- Timestamp:
- 2015-08-04T14:45:33+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/2015_CO6_CO5_shelfdiagnostic/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90
r5422 r5666 24 24 USE trdmxl_oce ! ocean active mixed layer tracers trends variables 25 25 USE divcur ! hor. divergence and curl (div & cur routines) 26 USE sbc_ice, ONLY : lk_lim327 26 28 27 IMPLICIT NONE … … 57 56 !! 58 57 CHARACTER(LEN=20) :: clkt ! ocean time-step deine as a character 59 CHARACTER(LEN=50) :: clname ! ice output restart file name 58 CHARACTER(LEN=50) :: clname ! ocean output restart file name 59 CHARACTER(lc) :: clpath ! full path to ocean output restart file 60 60 !!---------------------------------------------------------------------- 61 61 ! 62 62 IF( kt == nit000 ) THEN ! default definitions 63 63 lrst_oce = .FALSE. 64 nitrst = nitend 65 ENDIF 66 IF( MOD( kt - 1, nstock ) == 0 ) THEN 64 IF( ln_rst_list ) THEN 65 nrst_lst = 1 66 nitrst = nstocklist( nrst_lst ) 67 ELSE 68 nitrst = nitend 69 ENDIF 70 ENDIF 71 72 ! frequency-based restart dumping (nn_stock) 73 IF( .NOT. ln_rst_list .AND. MOD( kt - 1, nstock ) == 0 ) THEN 67 74 ! we use kt - 1 and not kt - nit000 to keep the same periodicity from the beginning of the experiment 68 75 nitrst = kt + nstock - 1 ! define the next value of nitrst for restart writing … … 73 80 ! except if we write ocean restart files every time step or if an ocean restart file was writen at nitend - 1 74 81 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 82 IF( nitrst <= nitend .AND. nitrst > 0 ) THEN 83 ! beware of the format used to write kt (default is i8.8, that should be large enough...) 84 IF( nitrst > 999999999 ) THEN ; WRITE(clkt, * ) nitrst 85 ELSE ; WRITE(clkt, '(i8.8)') nitrst 90 86 ENDIF 91 ENDIF 92 ! 93 CALL iom_open( clname, numrow, ldwrt = .TRUE., kiolib = jprstlib ) 94 lrst_oce = .TRUE. 87 ! create the file 88 clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_ocerst_out) 89 clpath = TRIM(cn_ocerst_outdir) 90 IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath) // '/' 91 IF(lwp) THEN 92 WRITE(numout,*) 93 SELECT CASE ( jprstlib ) 94 CASE ( jprstdimg ) ; WRITE(numout,*) & 95 ' open ocean restart binary file: ',TRIM(clpath)//clname 96 CASE DEFAULT ; WRITE(numout,*) & 97 ' open ocean restart NetCDF file: ',TRIM(clpath)//clname 98 END SELECT 99 IF ( snc4set%luse ) WRITE(numout,*) ' opened for NetCDF4 chunking and compression' 100 IF( kt == nitrst - 1 ) THEN ; WRITE(numout,*) ' kt = nitrst - 1 = ', kt 101 ELSE ; WRITE(numout,*) ' kt = ' , kt 102 ENDIF 103 ENDIF 104 ! 105 CALL iom_open( TRIM(clpath)//TRIM(clname), numrow, ldwrt = .TRUE., kiolib = jprstlib ) 106 lrst_oce = .TRUE. 107 ENDIF 95 108 ENDIF 96 109 ! … … 120 133 CALL iom_rstput( kt, nitrst, numrow, 'hdivb' , hdivb ) 121 134 CALL iom_rstput( kt, nitrst, numrow, 'sshb' , sshb ) 122 !123 IF( lk_lim3 ) CALL iom_rstput( kt, nitrst, numrow, 'fse3t_b', fse3t_b(:,:,:) )124 135 ! 125 136 CALL iom_rstput( kt, nitrst, numrow, 'un' , un ) ! now fields … … 134 145 CALL iom_rstput( kt, nitrst, numrow, 'rhd' , rhd ) 135 146 #endif 136 IF( lk_lim3 ) THEN137 CALL iom_rstput( kt, nitrst, numrow, 'fraqsr_1lev' , fraqsr_1lev ) !clem modif138 ENDIF139 147 IF( kt == nitrst ) THEN 140 148 CALL iom_close( numrow ) ! close the restart file (only at last time step) … … 142 150 !!gm not sure what to do here ===>>> ask to Sebastian 143 151 lrst_oce = .FALSE. 152 IF( ln_rst_list ) THEN 153 nrst_lst = MIN(nrst_lst + 1, SIZE(nstocklist,1)) 154 nitrst = nstocklist( nrst_lst ) 155 ENDIF 156 lrst_oce = .FALSE. 144 157 ENDIF 145 158 ! … … 156 169 !! the file has already been opened 157 170 !!---------------------------------------------------------------------- 158 INTEGER :: jlibalt = jprstlib 159 LOGICAL :: llok 171 INTEGER :: jlibalt = jprstlib 172 LOGICAL :: llok 173 CHARACTER(lc) :: clpath ! full path to ocean output restart file 160 174 !!---------------------------------------------------------------------- 161 175 ! … … 171 185 ENDIF 172 186 187 clpath = TRIM(cn_ocerst_indir) 188 IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath) // '/' 173 189 IF ( jprstlib == jprstdimg ) THEN 174 190 ! eventually read netcdf file (monobloc) for restarting on different number of processors 175 191 ! if {cn_ocerst_in}.nc exists, then set jlibalt to jpnf90 176 INQUIRE( FILE = TRIM(cn_ocerst_in )//'.nc', EXIST = llok )192 INQUIRE( FILE = TRIM(cn_ocerst_indir)//'/'//TRIM(cn_ocerst_in)//'.nc', EXIST = llok ) 177 193 IF ( llok ) THEN ; jlibalt = jpnf90 ; ELSE ; jlibalt = jprstlib ; ENDIF 178 194 ENDIF 179 CALL iom_open( cn_ocerst_in, numror, kiolib = jlibalt )195 CALL iom_open( TRIM(clpath)//cn_ocerst_in, numror, kiolib = jlibalt ) 180 196 ENDIF 181 197 END SUBROUTINE rst_read_open … … 214 230 CALL iom_get( numror, jpdom_autoglo, 'hdivb' , hdivb ) 215 231 CALL iom_get( numror, jpdom_autoglo, 'sshb' , sshb ) 216 IF( lk_lim3 ) CALL iom_get( numror, jpdom_autoglo, 'fse3t_b', fse3t_b(:,:,:) )217 232 ELSE 218 233 neuler = 0 … … 257 272 ENDIF 258 273 259 IF( lk_lim3 .AND. .NOT. lk_vvl ) THEN260 DO jk = 1, jpk261 fse3t_b(:,:,jk) = fse3t_n(:,:,jk)262 END DO263 ENDIF264 265 ENDIF266 !267 IF( lk_lim3 ) THEN268 CALL iom_get( numror, jpdom_autoglo, 'fraqsr_1lev' , fraqsr_1lev )269 274 ENDIF 270 275 !
Note: See TracChangeset
for help on using the changeset viewer.