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 12660 for NEMO/branches/UKMO/NEMO_4.0.2_GO8_package/src/OCE/IOM/restart.F90 – NEMO

Ignore:
Timestamp:
2020-04-03T13:09:33+02:00 (4 years ago)
Author:
cguiavarch
Message:

UKMO/NEMO_4.0.2_GO8_package: copy over changes from NEMO_4.0.1_GO8_package branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/NEMO_4.0.2_GO8_package/src/OCE/IOM/restart.F90

    r12658 r12660  
    2727   USE in_out_manager  ! I/O manager 
    2828   USE iom             ! I/O module 
     29   USE ioipsl, ONLY : ju2ymds    ! for calendar 
    2930   USE diurnal_bulk 
    3031   USE lib_mpp         ! distribued memory computing library 
     
    5960      INTEGER, INTENT(in) ::   kt     ! ocean time-step 
    6061      !! 
     62      INTEGER             ::   iyear, imonth, iday 
     63      REAL (wp)           ::   zsec 
     64      REAL (wp)           ::   zfjulday 
    6165      CHARACTER(LEN=20)   ::   clkt     ! ocean time-step deine as a character 
    6266      CHARACTER(LEN=50)   ::   clname   ! ocean output restart file name 
     
    9094         IF( nitrst <= nitend .AND. nitrst > 0 ) THEN  
    9195            ! beware of the format used to write kt (default is i8.8, that should be large enough...) 
    92             IF( nitrst > 999999999 ) THEN   ;   WRITE(clkt, *       ) nitrst 
    93             ELSE                            ;   WRITE(clkt, '(i8.8)') nitrst 
     96            IF ( ln_rstdate ) THEN 
     97               zfjulday = fjulday + rdt / rday 
     98               IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday )   zfjulday = REAL(NINT(zfjulday),wp)   ! avoid truncation error 
     99               CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec )            
     100               WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday 
     101            ELSE 
     102               IF( nitrst > 999999999 ) THEN   ;   WRITE(clkt, *       ) nitrst 
     103               ELSE                            ;   WRITE(clkt, '(i8.8)') nitrst 
     104               ENDIF 
    94105            ENDIF 
    95106            ! create the file 
     
    173184                  END IF 
    174185      ENDIF 
     186                     CALL iom_rstput( kt, nitrst, numrow, 'neos'    , REAL(neos)      , ldxios = lwxios)   ! equation of state 
     187                     !CALL iom_rstput( kt, nitrst, numrow, 'neos'    , neos      , ktype = jp_i1, ldxios = lwxios)   ! equation of state 
     188 
    175189       
    176190      IF (ln_diurnal) CALL iom_rstput( kt, nitrst, numrow, 'Dsst', x_dsst, ldxios = lwxios )   
     
    249263      !!---------------------------------------------------------------------- 
    250264      REAL(wp) ::   zrdt 
     265      REAL(wp) ::   zeos 
    251266      INTEGER  ::   jk 
    252267      REAL(wp), DIMENSION(jpi, jpj, jpk) :: w3d 
     
    255270      CALL rst_read_open           ! open restart for reading (if not already opened) 
    256271 
     272      IF ( ln_rst_eos ) THEN 
     273         ! Check equation of state used is consistent with the restart 
     274         IF( iom_varid( numror, 'neos') == -1) THEN 
     275            CALL ctl_stop( 'restart, rst_read: variable neos not found. STOP check that the equations of state in the restart file and in the namelist nameos are consistent and use ln_rst_eos=F') 
     276         ELSE 
     277            CALL iom_get( numror, 'neos', zeos, ldxios = lrxios ) 
     278            IF ( INT(zeos) /= neos ) CALL ctl_stop( 'restart, rst_read: equation of state used in restart file differs from namelist nameos') 
     279         ENDIF 
     280      ENDIF 
     281 
    257282      ! Check dynamics and tracer time-step consistency and force Euler restart if changed 
    258       IF( iom_varid( numror, 'rdt', ldstop = .FALSE. ) > 0 )   THEN 
     283      IF( iom_varid( numror, 'rdt', ldstop = .FALSE. ) > 0 )   THEN  
    259284         CALL iom_get( numror, 'rdt', zrdt, ldxios = lrxios ) 
    260285         IF( zrdt /= rdt )   neuler = 0 
Note: See TracChangeset for help on using the changeset viewer.