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/OPA_SRC/IOM/restart.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/OPA_SRC/IOM/restart.F90

    r3294 r3594  
    5757      INTEGER, INTENT(in) ::   kt     ! ocean time-step 
    5858      !! 
    59       CHARACTER(LEN=20)   ::   clkt     ! ocean time-step deine as a character 
    60       CHARACTER(LEN=50)   ::   clname   ! ice output restart file name 
     59      CHARACTER(LEN=20)   ::   clkt   ! ocean time-step defined as a character 
     60      CHARACTER(LEN=50)   ::   clname ! ice output restart file name 
     61      INTEGER             ::   js     ! dummy loop variable 
    6162      !!---------------------------------------------------------------------- 
    6263      ! 
    6364      IF( kt == nit000 ) THEN   ! default definitions 
    6465         lrst_oce = .FALSE.    
    65          nitrst = nitend 
    66       ENDIF 
    67       IF( MOD( kt - 1, nstock ) == 0 ) THEN    
    68          ! we use kt - 1 and not kt - nit000 to keep the same periodicity from the beginning of the experiment 
    69          nitrst = kt + nstock - 1                  ! define the next value of nitrst for restart writing 
    70          IF( nitrst > nitend )   nitrst = nitend   ! make sure we write a restart at the end of the run 
    71       ENDIF 
     66         nrst = 1 
     67         nitrst = nn_stock( nrst ) 
     68      ENDIF 
     69 
    7270      ! to get better performances with NetCDF format: 
    7371      ! we open and define the ocean restart file one time step before writing the data (-> at nitrst - 1) 
    74       ! except if we write ocean restart files every time step or if an ocean restart file was writen at nitend - 1 
    75       IF( kt == nitrst - 1 .OR. nstock == 1 .OR. ( kt == nitend .AND. .NOT. lrst_oce ) ) THEN 
     72      ! except if we are at the first time step, or if the previous time step we outputted a restart 
     73      IF ( kt == nitrst - 1 .OR. nn_stock(nrst) == 1 .OR. nn_stock(nrst)==nn_stock(nrst-1)+1 ) THEN 
    7674         ! beware of the format used to write kt (default is i8.8, that should be large enough...) 
    7775         IF( nitrst > 999999999 ) THEN   ;   WRITE(clkt, *       ) nitrst 
     
    135133#endif 
    136134      IF( kt == nitrst ) THEN 
    137          CALL iom_close( numrow )     ! close the restart file (only at last time step) 
    138          IF( .NOT. lk_trdmld )   lrst_oce = .FALSE. 
     135         CALL iom_close( numrow )     ! close the restart file (only on the dump time step) 
     136         IF( .NOT. lk_trdmld ) THEN 
     137            lrst_oce = .FALSE. 
     138            nrst = nrst + 1    
     139            nitrst = nn_stock( nrst )  
     140         ENDIF 
    139141      ENDIF 
    140142      ! 
Note: See TracChangeset for help on using the changeset viewer.