Re: fatal:Undefined identifier: (gsn_csm_contour) is undefined, can't continue

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Mar 07 2011 - 14:54:43 MST

Given the number of consecutive missing values in your data, the plot you sent earlier looks correct.

NCL will give you gaps in your plot wherever you have missing values, which is the proper behavior.

Without being able to see your file, there's not much we can do to help you debug it.

Can you write just the variables that you're reading off the file to a new file, and provide us with that?

These variables would be:
        XLAT
        XLONG
        theta
        pressure

At the end of your file, after the "frame(wks)" call, do this:

  outfile = addfile("wrfdebug","c")
  outfile->XLAT = lat2d
  outfile->XLONG = lon2d
  outfile->theta = theta
  outfile->pressure = p

Hopefully, then "wrfdebug.nc" will be a lot smaller than the original file, and you can send this instead.

--Mary

On Mar 7, 2011, at 10:28 AM, wei huang wrote:

> Hi,
> Thank you for your email and nice cooperation. I have checked my WRF data closely there are missing value problem.
> It is very hard to upload the data on ftp due to some error (sorry for that). However, Iím sending you print data summary (Variable: plvl_r) may be it will be helpful to solving the problem.
> I have also checked the code at different times it is working fine except for few time steps where the data is missing (in the same data file).
> Your suggestion and comments will be highly appreciated,
> Thanks again and regards,
>
>
> print
>
> (2,1,134,79) 921.6396
> (2,1,134,80) 919.3051
> (2,1,134,81) 9.96921e+36
> (2,1,134,82) 9.96921e+36
> (2,1,134,83) 9.96921e+36
> (2,1,134,84) 9.96921e+36
> (2,1,134,85) 9.96921e+36
> (2,1,134,86) 9.96921e+36
> (2,1,134,87) 9.96921e+36
> (2,1,134,88) 9.96921e+36
> (2,1,134,89) 9.96921e+36
> (2,1,134,90) 9.96921e+36
> (2,1,134,91) 9.96921e+36
> (2,1,134,92) 9.96921e+36
> (2,1,134,93) 9.96921e+36
> (2,1,134,94) 9.96921e+36
> (2,1,134,95) 9.96921e+36
> (2,1,134,96) 9.96921e+36
> (2,1,134,97) 9.96921e+36
> (2,1,134,98) 9.96921e+36
> (2,1,134,99) 9.96921e+36
> (2,1,134,100) 9.96921e+36
> (2,1,134,101) 9.96921e+36
> (2,1,134,102) 9.96921e+36
> (2,1,134,103) 9.96921e+36
> (2,1,134,104) 9.96921e+36
> (2,1,134,105) 9.96921e+36
> (2,1,134,106) 9.96921e+36
> (2,1,134,107) 9.96921e+36
> (2,1,134,108) 9.96921e+36
> (2,1,134,109) 9.96921e+36
> (2,1,134,110) 9.96921e+36
> (2,1,134,111) 9.96921e+36
> (2,1,134,112) 9.96921e+36
> (2,1,134,113) 9.96921e+36
> (2,1,134,114) 9.96921e+36
> (2,1,134,115) 9.96921e+36
> (2,1,134,116) 9.96921e+36
> (2,1,134,117) 9.96921e+36
> (2,1,134,118) 9.96921e+36
> (2,1,134,119) 9.96921e+36
> (2,1,134,120) 9.96921e+36
> (2,1,134,118) 9.96921e+36
> (2,1,134,119) 9.96921e+36
> (2,1,134,120) 9.96921e+36
> (2,1,134,121) 9.96921e+36
> (2,1,134,122) 9.96921e+36
> (2,1,134,123) 9.96921e+36
> (2,1,134,124) 9.96921e+36
> (2,1,134,125) 9.96921e+36
> (2,1,134,126) 9.96921e+36
> (2,1,134,127) 9.96921e+36
> (2,1,134,128) 9.96921e+36
> (2,1,134,129) 9.96921e+36
> (2,1,134,130) 9.96921e+36
> (2,1,134,131) 9.96921e+36
> (2,1,134,132) 9.96921e+36
> (2,1,134,133) 9.96921e+36
> (2,1,134,134) 9.96921e+36
> (2,1,135,0) 9.96921e+36
> (2,1,135,1) 9.96921e+36
> (2,1,135,2) 9.96921e+36
> (2,1,135,3) 9.96921e+36
> (2,1,135,4) 9.96921e+36
> (2,1,135,5) 9.96921e+36
> (2,1,135,6) 9.96921e+36
> (2,1,135,7) 9.96921e+36
> (2,1,135,8) 9.96921e+36
> (2,1,135,9) 9.96921e+36
> (2,1,135,10) 9.96921e+36
> (2,1,135,11) 9.96921e+36
> (2,1,135,12) 9.96921e+36
> (2,1,135,13) 9.96921e+36
> (2,1,135,14) 9.96921e+36
> (2,1,135,15) 9.96921e+36
> (2,1,135,16) 9.96921e+36
> (2,1,135,17) 9.96921e+36
> (2,1,135,18) 9.96921e+36
> (2,1,135,19) 9.96921e+36
> (2,1,135,20) 851.8718
> (2,1,135,21) 855.6484
> (2,1,135,22) 856.7663
> (2,1,135,23) 852.534
> (2,1,135,24) 851.7963
> (2,1,135,25) 856.1863
> (2,1,135,26) 858.5704
> ;*******************************
>
> On Mon, Mar 7, 2011 at 11:44 PM, Mary Haley <haley@ucar.edu> wrote:
> Wei,
>
> It would help if you could provide the data. We can't tell just from looking at your script what the problem might be.
>
> Please see:
>
> http://www.ncl.ucar.edu/report_bug.shtml
>
> for information on how to ftp the data to our ftp account.
>
> Thanks,
>
> --Mary
>
> On Mar 5, 2011, at 8:54 AM, wei huang wrote:
>
>> Hi,
>> First of all thanks for your valuable guidance and response. Here the two figures are attached. In Fig-1 the plot is okay but in the Fig-2 there are missing contours. These two figures are created at different times from the same wrf output. For interpolating the wrf data I used (rcm2rgrid) NCL function and for vertical interpolation used the function given below:
>> plvl = int2p(theta(time|:,lat|:,lon|:,lev|:), \
>> ; p(time|:,lat|:,lon|:,lev|:), lvl,0)
>> plvl = int2p_n(theta, p,lvl,0,1)
>> plvl = int2p_n_Wrap(theta,p,lvl,0,1)
>>
>> After testing several times they produced the same results as shown in (Fig.1 & 2)
>> There are many vertically and horizontally cross sectional examples are available on the WRF site but Iím interested to plot the figure (as I attached).
>> So I would like to know what is the reason either the code is not correct or something else/ data missing problem? Print VarSummary (plvl_r) is attached herewith.
>> Please your suggestion and comments will be highly appreciated.
>> Thanks and regards,
>> wei
>>
>>
>> Variable: plvl
>> Type: float
>> Total Size: 39487500 bytes
>> 9871875 values
>> Number of Dimensions: 4
>> Dimensions and sizes: [time | 25] x [lat | 195] x [lon | 135] x [lvl | 15]
>> Coordinates:
>> Number Of Attributes: 1
>> _FillValue : 9.96921e+36
>>
>> Variable: plvl_r
>> Type: float
>> Total Size: 39487500 bytes
>> 9871875 values
>> Number of Dimensions: 4
>> Dimensions and sizes: [time | 25] x [lvl | 15] x [lat | 195] x [lon | 135]
>> Coordinates:
>> time: [0.5..24.5]
>> lvl: [300..370]
>> lat: [40.87445..45.88511]
>> lon: [90.85538..100.10556]
>> Number Of Attributes: 1
>> _FillValue : 9.96921e+36
>>
>>
>> On Fri, Mar 4, 2011 at 2:17 AM, Dennis Shea <shea@ucar.edu> wrote:
>>
>>
>> [1] If you are using classic WRF data, the lat/lon are curvilinear:
>>
>> float XLAT(Time, south_north, west_east)
>> float XLONG(Time, south_north, west_east)
>>
>> You can *not* use the coordinate variable syntax {...}
>>
>> plvl_r(10,:,{40:45},{92})
>>
>> By netCDF definition, coordinate variables are
>> one dimensional, monotonic {in/de}creasing variables [*].
>>
>> [2] You should always include a "printVarSummary" of the
>> specific variable.
>> printVarSummary(plvl_r)
>> Also, in this case
>> printVarSummary(plvl_r(10,:,{40:45},{92}))
>> This will help you determine the problem.
>>
>> [3] The WRF project has their own suite of NCL examples. Please see:
>>
>>
>> http://www.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/NCL_examples.htm
>>
>> They even have cross-section examples.
>> Please send *all* questions related to these examples to
>> wrfhelp@ucar.edu
>> ===
>> [4] If you do use 'int2p', I suggest that you use 'int2p_n' or 'int2p_n_Wrap'
>>
>> plvl = int2p_n(theta,p,lvl,0,1)
>> or
>> plvl = int2p_n_Wrap(theta,p,lvl,0,1)
>>
>> http://www.ncl.ucar.edu/Document/Functions/Contributed/int2p_n_Wrap.shtml
>>
>>
>> On 03/03/2011 10:22 AM, wei huang wrote:
>> Hi,
>>
>> Thanks for your help, it is working but inside the figure (attached)
>> contours are missing at some places. Please your advice/suggestion will
>> be appreciated. some part of script and print summary is attached
>> herewith.here i'm using wrf data.
>> thanks again,
>> wei
>> ***********************************
>>
>> ; Create a pressure field on the specified theta surface
>>
>> plvl = int2p(theta(time|:,lat|:,lon|:,lev|:), \
>>
>> p(time|:,lat|:,lon|:,lev|:), lvl,0)
>>
>> plvl!1="lev"
>>
>> printVarSummary(plvl)
>>
>> plvl!0= "time"; name dimensions
>>
>> plvl!1= "lat"
>>
>> plvl!2= "lon"
>>
>> plvl!3= "lvl"
>>
>> printVarSummary(plvl)
>>
>> ;exit
>>
>> plvl&time =p&time; assign coordinates
>>
>> plvl&lvl=lvl; isentropic levels
>>
>> plvl&lat=p&lat
>>
>> plvl&lon=p&lon
>>
>> plvl_r = plvl(time|:,lvl|:,lat|:,lon|:)
>>
>> ;***********************************
>>
>> ; Map resources
>>
>> wks= gsn_open_wks("x11","th_z")
>>
>> res= True; plot mods desired
>>
>> res@cnLineColor= "Blue"; color of second contours
>>
>> res@cnLineThicknessF = 2.; line thickness
>>
>> res@gsnAddCyclic = False
>>
>> res@tmYLMode = "Explicit"
>>
>> res@tmYLValues = ispan(300,370,10)
>>
>> res@tmYLLabels = ispan(300,370,10)
>>
>> res@gsnRightString= ""
>>
>> res@gsnLeftString= ""
>>
>> res@gsnCenterString= ""
>>
>> res@cnLevelSelectionMode = "ExplicitLevels"; set manual contour levels
>>
>> res@cnLevels = ispan(100,1000,50)
>>
>> plot= gsn_csm_contour(wks, plvl_r(10,:,{40:45},{92}), res )
>>
>> end
>>
>> Variable: theta
>>
>> Type: float
>>
>> Total Size: 102667500 bytes
>>
>> 25666875 values
>>
>> Number of Dimensions: 4
>>
>> Dimensions and sizes:[Time | 25] x [bottom_top | 39] x [south_north |
>> 195] x [west_east | 135]
>>
>> Coordinates:
>>
>> Number Of Attributes: 6
>>
>> coordinates : XLONG XLAT
>>
>> stagger :
>>
>> units :K
>>
>> description : Potential Temperature (theta)
>>
>> MemoryOrder : XYZ
>>
>> FieldType :104
>>
>> Variable: theta
>>
>> Type: float
>>
>> Total Size: 102667500 bytes
>>
>> 25666875 values
>>
>> Number of Dimensions: 4
>>
>> Dimensions and sizes:[time | 25] x [lev | 39] x [lat | 195] x [lon | 135]
>>
>> Coordinates:
>>
>> Number Of Attributes: 6
>>
>> coordinates : XLONG XLAT
>>
>> stagger :
>>
>> units :K
>>
>> description : Potential Temperature (theta)
>>
>> MemoryOrder : XYZ
>>
>> FieldType :104
>>
>> Variable: time (coordinate)
>>
>> Type: float
>>
>> Total Size: 100 bytes
>>
>> 25 values
>>
>> Number of Dimensions: 1
>>
>> Dimensions and sizes:[time | 25]
>>
>> Coordinates:
>>
>> Variable: p
>>
>> Type: float
>>
>> Total Size: 102667500 bytes
>>
>> 25666875 values
>>
>> Number of Dimensions: 4
>>
>> Dimensions and sizes:[time | 25] x [lev | 39] x [lat | 195] x [lon | 135]
>>
>> Coordinates:
>>
>> time: [0.5..24.5]
>>
>> Number Of Attributes: 6
>>
>> coordinates : XLONG XLAT
>>
>> stagger :
>>
>> units :hPa
>>
>> description : Pressure
>>
>> MemoryOrder : XYZ
>>
>> FieldType :104
>>
>> Variable: plvl
>>
>> Type: float
>>
>> Total Size: 39487500 bytes
>>
>> 9871875 values
>>
>> Number of Dimensions: 4
>>
>> Dimensions and sizes:[25] x [lev | 195] x [135] x [15]
>>
>> Coordinates:
>>
>> Number Of Attributes: 1
>>
>> _FillValue :9.96921e+36
>>
>> Variable: plvl
>>
>> Type: float
>>
>> Total Size: 39487500 bytes
>>
>> 9871875 values
>>
>> Number of Dimensions: 4
>>
>> Dimensions and sizes:[time | 25] x [lat | 195] x [lon | 135] x [lvl | 15]
>>
>> Coordinates:
>>
>> Number Of Attributes: 1
>>
>> _FillValue :9.96921e+36
>>
>>
>>
>> On Thu, Mar 3, 2011 at 1:45 AM, Rick Brownrigg <brownrig@ucar.edu
>> <mailto:brownrig@ucar.edu>> wrote:
>>
>> Hi,
>>
>> It sounds like you are not loading the requisite script libraries (?)
>>
>> load"$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>> load"$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>>
>> See:
>>
>> http://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_csm_contour.shtml
>>
>> On Mar 2, 2011, at 10:41 AM, wei huang wrote:
>>
>> Hi,
>> please I'm getting an error given below. could anyone help me how
>> to fix it?
>> thanks
>> wei
>> ; options for pressure plotting
>> plvl_r = plvl(time|:,lvl|:,lat|:,lon|:)
>> printVarSummary(plvl_r)
>> res@cnLevelSelectionMode = "ExplicitLevels"; set manual contour levels
>> res@cnLevels = ispan(100,1000,50)
>> plot= gsn_csm_contour(wks,plvl_r(0,:,{40:45},{92}),res)
>> end
>>
>> ;*****************************
>> Variable: plvl_r
>> Type: float
>> Total Size: 55282500 bytes
>> 13820625 values
>> Number of Dimensions: 4
>> Dimensions and sizes:[time | 25] x [lvl | 21] x [lat | 195] x [lon
>> | 135]
>> Coordinates:
>> time: [0.5..24.5]
>> lvl: [270..370]
>> lat: [40.87445..45.88511]
>> lon: [90.85538..100.10556]
>> Number Of Attributes: 1
>> _FillValue :9.96921e+36
>> fatal:Undefined identifier: (gsn_csm_contour) is undefined, can't
>> continue
>> fatal:Execute: Error occurred at or near line 116 in file
>> _______________________________________________
>> 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
>>
>>
>> --
>> ======================================================
>> Dennis J. Shea tel: 303-497-1361 |
>> P.O. Box 3000 fax: 303-497-1333 |
>> Climate Analysis Section |
>> Climate & Global Dynamics Div. |
>> National Center for Atmospheric Research |
>> Boulder, CO 80307 |
>> USA email: shea 'at' ucar.edu |
>> ======================================================
>>
>> <Fig.pdf>_______________________________________________
>>
>> 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 Mon Mar 7 14:54:51 2011

This archive was generated by hypermail 2.1.8 : Mon Mar 07 2011 - 15:20:57 MST