[gradsusr] sflux (weasdsfc) with pgrb2.0p25 (tmpprs), lterp or lost hope?

Jeff Duda jeffduda319 at gmail.com
Wed Nov 11 14:15:34 EST 2015


I think you're making this more complicated than it has to be.

The comma in the lterp() function call simply separates arguments. See the
documentation for full details:
http://www.iges.org/grads/gadoc/gradfunclterp.html

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:
define newfield = lterp(oldfield,field1)
define newfield = lterp(oldfield,field2)
...
...
...
define newfield = lterp(oldfield,field99)
define newfield = lterp(oldfield,field100)
...
...
...

If you did something like
define newfield1 = lterp(oldfield,field1)
define newfield2 = lterp(oldfield,field2)

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.

Jeff

On Wed, Nov 11, 2015 at 12:29 PM, Christopher Gilroy <chris.gilroy at gmail.com
> wrote:

> Jeff,
>
> So since I typically do
>
> define zcomp006 = docalculations
>
> 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)
>
> define negto006 = const(maskout(zcomp006,zcomp006-1),40,-u)
>
> define mor006 = const(maskout(negto006,41-negto006),40,-u)
>
> define totalsnow006 = snow006*mor006
> d totalsnow006
>
>
> How would I go about making
>
> define newfield = lterp(mor006,snow006) *this just does some interpolation
> to make the grids play nice, right?
>
> 'd newfield' do that? *is the comma in lterp suddenly a * multiplier?
>
> 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.
>
> On Wed, Nov 11, 2015 at 12:31 PM, Jeff Duda <jeffduda319 at gmail.com> wrote:
>
>> You can interpolate between ANY two grids as long as both are defined
>> somehow (i.e., in the control file).
>>
>> define newfield = lterp(snow006,mor006)
>> OR
>> define newfield = lterp(mor006,snow006)
>> 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).
>>
>> Jeff DUda
>>
>> On Wed, Nov 11, 2015 at 1:18 AM, Christopher Gilroy <
>> chris.gilroy at gmail.com> wrote:
>>
>>> 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?
>>>
>>> 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. :-/
>>>
>>> _______________________________________________
>>> 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
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>>
>
>
> --
> -Chris A. Gilroy
>
> _______________________________________________
> 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/20151111/10f2e104/attachment.html 


More information about the gradsusr mailing list