[ncl-talk] Question about SNODAS plot

张雪岩 xueyanzhang520 at gmail.com
Wed Jun 5 09:04:22 MDT 2019


Hi, I am plotting snow water equivalent using NCL. The following is my script:

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/wrf/WRFUserARW.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"

begin

f=addfile("/Users/xueyanzhang/NOHRSC_SNODAS-master/July_mean/201807.nc", "r")
swe=f->SWE(0,:,:)

;;;;;;;;;;;;;;;;;;;;;;;;plot section;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

wks = gsn_open_wks("png", "201807_swe_mean")
gsn_define_colormap(wks, "BlAqGrYeOrReVi200")

setvalues NhlGetWorkspaceObjectId()
  "wsMaximumSize" : 300000000
end setvalues

res = True

res at gsnAddCyclic           = False
res at gsnDraw                = False 
res at gsnFrame               = False                   
res at gsnMaximize            = True
res at gsnRightString         = "Snow water equivalent (mm)"
res at gsnLeftString          = "201807 mean"
res at gsnStringFontHeightF   = 0.01


res at cnFillOn               = True
res at cnLinesOn              = False
res at cnLineLabelsOn         = False 
res at cnFillDrawOrder        = "PreDraw"
res at cnFillMode             = "RasterFill" 
res at cnLineLabelsOn         = False
res at cnLevelSelectionMode   = "ManualLevels"
res at cnMinLevelValF         = 0
res at cnMaxLevelValF         = 1000
res at cnLevelSpacingF        = 50

res at mpFillOn                = False           ; turn off map fill
res at mpDataBaseVersion       = "MediumRes"
res at mpOutlineBoundarySets   = "USStates"
res at mpProjection     = "CylindricalEquidistant"
res at mpOutlineDrawOrder      = "PostDraw"  ; draw continental outline last
res at mpGeophysicalLineColor  = "Black"
res at mpNationalLineColor     = "Black"
res at mpLimbLineColor         = "Black"
res at mpPerimLineColor        = "Black"
res at mpUSStateLineColor      = "black"
res at mpGeophysicalLineThicknessF = 2.
res at mpLandFillColor         = "white"
res at mpInlandWaterFillColor  = "white"
res at mpOceanFillColor        = "white"

res at mpLimitMode              = "LatLon"
res at mpMaxLatF                = 53
res at mpMinLatF                = 23
res at mpMaxLonF                = -65
res at mpMinLonF                = -125
;res at mpCenterLatF             = (53+23)/2
;res at mpCenterLonF             = (-65-125)/2

plot = gsn_csm_contour_map(wks, swe, res)

draw(plot)
frame(wks)


end

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
But the plot is not consistent with the map NCL provides.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 201807_swe_mean.png.zip
Type: application/zip
Size: 93413 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190605/3119feec/attachment-0002.zip>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 201807.nc.zip
Type: application/zip
Size: 286328 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190605/3119feec/attachment-0003.zip>
-------------- next part --------------

I searched and found it may be because of WGS84, this datum. But I don?t know how to solve it. Can you help me?

Xueyan


More information about the ncl-talk mailing list