Re: How do I interpolate my 4-dimensional data to a 3-dimensional layer in vertical ?

From: moon <nightmoon35_at_nyahnyahspammersnyahnyah>
Date: Thu Dec 31 2009 - 06:03:56 MST

Yes, that is a better and convenient way ,I could understand
one-dimesional p_out, but I didn't well understand the meaning of
four-dimesional p_out in int2p, example
5---http://www.ncl.ucar.edu/Document/Functions/Built-in/int2p.shtml

Example 5
   ; t_out will be dimensioned time, lat, lon, pout_level
     t_out = int2p(p_in(time|:,lat|:,lon|:,pin_lev|:), \
                                 t_in(time|:,lat|:,lon|:,pin_lev|:), \
                                 p_out(time|:,lat|:,lon|:,pout_lev|:),
linlog)

   ; t_out_n will be dimensioned time, pout_level, lat, lon
     t_out_n = int2p_n(p_in, t_in, p_out, linlog, 1)

  In function int2p ,the value of p_in are the levels to interpolate, t_in
is the data to be interpolated, p_out is a certain pressure level in p_in,
but pout_lev stands for what?

  Bests,

  stera

在 Thu, 31 Dec 2009 11:09:36 +0800,Dennis Shea <shea@ucar.edu> 写道:

> I thought about this on the way home.
>
> A *much* faster version of the code is at:
>
> http://www.cgd.ucar.edu/~shea/linint1.ncl_v1
>
> It is based on the fact that the "pout" argument can be one-dimensional
> *or* the same dimensions as "xin" argument.
>
> The "mh" was expanded via "conform"
>
> http://www.ncl.ucar.edu/Document/Functions/Built-in/conform.shtml
>
> Good luck
>
> moon wrote:
>> Thanks,that is exactly what I want to figure out.
>> 在 Thu, 31 Dec 2009 04:23:27 +0800,Dennis Shea <shea@ucar.edu> 写道:
>>
>>> My understanding is that you have a vertical velocity from GODAS
>>> dzdt(time,lev,lat,lon) ==> (1,40,418,360)
>>> and a mixed layer depth
>>> mh(time,lat,lon) ==> (1,418,360)
>>>
>>> You wish to get the dzdt at the depth of the mised layer??
>>>
>>> ===
>>> Currently, there is no function to get this directly. You would have
>>> to use
>>> a double do loop. As in any interpreted language, 'do loop's can be
>>> slow.
>>>
>>> You will have to do something like:
>>>
>>> xo = new ( dimsizes(mh), typeof(dzdt), getFillValue(dzdt))
>>>
>>> w = dzdt(time|:,lat|:,lon|:,lev|:) ; only do this once
>>>
>>>
>>> do nl=0,nlat-1
>>> do ml=0,mlon-1
>>> xo(:,nl,ml) = int2p (lev,w(:,nl,ml,:),mh(:,nl,ml),0)
>>> end do
>>> end do
>>>
>>> xo will be (time,lat,lon) ==> (1,418,360)
>>>
>>> See:
>>> http://www.cgd.ucar.edu/~shea/h_20090105.png
>>> http://www.cgd.ucar.edu/~shea/linint1.ncl
>>> http://www.cgd.ucar.edu/~shea/plt_dzdt_mixed_layer.ncl
>>>
>>> ===
>>>
>>> If you want the data on a 2.5 degree grid, you will have to
>>> use linint [better, linint2_Wrap] or area_hi2lores [better,
>>> area_hi2lores_Wrap]
>>>
>>> http://www.ncl.ucar.edu/Document/Functions/Contributed/linint2_Wrap.shtml
>>> http://www.ncl.ucar.edu/Document/Functions/Contributed/area_hi2lores_Wrap.shtml
>>> to interpolate to the 2.5 grid.
>>>
>>> Please dowload the fileas as soon as possible.
>>>
>>> Good luck
>>>
>>> On 12/29/2009 07:27 PM, moon wrote:
>>>> Hi,
>>>> Sorry, I didn't explain clearly.
>>>> I have 4-dimensional ocean data with grid
>>>> (time,h,lat,lon)--(0,20,72,144).I want to interpolate the data to
>>>> vertical level with grid (time,lat,lon)--(0,72,144).
>>>> The vertical level which I want to interpolate is a fuction of lat
>>>> and lon.
>>>> I have been looking at the web page documenting int2p, it can't meet
>>>> my needs.
>>>>
>>>> Can someone provide some guidance?
>>>>
>>>> Thanks
>>>>
>>>> stera
>>>>
>>>> 在 Wed, 30 Dec 2009 02:24:57 +0800,Dennis Shea <shea@ucar.edu> 写道:
>>>>
>>>>> Sorry. It is not clear what you want to do.
>>>>>
>>>>> Please explain in more detail.
>>>>>
>>>>> moon wrote:
>>>>>> Hi,
>>>>>> I have a four-dimensional data,eg. w(time,lev,lat,lon),how do I
>>>>>> interpolate this variable to a three-dimentional
>>>>>> layer--lev(time,lat,lon) in vertical?
>>>>>> There are the same horizontal grids, but I try to interpolate w to
>>>>>> a vertical layer which change with lat and lon.
>>>>>> Thanks
>>>>>> stera
>>>>>> _______________________________________________
>>>>>> ncl-talk mailing list
>>>>>> List instructions, subscriber options, unsubscribe:
>>>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>
>>>>
>>>
>>>
>>

-- 
使用 Opera 革命性的电子邮件客户程序: http://www.opera.com/mail/
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Dec 31 06:04:07 2009

This archive was generated by hypermail 2.1.8 : Tue Jan 05 2010 - 11:04:11 MST