Dan,<div>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.</div>
<div><br></div><div>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?</div><div><br></div><div>
Jeff Duda<br><br><div class="gmail_quote">On Sun, Jul 14, 2013 at 11:13 AM, Dan Leins <span dir="ltr"><<a href="mailto:theedge981@gmail.com" target="_blank">theedge981@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">All,<div><br></div><div>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. </div>
<div><br></div><div>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:</div>
<div><br></div><div><div>'define test=pwatclm'</div><div>'q defval test 100 100'</div><div>rec=sublin(result,1)</div><div>value=subwrd(rec,3)</div><div>say 'the value at this point is 'value</div>
<div>
<br></div><div>if (value >=0.0)</div><div>say 'Looks like there is data in this file - we can include it'</div><div>else</div><div>say 'Looks like this file is missing data - skip it'</div><div>endif</div>
</div><div><br></div><div>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. </div>
<div><br></div><div>Any idea what I might have done wrong, or if there's a better way to perform this check?</div><div><br></div><div>Thanks!<span class="HOEnZb"><font color="#888888"><br>Dan Leins</font></span></div>
<div><br></div><div><br></div><div><br></div><div><br></div>
</div>
<br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Jeff Duda<br>Graduate research assistant<br>University of Oklahoma School of Meteorology<br>Center for Analysis and Prediction of Storms<br>
</div>