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 2059 for branches/dev_1784_WEEK/NEMO/OPA_SRC/DOM/daymod.F90 – NEMO

Ignore:
Timestamp:
2010-08-18T11:44:33+02:00 (14 years ago)
Author:
cbricaud
Message:

add modifications to have the possibility to read weekly files with fldread

File:
1 edited

Legend:

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

    r1730 r2059  
    6767      !!              - nmonth_len, nyear_len, nmonth_half, nmonth_end through day_mth 
    6868      !!---------------------------------------------------------------------- 
     69      INTEGER :: inbday, irest 
     70      REAL(wp) :: zjul 
     71      !!---------------------------------------------------------------------- 
    6972 
    7073      ! all calendar staff is based on the fact that MOD( rday, rdttra(1) ) == 0 
     
    105108      ! day since january 1st 
    106109      nday_year = nday + SUM( nmonth_len(1:nmonth - 1) ) 
    107        
     110 
     111      !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 
    108119      ! number of seconds since the beginning of current year/month at the middle of the time-step 
    109120      nsec_year  = nday_year * nsecd - ndt05   ! 1 time step before the middle of the first time step 
    110121      nsec_month = nday      * nsecd - ndt05   ! because day will be called at the beginning of step 
    111122      nsec_day   =             nsecd - ndt05 
     123      nsec_week  = 0 
     124      IF( nn_leapy==1 ) nsec_week  = irest     * nsecd - ndt05 
    112125 
    113126      ! control print 
    114127      IF(lwp) WRITE(numout,'(a,i6,a,i2,a,i2,a,i6)')' ==============>> 1/2 time step before the start of the run DATE Y/M/D = ',   & 
    115            &                   nyear, '/', nmonth, '/', nday, '  nsec_day:', nsec_day 
     128           &                   nyear, '/', nmonth, '/', nday, '  nsec_day:', nsec_day, '  nsec_week:', nsec_week 
    116129 
    117130      ! Up to now, calendar parameters are related to the end of previous run (nit000-1) 
     
    200213      nsec_year  = nsec_year  + ndt  
    201214      nsec_month = nsec_month + ndt                  
     215      IF( nn_leapy==1 ) nsec_week  = nsec_week  + ndt 
    202216      nsec_day   = nsec_day   + ndt                 
    203217      adatrj  = adatrj  + rdttra(1) / rday 
     
    228242         ndastp = nyear * 10000 + nmonth * 100 + nday   ! NEW date 
    229243         ! 
     244         !compute first day of the year in julian days 
     245         CALL ymds2ju( nyear, 01, 01, 0.0, fjulstartyear ) 
     246         ! 
    230247         IF(lwp) WRITE(numout,'(a,i8,a,i4.4,a,i2.2,a,i2.2,a,i3.3)') '======>> time-step =', kt,   & 
    231248              &   '      New day, DATE Y/M/D = ', nyear, '/', nmonth, '/', nday, '      nday_year = ', nday_year 
    232249         IF(lwp) WRITE(numout,'(a,i8,a,i7,a,i5)') '         nsec_year = ', nsec_year,   & 
    233               &   '   nsec_month = ', nsec_month, '   nsec_day = ', nsec_day 
    234       ENDIF 
     250              &   '   nsec_month = ', nsec_month, '   nsec_day = ', nsec_day, '   nsec_week = ', nsec_week 
     251      ENDIF 
     252 
     253      IF( nsec_week .GT. 7*86400 ) nsec_week = ndt05 
    235254       
    236255      IF(ln_ctl) THEN 
Note: See TracChangeset for help on using the changeset viewer.