Changeset 1130 for trunk/NEMO/OPA_SRC/restart.F90
- Timestamp:
- 2008-06-24T17:00:56+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMO/OPA_SRC/restart.F90
r900 r1130 18 18 USE oce ! ocean dynamics and tracers 19 19 USE phycst ! physical constants 20 USE daymod ! calendar21 20 USE cpl_oce, ONLY : lk_cpl ! 22 21 USE in_out_manager ! I/O manager … … 89 88 CASE DEFAULT ; WRITE(numout,*) ' open ocean restart NetCDF file: '//clname 90 89 END SELECT 91 IF( kt == nitrst - 1 ) THEN ; WRITE(numout,*) ' kt = nitrst - 1 = ', kt ,' date= ', ndastp92 ELSE ; WRITE(numout,*) ' kt = ' , kt ,' date= ', ndastp90 IF( kt == nitrst - 1 ) THEN ; WRITE(numout,*) ' kt = nitrst - 1 = ', kt 91 ELSE ; WRITE(numout,*) ' kt = ' , kt 93 92 ENDIF 94 93 ENDIF … … 112 111 INTEGER, INTENT(in) :: kt ! ocean time-step 113 112 !!---------------------------------------------------------------------- 114 115 IF( kt == nitrst ) THEN116 IF(lwp) WRITE(numout,*)117 IF(lwp) WRITE(numout,*) 'rst_write : write oce restart file kt =', kt118 IF(lwp) WRITE(numout,*) '~~~~~~~'119 ENDIF120 121 ! calendar control122 CALL iom_rstput( kt, nitrst, numrow, 'kt' , REAL( kt , wp) ) ! time-step123 CALL iom_rstput( kt, nitrst, numrow, 'ndastp' , REAL( ndastp, wp) ) ! date124 CALL iom_rstput( kt, nitrst, numrow, 'adatrj' , adatrj ) ! number of elapsed days since125 113 ! ! the begining of the run [s] 126 114 CALL iom_rstput( kt, nitrst, numrow, 'rdt' , rdt ) ! dynamics time step … … 179 167 !! for this last three records, the previous characteristics 180 168 !! 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 195 171 !!---------------------------------------------------------------------- 196 172 … … 198 174 WRITE(numout,*) 199 175 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' 204 178 END SELECT 205 179 WRITE(numout,*) '~~~~~~~~' 206 207 WRITE(numout,*) ' *** Info on the present job : '208 WRITE(numout,*) ' time-step : ', nit000209 WRITE(numout,*) ' date ndastp : ', ndastp210 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 DEFAULT220 WRITE(numout,*) ' ===>>>> nrstdt not equal 0, 1 or 2 : no control of the date'221 WRITE(numout,*) ' ======= ========='222 END SELECT223 WRITE(numout,*)224 180 ENDIF 225 181 226 182 CALL iom_open( 'restart', numror, kiolib = jprstlib ) 227 183 228 ! Calendar informations229 CALL iom_get( numror, 'kt' , zkt ) ! time-step230 CALL iom_get( numror, 'ndastp' , zndastp ) ! date231 IF(lwp) THEN232 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 ENDIF238 ! Control of date239 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 adatrj0243 adatrj0 = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday244 IF ( nrstdt == 2 ) THEN245 ! by default ndatsp has been set to ndate0 in dom_nam246 ! ndate0 has been read in the namelist (standard OPA 8)247 ! here when nrstdt=2 we keep the final date of previous run248 ndastp = NINT( zndastp )249 CALL iom_get( numror, 'adatrj', adatrj ) ! number of elapsed days since the begining of last run250 ENDIF251 184 ! Check dynamics and tracer time-step consistency and force Euler restart if changed 252 185 IF( iom_varid( numror, 'rdt', ldstop = .FALSE. ) > 0 ) THEN … … 258 191 IF( zrdttra1 /= rdttra(1) ) neuler = 0 259 192 ENDIF 260 !261 193 ! ! Read prognostic variables 262 194 CALL iom_get( numror, jpdom_autoglo, 'ub' , ub ) ! before i-component velocity
Note: See TracChangeset
for help on using the changeset viewer.