[gradsusr] Checking for valid times in grib file

Jeff Duda jeffduda319 at gmail.com
Sun Jul 14 13:34:23 EDT 2013


Dan,
I think that if you try to plot data from a file at a time where data do
not exist, the output will be that of the undef value in your control file.
 Thus, instead of using the defval stuff, just check a point somewhere near
the center of the grid for having a defined value.  If it has undef, you
should be able to determine that the data don't exist at that time.

On a more general note, if you KNOW when certain data will not be present,
why not just include if statements surrounding the plotting of arrays from
that file at those times?

Jeff Duda

On Sun, Jul 14, 2013 at 11:13 AM, Dan Leins <theedge981 at gmail.com> wrote:

> All,
>
> I've got several WRF model runs that I would like to open at the same time
> using GrADS. This is easy enough, as I simply create and open control files
> for each model. While most of these models run out to 36hrs, I have one
> that runs out to 24 hrs. This causes me a problem when I start making plots
> for hours 27 and beyond, as I start getting the "Entire Grid Undefined"
> error for that shorter model run.
>
> Is there any way that I can check to see if the data exist BEFORE I
> attempt to plot it? I thought I could accomplish this by using q defval on
> a variable (precipitable water in this case) for each forecast hour, check
> to see if the value is above 0, and include the data if that's the case.
>  Here's what I've come up with:
>
> 'define test=pwatclm'
> 'q defval test 100 100'
> rec=sublin(result,1)
> value=subwrd(rec,3)
> say 'the value at this point is 'value
>
> if (value >=0.0)
> say 'Looks like there is data in this file - we can include it'
> else
> say 'Looks like this file is missing data - skip it'
> endif
>
> I'm capturing the output of q defval properly, as I routinely get values
> of precipitable water for hours 00-24. Also, when I get into a time period
> where data are missing (hours 27 and beyond), I get a result that states
> "The value at this point is missing". However, I've obviously got a problem
> with my if statement. It still says there is data in this file.
>
> Any idea what I might have done wrong, or if there's a better way to
> perform this check?
>
> Thanks!
> Dan Leins
>
>
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>


-- 
Jeff Duda
Graduate research assistant
University of Oklahoma School of Meteorology
Center for Analysis and Prediction of Storms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130714/f398cd6f/attachment-0003.html 


More information about the gradsusr mailing list