[gradsusr] Time series of hourly accumulated rainfall plotting problem

Jeffrey Duda jdduda at iastate.edu
Tue Aug 30 12:23:47 EDT 2011


Using the following script I am trying to plot hourly rainfall time series

> 'open file.ctl'
> tt=1
> 'set lat 13.1'
> 'set lon 80.00'
> while ( tt <= 49)
> 'set gxout line'
> 'set t ' tt
> 'set grads off'
> 'set grid off'
> 'set ccolor 2'
> 'set cthick 7'
> 'define
> rn=(rainc(t='tt+1')+rainnc(t='tt+1'))-(rainc(t='tt')+rainnc(t='tt'))'
> 'd rn'
>

The block above is really all you need other than to set a time range as
well.  So try something like 'set t 1 15' and just hardcode your tt value.
If the time increment in your file is one hour or less, you can do this.  If
it isn't then you will have to make assumptions and guess.  Also, just FYI,
usually precipitation that accumulates over time is valid at the end of the
period rather than at the beginning.  Thus your definition would be
rn = rainc + rainnc - [rainc(t-1) + rainnc(t-1)]


> fmt='%6.2f'
> tmpval=subwrd(result,4)
> drain=math_format(fmt,tmpval)
> say drain
> tt=tt+1
> endwhile
> 'set gxout line'
> 'd drain'
>

The above display statement should give you an error.  In fact, except for
the [t = tt + 1] and [endwhile] lines, the entire section above this and
below my comment above appears unnecessary.  You can only display defined
fields, not just scalar variables.  drain is just a single number, not an
array.  Thus, Grads doesn't know how to display it.


> 'draw ylab Hourly Rainfall(mm)'
> 'printim CHENNAI.gif white'
> 'quit'
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>


-- 
Jeff Duda
Iowa State University
Meteorology Graduate Student
www.meteor.iastate.edu/~jdduda <http://www.meteor.iastate.edu/%7Ejdduda>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110830/45367694/attachment-0003.html 


More information about the gradsusr mailing list