New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 623 for trunk/NEMO/OPA_SRC/SBC/flxfwb.F90 – NEMO

Ignore:
Timestamp:
2007-02-26T18:26:08+01:00 (17 years ago)
Author:
opalod
Message:

nemo_v2_bugfix_024:RB: Use of ctlopn for all files (except for dimg and coupled part)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/SBC/flxfwb.F90

    r622 r623  
    8080 
    8181      !! * Local declarations 
     82      CHARACTER (len=32) ::   & 
     83         clname = 'EMPav.dat' 
    8284      INTEGER  ::   ji, jj, jk        ! dummy loop indices 
    83       INTEGER  ::   inum = 11         ! temporary logical unit 
     85      INTEGER  ::   inum              ! temporary logical unit 
    8486      INTEGER  ::   ikty              !  
    8587      REAL(wp) ::   & 
     
    194196      IF( kt == nitend ) THEN 
    195197 
    196          OPEN( inum, FILE='EMPave.dat' ) 
     198         CALL ctlopn( inum, clname, 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL',   & 
     199            &           1, numout, .FALSE., 0 ) 
    197200         WRITE(inum, "(24X,I8,2ES24.16)" ) nyear, a_fwb_b, a_fwb 
    198201         WRITE(inum,*) 
     
    249252      !!---------------------------------------------------------------------- 
    250253      !! * Local declarations 
    251       LOGICAL ::   llbon 
    252254      CHARACTER (len=32) ::   & 
    253255         clname = 'EMPave_old.dat' 
    254       INTEGER ::   inum = 11         ! temporary logical unit 
    255       INTEGER ::   iyear 
     256      INTEGER ::   inum, iyear 
    256257 
    257258      NAMELIST/namfwb/ ln_fwb  
     
    290291         !                                     ! ============================== 
    291292         ! Read the corrective factor on precipitations (empold) 
    292          INQUIRE( FILE=clname, EXIST=llbon ) 
    293          IF( llbon ) THEN 
    294             OPEN ( inum, FILE=clname) 
    295             READ ( inum, "(24X,I8,2ES24.16)" ) iyear, a_fwb_b, a_fwb 
    296             CLOSE( inum ) 
    297             empold = a_fwb                  ! current year freshwater budget correction 
    298             !                               ! estimate from the previous year budget 
    299             IF(lwp)WRITE(numout,*) 
    300             IF(lwp)WRITE(numout,*)'flx_fwb_init : year = ',iyear  , ' freshwater budget correction = ', empold 
    301             IF(lwp)WRITE(numout,*)'               year = ',iyear-1, ' freshwater budget read       = ', a_fwb 
    302             IF(lwp)WRITE(numout,*)'               year = ',iyear-2, ' freshwater budget read       = ', a_fwb_b 
    303          ELSE 
    304             WRITE(ctmp1,*)'flx_fwb_init : unable to read the file', clname 
    305             CALL ctl_stop( ctmp1 ) 
    306          ENDIF 
     293         CALL ctlopn( inum, clname, 'OLD', 'FORMATTED', 'SEQUENTIAL',   & 
     294            &           1, numout, .FALSE., 1 ) 
     295         READ ( inum, "(24X,I8,2ES24.16)" ) iyear, a_fwb_b, a_fwb 
     296         CLOSE( inum ) 
     297         empold = a_fwb                  ! current year freshwater budget correction 
     298         !                               ! estimate from the previous year budget 
     299         IF(lwp)WRITE(numout,*) 
     300         IF(lwp)WRITE(numout,*)'flx_fwb_init : year = ',iyear  , ' freshwater budget correction = ', empold 
     301         IF(lwp)WRITE(numout,*)'               year = ',iyear-1, ' freshwater budget read       = ', a_fwb 
     302         IF(lwp)WRITE(numout,*)'               year = ',iyear-2, ' freshwater budget read       = ', a_fwb_b 
    307303         !                                    ! ============================== 
    308304      ELSE                                    !      NO  budget correction  
Note: See TracChangeset for help on using the changeset viewer.