Changeset 14072 for NEMO/trunk/src/OCE/DOM/daymod.F90
- Timestamp:
- 2020-12-04T08:48:38+01:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/trunk/src/OCE/DOM/daymod.F90
r13970 r14072 19 19 !! ----------- WARNING ----------- 20 20 !! ------------------------------- 21 !! sbcmod assume that the time step is dividing the number of second of 22 !! in a day, i.e. ===> MOD( rday, rn_Dt ) == 0 21 !! sbcmod assume that the time step is dividing the number of second of 22 !! in a day, i.e. ===> MOD( rday, rn_Dt ) == 0 23 23 !! except when user defined forcing is used (see sbcmod.F90) 24 24 !!---------------------------------------------------------------------- … … 84 84 lrst_oce = .NOT. l_offline ! force definition of offline 85 85 IF( lrst_oce ) CALL day_rst( nit000, 'READ' ) 86 86 87 87 ! set the calandar from ndastp (read in restart file and namelist) 88 88 nyear = ndastp / 10000 … … 94 94 isecrst = ( nhour * NINT(rhhmm) + nminute ) * NINT(rmmss) 95 95 96 CALL ymds2ju( nyear, nmonth, nday, REAL(isecrst,wp), fjulday ) 96 CALL ymds2ju( nyear, nmonth, nday, REAL(isecrst,wp), fjulday ) 97 97 IF( ABS(fjulday - REAL(NINT(fjulday),wp)) < 0.1 / rday ) fjulday = REAL(NINT(fjulday),wp) ! avoid truncation error 98 98 IF( nhour*NINT(rhhmm*rmmss) + nminute*NINT(rmmss) - ndt05 .LT. 0 ) fjulday = fjulday+1. ! move back to the day at nit000 (and not at nit000 - 1) … … 124 124 IF( isecrst - ndt05 .GT. 0 ) THEN 125 125 ! 1 timestep before current middle of first time step is still the same day 126 nsec_year = (nday_year-1) * nsecd + isecrst - ndt05 127 nsec_month = (nday-1) * nsecd + isecrst - ndt05 126 nsec_year = (nday_year-1) * nsecd + isecrst - ndt05 127 nsec_month = (nday-1) * nsecd + isecrst - ndt05 128 128 ELSE 129 ! 1 time step before the middle of the first time step is the previous day 130 nsec_year = nday_year * nsecd + isecrst - ndt05 131 nsec_month = nday * nsecd + isecrst - ndt05 129 ! 1 time step before the middle of the first time step is the previous day 130 nsec_year = nday_year * nsecd + isecrst - ndt05 131 nsec_month = nday * nsecd + isecrst - ndt05 132 132 ENDIF 133 133 nsec_monday = imonday * nsecd + isecrst - ndt05 134 nsec_day = isecrst - ndt05 134 nsec_day = isecrst - ndt05 135 135 IF( nsec_day .LT. 0 ) nsec_day = nsec_day + nsecd 136 136 IF( nsec_monday .LT. 0 ) nsec_monday = nsec_monday + nsecd*7 … … 144 144 nsec000_1jan000 = nsec1jan000 + nsec_year + ndt05 145 145 nsecend_1jan000 = nsec000_1jan000 + ndt * ( nitend - nit000 + 1 ) 146 146 147 147 ! Up to now, calendar parameters are related to the end of previous run (nit000-1) 148 148 ! call day to set the calendar parameters at the begining of the current simulaton. needed by iom_init … … 344 344 ! calculate start time in hours and minutes 345 345 zdayfrac = adatrj - REAL(INT(adatrj), wp) 346 ksecs = NINT(zdayfrac * rday) ! Nearest second to catch rounding errors in adatrj 346 ksecs = NINT(zdayfrac * rday) ! Nearest second to catch rounding errors in adatrj 347 347 ihour = ksecs / NINT( rhhmm*rmmss ) 348 348 iminute = ksecs / NINT(rmmss) - ihour*NINT(rhhmm) 349 349 350 350 ! Add to nn_time0 351 351 nhour = nn_time0 / 100 352 352 nminute = ( nn_time0 - nhour * 100 ) 353 353 nminute = nminute + iminute 354 354 355 355 IF( nminute >= NINT(rhhmm) ) THEN 356 356 nminute = nminute - NINT(rhhmm) … … 361 361 nhour = nhour - NINT(rjjhh) 362 362 adatrj = adatrj + 1. 363 ENDIF 363 ENDIF 364 364 nn_time0 = nhour * 100 + nminute 365 adatrj = REAL(INT(adatrj), wp) ! adatrj set to integer as nn_time0 updated 365 adatrj = REAL(INT(adatrj), wp) ! adatrj set to integer as nn_time0 updated 366 366 ELSE 367 367 ! parameters corresponding to nit000 - 1 (as we start the step loop with a call to day)
Note: See TracChangeset
for help on using the changeset viewer.