1 | ;+ |
---|
2 | ; |
---|
3 | ; @file_comments |
---|
4 | ; load ORCA grid from the NetCDF meshmask file created by NEMO |
---|
5 | ; |
---|
6 | ; @categories |
---|
7 | ; Grid |
---|
8 | ; |
---|
9 | ; @param meshfilein {in}{optional}{default='mesh_mask.nc'}{type=scalar string} |
---|
10 | ; Name of the meshmask file to read. If this name does not contain any "/" |
---|
11 | ; and if iodirectory keyword is not specified, then the common variable |
---|
12 | ; iodir will be used to define the mesh file path. |
---|
13 | ; |
---|
14 | ; @param jpkin {in}{optional}{default=the one contained in the grid}{type=scalar} |
---|
15 | ; Number of vertical levels to load |
---|
16 | ; |
---|
17 | ; @keyword STRIDE {default=[1, 1, 1]}{type=3 elements vector} |
---|
18 | ; Specify the stride in x, y and z direction. The resulting |
---|
19 | ; value will be stored in the common (cm_4mesh) variable key_stride |
---|
20 | ; |
---|
21 | ; @keyword _EXTRA |
---|
22 | ; Used to pass keywords to <pro>ncdf_meshread</pro> |
---|
23 | ; |
---|
24 | ; @returns |
---|
25 | ; nothing but define common variables in <pro>cm_4mesh</pro>, |
---|
26 | ; <pro>cm_4data</pro> and <pro>cm_4cal</pro> |
---|
27 | ; |
---|
28 | ; @uses |
---|
29 | ; <pro>cm_4mesh</pro> |
---|
30 | ; <pro>cm_4data</pro> |
---|
31 | ; <pro>cm_4cal</pro> |
---|
32 | ; |
---|
33 | ; @restrictions |
---|
34 | ; works only for ORCA grid (because of the specific periodicity) |
---|
35 | ; |
---|
36 | ; @examples |
---|
37 | ; IDL> load_orca, 'toto_meshmask.nc' |
---|
38 | ; IDL> load_orca, 'toto_meshmask.nc', 1 |
---|
39 | ; |
---|
40 | ; @history |
---|
41 | ; April. 2010, Sebastien Masson: Creation |
---|
42 | ; |
---|
43 | ; @version |
---|
44 | ; $Id$ |
---|
45 | ; |
---|
46 | ;- |
---|
47 | PRO load_orca, meshfilein, jpkin, stride = stride, _extra = ex |
---|
48 | ; jpkin: optional.t |
---|
49 | ; |
---|
50 | @common |
---|
51 | ;---------------------------------------------------------- |
---|
52 | ; define meshfile and check if the file exist |
---|
53 | ;---------------------------------------------------------- |
---|
54 | IF n_elements(meshfilein) EQ 0 THEN meshfilein = 'mesh_mask.nc' |
---|
55 | meshfile = isafile(meshfilein, iodirectory = iodir, title = 'define the NetCDF mesh-file') |
---|
56 | IF size(meshfile, /type) NE 7 THEN return |
---|
57 | ; grid size |
---|
58 | cdfid = ncdf_open(meshfile) |
---|
59 | ncdf_diminq, cdfid, 'x', name, jpiglo |
---|
60 | ncdf_diminq, cdfid, 'y', name, jpjglo |
---|
61 | ncdf_diminq, cdfid, 'z', name, jpkglo |
---|
62 | ncdf_close, cdfid |
---|
63 | ;---------------------------------------------------------- |
---|
64 | ; suppress overlapping bondaries |
---|
65 | ;---------------------------------------------------------- |
---|
66 | ixminmesh = 1 |
---|
67 | ixmaxmesh = jpiglo-2 |
---|
68 | ; |
---|
69 | iyminmesh = 0 |
---|
70 | iymaxmesh = jpjglo -1 + (jpjglo EQ 511) |
---|
71 | ; |
---|
72 | izminmesh = 0 |
---|
73 | IF n_elements(jpkin) EQ 0 THEN jpkin = jpkglo ELSE jpkin = jpkin < jpkglo |
---|
74 | izmaxmesh = jpkin-1 |
---|
75 | ; |
---|
76 | jpt = 1 |
---|
77 | time = 0 |
---|
78 | ;------------------------------------------------------ |
---|
79 | ; read grid parameters |
---|
80 | ;------------------------------------------------------ |
---|
81 | IF n_elements(stride) EQ 3 THEN key_stride = stride ELSE key_stride = [1, 1, 1] |
---|
82 | ncdf_meshread, meshfile, glamboundary = [20.25, 380.25] - 0.25*(jpiglo eq 182), _extra = ex |
---|
83 | ;------------------------------------------------------------- |
---|
84 | domdef |
---|
85 | ; |
---|
86 | triangles_list = triangule(keep_cont = jpiglo NE 182) |
---|
87 | ;---------------------------------------------------------- |
---|
88 | ; define reading parameters |
---|
89 | ;---------------------------------------------------------- |
---|
90 | jpidta = jpiglo |
---|
91 | jpjdta = jpjglo |
---|
92 | jpkdta = jpkglo |
---|
93 | ixmindta = 0 |
---|
94 | ixmaxdta = jpidta-1 |
---|
95 | iymindta = 0 |
---|
96 | iymaxdta = jpjdta-1 |
---|
97 | izmindta = 0 |
---|
98 | izmaxdta = jpkdta-1 |
---|
99 | ; |
---|
100 | @updateold |
---|
101 | ; |
---|
102 | return |
---|
103 | END |
---|