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 2353 for branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90 – NEMO

Ignore:
Timestamp:
2010-11-04T12:18:58+01:00 (14 years ago)
Author:
smasson
Message:

nemo_v3_3_beta: cleaning/debug fldread, see Ticket #751

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90

    r2288 r2353  
    6767      !!              - nmonth_len, nyear_len, nmonth_half, nmonth_end through day_mth 
    6868      !!---------------------------------------------------------------------- 
    69       INTEGER :: inbday, irest 
     69      INTEGER :: inbday, idweek 
    7070      REAL(wp) :: zjul 
    7171      !!---------------------------------------------------------------------- 
     
    110110 
    111111      !compute number of days between last monday and today       
    112       IF( nn_leapy==1 )THEN 
    113          CALL ymds2ju( 1900, 01, 01, 0.0, zjul )  ! compute julian day value of 01.01.1900 (monday) 
    114          inbday = INT(fjulday) - NINT(zjul)       ! compute nb day between  01.01.1900 and current day fjulday  
    115          irest = MOD(inbday,7)                    ! compute nb day between last monday and current day fjulday  
    116          IF(irest==0 )irest = 7  
    117       ENDIF 
    118  
    119       ! number of seconds since the beginning of current year/month at the middle of the time-step 
     112      CALL ymds2ju( 1900, 01, 01, 0.0, zjul )  ! compute julian day value of 01.01.1900 (our reference that was a Monday) 
     113      inbday = NINT(fjulday - zjul)            ! compute nb day between  01.01.1900 and current day   
     114      idweek = MOD(inbday, 7)                  ! compute nb day between last monday and current day   
     115 
     116      ! number of seconds since the beginning of current year/month/week/day at the middle of the time-step 
    120117      nsec_year  = nday_year * nsecd - ndt05   ! 1 time step before the middle of the first time step 
    121118      nsec_month = nday      * nsecd - ndt05   ! because day will be called at the beginning of step 
     119      nsec_week  = idweek    * nsecd - ndt05 
    122120      nsec_day   =             nsecd - ndt05 
    123       nsec_week  = 0 
    124       IF( nn_leapy==1 ) nsec_week  = irest     * nsecd - ndt05 
    125121 
    126122      ! control print 
     
    213209      nsec_year  = nsec_year  + ndt  
    214210      nsec_month = nsec_month + ndt                  
    215       IF( nn_leapy==1 ) nsec_week  = nsec_week  + ndt 
     211      nsec_week  = nsec_week  + ndt 
    216212      nsec_day   = nsec_day   + ndt                 
    217213      adatrj  = adatrj  + rdttra(1) / rday 
     
    220216      IF( ABS(adatrj  - REAL(NINT(adatrj ),wp)) < zprec )   adatrj  = REAL(NINT(adatrj ),wp)   ! avoid truncation error 
    221217       
    222       IF( nsec_day > nsecd ) THEN                        ! NEW day 
     218      IF( nsec_day > nsecd ) THEN                       ! New day 
    223219         ! 
    224220         nday      = nday + 1 
     
    226222         nsec_day  = ndt05 
    227223         ! 
    228          IF( nday == nmonth_len(nmonth) + 1 ) THEN      ! NEW month 
     224         IF( nday == nmonth_len(nmonth) + 1 ) THEN      ! New month 
    229225            nday   = 1 
    230226            nmonth = nmonth + 1 
    231227            nsec_month = ndt05 
    232             IF( nmonth == 13 ) THEN                     ! NEW year 
     228            IF( nmonth == 13 ) THEN                     ! New year 
    233229               nyear     = nyear + 1 
    234230               nmonth    = 1 
     
    240236         ENDIF 
    241237         ! 
    242          ndastp = nyear * 10000 + nmonth * 100 + nday   ! NEW date 
     238         ndastp = nyear * 10000 + nmonth * 100 + nday   ! New date 
    243239         ! 
    244240         !compute first day of the year in julian days 
     
    251247      ENDIF 
    252248 
    253       IF( nsec_week .GT. 7*86400 ) nsec_week = ndt05 
     249      IF( nsec_week > 7*nsecd )   nsec_week = ndt05     ! New week 
    254250       
    255251      IF(ln_ctl) THEN 
Note: See TracChangeset for help on using the changeset viewer.