# Re: problem of PotVortIsobaric

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Sun Jan 13 2013 - 08:07:59 MST

The potential vorticity functions located in shea_util.ncl
are not documenented or supported.

You can see the inline code documentation by

%> less \$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl
=====

[1] You are using hybrid coordinates so you should use the
other potential vorticity function: PotVortHybrid

[2] In your script, you were computing potential temperature
and passing that variable. The function(s) want
temperature (K). They compute the potential temperature
internally.

function PotVortHybrid\
(p:numeric, u:numeric, v:numeric, t:numeric
,lat[*]:numeric, gridType[1]:integer, opt:integer)

; Compute Isentropic Potential Vorticity on hybrid levels
; CCM Processor User's Guide: May 1994: page B-19
; Original source P Rasch and B Boville
;
; Nomenclature
; p - pressure levels (Pa) [3D or 4D]
; u - zonal wind (m/s) [3D or 4D]
; v - meridional wind (m/s) [3D or 4D]
; t - temperature (K) [3D or 4D]
; gridType- grid type
; =0 means gaussian grid
; =1 means regular or fixed grid
; lat - latitudes
; opt - options: not used
;
; Note: u,v,t,p *** MUST ****:
; [1] be SOUTH-TO-NORTH
; [2] be GLOBAL because spherical harmonics are used
; [3] have named dimensions because data are reordered
;
; Usage:
; f = addfile ("foo.nc", "r")
; U = f->U ; (time,lev,lat,lon) or (lev,lat,lon)
; V = f->V
; T = f->T
; lat = f->lat
; hyam = f->hyam
; hybm = f->hybm
; p0 = f->P0 ; p0=100000
; ps = f->PS ; Pa
; p = pres_hybrid_ccm (ps,p0,hyam,hybm) ; Pa [kg/(m s2)]
; copy_VarCoords(U,p)
;
; ; Potential Vorticity
; PV = PotVortHybrid(p,u,v,t,lat, 0, 0)
;
; Note: A nice basic discussion of PV may be found at:
; Mid-Latitude Atmospheric Dynamics: A First Course
; Jonathan E. Martin, Wiley 2006, QC880.M36 , pp276-onward
;

On 1/12/13 7:37 PM, lzl@gate.sinica.edu.tw wrote:
> Hi,
>
> I had a problem to use the function of "PotVortIsobaric".
> The error message is below:
>
> "Error occurred at or near line 3831 in file \$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl
> And, in the line near 162 in file pv.ncl "
>
> The line near 162 in pv.ncl is where I call PotVortIsobaric
> Here is the brief description in my scrip:
>
> p0 = 100000. ; since ps is in Pa
> pm60 = pres_hybrid_ccm(PS60a,p0,hyam60,hybm60)
> pm30 = pres_hybrid_ccm(PS30a,p0,hyam30,hybm30)
>
> theta60 = ppT60*(p0/pm60)^0.286
> theta30 = ppT30*(p0/pm30)^0.286
>
> copy_VarCoords(ppT60,theta60)
> copy_VarCoords(ppT30,theta30)
>
> printVarSummary(theta60)
> printVarSummary(theta30)
>
> lev30b = lev30*100.0
> lev60b = lev60*100.0
>
> copy_VarAtts(lev30,lev30b)
> copy_VarAtts(lev60,lev60b)
>
> printVarSummary(lev30b)
> printVarSummary(lev60b)
>
> PV30 = PotVortIsobaric(lev30b,ppU30,ppV30,ppT30,lat30, 0, 0)
> PV60 = PotVortIsobaric(lev60b,ppU60,ppV60,ppT60,lat60, 0, 0)
>
> Thank you very much for your help
>
> Sincerely,
> Leslie
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sun Jan 13 08:08:18 2013

This archive was generated by hypermail 2.1.8 : Mon Jan 14 2013 - 14:31:38 MST