[gradsusr] GFS_0p25 and total precip accum

Jeff Duda jeffduda319 at gmail.com
Tue Jun 22 11:13:03 EDT 2021

It seems you are overcomplicating this.

First, why are you using the const function for your sum? There should be
no negative values nor any undefined values in the apcpsfc field. If there
are, then there are problems at the level of the data processing upstream
of you.

Second, my understanding of the precip array in GFS output is that it
alternates between 3- and 6-hour accumulation. So at 0300, 0900, 1500,
2100, apcpsfc contains 3-hour precipitation, whereas at 0000, 0600, 1200,
and 1800 UTC, apcpsfc contains 6-hour precipitation. That means that pairs
of adjacent time stamp apcpsfc arrays *are not independent* of each other;
the 6-hour accumulation field completely *contains* the 3-hour
precipitation field. Therefore, if you are looking for run-total
precipitation, you only need to sum the apcpsfc arrays every other time
stamp up to the time before the valid time (or the valid time itself, if
the forecast hour is divisible by 6). The simple function math_fmod(t,6)
will give you the ability to decide if you are computing this for forecast
hours divisible only by 3.

In essence, your display command really only needs to be

* if forecast hour = 0 mod 6
'd sum(apcpsfc,t=1,t-0,2)'
* else
'd sum(apcpsfc,t=1,t-1,2) + apcpsfc'

...or something similar to that.

Jeff Duda

On Tue, Jun 22, 2021 at 8:43 AM Jeff Chabot <jsc219 at gmail.com> wrote:

> Hi GrADS Users,
> I am having trouble with computing precip accum using just GFS_0p25
> from NCEP.  The source that I am using is the following:
> http://nomads.ncep.noaa.gov:80/dods/gfs_0p25/gfs20210622/gfs_0p25_00z
> To compute precip, I'm using:
> 'define precip = const((apcpsfc/25.4),0,-u)'
> I set the following variables:
> t=1
> t0=0
> Then, in the while loop, I am using this equation to subtract 0-6
> hours from 0-3 hours (Please note, I only need to do this for GFS):
> 'define rain = const(precip(t='t') - precip(t='t0'),0,-u)'
> This works well for a 3 hour interval of precip (every three hours up
> to 10 days).
> Next, I am trying to apply a sum to it to get total accumulated precip
> totals:
> 'define accum = sum(rain,t=1,t='t')'
> For other models like NAM, I use the following since I don't need the
> define rain:
> 'define accum = sum(precip,t=1,t='t')'
> I then do the counter and then end my loop:
> t = t+1
> t0 = t0+1
> endwhile
> I have tried modifying the define accum equation with no luck.  If I
> use precip in the equation, then I get ridiculous precip totals of 24
> inches for 1/2 of the country in 10 days.  If I use rain, then I'm not
> getting total precipitation, instead I'm getting an interval.
> Any suggestions would be greatly appreciated.  I suspect that I have
> an error in my equation. the correct accum equation.
> Sincerely,
> Jeff
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr

Jeff Duda, Research Scientist
University of Colorado Boulder
Cooperative Institute for Research in Environmental Sciences
NOAA/OAR/ESRL/Global Systems Laboratory
Boulder, CO
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20210622/2f7129d7/attachment.html>

More information about the gradsusr mailing list