Changeset 10765
- Timestamp:
- 2019-03-15T13:14:30+01:00 (6 years ago)
- Location:
- NEMO/branches/UKMO/r8395_restart_datestamp/NEMOGCM
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/UKMO/r8395_restart_datestamp/NEMOGCM/CONFIG/SHARED/namelist_ref
r10758 r10765 34 34 nn_leapy = 0 ! Leap year calendar (1) or not (0) 35 35 ln_rstart = .false. ! start from rest (F) or from a restart file (T) 36 ln_rstdate = .false. ! add a datestamp in the restart file name 36 37 nn_euler = 1 ! = 0 : start with forward time step if ln_rstart=T 37 38 nn_rstctl = 0 ! restart control ==> activated only if ln_rstart=T -
NEMO/branches/UKMO/r8395_restart_datestamp/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90
r10758 r10765 22 22 USE sbc_ice ! Surface boundary condition: ice fields 23 23 USE in_out_manager ! I/O manager 24 USE ioipsl , ONLY : ju2ymds ! for calendar 24 25 USE iom ! I/O library 25 26 USE lib_mpp ! MPP library … … 51 52 !! ** purpose : output of sea-ice variable in a netcdf file 52 53 !!---------------------------------------------------------------------- 54 INTEGER :: iyear, imonth, iday 55 REAL (wp) :: zsec 56 REAL (wp) :: zfjulday !! 53 57 INTEGER, INTENT(in) :: kt ! number of iteration 54 58 ! … … 67 71 IF( nitrst <= nitend .AND. nitrst > 0 ) THEN 68 72 ! beware of the format used to write kt (default is i8.8, that should be large enough...) 69 IF( nitrst > 99999999 ) THEN ; WRITE(clkt, * ) nitrst 70 ELSE ; WRITE(clkt, '(i8.8)') nitrst 73 IF ( ln_rstdate ) THEN 74 zfjulday = fjulday + rdt / rday 75 IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday ) zfjulday = REAL(NINT(zfjulday),wp) ! avoid truncation error 76 CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec ) 77 WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday 78 ELSE 79 IF( nitrst > 999999999 ) THEN 80 WRITE(clkt, * ) nitrst 81 ELSE 82 WRITE(clkt, '(i8.8)') nitrst 83 ENDIF 71 84 ENDIF 72 85 ! create the file -
NEMO/branches/UKMO/r8395_restart_datestamp/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90
r10758 r10765 274 274 ENDIF 275 275 276 IF( .NOT. l_offline ) CALL rst_opn( kt )! Open the restart file if needed and control lrst_oce276 IF( .NOT. l_offline ) CALL rst_opn( kt, ndastp ) ! Open the restart file if needed and control lrst_oce 277 277 IF( lrst_oce ) CALL day_rst( kt, 'WRITE' ) ! write day restart information 278 278 ! -
NEMO/branches/UKMO/r8395_restart_datestamp/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90
r10758 r10765 281 281 !!---------------------------------------------------------------------- 282 282 USE ioipsl 283 NAMELIST/namrun/ cn_ocerst_indir, cn_ocerst_outdir, nn_stocklist, ln_rst_list, 283 NAMELIST/namrun/ cn_ocerst_indir, cn_ocerst_outdir, nn_stocklist, ln_rst_list, ln_rstdate, & 284 284 & nn_no , cn_exp , cn_ocerst_in, cn_ocerst_out, ln_rstart , nn_rstctl , & 285 285 & nn_it000, nn_itend , nn_date0 , nn_time0 , nn_leapy , nn_istate , & … … 314 314 WRITE(numout,*) ' restart output directory cn_ocerst_outdir= ', cn_ocerst_outdir 315 315 WRITE(numout,*) ' restart logical ln_rstart = ', ln_rstart 316 WRITE(numout,*) ' use date in restart name ln_rstdate = ', ln_rstdate 316 317 WRITE(numout,*) ' start with forward time step nn_euler = ', nn_euler 317 318 WRITE(numout,*) ' control of time step nn_rstctl = ', nn_rstctl -
NEMO/branches/UKMO/r8395_restart_datestamp/NEMOGCM/NEMO/OPA_SRC/ICB/icbrst.F90
r10758 r10765 20 20 !!---------------------------------------------------------------------- 21 21 USE par_oce ! NEMO parameters 22 USE phycst ! for rday 22 23 USE dom_oce ! NEMO domain 23 24 USE in_out_manager ! NEMO IO routines 25 USE ioipsl, ONLY : ju2ymds ! for calendar 24 26 USE lib_mpp ! NEMO MPI library, lk_mpp in particular 25 27 USE netcdf ! netcdf routines for IO … … 161 163 CHARACTER(len=256) :: cl_filename 162 164 TYPE(iceberg), POINTER :: this 165 INTEGER :: iyear, imonth, iday 166 REAL (wp) :: zsec 167 REAL (wp) :: zfjulday 168 CHARACTER(LEN=20) :: clkt ! ocean time-step define as a character TYPE(iceberg), POINTER :: this 163 169 TYPE(point) , POINTER :: pt 164 170 !!---------------------------------------------------------------------- … … 167 173 cl_path = TRIM(cn_ocerst_outdir) 168 174 IF( cl_path(LEN_TRIM(cl_path):) /= '/' ) cl_path = TRIM(cl_path) // '/' 175 IF ( ln_rstdate ) THEN 176 zfjulday = fjulday + rdt / rday 177 IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday ) zfjulday = REAL(NINT(zfjulday),wp) ! avoid truncation error 178 CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec ) 179 WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday 180 ELSE 181 IF( kt > 999999999 ) THEN ; WRITE(clkt, * ) kt 182 ELSE ; WRITE(clkt, '(i8.8)') kt 183 ENDIF 184 ENDIF 185 169 186 IF( lk_mpp ) THEN 170 WRITE(cl_filename,'(A,"_icebergs_", I8.8,"_restart_",I4.4,".nc")') TRIM(cexper), kt, narea-1187 WRITE(cl_filename,'(A,"_icebergs_",A,"_restart_",I4.4,".nc")') TRIM(cexper), TRIM(ADJUSTL(clkt)), narea-1 171 188 ELSE 172 WRITE(cl_filename,'(A,"_icebergs_", I8.8,"_restart.nc")') TRIM(cexper), kt189 WRITE(cl_filename,'(A,"_icebergs_",A,"_restart.nc")') TRIM(cexper), TRIM(ADJUSTL(clkt)) 173 190 ENDIF 174 191 IF (nn_verbose_level >= 0) WRITE(numout,'(2a)') 'icebergs, write_restart: creating ',TRIM(cl_path)//TRIM(cl_filename) -
NEMO/branches/UKMO/r8395_restart_datestamp/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90
r10758 r10765 77 77 INTEGER :: nitend !: index of the last time step 78 78 INTEGER :: ndate0 !: initial calendar date aammjj 79 LOGICAL :: ln_rstdate = .FALSE. !: Use calendar date rather than time-step in restart 79 80 INTEGER :: nleapy !: Leap year calendar flag (0/1 or 30) 80 81 INTEGER :: ninist !: initial state output flag (0/1) -
NEMO/branches/UKMO/r8395_restart_datestamp/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90
r10758 r10765 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 31 33 IMPLICIT NONE … … 46 48 CONTAINS 47 49 48 SUBROUTINE rst_opn( kt )50 SUBROUTINE rst_opn( kt, ndastp ) 49 51 !!--------------------------------------------------------------------- 50 52 !! *** ROUTINE rst_opn *** … … 57 59 !!---------------------------------------------------------------------- 58 60 INTEGER, INTENT(in) :: kt ! ocean time-step 61 INTEGER, INTENT(in) :: ndastp ! ocean date 59 62 !! 63 64 INTEGER :: iyear, imonth, iday 65 REAL (wp) :: zsec 66 REAL (wp) :: zfjulday !! 60 67 CHARACTER(LEN=20) :: clkt ! ocean time-step deine as a character 61 68 CHARACTER(LEN=50) :: clname ! ocean output restart file name 62 CHARACTER( lc):: clpath ! full path to ocean output restart file69 CHARACTER(LEN=150) :: clpath ! full path to ocean output restart file 63 70 !!---------------------------------------------------------------------- 64 71 ! … … 85 92 IF( nitrst <= nitend .AND. nitrst > 0 ) THEN 86 93 ! beware of the format used to write kt (default is i8.8, that should be large enough...) 87 IF( nitrst > 999999999 ) THEN ; WRITE(clkt, * ) nitrst 88 ELSE ; WRITE(clkt, '(i8.8)') nitrst 94 IF ( ln_rstdate ) THEN 95 zfjulday = fjulday + rdt / rday 96 IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday ) zfjulday = REAL(NINT(zfjulday),wp) ! avoid truncation error 97 CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec ) 98 WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday 99 ELSE 100 IF( nitrst > 999999999 ) THEN 101 WRITE(clkt, * ) nitrst 102 ELSE 103 WRITE(clkt, '(i8.8)') nitrst 104 ENDIF 89 105 ENDIF 90 106 ! create the file
Note: See TracChangeset
for help on using the changeset viewer.