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 13280 for NEMO/releases/r4.0/r4.0-HEAD/src – NEMO

Ignore:
Timestamp:
2020-07-09T13:53:42+02:00 (4 years ago)
Author:
smueller
Message:

Remedy for the defect described in ticket #2376

This modification comprises the merging of changesets [12591] and [12602] made in branch /NEMO/branches/2020/ticket2377 as a remedy for the corresponding defect in the trunk version of NEMO (see ticket #2377).

Location:
NEMO/releases/r4.0/r4.0-HEAD/src/OCE
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • NEMO/releases/r4.0/r4.0-HEAD/src/OCE/IOM/iom.F90

    r12859 r13280  
    515515        i = i + 1; fields(i)%vname="hbli";           fields(i)%grid="grid_N" 
    516516        i = i + 1; fields(i)%vname="wn";             fields(i)%grid="grid_N_3D" 
     517        i = i + 1; fields(i)%vname="a_fwb_b";        fields(i)%grid="grid_scalar" 
     518        i = i + 1; fields(i)%vname="a_fwb";          fields(i)%grid="grid_scalar" 
    517519 
    518520        IF( i-1 > max_rst_fields) THEN 
  • NEMO/releases/r4.0/r4.0-HEAD/src/OCE/IOM/iom_def.F90

    r13061 r13280  
    6767   END TYPE file_descriptor 
    6868   TYPE(file_descriptor), DIMENSION(jpmax_files), PUBLIC ::   iom_file !: array containing the info for all opened files 
    69    INTEGER, PARAMETER, PUBLIC                   :: max_rst_fields = 95 !: maximum number of restart variables defined in iom_set_rst_vars 
     69   INTEGER, PARAMETER, PUBLIC                   :: max_rst_fields = 97 !: maximum number of restart variables defined in iom_set_rst_vars 
    7070   TYPE, PUBLIC :: RST_FIELD   
    7171    CHARACTER(len=30) :: vname = "NO_NAME" ! names of variables in restart file 
  • NEMO/releases/r4.0/r4.0-HEAD/src/OCE/SBC/sbcfwb.F90

    r10570 r13280  
    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 
     
    116117         IF( kt == nit000 ) THEN                      ! initialisation 
    117118            !                                         ! Read the corrective factor on precipitations (fwfold) 
    118             CALL ctl_opn( inum, 'EMPave_old.dat', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 
    119             READ ( inum, "(24X,I8,2ES24.16)" ) iyear, a_fwb_b, a_fwb 
    120             CLOSE( inum ) 
     119            IF ( ln_rstart .AND. iom_varid( numror, 'a_fwb_b', ldstop = .FALSE. ) > 0     & 
     120               &           .AND. iom_varid( numror, 'a_fwb',   ldstop = .FALSE. ) > 0 ) THEN 
     121               IF(lwp) WRITE(numout,*) 'sbc_fwb : reading FW-budget adjustment from restart file' 
     122               CALL iom_get( numror, 'a_fwb_b', a_fwb_b, ldxios = lrxios ) 
     123               CALL iom_get( numror, 'a_fwb',   a_fwb,   ldxios = lrxios ) 
     124            ELSE 
     125               CALL ctl_opn( inum, 'EMPave_old.dat', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 
     126               READ ( inum, "(24X,I8,2ES24.16)" ) iyear, a_fwb_b, a_fwb 
     127               CLOSE( inum ) 
     128            END IF 
    121129            fwfold = a_fwb                            ! current year freshwater budget correction 
    122130            !                                         ! estimate from the previous year budget 
     
    125133            IF(lwp)WRITE(numout,*)'          year = ',iyear-1, ' freshwater budget read       = ', a_fwb 
    126134            IF(lwp)WRITE(numout,*)'          year = ',iyear-2, ' freshwater budget read       = ', a_fwb_b 
     135            ! 
     136            IF( lwxios ) THEN                         ! Activate output of restart variables 
     137               CALL iom_set_rstw_var_active( 'a_fwb_b' ) 
     138               CALL iom_set_rstw_var_active( 'a_fwb'   ) 
     139            END IF 
    127140         ENDIF    
    128141         !                                         ! Update fwfold if new year start 
     
    143156            qns(:,:) = qns(:,:) - zcoef * sst_m(:,:) * tmask(:,:,1) ! account for change to the heat budget due to fw correction 
    144157         ENDIF 
     158         ! Output restart information 
     159         IF( lrst_oce ) THEN 
     160            IF(lwp) WRITE(numout,*) 
     161            IF(lwp) WRITE(numout,*) 'sbc_fwb : writing FW-budget adjustment to ocean restart file at it = ', kt 
     162            IF(lwp) WRITE(numout,*) '~~~~' 
     163            IF( lwxios ) CALL iom_swap( cwxios_context ) 
     164            CALL iom_rstput( kt, nitrst, numrow, 'a_fwb_b', a_fwb_b, ldxios = lwxios ) 
     165            CALL iom_rstput( kt, nitrst, numrow, 'a_fwb',   a_fwb,   ldxios = lwxios ) 
     166            IF( lwxios ) CALL iom_swap( cxios_context  ) 
     167         END IF 
    145168         ! 
    146169         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.