<div dir="ltr"><div><div><div>I think you're making this more complicated than it has to be.<br><br></div>The comma in the lterp() function call simply separates arguments. See the documentation for full details: <a href="http://www.iges.org/grads/gadoc/gradfunclterp.html">http://www.iges.org/grads/gadoc/gradfunclterp.html</a><br><br></div>The lterp() function simply interpolates one field to the grid on which another field exists. You can use any field on which the target grid lies. In other words, if I had a bunch of fields on one grid, say: field1, field2, field3, field4, ..., field99, field100, ..., and I had another field that was defined on a different grid than those, say, oldfield, then all of the following commands will give the same output field:<br></div><div>define newfield = lterp(oldfield,field1)<br></div><div>define newfield = lterp(oldfield,field2)<br>...<br>...<br>...<br></div><div>define newfield = lterp(oldfield,field99)<br></div><div>define newfield = lterp(oldfield,field100)<br>...<br>...<br>...<br></div><div><br></div><div>If you did something like<br><div>define newfield1 = lterp(oldfield,field1)<br></div>define newfield2 = lterp(oldfield,field2)<br><br></div><div>Then newfield1-newfield2 should be a constant 0 field. Try it with your data. Hopefully then you'll start to see the utility of the lterp() function.<br><br></div><div>Jeff<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 11, 2015 at 12:29 PM, Christopher Gilroy <span dir="ltr"><<a href="mailto:chris.gilroy@gmail.com" target="_blank">chris.gilroy@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">Jeff,<div><br></div><div>So since I typically do</div><div><br></div><div>define zcomp006 = docalculations<br></div><div><br></div><div>define snow006 = const((sum(maskout(weasdsfc.1-weasdsfc.1(t-1),weasdsfc.1-weasdsfc.1(t-1)), t=2, t=2)*0.0393701), 0, -u)</div><div><br></div><div>define negto006 = const(maskout(zcomp006,zcomp006-1),40,-u)</div><div><br></div><div>define mor006 = const(maskout(negto006,41-negto006),40,-u)<br></div><div><br></div><div>define totalsnow006 = snow006*mor006</div><div>d totalsnow006</div><div><br></div><div><br></div><div>How would I go about making<br></div><div><br></div><div><span style="font-size:12.8px">define newfield = lterp(mor006,snow006) *this just does some interpolation to make the grids play nice, right?</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">'d newfield' do that? *is the comma in lterp suddenly a * multiplier?</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">I can't see needing to lterp zcomp006 as that's strictly pgrb stuff. snow006 is strictly sflux stuff. I'm following you somewhat with how lterp works, but... yea, first time with lterp.</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 11, 2015 at 12:31 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"><div><div>You can interpolate between ANY two grids as long as both are defined somehow (i.e., in the control file).<br><br></div>define newfield = lterp(snow006,mor006)<br></div><div>OR<br></div><div>define newfield = lterp(mor006,snow006)<br></div><div>should do what you want, unless you want the output on a specific grid. In that case, use which ever field that's on the grid you want to interpolate to as the destination grid (second argument).<br><br></div><div>Jeff DUda<br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><span>On Wed, Nov 11, 2015 at 1:18 AM, Christopher Gilroy <span dir="ltr"><<a href="mailto:chris.gilroy@gmail.com" target="_blank">chris.gilroy@gmail.com</a>></span> wrote:<br></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><div dir="ltr">Alright, so I have 1 var that gets defined off a calculation with tmpprs in pgrb2 files. I have another var that really just gets weasdsfc, with some added calculations. My final var for display (for hour 06) is simply 'totalsnow=snow006 * mor006' and obviously the two grids aren't the same so grads doesn't like that. Is there any way to use lterp and somehow get them to play nice? From the example, lterp you have to somewhat do: lterp(weasdsfc.1, tmpprs.2) but since I'm defining vars and such each from different files I don't know if I have to incorporate lterp into all my define's now or?<div><br></div><div>I don't think it's going to be possible to "up-sample" but all I'm looking to get is temperature values from pgrb2 files, the actual weasdsfc is from sflux. :-/<br>
</div></div>
<br></span>_______________________________________________<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/listinfo/gradsusr</a><br>
<br></blockquote></div><span><font color="#888888"><br><br clear="all"><span class="HOEnZb"><font color="#888888"><br>-- <br><div>Jeff Duda<br>Graduate research assistant<br>University of Oklahoma School of Meteorology<br>Center for Analysis and Prediction of Storms<br></div>
</font></span></font></span></div><span class="HOEnZb"><font color="#888888">
<br>_______________________________________________<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/listinfo/gradsusr</a><br>
<br></font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div>-Chris A. Gilroy</div>
</font></span></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" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Jeff Duda<br>Graduate research assistant<br>University of Oklahoma School of Meteorology<br>Center for Analysis and Prediction of Storms<br></div>
</div>