Changeset 12477
- Timestamp:
- 2020-02-27T13:20:58+01:00 (3 years ago)
- Location:
- NEMO/branches/UKMO/r12083_restart_datestamp
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/UKMO/r12083_restart_datestamp/cfgs/SHARED/namelist_ref
r12083 r12477 42 42 nn_leapy = 0 ! Leap year calendar (1) or not (0) 43 43 ln_rstart = .false. ! start from rest (F) or from a restart file (T) 44 ln_rstdate = .false. ! add a datestamp in the restart file name 44 45 nn_euler = 1 ! = 0 : start with forward time step if ln_rstart=T 45 46 nn_rstctl = 0 ! restart control ==> activated only if ln_rstart=T -
NEMO/branches/UKMO/r12083_restart_datestamp/src/ICE/icerst.F90
r11715 r12477 23 23 USE in_out_manager ! I/O manager 24 24 USE iom ! I/O manager library 25 USE ioipsl , ONLY : ju2ymds ! for calendar 25 26 USE lib_mpp ! MPP library 26 27 USE lib_fortran ! fortran utilities (glob_sum + no signed zero) … … 46 47 !! ** purpose : open restart file 47 48 !!---------------------------------------------------------------------- 49 INTEGER :: iyear, imonth, iday 50 REAL (wp) :: zsec 51 REAL (wp) :: zfjulday !! 48 52 INTEGER, INTENT(in) :: kt ! number of iteration 49 53 ! … … 63 67 IF( nitrst <= nitend .AND. nitrst > 0 ) THEN 64 68 ! beware of the format used to write kt (default is i8.8, that should be large enough...) 65 IF( nitrst > 99999999 ) THEN ; WRITE(clkt, * ) nitrst 66 ELSE ; WRITE(clkt, '(i8.8)') nitrst 69 IF ( ln_rstdate ) THEN 70 zfjulday = fjulday + rdt / rday 71 IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday ) zfjulday = REAL(NINT(zfjulday),wp) ! avoid truncation error 72 CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec ) 73 WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday 74 ELSE 75 IF( nitrst > 999999999 ) THEN 76 WRITE(clkt, * ) nitrst 77 ELSE 78 WRITE(clkt, '(i8.8)') nitrst 79 ENDIF 67 80 ENDIF 68 81 ! create the file -
NEMO/branches/UKMO/r12083_restart_datestamp/src/OCE/DOM/daymod.F90
r11715 r12477 282 282 ENDIF 283 283 284 IF( .NOT. l_offline ) CALL rst_opn( kt )! Open the restart file if needed and control lrst_oce284 IF( .NOT. l_offline ) CALL rst_opn( kt, ndastp ) ! Open the restart file if needed and control lrst_oce 285 285 IF( lrst_oce ) CALL day_rst( kt, 'WRITE' ) ! write day restart information 286 286 ! -
NEMO/branches/UKMO/r12083_restart_datestamp/src/OCE/DOM/domain.F90
r11715 r12477 292 292 & nn_it000, nn_itend , nn_date0 , nn_time0 , nn_leapy , nn_istate , & 293 293 & nn_stock, nn_write , ln_mskland , ln_clobber , nn_chunksz, nn_euler , & 294 & ln_cfmeta, ln_iscpl, ln_xios_read, nn_wxios 294 & ln_cfmeta, ln_iscpl, ln_xios_read, nn_wxios , ln_rstdate 295 295 NAMELIST/namdom/ ln_linssh, rn_isfhmin, rn_rdt, rn_atfp, ln_crs, ln_meshmask 296 296 #if defined key_netcdf4 … … 323 323 WRITE(numout,*) ' restart output directory cn_ocerst_outdir= ', TRIM( cn_ocerst_outdir ) 324 324 WRITE(numout,*) ' restart logical ln_rstart = ', ln_rstart 325 WRITE(numout,*) ' use date in restart name ln_rstdate = ', ln_rstdate 325 326 WRITE(numout,*) ' start with forward time step nn_euler = ', nn_euler 326 327 WRITE(numout,*) ' control of time step nn_rstctl = ', nn_rstctl -
NEMO/branches/UKMO/r12083_restart_datestamp/src/OCE/IOM/in_out_manager.F90
r11715 r12477 78 78 INTEGER :: nitend !: index of the last time step 79 79 INTEGER :: ndate0 !: initial calendar date aammjj 80 LOGICAL :: ln_rstdate = .FALSE. !: Use calendar date rather than time-step in restart 80 81 INTEGER :: nleapy !: Leap year calendar flag (0/1 or 30) 81 82 INTEGER :: ninist !: initial state output flag (0/1) -
NEMO/branches/UKMO/r12083_restart_datestamp/src/OCE/IOM/restart.F90
r11715 r12477 27 27 USE in_out_manager ! I/O manager 28 28 USE iom ! I/O module 29 USE ioipsl, ONLY : ju2ymds ! for calendar 29 30 USE diurnal_bulk 31 USE sbc_oce ! for icesheet freshwater input variables 30 32 USE lib_mpp ! distribued memory computing library 31 33 … … 47 49 CONTAINS 48 50 49 SUBROUTINE rst_opn( kt )51 SUBROUTINE rst_opn( kt, ndastp ) 50 52 !!--------------------------------------------------------------------- 51 53 !! *** ROUTINE rst_opn *** … … 58 60 !!---------------------------------------------------------------------- 59 61 INTEGER, INTENT(in) :: kt ! ocean time-step 62 INTEGER, INTENT(in) :: ndastp ! ocean date 60 63 !! 64 INTEGER :: iyear, imonth, iday 65 REAL (wp) :: zsec 66 REAL (wp) :: zfjulday !! 61 67 CHARACTER(LEN=20) :: clkt ! ocean time-step deine as a character 62 68 CHARACTER(LEN=50) :: clname ! ocean output restart file name 63 CHARACTER( lc):: clpath ! full path to ocean output restart file69 CHARACTER(LEN=150) :: clpath ! full path to ocean output restart file 64 70 CHARACTER(LEN=52) :: clpname ! ocean output restart file name including prefix for AGRIF 65 71 CHARACTER(LEN=256) :: clinfo ! info character … … 90 96 IF( nitrst <= nitend .AND. nitrst > 0 ) THEN 91 97 ! 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 98 IF ( ln_rstdate ) THEN 99 zfjulday = fjulday + rdt / rday 100 IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday ) zfjulday = REAL(NINT(zfjulday),wp) ! avoid truncation error 101 CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec ) 102 WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday 103 ELSE 104 IF( nitrst > 999999999 ) THEN 105 WRITE(clkt, * ) nitrst 106 ELSE 107 WRITE(clkt, '(i8.8)') nitrst 108 ENDIF 94 109 ENDIF 95 110 ! create the file -
NEMO/branches/UKMO/r12083_restart_datestamp/src/TOP/trcrst.F90
r11715 r12477 20 20 !!---------------------------------------------------------------------- 21 21 USE oce_trc 22 USE dom_oce, ONLY: fjulday 23 USE phycst, ONLY: rday 24 USE in_out_manager, ONLY: ln_rstdate 22 25 USE trc 23 26 USE iom 27 USE ioipsl, ONLY: ju2ymds 24 28 USE daymod 25 29 USE lib_mpp … … 47 51 !!---------------------------------------------------------------------- 48 52 INTEGER, INTENT(in) :: kt ! number of iteration 53 INTEGER :: iyear, imonth, iday 54 REAL (wp) :: zsec 55 REAL (wp) :: zfjulday 49 56 ! 50 57 CHARACTER(LEN=20) :: clkt ! ocean time-step define as a character … … 78 85 ! we open and define the tracer restart file one tracer time step before writing the data (-> at nitrst - 2*nn_dttrc + 1) 79 86 ! except if we write tracer restart files every tracer time step or if a tracer restart file was writen at nitend - 2*nn_dttrc + 1 80 IF( kt == nitrst - 2*nn_dttrc .OR. nn_stock == nn_dttrc .OR. ( kt == nitend - nn_dttrc .AND. .NOT. lrst_trc ) ) THEN 81 ! beware of the format used to write kt (default is i8.8, that should be large enough) 82 IF( nitrst > 1.0e9 ) THEN ; WRITE(clkt,* ) nitrst 83 ELSE ; WRITE(clkt,'(i8.8)') nitrst 87 IF( kt == nitrst - 2*nn_dttrc + 1 .OR. nstock == nn_dttrc .OR. ( kt == nitend - nn_dttrc .AND. .NOT. lrst_trc ) ) THEN 88 if ( ln_rstdate ) THEN 89 zfjulday = fjulday + rdttrc(1) / rday 90 IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday ) zfjulday = REAL(NINT(zfjulday),wp) ! avoid truncation error 91 CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec ) 92 WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday 93 ELSE 94 ! beware of the format used to write kt (default is i8.8, that should be large enough) 95 IF( nitrst > 1.0e9 ) THEN ; WRITE(clkt,* ) nitrst 96 ELSE ; WRITE(clkt,'(i8.8)') nitrst 97 ENDIF 84 98 ENDIF 85 99 ! create the file
Note: See TracChangeset
for help on using the changeset viewer.