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
information.
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, lzl@gate.sinica.edu.tw 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:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-- ______________________________________________________________ Adam Phillips asphilli@ucar.edu NCAR/Climate and Global Dynamics Division (303) 497-1726 P.O. Box 3000 Boulder, CO 80307-3000 http://www.cgd.ucar.edu/cas/asphilli _______________________________________________ ncl-talk mailing list List instructions, subscriber options, unsubscribe: http://mailman.ucar.edu/mailman/listinfo/ncl-talkReceived 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