Changeset 5341 for trunk/NEMOGCM/NEMO/OPA_SRC/IOM
- Timestamp:
- 2015-06-03T16:59:46+02:00 (9 years ago)
- Location:
- trunk/NEMOGCM/NEMO/OPA_SRC/IOM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.