New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 6808 for branches/NERC/dev_r5549_BDY_ZEROGRAD/NEMOGCM/NEMO/SAS_SRC/daymod.F90 – NEMO

Ignore:
Timestamp:
2016-07-19T10:38:35+02:00 (8 years ago)
Author:
jamesharle
Message:

merge with trunk@6232 for consistency with SSB code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/NERC/dev_r5549_BDY_ZEROGRAD/NEMOGCM/NEMO/SAS_SRC/daymod.F90

    r5518 r6808  
    2020   !! 
    2121   !!   we suppose that the time step is deviding the number of second of in a day 
    22    !!             ---> MOD( rday, rdttra(1) ) == 0 
     22   !!             ---> MOD( rday, rdt ) == 0 
    2323   !! 
    2424   !!           ----------- WARNING ----------- 
     
    7171      !!---------------------------------------------------------------------- 
    7272      ! 
    73       ! all calendar staff is based on the fact that MOD( rday, rdttra(1) ) == 0 
    74       IF( MOD( rday     , rdttra(1) ) /= 0. )   CALL ctl_stop( 'the time step must devide the number of second of in a day' ) 
    75       IF( MOD( rday     , 2.        ) /= 0. )   CALL ctl_stop( 'the number of second of in a day must be an even number'    ) 
    76       IF( MOD( rdttra(1), 2.        ) /= 0. )   CALL ctl_stop( 'the time step (in second) must be an even number'           ) 
    77       nsecd   = NINT(rday           ) 
    78       nsecd05 = NINT(0.5 * rday     ) 
    79       ndt     = NINT(      rdttra(1)) 
    80       ndt05   = NINT(0.5 * rdttra(1)) 
     73      ! max number of seconds between each restart 
     74      IF( REAL( nitend - nit000 + 1 ) * rdt > REAL( HUGE( nsec1jan000 ) ) ) THEN 
     75         CALL ctl_stop( 'The number of seconds between each restart exceeds the integer 4 max value: 2^31-1. ',   & 
     76            &           'You must do a restart at higher frequency (or remove this stop and recompile the code in I8)' ) 
     77      ENDIF 
     78      ! all calendar staff is based on the fact that MOD( rday, rdt ) == 0 
     79      IF( MOD( rday , rdt ) /= 0. )   CALL ctl_stop( 'the time step must devide the number of second of in a day' ) 
     80      IF( MOD( rday , 2.  ) /= 0. )   CALL ctl_stop( 'the number of second of in a day must be an even number'    ) 
     81      IF( MOD( rdt  , 2.  ) /= 0. )   CALL ctl_stop( 'the time step (in second) must be an even number'           ) 
     82      nsecd   = NINT(rday         ) 
     83      nsecd05 = NINT(0.5 * rday   ) 
     84      ndt     = NINT(      rdt    ) 
     85      ndt05   = NINT(0.5 * rdt    ) 
    8186 
    8287      ! ==> clem: here we read the ocean restart for the date (only if it exists) 
     
    219224      nsec_week  = nsec_week  + ndt 
    220225      nsec_day   = nsec_day   + ndt                 
    221       adatrj  = adatrj  + rdttra(1) / rday 
    222       fjulday = fjulday + rdttra(1) / rday 
     226      adatrj  = adatrj  + rdt / rday 
     227      fjulday = fjulday + rdt / rday 
    223228      IF( ABS(fjulday - REAL(NINT(fjulday),wp)) < zprec )   fjulday = REAL(NINT(fjulday),wp)   ! avoid truncation error 
    224229      IF( ABS(adatrj  - REAL(NINT(adatrj ),wp)) < zprec )   adatrj  = REAL(NINT(adatrj ),wp)   ! avoid truncation error 
     
    239244               nday_year = 1 
    240245               nsec_year = ndt05 
    241                IF( nsec1jan000 >= 2 * (2**30 - nsecd * nyear_len(1) / 2 ) ) THEN   ! test integer 4 max value 
    242                   CALL ctl_stop( 'The number of seconds between Jan. 1st 00h of nit000 year and Jan. 1st 00h ',   & 
    243                      &           'of the current year is exceeding the INTEGER 4 max VALUE: 2^31-1 -> 68.09 years in seconds', & 
    244                      & 'You must do a restart at higher frequency (or remove this STOP and recompile everything in I8)' ) 
    245                ENDIF 
    246246               nsec1jan000 = nsec1jan000 + nsecd * nyear_len(1) 
    247247               IF( nleapy == 1 )   CALL day_mth 
     
    340340               ! parameters correspondting to nit000 - 1 (as we start the step loop with a call to day) 
    341341               ndastp = ndate0 - 1     ! ndate0 read in the namelist in dom_nam, we assume that we start run at 00:00 
    342                adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday 
     342               adatrj = ( REAL( nit000-1, wp ) * rdt ) / rday 
    343343               ! note this is wrong if time step has changed during run 
    344344            ENDIF 
     
    346346            ! parameters correspondting to nit000 - 1 (as we start the step loop with a call to day) 
    347347            ndastp = ndate0 - 1        ! ndate0 read in the namelist in dom_nam, we assume that we start run at 00:00 
    348             adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday 
     348            adatrj = ( REAL( nit000-1, wp ) * rdt ) / rday 
    349349         ENDIF 
    350350         IF( ABS(adatrj  - REAL(NINT(adatrj),wp)) < 0.1 / rday )   adatrj = REAL(NINT(adatrj),wp)   ! avoid truncation error 
Note: See TracChangeset for help on using the changeset viewer.