source: trunk/ToBeReviewed/HOPE/findlineandpointtype.pro @ 53

Last change on this file since 53 was 53, checked in by pinsard, 18 years ago

upgrade of ToBeReviewed?/HOPE according to cerbere.lodyc.jussieu.fr: /usr/home/smasson/SAXO_RD/

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