[ncl-talk] No valid values in scalar field

Ciao Kai Liang ciaokailiang at gmail.com
Thu Jun 16 09:25:46 MDT 2016


Hi

I have a metric dox(720,360,24). It is 24 different ozone concentration
across globe. I try to use gsn_panel to plot them at one single sheet but I
don't know why my first three plot (see attached) couldn't show properly
and the below message pops out.

warning:ContourPlotInitialize: no valid values in scalar field; ContourPlot
not possible:[errno=1101]

;dox====================================
below is dox for details
Variable: dox
Type: float
Total Size: 24883200 bytes
            6220800 values
Number of Dimensions: 3
Dimensions and sizes:   [lat | 360] x [lon | 720] x [24]
Coordinates:
            lat: [-89.75..89.75]
            lon: [-179.75..179.75]
Number Of Attributes: 1
  _FillValue :  9.96921e+36


;source code============================
file   = "dox_mean_2010_05x05.nc"
a = addfile(file,"r")
lat_pts     = a->lat(:)
lon_pts     = a->lon(:)
dox   = a->ozone(:,:,:) ;720x360x24
;======================================
dox!0="lat"
dox!1="lon"
dox&lat = lat_pts
dox&lon = lon_pts
dox&lat at units="degrees_north"
dox&lon at units="degrees_east"
;=====================================
plots = new(24,graphic)
wks_type = "pdf"
wks_name = "htap2_dox_panel"
wks_type at wkPaperSize = "A4"
wks = gsn_open_wks(wks_type,wks_name)      ; send graphics to PDF file

 res                                = True
 res at gsnMaximize       = True               ;If set to True, plot will be
maximized
 res at gsnDraw              = False              ; don't draw
 res at gsnFrame            = False              ; don't advance frame

 res at cnLevelSelectionMode = "ManualLevels"     ; set manual contour levels
 res at cnMinLevelValF       = -5.                ; set min contour level
 res at cnMaxLevelValF       =  5.                ; set max contour level

res at cnFillOn               = True
 res at cnLinesOn          = False
 res at cnLineLabelsOn  = False
 res at lbLabelBarOn      = False
 res at cnFillPalette         = "BlWhRe"              ; Blue-Red colormap
 res at gsnRightString    = "ppb"                  ; "~" is txFuncCode

do i=0,23
    plots(i) = gsn_csm_contour_map_ce(wks,dox(:,:,i),res)
 end do

pnlres = True
pnlres at txString                   = ""
pnlres at gsnPanelLabelBar  = True
pnlres at lbLabelAutoStride   = True

 gsn_panel(wks,plots,(/6,4/),pnlres)

end


Joe

University of North Carolina, Gillings School of Global Public Health
170 Rosenau Hall, CB #7400 | 135 Dauer Drive | Chapel Hill, NC 27599-7400
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160616/2c2b2561/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plot.docx
Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document
Size: 281246 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160616/2c2b2561/attachment-0001.bin 


More information about the ncl-talk mailing list