Changeset 14789 for NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU/src/OCE/DOM/daymod.F90
- Timestamp:
- 2021-05-05T13:18:04+02:00 (3 years ago)
- Location:
- NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU
- Property svn:externals
-
old new 3 3 ^/utils/build/mk@HEAD mk 4 4 ^/utils/tools@HEAD tools 5 ^/vendors/AGRIF/dev _r12970_AGRIF_CMEMSext/AGRIF5 ^/vendors/AGRIF/dev@HEAD ext/AGRIF 6 6 ^/vendors/FCM@HEAD ext/FCM 7 7 ^/vendors/IOIPSL@HEAD ext/IOIPSL 8 ^/vendors/PPR@HEAD ext/PPR 8 9 9 10 # SETTE 10 ^/utils/CI/sette@1 3559sette11 ^/utils/CI/sette@14244 sette
-
- Property svn:externals
-
NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU/src/OCE/DOM/daymod.F90
r13558 r14789 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 149 149 CALL day( nit000 ) 150 150 ! 151 IF( lwxios ) THEN152 ! define variables in restart file when writing with XIOS153 CALL iom_set_rstw_var_active('kt')154 CALL iom_set_rstw_var_active('ndastp')155 CALL iom_set_rstw_var_active('adatrj')156 CALL iom_set_rstw_var_active('ntime')157 ENDIF158 159 151 END SUBROUTINE day_init 160 152 … … 324 316 325 317 IF( TRIM(cdrw) == 'READ' ) THEN 326 327 318 IF( iom_varid( numror, 'kt', ldstop = .FALSE. ) > 0 ) THEN 328 319 ! Get Calendar informations 329 CALL iom_get( numror, 'kt', zkt , ldxios = lrxios) ! last time-step of previous run320 CALL iom_get( numror, 'kt', zkt ) ! last time-step of previous run 330 321 IF(lwp) THEN 331 322 WRITE(numout,*) ' *** Info read in restart : ' … … 346 337 IF ( nrstdt == 2 ) THEN 347 338 ! read the parameters corresponding to nit000 - 1 (last time step of previous run) 348 CALL iom_get( numror, 'ndastp', zndastp , ldxios = lrxios)339 CALL iom_get( numror, 'ndastp', zndastp ) 349 340 ndastp = NINT( zndastp ) 350 CALL iom_get( numror, 'adatrj', adatrj , ldxios = lrxios)351 CALL iom_get( numror, 'ntime' , ktime , ldxios = lrxios)341 CALL iom_get( numror, 'adatrj', adatrj ) 342 CALL iom_get( numror, 'ntime' , ktime ) 352 343 nn_time0 = NINT(ktime) 353 344 ! calculate start time in hours and minutes 354 345 zdayfrac = adatrj - REAL(INT(adatrj), wp) 355 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 356 347 ihour = ksecs / NINT( rhhmm*rmmss ) 357 348 iminute = ksecs / NINT(rmmss) - ihour*NINT(rhhmm) 358 349 359 350 ! Add to nn_time0 360 351 nhour = nn_time0 / 100 361 352 nminute = ( nn_time0 - nhour * 100 ) 362 353 nminute = nminute + iminute 363 354 364 355 IF( nminute >= NINT(rhhmm) ) THEN 365 356 nminute = nminute - NINT(rhhmm) … … 370 361 nhour = nhour - NINT(rjjhh) 371 362 adatrj = adatrj + 1. 372 ENDIF 363 ENDIF 373 364 nn_time0 = nhour * 100 + nminute 374 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 375 366 ELSE 376 367 ! parameters corresponding to nit000 - 1 (as we start the step loop with a call to day) … … 410 401 ENDIF 411 402 ! calendar control 412 IF( lwxios ) CALL iom_swap( cwxios_context ) 413 CALL iom_rstput( kt, nitrst, numrow, 'kt' , REAL( kt , wp) , ldxios = lwxios ) ! time-step 414 CALL iom_rstput( kt, nitrst, numrow, 'ndastp' , REAL( ndastp, wp) , ldxios = lwxios ) ! date 415 CALL iom_rstput( kt, nitrst, numrow, 'adatrj' , adatrj , ldxios = lwxios ) ! number of elapsed days since 403 CALL iom_rstput( kt, nitrst, numrow, 'kt' , REAL( kt , wp) ) ! time-step 404 CALL iom_rstput( kt, nitrst, numrow, 'ndastp' , REAL( ndastp, wp) ) ! date 405 CALL iom_rstput( kt, nitrst, numrow, 'adatrj' , adatrj ) ! number of elapsed days since 416 406 ! ! the begining of the run [s] 417 CALL iom_rstput( kt, nitrst, numrow, 'ntime' , REAL( nn_time0, wp), ldxios = lwxios ) ! time 418 IF( lwxios ) CALL iom_swap( cxios_context ) 407 CALL iom_rstput( kt, nitrst, numrow, 'ntime' , REAL( nn_time0, wp) ) ! time 419 408 ENDIF 420 409 !
Note: See TracChangeset
for help on using the changeset viewer.