fwrite MM5 output

Ricardo Hallak hallak at MODEL.IAG.USP.BR
Thu Jul 28 17:51:59 EDT 2005


And the number of levels in the original ctl file? Is that 28 or just 5? A
wrong number of levels in the ctl file can mix level and time records during
fwrite.

Ricardo

On Thu, 28 Jul 2005 17:21:20 -0400, Mary Jo Nath wrote
> I believe that since your MM5 output data is defined:
>
>   xdef  202 linear -157.44  0.0090
>   ydef  133 linear   20.32  0.0090
>
> then in your script you need to
>
>  'set x 1 202'
>  'set y 1 133'
>
> (not
>   'set x 1 201'
>   'set y 1 132' as you have )
>
> Mary Jo
>
> On Thursday 28 July 2005 17:02, you wrote:
> >>  Hello,
> >>
> >>  I am attempting to write MM5 output to a binary file that can be read by
> >>  GRADS.  I only want to write the u and v component of the winds between
> >> the 12th and 36th hour of the forecast run.  I've attached a portion of
> >> the .ctl file that is produced using MM5toGrADS.
> >>
> >>  dset ^test24.dat
> >>  byteswapped
> >>  title MM5 data
> >>  undef -9999.
> >>  pdef   99   69 lcc   20.50 -157.20   14.00   11.00   30.00   60.00
> >> -157.20 2000.   2000.
> >>  xdef  202 linear -157.44  0.0090
> >>  ydef  133 linear   20.32  0.0090
> >>  zdef  28 levels
> >>   0.99900
> >>   0.99600
> >>   0.99200
> >>   0.98750
> >>   0.98250
> >>  tdef  49 linear 00:00Z24JUL2005  1hr
> >>  vars 28
> >>  u         28 99 u wind (m/s)
> >>  v         28 99 v wind (m/s)
> >>
> >>  Here is a copy of my .gs file that I'm using to write the data:
> >>
> >>  'open test24.ctl'
> >>  'set x 1 201'
> >>  'set y 1 132'
> >>  'set gxout fwrite'
> >>  'set fwrite uv.dat'
> >>  t=13
> >>  while (t<=36)
> >>  'set t 't
> >>  'd u'
> >>  'd v'
> >>  t=t+1
> >>  endwhile
> >>
> >>  The .ctl file that is used to read the uv.dat binary file is the
> >> following:
> >>
> >>  dset ^uv.dat
> >>  title wind data
> >>  undef -9999.
> >>  xdef  202 linear -157.44  0.0090
> >>  ydef  133 linear   20.32 0.0090
> >>  zdef  1 levels 0.99900
> >>  tdef 24 linear 12:00Z24JUL2005   1hr
> >>  vars 2
> >>  u         0 99 u wind (m/s)
> >>  v    0 99 u wind (m/s)
> >>  endvars
> >>
> >>  So, the problem that I'm having is that I can write the data to the
> >> binary file, but when I open up grads to display the data that I wrote
the
> >> plots are shifted or skewed.  The display at time t=1 is fine, but as I
> >> move to t=5,6,7,etc.. the data becomes more skewed.  Please help!!



More information about the gradsusr mailing list