Ignore:
Timestamp:
07/10/14 13:11:52 (10 years ago)
Author:
ymipsl
Message:

Find automatically a free unit when trying to open a file.
Unit 42 has a big chance to be connected to an other file....

YM

Location:
codes/icosagcm/trunk/src
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • codes/icosagcm/trunk/src/disvert.f90

    r207 r210  
    5050    ap_bp_present=.TRUE. 
    5151    CALL getin("disvert",def) 
    52     PRINT*,"def --> ",def 
     52 
    5353    SELECT CASE (TRIM(def)) 
    5454      CASE('none') 
     
    9999        bp=>bp_ncarl30 
    100100        presnivs=>presnivs_ncarl30 
    101         PRINT*,"ap --> ",ap 
    102         PRINT*,"ap_ncarl30 --> ",ap_ncarl30 
    103101      CASE default 
    104102        IF (is_mpi_root) PRINT*,'Bad selector for variable disvert : <', TRIM(def),"> options are <std>, <ncar>, <ncarl30>"  
  • codes/icosagcm/trunk/src/disvert_apbp.f90

    r208 r210  
    2828  USE omp_para, ONLY: omp_in_parallel 
    2929  USE transfert_omp_mod, ONLY: bcast_omp 
     30  USE free_unit_mod, ONLY : free_unit 
    3031  IMPLICIT NONE 
    3132  REAL(rstd),INTENT(OUT) :: ap(:) 
    3233  REAL(rstd),INTENT(OUT) :: bp(:) 
    3334  REAL(rstd),INTENT(OUT) :: presnivs(:) 
    34    
     35  INTEGER :: unit 
    3536  CHARACTER(len=255) :: filename 
    3637  INTEGER :: l,ok 
     
    4142     
    4243!$OMP MASTER 
     44    unit=free_unit() 
    4345    OPEN(unit,file=filename,status="old",action="read",iostat=ok) 
    4446    IF (ok/=0) THEN 
Note: See TracChangeset for help on using the changeset viewer.