source: trunk/SRC/Grid/ncdf_meshroms.pro @ 210

Last change on this file since 210 was 173, checked in by smasson, 18 years ago

bugfix on the previous commit

  • Property svn:keywords set to Id
File size: 20.4 KB
Line 
1;------------------------------------------------------------
2;------------------------------------------------------------
3;------------------------------------------------------------
4;+
5;
6; @file_comments read NetCDF grid file created by ROMS
7;
8; @categories
9; Grid
10;
11; @examples
12; IDL> ncdf_meshroms [,' filename']
13;
14; @param filename {in}{optional}{default='roms_grd.nc'}{type=scalar string}
15;    Name of the meshmask file to read. If this name does not contain any "/"
16;    and if iodirectory keyword is not specify, then the common variable
17;    iodir will be use to define the mesh file path.
18;
19; @keyword GLAMBOUNDARY {default=those defined in the file}{type=2 elements vector}
20;    Longitude boundaries that should be used to visualize the data.
21;      lon2 > lon1
22;      lon2 - lon1 le 360
23;    By default, the common (cm_4mesh) variable key_shift will be automatically
24;    defined according to GLAMBOUNDARY.
25;
26; @keyword ONEARTH {default=1}{type=scalar: 0 or 1}
27;    Force the manual definition of data localization on the earth or not
28;       0) if the data are not on the earth
29;       1) if the data are on earth (in that case we can for example use
30;          the labels 'longitude', 'latitude' in plots).
31;    The resulting value will be stored in the common (cm_4mesh) variable key_onearth
32;    ONEARTH = 0 forces PERIODIC = 0, SHIFT = 0 and is cancelling GLAMBOUNDARY
33;
34; @keyword GETDIMENSIONS {default=0}{type=scalar: 0 or 1}
35;    Activate this keywords if you only want to know the dimension
36;    of the domain stored in the mesh file. This dimensions will be
37;    defined in jpiglo, jpjglo, jpkglo (cm_4mesh common variables)
38;
39; @keyword PERIODIC {default=computed by using the first line of glamt}{type=scalar: 0 or 1}
40;    Force the manual definition of the grid zonal periodicity.
41;    The resulting value will be stored in the common (cm_4mesh) variable key_periodic
42;    PERIODIC = 0 forces SHIFT = 0
43;
44; @keyword NRHO {default=1}{type=scalar}
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 depper levers and vertical sections.
47;
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.
50;    The resulting value will be stored in the common (cm_4mesh) variable key_shift
51;    Note that if key_periodic=0 then in any case key_shift = 0.
52;
53; @keyword STRCALLING {type=scalar string}
54;    the calling command used to call computegrid (this is used by xxx.pro)
55;
56; @keyword STRIDE {default=[1, 1, 1]}{type=3 elements vector}
57;    Specify the stride in x, y and z direction. The resulting
58;    value will be stored in the common (cm_4mesh) variable key_stride
59;
60; @keyword _EXTRA used to pass isafile keywords
61;
62; @uses cm_4mesh cm_4data cm_4cal
63;
64; @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 irregulare grid).
80;
81; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) September 2006
82;
83; @version $Id$
84;
85;-
86;------------------------------------------------------------
87;------------------------------------------------------------
88;------------------------------------------------------------
89PRO ncdf_meshroms, filename, NRHO = nrho, GLAMBOUNDARY = glamboundary $
90                  , ONEARTH = onearth, GETDIMENSIONS = getdimensions $
91                  , PERIODIC = periodic, SHIFT = shift, STRIDE = stride $
92                  , STRCALLING = strcalling, _EXTRA = ex
93;
94;---------------------------------------------------------
95;
96  compile_opt idl2, strictarrsubs
97;
98@cm_4mesh
99@cm_4data
100@cm_4cal
101  IF NOT keyword_set(key_forgetold) THEN BEGIN
102@updatenew
103@updatekwd
104  ENDIF
105;---------------------------------------------------------
106;
107  tempsun = systime(1)          ; for key_performance
108;-------------------------------------------------------
109; find meshfile name and open it!
110;-------------------------------------------------------
111; def of filename by default
112  IF n_params() EQ 0 then filename = 'roms_grd.nc'
113  meshname = isafile(file = filename, iodirectory = iodir, _EXTRA = ex)
114  meshname = meshname[0]
115;
116  noticebase = xnotice('Reading file !C '+meshname+'!C ...')
117; if the meshmask is on tape archive ... get it back
118  IF !version.OS_FAMILY EQ 'unix' THEN spawn, '\file '+meshname+' > /dev/null'
119  cdfid = ncdf_open(meshname)
120  contient = ncdf_inquire(cdfid)
121;------------------------------------------------------------
122; dimensions
123;------------------------------------------------------------
124  ncdf_diminq, cdfid, 'xi_rho', name, jpiglo
125  ncdf_diminq, cdfid, 'eta_rho', name, jpjglo
126  IF n_elements(nrho) NE 0 THEN jpkglo = long(nrho[0]) $
127    ELSE jpkglo = 1L
128;
129  if keyword_set(getdimensions) then begin
130    widget_control, noticebase, bad_id = nothing, /destroy
131    ncdf_close,  cdfid
132    return
133  endif
134;-------------------------------------------------------
135; check that all i[xyz]min[ax]mesh are well defined
136;-------------------------------------------------------
137  if n_elements(ixminmesh) EQ 0 THEN ixminmesh = 0
138  if n_elements(ixmaxmesh) EQ 0 then ixmaxmesh = jpiglo-1
139  if ixminmesh EQ -1 THEN ixminmesh = 0
140  IF ixmaxmesh EQ -1 then ixmaxmesh = jpiglo-1
141  if n_elements(iyminmesh) EQ 0 THEN iyminmesh = 0
142  IF n_elements(iymaxmesh) EQ 0 then iymaxmesh = jpjglo-1
143  if iyminmesh EQ -1 THEN iyminmesh = 0
144  IF iymaxmesh EQ -1 then iymaxmesh = jpjglo-1
145  if n_elements(izminmesh) EQ 0 THEN izminmesh = 0
146  IF n_elements(izmaxmesh) EQ 0 then izmaxmesh = jpkglo-1
147  if izminmesh EQ -1 THEN izminmesh = 0
148  IF izmaxmesh EQ -1 then izmaxmesh = jpkglo-1
149; definition of jpi,jpj,jpj
150  jpi = long(ixmaxmesh-ixminmesh+1)
151  jpj = long(iymaxmesh-iyminmesh+1)
152  jpk = long(izmaxmesh-izminmesh+1)
153;-------------------------------------------------------
154; check onearth and its consequences
155;-------------------------------------------------------
156  IF n_elements(onearth) EQ 0 THEN key_onearth = 1 $
157  ELSE key_onearth = keyword_set(onearth)
158  IF NOT key_onearth THEN BEGIN
159    periodic = 0
160    shift = 0
161  ENDIF
162;-------------------------------------------------------
163; automatic definition of key_periodic
164;-------------------------------------------------------
165  IF n_elements(periodic) EQ 0 THEN BEGIN
166    IF jpi GT 1 THEN BEGIN
167      ncdf_varget, cdfid, 'lon_rho', xaxis $
168                   , offset = [ixminmesh, iyminmesh], count = [jpi, 1]
169      xaxis = (xaxis+720) MOD 360
170      xaxis = xaxis[sort(xaxis)]
171      key_periodic = (xaxis[jpi-1]+2*(xaxis[jpi-1]-xaxis[jpi-2])) $
172                     GE (xaxis[0]+360)
173    ENDIF ELSE key_periodic = 0
174  ENDIF ELSE key_periodic = keyword_set(periodic)
175;-------------------------------------------------------
176; automatic definition of key_shift
177;-------------------------------------------------------
178  IF n_elements(shift) EQ 0 THEN BEGIN
179    key_shift = long(testvar(var = key_shift))
180;  key_shift will be defined according to the first line of glamt.
181    if keyword_set(glamboundary) AND jpi GT 1 AND key_periodic EQ 1 $
182    THEN BEGIN
183      ncdf_varget, cdfid, 'lon_rho', xaxis $
184                   , offset = [ixminmesh, iyminmesh], count = [jpi, 1]
185; xaxis between glamboundary[0] and glamboundary[1]
186      xaxis = xaxis MOD 360
187      smaller = where(xaxis LT glamboundary[0])
188      if smaller[0] NE -1 then xaxis[smaller] = xaxis[smaller]+360
189      bigger = where(xaxis GE glamboundary[1])
190      if bigger[0] NE -1 then xaxis[bigger] = xaxis[bigger]-360
191;
192      key_shift = (where(xaxis EQ min(xaxis)))[0]
193      IF key_shift NE 0 THEN BEGIN
194        key_shift = jpi-key_shift
195        xaxis = shift(xaxis, key_shift)
196      ENDIF
197;
198      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 inceasing order after the automatic definition of key_shift'
200        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        widget_control, noticebase, bad_id = nothing, /destroy
202        return
203      ENDIF
204;
205    ENDIF ELSE key_shift = 0
206  ENDIF ELSE key_shift = long(shift)*(key_periodic EQ 1)
207;-------------------------------------------------------
208; check key_stride and related things
209;-------------------------------------------------------
210  if n_elements(stride) eq 3 then key_stride = stride
211  if n_elements(key_stride) LE 2 then key_stride = [1, 1, 1]
212  key_stride = 1l > long(key_stride)
213  IF total(key_stride) NE 3  THEN BEGIN
214    IF key_shift NE 0 THEN BEGIN
215; for explanation, see header of read_ncdf_varget.pro
216      jpiright = key_shift
217      jpileft = jpi - key_shift - ( (key_stride[0]-1)-((key_shift-1) MOD key_stride[0]) )
218      jpi = ((jpiright-1)/key_stride[0]+1) + ((jpileft-1)/key_stride[0]+1)
219    ENDIF ELSE jpi = (jpi-1)/key_stride[0]+1
220    jpj = (jpj-1)/key_stride[1]+1
221    jpk = (jpk-1)/key_stride[2]+1
222  ENDIF
223;-------------------------------------------------------
224; for the variables related to the partial steps
225;-------------------------------------------------------
226  key_partialstep = 0
227  hdept = -1
228  hdepw = -1
229;-------------------------------------------------------
230; default definitions to be able to use read_ncdf_varget
231;-------------------------------------------------------
232; default definitions to be able to use read_ncdf_varget
233  ixmindtasauve = testvar(var = ixmindta)
234  iymindtasauve = testvar(var = iymindta)
235  izmindtasauve = testvar(var = izmindta)
236;
237  ixmindta = 0l
238  iymindta = 0l
239  izmindta = 0l
240;
241  jpt = 1
242  time = 1
243  firsttps = 0
244;
245  firstx = 0
246  lastx = jpi-1
247  firsty = 0
248  lasty = jpj-1
249  firstz = 0
250  lastz = jpk-1
251  nx = jpi
252  ny = jpj
253  nz = 1
254  izminmeshsauve = izminmesh
255  izminmesh = 0
256;-------------------------------------------------------
257; 2d arrays:
258;-------------------------------------------------------
259; list the 2d variables that must be read
260  namebase  = ['lon_', 'lat_', 'mask_', 'x_', 'y_']
261  namebase2 = ['glam', 'gphi', 'mask' , 'd1', 'd2']
262;
263; read all grid T variables
264;
265  for i = 0, n_elements(namebase)-1 do begin
266    varcontient = ncdf_varinq(cdfid, namebase[i]+'rho')
267    name = varcontient.name
268@read_ncdf_varget
269    command = namebase2[i]+'t = float(temporary(res))'
270    nothing = execute(command)
271  ENDFOR
272  d1t = 1.e3*(shift(d1t, -1, 0) - d1t)
273  d2t = 1.e3*(shift(d2t, 0, -1) - d2t)
274  for i = 0, n_elements(namebase2)-1 do begin
275    command = namebase2[i]+'t = '+namebase2[i]+'t[0:jpi-2, 0:jpj-2]'
276    nothing = execute(command)
277  ENDFOR
278  tmask = byte(temporary(maskt))
279  IF jpk GT 1 THEN tmask = reform(tmask[*]#replicate(1b, jpk), jpi-1, jpj-1, jpk, /overwrite)
280  e1u = temporary(d1t)
281  e2v = temporary(d2t)
282; h: Final bathymetry at RHO-points
283    varcontient = ncdf_varinq(cdfid, 'h')
284    name = varcontient.name
285@read_ncdf_varget
286    hroms = float(temporary(res))
287    hroms = hroms[0:jpi-2, 0:jpj-2]
288;
289; read all grid U variables
290;
291  jpiglo = jpiglo - 1
292  jpi = jpi - 1
293  ixmaxmesh = ixmaxmesh - 1
294  firstx = 0
295  lastx = jpi-1
296  nx = jpi
297;
298  for i = 0, n_elements(namebase)-1 do begin
299    varcontient = ncdf_varinq(cdfid, namebase[i]+'u')
300    name = varcontient.name
301@read_ncdf_varget
302    command = namebase2[i]+'u = float(temporary(res))'
303    nothing = execute(command)
304  ENDFOR
305  tmpsave = 2. * 1.e3 * d1u[0, 0:jpj-2]
306  d1u = 1.e3*(shift(d1u, -1, 0) - d1u)
307  d2u = 1.e3*(shift(d2u, 0, -1) - d2u)
308  for i = 0, n_elements(namebase2)-1 do begin
309    command = namebase2[i]+'u = '+namebase2[i]+'u[*, 0:jpj-2]'
310    nothing = execute(command)
311  ENDFOR
312  umaskred = byte((temporary(masku))[jpi-1, *])
313  IF jpk GT 1 THEN umaskred = reform(umaskred[*]#replicate(1b, jpk), 1, jpj-1, jpk, /overwrite)
314  e1t = temporary(d1u)
315  e1t = shift(temporary(e1t), 1, 0)
316  e1t[0, *] = temporary(tmpsave)
317  e2f = temporary(d2u)
318;
319; read all grid V variables
320;
321  jpiglo = jpiglo + 1
322  jpi = jpi + 1
323  ixmaxmesh = ixmaxmesh + 1
324  firstx = 0
325  lastx = jpi-1
326  nx = jpi
327  jpjglo = jpjglo - 1
328  jpj = jpj - 1
329  iymaxmesh = iymaxmesh - 1
330  firsty = 0
331  lasty = jpj-1
332  ny = jpj
333;
334  for i = 0, n_elements(namebase)-1 do begin
335    varcontient = ncdf_varinq(cdfid, namebase[i]+'v')
336    name = varcontient.name
337@read_ncdf_varget
338    command = namebase2[i]+'v = float(temporary(res))'
339    nothing = execute(command)
340  ENDFOR
341  d1v = 1.e3*(shift(d1v, -1, 0) - d1v)
342  tmpsave = 2. * 1.e3 * d2v[0:jpi-2, 0]
343  d2v = 1.e3*(shift(d2v, 0, -1) - d2v)
344  for i = 0, n_elements(namebase2)-1 do begin
345    command = namebase2[i]+'v = '+namebase2[i]+'v[0:jpi-2, *]'
346    nothing = execute(command)
347  ENDFOR
348  vmaskred = byte((temporary(maskv))[*, jpj-1])
349  IF jpk GT 1 THEN vmaskred = reform(vmaskred[*]#replicate(1b, jpk), jpi-1, 1, jpk, /overwrite)
350  e1f = temporary(d1v)
351  e2t = temporary(d2v)
352  e2t = shift(temporary(e2t), 0, 1)
353  e2t[*, 0] = temporary(tmpsave)
354;
355; read all grid F variables
356;
357  jpiglo = jpiglo - 1
358  jpi = jpi - 1
359  ixmaxmesh = ixmaxmesh - 1
360  firstx = 0
361  lastx = jpi-1
362  nx = jpi
363;
364  for i = 0, n_elements(namebase)-1 do begin
365    varcontient = ncdf_varinq(cdfid, namebase[i]+'psi')
366    name = varcontient.name
367@read_ncdf_varget
368    command = namebase2[i]+'f = float(temporary(res))'
369    nothing = execute(command)
370  ENDFOR
371  tmpsave1 = 2. * 1.e3 * d1f[0, *]
372  d1f = 1.e3*(shift(d1f, -1, 0) - d1f)
373  tmpsave2 = 2. * 1.e3 * d2f[*, 0]
374  d2f = 1.e3*(shift(d2f, 0, -1) - d2f)
375  fmaskredy = byte(maskf[jpi-1, *])
376  IF jpk GT 1 THEN fmaskredy = reform(fmaskredy[*]#replicate(1b, jpk), 1, jpj, jpk, /overwrite)
377  fmaskredx = byte((temporary(maskf))[*, jpj-1])
378  IF jpk GT 1 THEN fmaskredx = reform(fmaskredx[*]#replicate(1b, jpk), jpi, 1, jpk, /overwrite)
379  e1v = temporary(d1f)
380  e1v = shift(temporary(e1v), 1, 0)
381  e1v[0, *] = temporary(tmpsave1)
382  e2u = temporary(d2f)
383  e2u = shift(temporary(e2u), 0, 1)
384  e2u[*, 0] = temporary(tmpsave2)
385;-------------------------------------------------------
386; in the case of key_stride ne [1, 1, 1] redefine f points
387; coordinates: they must be in the middle of 3 T points
388;-------------------------------------------------------
389  if key_stride[0] NE 1 OR key_stride[1] NE 1 then BEGIN
390; we must recompute glamf and gphif...
391    IF jpi GT 1 THEN BEGIN
392      if (keyword_set(key_onearth) AND keyword_set(xnotsorted)) $
393        OR (keyword_set(key_periodic) AND key_irregular) then BEGIN
394        stepxf = (glamt + 720) MOD 360
395        stepxf = shift(stepxf, -1, -1) - stepxf
396        stepxf = [ [[stepxf]], [[stepxf + 360]], [[stepxf - 360]] ]
397        stepxf = min(abs(stepxf), dimension = 3)
398        IF NOT keyword_set(key_periodic) THEN $
399          stepxf[jpi-1, *] = stepxf[jpi-2, *]
400      ENDIF ELSE BEGIN
401        stepxf = shift(glamt, -1, -1) - glamt
402        IF keyword_set(key_periodic) THEN $
403          stepxf[jpi-1, *] = 360 + stepxf[jpi-1, *] $
404        ELSE stepxf[jpi-1, *] = stepxf[jpi-2, *]
405      ENDELSE
406      IF jpj GT 1 THEN BEGIN
407        stepxf[*, jpj-1] = stepxf[*, jpj-2]
408        stepxf[jpi-1, jpj-1] = stepxf[jpi-2, jpj-2]
409      ENDIF
410      glamf = glamt + 0.5 * stepxf
411    ENDIF ELSE glamf = glamt + 0.5
412    IF jpj GT 1 THEN BEGIN
413; we must compute stepyf: y distance between T(i,j) T(i+1,j+1)
414      stepyf = shift(gphit, -1, -1) - gphit
415      stepyf[*, jpj-1] = stepyf[*, jpj-2]
416      IF jpi GT 1 THEN BEGIN
417        if NOT keyword_set(key_periodic) THEN $
418          stepyf[jpi-1, *] = stepyf[jpi-2, *]
419        stepyf[jpi-1, jpj-1] = stepyf[jpi-2, jpj-2]
420      ENDIF
421      gphif = gphit + 0.5 * stepyf
422    ENDIF ELSE gphif = gphit + 0.5
423  ENDIF
424;-------------------------------------------------------
425; 1d arrays
426;-------------------------------------------------------
427  gdept = findgen(jpk)
428  gdepw = findgen(jpk)
429  e3t = replicate(1., jpk)
430  e3w = replicate(1., jpk)
431;-------------------------------------------------------
432  ncdf_close, cdfid
433;-------------------------------------------------------
434; Apply Glamboudary
435;-------------------------------------------------------
436  if keyword_set(glamboundary) AND key_onearth then BEGIN
437    if glamboundary[0] NE glamboundary[1] then BEGIN
438      glamt = temporary(glamt) MOD 360
439      smaller = where(glamt LT glamboundary[0])
440      if smaller[0] NE -1 then glamt[smaller] = glamt[smaller]+360
441      bigger = where(glamt GE glamboundary[1])
442      if bigger[0] NE -1 then glamt[bigger] = glamt[bigger]-360
443      glamu = temporary(glamu) MOD 360
444      smaller = where(glamu LT glamboundary[0])
445      if smaller[0] NE -1 then glamu[smaller] = glamu[smaller]+360
446      bigger = where(glamu GE glamboundary[1])
447      if bigger[0] NE -1 then glamu[bigger] = glamu[bigger]-360
448      glamv = temporary(glamv) MOD 360
449      smaller = where(glamv LT glamboundary[0])
450      if smaller[0] NE -1 then glamv[smaller] = glamv[smaller]+360
451      bigger = where(glamv GE glamboundary[1])
452      if bigger[0] NE -1 then glamv[bigger] = glamv[bigger]-360
453      glamf = temporary(glamf) MOD 360
454      smaller = where(glamf LT glamboundary[0])
455      if smaller[0] NE -1 then glamf[smaller] = glamf[smaller]+360
456      bigger = where(glamf GE glamboundary[1])
457      if bigger[0] NE -1 then glamf[bigger] = glamf[bigger]-360
458      toosmall = where(glamu EQ glamboundary[0])
459      IF toosmall[0] NE -1 THEN glamu[toosmall] = glamu[toosmall] + 360
460      toosmall = where(glamf EQ glamboundary[0])
461      IF toosmall[0] NE -1 THEN glamf[toosmall] = glamf[toosmall] + 360
462    endif
463  endif
464;-------------------------------------------------------
465; make sure we do have 2d arrays when jpj eq 1
466;-------------------------------------------------------
467  IF jpj EQ 1 THEN BEGIN
468    glamt = reform(glamt, jpi, jpj, /over)
469    gphit = reform(gphit, jpi, jpj, /over)
470    e1t = reform(e1t, jpi, jpj, /over)
471    e2t = reform(e2t, jpi, jpj, /over)
472    glamu = reform(glamu, jpi, jpj, /over)
473    gphiu = reform(gphiu, jpi, jpj, /over)
474    e1u = reform(e1u, jpi, jpj, /over)
475    e2u = reform(e2u, jpi, jpj, /over)
476    glamv = reform(glamv, jpi, jpj, /over)
477    gphiv = reform(gphiv, jpi, jpj, /over)
478    e1v = reform(e1v, jpi, jpj, /over)
479    e2v = reform(e2v, jpi, jpj, /over)
480    glamf = reform(glamf, jpi, jpj, /over)
481    gphif = reform(gphif, jpi, jpj, /over)
482    e1f = reform(e1f, jpi, jpj, /over)
483    e2f = reform(e2f, jpi, jpj, /over)
484  ENDIF
485;-------------------------------------------------------
486  ixmindta = ixmindtasauve
487  iymindta = iymindtasauve
488  izmindta = izmindtasauve
489;-------------------------------------------------------
490  widget_control, noticebase, bad_id = nothing, /destroy
491;
492  key_yreverse = 0
493  key_zreverse = 1
494  key_gridtype = 'c'
495;
496;====================================================
497; grid parameters used by xxx
498;====================================================
499;
500  IF NOT keyword_set(strcalling) THEN BEGIN
501    IF n_elements(ccmeshparameters) EQ 0 THEN strcalling = 'ncdf_meshroms' $
502    ELSE strcalling = ccmeshparameters.filename
503  ENDIF
504  IF n_elements(glamt) GE 2 THEN BEGIN
505    glaminfo = moment(glamt)
506    IF finite(glaminfo[2]) EQ 0 THEN glaminfo = glaminfo[0:1]
507    gphiinfo = moment(gphit)
508    IF finite(gphiinfo[2]) EQ 0 THEN gphiinfo = gphiinfo[0:1]
509  ENDIF ELSE BEGIN
510    glaminfo = glamt
511    gphiinfo = gphit
512  ENDELSE
513  romszinfos = {h:hroms, zeta:replicate(0., jpi, jpj), theta_s:-1, theta_b:-1, hc:-1}
514  ccmeshparameters = {filename:strcalling  $
515          , glaminfo:float(string(glaminfo, format = '(E11.4)')) $
516          , gphiinfo:float(string(gphiinfo, format = '(E11.4)')) $
517          , jpiglo:jpiglo, jpjglo:jpjglo, jpkglo:jpkglo $
518          , jpi:jpi, jpj:jpj, jpk:jpk $
519          , ixminmesh:ixminmesh, ixmaxmesh:ixmaxmesh $
520          , iyminmesh:iyminmesh, iymaxmesh:iymaxmesh $
521          , izminmesh:izminmesh, izmaxmesh:izmaxmesh $
522          , key_shift:key_shift, key_periodic:key_periodic $
523          , key_stride:key_stride, key_gridtype:key_gridtype $
524          , key_yreverse:key_yreverse, key_zreverse:key_zreverse $
525          , key_partialstep:key_partialstep, key_onearth:key_onearth}
526;
527  if keyword_set(key_performance) THEN $
528    print, 'time ncdf_meshread', systime(1)-tempsun
529
530;-------------------------------------------------------
531   @updateold
532;-------------------------------------------------------
533   return
534 end
Note: See TracBrowser for help on using the repository browser.