Changeset 14072 for NEMO/trunk/src/OCE/IOM/restart.F90
- Timestamp:
- 2020-12-04T08:48:38+01:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/trunk/src/OCE/IOM/restart.F90
r14053 r14072 19 19 !! rst_read : read the ocean restart file 20 20 !!---------------------------------------------------------------------- 21 USE oce ! ocean dynamics and tracers 21 USE oce ! ocean dynamics and tracers 22 22 USE dom_oce ! ocean space and time domain 23 USE sbc_ice ! only lk_si3 23 USE sbc_ice ! only lk_si3 24 24 USE phycst ! physical constants 25 25 USE eosbn2 ! equation of state (eos bn2 routine) … … 49 49 !!--------------------------------------------------------------------- 50 50 !! *** ROUTINE rst_opn *** 51 !! 52 !! ** Purpose : + initialization (should be read in the namelist) of nitrst 51 !! 52 !! ** Purpose : + initialization (should be read in the namelist) of nitrst 53 53 !! + open the restart when we are one time step before nitrst 54 54 !! - restart header is defined when kt = nitrst-1 … … 66 66 ! 67 67 IF( kt == nit000 ) THEN ! default definitions 68 lrst_oce = .FALSE. 68 lrst_oce = .FALSE. 69 69 IF( ln_rst_list ) THEN 70 70 nrst_lst = 1 … … 74 74 ENDIF 75 75 ENDIF 76 76 77 77 IF( .NOT. ln_rst_list .AND. nn_stock == -1 ) RETURN ! we will never do any restart 78 78 79 79 ! frequency-based restart dumping (nn_stock) 80 IF( .NOT. ln_rst_list .AND. MOD( kt - 1, nn_stock ) == 0 ) THEN 80 IF( .NOT. ln_rst_list .AND. MOD( kt - 1, nn_stock ) == 0 ) THEN 81 81 ! we use kt - 1 and not kt - nit000 to keep the same periodicity from the beginning of the experiment 82 82 nitrst = kt + nn_stock - 1 ! define the next value of nitrst for restart writing … … 87 87 ! except if we write ocean restart files every time step or if an ocean restart file was writen at nitend - 1 88 88 IF( kt == nitrst - 1 .OR. nn_stock == 1 .OR. ( kt == nitend .AND. .NOT. lrst_oce ) ) THEN 89 IF( nitrst <= nitend .AND. nitrst > 0 ) THEN 89 IF( nitrst <= nitend .AND. nitrst > 0 ) THEN 90 90 ! beware of the format used to write kt (default is i8.8, that should be large enough...) 91 91 IF( nitrst > 999999999 ) THEN ; WRITE(clkt, * ) nitrst … … 115 115 clpname = clname 116 116 ELSE 117 clpname = TRIM(Agrif_CFixed())//"_"//clname 117 clpname = TRIM(Agrif_CFixed())//"_"//clname 118 118 ENDIF 119 119 numrow = iom_xios_setid(TRIM(clpath)//TRIM(clpname)) … … 135 135 !!--------------------------------------------------------------------- 136 136 !! *** ROUTINE rstwrite *** 137 !! 137 !! 138 138 !! ** Purpose : Write restart fields in NetCDF format 139 139 !! … … 164 164 CALL iom_rstput( kt, nitrst, numrow, 'rhop' , rhop ) 165 165 ENDIF 166 167 IF (ln_diurnal) CALL iom_rstput( kt, nitrst, numrow, 'Dsst', x_dsst ) 166 167 IF (ln_diurnal) CALL iom_rstput( kt, nitrst, numrow, 'Dsst', x_dsst ) 168 168 IF( kt == nitrst ) THEN 169 169 IF(.NOT.lwxios) THEN … … 187 187 188 188 SUBROUTINE rst_read_open 189 !!---------------------------------------------------------------------- 189 !!---------------------------------------------------------------------- 190 190 !! *** ROUTINE rst_read_open *** 191 !! 191 !! 192 192 !! ** Purpose : Open read files for NetCDF restart 193 !! 193 !! 194 194 !! ** Method : Use a non-zero, positive value of numror to assess whether or not 195 195 !! the file has already been opened … … 222 222 ! clpname = cn_ocerst_in 223 223 ! ELSE 224 ! clpname = TRIM(Agrif_CFixed())//"_"//cn_ocerst_in 224 ! clpname = TRIM(Agrif_CFixed())//"_"//cn_ocerst_in 225 225 ! ENDIF 226 226 CALL iom_init( cr_ocerst_cxt, kdid = numror, ld_closedef = .TRUE. ) … … 234 234 235 235 SUBROUTINE rst_read( Kbb, Kmm ) 236 !!---------------------------------------------------------------------- 236 !!---------------------------------------------------------------------- 237 237 !! *** ROUTINE rst_read *** 238 !! 238 !! 239 239 !! ** Purpose : Read velocity and T-S fields in the restart file 240 !! 240 !! 241 241 !! ** Method : Read in restart.nc fields which are necessary for restart 242 242 !! … … 255 255 IF(.NOT.lrxios ) CALL iom_delay_rst( 'READ', 'OCE', numror ) ! read only ocean delayed global communication variables 256 256 ! 257 ! !* Diurnal DSST 258 IF( ln_diurnal ) CALL iom_get( numror, jpdom_auto, 'Dsst' , x_dsst ) 259 IF ( ln_diurnal_only ) THEN 257 ! !* Diurnal DSST 258 IF( ln_diurnal ) CALL iom_get( numror, jpdom_auto, 'Dsst' , x_dsst ) 259 IF ( ln_diurnal_only ) THEN 260 260 IF(lwp) WRITE( numout, * ) & 261 & "rst_read:- ln_diurnal_only set, setting rhop=rho0" 261 & "rst_read:- ln_diurnal_only set, setting rhop=rho0" 262 262 rhop = rho0 263 CALL iom_get( numror, jpdom_auto, 'tn' , w3d ) 263 CALL iom_get( numror, jpdom_auto, 'tn' , w3d ) 264 264 ts(:,:,1,jp_tem,Kmm) = w3d(:,:,1) 265 RETURN 266 ENDIF 265 RETURN 266 ENDIF 267 267 ! 268 268 ! !* Read Kmm fields … … 289 289 CALL iom_get( numror, jpdom_auto, 'rhop' , rhop ) ! now potential density 290 290 ELSE 291 CALL eos( ts(:,:,:,:,Kmm), rhd, rhop, gdept(:,:,:,Kmm) ) 291 CALL eos( ts(:,:,:,:,Kmm), rhd, rhop, gdept(:,:,:,Kmm) ) 292 292 ENDIF 293 293 !
Note: See TracChangeset
for help on using the changeset viewer.