Hi Lifen Jiang,
Do you get these errors if you comment out the two lines:
t@_FillValue = -32768
t@missing_value = t@_FillValue
The problem with these two lines is that the variable is a short but you are
assigning integer values to these attributes, which should have both been shorts originally.
To assign a literal short value you need to use the suffix indicating a short, the letter 'h'.
t@_FillValue = -32768h
See the table at
http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclDataTypes.shtml#BasicNumericTypes
If there are still problems, can you send us the file? See the instructions at http://www.ncl.ucar.edu/report_bug.shtml if you are not sure how to do this.
-dave
On Feb 6, 2013, at 10:16 AM, Jiang, Lifen wrote:
> Hello,
>
> I have a data file as below:
>
> <Catch0.jpg>
>
> When I ran the plotting sripts, the following errors occured:
>
> <Catch2.jpg>
>
> I greatly appreciate if anyone can help tell what is wrong with the scripts (see below).
>
> Lifen Jiang
> -------------------------------------------------------------------
> ;************************************************
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> ;************************************************
> begin
> ;************************************************
> ; open file and read in data
> ;************************************************
> in = addfile("med_c0.nc","r")
> t = in->med_c0
> printVarSummary(t)
>
> t@_FillValue = -32768
> t@missing_value = t@_FillValue
>
> t = lonFlip(t) ; reorder
> ;************************************************
> ; create plot
> ;************************************************
> wks = gsn_open_wks("pdf" ,"Olson") ;
> gsn_define_colormap(wks,"rainbow") ; choose colormap
> res = True ; plot mods desired
> res@cnFillOn = True ; turn on color fill
> res@cnLinesOn = False ; turn of contour lines
> res@cnLevelSpacingF = 0.5 ; contour spacing
> ;---This resource not needed in NCL V6.1.0
> res@gsnSpreadColors = True ; use full range of color map
> res@lbLabelStride = 4
> res@pmTickMarkDisplayMode = "Always"; use NCL default lat/lon labels
> res@gsnAddCyclic = False ; data already has cyclic point
> ; this must also be set for any zoom
> ; note that the gsn_csm_*map_ce templates automatically set
> ; res@mpLimitMode="LatLon" for you. If you are plotting a different projection,
> ; you may have to set this resource.
> res@mpMinLatF = -90 ; range to zoom in on
> res@mpMaxLatF = 90
> res@mpMinLonF = -180
> res@mpMaxLonF = 180
> plot = gsn_csm_contour_map_ce(wks,t({-90:90},{-180:180}), res)
> ;************************************************
> end
>
> _______________________________________________
> 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 Wed Feb 6 10:43:37 2013
This archive was generated by hypermail 2.1.8 : Wed Feb 06 2013 - 16:37:00 MST