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 3594 for branches/2012/dev_r3452_UKMO9_RESTART/NEMOGCM/NEMO/TOP_SRC/trcrst.F90 – NEMO

Ignore:
Timestamp:
2012-11-19T13:28:55+01:00 (11 years ago)
Author:
rfurner
Message:

code not tested through SETTEE, builds and runs, but has not been thoroughly tested, so will not be included in 2012 merge, however submitted back to keep record of work done for 2013 developments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2012/dev_r3452_UKMO9_RESTART/NEMOGCM/NEMO/TOP_SRC/trcrst.F90

    r3294 r3594  
    6666         ENDIF 
    6767 
    68          IF( MOD( kt - 1, nstock ) == 0 ) THEN 
    69             ! we use kt - 1 and not kt - nittrc000 to keep the same periodicity from the beginning of the experiment 
    70             nitrst = kt + nstock - 1                  ! define the next value of nitrst for restart writing 
    71             IF( nitrst > nitend )   nitrst = nitend   ! make sure we write a restart at the end of the run 
     68         IF ( kt == 0 ) THEN 
     69            nrst = 1    
     70            nitrst = nn_stock( nrst )    
     71            lrst_trc = .FALSE.    
    7272         ENDIF 
    7373      ELSE 
     
    7777      ! to get better performances with NetCDF format: 
    7878      ! we open and define the tracer restart file one tracer time step before writing the data (-> at nitrst - 2*nn_dttrc + 1) 
    79       ! 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. nstock == nn_dttrc .OR. ( kt == nitend - nn_dttrc .AND. .NOT. lrst_trc ) ) THEN 
     79      ! except if we are at the first time step, or if the previous time step we outputted a restart 
     80      IF( kt == nitrst - 2*nn_dttrc .OR. nn_stock(nitrst) == nn_dttrc .OR. ( nn_stock(nrst)==nn_stock(nrst-1)+nn_dttrc ) ) THEN 
    8181         ! beware of the format used to write kt (default is i8.8, that should be large enough) 
    8282         IF( nitrst > 1.0e9 ) THEN   ;   WRITE(clkt,*       ) nitrst 
     
    161161#if ! defined key_trdmld_trc 
    162162          lrst_trc = .FALSE. 
     163          nrst = nrst + 1 
     164          nitrst = nn_stock(nrst) 
    163165#endif 
    164166      ENDIF 
Note: See TracChangeset for help on using the changeset viewer.