# Re: Pressure to height and Potential Temp calculation

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Wed Apr 27 2011 - 18:30:19 MDT

You have printed:
print(ptm(12,:,80,220))
and
print(dptdz(12,:,60,220))
Did you mean
print(dptdz(12,:,80,220))
to match ptm?

You should also
print(zm(12,:,80,220))

Maybe better

print(ptm(12,:,80,220)+" "+zm(12,:,80,220)+" "+dptdz(12,:,80,220))

On 4/27/11 6:18 PM, sbasu@iarc.uaf.edu wrote:
> Hi,
>
> Thanks for the reply. I have one more question which I faced when
> calculating potential temperature. It will be really helpful if somebody
> can show me some way out of this problem.
> When I applied these and after getting potential temperature I calculated
> vertical gradient of potential temperature with "center_finite_diff_n" I
> ended up with negative values at some points and as it is a CAM output it
> could not have negative vertical potential temperature gradient.
>
> Is it possible that this is coming due to interpolation of pressure levels
> while converting from sigma levels ? or it may be the differentiation?
> I am attaching the script but it is little bit long.
>
> Thanks,
> Soumik
>
>
>
> Dennis Shea wrote:
>>
>>
>> On 4/27/11 2:41 PM, sbasu@iarc.uaf.edu wrote:
>>> Hi,
>>>
>>> I have two questions. Is there any function to use which will convert
>>> the
>>> pressure levels like 900mb,850mb etc to height using Hypsometric
>>> equation?
>>
>> http://www.ncl.ucar.edu/Document/Functions/Built-in/hydro.shtml
>>
>> http://www.ncl.ucar.edu/Document/Functions/Built-in/pslhyp.shtml
>>>
>>> I have standard CAM3.output. Its in hybrid sigma levels.What is the best
>>> way to calculate potential temperature at different pressure levels ? I
>>> interpolated my temperatures in hybrid sigma levels to pressure levels
>>> like 900mb, 850mb etc using vinth2p.
>>
>> You do not have to interpolate to constant pressure levels.
>> You can calculate potential temperature at each hybrid level
>> directly.
>>
>> Use:
>>
>> http://www.ncl.ucar.edu/Document/Functions/Built-in/pres_hybrid_ccm.shtml
>>
>> hyam = f->hyam ; read from a file the mid-layer coef
>> hybm = f->hybm ; read from a file
>> ps = f->PS ; surface pressure [Pa]
>> p0 = 100000. ; since ps is in Pa or [ f->P0]
>>
>> p = pres_hybrid_ccm(ps,p0,hyam,hybm) ; (ntim,klev,nlat,mlon)
>>
>> t = f->T ; (ntim,klev,nlat,mlon)
>>
>> Then use
>>
>> theta = t*(1000/p)^0.286
>>
>>
>>
>>
>>
>>>
>>> Thanks,
>>> Soumik
>>>
>>
>
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Apr 27 18:30:31 2011

This archive was generated by hypermail 2.1.8 : Tue May 03 2011 - 14:47:35 MDT