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 895 for trunk/NEMO/OPA_SRC/SBC/sbcfwb.F90 – NEMO

Ignore:
Timestamp:
2008-04-21T17:32:02+02:00 (16 years ago)
Author:
rblod
Message:

Fix small bugs in sea-ice (previous commit) and old flyspray: 189, 185, 161

File:
1 edited

Legend:

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

    r888 r895  
    6060      INTEGER, INTENT( in ) ::   kn_fwb   ! ocean time-step index 
    6161      !! 
    62       INTEGER  ::   inum = 11             ! temporary logical unit 
     62      INTEGER  ::   inum                  ! temporary logical unit 
    6363      INTEGER  ::   ikty, iyear           !  
    6464      LOGICAL  ::   llbon 
    65       CHARACTER (len=32) ::   clname = 'EMPave_old.dat' 
     65      CHARACTER (len=32) ::   clname  
    6666      REAL(wp) ::   z_emp                 ! temporary scalars 
    6767      !!---------------------------------------------------------------------- 
     
    9898         IF( kt == nit000 ) THEN 
    9999            ! Read the corrective factor on precipitations (empold) 
    100             INQUIRE( FILE=clname, EXIST=llbon ) 
    101             IF( llbon ) THEN 
    102                OPEN ( inum, FILE=clname) 
    103                READ ( inum, "(24X,I8,2ES24.16)" ) iyear, a_fwb_b, a_fwb 
    104                CLOSE( inum ) 
    105                empold = a_fwb                  ! current year freshwater budget correction 
    106                !                               ! estimate from the previous year budget 
    107                IF(lwp)WRITE(numout,*) 
    108                IF(lwp)WRITE(numout,*)'sbc_fwb : year = ',iyear  , ' freshwater budget correction = ', empold 
    109                IF(lwp)WRITE(numout,*)'          year = ',iyear-1, ' freshwater budget read       = ', a_fwb 
    110                IF(lwp)WRITE(numout,*)'          year = ',iyear-2, ' freshwater budget read       = ', a_fwb_b 
    111             ELSE 
    112                WRITE(ctmp1,*)'sbc_fwb : unable to read the file', clname 
    113                CALL ctl_stop( ctmp1 ) 
    114             ENDIF 
    115          ENDIF 
     100            clname = 'EMPave_old.dat' 
     101            CALL ctlopn( inum, clname, 'OLD', 'FORMATTED', 'SEQUENTIAL',   & 
     102               &           1, numout, .FALSE., 1 ) 
     103 
     104            READ ( inum, "(24X,I8,2ES24.16)" ) iyear, a_fwb_b, a_fwb 
     105            CLOSE( inum ) 
     106            empold = a_fwb                  ! current year freshwater budget correction 
     107            !                               ! estimate from the previous year budget 
     108            IF(lwp)WRITE(numout,*) 
     109            IF(lwp)WRITE(numout,*)'sbc_fwb : year = ',iyear  , ' freshwater budget correction = ', empold 
     110            IF(lwp)WRITE(numout,*)'          year = ',iyear-1, ' freshwater budget read       = ', a_fwb 
     111            IF(lwp)WRITE(numout,*)'          year = ',iyear-2, ' freshwater budget read       = ', a_fwb_b 
     112         ENDIF    
    116113         !  
    117114         ! Update empold if new year start 
     
    134131         ! 
    135132         ! save empold value in a file 
    136          IF( kt == nitend ) THEN 
    137             OPEN( inum, FILE='EMPave.dat' ) 
     133         IF( kt == nitend .AND. lwp ) THEN 
     134            clname = 'EMPav.dat'     
     135            CALL ctlopn( inum, clname, 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL',   & 
     136               &           1, numout, .FALSE., 0 ) 
    138137            WRITE(inum, "(24X,I8,2ES24.16)" ) nyear, a_fwb_b, a_fwb 
    139138         ENDIF 
Note: See TracChangeset for help on using the changeset viewer.