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 1130 for trunk/NEMO/OPA_SRC/restart.F90 – NEMO

Ignore:
Timestamp:
2008-06-24T17:00:56+02:00 (16 years ago)
Author:
smasson
Message:

daymod bugfix and enhancement, see ticket #216

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/restart.F90

    r900 r1130  
    1818   USE oce             ! ocean dynamics and tracers  
    1919   USE phycst          ! physical constants 
    20    USE daymod          ! calendar 
    2120   USE cpl_oce, ONLY : lk_cpl              ! 
    2221   USE in_out_manager  ! I/O manager 
     
    8988            CASE DEFAULT         ;   WRITE(numout,*) '             open ocean restart NetCDF file: '//clname 
    9089            END SELECT 
    91             IF( kt == nitrst - 1 ) THEN   ;   WRITE(numout,*) '             kt = nitrst - 1 = ', kt,' date= ', ndastp 
    92             ELSE                          ;   WRITE(numout,*) '             kt = '             , kt,' date= ', ndastp 
     90            IF( kt == nitrst - 1 ) THEN   ;   WRITE(numout,*) '             kt = nitrst - 1 = ', kt 
     91            ELSE                          ;   WRITE(numout,*) '             kt = '             , kt 
    9392            ENDIF 
    9493         ENDIF 
     
    112111      INTEGER, INTENT(in) ::   kt   ! ocean time-step 
    113112      !!---------------------------------------------------------------------- 
    114  
    115       IF( kt == nitrst ) THEN 
    116          IF(lwp) WRITE(numout,*) 
    117          IF(lwp) WRITE(numout,*) 'rst_write : write oce restart file  kt =', kt 
    118          IF(lwp) WRITE(numout,*) '~~~~~~~'          
    119       ENDIF 
    120  
    121       ! calendar control 
    122       CALL iom_rstput( kt, nitrst, numrow, 'kt'     , REAL( kt    , wp) )   ! time-step  
    123       CALL iom_rstput( kt, nitrst, numrow, 'ndastp' , REAL( ndastp, wp) )   ! date 
    124       CALL iom_rstput( kt, nitrst, numrow, 'adatrj' , adatrj            )   ! number of elapsed days since 
    125113      !                                                                     ! the begining of the run [s] 
    126114      CALL iom_rstput( kt, nitrst, numrow, 'rdt'    , rdt               )   ! dynamics time step 
     
    179167      !!      for this last three records,  the previous characteristics  
    180168      !!      could be different with those used in the present run.  
    181       !! 
    182       !!   According to namelist parameter nrstdt, 
    183       !!       nrstdt = 0  no control on the date (nit000 is  arbitrary). 
    184       !!       nrstdt = 1  we verify that nit000 is equal to the last 
    185       !!                   time step of previous run + 1. 
    186       !!       In both those options, the  exact duration of the experiment 
    187       !!       since the beginning (cumulated duration of all previous restart runs) 
    188       !!       is not stored in the restart and is assumed to be (nit000-1)*rdt. 
    189       !!       This is valid is the time step has remained constant. 
    190       !! 
    191       !!       nrstdt = 2  the duration of the experiment in days (adatrj) 
    192       !!                    has been stored in the restart file. 
    193       !!---------------------------------------------------------------------- 
    194       REAL(wp) ::   zkt, zrdt, zrdttra1, zndastp 
     169      !!---------------------------------------------------------------------- 
     170      REAL(wp) ::   zrdt, zrdttra1 
    195171      !!---------------------------------------------------------------------- 
    196172 
     
    198174         WRITE(numout,*) 
    199175         SELECT CASE ( jprstlib ) 
    200          CASE ( jpnf90 ) 
    201             WRITE(numout,*) 'rst_read : read oce NetCDF restart file' 
    202          CASE ( jprstdimg ) 
    203             WRITE(numout,*) 'rst_read : read oce binary restart file' 
     176         CASE ( jpnf90    )   ;   WRITE(numout,*) 'rst_read : read oce NetCDF restart file' 
     177         CASE ( jprstdimg )   ;   WRITE(numout,*) 'rst_read : read oce binary restart file' 
    204178         END SELECT 
    205179         WRITE(numout,*) '~~~~~~~~' 
    206  
    207          WRITE(numout,*) ' *** Info on the present job : ' 
    208          WRITE(numout,*) '   time-step           : ', nit000 
    209          WRITE(numout,*) '   date ndastp         : ', ndastp 
    210          WRITE(numout,*) 
    211          WRITE(numout,*) ' *** restart option' 
    212          SELECT CASE ( nrstdt ) 
    213          CASE ( 0 )  
    214             WRITE(numout,*) ' nrstdt = 0 no control of nit000' 
    215          CASE ( 1 )  
    216             WRITE(numout,*) ' nrstdt = 1 we control the date of nit000' 
    217          CASE ( 2 ) 
    218             WRITE(numout,*) ' nrstdt = 2 the date adatrj is read in restart file' 
    219          CASE DEFAULT 
    220             WRITE(numout,*) '  ===>>>> nrstdt not equal 0, 1 or 2 : no control of the date' 
    221             WRITE(numout,*) '  =======                  =========' 
    222          END SELECT 
    223          WRITE(numout,*) 
    224180      ENDIF 
    225181 
    226182      CALL iom_open( 'restart', numror, kiolib = jprstlib ) 
    227183 
    228       ! Calendar informations 
    229       CALL iom_get( numror, 'kt'     , zkt      )   ! time-step  
    230       CALL iom_get( numror, 'ndastp' , zndastp  )   ! date 
    231       IF(lwp) THEN 
    232          WRITE(numout,*) 
    233          WRITE(numout,*) ' *** Info on the restart file read : ' 
    234          WRITE(numout,*) '   time-step           : ', NINT( zkt ) 
    235          WRITE(numout,*) '   date ndastp         : ', NINT( zndastp ) 
    236          WRITE(numout,*) 
    237       ENDIF 
    238       ! Control of date 
    239       IF( nit000 - NINT( zkt )  /= 1 .AND. nrstdt /= 0 ) & 
    240            & CALL ctl_stop( ' ===>>>> : problem with nit000 for the restart', & 
    241            & ' verify the restart file or rerun with nrstdt = 0 (namelist)' ) 
    242       ! re-initialisation of  adatrj0 
    243       adatrj0 = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday 
    244       IF ( nrstdt == 2 ) THEN 
    245          ! by default ndatsp has been set to ndate0 in dom_nam 
    246          ! ndate0 has been read in the namelist (standard OPA 8) 
    247          ! here when nrstdt=2 we keep the  final date of previous run 
    248          ndastp = NINT( zndastp ) 
    249          CALL iom_get( numror, 'adatrj', adatrj )   ! number of elapsed days since the begining of last run 
    250       ENDIF 
    251184      ! Check dynamics and tracer time-step consistency and force Euler restart if changed 
    252185      IF( iom_varid( numror, 'rdt', ldstop = .FALSE. ) > 0 )   THEN 
     
    258191         IF( zrdttra1 /= rdttra(1) )   neuler = 0 
    259192      ENDIF 
    260       ! 
    261193      !                                                       ! Read prognostic variables 
    262194      CALL iom_get( numror, jpdom_autoglo, 'ub'   , ub    )        ! before i-component velocity 
Note: See TracChangeset for help on using the changeset viewer.