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

Changeset 8581


Ignore:
Timestamp:
2017-10-03T10:03:41+02:00 (7 years ago)
Author:
cbricaud
Message:

fix ticket #1944 in nemo_v3_6_STABLE ( SAS restartability)

Location:
branches/2015/nemo_v3_6_STABLE/NEMOGCM
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/SAS_SRC/daymod.F90

    r5564 r8581  
    22   !!====================================================================== 
    33   !!                       ***  MODULE  daymod  *** 
    4    !! Ocean        :  calendar  
     4   !! Ocean        :  calendar 
    55   !!===================================================================== 
    66   !! History :  OPA  ! 1994-09  (M. Pontaud M. Imbard)  Original code 
    77   !!                 ! 1997-03  (O. Marti) 
    8    !!                 ! 1997-05  (G. Madec)  
     8   !!                 ! 1997-05  (G. Madec) 
    99   !!                 ! 1997-08  (M. Imbard) 
    1010   !!   NEMO     1.0  ! 2003-09  (G. Madec)  F90 + nyear, nmonth, nday 
    1111   !!                 ! 2004-01  (A.M. Treguier) new calculation based on adatrj 
    1212   !!                 ! 2006-08  (G. Madec)  surface module major update 
    13    !!----------------------------------------------------------------------       
     13   !!---------------------------------------------------------------------- 
    1414 
    1515   !!---------------------------------------------------------------------- 
    1616   !!   day        : calendar 
    17    !!   
     17   !! 
    1818   !!           ------------------------------- 
    1919   !!           ----------- WARNING ----------- 
     
    2424   !!           ----------- WARNING ----------- 
    2525   !!           ------------------------------- 
    26    !!   
     26   !! 
    2727   !!---------------------------------------------------------------------- 
    2828   USE dom_oce         ! ocean space and time domain 
    2929   USE phycst          ! physical constants 
    3030   USE in_out_manager  ! I/O manager 
    31    USE iom             !  
     31   USE iom             ! 
    3232   USE ioipsl, ONLY :   ymds2ju   ! for calendar 
    3333   USE prtctl          ! Print control 
    34    USE restart         !  
     34   USE trc_oce, ONLY : lk_offline ! offline flag 
    3535   USE timing          ! Timing 
     36   USE restart         ! restart 
    3637 
    3738   IMPLICIT NONE 
     
    4041   PUBLIC   day        ! called by step.F90 
    4142   PUBLIC   day_init   ! called by istate.F90 
    42  
    43    INTEGER ::   nsecd, nsecd05, ndt, ndt05 
     43   PUBLIC   day_mth    ! Needed by TAM 
     44 
     45   INTEGER, PUBLIC ::   nsecd, nsecd05, ndt, ndt05 ! (PUBLIC for TAM) 
    4446 
    4547   !!---------------------------------------------------------------------- 
     
    5355      !!---------------------------------------------------------------------- 
    5456      !!                   ***  ROUTINE day_init  *** 
    55       !!  
    56       !! ** Purpose :   Initialization of the calendar values to their values 1 time step before nit000  
     57      !! 
     58      !! ** Purpose :   Initialization of the calendar values to their values 1 time step before nit000 
    5759      !!                because day will be called at the beginning of step 
    5860      !! 
     
    8587      ndt05   = NINT(0.5 * rdttra(1)) 
    8688 
    87       ! ==> clem: here we read the ocean restart for the date (only if it exists) 
    88       !           It is not clean and another solution should be found 
    89       CALL day_rst( nit000, 'READ' ) 
    90       ! ==> 
    91  
    92       ! set the calendar from ndastp (read in restart file and namelist) 
     89      IF( .NOT. lk_offline ) CALL day_rst( nit000, 'READ' ) 
     90 
     91      ! set the calandar from ndastp (read in restart file and namelist) 
    9392 
    9493      nyear   =   ndastp / 10000 
    9594      nmonth  = ( ndastp - (nyear * 10000) ) / 100 
    96       nday    =   ndastp - (nyear * 10000) - ( nmonth * 100 )  
     95      nday    =   ndastp - (nyear * 10000) - ( nmonth * 100 ) 
    9796 
    9897      CALL ymds2ju( nyear, nmonth, nday, 0.0, fjulday )  ! we assume that we start run at 00:00 
     
    102101      nsec1jan000 = 0 
    103102      CALL day_mth 
    104        
     103 
    105104      IF ( nday == 0 ) THEN     !   for ex if ndastp = ndate0 - 1 
    106          nmonth = nmonth - 1   
     105         nmonth = nmonth - 1 
    107106         nday = nmonth_len(nmonth) 
    108107      ENDIF 
     
    113112         IF( nleapy == 1 )   CALL day_mth 
    114113      ENDIF 
    115        
     114 
    116115      ! day since january 1st 
    117116      nday_year = nday + SUM( nmonth_len(1:nmonth - 1) ) 
    118117 
    119       !compute number of days between last monday and today       
     118      !compute number of days between last monday and today 
    120119      CALL ymds2ju( 1900, 01, 01, 0.0, zjul )  ! compute julian day value of 01.01.1900 (our reference that was a Monday) 
    121       inbday = NINT(fjulday - zjul)            ! compute nb day between  01.01.1900 and current day   
    122       idweek = MOD(inbday, 7)                  ! compute nb day between last monday and current day   
     120      inbday = NINT(fjulday - zjul)            ! compute nb day between  01.01.1900 and current day 
     121      idweek = MOD(inbday, 7)                  ! compute nb day between last monday and current day 
    123122 
    124123      ! number of seconds since the beginning of current year/month/week/day at the middle of the time-step 
     
    142141      !!---------------------------------------------------------------------- 
    143142      !!                   ***  ROUTINE day_init  *** 
    144       !!  
     143      !! 
    145144      !! ** Purpose :   calendar values related to the months 
    146145      !! 
     
    154153 
    155154      ! length of the month of the current year (from nleapy, read in namelist) 
    156       IF ( nleapy < 2 ) THEN  
     155      IF ( nleapy < 2 ) THEN 
    157156         nmonth_len(:) = (/ 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31 /) 
    158157         nyear_len(:) = 365 
     
    177176      ! time since Jan 1st   0     1     2    ...    11    12    13 
    178177      !          ---------*--|--*--|--*--| ... |--*--|--*--|--*--|-------------------------------------- 
    179       !                 <---> <---> <--->  ...  <---> <---> <--->         
     178      !                 <---> <---> <--->  ...  <---> <---> <---> 
    180179      ! month number      0     1     2    ...    11    12    13 
    181180      ! 
     
    190189         nmonth_end(jm) = nmonth_end(jm-1) + nsecd * nmonth_len(jm) 
    191190      END DO 
    192       !            
    193    END SUBROUTINE  
     191      ! 
     192   END SUBROUTINE 
    194193 
    195194 
     
    197196      !!---------------------------------------------------------------------- 
    198197      !!                      ***  ROUTINE day  *** 
    199       !!  
     198      !! 
    200199      !! ** Purpose :   Compute the date with a day iteration IF necessary. 
    201200      !! 
     
    209208      !!              - adatrj    : date in days since the beginning of the run 
    210209      !!              - nsec_year : current time of the year (in second since 00h, jan 1st) 
    211       !!----------------------------------------------------------------------       
     210      !!---------------------------------------------------------------------- 
    212211      INTEGER, INTENT(in) ::   kt        ! ocean time-step indices 
    213212      ! 
     
    220219      zprec = 0.1 / rday 
    221220      !                                                 ! New time-step 
    222       nsec_year  = nsec_year  + ndt  
    223       nsec_month = nsec_month + ndt                  
     221      nsec_year  = nsec_year  + ndt 
     222      nsec_month = nsec_month + ndt 
    224223      nsec_week  = nsec_week  + ndt 
    225       nsec_day   = nsec_day   + ndt                 
     224      nsec_day   = nsec_day   + ndt 
    226225      adatrj  = adatrj  + rdttra(1) / rday 
    227226      fjulday = fjulday + rdttra(1) / rday 
    228227      IF( ABS(fjulday - REAL(NINT(fjulday),wp)) < zprec )   fjulday = REAL(NINT(fjulday),wp)   ! avoid truncation error 
    229228      IF( ABS(adatrj  - REAL(NINT(adatrj ),wp)) < zprec )   adatrj  = REAL(NINT(adatrj ),wp)   ! avoid truncation error 
    230        
     229 
    231230      IF( nsec_day > nsecd ) THEN                       ! New day 
    232231         ! 
     
    261260 
    262261      IF( nsec_week > 7*nsecd )   nsec_week = ndt05     ! New week 
    263        
     262 
    264263      IF(ln_ctl) THEN 
    265264         WRITE(charout,FMT="('kt =', I4,'  d/m/y =',I2,I2,I4)") kt, nday, nmonth, nyear 
     
    267266      ENDIF 
    268267 
    269       ! since we no longer call rst_opn, need to define nitrst here, used by ice restart routine 
    270       IF( kt == nit000 ) nitrst = nitend 
    271       IF( MOD( kt - 1, nstock ) == 0 ) THEN 
    272          ! we use kt - 1 and not kt - nit000 to keep the same periodicity from the beginning of the experiment 
    273          nitrst = kt + nstock - 1                  ! define the next value of nitrst for restart writing 
    274          IF( nitrst > nitend )   nitrst = nitend   ! make sure we write a restart at the end of the run 
    275       ENDIF 
    276  
     268      IF( .NOT. lk_offline ) CALL rst_opn( kt )               ! Open the restart file if needed and control lrst_oce 
     269      IF( lrst_oce         ) CALL day_rst( kt, 'WRITE' )      ! write day restart information 
     270      ! 
    277271      IF( nn_timing == 1 )  CALL timing_stop('day') 
    278272      ! 
     
    372366      ! 
    373367   END SUBROUTINE day_rst 
     368 
    374369   !!====================================================================== 
    375370END MODULE daymod 
  • branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90

    r7760 r8581  
    6464#endif 
    6565   USE bdy_par 
    66  
     66   USE restart 
     67 
     68    
    6769   IMPLICIT NONE 
    6870   PRIVATE 
     
    357359      IF( ln_ctl        )   CALL prt_ctl_init   ! Print control 
    358360                            CALL day_init   ! model calendar (using both namelist and restart infos) 
     361      IF( ln_rstart )       CALL rst_read_open 
    359362 
    360363                            CALL sbc_init   ! Forcings : surface module  
     
    363366      !           the environment of ocean BDY. Therefore bdy is called in both OPA and SAS modules.  
    364367      !           This is not clean and should be changed in the future.  
     368#if defined key_bdy 
    365369      IF( lk_bdy        )   CALL     bdy_init 
    366370      IF( lk_bdy        )   CALL bdy_dta_init 
    367371      ! ==> 
     372#endif 
    368373       
    369374      IF(lwp) WRITE(numout,*) 'Euler time step switch is ', neuler 
  • branches/2015/nemo_v3_6_STABLE/NEMOGCM/SETTE/sette.sh

    r6459 r8581  
    8888# 
    8989# Compiler among those in NEMOGCM/ARCH 
    90 COMPILER=X64_ADA 
    91 export BATCH_COMMAND_PAR="llsubmit" 
     90COMPILER=openmpi_NAVITI_MERCATOR 
     91export BATCH_COMMAND_PAR="qsub" 
    9292export BATCH_COMMAND_SEQ=$BATCH_COMMAND_PAR 
    9393export INTERACT_FLAG="no" 
     
    143143# ORCA2_AGRIF_LIM :16 & 17  
    144144#                  18 & 19  
    145 for config in  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 
     145for config in  11 
    146146 
    147147do 
     
    897897    set_namelist namelist_cfg cn_exp \"SAS\" 
    898898    set_namelist namelist_cfg nn_it000 1 
    899     set_namelist namelist_cfg nn_itend 100 
    900     set_namelist namelist_cfg nn_stock 50 
     899    set_namelist namelist_cfg nn_itend 240 
     900    set_namelist namelist_cfg nn_stock 120 
    901901    set_namelist namelist_cfg ln_ctl .false. 
    902902    set_namelist namelist_cfg ln_clobber .true. 
     
    918918    cd ${EXE_DIR} 
    919919    set_namelist namelist_cfg cn_exp \"SAS\" 
    920     set_namelist namelist_cfg nn_it000 51 
    921     set_namelist namelist_cfg nn_itend 100 
     920    set_namelist namelist_cfg nn_it000 121 
     921    set_namelist namelist_cfg nn_itend 240 
    922922    set_namelist namelist_cfg ln_ctl .false. 
    923923    set_namelist namelist_cfg ln_clobber .true. 
     
    926926    set_namelist namelist_cfg jpnj 4 
    927927    set_namelist namelist_cfg jpnij 32 
     928    set_namelist namelist_cfg ln_rstart .true. 
    928929    set_namelist namelist_cfg nn_rstctl 2 
    929     set_namelist namelist_cfg cn_ocerst_in \"SAS_00000050_restart\" 
     930    set_namelist namelist_cfg nn_date0 010106 
     931    set_namelist namelist_cfg cn_ocerst_in \"SAS_00000120_restart\" 
     932    set_namelist namelist_ice_cfg cn_icerst_in \"SAS_00000120_restart_ice\" 
    930933    for (( i=1; i<=$NPROC; i++)) ; do 
    931934        L_NPROC=$(( $i - 1 )) 
    932935        L_NPROC=`printf "%04d\n" ${L_NPROC}` 
    933         ln -sf ../LONG/SAS_00000050_restart_${L_NPROC}.nc . 
     936        ln -sf ../LONG/SAS_00000120_restart_${L_NPROC}.nc . 
     937        ln -sf ../LONG/SAS_00000120_restart_ice_${L_NPROC}.nc . 
    934938    done 
    935939    if [ ${USING_MPMD} == "yes" ] ; then 
Note: See TracChangeset for help on using the changeset viewer.