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 15264 for NEMO/branches/2020/ticket2487/src/OCE/SBC/sbcfwb.F90 – NEMO

Ignore:
Timestamp:
2021-09-16T12:42:20+02:00 (3 years ago)
Author:
smueller
Message:

Synchronizing with /NEMO/releases/r4.0/r4.0-HEAD@15236 (ticket #2487)

Location:
NEMO/branches/2020/ticket2487
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/ticket2487

    • Property svn:externals
      •  

        old new  
        1 ^/utils/build/arch@12130      arch 
        2 ^/utils/build/makenemo@12191  makenemo 
        3 ^/utils/build/mk@11662        mk 
        4 ^/utils/tools_r4.0-HEAD@12672 tools 
        5 ^/vendors/AGRIF/dev@10586     ext/AGRIF 
        6 ^/vendors/FCM@10134           ext/FCM 
        7 ^/vendors/IOIPSL@9655         ext/IOIPSL 
         1^/utils/build/arch@12130        arch 
         2^/utils/build/makenemo@12191    makenemo 
         3^/utils/build/mk@11662          mk 
         4^/utils/tools_r4.0-HEAD@14974  tools 
         5^/vendors/AGRIF/stable@14105    ext/AGRIF 
         6^/vendors/FCM@10134             ext/FCM 
         7^/vendors/IOIPSL@9655           ext/IOIPSL 
        88 
        99# SETTE mapping (inactive) 
  • NEMO/branches/2020/ticket2487/src/OCE/SBC/sbcfwb.F90

    r13301 r15264  
    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 
     
    101102         snwice_mass_b(:,:) = 0.e0               ! no sea-ice model is being used : no snow+ice mass 
    102103         snwice_mass  (:,:) = 0.e0 
     104         snwice_fmass (:,:) = 0.e0 
    103105#endif 
    104106         ! 
     
    116118            emp(:,:) = emp(:,:) - z_fwfprv(1)        * tmask(:,:,1) 
    117119            qns(:,:) = qns(:,:) + zcoef * sst_m(:,:) * tmask(:,:,1) ! account for change to the heat budget due to fw correction 
     120            ! outputs 
     121            IF( iom_use('hflx_fwb_cea') )  CALL iom_put( 'hflx_fwb_cea', zcoef * sst_m(:,:) * tmask(:,:,1) ) 
     122            IF( iom_use('vflx_fwb_cea') )  CALL iom_put( 'vflx_fwb_cea', z_fwfprv(1)        * tmask(:,:,1) ) 
    118123         ENDIF 
    119124         ! 
     
    122127         IF( kt == nit000 ) THEN                      ! initialisation 
    123128            !                                         ! Read the corrective factor on precipitations (fwfold) 
    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 ) 
     129            IF ( ln_rstart .AND. iom_varid( numror, 'a_fwb_b', ldstop = .FALSE. ) > 0     & 
     130               &           .AND. iom_varid( numror, 'a_fwb',   ldstop = .FALSE. ) > 0 ) THEN 
     131               IF(lwp) WRITE(numout,*) 'sbc_fwb : reading FW-budget adjustment from restart file' 
     132               CALL iom_get( numror, 'a_fwb_b', a_fwb_b, ldxios = lrxios ) 
     133               CALL iom_get( numror, 'a_fwb',   a_fwb,   ldxios = lrxios ) 
     134            ELSE 
     135               CALL ctl_opn( inum, 'EMPave_old.dat', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 
     136               READ ( inum, "(24X,I8,2ES24.16)" ) iyear, a_fwb_b, a_fwb 
     137               CLOSE( inum ) 
     138            END IF 
    127139            fwfold = a_fwb                            ! current year freshwater budget correction 
    128140            !                                         ! estimate from the previous year budget 
     
    131143            IF(lwp)WRITE(numout,*)'          year = ',iyear-1, ' freshwater budget read       = ', a_fwb 
    132144            IF(lwp)WRITE(numout,*)'          year = ',iyear-2, ' freshwater budget read       = ', a_fwb_b 
     145            ! 
     146            IF( lwxios ) THEN                         ! Activate output of restart variables 
     147               CALL iom_set_rstw_var_active( 'a_fwb_b' ) 
     148               CALL iom_set_rstw_var_active( 'a_fwb'   ) 
     149            END IF 
    133150         ELSEIF( ( nday_year == 1 ) .AND. ( nsec_day == NINT( 0.5_wp * rdt ) ) ) THEN   ! Update fwfold at the start of 1 January 
    134151            a_fwb_b = a_fwb                           ! mean sea level taking into account the ice+snow 
     
    144161            emp(:,:) = emp(:,:) + fwfold             * tmask(:,:,1) 
    145162            qns(:,:) = qns(:,:) - zcoef * sst_m(:,:) * tmask(:,:,1) ! account for change to the heat budget due to fw correction 
    146          ENDIF 
     163            ! outputs 
     164            IF( iom_use('hflx_fwb_cea') )  CALL iom_put( 'hflx_fwb_cea', -zcoef * sst_m(:,:) * tmask(:,:,1) ) 
     165            IF( iom_use('vflx_fwb_cea') )  CALL iom_put( 'vflx_fwb_cea', -fwfold             * tmask(:,:,1) ) 
     166         ENDIF 
     167         ! Output restart information 
     168         IF( lrst_oce ) THEN 
     169            IF(lwp) WRITE(numout,*) 
     170            IF(lwp) WRITE(numout,*) 'sbc_fwb : writing FW-budget adjustment to ocean restart file at it = ', kt 
     171            IF(lwp) WRITE(numout,*) '~~~~' 
     172            IF( lwxios ) CALL iom_swap( cwxios_context ) 
     173            CALL iom_rstput( kt, nitrst, numrow, 'a_fwb_b', a_fwb_b, ldxios = lwxios ) 
     174            CALL iom_rstput( kt, nitrst, numrow, 'a_fwb',   a_fwb,   ldxios = lwxios ) 
     175            IF( lwxios ) CALL iom_swap( cxios_context  ) 
     176         END IF 
    147177         ! 
    148178         IF( kt == nitend .AND. lwm ) THEN            ! save fwfold value in a file (only one required) 
     
    188218            qns(:,:) = qns(:,:) - zerp_cor(:,:) * rcp * sst_m(:,:)  ! account for change to the heat budget due to fw correction 
    189219            erp(:,:) = erp(:,:) + zerp_cor(:,:) 
     220            ! outputs 
     221            IF( iom_use('hflx_fwb_cea') )  CALL iom_put( 'hflx_fwb_cea', -zerp_cor(:,:) * rcp * sst_m(:,:) ) 
     222            IF( iom_use('vflx_fwb_cea') )  CALL iom_put( 'vflx_fwb_cea', -zerp_cor(:,:) ) 
    190223            ! 
    191224            IF( nprint == 1 .AND. lwp ) THEN                   ! control print 
Note: See TracChangeset for help on using the changeset viewer.