- Timestamp:
- 2015-11-20T09:39:06+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/TOP_SRC/trcrst.F90
r5038 r5901 25 25 USE oce_trc 26 26 USE trc 27 USE trcnam_trp28 27 USE iom 29 28 USE daymod … … 37 36 38 37 !! * Substitutions 39 # include " top_substitute.h90"38 # include "domzgr_substitute.h90" 40 39 41 40 CONTAINS … … 51 50 CHARACTER(LEN=20) :: clkt ! ocean time-step define as a character 52 51 CHARACTER(LEN=50) :: clname ! trc output restart file name 52 CHARACTER(LEN=256) :: clpath ! full path to ocean output restart file 53 53 !!---------------------------------------------------------------------- 54 54 ! … … 56 56 IF( kt == nittrc000 ) THEN 57 57 lrst_trc = .FALSE. 58 nitrst = nitend 59 ENDIF 60 61 IF( MOD( kt - 1, nstock ) == 0 ) THEN 58 IF( ln_rst_list ) THEN 59 nrst_lst = 1 60 nitrst = nstocklist( nrst_lst ) 61 ELSE 62 nitrst = nitend 63 ENDIF 64 ENDIF 65 66 IF( .NOT. ln_rst_list .AND. MOD( kt - 1, nstock ) == 0 ) THEN 62 67 ! we use kt - 1 and not kt - nittrc000 to keep the same periodicity from the beginning of the experiment 63 68 nitrst = kt + nstock - 1 ! define the next value of nitrst for restart writing … … 79 84 IF(lwp) WRITE(numout,*) 80 85 clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_trcrst_out) 81 IF(lwp) WRITE(numout,*) ' open trc restart.output NetCDF file: '//clname 82 CALL iom_open( clname, numrtw, ldwrt = .TRUE., kiolib = jprstlib ) 86 clpath = TRIM(cn_trcrst_outdir) 87 IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath) // '/' 88 IF(lwp) WRITE(numout,*) & 89 ' open trc restart.output NetCDF file: ',TRIM(clpath)//clname 90 CALL iom_open( TRIM(clpath)//TRIM(clname), numrtw, ldwrt = .TRUE., kiolib = jprstlib ) 83 91 lrst_trc = .TRUE. 84 92 ENDIF … … 140 148 lrst_trc = .FALSE. 141 149 #endif 150 IF( lk_offline .AND. ln_rst_list ) THEN 151 nrst_lst = nrst_lst + 1 152 nitrst = nstocklist( nrst_lst ) 153 ENDIF 142 154 ENDIF 143 155 ! … … 190 202 ! eventually read netcdf file (monobloc) for restarting on different number of processors 191 203 ! if {cn_trcrst_in}.nc exists, then set jlibalt to jpnf90 192 INQUIRE( FILE = TRIM(cn_trcrst_in )//'.nc', EXIST = llok )204 INQUIRE( FILE = TRIM(cn_trcrst_indir)//'/'//TRIM(cn_trcrst_in)//'.nc', EXIST = llok ) 193 205 IF ( llok ) THEN ; jlibalt = jpnf90 ; ELSE ; jlibalt = jprstlib ; ENDIF 194 206 ENDIF 195 207 196 CALL iom_open( cn_trcrst_in, numrtr, kiolib = jlibalt ) 197 198 CALL iom_get ( numrtr, 'kt', zkt ) ! last time-step of previous run 199 200 IF(lwp) THEN 201 WRITE(numout,*) ' *** Info read in restart : ' 202 WRITE(numout,*) ' previous time-step : ', NINT( zkt ) 203 WRITE(numout,*) ' *** restart option' 204 SELECT CASE ( nn_rsttr ) 205 CASE ( 0 ) ; WRITE(numout,*) ' nn_rsttr = 0 : no control of nittrc000' 206 CASE ( 1 ) ; WRITE(numout,*) ' nn_rsttr = 1 : no control the date at nittrc000 (use ndate0 read in the namelist)' 207 CASE ( 2 ) ; WRITE(numout,*) ' nn_rsttr = 2 : calendar parameters read in restart' 208 END SELECT 209 WRITE(numout,*) 210 ENDIF 211 ! Control of date 212 IF( nittrc000 - NINT( zkt ) /= nn_dttrc .AND. nn_rsttr /= 0 ) & 213 & CALL ctl_stop( ' ===>>>> : problem with nittrc000 for the restart', & 214 & ' verify the restart file or rerun with nn_rsttr = 0 (namelist)' ) 215 IF( lk_offline ) THEN ! set the date in offline mode 216 ! Check dynamics and tracer time-step consistency and force Euler restart if changed 217 IF( iom_varid( numrtr, 'rdttrc1', ldstop = .FALSE. ) > 0 ) THEN 218 CALL iom_get( numrtr, 'rdttrc1', zrdttrc1 ) 219 IF( zrdttrc1 /= rdt * nn_dttrc ) neuler = 0 220 ENDIF 221 ! ! define ndastp and adatrj 222 IF( nn_rsttr == 2 ) THEN 208 IF( ln_rsttr ) THEN 209 CALL iom_open( TRIM(cn_trcrst_indir)//'/'//cn_trcrst_in, numrtr, kiolib = jlibalt ) 210 CALL iom_get ( numrtr, 'kt', zkt ) ! last time-step of previous run 211 212 IF(lwp) THEN 213 WRITE(numout,*) ' *** Info read in restart : ' 214 WRITE(numout,*) ' previous time-step : ', NINT( zkt ) 215 WRITE(numout,*) ' *** restart option' 216 SELECT CASE ( nn_rsttr ) 217 CASE ( 0 ) ; WRITE(numout,*) ' nn_rsttr = 0 : no control of nittrc000' 218 CASE ( 1 ) ; WRITE(numout,*) ' nn_rsttr = 1 : no control the date at nittrc000 (use ndate0 read in the namelist)' 219 CASE ( 2 ) ; WRITE(numout,*) ' nn_rsttr = 2 : calendar parameters read in restart' 220 END SELECT 221 WRITE(numout,*) 222 ENDIF 223 ! Control of date 224 IF( nittrc000 - NINT( zkt ) /= nn_dttrc .AND. nn_rsttr /= 0 ) & 225 & CALL ctl_stop( ' ===>>>> : problem with nittrc000 for the restart', & 226 & ' verify the restart file or rerun with nn_rsttr = 0 (namelist)' ) 227 ENDIF 228 ! 229 IF( lk_offline ) THEN 230 ! ! set the date in offline mode 231 IF( ln_rsttr .AND. nn_rsttr == 2 ) THEN 223 232 CALL iom_get( numrtr, 'ndastp', zndastp ) 224 233 ndastp = NINT( zndastp ) 225 234 CALL iom_get( numrtr, 'adatrj', adatrj ) 226 ELSE235 ELSE 227 236 ndastp = ndate0 - 1 ! ndate0 read in the namelist in dom_nam 228 237 adatrj = ( REAL( nittrc000-1, wp ) * rdttra(1) ) / rday … … 235 244 WRITE(numout,*) ' number of elapsed days since the begining of run : ', adatrj 236 245 WRITE(numout,*) 246 ENDIF 247 ! 248 IF( ln_rsttr ) THEN ; neuler = 1 249 ELSE ; neuler = 0 237 250 ENDIF 238 251 ! … … 265 278 INTEGER :: jk, jn 266 279 REAL(wp) :: ztraf, zmin, zmax, zmean, zdrift 280 REAL(wp), DIMENSION(jpi,jpj,jpk) :: zvol 267 281 !!---------------------------------------------------------------------- 268 282 … … 273 287 ENDIF 274 288 ! 275 DO jn = 1, jptra 276 ztraf = glob_sum( trn(:,:,:,jn) * cvol(:,:,:) ) 289 DO jk = 1, jpk 290 zvol(:,:,jk) = e1e2t(:,:) * fse3t_a(:,:,jk) * tmask(:,:,jk) 291 END DO 292 ! 293 DO jn = 1, jptra 294 ztraf = glob_sum( trn(:,:,:,jn) * zvol(:,:,:) ) 277 295 zmin = MINVAL( trn(:,:,:,jn), mask= ((tmask*SPREAD(tmask_i,DIM=3,NCOPIES=jpk).NE.0.)) ) 278 296 zmax = MAXVAL( trn(:,:,:,jn), mask= ((tmask*SPREAD(tmask_i,DIM=3,NCOPIES=jpk).NE.0.)) ) … … 306 324 !!---------------------------------------------------------------------- 307 325 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 308 !! $Id$ 326 !! $Id$ 309 327 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 310 328 !!======================================================================
Note: See TracChangeset
for help on using the changeset viewer.