- Timestamp:
- 2016-07-19T10:38:35+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/NERC/dev_r5549_BDY_ZEROGRAD/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90
r5407 r6808 9 9 !! 3.3 ! 2010-04 (M. Leclair, G. Madec) modified LF-RA 10 10 !! - - ! 2010-10 (C. Ethe, G. Madec) TRC-TRA merge (T-S in 4D) 11 !! 3.7 ! 2014-01 (G. Madec) suppression of curl and hdiv from the restart 12 !! - ! 2014-12 (G. Madec) remove KPP scheme 11 13 !!---------------------------------------------------------------------- 12 14 … … 18 20 USE oce ! ocean dynamics and tracers 19 21 USE dom_oce ! ocean space and time domain 22 USE sbc_ice ! only lk_lim3 20 23 USE phycst ! physical constants 24 USE eosbn2 ! equation of state (eos bn2 routine) 25 USE trdmxl_oce ! ocean active mixed layer tracers trends variables 26 ! 21 27 USE in_out_manager ! I/O manager 22 28 USE iom ! I/O module 23 USE eosbn2 ! equation of state (eos bn2 routine) 24 USE trdmxl_oce ! ocean active mixed layer tracers trends variables 25 USE divcur ! hor. divergence and curl (div & cur routines) 26 29 USE diurnal_bulk 30 27 31 IMPLICIT NONE 28 32 PRIVATE … … 34 38 35 39 !! * Substitutions 36 # include "domzgr_substitute.h90"37 40 # include "vectopt_loop_substitute.h90" 38 41 !!---------------------------------------------------------------------- … … 92 95 WRITE(numout,*) 93 96 SELECT CASE ( jprstlib ) 94 CASE ( jprstdimg ) ; WRITE(numout,*) &95 ' open ocean restart binary file: ',TRIM(clpath)//clname96 97 CASE DEFAULT ; WRITE(numout,*) & 97 98 ' open ocean restart NetCDF file: ',TRIM(clpath)//clname … … 123 124 !!---------------------------------------------------------------------- 124 125 125 CALL iom_rstput( kt, nitrst, numrow, 'rdt' , rdt ) ! dynamics time step126 CALL iom_rstput( kt, nitrst, numrow, 'rdttra1', rdttra(1) ) ! surface tracer time step 127 126 CALL iom_rstput( kt, nitrst, numrow, 'rdt' , rdt ) ! dynamics and tracer time step 127 128 IF ( .NOT. ln_diurnal_only ) THEN 128 129 CALL iom_rstput( kt, nitrst, numrow, 'ub' , ub ) ! before fields 129 130 CALL iom_rstput( kt, nitrst, numrow, 'vb' , vb ) 130 131 CALL iom_rstput( kt, nitrst, numrow, 'tb' , tsb(:,:,:,jp_tem) ) 131 132 CALL iom_rstput( kt, nitrst, numrow, 'sb' , tsb(:,:,:,jp_sal) ) 132 CALL iom_rstput( kt, nitrst, numrow, 'rotb' , rotb )133 CALL iom_rstput( kt, nitrst, numrow, 'hdivb' , hdivb )134 133 CALL iom_rstput( kt, nitrst, numrow, 'sshb' , sshb ) 135 134 ! … … 138 137 CALL iom_rstput( kt, nitrst, numrow, 'tn' , tsn(:,:,:,jp_tem) ) 139 138 CALL iom_rstput( kt, nitrst, numrow, 'sn' , tsn(:,:,:,jp_sal) ) 140 CALL iom_rstput( kt, nitrst, numrow, 'rotn' , rotn )141 CALL iom_rstput( kt, nitrst, numrow, 'hdivn' , hdivn )142 139 CALL iom_rstput( kt, nitrst, numrow, 'sshn' , sshn ) 143 140 CALL iom_rstput( kt, nitrst, numrow, 'rhop' , rhop ) 144 #if defined key_zdfkpp 145 CALL iom_rstput( kt, nitrst, numrow, 'rhd' , rhd ) 146 #endif 141 142 ! extra variable needed for the ice sheet coupling 143 IF ( ln_iscpl ) THEN 144 CALL iom_rstput( kt, nitrst, numrow, 'tmask' , tmask ) ! need to extrapolate T/S 145 CALL iom_rstput( kt, nitrst, numrow, 'umask' , umask ) ! need to correct barotropic velocity 146 CALL iom_rstput( kt, nitrst, numrow, 'vmask' , vmask ) ! need to correct barotropic velocity 147 CALL iom_rstput( kt, nitrst, numrow, 'smask' , ssmask ) ! need to correct barotropic velocity 148 CALL iom_rstput( kt, nitrst, numrow, 'e3t_n', e3t_n(:,:,:) ) ! need to compute temperature correction 149 CALL iom_rstput( kt, nitrst, numrow, 'e3u_n', e3u_n(:,:,:) ) ! need to compute bt conservation 150 CALL iom_rstput( kt, nitrst, numrow, 'e3v_n', e3v_n(:,:,:) ) ! need to compute bt conservation 151 CALL iom_rstput( kt, nitrst, numrow, 'gdepw_n', gdepw_n(:,:,:) ) ! need to compute extrapolation if vvl 152 END IF 153 ENDIF 154 155 IF (ln_diurnal) CALL iom_rstput( kt, nitrst, numrow, 'Dsst', x_dsst ) 156 147 157 IF( kt == nitrst ) THEN 148 158 CALL iom_close( numrow ) ! close the restart file (only at last time step) … … 179 189 SELECT CASE ( jprstlib ) 180 190 CASE ( jpnf90 ) ; WRITE(numout,*) 'rst_read : read oce NetCDF restart file' 181 CASE ( jprstdimg ) ; WRITE(numout,*) 'rst_read : read oce binary restart file'182 191 END SELECT 183 192 IF ( snc4set%luse ) WRITE(numout,*) 'rst_read : configured with NetCDF4 support' … … 187 196 clpath = TRIM(cn_ocerst_indir) 188 197 IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath) // '/' 189 IF ( jprstlib == jprstdimg ) THEN190 ! eventually read netcdf file (monobloc) for restarting on different number of processors191 ! if {cn_ocerst_in}.nc exists, then set jlibalt to jpnf90192 INQUIRE( FILE = TRIM(cn_ocerst_indir)//'/'//TRIM(cn_ocerst_in)//'.nc', EXIST = llok )193 IF ( llok ) THEN ; jlibalt = jpnf90 ; ELSE ; jlibalt = jprstlib ; ENDIF194 ENDIF195 198 CALL iom_open( TRIM(clpath)//cn_ocerst_in, numror, kiolib = jlibalt ) 196 199 ENDIF 197 200 END SUBROUTINE rst_read_open 201 198 202 199 203 SUBROUTINE rst_read … … 205 209 !! ** Method : Read in restart.nc file fields which are necessary for restart 206 210 !!---------------------------------------------------------------------- 207 REAL(wp) :: zrdt , zrdttra1211 REAL(wp) :: zrdt 208 212 INTEGER :: jk 209 LOGICAL :: llok210 213 !!---------------------------------------------------------------------- 211 214 … … 217 220 IF( zrdt /= rdt ) neuler = 0 218 221 ENDIF 219 IF( iom_varid( numror, 'rdttra1', ldstop = .FALSE. ) > 0 ) THEN 220 CALL iom_get( numror, 'rdttra1', zrdttra1 ) 221 IF( zrdttra1 /= rdttra(1) ) neuler = 0 222 ENDIF 223 ! 222 223 ! Diurnal DSST 224 IF( ln_diurnal ) CALL iom_get( numror, jpdom_autoglo, 'Dsst' , x_dsst ) 225 IF ( ln_diurnal_only ) THEN 226 IF(lwp) WRITE( numout, * ) & 227 & "rst_read:- ln_diurnal_only set, setting rhop=rau0" 228 rhop = rau0 229 CALL iom_get( numror, jpdom_autoglo, 'tn' , tsn(:,:,1,jp_tem) ) 230 RETURN 231 ENDIF 232 224 233 IF( iom_varid( numror, 'ub', ldstop = .FALSE. ) > 0 ) THEN 225 234 CALL iom_get( numror, jpdom_autoglo, 'ub' , ub ) ! before fields … … 227 236 CALL iom_get( numror, jpdom_autoglo, 'tb' , tsb(:,:,:,jp_tem) ) 228 237 CALL iom_get( numror, jpdom_autoglo, 'sb' , tsb(:,:,:,jp_sal) ) 229 CALL iom_get( numror, jpdom_autoglo, 'rotb' , rotb )230 CALL iom_get( numror, jpdom_autoglo, 'hdivb' , hdivb )231 238 CALL iom_get( numror, jpdom_autoglo, 'sshb' , sshb ) 232 239 ELSE … … 239 246 CALL iom_get( numror, jpdom_autoglo, 'sn' , tsn(:,:,:,jp_sal) ) 240 247 CALL iom_get( numror, jpdom_autoglo, 'sshn' , sshn ) 241 IF( iom_varid( numror, 'rotn', ldstop = .FALSE. ) > 0 ) THEN242 CALL iom_get( numror, jpdom_autoglo, 'rotn' , rotn )243 CALL iom_get( numror, jpdom_autoglo, 'hdivn' , hdivn )244 ELSE245 CALL div_cur( 0 ) ! Horizontal divergence & Relative vorticity246 ENDIF247 248 IF( iom_varid( numror, 'rhop', ldstop = .FALSE. ) > 0 ) THEN 248 249 CALL iom_get( numror, jpdom_autoglo, 'rhop' , rhop ) ! now potential density 249 250 ELSE 250 CALL eos ( tsn, rhd, rhop, fsdept_n(:,:,:) ) 251 ENDIF 252 #if defined key_zdfkpp 253 IF( iom_varid( numror, 'rhd', ldstop = .FALSE. ) > 0 ) THEN 254 CALL iom_get( numror, jpdom_autoglo, 'rhd' , rhd ) ! now in situ density anomaly 255 ELSE 256 CALL eos( tsn, rhd, fsdept_n(:,:,:) ) ! compute rhd 257 ENDIF 258 #endif 251 CALL eos( tsn, rhd, rhop, gdept_n(:,:,:) ) 252 ENDIF 259 253 ! 260 254 IF( neuler == 0 ) THEN ! Euler restart (neuler=0) … … 262 256 ub (:,:,:) = un (:,:,:) 263 257 vb (:,:,:) = vn (:,:,:) 264 rotb (:,:,:) = rotn (:,:,:)265 hdivb(:,:,:) = hdivn(:,:,:)266 258 sshb (:,:) = sshn (:,:) 267 268 IF( lk_vvl) THEN259 ! 260 IF( .NOT.ln_linssh ) THEN 269 261 DO jk = 1, jpk 270 fse3t_b(:,:,jk) = fse3t_n(:,:,jk)262 e3t_b(:,:,jk) = e3t_n(:,:,jk) 271 263 END DO 272 264 ENDIF 273 265 ! 274 266 ENDIF 275 267 !
Note: See TracChangeset
for help on using the changeset viewer.