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 15596 for NEMO/releases/r4.0/r4.0-HEAD/src/TOP – NEMO

Ignore:
Timestamp:
2021-12-13T17:28:47+01:00 (3 years ago)
Author:
acc
Message:

Changes to restart.F90 and trcrst.F90 to address #2735 and cope with requests in nn_stocklist outside the simulation period. These changes also enable a restart file to be generated on nit000, if requested, and will force a restart at nitend even if it is not explicitly listed in nn_stocklist. This closes #2735

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/releases/r4.0/r4.0-HEAD/src/TOP/trcrst.F90

    r11536 r15596  
    5757            lrst_trc = .FALSE. 
    5858            IF( ln_rst_list ) THEN 
    59                nrst_lst = 1 
    60                nitrst = nn_stocklist( nrst_lst ) 
     59               ! Protect against user requests outside of simulation period (#2735) 
     60               nitrst   = MIN( nitend, MINVAL( nn_stocklist, MASK=nn_stocklist.ge.nit000) ) 
     61               nrst_lst = MAX( 1, FINDLOC( nn_stocklist, nitrst, DIM=1 ) ) 
    6162            ELSE 
    6263               nitrst = nitend 
     
    7879      ! we open and define the tracer restart file one tracer time step before writing the data (-> at nitrst - 2*nn_dttrc + 1) 
    7980      ! except if we write tracer restart files every tracer time step or if a tracer restart file was writen at nitend - 2*nn_dttrc + 1 
    80       IF( kt == nitrst - 2*nn_dttrc .OR. nn_stock == nn_dttrc .OR. ( kt == nitend - nn_dttrc .AND. .NOT. lrst_trc ) ) THEN 
     81      ! or if nit000 is requested in the nn_stocklist 
     82      IF( kt == nitrst - 2*nn_dttrc .OR. nn_stock == nn_dttrc .OR. ( kt == nitend - nn_dttrc .AND. .NOT. lrst_trc ) & 
     83      &                                                       .OR. ( kt == nit000 .AND. nitrst == nit000 ) ) THEN 
    8184         ! beware of the format used to write kt (default is i8.8, that should be large enough) 
    8285         IF( nitrst > 1.0e9 ) THEN   ;   WRITE(clkt,*       ) nitrst 
Note: See TracChangeset for help on using the changeset viewer.