Changeset 226 for trunk/SRC/Grid
- Timestamp:
- 03/16/07 10:22:26 (17 years ago)
- Location:
- trunk/SRC/Grid
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Grid/checkperio.pro
r197 r226 8 8 ; @param file {in}{required}{type=scalar string} 9 9 ; A string giving the name of the NetCdf file 10 ; 10 ; 11 11 ; @keyword WRITE {default=0}{type=scalar: 0 or 1} 12 12 ; Define to 1 to write the good periodicity in the file. 13 ; By default print only mes age of periodicity errors13 ; By default print only message of periodicity errors 14 14 ; 15 15 ; @restrictions … … 38 38 ; @history 39 39 ; October 2006: Sebastien Masson (smasson\@locean-ipsl.upmc.fr) 40 ; 40 ; 41 41 ; @version 42 42 ; $Id$ … … 44 44 PRO checkperio, file, WRITE = write 45 45 46 IF file_test(file) EQ 0 THEN BEGIN 46 IF file_test(file) EQ 0 THEN BEGIN 47 47 print, 'file '+file+' not found' 48 48 RETURN … … 53 53 ; 54 54 dimsz = lonarr(finq.ndims) 55 FOR did = 0, finq.ndims-1 DO BEGIN 55 FOR did = 0, finq.ndims-1 DO BEGIN 56 56 ncdf_diminq, cdfid, did, name, size 57 57 dimsz[did] = size 58 58 ENDFOR 59 59 ; 60 FOR vid = 0, finq.nvars-1 DO BEGIN 60 FOR vid = 0, finq.nvars-1 DO BEGIN 61 61 vinq = ncdf_varinq(cdfid, vid) 62 62 IF vinq.ndims GE 2 THEN BEGIN … … 68 68 ; 2D VAR 69 69 ;------------------------------ 70 2:BEGIN 70 2:BEGIN 71 71 ; y periodicity (1) 72 72 CASE 1 OF … … 75 75 ncdf_varget, cdfid, vid, part2, count = [jpi-2, 1], offset = [1, jpj-3] 76 76 part2 = reverse(shift(part2, -1)) 77 IF array_equal(part1, part2) NE 1 THEN BEGIN 77 IF array_equal(part1, part2) NE 1 THEN BEGIN 78 78 print, vinq.name+' bad y periodicity (1)' 79 79 IF keyword_set(write) THEN $ … … 85 85 ncdf_varget, cdfid, vid, part2, count = [jpi-2, 1], offset = [1, jpj-2] 86 86 part2 = reverse(part2) 87 IF array_equal(part1, part2) NE 1 THEN BEGIN 87 IF array_equal(part1, part2) NE 1 THEN BEGIN 88 88 print, vinq.name+' bad y periodicity (1)' 89 89 IF keyword_set(write) THEN $ … … 99 99 ncdf_varget, cdfid, vid, part2, count = [(jpi-1)/2-2+1, 1], offset = [ 2, jpj-2] 100 100 part2 = reverse(part2) 101 IF array_equal(part1, part2) NE 1 THEN BEGIN 101 IF array_equal(part1, part2) NE 1 THEN BEGIN 102 102 print, vinq.name+' bad y periodicity (2)' 103 103 IF keyword_set(write) THEN $ … … 112 112 ncdf_varget, cdfid, vid, part1, count = [1, jpj], offset = [0, 0] 113 113 ncdf_varget, cdfid, vid, part2, count = [1, jpj], offset = [jpi-2, 0] 114 IF array_equal(part1, part2) NE 1 THEN BEGIN 114 IF array_equal(part1, part2) NE 1 THEN BEGIN 115 115 print, vinq.name+' bad x periodicity (1)' 116 116 IF keyword_set(write) THEN $ … … 120 120 ncdf_varget, cdfid, vid, part1, count = [1, jpj], offset = [jpi-1, 0] 121 121 ncdf_varget, cdfid, vid, part2, count = [1, jpj], offset = [1, 0] 122 IF array_equal(part1, part2) NE 1 THEN BEGIN 122 IF array_equal(part1, part2) NE 1 THEN BEGIN 123 123 print, vinq.name+' bad x periodicity (2)' 124 124 IF keyword_set(write) THEN $ … … 129 129 ; 3D VAR 130 130 ;------------------------------ 131 3:BEGIN 131 3:BEGIN 132 132 jpk = vdimsz[2] 133 133 ; y periodicity (1) … … 138 138 IF jpk EQ 1 THEN part2 = reform(part2, jpi-2, 1, jpk, /over) 139 139 part2 = reverse(shift(part2, -1, 0, 0), 1) 140 IF array_equal(part1, part2) NE 1 THEN BEGIN 140 IF array_equal(part1, part2) NE 1 THEN BEGIN 141 141 print, vinq.name+' bad y periodicity (1)' 142 142 IF keyword_set(write) THEN $ … … 149 149 IF jpk EQ 1 THEN part2 = reform(part2, jpi-2, 1, jpk, /over) 150 150 part2 = reverse(part2, 1) 151 IF array_equal(part1, part2) NE 1 THEN BEGIN 151 IF array_equal(part1, part2) NE 1 THEN BEGIN 152 152 print, vinq.name+' bad y periodicity (1)' 153 153 IF keyword_set(write) THEN $ … … 163 163 ncdf_varget, cdfid, vid, part2, count = [(jpi-1)/2-2+1, 1, jpk], offset = [ 2, jpj-2, 0] 164 164 part2 = reverse(part2, 1) 165 IF array_equal(part1, part2) NE 1 THEN BEGIN 165 IF array_equal(part1, part2) NE 1 THEN BEGIN 166 166 print, vinq.name+' bad y periodicity (2)' 167 167 IF keyword_set(write) THEN $ … … 176 176 ncdf_varget, cdfid, vid, part1, count = [1, jpj, jpk], offset = [0, 0, 0] 177 177 ncdf_varget, cdfid, vid, part2, count = [1, jpj, jpk], offset = [jpi-2, 0, 0] 178 IF array_equal(part1, part2) NE 1 THEN BEGIN 178 IF array_equal(part1, part2) NE 1 THEN BEGIN 179 179 print, vinq.name+' bad x periodicity (1)' 180 180 IF keyword_set(write) THEN $ … … 184 184 ncdf_varget, cdfid, vid, part1, count = [1, jpj, jpk], offset = [jpi-1, 0, 0] 185 185 ncdf_varget, cdfid, vid, part2, count = [1, jpj, jpk], offset = [1, 0, 0] 186 IF array_equal(part1, part2) NE 1 THEN BEGIN 186 IF array_equal(part1, part2) NE 1 THEN BEGIN 187 187 print, vinq.name+' bad x periodicity (2)' 188 188 IF keyword_set(write) THEN $ … … 193 193 ; 4D VAR 194 194 ;------------------------------ 195 4:BEGIN 195 4:BEGIN 196 196 jpk = vdimsz[2] 197 197 jpt = vdimsz[3] … … 203 203 IF jpt EQ 1 THEN part2 = reform(part2, jpi-2, 1, jpk, jpt, /over) 204 204 part2 = reverse(shift(part2, -1, 0, 0, 0), 1) 205 IF array_equal(part1, part2) NE 1 THEN BEGIN 205 IF array_equal(part1, part2) NE 1 THEN BEGIN 206 206 print, vinq.name+' bad y periodicity (1)' 207 207 IF keyword_set(write) THEN $ … … 214 214 IF jpt EQ 1 THEN part2 = reform(part2, jpi-2, 1, jpk, jpt, /over) 215 215 part2 = reverse(part2, 1) 216 IF array_equal(part1, part2) NE 1 THEN BEGIN 216 IF array_equal(part1, part2) NE 1 THEN BEGIN 217 217 print, vinq.name+' bad y periodicity (1)' 218 218 IF keyword_set(write) THEN $ … … 228 228 ncdf_varget, cdfid, vid, part2, count = [(jpi-1)/2-2+1, 1, jpk, jpt], offset = [ 2, jpj-2, 0, 0] 229 229 part2 = reverse(part2, 1) 230 IF array_equal(part1, part2) NE 1 THEN BEGIN 230 IF array_equal(part1, part2) NE 1 THEN BEGIN 231 231 print, vinq.name+' bad y periodicity (2)' 232 232 IF keyword_set(write) THEN $ … … 241 241 ncdf_varget, cdfid, vid, part1, count = [1, jpj, jpk, jpt], offset = [0, 0, 0, 0] 242 242 ncdf_varget, cdfid, vid, part2, count = [1, jpj, jpk, jpt], offset = [jpi-2, 0, 0, 0] 243 IF array_equal(part1, part2) NE 1 THEN BEGIN 243 IF array_equal(part1, part2) NE 1 THEN BEGIN 244 244 print, vinq.name+' bad x periodicity (1)' 245 245 IF keyword_set(write) THEN $ … … 249 249 ncdf_varget, cdfid, vid, part1, count = [1, jpj, jpk, jpt], offset = [jpi-1, 0, 0, 0] 250 250 ncdf_varget, cdfid, vid, part2, count = [1, jpj, jpk, jpt], offset = [1, 0, 0, 0] 251 IF array_equal(part1, part2) NE 1 THEN BEGIN 251 IF array_equal(part1, part2) NE 1 THEN BEGIN 252 252 print, vinq.name+' bad x periodicity (2)' 253 253 IF keyword_set(write) THEN $ … … 257 257 ELSE:print, vinq.name+' nothing to check' 258 258 ENDCASE 259 ENDIF 259 ENDIF 260 260 ENDFOR 261 261 -
trunk/SRC/Grid/computegrid.pro
r217 r226 4 4 ;+ 5 5 ; 6 ; @file_comments 6 ; @file_comments 7 7 ; 8 8 ; compute the grid parameters (cm_4mesh) common … … 50 50 ; ccmeshparameters, ccreadparameters 51 51 ; 52 ; @categories 52 ; @categories 53 53 ; Grid 54 54 ; … … 72 72 ; optional if [XY]AXIS keyword is used or stepxin is a vector 73 73 ; 74 ; @param nyin {in}{optional}{type=scalar} 74 ; @param nyin {in}{optional}{type=scalar} 75 75 ; number of points in y direction, 76 76 ; optional if [XY]AXIS keyword is used or stepyin is a vector … … 111 111 ; 112 112 ; @keyword SHIFT {default=computed according to glamboundary}{type=scalar} 113 ; Force the manual definition of the zonal shift that must be apply to the data. 113 ; Force the manual definition of the zonal shift that must be apply to the data. 114 114 ; The resulting value will be stored in the common (cm_4mesh) variable key_shift 115 115 ; Note that if key_periodic=0 then in any case key_shift = 0. … … 169 169 ; Activate when the model is a C grid based on a F point 170 170 ; (with a F point at the bottom-left corner and a T point at the 171 ; upper-right corner). In this case, we ignore 171 ; upper-right corner). In this case, we ignore 172 172 ; - the first line of F and V points 173 173 ; - the last line of T and U points … … 181 181 ; Activate when the model is a C grid based on a U point 182 182 ; (with a U point at the bottom-left corner and a T point at the 183 ; upper-right corner). In this case, we ignore 183 ; upper-right corner). In this case, we ignore 184 184 ; - if the grid is not x-periodic, the first column of F and U points 185 185 ; - if the grid is not x-periodic, the last column of T and V points. … … 191 191 ; Activate when the model is a C grid based on a V point 192 192 ; (with a V point at the bottom-left corner and a T point at the 193 ; upper-right corner). In this case, we ignore 193 ; upper-right corner). In this case, we ignore 194 194 ; - the first line of F and V points 195 195 ; - the last line of T and U points … … 203 203 ; Used when the model is a ROMS C-grid with one more point 204 204 ; in longitude for T and V grid and one more point in latitude 205 ; for T and U grid. In this case, we ignore 205 ; for T and U grid. In this case, we ignore 206 206 ; - the last line of T and U points 207 207 ; - the last column of T and V points. … … 215 215 ; Specify the vertical axis. Must be sorted in the increasing or deceasing order 216 216 ; 217 ; @keyword _EXTRA 217 ; @keyword _EXTRA 218 218 ; (not used in the present case...) 219 219 ; 220 220 ; @uses cm_4mesh cm_4data cm_4cal 221 221 ; 222 ; @restrictions if the grid has x/y periodicity o rverlap and/or if222 ; @restrictions if the grid has x/y periodicity overlap and/or if 223 223 ; the mask has 0 everywhere at the border (like a close sea) and 224 224 ; if (we did not activate /plain and xminmesh, xmaxmesh, yminmesh, … … 230 230 ; @restrictions FUV points definition is not exact if the grid is irregular 231 231 ; 232 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 232 ; @history 233 ; Sebastien Masson (smasson\@lodyc.jussieu.fr) 233 234 ; 2000-04-20 234 ; Sept 2004, several bug fix sto suit C grid type...235 ; Sept 2004, several bug fix to suit C grid type... 235 236 ; Aug 2005, rewritte almost everything... 236 237 ; 237 ; @version $Id$ 238 ; @version 239 ; $Id$ 238 240 ; 239 241 ;- … … 996 998 gdepw = gdept 997 999 ENDELSE 998 IF keyword_set(romsh) THEN gdepw = gdept 1000 IF keyword_set(romsh) THEN gdepw = gdept 999 1001 ; 1000 1002 ;==================================================== … … 1020 1022 tmask = tmask[*]#replicate(1, jpkglo) 1021 1023 tmask = reform(tmask, jpiglo, jpjglo, jpkglo, /overwrite) 1022 ENDIF 1024 ENDIF 1023 1025 IF jpiglo EQ 1 OR jpjglo EQ 1 THEN tmask = reform(tmask, jpiglo, jpjglo, jpkglo, /overwrite) 1024 1026 tmask = byte(tmask[ixminmesh:ixmaxmesh, iyminmesh:iymaxmesh, izminmesh:izmaxmesh]) -
trunk/SRC/Grid/ncdf_meshread.pro
r216 r226 6 6 ; @file_comments read NetCDF meshmask file created by OPA 7 7 ; 8 ; @categories 8 ; @categories 9 9 ; Grid 10 10 ; … … 46 46 ; 47 47 ; @keyword SHIFT {default=computed according to glamboundary}{type=scalar} 48 ; Force the manual definition of the zonal shift that must be apply to the data. 48 ; Force the manual definition of the zonal shift that must be apply to the data. 49 49 ; The resulting value will be stored in the common (cm_4mesh) variable key_shift 50 50 ; Note that if key_periodic=0 then in any case key_shift = 0. … … 67 67 ; are equal to -1 they will be automatically defined 68 68 ; 69 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 69 ; @history 70 ; Sebastien Masson (smasson\@lodyc.jussieu.fr) 70 71 ; 12/1999 71 72 ; July 2004, Sebastien Masson: Several modifications (micromeshmask, … … 75 76 ; Aug. 2005, Sebastien Masson: some cleaning + english 76 77 ; 77 ; @version $Id$ 78 ; @version 79 ; $Id$ 78 80 ; 79 81 ;- … … 218 220 ; 219 221 IF array_equal(sort(xaxis), lindgen(jpi)) NE 1 THEN BEGIN 220 print, 'the x axis (1st line of glamt) is not sorted in the inc easing order after the automatic definition of key_shift'222 print, 'the x axis (1st line of glamt) is not sorted in the increasing order after the automatic definition of key_shift' 221 223 print, 'please use the keyword shift (and periodic) to suppress the automatic definition of key_shift (and key_periodic) and define by hand a more suitable value...' 222 224 widget_control, noticebase, bad_id = nothing, /destroy … … 405 407 tmask = byte(res) 406 408 ENDELSE 407 ; bou dary conditions used to compute umask.409 ; boundary conditions used to compute umask. 408 410 varcontient = ncdf_varinq(cdfid, 'umask') 409 411 name = varcontient.name … … 420 422 umaskred = reform(byte(res), /over) 421 423 ENDELSE 422 ; bou dary conditions used to compute fmask (1).424 ; boundary conditions used to compute fmask (1). 423 425 varcontient = ncdf_varinq(cdfid, 'fmask') 424 426 name = varcontient.name … … 433 435 fmaskredy = temporary(fmaskredy) MOD 2 434 436 ENDELSE 435 ; bou dary conditions used to compute vmask437 ; boundary conditions used to compute vmask 436 438 varcontient = ncdf_varinq(cdfid, 'vmask') 437 439 name = varcontient.name … … 459 461 vmaskred = reform(byte(res), /over) 460 462 ENDELSE 461 ; bou dary conditions used to compute fmask (2).463 ; boundary conditions used to compute fmask (2). 462 464 varcontient = ncdf_varinq(cdfid, 'fmask') 463 465 name = varcontient.name … … 509 511 ncdf_close, cdfid 510 512 ;------------------------------------------------------- 511 ; Apply Glambou dary513 ; Apply Glamboundary 512 514 ;------------------------------------------------------- 513 515 if keyword_set(glamboundary) AND key_onearth then BEGIN -
trunk/SRC/Grid/ncdf_meshroms.pro
r216 r226 6 6 ; @file_comments read NetCDF grid file created by ROMS 7 7 ; 8 ; @categories 8 ; @categories 9 9 ; Grid 10 10 ; … … 44 44 ; @keyword NRHO {default=1}{type=scalar} 45 45 ; Specify the number of rho level that contain the data we want to explore. 46 ; This is mainly useful when using xxx to get access to the de pper levers and vertical sections.46 ; This is mainly useful when using xxx to get access to the deeper levers and vertical sections. 47 47 ; 48 48 ; @keyword SHIFT {default=computed according to glamboundary}{type=scalar} 49 ; Force the manual definition of the zonal shift that must be apply to the data. 49 ; Force the manual definition of the zonal shift that must be apply to the data. 50 50 ; The resulting value will be stored in the common (cm_4mesh) variable key_shift 51 51 ; Note that if key_periodic=0 then in any case key_shift = 0. … … 77 77 ; 78 78 ; Scale factors are compuited using the distance between the points 79 ; (which is not the exact definition for irregulare grid). 80 ; 81 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) September 2006 82 ; 83 ; @version $Id$ 79 ; (which is not the exact definition for irregular grid). 80 ; 81 ; @history 82 ; Sebastien Masson (smasson\@lodyc.jussieu.fr) September 2006 83 ; 84 ; @version 85 ; $Id$ 84 86 ; 85 87 ;- … … 197 199 ; 198 200 IF array_equal(sort(xaxis), lindgen(jpi)) NE 1 THEN BEGIN 199 print, 'the x axis (1st line of glamt) is not sorted in the inc easing order after the automatic definition of key_shift'201 print, 'the x axis (1st line of glamt) is not sorted in the increasing order after the automatic definition of key_shift' 200 202 print, 'please use the keyword shift (and periodic) to suppress the automatic definition of key_shift (and key_periodic) and define by hand a more suitable value...' 201 203 widget_control, noticebase, bad_id = nothing, /destroy -
trunk/SRC/Grid/restoreboxparam.pro
r155 r226 5 5 ; 6 6 ; @file_comments restore all the zoom parameters (defined by calling domdef) 7 ; p erviously defined by saveboxparam7 ; previously defined by saveboxparam 8 8 ; 9 ; @param filename {in}{required} 10 ; a scalar string defining the file name 9 ; @param filename {in}{required} 10 ; a scalar string defining the file name 11 11 ; 12 12 ; @uses cm_4mesh (and cm_demomode_used if we are in demo mode) 13 13 ; 14 ; @restrictions call def_myuniquetmpdir, if myuniquetmpdir is undefined: 14 ; @restrictions call def_myuniquetmpdir, if myuniquetmpdir is undefined: 15 15 ; => define, create and add it to !path 16 16 ; 17 17 ; @examples 18 18 ; IDL> restoreboxparam, filename 19 ; 19 ; 20 20 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 21 21 ; July 2005 … … 88 88 return 89 89 end 90 90 -
trunk/SRC/Grid/romsdepth.pro
r192 r226 16 16 ; common variable (cm_4mesh) romszinfos must be correctly defined 17 17 ; 18 ; @history 18 ; @history 19 19 ; Sept 2006 Sebastien Masson (smasson\@lodyc.jussieu.fr) 20 20 ; … … 41 41 grille, -1, -1, -1, -1, nx, ny, nz, firstx, firsty, firstz, lastx, lasty, lastz 42 42 hroms = hroms[firstx:lastx, firsty:lasty] 43 nt = n_elements(zeta)/nx/ny 43 nt = n_elements(zeta)/nx/ny 44 44 ; 45 45 cff1 = 1./sinh(theta_s) … … 47 47 ; 48 48 IF type EQ 'W' THEN BEGIN 49 sc = (findgen(jpk)-jpk)/jpk 50 ; sc = (dindgen(jpk+1)-jpk)/jpk 49 sc = (findgen(jpk)-jpk)/jpk 50 ; sc = (dindgen(jpk+1)-jpk)/jpk 51 51 ; jpk = jpk+1 52 52 ENDIF ELSE BEGIN 53 sc = (findgen(jpk)-jpk-0.5+1)/jpk 53 sc = (findgen(jpk)-jpk-0.5+1)/jpk 54 54 ENDELSE 55 55 ; … … 60 60 hinv = 1./hroms 61 61 hinv = hinv[*]#replicate(1., jpk) 62 ; put a z dimens tion to zeta62 ; put a z dimension to zeta 63 63 zeta = transpose(temporary(zeta)) 64 64 zeta = reform((temporary(zeta))[*]#replicate(1., jpk), nt, ny, nx, jpk, /overwrite)
Note: See TracChangeset
for help on using the changeset viewer.