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 6510 – NEMO

Changeset 6510


Ignore:
Timestamp:
2016-05-06T13:08:30+02:00 (8 years ago)
Author:
rfurner
Message:

changes to include different start times from branch 2014/dev_r4650_UKMO7_STARTHOUR

Location:
branches/UKMO/dev_r5518_Surge_Modelling/NEMOGCM
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_Surge_Modelling/NEMOGCM/CONFIG/AMM7_SURGE/EXP00/namelist_cfg

    r6402 r6510  
    99   nn_itend    =  105264   !  last  time step (std 1 day = 144) 
    1010   nn_date0    =  20030101 !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1) 
     11   nn_time0    =       0   !  initial time of day in hhmm 
    1112   nn_leapy    =       1   !  Leap year calendar (1) or not (0) 
    1213   ln_rstart   =  .false.  !  start from rest (F) or from a restart file (T) 
  • branches/UKMO/dev_r5518_Surge_Modelling/NEMOGCM/CONFIG/AMM7_SURGE/EXP00/namelist_ref

    r6389 r6510  
    2929   nn_itend    =    5475   !  last  time step (std 5475) 
    3030   nn_date0    =  010101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1) 
     31   nn_time0    =       0   !  initial time of day in hhmm 
    3132   nn_leapy    =       0   !  Leap year calendar (1) or not (0) 
    3233   ln_rstart   = .false.   !  start from rest (F) or from a restart file (T) 
  • branches/UKMO/dev_r5518_Surge_Modelling/NEMOGCM/CONFIG/SHARED/namelist_ref

    r5954 r6510  
    2929   nn_itend    =    5475   !  last  time step (std 5475) 
    3030   nn_date0    =  010101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1) 
     31   nn_time0    =       0   !  initial time of day in hhmm 
    3132   nn_leapy    =       0   !  Leap year calendar (1) or not (0) 
    3233   ln_rstart   = .false.   !  start from rest (F) or from a restart file (T) 
  • branches/UKMO/dev_r5518_Surge_Modelling/NEMOGCM/NEMO/OPA_SRC/BDY/bdytides.F90

    r5942 r6510  
    325325      ENDIF 
    326326 
    327       IF ( nsec_day == NINT(0.5_wp * rdttra(1)) .AND. zflag==1 ) THEN 
     327      IF ( (nsec_day == NINT(0.5_wp * rdttra(1)) .OR. kt==nit000) .AND. zflag==1 ) THEN 
    328328        ! 
    329         kt_tide = kt 
     329        kt_tide = kt - (nsec_day - 0.5_wp * rdttra(1))/rdttra(1) 
    330330        ! 
    331331        IF(lwp) THEN 
     
    440440            ! We refresh nodal factors every day below 
    441441            ! This should be done somewhere else 
    442             IF ( nsec_day == NINT(0.5_wp * rdttra(1)) .AND. lk_first_btstp ) THEN 
    443                ! 
    444                kt_tide = kt                
     442            IF ( ( nsec_day == NINT(0.5_wp * rdttra(1)) .OR. kt==nit000 ) .AND. lk_first_btstp ) THEN 
     443               ! 
     444               kt_tide = kt - (nsec_day - 0.5_wp * rdttra(1))/rdttra(1) 
    445445               ! 
    446446               IF(lwp) THEN 
  • branches/UKMO/dev_r5518_Surge_Modelling/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90

    r5942 r6510  
    1111   !!                 ! 2004-01  (A.M. Treguier) new calculation based on adatrj 
    1212   !!                 ! 2006-08  (G. Madec)  surface module major update 
     13   !!                 ! 2015-11  (D. Lea) Allow non-zero initial time of day 
    1314   !!---------------------------------------------------------------------- 
    1415 
     
    9596      nday    =   ndastp - (nyear * 10000) - ( nmonth * 100 ) 
    9697 
    97       CALL ymds2ju( nyear, nmonth, nday, 0.0, fjulday )  ! we assume that we start run at 00:00 
     98      nhour   =   nn_time0 / 100 
     99      nminute = ( nn_time0 - nhour * 100 ) 
     100 
     101      CALL ymds2ju( nyear, nmonth, nday, nhour*3600._wp+nminute*60._wp, fjulday )   
    98102      IF( ABS(fjulday - REAL(NINT(fjulday),wp)) < 0.1 / rday )   fjulday = REAL(NINT(fjulday),wp)   ! avoid truncation error 
    99       fjulday = fjulday + 1.                             ! move back to the day at nit000 (and not at nit000 - 1) 
     103      IF( nn_time0*3600 - ndt05 .lt. 0 ) fjulday = fjulday + 1.                    ! move back to the day at nit000 (and not at nit000 - 1) 
    100104 
    101105      nsec1jan000 = 0 
     
    118122      !compute number of days between last monday and today 
    119123      CALL ymds2ju( 1900, 01, 01, 0.0, zjul )  ! compute julian day value of 01.01.1900 (our reference that was a Monday) 
    120       inbday = NINT(fjulday - zjul)            ! compute nb day between  01.01.1900 and current day 
     124      inbday = FLOOR(fjulday - zjul)            ! compute nb day between  01.01.1900 and current day 
    121125      idweek = MOD(inbday, 7)                  ! compute nb day between last monday and current day 
     126      IF (idweek .lt. 0) idweek=idweek+7       ! Avoid negative values for dates before 01.01.1900 
    122127 
    123128      ! number of seconds since the beginning of current year/month/week/day at the middle of the time-step 
    124       nsec_year  = nday_year * nsecd - ndt05   ! 1 time step before the middle of the first time step 
    125       nsec_month = nday      * nsecd - ndt05   ! because day will be called at the beginning of step 
    126       nsec_week  = idweek    * nsecd - ndt05 
    127       nsec_day   =             nsecd - ndt05 
     129      IF (nhour*3600+nminute*60-ndt05 .gt. 0) THEN 
     130         ! 1 timestep before current middle of first time step is still the same day 
     131         nsec_year  = (nday_year-1) * nsecd + nhour*3600+nminute*60 - ndt05 
     132         nsec_month = (nday-1)      * nsecd + nhour*3600+nminute*60 - ndt05    
     133      ELSE 
     134         ! 1 time step before the middle of the first time step is the previous day 
     135         nsec_year  = nday_year * nsecd + nhour*3600+nminute*60 - ndt05 
     136         nsec_month = nday      * nsecd + nhour*3600+nminute*60 - ndt05    
     137      ENDIF 
     138      nsec_week  = idweek    * nsecd + nhour*3600+nminute*60 - ndt05 
     139      nsec_day   =             nhour*3600+nminute*60 - ndt05  
     140      IF( nsec_day .lt. 0 ) nsec_day = nsec_day + nsecd 
     141      IF( nsec_week .lt. 0 ) nsec_week = nsec_week + nsecd*7 
    128142 
    129143      ! control print 
    130       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 = ',   & 
    131            &                   nyear, '/', nmonth, '/', nday, '  nsec_day:', nsec_day, '  nsec_week:', nsec_week 
     144      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 = ',   & 
     145           &                   nyear, '/', nmonth, '/', nday, '  nsec_day:', nsec_day, '  nsec_week:', nsec_week, '  & 
     146           &                   nsec_month:', nsec_month , '  nsec_year:' , nsec_year 
    132147 
    133148      ! Up to now, calendar parameters are related to the end of previous run (nit000-1) 
     
    302317      CHARACTER(len=*), INTENT(in) ::   cdrw       ! "READ"/"WRITE" flag 
    303318      ! 
    304       REAL(wp) ::   zkt, zndastp 
     319      REAL(wp) ::   zkt, zndastp, zdayfrac, ksecs, ktime 
     320      INTEGER  ::   ihour, iminute 
    305321      !!---------------------------------------------------------------------- 
    306322 
     
    331347               ndastp = NINT( zndastp ) 
    332348               CALL iom_get( numror, 'adatrj', adatrj  ) 
     349               CALL iom_get( numror, 'ntime', ktime ) 
     350               nn_time0=INT(ktime) 
     351               ! calculate start time in hours and minutes 
     352               zdayfrac=adatrj-INT(adatrj) 
     353               ksecs = NINT(zdayfrac*86400)            ! Nearest second to catch rounding errors in adatrj              
     354               ihour = INT(ksecs/3600) 
     355               iminute = ksecs/60-ihour*60 
     356                
     357               ! Add to nn_time0 
     358               nhour   =   nn_time0 / 100 
     359               nminute = ( nn_time0 - nhour * 100 ) 
     360               nminute=nminute+iminute 
     361                
     362               IF( nminute >= 60 ) THEN 
     363                  nminute=nminute-60 
     364                  nhour=nhour+1 
     365               ENDIF 
     366               nhour=nhour+ihour 
     367               IF( nhour >= 24 ) THEN 
     368                  nhour=nhour-24 
     369                  adatrj=adatrj+1 
     370               ENDIF            
     371               nn_time0 = nhour * 100 + nminute 
     372               adatrj = INT(adatrj)                    ! adatrj set to integer as nn_time0 updated            
    333373            ELSE 
    334374               ! parameters correspondting to nit000 - 1 (as we start the step loop with a call to day) 
    335                ndastp = ndate0 - 1     ! ndate0 read in the namelist in dom_nam, we assume that we start run at 00:00 
     375               ndastp = ndate0      ! ndate0 read in the namelist in dom_nam, we assume that we start run at 00:00 
     376               nhour   =   nn_time0 / 100 
     377               nminute = ( nn_time0 - nhour * 100 ) 
     378               IF( nhour*3600+nminute*60-ndt05 .lt. 0 )  ndastp=ndastp-1      ! Start hour is specified in the namelist (default 0) 
    336379               adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday 
    337380               ! note this is wrong if time step has changed during run 
     
    339382         ELSE 
    340383            ! parameters correspondting to nit000 - 1 (as we start the step loop with a call to day) 
    341             ndastp = ndate0 - 1        ! ndate0 read in the namelist in dom_nam, we assume that we start run at 00:00 
     384            ndastp = ndate0        ! ndate0 read in the namelist in dom_nam, we assume that we start run at 00:00 
     385            nhour   =   nn_time0 / 100 
     386            nminute = ( nn_time0 - nhour * 100 ) 
     387            IF( nhour*3600+nminute*60-ndt05 .lt. 0 )  ndastp=ndastp-1      ! Start hour is specified in the namelist (default 0) 
    342388            adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday 
    343389         ENDIF 
     
    348394            WRITE(numout,*) '   date ndastp                                      : ', ndastp 
    349395            WRITE(numout,*) '   number of elapsed days since the begining of run : ', adatrj 
     396            WRITE(numout,*) '   nn_time0                                         : ',nn_time0 
    350397            WRITE(numout,*) 
    351398         ENDIF 
     
    363410         CALL iom_rstput( kt, nitrst, numrow, 'adatrj' , adatrj            )   ! number of elapsed days since 
    364411         !                                                                     ! the begining of the run [s] 
     412         CALL iom_rstput( kt, nitrst, numrow, 'ntime'  , REAL( nn_time0, wp) ) ! time 
    365413      ENDIF 
    366414      ! 
  • branches/UKMO/dev_r5518_Surge_Modelling/NEMOGCM/NEMO/OPA_SRC/DOM/dom_oce.F90

    r5954 r6510  
    290290   INTEGER , PUBLIC ::   nmonth        !: current month 
    291291   INTEGER , PUBLIC ::   nday          !: current day of the month 
     292   INTEGER , PUBLIC ::   nhour         !: current hour 
     293   INTEGER , PUBLIC ::   nminute       !: current minute 
    292294   INTEGER , PUBLIC ::   ndastp        !: time step date in yyyymmdd format 
    293295   INTEGER , PUBLIC ::   nday_year     !: current day counted from jan 1st of the current year 
  • branches/UKMO/dev_r5518_Surge_Modelling/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90

    r6269 r6510  
    139139         &             nn_no   , cn_exp    , cn_ocerst_in, cn_ocerst_out, ln_rstart , nn_rstctl,   & 
    140140         &             ln_rstdate,                                                                 & 
    141          &             nn_it000, nn_itend  , nn_date0    , nn_leapy     , nn_istate , nn_stock ,   & 
     141         &             nn_it000, nn_itend  , nn_date0   ,nn_time0 , nn_leapy     , nn_istate , nn_stock ,   & 
    142142         &             nn_write, ln_dimgnnn, ln_mskland  , ln_cfmeta    , ln_clobber, nn_chunksz, nn_euler 
    143143      NAMELIST/namdom/ nn_bathy, rn_bathy , rn_e3zps_min, rn_e3zps_rat, nn_msh, rn_hmin,   & 
     
    184184         WRITE(numout,*) '      number of the last time step    nn_itend   = ', nn_itend 
    185185         WRITE(numout,*) '      initial calendar date aammjj    nn_date0   = ', nn_date0 
     186         WRITE(numout,*) '      initial time of day in hhmm     nn_time0   = ', nn_time0 
    186187         WRITE(numout,*) '      leap year calendar (0/1)        nn_leapy   = ', nn_leapy 
    187188         WRITE(numout,*) '      initial state output            nn_istate  = ', nn_istate 
  • branches/UKMO/dev_r5518_Surge_Modelling/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90

    r6274 r6510  
    3737   INTEGER       ::   nn_itend         !: index of the last time step 
    3838   INTEGER       ::   nn_date0         !: initial calendar date aammjj 
     39   INTEGER       ::   nn_time0         !: initial time of day in hhmm 
    3940   INTEGER       ::   nn_leapy         !: Leap year calendar flag (0/1 or 30) 
    4041   INTEGER       ::   nn_istate        !: initial state output flag (0/1) 
  • branches/UKMO/dev_r5518_Surge_Modelling/NEMOGCM/NEMO/OPA_SRC/SBC/sbctide.F90

    r5215 r6510  
    4747      INTEGER, INTENT( in ) ::   kt     ! ocean time-step 
    4848      INTEGER               ::   jk     ! dummy loop index 
     49      INTEGER               ::   nsec_day_orig     ! Temporary variable 
    4950      !!---------------------------------------------------------------------- 
    5051 
    51       IF( nsec_day == NINT(0.5_wp * rdttra(1)) ) THEN      ! start a new day 
     52      IF( nsec_day == NINT(0.5_wp * rdttra(1)) .OR. kt == nit000 ) THEN      ! start a new day 
    5253         ! 
    5354         IF( kt == nit000 ) THEN 
     
    6061         pot_astro(:,:) = 0._wp 
    6162         ! 
     63         ! If the run does not start from midnight then need to initialise tides 
     64         ! at the start of the current day (only occurs when kt==nit000) 
     65         ! Temporarily set nsec_day to beginning of day. 
     66         nsec_day_orig = nsec_day 
     67         IF ( nsec_day /= NINT(0.5_wp * rdttra(1)) ) THEN 
     68            kt_tide = kt - (nsec_day - 0.5_wp * rdttra(1))/rdttra(1) 
     69            nsec_day = NINT(0.5_wp * rdttra(1)) 
     70         ELSE 
     71            kt_tide = kt 
     72         ENDIF 
    6273         CALL tide_harmo( omega_tide, v0tide, utide, ftide, ntide, nb_harmo ) 
    6374         ! 
    64          kt_tide = kt 
    6575         ! 
    6676         IF(lwp) THEN 
     
    7585         IF( ln_tide_pot )   CALL tide_init_potential 
    7686         ! 
     87         ! Reset nsec_day 
     88         nsec_day = nsec_day_orig  
    7789      ENDIF 
    7890      ! 
Note: See TracChangeset for help on using the changeset viewer.