<html><body>
<DIV>Thio,</DIV>
<DIV>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.</DIV>
<DIV>The other option is to create another variable (x_prev) and write the value there then read it in as required. </DIV>
<DIV>If you want to save it for all previous values then create x1, x2, x3 etc and </DIV>
<DIV>if time = 1 ; x1 = value ; endif</DIV>
<DIV>if time = 2 ; x2 = value ; endif</DIV>
<DIV>if time = 3 ; x3 = value ; endif </DIV>
<DIV>etc...</DIV>
<DIV>A poor mans array. </DIV>
<DIV>--<BR>Thanks, <BR>Mark</DIV>
<DIV> </DIV>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">-------------- Original message -------------- <BR>From: Theo Carter <thibidottwo@HOTMAIL.COM> <BR>
<STYLE>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</STYLE>
<META content="Microsoft SafeHTML" name=Generator>
<STYLE>
.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Tahoma;}
</STYLE>
Hi to all,<BR><BR>I have just started using the WRF-ARW (after using WRF-NMM) and it outputs <BR>precip as an accumulated total through the forecast period. <BR> <BR>I need to display in hourly amounts using grads. My display field (called <BR>by a menu button from the main script) outputs 10m wind along with SLP and <BR>precipitation every hour for 48 forecast hours. <BR> <BR>The time is set to _x earlier on in the run script and I wrote the <BR>following:<BR> <BR>####################################################<BR>function rain()<BR># printing out the first hour's precipitation<BR>if _x = 1<BR> 'set gxout contour'<BR> 'set cthick 2'<BR> 'set cmin 0.3'<BR> 'set ccolor rainbow'<BR> 'd APCPsfc'<BR> 'set cthick 3'<BR> 'set ccolor 4'<BR> 'set cmax 0.0001'<BR> 'set cint 0.1'<BR> 'd APCPsfc'<BR># printing out all the following hours precipitation<BR>else<BR> 'define current = APCPsfc'<BR> _x = _x
- 1<BR> 'define last = APCPsfc'<BR> _x = _x + 1<BR> 'define hourly = current-last'<BR> 'set gxout contour'<BR> 'set cthick 2'<BR> 'set cmin 0.3'<BR> 'set ccolor rainbow'<BR> 'd hourly'<BR> 'set cthick 3'<BR> 'set ccolor 4'<BR> 'set cmax 0.0001'<BR> 'set cint 0.1'<BR> 'd hourly'<BR> 'undefine last'<BR> 'undefine current'<BR> 'undefine hourly'<BR>endif<BR>return<BR>######################################<BR><BR>I have been struggling with this for a week, and reading through the <BR>script writing section, it appears that one cannot attach new values to <BR>a 'global variable' such as _x. How then else are you able to step back <BR>one hour so that you can retrieve that data to subtract it from the <BR>current hour?<BR> <BR>Thanks for any help,<BR>Theo<BR><BR></BLOCKQUOTE></body></html>