Changeset 1239 for trunk/NEMO/OPA_SRC/restart.F90
- Timestamp:
- 2008-12-31T10:35:35+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMO/OPA_SRC/restart.F90
r1229 r1239 24 24 USE eosbn2 ! equation of state (eos bn2 routine) 25 25 USE trdmld_oce ! ocean active mixed layer tracers trends variables 26 #if defined key_zdftke2 27 USE zdf_oce 28 #endif 26 29 27 30 IMPLICIT NONE … … 64 67 lrst_oce = .FALSE. 65 68 nitrst = nitend 69 #if defined key_zdftke2 70 nitrst_tke2 = nitrst + 1 71 #endif 66 72 ENDIF 67 73 IF( MOD( kt - 1, nstock ) == 0 ) THEN … … 70 76 IF( nitrst > nitend ) nitrst = nitend ! make sure we write a restart at the end of the run 71 77 ENDIF 72 78 #if defined key_zdftke2 79 IF ( nitrst_tke2 .NE. kt ) nitrst_tke2 = nitrst + 1 80 #endif 73 81 ! to get better performances with NetCDF format: 74 82 ! we open and define the ocean restart file one time step before writing the data (-> at nitrst - 1) … … 110 118 INTEGER, INTENT(in) :: kt ! ocean time-step 111 119 !!---------------------------------------------------------------------- 120 121 #if defined key_zdftke2 122 IF( kt == nitrst_tke2 ) THEN 123 CALL iom_close( numrow ) ! close the restart file (only at last time step) 124 IF( .NOT. lk_trdmld ) lrst_oce = .FALSE. 125 ELSE 126 #endif 112 127 ! ! the begining of the run [s] 113 128 CALL iom_rstput( kt, nitrst, numrow, 'rdt' , rdt ) ! dynamics time step … … 129 144 CALL iom_rstput( kt, nitrst, numrow, 'hdivn' , hdivn ) 130 145 146 #if defined key_zdftke2 147 CALL iom_rstput( kt, nitrst, numrow, 'rhop' , rhop ) 148 #endif 131 149 IF( nn_dynhpg_rst == 1 .OR. lk_vvl ) THEN 132 150 CALL iom_rstput( kt, nitrst, numrow, 'rhd' , rhd ) 151 #if defined key_zdftke2 152 CALL iom_rstput( kt, nitrst, numrow, 'rn2' , rn2 ) 153 CALL iom_rstput( kt, nitrst, numrow, 'avt' , avt ) 154 ENDIF 155 #else 133 156 CALL iom_rstput( kt, nitrst, numrow, 'rhop', rhop ) 157 #endif 134 158 IF( ln_zps ) THEN 135 159 CALL iom_rstput( kt, nitrst, numrow, 'gtu' , gtu ) … … 141 165 ENDIF 142 166 ENDIF 143 167 #if ! defined key_zdftke2 144 168 IF( kt == nitrst ) THEN 145 169 CALL iom_close( numrow ) ! close the restart file (only at last time step) 146 170 IF( .NOT. lk_trdmld ) lrst_oce = .FALSE. 147 171 ENDIF 172 #endif 148 173 ! 149 174 END SUBROUTINE rst_write … … 163 188 !! - barotropic stream function arrays ("key_dynspg_rl" defined) 164 189 !! or free surface arrays 165 !! - tke arrays (lk_zdftke=T )190 !! - tke arrays (lk_zdftke=T .OR. lk_zdftke2=T) 166 191 !! for this last three records, the previous characteristics 167 192 !! could be different with those used in the present run. … … 215 240 ENDIF 216 241 242 #if defined key_zdftke2 243 CALL eos( tb, sb, rhd, rhop ) ! before potential and in situ densities 244 IF( iom_varid( numror, 'rhd', ldstop = .FALSE. ) > 0 ) THEN 245 CALL iom_get( numror, jpdom_autoglo, 'rhd' , rhd ) 246 ENDIF 247 IF( iom_varid( numror, 'rhop', ldstop = .FALSE. ) > 0 ) THEN 248 CALL iom_get( numror, jpdom_autoglo, 'rhop', rhop ) 249 ENDIF 250 #else 217 251 IF( iom_varid( numror, 'rhd', ldstop = .FALSE. ) > 0 ) THEN 218 252 CALL iom_get( numror, jpdom_autoglo, 'rhd' , rhd ) … … 221 255 CALL eos( tb, sb, rhd, rhop ) ! before potential and in situ densities 222 256 ENDIF 257 #endif 258 #if defined key_zdftke2 259 CALL eos_init ! usefull to get the equation state type neos parameter 260 IF( iom_varid( numror, 'rn2', ldstop = .FALSE. ) > 0 ) THEN 261 CALL iom_get( numror, jpdom_autoglo, 'rn2' , rn2 ) 262 ELSE 263 IF ( ln_dynhpg_imp ) THEN 264 CALL bn2( tb, sb, rn2 ) ! before Brunt-Vaisala frequency 265 ENDIF 266 ENDIF 267 IF( iom_varid( numror, 'avt', ldstop = .FALSE. ) > 0 ) THEN 268 CALL iom_get( numror, jpdom_autoglo, 'avt' , avt ) 269 ELSE 270 IF ( ln_dynhpg_imp ) avt (:,:,:) = 1.2e-5 * tmask(:,:,:) 271 ENDIF 272 #endif 273 223 274 IF( ln_zps .AND. .NOT. lk_c1d ) THEN 224 275 IF( iom_varid( numror, 'gtu', ldstop = .FALSE. ) > 0 ) THEN
Note: See TracChangeset
for help on using the changeset viewer.