[ncl-talk] The problems to use function of pot_vort_hybrid

Adam Phillips asphilli at ucar.edu
Mon Apr 9 16:50:36 MDT 2018


Hi Zhuxiao,
For b) It looks to me like there is an error in pot_vort_hybrid when one
sets opt = 1, as the function tries to return a number of arrays that are
not defined within the function. I would recommend copying
pot_vort_isobaric from $NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl
to the top of your script and rename the function pot_vort_isobaric2. Alter
your script to call pot_vort_isobaric2. Then, change the following line
from this:
      return( [/pv, s, theta, dthdp, dudp, dvdp, dtdx, dtdy/])
to this:
      return( [/pv, s, theta/] )

And b) should be solved.

For a) Make sure that the order of files specified in fils is correct.
(Specifically, check that the times are increasing between the files.) If
they are correct this might indicate another issue with the function.  If
that's the case you can more easily debug the issue by creating the
pot_vort_isobaric2
function as stated above and putting in place a few printVarSummary
statements above the offending line:

printVarSummary(vr)
printVarSummary(f)
print(nlt)
vr  = vr + conform(vr,f,nlt)     ; absolute vorticity   Line 15551 in
contributed.

Hope that helps. I will file a bug report on issue b).
Adam



On Mon, Apr 9, 2018 at 4:07 PM, Zhuxiao Li - NOAA Affiliate <
zhuxiao.li at noaa.gov> wrote:

> Hi there,
>
> I have got the following two problems when try to apply function of
> pot_vort_hybrid to calcualted Potential Vorticity by a simple NCL code as
> attached (please have a look at first).
>
> I can get PV(only) for one time slot () with the setting 'opt = 0'.
>
> While, a) when I want to cat the NetCDF files, for example cat
> 2013031700.nc4 4 and   2013031701.nc4 (see my NCL code), I got the
> following err message:
>
> >warning:Aggregated dimension coordinate values are non-monotonic; check
> aggregated file >ordering
>
> >fatal:conform: the dimension sizes of the second argument do not match
> those indicated by the >third argument
> >fatal:["Execute.c":8640]:Execute: Error occurred at or near line 15551
> in file >/home/Adam.Kubaryk/local/lib/ncarg/nclscripts/csm/contributed.ncl
> >fatal:["Execute.c":8640]:Execute: Error occurred at or near line 43 in
> file >PV_wind_polar_WAM_4UT_3days_5lev_SW_0317.ncl
>
>
> b) if I use  2013031700.nc4 only, while set 'opt = 1', I get the
> following error message:
>
> >fatal:Variable (dtdy) is undefined
> >fatal:["Execute.c":8640]:Execute: Error occurred at or near line 15562
> in file >/home/Adam.Kubaryk/local/lib/ncarg/nclscripts/csm/contributed.ncl
>
> >fatal:["Execute.c":8640]:Execute: Error occurred at or near line 43 in
> file >PV_wind_polar_WAM_4UT_3days_5lev_SW_0317.ncl
>
> Could you tell me the reasons and give me the solution(s)?
>
> Thanks very much in advance!
> Zhuxiao
>
>
> P.S. my NetCDF file format:
>
> netcdf sigf371.2013030100 {
> dimensions:
>         lon = 192 ;
>         lat = 94 ;
>         lev = 1 ;
>         lev_2 = 150 ;
>         time = UNLIMITED ; // (1 currently)
>         float p(time, lev_2, lat, lon) ;
>                 p:long_name = "pressure (Pa)" ;
>                 p:grid_type = "gaussian" ;
>                 p:_FillValue = -9.99e+33f ;
>                 p:missing_value = -9.99e+33f ;
>
> By the way, I set gridType = 1,  I also tried gridType= 0, got the same
> error message for each issue.
>
>
>
>
>


-- 
Adam Phillips
Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/   303-497-1726

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180409/8b3cf890/attachment.html>


More information about the ncl-talk mailing list