[ncl-talk] Plotting_ET gridded data

Kerandi, Noah Misati (IMK) noah.kerandi at kit.edu
Sun Aug 7 08:51:49 MDT 2016


Hi,

I am trying to plot some gridded dataset (attached file_*) and model outputs.

The model outputs get plotted. However nothing is plotted for the other three (gridded datasets) files.

I had seen the error below in one of my trials.


"warning:_NclIRemovePrimitive: First parameter is a missing value, returning missing values"


However, subsequently i don't see any error though my data is not plotted.

If you have any idea or suggestion please share with me.

The basic script is pasted below and also attached.

Thank you very much.

###################################################





load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
;

begin
a= addfile("file_v3.0a.nc","r")
b=addfile("file_v3.0b.nc","r")
c=addfile("file_v3.0c.nc","r")
d=addfile("WRF1.nc","r")
e=addfile("HYDRO1.nc","r")


A=a->E(0,:,:)

A at _FillValue = -999

A at long_name=""
A!0="lat"
A!1="lon"
A at units    =""

A at _FillValue =A at _FillValue
A at _FillValue =-999
lat =a->lat
lat at long_name = "latitude" ;

lon = a->lon
lon at long_name = "longitude" ;

A&lat at units="degrees_north"
A&lon at units="degrees_east"




printVarSummary(A)



B=b->E(0,:,:)

B!0="lat"
B!1="lon"
B at units    =""
B at _FillValue = B at _FillValue


B at _FillValue= -999

lat =b->lat
lat at long_name = "latitude" ;
lon = b->lon
lon at long_name = "longitude" ;

B&lat at units="degrees_north"
B&lon at units="degrees_east"



B at long_name=""
B at units    =""



C=c->E(0,:,:)
C at _FillValue = -999
C!0="lat"
C!1="lon"
C at units    =""
C at _FillValue = C at _FillValue

C at _FillValue= -999


lat =c->lat
lat at long_name = "latitude" ;

lon = c->lon
lon at long_name = "longitude" ;



C&lat at units="degrees_north"
C&lon at units="degrees_east"
C at long_name=""
C at units    =""




C at long_name=""
C at units    =""

D=d->ACLHF(0,:,:)
D at long_name=""
D at units    =""

E=e->ACLHF(0,:,:)
E at long_name=""
E at units    =""



; We generate plots, but what kind do we prefer?
     type = "x11"
    ;type = "pdf"
  ;type = "png"
    ;type = "ps"
; type = "ncgm"
  wks = gsn_open_wks(type,"test")
 plot = new(5,graphic)








;-- plot resource settings

   res                    = True
  res at cnFillOn             =  True            ;-- enable color filled contours

  res at gsnDraw              =  False           ;-- don't draw the plot - yet
  res at gsnFrame             =  False           ;-- don't advance the frame
  res at gsnMaximize       = True      ; maximize the plot space on page - this will apply to each individual plot
  res at cnLineLabelsOn       =  False           ;-- don't draw labels on contour lines
  res at cnInfoLabelOn        =  False           ;-- don't draw labels on contour lines
  res at lbLabelBarOn         =  False           ;-- don't draw a labelbar below
  res at gsnPaperOrientation  = "landscape"
  res at cnLevelSelectionMode = "ManualLevels"   ;-- set manual contour levels, so that all
                                              ;-- plots have the same labelbar colors/values
  res at cnMinLevelValF       =   20            ;-- contour level minimum
  res at cnMaxLevelValF       =   200          ;-- contour level maximum
  res at cnLevelSpacingF      =    20            ;-- contour level interval


  res                    = True

  res at pmTickMarkDisplayMode = "Always"
  res at mpLimitMode       =  "LatLon"
  res at mpMinLatF         = -3.061569  ;min(lat2d)
  res at mpMaxLatF         =  2.22883  ;max(lat2d)
  res at mpMinLonF         =  34.56185  ;min(lon2d)
  res at mpMaxLonF         =  39.91379 ;max(lon2d)
  res at mpCenterLonF      = (res at mpMinLonF + res at mpMaxLonF) / 2.
  res at mpGeophysicalLineColor      = "Blue"
  res at mpDataBaseVersion           = "MediumRes"
  res at mpDataSetName               = "Earth..4"
  res at mpPerimLineColor            = "Black"
  res at mpUSStateLineColor          = "Black"
  res at mpLimbLineColor             = "Black"
  res at mpNationalLineColor         = "Black"
  res at mpNationalLineThicknessF    = 2.5
  res at mpOutlineBoundarySets       = "National"
  res at mpFillBoundarySets           ="AllBoundaries"
  res at mpOutlineOn                  = True
  ;res at lbLabelAutoStride            = True
  res at lbOrientation =   "horizontal"          ; vertical label bar

; Set the size of the individual title and axis fonts
  res at tiXAxisFontHeightF     = 0.035
  res at tiYAxisFontHeightF     = 0.035

;Set to False if plotting regional data or setting sfXArray/sfYArray
   res at gsnAddCyclic      = False



 ;---Uncomment if you want to change the contour levels

       res at cnLinesOn            = False    ; turn of contour lines
       res at cnFillMode           = "CellFill"           ; Cell Mode
       res at cnFillMode           = "RasterFill"         ; Raster Mode
       res at cnLinesOn            =  False       ; Turn off contour lines
       res at cnLineLabelsOn       =  False       ; Turn off contour lines
       res at cnFillPalette        = "precip_11lev"





        res at tmXBLabelFontHeightF = 0.035    ; boost the axis value labels even more
        res at tmYLLabelFontHeightF = 0.035

        ;res at tmYRLabelFontHeightF = 0.030


 res at tiMainString         = "file_v3.0a"    ; main title
  res at txFont  = "times-roman"
  res at tiMainOffsetYF       = -0.008
  res at tiMainFontHeightF  = 0.035
 plot(0)=gsn_csm_contour_map_ce(wks,A,res)





 res at tiMainString         = "file_v3.0b"    ; main title
 res at txFont               = "times-roman"
 plot(1)=gsn_csm_contour_map_ce(wks,B,res)



 res at tiMainString         = "file_v3.0c"    ; main title
 res at txFont               = "times-roman"
plot(2)=gsn_csm_contour_map_ce(wks,C,res)




 res at tiMainString         = "WRF1"    ; main title
  res at txFont              = "times-roman"
 plot(3)=gsn_csm_contour_map_ce(wks,D,res)




 res at tiMainString         = "Hydro1"    ; main title
  res at txFont              = "times-roman"
  plot(4)=gsn_csm_contour_map_ce(wks,E,res)

;-- panel resources
  resP                     =  True
  resP at gsnPanelYWhiteSpacePercent= 5     ; set a bit of extra white space between panels in the x and y directions
  resP at gsnPanelXWhiteSpacePercent =5


   ;resP at gsnPanelBottom      =  0.1            ;-- panel bottom position (y-value)
  ;resP at gsnPanelTop         = 0.40
  resP at gsnPanelLabelBar    =  True             ;-- draw a common labelbar
  resP at lbTitleOn        =  True
  resP at lbLabelAutoStride = True
  resP at lbTitlePosition  = "Bottom"
  resP at lbTitleString    = "ET (mm/month)"
  resP at lbTitleFontHeightF= .020                ; make title smaller
  resP at lbTitleDirection = "Across"             ; title direction



  resP at lbTitleFontHeightF  = .025
  resP at amJust              = "TopLeft"    ;-- text justification
  resP at gsnMaximize        = True
  resP at gsnPanelBottom     = 0.02

   resP at lbLabelFontHeightF = 0.015 ;-- label font height
   resP at lbLabelFont = "times-roman" ;-- label font


   resP at lbTitleOffsetF        = -0.1              ; move the labelbar title downwards

  gsn_panel(wks,plot,(/2,3/),resP)


end


Noah M. Kerandi
KIT-Campus Alpin
IMK-IFU: Atmospheric Environmental Research
Kreuzeckbahnstr. 19,
82467 Garmisch-Partenkirchen
Germany
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160807/b22afd02/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file_v3.0a.nc
Type: application/x-netcdf
Size: 5700 bytes
Desc: file_v3.0a.nc
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160807/b22afd02/attachment.nc 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file_v3.0b.nc
Type: application/x-netcdf
Size: 5856 bytes
Desc: file_v3.0b.nc
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160807/b22afd02/attachment-0001.nc 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file_v3.0c.nc
Type: application/x-netcdf
Size: 5852 bytes
Desc: file_v3.0c.nc
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160807/b22afd02/attachment-0002.nc 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: HYDRO1.nc
Type: application/x-netcdf
Size: 8224 bytes
Desc: HYDRO1.nc
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160807/b22afd02/attachment-0003.nc 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_script.ncl
Type: application/octet-stream
Size: 6334 bytes
Desc: test_script.ncl
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160807/b22afd02/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WRF1.nc
Type: application/x-netcdf
Size: 8232 bytes
Desc: WRF1.nc
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160807/b22afd02/attachment-0004.nc 


More information about the ncl-talk mailing list