Changeset 5341 for trunk/NEMOGCM/NEMO/OPA_SRC
- Timestamp:
- 2015-06-03T16:59:46+02:00 (9 years ago)
- Location:
- trunk/NEMOGCM/NEMO/OPA_SRC
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90
r4990 r5341 135 135 !!---------------------------------------------------------------------- 136 136 USE ioipsl 137 NAMELIST/namrun/ nn_no , cn_exp , cn_ocerst_in, cn_ocerst_out, ln_rstart , nn_rstctl, & 137 NAMELIST/namrun/ cn_ocerst_indir, cn_ocerst_outdir, nn_stocklist, ln_rst_list, & 138 & nn_no , cn_exp , cn_ocerst_in, cn_ocerst_out, ln_rstart , nn_rstctl, & 138 139 & nn_it000, nn_itend , nn_date0 , nn_leapy , nn_istate , nn_stock , & 139 140 & nn_write, ln_dimgnnn, ln_mskland , ln_clobber , nn_chunksz, nn_euler … … 169 170 WRITE(numout,*) ' experiment name for output cn_exp = ', cn_exp 170 171 WRITE(numout,*) ' file prefix restart input cn_ocerst_in= ', cn_ocerst_in 172 WRITE(numout,*) ' restart input directory cn_ocerst_indir= ', cn_ocerst_indir 171 173 WRITE(numout,*) ' file prefix restart output cn_ocerst_out= ', cn_ocerst_out 174 WRITE(numout,*) ' restart output directory cn_ocerst_outdir= ', cn_ocerst_outdir 172 175 WRITE(numout,*) ' restart logical ln_rstart = ', ln_rstart 173 176 WRITE(numout,*) ' start with forward time step nn_euler = ', nn_euler … … 178 181 WRITE(numout,*) ' leap year calendar (0/1) nn_leapy = ', nn_leapy 179 182 WRITE(numout,*) ' initial state output nn_istate = ', nn_istate 180 WRITE(numout,*) ' frequency of restart file nn_stock = ', nn_stock 183 IF( ln_rst_list ) THEN 184 WRITE(numout,*) ' list of restart dump times nn_stocklist =', nn_stocklist 185 ELSE 186 WRITE(numout,*) ' frequency of restart file nn_stock = ', nn_stock 187 ENDIF 181 188 WRITE(numout,*) ' frequency of output file nn_write = ', nn_write 182 189 WRITE(numout,*) ' multi file dimgout ln_dimgnnn = ', ln_dimgnnn … … 195 202 ninist = nn_istate 196 203 nstock = nn_stock 204 nstocklist = nn_stocklist 197 205 nwrite = nn_write 198 206 neuler = nn_euler 199 IF ( neuler == 1 .AND. .NOT. ln_rstart ) THEN207 IF ( neuler == 1 .AND. .NOT. ln_rstart ) THEN 200 208 WRITE(ctmp1,*) 'ln_rstart =.FALSE., nn_euler is forced to 0 ' 201 209 CALL ctl_warn( ctmp1 ) -
trunk/NEMOGCM/NEMO/OPA_SRC/ICB/icbrst.F90
r5215 r5341 64 64 ! start and count arrays 65 65 LOGICAL :: ll_found_restart 66 CHARACTER(len=256) :: cl_path 66 67 CHARACTER(len=256) :: cl_filename 67 68 CHARACTER(len=NF90_MAX_NAME) :: cl_dname … … 70 71 !!---------------------------------------------------------------------- 71 72 72 ! Find a restart file 73 ! Find a restart file. Assume iceberg restarts in same directory as ocean restarts. 74 cl_path = TRIM(cn_ocerst_indir) 75 IF( cl_path(LEN_TRIM(cl_path):) /= '/' ) cl_path = TRIM(cl_path) // '/' 73 76 cl_filename = ' ' 74 77 IF ( lk_mpp ) THEN 75 78 cl_filename = ' ' 76 79 WRITE( cl_filename, '("restart_icebergs_",I4.4,".nc")' ) narea-1 77 INQUIRE( file=TRIM(cl_ filename), exist=ll_found_restart )80 INQUIRE( file=TRIM(cl_path)//TRIM(cl_filename), exist=ll_found_restart ) 78 81 ELSE 79 82 cl_filename = 'restart_icebergs.nc' 80 INQUIRE( file=TRIM(cl_ filename), exist=ll_found_restart )83 INQUIRE( file=TRIM(cl_path)//TRIM(cl_filename), exist=ll_found_restart ) 81 84 ENDIF 82 85 … … 86 89 87 90 IF (nn_verbose_level >= 0 .AND. lwp) & 88 WRITE(numout,'(2a)') 'icebergs, read_restart_bergs: found restart file = ',TRIM(cl_ filename)89 90 nret = NF90_OPEN(TRIM(cl_ filename), NF90_NOWRITE, ncid)91 WRITE(numout,'(2a)') 'icebergs, read_restart_bergs: found restart file = ',TRIM(cl_path)//TRIM(cl_filename) 92 93 nret = NF90_OPEN(TRIM(cl_path)//TRIM(cl_filename), NF90_NOWRITE, ncid) 91 94 IF (nret .ne. NF90_NOERR) CALL ctl_stop('icebergs, read_restart_bergs: nf_open failed') 92 95 … … 228 231 INTEGER :: jn ! dummy loop index 229 232 INTEGER :: ix_dim, iy_dim, ik_dim, in_dim 233 CHARACTER(len=256) :: cl_path 230 234 CHARACTER(len=256) :: cl_filename 231 235 TYPE(iceberg), POINTER :: this … … 233 237 !!---------------------------------------------------------------------- 234 238 239 ! Assume we write iceberg restarts to same directory as ocean restarts. 240 cl_path = TRIM(cn_ocerst_outdir) 241 IF( cl_path(LEN_TRIM(cl_path):) /= '/' ) cl_path = TRIM(cl_path) // '/' 235 242 IF( lk_mpp ) THEN 236 WRITE(cl_filename,'( "icebergs_",I8.8,"_restart_",I4.4,".nc")')kt, narea-1243 WRITE(cl_filename,'(A,"_icebergs_",I8.8,"_restart_",I4.4,".nc")') TRIM(cexper), kt, narea-1 237 244 ELSE 238 WRITE(cl_filename,'( "icebergs_",I8.8,"_restart.nc")')kt239 ENDIF 240 IF (nn_verbose_level >= 0) WRITE(numout,'(2a)') 'icebergs, write_restart: creating ',TRIM(cl_ filename)241 242 nret = NF90_CREATE(TRIM(cl_ filename), NF90_CLOBBER, ncid)245 WRITE(cl_filename,'(A,"_icebergs_",I8.8,"_restart.nc")') TRIM(cexper), kt 246 ENDIF 247 IF (nn_verbose_level >= 0) WRITE(numout,'(2a)') 'icebergs, write_restart: creating ',TRIM(cl_path)//TRIM(cl_filename) 248 249 nret = NF90_CREATE(TRIM(cl_path)//TRIM(cl_filename), NF90_CLOBBER, ncid) 243 250 IF (nret .ne. NF90_NOERR) CALL ctl_stop('icebergs, write_restart: nf_create failed') 244 251 … … 372 379 ENDIF 373 380 ENDDO 374 IF( lwp ) WRITE(numout,*) 'file: ',TRIM(cl_ filename),' var: stored_ice written'381 IF( lwp ) WRITE(numout,*) 'file: ',TRIM(cl_path)//TRIM(cl_filename),' var: stored_ice written' 375 382 376 383 nret = NF90_PUT_VAR( ncid, nkountid, num_bergs(:) ) … … 379 386 nret = NF90_PUT_VAR( ncid, nsheatid, berg_grid%stored_heat(:,:) ) 380 387 IF (nret .ne. NF90_NOERR) CALL ctl_stop('icebergs, write_restart: nf_put_var stored_heat failed') 381 IF( lwp ) WRITE(numout,*) 'file: ',TRIM(cl_ filename),' var: stored_heat written'388 IF( lwp ) WRITE(numout,*) 'file: ',TRIM(cl_path)//TRIM(cl_filename),' var: stored_heat written' 382 389 383 390 nret = NF90_PUT_VAR( ncid, ncalvid , src_calving(:,:) ) … … 385 392 nret = NF90_PUT_VAR( ncid, ncalvhid, src_calving_hflx(:,:) ) 386 393 IF (nret .ne. NF90_NOERR) CALL ctl_stop('icebergs, write_restart: nf_put_var calving_hflx failed') 387 IF( lwp ) WRITE(numout,*) 'file: ',TRIM(cl_ filename),' var: calving written'394 IF( lwp ) WRITE(numout,*) 'file: ',TRIM(cl_path)//TRIM(cl_filename),' var: calving written' 388 395 389 396 IF ( ASSOCIATED(first_berg) ) THEN -
trunk/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90
r4990 r5341 26 26 CHARACTER(lc) :: cn_exp !: experiment name used for output filename 27 27 CHARACTER(lc) :: cn_ocerst_in !: suffix of ocean restart name (input) 28 CHARACTER(lc) :: cn_ocerst_indir !: restart input directory 28 29 CHARACTER(lc) :: cn_ocerst_out !: suffix of ocean restart name (output) 30 CHARACTER(lc) :: cn_ocerst_outdir !: restart output directory 29 31 LOGICAL :: ln_rstart !: start from (F) rest or (T) a restart file 32 LOGICAL :: ln_rst_list !: output restarts at list of times (T) or by frequency (F) 30 33 INTEGER :: nn_no !: job number 31 34 INTEGER :: nn_rstctl !: control of the time step (0, 1 or 2) … … 38 41 INTEGER :: nn_write !: model standard output frequency 39 42 INTEGER :: nn_stock !: restart file frequency 43 INTEGER, DIMENSION(10) :: nn_stocklist !: restart dump times 40 44 LOGICAL :: ln_dimgnnn !: type of dimgout. (F): 1 file for all proc 41 45 !: (T): 1 file per proc … … 78 82 INTEGER :: nwrite !: model standard output frequency 79 83 INTEGER :: nstock !: restart file frequency 84 INTEGER, DIMENSION(10) :: nstocklist !: restart dump times 80 85 81 86 !!---------------------------------------------------------------------- … … 85 90 LOGICAL :: lrst_oce !: logical to control the oce restart write 86 91 INTEGER :: numror, numrow !: logical unit for cean restart (read and write) 92 INTEGER :: nrst_lst !: number of restart to output next 87 93 88 94 !!---------------------------------------------------------------------- -
trunk/NEMOGCM/NEMO/OPA_SRC/IOM/iom_nf90.F90
r4689 r5341 61 61 INTEGER, DIMENSION(2,5), INTENT(in ), OPTIONAL :: kdompar ! domain parameters: 62 62 63 CHARACTER(LEN= 100) :: clinfo ! info character64 CHARACTER(LEN= 100) :: cltmp ! temporary character63 CHARACTER(LEN=256) :: clinfo ! info character 64 CHARACTER(LEN=256) :: cltmp ! temporary character 65 65 INTEGER :: iln ! lengths of character 66 66 INTEGER :: istop ! temporary storage of nstop … … 393 393 INTEGER, DIMENSION(4) :: idimsz ! dimensions size 394 394 INTEGER, DIMENSION(4) :: idimid ! dimensions id 395 CHARACTER(LEN= 100) :: clinfo ! info character395 CHARACTER(LEN=256) :: clinfo ! info character 396 396 CHARACTER(LEN= 12), DIMENSION(4) :: cltmp ! temporary character 397 397 INTEGER :: if90id ! nf90 file identifier -
trunk/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90
r4990 r5341 57 57 !! 58 58 CHARACTER(LEN=20) :: clkt ! ocean time-step deine as a character 59 CHARACTER(LEN=50) :: clname ! ice output restart file name 59 CHARACTER(LEN=50) :: clname ! ocean output restart file name 60 CHARACTER(lc) :: clpath ! full path to ocean output restart file 60 61 !!---------------------------------------------------------------------- 61 62 ! 62 63 IF( kt == nit000 ) THEN ! default definitions 63 64 lrst_oce = .FALSE. 64 nitrst = nitend 65 ENDIF 66 IF( MOD( kt - 1, nstock ) == 0 ) THEN 65 IF( ln_rst_list ) THEN 66 nrst_lst = 1 67 nitrst = nstocklist( nrst_lst ) 68 ELSE 69 nitrst = nitend 70 ENDIF 71 ENDIF 72 73 ! frequency-based restart dumping (nn_stock) 74 IF( .NOT. ln_rst_list .AND. MOD( kt - 1, nstock ) == 0 ) THEN 67 75 ! we use kt - 1 and not kt - nit000 to keep the same periodicity from the beginning of the experiment 68 76 nitrst = kt + nstock - 1 ! define the next value of nitrst for restart writing … … 73 81 ! except if we write ocean restart files every time step or if an ocean restart file was writen at nitend - 1 74 82 IF( kt == nitrst - 1 .OR. nstock == 1 .OR. ( kt == nitend .AND. .NOT. lrst_oce ) ) THEN 75 ! beware of the format used to write kt (default is i8.8, that should be large enough...) 76 IF( nitrst > 999999999 ) THEN ; WRITE(clkt, * ) nitrst 77 ELSE ; WRITE(clkt, '(i8.8)') nitrst 78 ENDIF 79 ! create the file 80 clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_ocerst_out) 81 IF(lwp) THEN 82 WRITE(numout,*) 83 SELECT CASE ( jprstlib ) 84 CASE ( jprstdimg ) ; WRITE(numout,*) ' open ocean restart binary file: '//clname 85 CASE DEFAULT ; WRITE(numout,*) ' open ocean restart NetCDF file: '//clname 86 END SELECT 87 IF ( snc4set%luse ) WRITE(numout,*) ' opened for NetCDF4 chunking and compression' 88 IF( kt == nitrst - 1 ) THEN ; WRITE(numout,*) ' kt = nitrst - 1 = ', kt 89 ELSE ; WRITE(numout,*) ' kt = ' , kt 83 IF( nitrst <= nitend .AND. nitrst > 0 ) THEN 84 ! beware of the format used to write kt (default is i8.8, that should be large enough...) 85 IF( nitrst > 999999999 ) THEN ; WRITE(clkt, * ) nitrst 86 ELSE ; WRITE(clkt, '(i8.8)') nitrst 90 87 ENDIF 91 ENDIF 92 ! 93 CALL iom_open( clname, numrow, ldwrt = .TRUE., kiolib = jprstlib ) 94 lrst_oce = .TRUE. 88 ! create the file 89 clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_ocerst_out) 90 clpath = TRIM(cn_ocerst_outdir) 91 IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath) // '/' 92 IF(lwp) THEN 93 WRITE(numout,*) 94 SELECT CASE ( jprstlib ) 95 CASE ( jprstdimg ) ; WRITE(numout,*) & 96 ' open ocean restart binary file: ',TRIM(clpath)//clname 97 CASE DEFAULT ; WRITE(numout,*) & 98 ' open ocean restart NetCDF file: ',TRIM(clpath)//clname 99 END SELECT 100 IF ( snc4set%luse ) WRITE(numout,*) ' opened for NetCDF4 chunking and compression' 101 IF( kt == nitrst - 1 ) THEN ; WRITE(numout,*) ' kt = nitrst - 1 = ', kt 102 ELSE ; WRITE(numout,*) ' kt = ' , kt 103 ENDIF 104 ENDIF 105 ! 106 CALL iom_open( TRIM(clpath)//TRIM(clname), numrow, ldwrt = .TRUE., kiolib = jprstlib ) 107 lrst_oce = .TRUE. 108 ENDIF 95 109 ENDIF 96 110 ! … … 142 156 !!gm not sure what to do here ===>>> ask to Sebastian 143 157 lrst_oce = .FALSE. 158 IF( ln_rst_list ) THEN 159 nrst_lst = MIN(nrst_lst + 1, SIZE(nstocklist,1)) 160 nitrst = nstocklist( nrst_lst ) 161 ENDIF 162 lrst_oce = .FALSE. 144 163 ENDIF 145 164 ! … … 156 175 !! the file has already been opened 157 176 !!---------------------------------------------------------------------- 158 INTEGER :: jlibalt = jprstlib 159 LOGICAL :: llok 177 INTEGER :: jlibalt = jprstlib 178 LOGICAL :: llok 179 CHARACTER(lc) :: clpath ! full path to ocean output restart file 160 180 !!---------------------------------------------------------------------- 161 181 ! … … 171 191 ENDIF 172 192 193 clpath = TRIM(cn_ocerst_indir) 194 IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath) // '/' 173 195 IF ( jprstlib == jprstdimg ) THEN 174 196 ! eventually read netcdf file (monobloc) for restarting on different number of processors 175 197 ! if {cn_ocerst_in}.nc exists, then set jlibalt to jpnf90 176 INQUIRE( FILE = TRIM(cn_ocerst_in )//'.nc', EXIST = llok )198 INQUIRE( FILE = TRIM(cn_ocerst_indir)//'/'//TRIM(cn_ocerst_in)//'.nc', EXIST = llok ) 177 199 IF ( llok ) THEN ; jlibalt = jpnf90 ; ELSE ; jlibalt = jprstlib ; ENDIF 178 200 ENDIF 179 CALL iom_open( cn_ocerst_in, numror, kiolib = jlibalt )201 CALL iom_open( TRIM(clpath)//cn_ocerst_in, numror, kiolib = jlibalt ) 180 202 ENDIF 181 203 END SUBROUTINE rst_read_open -
trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim.F90
r5167 r5341 346 346 !!------------------------------------------------------------------- 347 347 INTEGER :: ios ! Local integer output status for namelist read 348 NAMELIST/namicerun/ jpl, nlay_i, nlay_s, cn_icerst_in, cn_icerst_ out,&348 NAMELIST/namicerun/ jpl, nlay_i, nlay_s, cn_icerst_in, cn_icerst_indir, cn_icerst_out, cn_icerst_outdir, & 349 349 & ln_limdyn, rn_amax, ln_limdiahsb, ln_limdiaout, ln_icectl, iiceprt, jiceprt 350 350 !!------------------------------------------------------------------- -
trunk/NEMOGCM/NEMO/OPA_SRC/TRD/trdmxl_rst.F90
r5215 r5341 27 27 !!--------------------------------------------------------------------------------- 28 28 !! NEMO/OPA 3.3 , NEMO Consortium (2010) 29 !! $Id$ 29 !! $Id$ 30 30 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 31 31 !!--------------------------------------------------------------------------------- … … 43 43 INTEGER :: jk ! loop indice 44 44 CHARACTER(LEN=20) :: clkt ! ocean time-step deine as a character 45 CHARACTER(LEN=50) :: clname ! ice output restart file name 45 CHARACTER(LEN=50) :: clname ! output restart file name 46 CHARACTER(LEN=256) :: clpath ! full path to restart file 46 47 !!-------------------------------------------------------------------------------- 47 48 … … 56 57 ! create the file 57 58 clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_trdrst_out) 59 clpath = TRIM(cn_ocerst_outdir) 60 IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath) // '/' 58 61 IF(lwp) THEN 59 62 WRITE(numout,*) … … 67 70 ENDIF 68 71 69 CALL iom_open( clname, nummxlw, ldwrt = .TRUE., kiolib = jprstlib )72 CALL iom_open( TRIM(clpath)//TRIM(clname), nummxlw, ldwrt = .TRUE., kiolib = jprstlib ) 70 73 ENDIF 71 74 … … 133 136 INTEGER :: jlibalt = jprstlib 134 137 LOGICAL :: llok 138 CHARACTER(LEN=256) :: clpath ! full path to restart file 135 139 !!----------------------------------------------------------------------------- 136 140 … … 140 144 WRITE(numout,*) ' ~~~~~~~~~~~~~~~~' 141 145 ENDIF 146 147 clpath = TRIM(cn_ocerst_indir) 148 IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath) // '/' 149 142 150 IF ( jprstlib == jprstdimg ) THEN 143 151 ! eventually read netcdf file (monobloc) for restarting on different number of processors 144 152 ! if {cn_trdrst_in}.nc exists, then set jlibalt to jpnf90 145 INQUIRE( FILE = TRIM(c n_trdrst_in)//'.nc', EXIST = llok )153 INQUIRE( FILE = TRIM(clpath)//TRIM(cn_trdrst_in)//'.nc', EXIST = llok ) 146 154 IF ( llok ) THEN ; jlibalt = jpnf90 147 155 ELSE ; jlibalt = jprstlib … … 149 157 ENDIF 150 158 151 CALL iom_open( cn_trdrst_in, inum, kiolib = jlibalt )159 CALL iom_open( TRIM(clpath)//TRIM(cn_trdrst_in), inum, kiolib = jlibalt ) 152 160 153 161 IF( ln_trdmxl_instant ) THEN
Note: See TracChangeset
for help on using the changeset viewer.