Changeset 231 for trunk/SRC/Grid
- Timestamp:
- 03/19/07 18:15:51 (17 years ago)
- Location:
- trunk/SRC/Grid
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Grid/changemsk.pro
r230 r231 1 ;------------------------------------------------------------ 2 ;------------------------------------------------------------ 3 ;------------------------------------------------------------ 4 ; 1 ;+ 5 2 ; @file_comments 6 3 ; add land points on a 2D land-sea mask 7 4 ; 8 ; @categories 5 ; @categories 9 6 ; Grid 10 7 ; 11 ; @param TAB {in}{required} 8 ; @param TAB {in}{required} 12 9 ; a 2D land-sea mask, with 1 on sea and 0 on land 13 10 ; 14 ; @keyword CELLSIZE 11 ; @keyword CELLSIZE 15 12 ; size (in pixel) of the square 16 13 ; representing one point of the mask 17 14 ; 18 ; @returns 15 ; @returns 19 16 ; newmsk the new 2D land-sea mask 20 17 ; … … 28 25 ; June 2006 29 26 ; 30 ; @version 27 ; @version 31 28 ; $Id$ 32 29 ; 33 ;------------------------------------------------------------ 34 ;------------------------------------------------------------ 35 ;------------------------------------------------------------ 30 ;- 31 ; 36 32 function changemsk,tab, CELLSIZE = cellsize 37 33 ; -
trunk/SRC/Grid/checkperio.pro
r226 r231 42 42 ; $Id$ 43 43 ;- 44 ; 44 45 PRO checkperio, file, WRITE = write 45 46 -
trunk/SRC/Grid/computegrid.pro
r226 r231 1 ;------------------------------------------------------------2 ;------------------------------------------------------------3 ;------------------------------------------------------------4 1 ;+ 5 2 ; 6 3 ; @file_comments 7 ;8 4 ; compute the grid parameters (cm_4mesh) common 9 5 ; … … 117 113 ; @keyword STRCALLING {type=string} 118 114 ; a string containing the calling command used to 119 ; call computegrid (this is used by xxx.pro)115 ; call computegrid (this is used by <pro>xxx</pro>) 120 116 ; 121 117 ; @keyword STRIDE {default=[1, 1, 1]}{type=3 elements vector} … … 240 236 ; 241 237 ;- 242 ;------------------------------------------------------------ 243 ;------------------------------------------------------------ 244 ;------------------------------------------------------------ 238 ; 245 239 PRO computegrid, startx, starty, stepxin, stepyin, nxin, nyin $ 246 240 , XAXIS = xaxis, YAXIS = yaxis, ZAXIS = zaxis $ … … 254 248 , UBASE2TBASE = ubase2tbase, VBASE2TBASE = vbase2tbase, FBASE2TBASE = fbase2tbase $ 255 249 , STRCALLING = strcalling, ROMSH = romsh, _extra = ex 256 ;---------------------------------------------------------257 250 ; 258 251 compile_opt idl2, strictarrsubs -
trunk/SRC/Grid/micromeshmask.pro
r157 r231 1 1 ;+ 2 2 ; 3 ; @file_comments 3 ; @file_comments 4 4 ; Reduce the size of the NetCDF meshmask created by OPA by 5 5 ; using bit (and not byte) format for the masks and the float format 6 6 ; for the other fields. 7 7 ; 8 ; @categories 8 ; @categories 9 9 ; For OPA 10 10 ; … … 17 17 ; July 2004 Sebastien Masson (smasson\@lodyc.jussieu.fr) 18 18 ; 19 ; @version 19 ; @version 20 20 ; $Id$ 21 21 ; 22 22 ;- 23 ;------------------------------------------------------ 24 ;------------------------------------------------------ 23 ; 25 24 PRO ncdf_transfer, inid, outid, inname, outname 26 25 ; -
trunk/SRC/Grid/n128gaussian.pro
r157 r231 1 1 ;+ 2 ; @file_comments compute the latitudes of the n128 gaussian grid. See: 3 ; http://www.ecmwf.int/products/data/technical/gaussian/n128FIS.html 2 ; 3 ; @file_comments 4 ; compute the latitudes of the n128 gaussian grid. See: 5 ; <a href="http://www.ecmwf.int/products/data/technical/gaussian/n128FIS.html">Gaussian 128</a> 4 6 ; 5 7 ; @categories 6 8 ; Grid 7 9 ; 8 ; @examples 10 ; @examples 9 11 ; IDL> lat=n128gaussian() 10 12 ; … … 15 17 ; June 2004 16 18 ; 17 ; @version $Id$ 19 ; @version 20 ; $Id$ 18 21 ; 19 22 ;- -
trunk/SRC/Grid/n160gaussian.pro
r157 r231 1 1 ;+ 2 2 ; 3 ; @file_comments compute the latitudes of the n160 gaussian grid. See: 4 ; http://www.ecmwf.int/products/data/technical/gaussian/n160FIS.html 3 ; @file_comments 4 ; compute the latitudes of the n160 gaussian grid. See: 5 ; <a href="http://www.ecmwf.int/products/data/technical/gaussian/n160FIS.html">Gaussian 160</a> 5 6 ; 6 ; @categories 7 ; @categories 7 8 ; Grid 8 9 ; 9 ; @examples 10 ; @examples 10 11 ; IDL>lat=n160gaussian() 11 12 ; … … 16 17 ; June 2004 17 18 ; 18 ; @version $Id$ 19 ; @version 20 ; $Id$ 19 21 ; 20 22 ;- -
trunk/SRC/Grid/n256gaussian.pro
r157 r231 1 1 ;+ 2 2 ; 3 ; @file_comments compute the latitudes of the n256 gaussian grid. See: 4 ; http://www.ecmwf.int/products/data/technical/gaussian/n256FIS.html 5 ; 6 ; @categories 3 ; @file_comments 4 ; compute the latitudes of the n256 gaussian grid. See: 5 ; <a href="http://www.ecmwf.int/products/data/technical/gaussian/n256FIS.html">Gaussian 256</a> 6 ; 7 ; @categories 7 8 ; Grid 8 9 ; … … 16 17 ; June 2004 17 18 ; 18 ; @version $Id$ 19 ; @version 20 ; $Id$ 19 21 ; 20 22 ;- -
trunk/SRC/Grid/n48gaussian.pro
r157 r231 1 1 ;+ 2 2 ; 3 ; @file_comments compute the latitudes of the n48 gaussian grid. See: 4 ; http://www.ecmwf.int/products/data/technical/gaussian/n48FIS.html 3 ; @file_comments 4 ; compute the latitudes of the n48 gaussian grid. See: 5 ; <a href="http://www.ecmwf.int/products/data/technical/gaussian/n48FIS.html">Gaussian 48</a> 5 6 ; 6 ; @categories 7 ; @categories 7 8 ; Grid 8 9 ; … … 16 17 ; June 2004 17 18 ; 18 ; @version $Id$ 19 ; @version 20 ; $Id$ 19 21 ; 20 22 ;- -
trunk/SRC/Grid/n80gaussian.pro
r157 r231 2 2 ; 3 3 ; @file_comments compute the latitudes of the n80 gaussian grid. See: 4 ; http://www.ecmwf.int/products/data/technical/gaussian/n80FIS.html4 ; <a href="http://www.ecmwf.int/products/data/technical/gaussian/n80FIS.html">Gaussian 80</a> 5 5 ; 6 ; @categories 6 ; @categories 7 7 ; Grid 8 8 ; … … 16 16 ; June 2004 17 17 ; 18 ; @version $Id$ 18 ; @version 19 ; $Id$ 19 20 ; 20 21 ;- -
trunk/SRC/Grid/ncdf_meshread.pro
r226 r231 1 ;------------------------------------------------------------2 ;------------------------------------------------------------3 ;------------------------------------------------------------4 1 ;+ 5 2 ; 6 ; @file_comments read NetCDF meshmask file created by OPA 3 ; @file_comments 4 ; read NetCDF meshmask file created by OPA 7 5 ; 8 6 ; @categories … … 24 22 ; defined according to GLAMBOUNDARY. 25 23 ; 26 ; @keyword CHECKDAT Suppressed. Use micromeshmask.pro to create an 24 ; @keyword CHECKDAT 25 ; Suppressed. Use <pro>micromeshmask</pro> to create an 27 26 ; appropriate meshmask. 28 27 ; … … 51 50 ; 52 51 ; @keyword STRCALLING {type=scalar string} 53 ; the calling command used to call computegrid (this is used by xxx.pro)52 ; the calling command used to call computegrid (this is used by <pro>xxx<pro>) 54 53 ; 55 54 ; @keyword STRIDE {default=[1, 1, 1]}{type=3 elements vector} … … 57 56 ; value will be stored in the common (cm_4mesh) variable key_stride 58 57 ; 59 ; @keyword _EXTRA used to pass isafile keywords 60 ; 61 ; @uses cm_4mesh cm_4data cm_4cal 58 ; @keyword _EXTRA 59 ; Used to pass keywords to <pro>isafile</pro> 60 ; 61 ; @uses 62 ; cm_4mesh 63 ; cm_4data 64 ; cm_4cal 62 65 ; 63 66 ; @restrictions 64 ; 65 ; ixminmesh,ixmaxmesh,iyminmesh,iymaxmesh,izminmesh,izmaxmesh must 66 ; be defined before calling ncdf_meshread. if some of those value 67 ; are equal to -1 they will be automatically defined 67 ; ixminmesh,ixmaxmesh,iyminmesh,iymaxmesh,izminmesh,izmaxmesh must 68 ; be defined before calling ncdf_meshread. if some of those value 69 ; are equal to -1 they will be automatically defined 68 70 ; 69 71 ; @history … … 80 82 ; 81 83 ;- 82 ;------------------------------------------------------------ 83 ;------------------------------------------------------------ 84 ;------------------------------------------------------------ 84 ; 85 85 PRO ncdf_meshread, filename, GLAMBOUNDARY = glamboundary, CHECKDAT = checkdat $ 86 86 , ONEARTH = onearth, GETDIMENSIONS = getdimensions $ 87 87 , PERIODIC = periodic, SHIFT = shift, STRIDE = stride $ 88 88 , STRCALLING = strcalling, _EXTRA = ex 89 ;90 ;---------------------------------------------------------91 89 ; 92 90 compile_opt idl2, strictarrsubs -
trunk/SRC/Grid/ncdf_meshroms.pro
r226 r231 1 ;------------------------------------------------------------2 ;------------------------------------------------------------3 ;------------------------------------------------------------4 1 ;+ 5 2 ; 6 ; @file_comments read NetCDF grid file created by ROMS 3 ; @file_comments 4 ; read NetCDF grid file created by ROMS 7 5 ; 8 6 ; @categories … … 58 56 ; value will be stored in the common (cm_4mesh) variable key_stride 59 57 ; 60 ; @keyword _EXTRA used to pass isafile keywords 61 ; 62 ; @uses cm_4mesh cm_4data cm_4cal 58 ; @keyword _EXTRA 59 ; Used to pass keywords to <pro>isafile</pro> 60 ; 61 ; @uses 62 ; cm_4mesh 63 ; cm_4data 64 ; cm_4cal 63 65 ; 64 66 ; @restrictions 65 ; 66 ; ixminmesh,ixmaxmesh,iyminmesh,iymaxmesh,izminmesh,izmaxmesh must 67 ; be defined before calling ncdf_meshread. if some of those value 68 ; are equal to -1 they will be automatically defined 69 ; 70 ; In the original ROMS grid, if F grid has (jpi,jpj) points then T 71 ; grid will have (jpi+1,jpj+1) points, U grid will have (jpi,jpj+1) 72 ; points and V grid will have (jpi+1,jpj) points. 73 ; By default C-grid used in this package needs the same number of 74 ; points for T,U,V and F grid, with a T point at the bottom left 75 ; corner of the grid. We therefore ignore the last column of T and 76 ; V points and the last line of T and U points. 77 ; 78 ; Scale factors are compuited using the distance between the points 79 ; (which is not the exact definition for irregular grid). 67 ; ixminmesh,ixmaxmesh,iyminmesh,iymaxmesh,izminmesh,izmaxmesh must 68 ; be defined before calling ncdf_meshread. if some of those value 69 ; are equal to -1 they will be automatically defined 70 ; 71 ; In the original ROMS grid, if F grid has (jpi,jpj) points then T 72 ; grid will have (jpi+1,jpj+1) points, U grid will have (jpi,jpj+1) 73 ; points and V grid will have (jpi+1,jpj) points. 74 ; By default C-grid used in this package needs the same number of 75 ; points for T,U,V and F grid, with a T point at the bottom left 76 ; corner of the grid. We therefore ignore the last column of T and 77 ; V points and the last line of T and U points. 78 ; 79 ; Scale factors are compuited using the distance between the points 80 ; (which is not the exact definition for irregular grid). 80 81 ; 81 82 ; @history … … 86 87 ; 87 88 ;- 88 ;------------------------------------------------------------ 89 ;------------------------------------------------------------ 90 ;------------------------------------------------------------ 89 ; 91 90 PRO ncdf_meshroms, filename, NRHO = nrho, GLAMBOUNDARY = glamboundary $ 92 91 , ONEARTH = onearth, GETDIMENSIONS = getdimensions $ 93 92 , PERIODIC = periodic, SHIFT = shift, STRIDE = stride $ 94 93 , STRCALLING = strcalling, _EXTRA = ex 95 ;96 ;---------------------------------------------------------97 94 ; 98 95 compile_opt idl2, strictarrsubs -
trunk/SRC/Grid/numbisland.pro
r197 r231 22 22 ; 23 23 ;- 24 ; 24 25 PRO mskneig, msk, nx, ny, indin, numb 25 26 ; flag the point 26 27 msk[indin] = numb 27 28 ; find its neighbourgs 28 indx = (indin MOD nx) + [-1L, 0L, 1L] 29 indx = (indin MOD nx) + [-1L, 0L, 1L] 29 30 indx = (temporary(indx) + nx) MOD nx ; x periodicity 30 indy = (indin/nx) + [-1L, 0L, 1L] 31 indy = (indin/nx) + [-1L, 0L, 1L] 31 32 indy = 0 > temporary(indy) < (ny-1L) ; y periodicity 32 33 ; build 1d index 33 34 ind = temporary(indx)#replicate(1L, 3) + replicate(nx, 3)#temporary(indy) 34 35 ; for each neighbourgs on the same island, call again mskneig 35 FOR i = 0, n_elements(ind)-1 DO BEGIN 36 FOR i = 0, n_elements(ind)-1 DO BEGIN 36 37 IF msk[ind[i]] EQ 0 THEN mskneig, msk, nx, ny, ind[i], numb 37 ENDFOR 38 ENDFOR 38 39 39 40 return … … 82 83 IF (islnumb-9) MOD 10 EQ 0 THEN print, 'island number :'+strtrim(islnumb-9, 1) 83 84 84 mskneig, msk, nx, ny, land, islnumb 85 85 mskneig, msk, nx, ny, land, islnumb 86 86 87 land = (where(msk EQ 0, count))[0] 87 88 islnumb = islnumb + 1 … … 91 92 msk[where(msk EQ -8)] = 0 92 93 93 print, 'time:', systime(1)-time1 94 print, 'time:', systime(1)-time1 94 95 95 96 RETURN, msk -
trunk/SRC/Grid/restoreboxparam.pro
r226 r231 1 ;------------------------------------------------------------2 ;------------------------------------------------------------3 ;------------------------------------------------------------4 1 ;+ 5 2 ; 6 ; @file_comments restore all the zoom parameters (defined by calling domdef) 7 ; previously defined by saveboxparam 3 ; @file_comments 4 ; restore all the zoom parameters (defined by calling <pro>domdef</pro>) 5 ; previously defined by <pro>saveboxparam</pro> 8 6 ; 9 7 ; @param filename {in}{required} 10 8 ; a scalar string defining the file name 11 9 ; 12 ; @uses cm_4mesh (and cm_demomode_used if we are in demo mode) 10 ; @uses 11 ; cm_4mesh (and cm_demomode_used if we are in demo mode) 13 12 ; 14 ; @restrictions call def_myuniquetmpdir, if myuniquetmpdir is undefined: 13 ; @restrictions 14 ; call def_myuniquetmpdir, if myuniquetmpdir is undefined: 15 15 ; => define, create and add it to !path 16 16 ; … … 18 18 ; IDL> restoreboxparam, filename 19 19 ; 20 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 20 ; @history 21 ; Sebastien Masson (smasson\@lodyc.jussieu.fr) 21 22 ; July 2005 22 23 ; 23 ; @version $Id$ 24 ; @version 25 ; $Id$ 24 26 ; 25 27 ;- 26 ;------------------------------------------------------------ 27 ;------------------------------------------------------------ 28 ;------------------------------------------------------------ 28 ; 29 29 PRO restoreboxparam, filename 30 30 ; … … 88 88 return 89 89 end 90 -
trunk/SRC/Grid/romsdepth.pro
r226 r231 1 1 ;+ 2 ; 2 3 ; @file_comments 3 4 ; compute depth of ROMS outputs according to ROMS parameters … … 22 23 ; $Id$ 23 24 ;- 25 ; 24 26 FUNCTION romsdepth 25 27 ; -
trunk/SRC/Grid/saveboxparam.pro
r155 r231 1 ;------------------------------------------------------------2 ;------------------------------------------------------------3 ;------------------------------------------------------------4 1 ;+ 5 2 ; 6 ; @file_comments save all the zoom parameters (defined by calling domdef) 3 ; @file_comments 4 ; save all the zoom parameters (defined by calling <pro>domdef</pro>) 7 5 ; in a file (using save command) located in myuniquetmpdir 8 6 ; (common variable defined by def_myuniquetmpdir) 9 ;10 ; @param filename {in}{required} a scalar string defining the file name11 7 ; 12 ; @uses cm_4mesh (and cm_demomode_used if we are in demo mode) 8 ; @param filename {in}{required} 9 ; a scalar string defining the file name 13 10 ; 14 ; @restrictions call def_myuniquetmpdir, if myuniquetmpdir is undefined: 11 ; @uses 12 ; cm_4mesh (and cm_demomode_used if we are in demo mode) 13 ; 14 ; @restrictions 15 ; call def_myuniquetmpdir, if myuniquetmpdir is undefined: 15 16 ; => define, create and add it to !path 16 17 ; … … 18 19 ; IDL> saveboxparam, filename 19 20 ; 20 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 21 ; @history 22 ; Sebastien Masson (smasson\@lodyc.jussieu.fr) 21 23 ; June 2005 22 24 ; 23 ; @version $Id$ 25 ; @version 26 ; $Id$ 24 27 ; 25 28 ;- 26 ;------------------------------------------------------------ 27 ;------------------------------------------------------------ 28 ;------------------------------------------------------------ 29 ; 29 30 PRO saveboxparam, filename 30 31 ; -
trunk/SRC/Grid/smallmeshmask.pro
r157 r231 1 1 ;+ 2 2 ; 3 ; 4 ; @categories 3 ; @categories 5 4 ; For OPA 6 5 ; … … 13 12 ; July 2004 Sebastien Masson (smasson\@lodyc.jussieu.fr) 14 13 ; 15 ; @version 14 ; @version 16 15 ; $Id$ 17 16 ; 18 17 ;- 19 ;------------------------------------------------------ 20 ;------------------------------------------------------ 18 ; 21 19 PRO ncdf_transfer, inid, outid, inname, outname 22 20 ; … … 30 28 ; 31 29 ;+ 32 ; @file_comments 30 ; @file_comments 33 31 ; Reduce the size of the NetCDF meshmask created by OPA by 34 32 ; using byte format for the masks and the float format for the other … … 45 43 ; xxx.mask.nc. In that case, the meshmask is split into 3 files. 46 44 ; 47 ; @param ncfileout {in}{optional}{default=smallmeshmask.nc} 48 ; the name of the reduced meshmask file. 45 ; @param ncfileout {in}{optional}{default=smallmeshmask.nc} 46 ; the name of the reduced meshmask file. 49 47 ; 50 48 ; @examples … … 52 50 ; IDL> smallmeshmask, 'meshmask_ORCA_R05.nc',iodir=meshdir 53 51 ; 54 ; @categories 52 ; @categories 55 53 ; For OPA 56 54 ; … … 58 56 ; July 2004 Sebastien Masson (smasson\@lodyc.jussieu.fr) 59 57 ; 60 ; @version 58 ; @version 61 59 ; $Id$ 62 60 ; … … 86 84 ; get the horizontal dimensions 87 85 IF n_elements(filein_hgr) NE 0 THEN cdfid = ncdf_open(filein_hgr) $ 88 ELSE cdfid = ncdf_open(filein) 86 ELSE cdfid = ncdf_open(filein) 89 87 ncdf_diminq, cdfid, 'x', name, jpi 90 88 ncdf_diminq, cdfid, 'y', name, jpj … … 95 93 ENDIF 96 94 listdims = strlowcase(ncdf_listdims(cdfid)) 97 IF (where(listdims EQ 'z'))[0] NE -1 THEN ncdf_diminq, cdfid, 'z', name, jpk ELSE BEGIN 95 IF (where(listdims EQ 'z'))[0] NE -1 THEN ncdf_diminq, cdfid, 'z', name, jpk ELSE BEGIN 98 96 dimid = (where(strmid(listdims, 0, 5) EQ 'depth'))[0] 99 IF dimid NE -1 THEN ncdf_diminq, cdfid, dimid, name, jpk ELSE BEGIN 97 IF dimid NE -1 THEN ncdf_diminq, cdfid, dimid, name, jpk ELSE BEGIN 100 98 dummy = report('We could not find the vertical dimension..., its name must be z or start with depth') 101 99 return 102 ENDELSE 103 ENDELSE 100 ENDELSE 101 ENDELSE 104 102 ; get the variables list related to the partial steps 105 103 varlist_ps = ncdf_listvars(cdfid) … … 112 110 ;------------------------------------------------------ 113 111 IF n_elements(ncfileout) EQ 0 THEN ncfileout = 'smallmeshmask.nc' 114 112 115 113 cdfidout = ncdf_create(isafile(FILE = ncfileout, IODIR = iodir, /NEW), /clobber) 116 114 ncdf_control, cdfidout, /nofill … … 184 182 FOR z = 0, n_elements(zgrlist)-1 DO $ 185 183 ncdf_transfer, cdfid, cdfidout, zgrlist[z] 186 ; partial step variables 184 ; partial step variables 187 185 IF (where(varlist_ps EQ 'hdept'))[0] NE -1 THEN $ 188 186 ncdf_transfer, cdfid, cdfidout, 'hdept'
Note: See TracChangeset
for help on using the changeset viewer.