reducing accumulated precipitation to hourly

Mark Sponsler msponsler at COMCAST.NET
Sat Aug 16 20:42:10 EDT 2008


Thio,
Perhaps a clumsy way to do it is to write the value out to a text file, then read it in again with each loop of the script.
The other option is to create another variable (x_prev) and write the value there then read it in as required.
If you want to save it for all previous values then create x1, x2, x3 etc and
if time = 1 ; x1 = value ; endif
if time = 2 ; x2 =  value ; endif
if time = 3 ; x3 = value ; endif
etc...
A poor mans array.
--
Thanks,
Mark

-------------- Original message --------------
From: Theo Carter <thibidottwo at HOTMAIL.COM>
Hi to all,

I have just started using the WRF-ARW (after using WRF-NMM) and it outputs
precip as an accumulated total through the forecast period.

I need to display in hourly amounts using grads. My display field (called
by a menu button from the main script) outputs 10m wind along with SLP and
precipitation every hour for 48 forecast hours.

The time is set to _x earlier on in the run script and I wrote the
following:

####################################################
function rain()
# printing out the first hour's precipitation
if _x = 1
  'set gxout contour'
  'set cthick 2'
  'set cmin 0.3'
  'set ccolor rainbow'
  'd APCPsfc'
  'set cthick 3'
  'set ccolor 4'
  'set cmax 0.0001'
  'set cint 0.1'
  'd APCPsfc'
# printing out all the following hours precipitation
else
  'define current = APCPsfc'
  _x = _x - 1
  'define last = APCPsfc'
  _x = _x + 1
  'define hourly = current-last'
  'set gxout contour'
  'set cthick 2'
  'set cmin 0.3'
  'set ccolor rainbow'
  'd hourly'
  'set cthick 3'
  'set ccolor 4'
  'set cmax 0.0001'
  'set cint 0.1'
  'd hourly'
  'undefine last'
  'undefine current'
  'undefine hourly'
endif
return
######################################

I have been struggling with this for a week, and reading through the
script writing section, it appears that one cannot attach new values to
a 'global variable' such as _x. How then else are you able to step back
one hour so that you can retrieve that data to subtract it from the
current hour?

Thanks for any help,
Theo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20080817/89fe3f7a/attachment.html 


More information about the gradsusr mailing list