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 4780 for branches/2014/dev_r4650_UKMO11_restart_functionality – NEMO

Ignore:
Timestamp:
2014-09-19T18:45:49+02:00 (10 years ago)
Author:
edblockley
Message:

Second commit in UKMO11 development branch.

This change allows the user to replace the nn_stock frequency-based restart dump writing functionality with a list-based version (nn_stocklist).
This is conterolled using the logical ln_rst_list which defaults to false.
At present the list is hard-wired to have maximum 10 entries but this could be modified if required.

Ed

Location:
branches/2014/dev_r4650_UKMO11_restart_functionality/NEMOGCM
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/2014/dev_r4650_UKMO11_restart_functionality/NEMOGCM/CONFIG/SHARED/1_namelist_ref

    r4775 r4780  
    4040   cn_ocerst_outdir = "."      !  directory in which to write output ocean restarts 
    4141   nn_istate   =       0   !  output the initial state (1) or not (0) 
     42   ln_rst_list = .false.   !  output restarts at list of times using nn_stocklist (T) or at set frequency with nn_stock (F) 
    4243   nn_stock    =    5475   !  frequency of creation of a restart file (modulo referenced to 1) 
    4344   nn_write    =    5475   !  frequency of write in the output file   (modulo referenced to nn_it000) 
  • branches/2014/dev_r4650_UKMO11_restart_functionality/NEMOGCM/CONFIG/SHARED/namelist_ref

    r4775 r4780  
    4141   cn_ocerst_outdir = "."      !  directory in which to write output ocean restarts 
    4242   nn_istate   =       0   !  output the initial state (1) or not (0) 
     43   ln_rst_list = .false.   !  output restarts at list of times using nn_stocklist (T) or at set frequency with nn_stock (F) 
    4344   nn_stock    =    5475   !  frequency of creation of a restart file (modulo referenced to 1) 
    4445   nn_write    =    5475   !  frequency of write in the output file   (modulo referenced to nn_it000) 
  • branches/2014/dev_r4650_UKMO11_restart_functionality/NEMOGCM/NEMO/LIM_SRC_2/limrst_2.F90

    r4775 r4780  
    5959      ! except if we write ice restart files every ice time step or if an ice restart file was writen at nitend - 2*nn_fsbc + 1 
    6060      IF( kt == nitrst - 2*nn_fsbc + 1 .OR. nstock == nn_fsbc .OR. ( kt == nitend - nn_fsbc + 1 .AND. .NOT. lrst_ice ) ) THEN 
    61          ! beware of the format used to write kt (default is i8.8, that should be large enough...) 
    62          IF( nitrst > 99999999 ) THEN   ;   WRITE(clkt, *       ) nitrst 
    63          ELSE                           ;   WRITE(clkt, '(i8.8)') nitrst 
     61         IF( nitrst <= nitend .AND. nitrst > 0 ) THEN 
     62            ! beware of the format used to write kt (default is i8.8, that should be large enough...) 
     63            IF( nitrst > 99999999 ) THEN   ;   WRITE(clkt, *       ) nitrst 
     64            ELSE                           ;   WRITE(clkt, '(i8.8)') nitrst 
     65            ENDIF 
     66            ! create the file 
     67            clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_icerst_out) 
     68            clpath = TRIM(cn_icerst_outdir)  
     69            IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath)//'/'  
     70            IF(lwp) THEN 
     71               WRITE(numout,*) 
     72               SELECT CASE ( jprstlib ) 
     73               CASE ( jprstdimg ) 
     74                  WRITE(numout,*) '             open ice restart binary file: ',TRIM(clpath)//clname 
     75               CASE DEFAULT 
     76                  WRITE(numout,*) '             open ice restart NetCDF file: ',TRIM(clpath)//clname 
     77               END SELECT 
     78               IF( kt == nitrst - 2*nn_fsbc + 1 ) THEN    
     79                  WRITE(numout,*)         '             kt = nitrst - 2*nn_fsbc + 1 = ', kt,' date= ', ndastp 
     80               ELSE   ;   WRITE(numout,*) '             kt = '                         , kt,' date= ', ndastp 
     81               ENDIF 
     82            ENDIF 
     83 
     84            CALL iom_open( TRIM(clpath)//TRIM(clname), numriw, ldwrt = .TRUE., kiolib = jprstlib ) 
     85            lrst_ice = .TRUE. 
    6486         ENDIF 
    65          ! create the file 
    66          clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_icerst_out) 
    67          clpath = TRIM(cn_icerst_outdir)  
    68          IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath)//'/'  
    69          IF(lwp) THEN 
    70             WRITE(numout,*) 
    71             SELECT CASE ( jprstlib ) 
    72             CASE ( jprstdimg ) 
    73                WRITE(numout,*) '             open ice restart binary file: ',TRIM(clpath)//clname 
    74             CASE DEFAULT 
    75                WRITE(numout,*) '             open ice restart NetCDF file: ',TRIM(clpath)//clname 
    76             END SELECT 
    77             IF( kt == nitrst - 2*nn_fsbc + 1 ) THEN    
    78                WRITE(numout,*)         '             kt = nitrst - 2*nn_fsbc + 1 = ', kt,' date= ', ndastp 
    79             ELSE   ;   WRITE(numout,*) '             kt = '                         , kt,' date= ', ndastp 
    80             ENDIF 
    81          ENDIF 
    82  
    83          CALL iom_open( TRIM(clpath)//TRIM(clname), numriw, ldwrt = .TRUE., kiolib = jprstlib ) 
    84          lrst_ice = .TRUE. 
    8587      ENDIF 
    8688      ! 
  • branches/2014/dev_r4650_UKMO11_restart_functionality/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90

    r4775 r4780  
    6565      IF( kt == nitrst - 2*nn_fsbc + 1 .OR. nstock == nn_fsbc    & 
    6666         &                             .OR. ( kt == nitend - nn_fsbc + 1 .AND. .NOT. lrst_ice ) ) THEN 
    67          ! beware of the format used to write kt (default is i8.8, that should be large enough...) 
    68          IF( nitrst > 99999999 ) THEN   ;   WRITE(clkt, *       ) nitrst 
    69          ELSE                           ;   WRITE(clkt, '(i8.8)') nitrst 
     67         IF( nitrst <= nitend .AND. nitrst > 0 ) THEN 
     68            ! beware of the format used to write kt (default is i8.8, that should be large enough...) 
     69            IF( nitrst > 99999999 ) THEN   ;   WRITE(clkt, *       ) nitrst 
     70            ELSE                           ;   WRITE(clkt, '(i8.8)') nitrst 
     71            ENDIF 
     72            ! create the file 
     73            clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_icerst_out) 
     74            clpath = TRIM(cn_icerst_outdir)  
     75            IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath)//'/' 
     76            IF(lwp) THEN 
     77               WRITE(numout,*) 
     78               SELECT CASE ( jprstlib ) 
     79               CASE ( jprstdimg ) 
     80                  WRITE(numout,*) '             open ice restart binary file: ',TRIM(clpath)//clname 
     81               CASE DEFAULT 
     82                  WRITE(numout,*) '             open ice restart NetCDF file: ',TRIM(clpath)//clname 
     83               END SELECT 
     84               IF( kt == nitrst - 2*nn_fsbc + 1 ) THEN    
     85                  WRITE(numout,*)         '             kt = nitrst - 2*nn_fsbc + 1 = ', kt,' date= ', ndastp 
     86               ELSE   ;   WRITE(numout,*) '             kt = '                         , kt,' date= ', ndastp 
     87               ENDIF 
     88            ENDIF 
     89            ! 
     90            CALL iom_open( TRIM(clpath)//TRIM(clname), numriw, ldwrt = .TRUE., kiolib = jprstlib ) 
     91            lrst_ice = .TRUE. 
    7092         ENDIF 
    71          ! create the file 
    72          clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_icerst_out) 
    73          clpath = TRIM(cn_icerst_outdir)  
    74          IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath)//'/' 
    75          IF(lwp) THEN 
    76             WRITE(numout,*) 
    77             SELECT CASE ( jprstlib ) 
    78             CASE ( jprstdimg ) 
    79                WRITE(numout,*) '             open ice restart binary file: ',TRIM(clpath)//clname 
    80             CASE DEFAULT 
    81                WRITE(numout,*) '             open ice restart NetCDF file: ',TRIM(clpath)//clname 
    82             END SELECT 
    83             IF( kt == nitrst - 2*nn_fsbc + 1 ) THEN    
    84                WRITE(numout,*)         '             kt = nitrst - 2*nn_fsbc + 1 = ', kt,' date= ', ndastp 
    85             ELSE   ;   WRITE(numout,*) '             kt = '                         , kt,' date= ', ndastp 
    86             ENDIF 
    87          ENDIF 
    88          ! 
    89          CALL iom_open( TRIM(clpath)//TRIM(clname), numriw, ldwrt = .TRUE., kiolib = jprstlib ) 
    90          lrst_ice = .TRUE. 
    9193      ENDIF 
    9294      ! 
  • branches/2014/dev_r4650_UKMO11_restart_functionality/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90

    r4775 r4780  
    135135      !!---------------------------------------------------------------------- 
    136136      USE ioipsl 
    137       NAMELIST/namrun/ cn_ocerst_indir, cn_ocerst_outdir,                                          & 
     137      NAMELIST/namrun/ cn_ocerst_indir, cn_ocerst_outdir, nn_stocklist, ln_rst_list,               & 
    138138         &             nn_no   , cn_exp    , cn_ocerst_in, cn_ocerst_out, ln_rstart , nn_rstctl,   & 
    139139         &             nn_it000, nn_itend  , nn_date0    , nn_leapy     , nn_istate , nn_stock ,   & 
     
    181181         WRITE(numout,*) '      leap year calendar (0/1)        nn_leapy   = ', nn_leapy 
    182182         WRITE(numout,*) '      initial state output            nn_istate  = ', nn_istate 
    183          WRITE(numout,*) '      frequency of restart file       nn_stock   = ', nn_stock 
     183         IF( ln_rst_list ) THEN 
     184            WRITE(numout,*) '      list of restart dump times      nn_stocklist   =', nn_stocklist 
     185         ELSE 
     186            WRITE(numout,*) '      frequency of restart file       nn_stock   = ', nn_stock 
     187         ENDIF 
    184188         WRITE(numout,*) '      frequency of output file        nn_write   = ', nn_write 
    185189         WRITE(numout,*) '      multi file dimgout              ln_dimgnnn = ', ln_dimgnnn 
     
    198202      ninist = nn_istate 
    199203      nstock = nn_stock 
     204      nstocklist = nn_stocklist 
    200205      nwrite = nn_write 
    201206      neuler = nn_euler 
    202       IF ( neuler == 1 .AND. .NOT.ln_rstart ) THEN 
     207      IF ( neuler == 1 .AND. .NOT. ln_rstart ) THEN 
    203208         WRITE(ctmp1,*) 'ln_rstart =.FALSE., nn_euler is forced to 0 ' 
    204209         CALL ctl_warn( ctmp1 ) 
  • branches/2014/dev_r4650_UKMO11_restart_functionality/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90

    r4775 r4780  
    3030   CHARACTER(lc) ::   cn_ocerst_outdir !: restart output directory 
    3131   LOGICAL       ::   ln_rstart        !: start from (F) rest or (T) a restart file 
     32   LOGICAL       ::   ln_rst_list      !: output restarts at list of times (T) or by frequency (F) 
    3233   INTEGER       ::   nn_no            !: job number 
    3334   INTEGER       ::   nn_rstctl        !: control of the time step (0, 1 or 2) 
     
    4041   INTEGER       ::   nn_write         !: model standard output frequency 
    4142   INTEGER       ::   nn_stock         !: restart file frequency 
     43   INTEGER, DIMENSION(10) :: nn_stocklist  !: restart dump times 
    4244   LOGICAL       ::   ln_dimgnnn       !: type of dimgout. (F): 1 file for all proc 
    4345                                                       !:                  (T): 1 file per proc 
     
    8082   INTEGER       ::   nwrite                      !: model standard output frequency 
    8183   INTEGER       ::   nstock                      !: restart file frequency 
     84   INTEGER, DIMENSION(10) :: nstocklist           !: restart dump times 
    8285 
    8386   !!---------------------------------------------------------------------- 
     
    8790   LOGICAL ::   lrst_oce              !: logical to control the oce restart write  
    8891   INTEGER ::   numror, numrow        !: logical unit for cean restart (read and write) 
     92   INTEGER ::   nrst_lst              !: number of restart to output next 
    8993 
    9094   !!---------------------------------------------------------------------- 
  • branches/2014/dev_r4650_UKMO11_restart_functionality/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90

    r4775 r4780  
    6363      IF( kt == nit000 ) THEN   ! default definitions 
    6464         lrst_oce = .FALSE.    
    65          nitrst = nitend 
    66       ENDIF 
    67       IF( MOD( kt - 1, nstock ) == 0 ) THEN    
     65         IF( ln_rst_list ) THEN 
     66            nrst_lst = 1 
     67            nitrst = nstocklist( nrst_lst ) 
     68         ELSE 
     69            nitrst = nitend 
     70         ENDIF 
     71      ENDIF 
     72 
     73      ! frequency-based restart dumping (nn_stock) 
     74      IF( .NOT. ln_rst_list .AND. MOD( kt - 1, nstock ) == 0 ) THEN    
    6875         ! we use kt - 1 and not kt - nit000 to keep the same periodicity from the beginning of the experiment 
    6976         nitrst = kt + nstock - 1                  ! define the next value of nitrst for restart writing 
     
    7481      ! except if we write ocean restart files every time step or if an ocean restart file was writen at nitend - 1 
    7582      IF( kt == nitrst - 1 .OR. nstock == 1 .OR. ( kt == nitend .AND. .NOT. lrst_oce ) ) THEN 
    76          ! beware of the format used to write kt (default is i8.8, that should be large enough...) 
    77          IF( nitrst > 999999999 ) THEN   ;   WRITE(clkt, *       ) nitrst 
    78          ELSE                            ;   WRITE(clkt, '(i8.8)') nitrst 
    79          ENDIF 
    80          ! create the file 
    81          clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_ocerst_out) 
    82          clpath = TRIM(cn_ocerst_outdir) 
    83          IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath) // '/' 
    84          IF(lwp) THEN 
    85             WRITE(numout,*) 
    86             SELECT CASE ( jprstlib ) 
    87             CASE ( jprstdimg )   ;   WRITE(numout,*)                            & 
    88                 '             open ocean restart binary file: ',TRIM(clpath)//clname 
    89             CASE DEFAULT         ;   WRITE(numout,*)                            & 
    90                 '             open ocean restart NetCDF file: ',TRIM(clpath)//clname 
    91             END SELECT 
    92             IF ( snc4set%luse )      WRITE(numout,*) '             opened for NetCDF4 chunking and compression' 
    93             IF( kt == nitrst - 1 ) THEN   ;   WRITE(numout,*) '             kt = nitrst - 1 = ', kt 
    94             ELSE                          ;   WRITE(numout,*) '             kt = '             , kt 
     83         IF( nitrst <= nitend .AND. nitrst > 0 ) THEN  
     84            ! beware of the format used to write kt (default is i8.8, that should be large enough...) 
     85            IF( nitrst > 999999999 ) THEN   ;   WRITE(clkt, *       ) nitrst 
     86            ELSE                            ;   WRITE(clkt, '(i8.8)') nitrst 
    9587            ENDIF 
    96          ENDIF 
    97          ! 
    98          CALL iom_open( TRIM(clpath)//TRIM(clname), numrow, ldwrt = .TRUE., kiolib = jprstlib ) 
    99          lrst_oce = .TRUE. 
     88            ! create the file 
     89            clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_ocerst_out) 
     90            clpath = TRIM(cn_ocerst_outdir) 
     91            IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath) // '/' 
     92            IF(lwp) THEN 
     93               WRITE(numout,*) 
     94               SELECT CASE ( jprstlib ) 
     95               CASE ( jprstdimg )   ;   WRITE(numout,*)                            & 
     96                   '             open ocean restart binary file: ',TRIM(clpath)//clname 
     97               CASE DEFAULT         ;   WRITE(numout,*)                            & 
     98                   '             open ocean restart NetCDF file: ',TRIM(clpath)//clname 
     99               END SELECT 
     100               IF ( snc4set%luse )      WRITE(numout,*) '             opened for NetCDF4 chunking and compression' 
     101               IF( kt == nitrst - 1 ) THEN   ;   WRITE(numout,*) '             kt = nitrst - 1 = ', kt 
     102               ELSE                          ;   WRITE(numout,*) '             kt = '             , kt 
     103               ENDIF 
     104            ENDIF 
     105            ! 
     106            CALL iom_open( TRIM(clpath)//TRIM(clname), numrow, ldwrt = .TRUE., kiolib = jprstlib ) 
     107            lrst_oce = .TRUE. 
     108         ENDIF 
    100109      ENDIF 
    101110      ! 
     
    144153      IF( kt == nitrst ) THEN 
    145154         CALL iom_close( numrow )     ! close the restart file (only at last time step) 
    146          IF( .NOT. lk_trdmld )   lrst_oce = .FALSE. 
     155         IF( .NOT. lk_trdmld ) THEN 
     156            IF( ln_rst_list ) THEN 
     157               nrst_lst = nrst_lst + 1 
     158               nitrst = nstocklist( nrst_lst ) 
     159            ENDIF 
     160            lrst_oce = .FALSE. 
     161         ENDIF 
    147162      ENDIF 
    148163      ! 
Note: See TracChangeset for help on using the changeset viewer.