Re: Sigma to pressure level conversion for 2D data

From: Rashed Mahmood <rashidcomsis_at_nyahnyahspammersnyahnyah>
Date: Wed Jul 02 2014 - 10:43:42 MDT

sorry,, seems I found the error. the results look okay now. Thanks


On Tue, Jul 1, 2014 at 6:38 PM, Rashed Mahmood <rashidcomsis@gmail.com>
wrote:

> Hi Dennis,
> Thanks for the tric,
> Using suggestions mentioned above, I wrote one very simple script to test
> it. The script is executed but the results does not appear to be correct. I
> am not sure what is wrong. For example in attached figure the first plot
> shows the interpolated result and the second plot shows the original data
> results; which are quite different.
> I am also attaching the script and the two input files. Am I missing
> something here?
>
>
> Rashed
>
>
>
> On Mon, Jun 30, 2014 at 7:59 AM, Dennis Shea <shea@ucar.edu> wrote:
>
>> You can 'trick' the "vinth2p" into working.
>>
>> Consider data(time,lev) and ps(time):
>>
>> dimd = dimsizes(data)
>> ntim = dimd(0)
>> klev = dimd(1)
>>
>> DATA = new( (/ntim,klev,1,1/), typeof(data))
>> DATA(:,:,0,0) = data
>> PSFC = new( (/ntim,1,1/), typeof(ps))
>> PSFC(:,0,0) = ps
>> ; Pa
>>
>>
>> ; +++ from example 4
>>
>> lev_p = (/ 10, 20, 30, 50, 70,100,150,200,250 \
>> , 300,400,500,600,700,850,925,1000
>> /)
>> lev_p!0 = "lev_p" ; variable/dim name
>> lev_p&lev_p = lev_p ; create coordinate variable
>> lev_p@long_name = "pressure" ; attach some
>> attributes
>> lev_p@units = "hPa"
>> lev_p@positive = "down"
>> ; CAM outputs bottom-to-top
>> hybm = sigma ; hybm is the 'sigma' coordinate
>> hyam = hybm ; create a bogus hyam 1D array
>> hyam = 0.0 ; set all values to zero
>>
>> P0mb = 1000.0
>>
>> DATAP = vinth2p(DATA, hyam, hybm, lev_p, PSFC, intyp, P0mb, 1,
>> False )
>> printVarSummary(DATAP) ; (ntim, dimsizes(lev_p), 1,1)
>>
>> datap = DATAP(:,:,0,0)
>> printVarSummary(datap)
>>
>>
>>
>>
>> On Fri, Jun 27, 2014 at 1:30 PM, Rashed Mahmood <rashidcomsis@gmail.com>
>> wrote:
>>
>>> Hi,
>>>
>>> I have two dimensional data as (time,lev) which is on hybrid sigma level.
>>> I want convert from sigma to pressure levels.
>>> For 3D or higher Dimensions it can easily be done using "vinth2p"
>>> function but I am not sure how to do this with 2D (time,lev) or simply 1D
>>> (lev) data sets.
>>>
>>> Is there any workaround for this?
>>>
>>> Thanks
>>> Rashed
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>>
>>
>

Received on Wed Jul 02 04:43:53 2014

This archive was generated by hypermail 2.1.8 : Wed Jul 23 2014 - 15:33:46 MDT