<div dir="ltr"><div><div><div><div><div><div>Ally,<br></div>I see no indication in this code for why it won't work. When you said that the line<br><br> 'd tloop(amean(100*swed,x=1,x=98,<wbr>y=1,y=129))'<br><br></div>works, what do you mean? Does it plot a 1-D time series showing reasonable values? Are there any error messages anywhere when you run this code? If the line above works, but<br><br> 'd tloop(amean(maskout(100*swed,m<wbr>ask.3(t=1)),x=1,x=98,y=1,y=129<wbr>))'<br><br></div>doesn't, then it means the inclusion of the maskout(100*swed,mask.3(t=1)) function is resulting an field that is entirely undefined. If swed itself is defined everywhere, then it must be the case that either mask.3(t=1) is all negative, or that mask field is itself undefined. Your mask might be fine if you plot it in isolation, but remember that you're changing your dimension environment throughout the script (to values that likely differ from the defaults in the control files), and you have multiple files open simultaneously, so that will impact whether a field is defined or not. You can test if the mask is the problem by adding this line <br><br></div>'d mask.3(t=1)'<br></div><br>immediately before your big display command (and then stop the code by adding <i>return</i>). If the mask plots fine, then I'm missing something else.<br><br></div>Jeff<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 15, 2016 at 1:19 PM, Ally Toure <span dir="ltr"><<a href="mailto:allytoure@gmail.com" target="_blank">allytoure@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"><div><div>Here is the script<br><br>'reinit'<br><br> 'open ../outputs/snowpack.ctl'<br> 'open ../../topo_veg/regrid/siksik_<wbr>topo_veg_20m.ctl'<br> 'open ../process/ave_swe_mask/ave_<wbr>swe_mask.ctl'<br> 'open ../../obs/sonic_sounder_149/<wbr>snowd_daily_2012-2013.ctl'<br><br> 'set grads off'<br> 'set mproj scaled'<br> 'set mpdraw off'<br><br>* the aspect ratio is 129/98=1.32.<br> 'set parea 1.0 7.5 1.0 9.56'<br><br> 'set t 1 303'<br><br>* this is the grid cell corresponding to the met tower location.<br> 'set x 31'<br> 'set y 72'<br><br> 'set vrange 0 15'<br><br>* plot the domain-averaged swe at each time step.<br><br>'set x 1'<br> 'set y 1'<br> 'set t 1 303'<br> 'd 100*sweave_wi.3'<br><br>*'d tloop(amean(100*swed,x=1,x=98,<wbr>y=1,y=129))'<br>* pull dummy<br>* something is wrong with this.<br><br>*'d tloop(amean(maskout(100*swed,<wbr>mask.3(t=1)),x=1,x=98,y=1,y=<wbr>129))'<br><br><br><br></div>Thanks<br></div>Ally<br><div><div><br><br> <br><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 15, 2016 at 1:59 PM, Jeff Duda <span dir="ltr"><<a href="mailto:jeffduda319@gmail.com" target="_blank">jeffduda319@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">mask.3 implies you've opened at least 3 data files and that the mask is indeed in file #3. Can you verify this in your script code? Also make sure the time in your two files matches up or you use a string to reset the time to correspond to one of the fields. You used (t=1) for mask.3, but if t=1 does not represent 00Z 01 January 2001, then you'll have a time mismatch as well. It doesn't appear this is the issue, though. It might help if you sent your script code.<br></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 15, 2016 at 11:32 AM, Ally Toure <span dir="ltr"><<a href="mailto:allytoure@gmail.com" target="_blank">allytoure@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"><div><div><div><div><div>Hi Jeff,<br></div>I plotted the mask<br></div>and it look fine for me. attached is the .ctl and .gdat file<br><br></div>and there is the part of the code<br>* plot the domain-averaged swe at each time step.<br> 'set x 1'<br> 'set y 1'<br> 'set t 1 303'<br> 'set cmark 0'<br><br>This works<br> 'd tloop(amean(100*swed,x=1,x=98,<wbr>y=1,y=129))'<br><br><br>* something is wrong with this.<br> 'd tloop(amean(maskout(100*swed,m<wbr>ask.3(t=1)),x=1,x=98,y=1,y=129<wbr>))'<br><br></div>Thanks<br></div>Ally<br><div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 15, 2016 at 11:25 AM, Ally Toure <span dir="ltr"><<a href="mailto:allytoure@gmail.com" target="_blank">allytoure@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"><div><div>Hi Jeff,<br></div>I will do that. Thanks again for your help.<span><font color="#888888"><br></font></span></div><span><font color="#888888">Ally<br></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 15, 2016 at 11:12 AM, Jeff Duda <span dir="ltr"><<a href="mailto:jeffduda319@gmail.com" target="_blank">jeffduda319@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"><div>That makes it sound like your mask is negative in the entire domain over which you're trying to average. I would verify that the mask is what you want it to be.<span><font color="#888888"><br><br></font></span></div><span><font color="#888888">Jeff<br></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 15, 2016 at 9:32 AM, Ally Toure <span dir="ltr"><<a href="mailto:allytoure@gmail.com" target="_blank">allytoure@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"><div><div><div>Hi Jeff,<br></div>I get a message such as "Entire grid undefined"<br></div>Thanks<span><font color="#888888"><br></font></span></div><span><font color="#888888">Ally<br></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 15, 2016 at 1:24 AM, Jeff Duda <span dir="ltr"><<a href="mailto:jeffduda319@gmail.com" target="_blank">jeffduda319@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">What are you actually seeing?<br></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 14, 2016 at 11:25 PM, Ally Toure <span dir="ltr"><<a href="mailto:allytoure@gmail.com" target="_blank">allytoure@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"><div><div><div><div><div>Hi Jeff,<br></div>thanks so much for you prompt reply<br></div>I set up<br>'set t 1 303'<br> 'd tloop(amean(maskout(100*swed,m<wbr>ask.3(t=1)),x=1,x=98,y=1,y=129<wbr>))'<br><br></div>it still does not work<br></div>What else should I change?<br></div>Thanks<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 15, 2016 at 12:02 AM, Jeff Duda <span dir="ltr"><<a href="mailto:jeffduda319@gmail.com" target="_blank">jeffduda319@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"><div>You probably need to set your dimension environment to 1-D by fixing lat/x and lon/y so that only t varies.<br><br></div>Jeff Duda<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Sun, Aug 14, 2016 at 10:52 PM, Ally Toure <span dir="ltr"><<a href="mailto:allytoure@gmail.com" target="_blank">allytoure@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><div><div>Hi Guys,<br></div>I am trying to compute average of swed at points where the mask value are positive. I used the command below but it won't plot the line.<br></div><div>Am I missing something? Your help would be greatly appreciated.<br></div><div><div><div><br>* something is wrong with this.<br> 'set t 1'<br> 'd tloop(amean(maskout(100*swed,m<wbr>ask.3(t=1)),x=1,x=98,y=1,y=129<wbr>))'<span><font color="#888888"><br><br></font></span></div><span><font color="#888888"><div>Ally<br></div></font></span></div></div></div>
<br></div></div>______________________________<wbr>_________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/li<wbr>stinfo/gradsusr</a><br>
<br></blockquote></div><span><font color="#888888"><br><br clear="all"><span><font color="#888888"><br>-- <br><div data-smartmail="gmail_signature"><div dir="ltr"><div>Jeff Duda<br>Post-doctoral research associate<br>University of Oklahoma School of Meteorology<br></div></div></div>
</font></span></font></span></div><span><font color="#888888">
<br>______________________________<wbr>_________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/li<wbr>stinfo/gradsusr</a><br>
<br></font></span></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/li<wbr>stinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div data-smartmail="gmail_signature"><div dir="ltr"><div>Jeff Duda<br>Post-doctoral research associate<br>University of Oklahoma School of Meteorology<br></div></div></div>
</div>
</div></div><br>______________________________<wbr>_________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/li<wbr>stinfo/gradsusr</a><br>
<br></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/li<wbr>stinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><span><font color="#888888"><br>-- <br><div data-smartmail="gmail_signature"><div dir="ltr"><div>Jeff Duda<br>Post-doctoral research associate<br>University of Oklahoma School of Meteorology<br></div></div></div>
</font></span></div><span><font color="#888888">
</font></span></div></div><span><font color="#888888"><br>______________________________<wbr>_________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/li<wbr>stinfo/gradsusr</a><br>
<br></font></span></blockquote></div><span><font color="#888888"><br></font></span></div>
</div></div></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/li<wbr>stinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><span class="HOEnZb"><font color="#888888"><br>-- <br><div data-smartmail="gmail_signature"><div dir="ltr"><div>Jeff Duda<br>Post-doctoral research associate<br>University of Oklahoma School of Meteorology<br></div></div></div>
</font></span></div><span class="HOEnZb"><font color="#888888">
</font></span></div></div><span class="HOEnZb"><font color="#888888"><br>______________________________<wbr>_________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/li<wbr>stinfo/gradsusr</a><br>
<br></font></span></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/<wbr>listinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Jeff Duda<br>Post-doctoral research associate<br>University of Oklahoma School of Meteorology<br></div></div></div>
</div>