Changeset 811 for branches/dev_001_SBC/NEMO/OPA_SRC/restart.F90
- Timestamp:
- 2008-02-07T17:00:12+01:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/dev_001_SBC/NEMO/OPA_SRC/restart.F90
r762 r811 63 63 !!---------------------------------------------------------------------- 64 64 ! 65 IF( kt == nit000 ) THEN ! default initialization, to do: should be read in the namelist... 66 nitrst = nitend ! to do: should be read in the namelist in a cleaver way... 67 lrst_oce = .FALSE. 68 ENDIF 69 70 IF ( kt == nitrst-1 .AND. lrst_oce ) THEN 71 CALL ctl_stop( 'rst_opn: we cannot create an ocean restart at every time step', & 72 & 'if the run has more than one time step!!!' ) 73 numrow = 0 74 ELSEIF( kt == nitrst-1 .OR. nitend == nit000 ) THEN ! beware if model runs only one time step 75 ! beware of the format used to write kt (default is i8.8, that should be large enough) 76 IF( nitrst > 1.0e9 ) THEN 77 WRITE(clkt,*) nitrst 78 ELSE 79 WRITE(clkt,'(i8.8)') nitrst 65 IF( kt == nit000 ) THEN ! default definitions 66 lrst_oce = .FALSE. 67 nitrst = nitend 68 ENDIF 69 IF( MOD( kt - 1, nstock ) == 0 ) THEN 70 ! we use kt - 1 and not kt - nit000 to keep the same periodicity from the beginning of the experiment 71 nitrst = kt + nstock - 1 ! define the next value of nitrst for restart writing 72 IF( nitrst > nitend ) nitrst = nitend ! make sure we write a restart at the end of the run 73 ENDIF 74 75 ! to get better performances with NetCDF format: 76 ! we open and define the ocean restart file one time step before writing the data (-> at nitrst - 1) 77 ! except if we write ocean restart files every time step or if an ocean restart file was writen at nitend - 1 78 IF( kt == nitrst - 1 .OR. nstock == 1 .OR. ( kt == nitend .AND. .NOT. lrst_oce ) ) THEN 79 ! beware of the format used to write kt (default is i8.8, that should be large enough...) 80 IF( nitrst > 999999999 ) THEN ; WRITE(clkt, * ) nitrst 81 ELSE ; WRITE(clkt, '(i8.8)') nitrst 80 82 ENDIF 81 83 ! create the file … … 84 86 WRITE(numout,*) 85 87 SELECT CASE ( jprstlib ) 86 CASE ( jpnf90 ) 87 WRITE(numout,*) ' open ocean restart.output NetCDF file: '//clname 88 CASE ( jprstdimg ) 89 WRITE(numout,*) ' open ocean restart.output binary file: '//clname 88 CASE ( jprstdimg ) ; WRITE(numout,*) ' open ocean restart binary file: '//clname 89 CASE DEFAULT ; WRITE(numout,*) ' open ocean restart NetCDF file: '//clname 90 90 END SELECT 91 IF( kt == nitrst-1 ) THEN 92 WRITE(numout,*) ' kt = nitrst - 1 = ', kt,' date= ', ndastp 93 ELSE 94 WRITE(numout,*) ' kt = ', kt,' date= ', ndastp 91 IF( kt == nitrst - 1 ) THEN ; WRITE(numout,*) ' kt = nitrst - 1 = ', kt,' date= ', ndastp 92 ELSE ; WRITE(numout,*) ' kt = ' , kt,' date= ', ndastp 95 93 ENDIF 96 94 ENDIF … … 114 112 INTEGER, INTENT(in) :: kt ! ocean time-step 115 113 !!---------------------------------------------------------------------- 114 115 IF( kt == nitrst ) THEN 116 IF(lwp) WRITE(numout,*) 117 IF(lwp) WRITE(numout,*) 'rst_write : write oce restart file kt =', kt 118 IF(lwp) WRITE(numout,*) '~~~~~~~' 119 ENDIF 116 120 117 121 ! calendar control
Note: See TracChangeset
for help on using the changeset viewer.