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 12591 for NEMO/branches/2020/ticket2377/src – NEMO

Ignore:
Timestamp:
2020-03-24T11:21:58+01:00 (4 years ago)
Author:
smueller
Message:

Addition of standard restart capability without XIOS support to option 2 of the freshwater-budget adjustment mechanism as a remedy for the defect reported in ticket #2377

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/ticket2377/src/OCE/SBC/sbcfwb.F90

    r12489 r12591  
    2424   ! 
    2525   USE in_out_manager ! I/O manager 
     26   USE iom            ! IOM 
    2627   USE lib_mpp        ! distribued memory computing library 
    2728   USE timing         ! Timing 
     
    115116         IF( kt == nit000 ) THEN                      ! initialisation 
    116117            !                                         ! Read the corrective factor on precipitations (fwfold) 
    117             CALL ctl_opn( inum, 'EMPave_old.dat', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 
    118             READ ( inum, "(24X,I8,2ES24.16)" ) iyear, a_fwb_b, a_fwb 
    119             CLOSE( inum ) 
     118            IF ( ln_rstart .AND. iom_varid( numror, 'a_fwb_b', ldstop = .FALSE. ) > 0     & 
     119               &           .AND. iom_varid( numror, 'a_fwb',   ldstop = .FALSE. ) > 0 ) THEN 
     120               IF(lwp) WRITE(numout,*) 'sbc_fwb : reading FW-budget adjustment from restart file' 
     121               CALL iom_get( numror, 'a_fwb_b', a_fwb_b ) 
     122               CALL iom_get( numror, 'a_fwb',   a_fwb   ) 
     123            ELSE 
     124               CALL ctl_opn( inum, 'EMPave_old.dat', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 
     125               READ ( inum, "(24X,I8,2ES24.16)" ) iyear, a_fwb_b, a_fwb 
     126               CLOSE( inum ) 
     127            END IF 
    120128            fwfold = a_fwb                            ! current year freshwater budget correction 
    121129            !                                         ! estimate from the previous year budget 
     
    142150            qns(:,:) = qns(:,:) - zcoef * sst_m(:,:) * tmask(:,:,1) ! account for change to the heat budget due to fw correction 
    143151         ENDIF 
     152         ! Output restart information 
     153         IF( lrst_oce ) THEN 
     154            IF(lwp) WRITE(numout,*) 
     155            IF(lwp) WRITE(numout,*) 'sbc_fwb : writing FW-budget adjustment to ocean restart file at it = ', kt 
     156            IF(lwp) WRITE(numout,*) '~~~~' 
     157            CALL iom_rstput( kt, nitrst, numrow, 'a_fwb_b', a_fwb_b ) 
     158            CALL iom_rstput( kt, nitrst, numrow, 'a_fwb',   a_fwb   ) 
     159         END IF 
    144160         ! 
    145161         IF( kt == nitend .AND. lwm ) THEN            ! save fwfold value in a file (only one required) 
Note: See TracChangeset for help on using the changeset viewer.