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

Last change on this file since 216 was 216, checked in by smasson, 17 years ago

include parts of ncdf_read into ncdf_read_varget. Should have no impact...

  • 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  key_yreverse = 0
258  key_zreverse = 1
259  key_gridtype = 'c'
260;-------------------------------------------------------
261; 2d arrays:
262;-------------------------------------------------------
263; list the 2d variables that must be read
264  namebase  = ['lon_', 'lat_', 'mask_', 'x_', 'y_']
265  namebase2 = ['glam', 'gphi', 'mask' , 'd1', 'd2']
266;
267; read all grid T variables
268;
269  for i = 0, n_elements(namebase)-1 do begin
270    varcontient = ncdf_varinq(cdfid, namebase[i]+'rho')
271    name = varcontient.name
272@read_ncdf_varget
273    command = namebase2[i]+'t = float(temporary(res))'
274    nothing = execute(command)
275  ENDFOR
276  d1t = 1.e3*(shift(d1t, -1, 0) - d1t)
277  d2t = 1.e3*(shift(d2t, 0, -1) - d2t)
278  for i = 0, n_elements(namebase2)-1 do begin
279    command = namebase2[i]+'t = '+namebase2[i]+'t[0:jpi-2, 0:jpj-2]'
280    nothing = execute(command)
281  ENDFOR
282  tmask = byte(temporary(maskt))
283  IF jpk GT 1 THEN tmask = reform(tmask[*]#replicate(1b, jpk), jpi-1, jpj-1, jpk, /overwrite)
284  e1u = temporary(d1t)
285  e2v = temporary(d2t)
286; h: Final bathymetry at RHO-points
287    varcontient = ncdf_varinq(cdfid, 'h')
288    name = varcontient.name
289@read_ncdf_varget
290    hroms = float(temporary(res))
291    hroms = hroms[0:jpi-2, 0:jpj-2]
292;
293; read all grid U variables
294;
295  jpiglo = jpiglo - 1
296  jpi = jpi - 1
297  ixmaxmesh = ixmaxmesh - 1
298  firstx = 0
299  lastx = jpi-1
300  nx = jpi
301;
302  for i = 0, n_elements(namebase)-1 do begin
303    varcontient = ncdf_varinq(cdfid, namebase[i]+'u')
304    name = varcontient.name
305@read_ncdf_varget
306    command = namebase2[i]+'u = float(temporary(res))'
307    nothing = execute(command)
308  ENDFOR
309  tmpsave = 2. * 1.e3 * d1u[0, 0:jpj-2]
310  d1u = 1.e3*(shift(d1u, -1, 0) - d1u)
311  d2u = 1.e3*(shift(d2u, 0, -1) - d2u)
312  for i = 0, n_elements(namebase2)-1 do begin
313    command = namebase2[i]+'u = '+namebase2[i]+'u[*, 0:jpj-2]'
314    nothing = execute(command)
315  ENDFOR
316  umaskred = byte((temporary(masku))[jpi-1, *])
317  IF jpk GT 1 THEN umaskred = reform(umaskred[*]#replicate(1b, jpk), 1, jpj-1, jpk, /overwrite)
318  e1t = temporary(d1u)
319  e1t = shift(temporary(e1t), 1, 0)
320  e1t[0, *] = temporary(tmpsave)
321  e2f = temporary(d2u)
322;
323; read all grid V variables
324;
325  jpiglo = jpiglo + 1
326  jpi = jpi + 1
327  ixmaxmesh = ixmaxmesh + 1
328  firstx = 0
329  lastx = jpi-1
330  nx = jpi
331  jpjglo = jpjglo - 1
332  jpj = jpj - 1
333  iymaxmesh = iymaxmesh - 1
334  firsty = 0
335  lasty = jpj-1
336  ny = jpj
337;
338  for i = 0, n_elements(namebase)-1 do begin
339    varcontient = ncdf_varinq(cdfid, namebase[i]+'v')
340    name = varcontient.name
341@read_ncdf_varget
342    command = namebase2[i]+'v = float(temporary(res))'
343    nothing = execute(command)
344  ENDFOR
345  d1v = 1.e3*(shift(d1v, -1, 0) - d1v)
346  tmpsave = 2. * 1.e3 * d2v[0:jpi-2, 0]
347  d2v = 1.e3*(shift(d2v, 0, -1) - d2v)
348  for i = 0, n_elements(namebase2)-1 do begin
349    command = namebase2[i]+'v = '+namebase2[i]+'v[0:jpi-2, *]'
350    nothing = execute(command)
351  ENDFOR
352  vmaskred = byte((temporary(maskv))[*, jpj-1])
353  IF jpk GT 1 THEN vmaskred = reform(vmaskred[*]#replicate(1b, jpk), jpi-1, 1, jpk, /overwrite)
354  e1f = temporary(d1v)
355  e2t = temporary(d2v)
356  e2t = shift(temporary(e2t), 0, 1)
357  e2t[*, 0] = temporary(tmpsave)
358;
359; read all grid F variables
360;
361  jpiglo = jpiglo - 1
362  jpi = jpi - 1
363  ixmaxmesh = ixmaxmesh - 1
364  firstx = 0
365  lastx = jpi-1
366  nx = jpi
367;
368  for i = 0, n_elements(namebase)-1 do begin
369    varcontient = ncdf_varinq(cdfid, namebase[i]+'psi')
370    name = varcontient.name
371@read_ncdf_varget
372    command = namebase2[i]+'f = float(temporary(res))'
373    nothing = execute(command)
374  ENDFOR
375  tmpsave1 = 2. * 1.e3 * d1f[0, *]
376  d1f = 1.e3*(shift(d1f, -1, 0) - d1f)
377  tmpsave2 = 2. * 1.e3 * d2f[*, 0]
378  d2f = 1.e3*(shift(d2f, 0, -1) - d2f)
379  fmaskredy = byte(maskf[jpi-1, *])
380  IF jpk GT 1 THEN fmaskredy = reform(fmaskredy[*]#replicate(1b, jpk), 1, jpj, jpk, /overwrite)
381  fmaskredx = byte((temporary(maskf))[*, jpj-1])
382  IF jpk GT 1 THEN fmaskredx = reform(fmaskredx[*]#replicate(1b, jpk), jpi, 1, jpk, /overwrite)
383  e1v = temporary(d1f)
384  e1v = shift(temporary(e1v), 1, 0)
385  e1v[0, *] = temporary(tmpsave1)
386  e2u = temporary(d2f)
387  e2u = shift(temporary(e2u), 0, 1)
388  e2u[*, 0] = temporary(tmpsave2)
389;-------------------------------------------------------
390; in the case of key_stride ne [1, 1, 1] redefine f points
391; coordinates: they must be in the middle of 3 T points
392;-------------------------------------------------------
393  if key_stride[0] NE 1 OR key_stride[1] NE 1 then BEGIN
394; we must recompute glamf and gphif...
395    IF jpi GT 1 THEN BEGIN
396      if (keyword_set(key_onearth) AND keyword_set(xnotsorted)) $
397        OR (keyword_set(key_periodic) AND key_irregular) then BEGIN
398        stepxf = (glamt + 720) MOD 360
399        stepxf = shift(stepxf, -1, -1) - stepxf
400        stepxf = [ [[stepxf]], [[stepxf + 360]], [[stepxf - 360]] ]
401        stepxf = min(abs(stepxf), dimension = 3)
402        IF NOT keyword_set(key_periodic) THEN $
403          stepxf[jpi-1, *] = stepxf[jpi-2, *]
404      ENDIF ELSE BEGIN
405        stepxf = shift(glamt, -1, -1) - glamt
406        IF keyword_set(key_periodic) THEN $
407          stepxf[jpi-1, *] = 360 + stepxf[jpi-1, *] $
408        ELSE stepxf[jpi-1, *] = stepxf[jpi-2, *]
409      ENDELSE
410      IF jpj GT 1 THEN BEGIN
411        stepxf[*, jpj-1] = stepxf[*, jpj-2]
412        stepxf[jpi-1, jpj-1] = stepxf[jpi-2, jpj-2]
413      ENDIF
414      glamf = glamt + 0.5 * stepxf
415    ENDIF ELSE glamf = glamt + 0.5
416    IF jpj GT 1 THEN BEGIN
417; we must compute stepyf: y distance between T(i,j) T(i+1,j+1)
418      stepyf = shift(gphit, -1, -1) - gphit
419      stepyf[*, jpj-1] = stepyf[*, jpj-2]
420      IF jpi GT 1 THEN BEGIN
421        if NOT keyword_set(key_periodic) THEN $
422          stepyf[jpi-1, *] = stepyf[jpi-2, *]
423        stepyf[jpi-1, jpj-1] = stepyf[jpi-2, jpj-2]
424      ENDIF
425      gphif = gphit + 0.5 * stepyf
426    ENDIF ELSE gphif = gphit + 0.5
427  ENDIF
428;-------------------------------------------------------
429; 1d arrays
430;-------------------------------------------------------
431  gdept = findgen(jpk)
432  gdepw = findgen(jpk)
433  e3t = replicate(1., jpk)
434  e3w = replicate(1., jpk)
435;-------------------------------------------------------
436  ncdf_close, cdfid
437;-------------------------------------------------------
438; Apply Glamboudary
439;-------------------------------------------------------
440  if keyword_set(glamboundary) AND key_onearth then BEGIN
441    if glamboundary[0] NE glamboundary[1] then BEGIN
442      glamt = temporary(glamt) MOD 360
443      smaller = where(glamt LT glamboundary[0])
444      if smaller[0] NE -1 then glamt[smaller] = glamt[smaller]+360
445      bigger = where(glamt GE glamboundary[1])
446      if bigger[0] NE -1 then glamt[bigger] = glamt[bigger]-360
447      glamu = temporary(glamu) MOD 360
448      smaller = where(glamu LT glamboundary[0])
449      if smaller[0] NE -1 then glamu[smaller] = glamu[smaller]+360
450      bigger = where(glamu GE glamboundary[1])
451      if bigger[0] NE -1 then glamu[bigger] = glamu[bigger]-360
452      glamv = temporary(glamv) MOD 360
453      smaller = where(glamv LT glamboundary[0])
454      if smaller[0] NE -1 then glamv[smaller] = glamv[smaller]+360
455      bigger = where(glamv GE glamboundary[1])
456      if bigger[0] NE -1 then glamv[bigger] = glamv[bigger]-360
457      glamf = temporary(glamf) MOD 360
458      smaller = where(glamf LT glamboundary[0])
459      if smaller[0] NE -1 then glamf[smaller] = glamf[smaller]+360
460      bigger = where(glamf GE glamboundary[1])
461      if bigger[0] NE -1 then glamf[bigger] = glamf[bigger]-360
462      toosmall = where(glamu EQ glamboundary[0])
463      IF toosmall[0] NE -1 THEN glamu[toosmall] = glamu[toosmall] + 360
464      toosmall = where(glamf EQ glamboundary[0])
465      IF toosmall[0] NE -1 THEN glamf[toosmall] = glamf[toosmall] + 360
466    endif
467  endif
468;-------------------------------------------------------
469; make sure we do have 2d arrays when jpj eq 1
470;-------------------------------------------------------
471  IF jpj EQ 1 THEN BEGIN
472    glamt = reform(glamt, jpi, jpj, /over)
473    gphit = reform(gphit, jpi, jpj, /over)
474    e1t = reform(e1t, jpi, jpj, /over)
475    e2t = reform(e2t, jpi, jpj, /over)
476    glamu = reform(glamu, jpi, jpj, /over)
477    gphiu = reform(gphiu, jpi, jpj, /over)
478    e1u = reform(e1u, jpi, jpj, /over)
479    e2u = reform(e2u, jpi, jpj, /over)
480    glamv = reform(glamv, jpi, jpj, /over)
481    gphiv = reform(gphiv, jpi, jpj, /over)
482    e1v = reform(e1v, jpi, jpj, /over)
483    e2v = reform(e2v, jpi, jpj, /over)
484    glamf = reform(glamf, jpi, jpj, /over)
485    gphif = reform(gphif, jpi, jpj, /over)
486    e1f = reform(e1f, jpi, jpj, /over)
487    e2f = reform(e2f, jpi, jpj, /over)
488  ENDIF
489;-------------------------------------------------------
490  ixmindta = ixmindtasauve
491  iymindta = iymindtasauve
492  izmindta = izmindtasauve
493;-------------------------------------------------------
494  widget_control, noticebase, bad_id = nothing, /destroy
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.