Changeset 12477 for NEMO/branches/UKMO/r12083_restart_datestamp/src/TOP
- Timestamp:
- 2020-02-27T13:20:58+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.