Changeset 5164
- Timestamp:
- 2015-03-24T16:18:32+01:00 (8 years ago)
- Location:
- branches/2014/dev_r4650_UKMO7_STARTHOUR/NEMOGCM/NEMO/OPA_SRC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2014/dev_r4650_UKMO7_STARTHOUR/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90
r5075 r5164 90 90 nday = ndastp - (nyear * 10000) - ( nmonth * 100 ) 91 91 92 CALL ymds2ju( nyear, nmonth, nday, nn_time0*3600._wp, fjulday ) ! we assume that we start run at 00:0092 CALL ymds2ju( nyear, nmonth, nday, nn_time0*3600._wp, fjulday ) 93 93 IF( ABS(fjulday - REAL(NINT(fjulday),wp)) < 0.1 / rday ) fjulday = REAL(NINT(fjulday),wp) ! avoid truncation error 94 IF( nn_time0 == 0 ) fjulday = fjulday + 1.! move back to the day at nit000 (and not at nit000 - 1)94 IF( nn_time0*3600 - ndt05 .lt. 0 ) fjulday = fjulday + 1. ! move back to the day at nit000 (and not at nit000 - 1) 95 95 96 96 nsec1jan000 = 0 … … 113 113 !compute number of days between last monday and today 114 114 CALL ymds2ju( 1900, 01, 01, 0.0, zjul ) ! compute julian day value of 01.01.1900 (our reference that was a Monday) 115 inbday = NINT(fjulday - zjul) ! compute nb day between 01.01.1900 andcurrent day115 inbday = FLOOR(fjulday - zjul) ! compute nb day between 01.01.1900 and start of current day 116 116 idweek = MOD(inbday, 7) ! compute nb day between last monday and current day 117 IF (idweek .lt. 0) idweek=idweek+7 ! Avoid negative values for dates before 01.01.1900 117 118 118 119 ! number of seconds since the beginning of current year/month/week/day at the middle of the time-step 119 nsec_year = nday_year * nsecd + nn_time0*3600._wp - ndt05 ! 1 time step before the middle of the first time step 120 nsec_month = nday * nsecd + nn_time0*3600._wp - ndt05 ! because day will be called at the beginning of step 120 IF (nn_time0*3600-ndt05 .gt. 0) THEN 121 ! 1 timestep before current middle of first time step is still the same day 122 nsec_year = (nday_year-1) * nsecd + nn_time0*3600._wp - ndt05 123 nsec_month = (nday-1) * nsecd + nn_time0*3600._wp - ndt05 124 ELSE 125 ! 1 time step before the middle of the first time step is the previous day 126 nsec_year = nday_year * nsecd + nn_time0*3600._wp - ndt05 127 nsec_month = nday * nsecd + nn_time0*3600._wp - ndt05 128 ENDIF 121 129 nsec_week = idweek * nsecd + nn_time0*3600._wp - ndt05 122 nsec_day = n secd + nn_time0*3600._wp - ndt05130 nsec_day = nn_time0*3600._wp - ndt05 123 131 IF( nsec_day .lt. 0 ) nsec_day = nsec_day + nsecd 124 132 IF( nsec_week .lt. 0 ) nsec_week = nsec_week + nsecd*7 133 125 134 ! control print 126 IF(lwp) WRITE(numout,'(a,i6,a,i2,a,i2,a,i8,a,i8)')' =======>> 1/2 time step before the start of the run DATE Y/M/D = ', & 127 & nyear, '/', nmonth, '/', nday, ' nsec_day:', nsec_day, ' nsec_week:', nsec_week 135 IF(lwp) WRITE(numout,'(a,i6,a,i2,a,i2,a,i8,a,i8,a,i8,a,i8)')' =======>> 1/2 time step before the start of the run DATE Y/M/D = ', & 136 & nyear, '/', nmonth, '/', nday, ' nsec_day:', nsec_day, ' nsec_week:', nsec_week, ' & 137 & nsec_month:', nsec_month , ' nsec_year:' , nsec_year 128 138 129 139 ! Up to now, calendar parameters are related to the end of previous run (nit000-1) … … 335 345 ! parameters corresponding to nit000 - 1 (as we start the step loop with a call to day) 336 346 ndastp = ndate0 ! ndate0 read in the namelist in dom_nam 347 IF( nn_time0*3600-ndt05 .lt. 0 ) ndastp=ndastp-1 ! Start hour is specified in the namelist (default 0) 337 348 adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday 338 349 ! note this is wrong if time step has changed during run … … 341 352 ! parameters corresponding to nit000 - 1 (as we start the step loop with a call to day) 342 353 ndastp = ndate0 ! ndate0 read in the namelist in dom_nam 354 IF( nn_time0*3600-ndt05 .lt. 0 ) ndastp=ndastp-1 ! Start hour is specified in the namelist (default 0) 343 355 adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday 344 356 ENDIF 345 IF( nn_time0 == 0 ) ndastp=ndastp-1 ! Start hour is specified in the namelist (default 0)346 357 IF( ABS(adatrj - REAL(NINT(adatrj),wp)) < 0.1 / rday ) adatrj = REAL(NINT(adatrj),wp) ! avoid truncation error 347 358 ! -
branches/2014/dev_r4650_UKMO7_STARTHOUR/NEMOGCM/NEMO/OPA_SRC/SBC/sbctide.F90
r4292 r5164 49 49 !!---------------------------------------------------------------------- 50 50 51 IF( nsec_day == NINT(0.5_wp * rdttra(1)) ) THEN ! start a new day51 IF( nsec_day == NINT(0.5_wp * rdttra(1)) ) THEN ! start a new day 52 52 ! 53 53 IF( kt == nit000 ) THEN
Note: See TracChangeset
for help on using the changeset viewer.