Re: problem of gsn_csm_pres_hgt

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Mon Jan 14 2013 - 12:17:19 MST

NCL is complaining that your level coordinate variable does not have an
appropriate units attribute.. You can either set this manually after
PotVortHybrid is called, or you can make sure that the arrays input to
PotVortHybrid have valid vertical coordinate variable array unit

Looking at the PotVortHybrid coding, the coordinate variables are copied
from your input temperature array to the array returned from
PotVortHybrid (see line 3706). In your case the coordinates are copied
from ppT30 and ppT60, so I am guessing that ppT30 and ppT60 do not have
the required attribute set in the level coordinate variable.

The simple fix is to add the following after the PotVortHybrid call:
printVarSummary(PV30) ; check to make sure there are valid
coordinate variables present
PV30&lev@units = "hPa" ; not sure whether it should be hPa or Pa; you
will have to figure that out
PV60&lev@units = "hPa"

If this does not solve your issue please respond to ncl-talk. (Keep in
mind that this function is unsupported.)

On 01/14/2013 01:57 AM, wrote:
> Hi,
> I had a problem to plot "gsn_csm_pres_hgt", the error is:
> "The coordinate array must contain the attribute 'units' 'mb' 'Mb' 'MB' ...etc. "
> However, I used pres_hybrid_ccm to calculate pressure first, and also had coordinate units for each variables in the beginning. Then I used PotVortHybrid to get potential vorticity. Sould I need to reclaim the array again after I did any claculation? Thank you very much for your help.
> Here is 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)
> PV30 = PotVortHybrid(pm30,ppU30,ppV30,ppT30,lat30, 0, 0)
> PV60 = PotVortHybrid(pm60,ppU60,ppV60,ppT60,lat60, 0, 0)
> Thank you!
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:

Adam Phillips                      
NCAR/Climate and Global Dynamics Division       (303) 497-1726
P.O. Box 3000				
Boulder, CO 80307-3000
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Mon Jan 14 12:17:37 2013

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