source: trunk/SRC/ToBeReviewed/HOPE/findlineandpointtype.pro @ 327

Last change on this file since 327 was 325, checked in by pinsard, 17 years ago

modification of some headers (+some corrections) to prepare usage of the new idldoc

  • Property svn:keywords set to Id
File size: 9.0 KB
Line 
1;+
2;
3; @file_comments
4;
5; @categories
6;
7; @param SECTYPE
8;
9; @param XAXIS
10;
11; @param YAXIS
12;
13; @param IODIR
14;
15; @returns
16;
17; @uses
18;
19; @restrictions
20;
21; @examples
22;
23; @history
24;
25; @version
26; $Id$
27;
28; @todo seb
29;
30;-
31FUNCTION findlineandpointtype, sectype, xaxis, yaxis, iodir
32; the file 'HOPE_lonlat.nc' is used in this function, This file must
33; be localized in iodir
34; netcdf HOPE_lonlat {
35; dimensions:
36;         latTlow = 242 ;
37;         lonTlowodd = 128 ;
38;         latThigh = 390 ;
39;         lonThighodd = 256 ;
40; variables:
41;         float latTlow(latTlow) ;
42;                 latTlow:units = "degrees_north" ;
43;         float lonTlowodd(lonTlowodd) ;
44;                 lonTlowodd:units = "degrees_east" ;
45;                 lonTlowodd:point_spacing = "even" ;
46;                 lonTlowodd:modulo = " " ;
47;         float latThigh(latThigh) ;
48;                 latThigh:units = "degrees_north" ;
49;         float lonThighodd(lonThighodd) ;
50;                 lonThighodd:units = "degrees_east" ;
51;                 lonThighodd:point_spacing = "even" ;
52;                 lonThighodd:modulo = " " ;
53; }
54;
55  compile_opt idl2, strictarrsubs
56;
57   jpi = n_elements(xaxis)
58   jpj = n_elements(yaxis)
59;
60; determination of the grid type and of the point type
61;
62; low resolution grid: jpi=128, jpj=121 ( x 2), jpk=20
63;
64;                0.       1.4         2.8       4.2        5.6
65;    odd                    T          u          T          u  93.3
66;    even        T          u          T          u             92.2
67;    odd                    T          u          T          u  91.1
68;    even        T          u          T          u             90.0
69;
70;
71; high resolution grid: jpi=256, jpj=195 ( x 2), jpk=29
72;
73;                0.       0.7         1.4        2.1        2.8
74;    odd                    T          u          T          u  91.6
75;    even        T          u          T          u             91.0
76;    odd                    T          u          T          u  90.5
77;    even        T          u          T          u             90.0
78;
79;
80   x0 = floor(xaxis[0]*10)/10.
81   y0 = floor(yaxis[0]*10)/10.
82   case sectype of
83      'xy':BEGIN
84         if (jpi NE 128 and jpi NE 256) $
85          OR (jpj NE 121 AND jpj NE 121*2 AND jpj NE 195 AND jpj NE 195*2) then begin
86            ras = report('CASE NOT coded...')
87            stop
88         ENDIF
89         case 1 of
90            jpj EQ 195: BEGIN
91               case X0 OF
92                  0:BEGIN
93                     line = 'even'
94                     vargrid = 'T'
95                  END
96                  0.7:BEGIN
97                     case y0 OF
98                        91.6:BEGIN
99                           line = 'odd'
100                           vargrid = 'T'
101                        END
102                        91.0:BEGIN
103                           line = 'even'
104                           vargrid = 'U'
105                        END
106                        ELSE:BEGIN
107                           ras = report('CASE NOT coded...')
108                           stop
109                        END
110                     endcase
111                  END
112                  1.4:BEGIN
113                     line = 'odd'
114                     vargrid = 'U'
115                  END
116               endcase
117            END
118            jpj EQ 121:BEGIN
119               case x0 OF
120                  0:BEGIN
121                     line = 'even'
122                     vargrid = 'T'
123                  END
124                  1.4:BEGIN
125                     case y0 OF
126                        93.3:BEGIN
127                           line = 'odd'
128                           vargrid = 'T'
129                        END
130                        92.2:BEGIN
131                           line = 'even'
132                           vargrid = 'U'
133                        END
134                        ELSE:BEGIN
135                           ras = report('CASE NOT coded...')
136                           stop
137                        END
138                     endcase
139                  END
140                  2.8:BEGIN
141                     line = 'odd'
142                     vargrid = 'U'
143                  END
144               endcase
145            END
146            jpj EQ 195*2:BEGIN
147               line = 'odd-even'
148               case x0 OF
149                  0.7:vargrid = 'T'
150                  1.4:vargrid = 'U'
151                  ELSE:BEGIN
152                     ras = report('CASE NOT coded...')
153                     stop
154                  END
155               endcase
156            END
157            jpj EQ 121*2:BEGIN
158               line = 'odd-even'
159               case x0 OF
160                  1.4:vargrid = 'T'
161                  2.8:vargrid = 'U'
162                  ELSE:BEGIN
163                     ras = report('CASE NOT coded...')
164                     stop
165                  END
166               endcase
167            END
168            ELSE:BEGIN
169               ras = report('CASE NOT coded...')
170               stop
171            END
172         endcase
173      END
174      'xz':BEGIN
175         if (jpi NE 128 and jpi NE 256) then begin
176            ras = report('CASE NOT coded...')
177            stop
178         ENDIF
179         case X0 OF
180            0:BEGIN
181               line = 'even'
182               vargrid = 'T'
183            END
184            0.7:BEGIN
185               id = ncdf_open(iodir+'HOPE_lonlat.nc')
186               ncdf_varget, id, 'latThigh', lat
187               test = (where(lat EQ yaxis[0]))[0]
188               if test EQ -1 then begin
189                  ras = report('CASE NOT coded...')
190                  stop
191               endif
192               IF (test MOD 2) EQ 1 THEN BEGIN
193                  line = 'even'
194                  vargrid = 'U'
195               ENDIF ELSE BEGIN
196                  line = 'odd'
197                  vargrid = 'T'
198               ENDELSE
199               ncdf_close, id
200            END
201            1.4:BEGIN
202               if jpi EQ 128 then begin
203                  id = ncdf_open(iodir+'HOPE_lonlat.nc')
204                  ncdf_varget, id, 'latTlow', lat
205                  test = (where(lat EQ yaxis[0]))[0]
206                  if test EQ -1 then begin
207                     ras = report('CASE NOT coded...')
208                     stop
209                  endif
210                  IF (test MOD 2) EQ 1 THEN BEGIN
211                     line = 'even'
212                     vargrid = 'U'
213                  ENDIF ELSE BEGIN
214                     line = 'odd'
215                     vargrid = 'T'
216                  ENDELSE
217                  ncdf_close, id
218               ENDIF ELSE BEGIN
219                  line = 'odd'
220                  vargrid = 'U'
221               ENDELSE
222            END
223            2.8:BEGIN
224               line = 'odd'
225               vargrid = 'U'
226            END
227         endcase
228      END
229      'yz':BEGIN
230         if (jpj NE 121 AND jpj NE 195) then begin
231            ras= report('CASE NOT coded...')
232            stop
233         ENDIF
234         id = ncdf_open(iodir+'HOPE_lonlat.nc')
235         case y0 of
236            93.3:BEGIN
237               line = 'odd'
238               ncdf_varget, id, 'lonTlowodd', lonTodd
239               xstep = (lonTodd[1]-lonTodd[0])/2.
240               case 1 OF
241                  (where(lonTodd EQ xaxis[0]))[0] NE -1:vargrid = 'T'
242                  (where(lonTodd+xstep EQ xaxis[0]))[0] NE -1:vargrid = 'U'
243                  ELSE:BEGIN
244                     ras = report('CASE NOT coded...')
245                     stop
246                  END
247               endcase
248            END
249            92.2:BEGIN
250               line = 'even'
251               ncdf_varget, id, 'lonTlowodd', lonTodd
252               xstep = (lonTodd[1]-lonTodd[0])/2.
253               case 1 OF
254                  (where(lonTodd EQ xaxis[0]))[0] NE -1:vargrid = 'U'
255                  (where(lonTodd-xstep EQ xaxis[0]))[0] NE -1:vargrid = 'T'
256                  ELSE:BEGIN
257                     ras = report('CASE NOT coded...')
258                     stop
259                  END
260               endcase
261            END
262            91.6:BEGIN
263               line = 'odd'
264               ncdf_varget, id, 'lonThighodd', lonTodd
265               xstep = (lonTodd[1]-lonTodd[0])/2.
266               case 1 OF
267                  (where(lonTodd EQ xaxis[0]))[0] NE -1:vargrid = 'T'
268                  (where(lonTodd+xstep EQ xaxis[0]))[0] NE -1:vargrid = 'U'
269                  ELSE:BEGIN
270                     ras = report('CASE NOT coded...')
271                     stop
272                  END
273               endcase
274            END
275            91.0:BEGIN
276               line = 'even'
277               ncdf_varget, id, 'lonThighodd', lonTodd
278               xstep = (lonTodd[1]-lonTodd[0])/2.
279               case 1 OF
280                  (where(lonTodd EQ xaxis[0]))[0] NE -1:vargrid = 'U'
281                  (where(lonTodd-xstep EQ xaxis[0]))[0] NE -1:vargrid = 'T'
282                  ELSE:BEGIN
283                     ras = report('CASE NOT coded...')
284                     stop
285                  END
286               endcase
287            END
288            ELSE:BEGIN
289               ras = report('CASE NOT coded...')
290               stop
291            END
292         endcase
293         ncdf_close, id
294      END
295      else:BEGIN
296         ras = report('CASE NOT coded...')
297         stop
298      END
299   endcase
300
301   return, {linetype:line, pointtype:vargrid}
302end
Note: See TracBrowser for help on using the repository browser.