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 5872 for branches/2014/dev_r4650_UKMO7_STARTHOUR – NEMO

Ignore:
Timestamp:
2015-11-09T19:20:54+01:00 (8 years ago)
Author:
djlea
Message:

Fixes to enable restartability for runs of less than one day.

Location:
branches/2014/dev_r4650_UKMO7_STARTHOUR/NEMOGCM
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/2014/dev_r4650_UKMO7_STARTHOUR/NEMOGCM/CONFIG/SHARED/namelist_ref

    r5075 r5872  
    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 hours 
     31   nn_time0    =       0   !  initial time of day in hhmm 
    3232   nn_leapy    =       0   !  Leap year calendar (1) or not (0) 
    3333   ln_rstart   = .false.   !  start from rest (F) or from a restart file (T) 
  • branches/2014/dev_r4650_UKMO7_STARTHOUR/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90

    r5075 r5872  
    1111   !!             -   ! 2010-05  (D. Lea)  add calc_month_len routine based on day_init  
    1212   !!            3.4  ! 2012-10  (A. Weaver and K. Mogensen) Fix for direct initialization 
    13    !!                 ! 2014-09  (D. Lea)  local calc_date removed use routine from OBS 
     13   !!                 ! 2014-09  (D. Lea)  Local calc_date removed use routine from OBS 
     14   !!                 ! 2015-11  (D. Lea)  Handle non-zero initial time of day 
    1415   !!---------------------------------------------------------------------- 
    1516 
     
    378379         ENDIF 
    379380 
    380          IF (     ( z_inc_dateb < ndastp + nn_time0*0.01_wp ) & 
     381         IF (     ( z_inc_dateb < ndastp + nn_time0*0.0001_wp ) & 
    381382            & .OR.( z_inc_datef > ditend_date ) ) & 
    382383            & CALL ctl_warn( ' Validity time of assimilation increments is ', & 
  • branches/2014/dev_r4650_UKMO7_STARTHOUR/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90

    r5164 r5872  
    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 
     
    9091      nday    =   ndastp - (nyear * 10000) - ( nmonth * 100 ) 
    9192 
    92       CALL ymds2ju( nyear, nmonth, nday, nn_time0*3600._wp, fjulday )   
     93      nhour   =   nn_time0 / 100 
     94      nminute = ( nn_time0 - nhour * 100 ) 
     95 
     96      CALL ymds2ju( nyear, nmonth, nday, nhour*3600._wp+nminute*60._wp, fjulday )   
    9397      IF( ABS(fjulday - REAL(NINT(fjulday),wp)) < 0.1 / rday )   fjulday = REAL(NINT(fjulday),wp)   ! avoid truncation error 
    9498      IF( nn_time0*3600 - ndt05 .lt. 0 ) fjulday = fjulday + 1.                    ! move back to the day at nit000 (and not at nit000 - 1) 
     
    118122 
    119123      ! number of seconds since the beginning of current year/month/week/day at the middle of the time-step 
    120       IF (nn_time0*3600-ndt05 .gt. 0) THEN 
     124      IF (nhour*3600+nminute*60-ndt05 .gt. 0) THEN 
    121125         ! 1 timestep before current middle of first time step is still the same day 
    122          nsec_year  = (nday_year-1) * nsecd + nn_time0*3600._wp - ndt05  
    123          nsec_month = (nday-1)      * nsecd + nn_time0*3600._wp - ndt05     
     126         nsec_year  = (nday_year-1) * nsecd + nhour*3600+nminute*60 - ndt05  
     127         nsec_month = (nday-1)      * nsecd + nhour*3600+nminute*60 - ndt05     
    124128      ELSE 
    125129         ! 1 time step before the middle of the first time step is the previous day  
    126          nsec_year  = nday_year * nsecd + nn_time0*3600._wp - ndt05  
    127          nsec_month = nday      * nsecd + nn_time0*3600._wp - ndt05    
    128       ENDIF 
    129       nsec_week  = idweek    * nsecd + nn_time0*3600._wp - ndt05 
    130       nsec_day   =             nn_time0*3600._wp - ndt05  
     130         nsec_year  = nday_year * nsecd + nhour*3600+nminute*60 - ndt05  
     131         nsec_month = nday      * nsecd + nhour*3600+nminute*60 - ndt05    
     132      ENDIF 
     133      nsec_week  = idweek    * nsecd + nhour*3600+nminute*60 - ndt05 
     134      nsec_day   =             nhour*3600+nminute*60 - ndt05  
    131135      IF( nsec_day .lt. 0 ) nsec_day = nsec_day + nsecd 
    132136      IF( nsec_week .lt. 0 ) nsec_week = nsec_week + nsecd*7 
     
    313317      CHARACTER(len=*), INTENT(in) ::   cdrw       ! "READ"/"WRITE" flag 
    314318      ! 
    315       REAL(wp) ::   zkt, zndastp 
     319      REAL(wp) ::   zkt, zndastp, zdayfrac, ksecs, ktime 
     320      INTEGER  ::   ihour, iminute 
    316321      !!---------------------------------------------------------------------- 
    317322 
     
    342347               ndastp = NINT( zndastp ) 
    343348               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           
    344373            ELSE 
    345374               ! parameters corresponding to nit000 - 1 (as we start the step loop with a call to day) 
    346375               ndastp = ndate0        ! ndate0 read in the namelist in dom_nam 
    347                IF( nn_time0*3600-ndt05 .lt. 0 )  ndastp=ndastp-1      ! Start hour is specified in the namelist (default 0) 
     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) 
    348379               adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday 
    349380               ! note this is wrong if time step has changed during run 
     
    352383            ! parameters corresponding to nit000 - 1 (as we start the step loop with a call to day) 
    353384            ndastp = ndate0           ! ndate0 read in the namelist in dom_nam 
    354             IF( nn_time0*3600-ndt05 .lt. 0 )  ndastp=ndastp-1      ! Start hour is specified in the namelist (default 0) 
     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) 
    355388            adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday 
    356389         ENDIF 
     
    361394            WRITE(numout,*) '   date ndastp                                      : ', ndastp 
    362395            WRITE(numout,*) '   number of elapsed days since the begining of run : ', adatrj 
     396       WRITE(numout,*) '   nn_time0                                         : ',nn_time0 
    363397            WRITE(numout,*) 
    364398         ENDIF 
     
    376410         CALL iom_rstput( kt, nitrst, numrow, 'adatrj' , adatrj            )   ! number of elapsed days since 
    377411         !                                                                     ! the begining of the run [s] 
     412    CALL iom_rstput( kt, nitrst, numrow, 'ntime'  , REAL( nn_time0, wp) ) ! time 
    378413      ENDIF 
    379414      ! 
  • branches/2014/dev_r4650_UKMO7_STARTHOUR/NEMOGCM/NEMO/OPA_SRC/DOM/dom_oce.F90

    r5075 r5872  
    276276   INTEGER , PUBLIC ::   nmonth        !: current month 
    277277   INTEGER , PUBLIC ::   nday          !: current day of the month 
     278   INTEGER , PUBLIC ::   nhour         !: current hour 
     279   INTEGER , PUBLIC ::   nminute       !: current minute 
    278280   INTEGER , PUBLIC ::   ndastp        !: time step date in yyyymmdd format 
    279281   INTEGER , PUBLIC ::   nday_year     !: current day counted from jan 1st of the current year 
  • branches/2014/dev_r4650_UKMO7_STARTHOUR/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90

    r5075 r5872  
    177177         WRITE(numout,*) '      number of the last time step    nn_itend   = ', nn_itend 
    178178         WRITE(numout,*) '      initial calendar date aammjj    nn_date0   = ', nn_date0 
    179          WRITE(numout,*) '      initial time of day in hours    nn_time0   = ', nn_time0 
     179         WRITE(numout,*) '      initial time of day in hhmm     nn_time0   = ', nn_time0 
    180180         WRITE(numout,*) '      leap year calendar (0/1)        nn_leapy   = ', nn_leapy 
    181181         WRITE(numout,*) '      initial state output            nn_istate  = ', nn_istate 
  • branches/2014/dev_r4650_UKMO7_STARTHOUR/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90

    r5075 r5872  
    3434   INTEGER       ::   nn_itend         !: index of the last time step 
    3535   INTEGER       ::   nn_date0         !: initial calendar date aammjj 
    36    INTEGER       ::   nn_time0         !: initial time of day in hours 
     36   INTEGER       ::   nn_time0         !: initial time of day in hhmm 
    3737   INTEGER       ::   nn_leapy         !: Leap year calendar flag (0/1 or 30) 
    3838   INTEGER       ::   nn_istate        !: initial state output flag (0/1) 
  • branches/2014/dev_r4650_UKMO7_STARTHOUR/NEMOGCM/NEMO/OPA_SRC/OBS/diaobs.F90

    r5075 r5872  
    14521452      !!        !  06-10  (G. Smith) Calculates initial date the same as method for final date 
    14531453      !!        !  10-05  (D. Lea) Update to month length calculation for NEMO vn3.2 
    1454       !!        !  2014-09  (D. Lea) New generic routine now deals with arbitrary start hour  
     1454      !!        !  2014-09  (D. Lea) New generic routine now deals with arbitrary initial time of day 
    14551455      !!---------------------------------------------------------------------- 
    14561456      USE phycst, ONLY : &            ! Physical constants 
     
    14841484      imon = ( ndate0 - iyea * 10000 ) / 100 
    14851485      iday =   ndate0 - iyea * 10000 - imon * 100 
    1486       ihou = nn_time0 
    1487       imin = 0 
     1486      ihou =   nn_time0 / 100 
     1487      imin = ( nn_time0 - ihou * 100 )  
    14881488 
    14891489      !!---------------------------------------------------------------------- 
  • branches/2014/dev_r4650_UKMO7_STARTHOUR/NEMOGCM/NEMO/OPA_SRC/OBS/obs_prep.F90

    r4772 r5872  
    125125      imon0 = ( ndate0 - iyea0 * 10000 ) / 100 
    126126      iday0 =   ndate0 - iyea0 * 10000 - imon0 * 100 
    127       ihou0 = nn_time0 
    128       imin0 = 0 
     127      ihou0 =   nn_time0 / 100 
     128      imin0 = ( nn_time0 - ihou0 * 100 ) 
    129129 
    130130      icycle = no     ! Assimilation cycle 
     
    397397      imon0 = ( ndate0 - iyea0 * 10000 ) / 100 
    398398      iday0 =   ndate0 - iyea0 * 10000 - imon0 * 100 
    399       ihou0 = nn_time0 
    400       imin0 = 0 
     399      ihou0 =   nn_time0 / 100 
     400      imin0 = ( nn_time0 - ihou0 * 100 ) 
    401401 
    402402      icycle = no     ! Assimilation cycle 
     
    585585      imon0 = ( ndate0 - iyea0 * 10000 ) / 100 
    586586      iday0 =   ndate0 - iyea0 * 10000 - imon0 * 100 
    587       ihou0 = nn_time0 
    588       imin0 = 0 
     587      ihou0 =   nn_time0 / 100 
     588      imin0 = ( nn_time0 - ihou0 * 100 ) 
    589589 
    590590      icycle = no     ! Assimilation cycle 
     
    770770      imon0 = ( ndate0 - iyea0 * 10000 ) / 100 
    771771      iday0 =   ndate0 - iyea0 * 10000 - imon0 * 100 
    772       ihou0 = nn_time0 
    773       imin0 = 0 
     772      ihou0 =   nn_time0 / 100 
     773      imin0 = ( nn_time0 - ihou0 * 100 ) 
    774774 
    775775      icycle = no     ! Assimilation cycle 
     
    968968      imon0 = ( ndate0 - iyea0 * 10000 ) / 100 
    969969      iday0 =   ndate0 - iyea0 * 10000 - imon0 * 100 
    970       ihou0 = nn_time0 
    971       imin0 = 0 
     970      ihou0 =   nn_time0 / 100 
     971      imin0 = ( nn_time0 - ihou0 * 100 ) 
    972972 
    973973      icycle = no     ! Assimilation cycle 
  • branches/2014/dev_r4650_UKMO7_STARTHOUR/NEMOGCM/SETTE/sette.sh

    r5075 r5872  
    637637    ## Restartability tests for ORCA2_LIM3 
    638638    export TEST_NAME="LONG" 
     639    NUMTS=150 
     640    NUMTSD2=$(( NUMTS/2 )) 
     641    NUMTSD2_STR=$(printf "%08d" $NUMTSD2) 
    639642    cd ${CONFIG_DIR} 
    640643    . ./makenemo -m ${CMP_NAM} -n ORCA2LIM3_LONG -r ORCA2_LIM3 -j 8 del_key ${DEL_KEYS} 
     
    649652    set_namelist namelist_cfg cn_exp \"O2L3_LONG\" 
    650653    set_namelist namelist_cfg nn_it000 1 
    651     set_namelist namelist_cfg nn_itend 150 
    652     set_namelist namelist_cfg nn_stock 75 
     654    set_namelist namelist_cfg nn_itend $NUMTS 
     655    set_namelist namelist_cfg nn_stock $NUMTSD2 
    653656    set_namelist namelist_cfg ln_clobber .true. 
    654657    set_namelist namelist_cfg nn_fwb 0 
     
    670673    cd ${EXE_DIR} 
    671674    set_namelist namelist_cfg cn_exp \"O2L3_SHORT\" 
    672     set_namelist namelist_cfg nn_it000 76 
    673     set_namelist namelist_cfg nn_itend 150 
    674     set_namelist namelist_cfg nn_stock 75 
     675    set_namelist namelist_cfg nn_it000 $(( NUMTSD2+1 )) 
     676    set_namelist namelist_cfg nn_itend $NUMTS 
     677    set_namelist namelist_cfg nn_stock $NUMTSD2 
    675678    set_namelist namelist_cfg ln_rstart .true. 
    676679    set_namelist namelist_cfg nn_rstctl 2 
     
    681684    set_namelist namelist_cfg jpnij 4 
    682685    set_namelist namelist_cfg nn_solv 2 
    683     set_namelist namelist_cfg cn_ocerst_in \"O2L3_LONG_00000075_restart\" 
    684     set_namelist namelist_ice_cfg cn_icerst_in \"O2L3_LONG_00000075_restart_ice\" 
     686    set_namelist namelist_cfg cn_ocerst_in \"O2L3_LONG_${NUMTSD2_STR}_restart\" 
     687    set_namelist namelist_ice_cfg cn_icerst_in \"O2L3_LONG_${NUMTSD2_STR}_restart_ice\" 
    685688    for (( i=1; i<=$NPROC; i++)) ; do 
    686689        L_NPROC=$(( $i - 1 )) 
    687690        L_NPROC=`printf "%04d\n" ${L_NPROC}` 
    688         ln -sf ../LONG/O2L3_LONG_00000075_restart_${L_NPROC}.nc . 
    689         ln -sf ../LONG/O2L3_LONG_00000075_restart_ice_${L_NPROC}.nc . 
     691        ln -sf ../LONG/O2L3_LONG_${NUMTSD2_STR}_restart_${L_NPROC}.nc . 
     692        ln -sf ../LONG/O2L3_LONG_${NUMTSD2_STR}_restart_ice_${L_NPROC}.nc . 
    690693    done 
    691694    if [ ${USING_MPMD} == "yes" ] ; then 
     
    764767    ## Restartability tests for AMM12 
    765768    export TEST_NAME="LONG" 
     769    NUMTS=576 
     770    NUMTSD2=$(( numts/2 )) 
     771    NUMTSD2_STR=$(printf "%08d" $NUMTSD2) 
    766772    cd ${CONFIG_DIR} 
    767773    . ./makenemo -m ${CMP_NAM} -n AMM12_LONG -r AMM12 -j 8 add_key "key_tide" del_key ${DEL_KEYS} 
     
    775781    cd ${EXE_DIR} 
    776782    set_namelist namelist_cfg nn_it000 1 
    777     set_namelist namelist_cfg nn_itend 576 
    778     set_namelist namelist_cfg nn_stock 288 
     783    set_namelist namelist_cfg nn_itend $NUMTS 
     784    set_namelist namelist_cfg nn_stock $NUMTSD2 
    779785    set_namelist namelist_cfg nn_fwb 0 
    780786    set_namelist namelist_cfg ln_ctl .false. 
     
    795801    . ./prepare_exe_dir.sh 
    796802    cd ${EXE_DIR} 
    797     set_namelist namelist_cfg nn_it000 289 
    798     set_namelist namelist_cfg nn_itend 576 
     803    set_namelist namelist_cfg nn_it000 $(( NUMTSD2+1 )) 
     804    set_namelist namelist_cfg nn_itend $NUMTS 
    799805    set_namelist namelist_cfg nn_fwb 0 
    800806    set_namelist namelist_cfg ln_ctl .false. 
     
    805811    set_namelist namelist_cfg ln_rstart .true. 
    806812    set_namelist namelist_cfg nn_rstctl 2 
    807     set_namelist namelist_cfg cn_ocerst_in \"AMM12_00000288_restart_oce_out\" 
     813    set_namelist namelist_cfg cn_ocerst_in \"AMM12_${NUMTSD2_STR}_restart_oce_out\" 
    808814    set_namelist namelist_cfg nn_date0 20120102 
    809815    for (( i=1; i<=$NPROC; i++)) ; do 
    810816        L_NPROC=$(( $i - 1 )) 
    811817        L_NPROC=`printf "%04d\n" ${L_NPROC}` 
    812         ln -sf ../LONG/AMM12_00000288_restart_oce_out_${L_NPROC}.nc . 
     818        ln -sf ../LONG/AMM12_${NUMTSD2_STR}_restart_oce_out_${L_NPROC}.nc . 
    813819    done 
    814820    if [ ${USING_MPMD} == "yes" ] ; then 
Note: See TracChangeset for help on using the changeset viewer.