[ncl-talk] sub: mask-area specifier error...
Adv
advita6 at gmail.com
Fri Dec 9 12:57:14 MST 2016
Hi,
could someone help me to fix this error?
Thank you,
Adv
warning:MapV40DHUpdateDrawList: invalid boundary specification string:
"iowa"
warning:MapV40DHUpdateDrawList: invalid boundary specification string:
"wyoming"
warning:MapV40DHUpdateDrawList: invalid boundary specification string:
"idaho"
warning:MapV40DHUpdateDrawList: invalid boundary specification string:
"utah"
warning:MapV40DHUpdateDrawList: invalid boundary specification string:
"wisconsin"
warning:MapV40DHUpdateDrawList: invalid boundary specification string:
"iowa"
warning:MapV40DHUpdateDrawList: invalid boundary specification string:
"iowa"
warning:MapV40DHUpdateDrawList: invalid boundary specification string:
"wyoming"
warning:MapV40DHUpdateDrawList: invalid boundary specification string:
"idaho"
warning:MapV40DHUpdateDrawList: invalid boundary specification string:
"utah"
warning:MapV40DHUpdateDrawList: invalid boundary specification string:
"wisconsin"
warning:MapV40DHUpdateDrawList: invalid boundary specification string:
"iowa"
warning:MapV40DHUpdateDrawList: invalid boundary specification string:
"iowa"
warning:MapV40DHUpdateDrawList: invalid boundary specification string:
"wyoming"
warning:MapV40DHUpdateDrawList: invalid boundary specification string:
"idaho"
warning:MapV40DHUpdateDrawList: invalid boundary specification string:
"utah"
warning:MapV40DHUpdateDrawList: invalid boundary specification string:
"wisconsin"
warning:MapV40DHUpdateDrawList: invalid boundary specification string:
"iowa"
warning:MapV40DHUpdateDrawList: invalid boundary specification string:
"iowa"
warning:MapV40DHUpdateDrawList: invalid boundary specification string:
"wyoming"
warning:MapV40DHUpdateDrawList: invalid boundary specification string:
"idaho"
warning:MapV40DHUpdateDrawList: invalid boundary specification string:
"utah"
warning:MapV40DHUpdateDrawList: invalid boundary specification string:
"wisconsin"
warning:MapV40DHUpdateDrawList: invalid boundary specification string:
"iowa"
load "./contributed.ncl_beta_640"
begin
;***************************************************
strll = asciiread("stationmac.txt", -1, "string") ;
print(strll) ; STATION","STATION_NAME", "LAT", "LON"
print("=====")
sloc = str_get_field(strll , 2, ",")
lat = tofloat( str_get_field(strll , 3, ",") )
lon = tofloat( str_get_field(strll , 4, ",") )
print(sloc +" : "+lat+" "+lon)
mnlat=(min(lat))
mxlat=(max(lat))
mnlon=(min(lon))
mxlon=(max(lon))
;print(lon)
print(mnlon)
print(mxlon)
print(mnlat)
print(mxlat)
;iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
mlon = 360
dlon = -90.35 / mlon
lonn = fspan (-116, (mlon - 1) * dlon, mlon)
print(lonn)
mlat = 90
dlat = 49.0 / mlat
latt = fspan (40.01, (mlat - 1) * dlat, mlat)
print(latt)
diri="./"
z1 = asciiread(diri+"Temp_Mean1965-2005",-1,"float")
print(z1)
printVarSummary(z1)
opt = True
rscan = (/8,5,1 /)
grid = obj_anal_ic_deprecated(lon, lat, z1, lonn, latt, rscan, True)
printVarSummary(grid)
;print(grid)
print(min(grid))
print(max(grid))
;************************************************
; Specify geographical region and time span (year-month start and end
;************************************************
;latS=-90
;latN = 90
;lonL = 0;360-116.5
;lonR = 358;360-90
; latS = 40
; latS = 0
; latN = 49
; lonL = 244;360-116.5
; lonR = 270;360-90
ymStrt = 196501
ymLast = 200512
pltType = "x11"
pltName = "regress"
pltTitle = "Globe: "+(ymStrt/100)+"-"+(ymLast/100)
;************************************************
; Read from netCDF file: variable is type short...unpack
;************************************************
version= "v2" ; "v2", "v2c"
diri = "./"
; fili = "air.sig995.mon.mean."+version+".nc"
fili1 = "Netcdfmean.nc"
fili = "air.mon.mean.nc"
ff = addfile(diri+fili1,"r")
t = ff->mean(:,:)
printVarSummary(t) ; [time| 720]x[lat|
91]x[lon| 180]
printMinMax(t,0)
f = addfile(diri+fili,"r")
f1 = addfile("tas_Amon_CCSM4_historical_r3i1p1_185001-200512.nc", "r")
; note the "s" of addfile
f2 = addfile("Ecearth_tas_320x160x1961-2005.nc", "r") ; note the "s"
of addfile
f3 = addfile("CanCM4_Temp_320x160x1961-2005.nc", "r") ; note the "s"
of addfile
YYYYMM = cd_calendar( f->time, -1)
YYYYMMa = cd_calendar( f1->time, -1)
YYYYMMb = cd_calendar( f2->time, -1)
YYYYMMc = cd_calendar( f3->time, -1)
iStrt = ind(YYYYMM.eq.ymStrt)
iStrta = ind(YYYYMMa.eq.ymStrt)
iStrtb = ind(YYYYMMb.eq.ymStrt)
iStrtc = ind(YYYYMMc.eq.ymStrt)
iLast = ind(YYYYMM.eq.ymLast)
iLasta = ind(YYYYMMa.eq.ymLast)
iLastb = ind(YYYYMMb.eq.ymLast)
iLastc = ind(YYYYMMc.eq.ymLast)
; ; monthly data
xt = f->air(:,::-1,:)
printVarSummary(xt) ; [time| 720]x[lat|
91]x[lon| 180]
xt1 = f1->tas(:,:,:)
printVarSummary(xt1)
xt2 = f2->t2(:,:,:)
printVarSummary(xt2)
xt3 = f3->t2(:,:,:)
printVarSummary(xt3)
; x = xt(iStrt:iLast,{latN:latS},{lonL:lonR})
x = xt(iStrt:iLast,:,:)
x1 = xt1(iStrta:iLasta,:,:)
x2 = xt2(iStrtb:iLastb,:,:)
x3 = xt3(iStrtc:iLastc,:,:)
delete(xt)
delete(xt1)
delete(xt2)
delete(xt3)
x1 = x1-273.15
x2 = x2-273.15
x3 = x3-273.15
x1 at units= "degC"
x2 at units= "degC"
x3 at units= "degC"
printVarSummary(x) ; [time| 720]x[lat|
91]x[lon| 180]
printVarSummary(x1) ; [time| 720]x[lat|
91]x[lon| 180]
printVarSummary(x2) ; [time| 720]x[lat|
91]x[lon| 180]
printVarSummary(x3) ; [time| 720]x[lat|
91]x[lon| 180]
;************************************************
; Calculate the Annual Mean (slopes)
;************************************************
rc= dim_avg_n(x,0)
rc1= dim_avg_n(x1,0)
rc2= dim_avg_n(x2,0)
rc3= dim_avg_n(x3,0)
printVarSummary(rc)
printVarSummary(rc)
printVarSummary(rc1)
printVarSummary(rc2)
printVarSummary(rc3)
copy_VarCoords(x(0,:,:),rc)
copy_VarCoords(x1(0,:,:),rc1)
copy_VarCoords(x2(0,:,:),rc2)
copy_VarCoords(x3(0,:,:),rc3)
printMinMax(rc,0)
printMinMax(rc1,0)
printMinMax(rc2,0)
printMinMax(rc3,0)
;==============================O===========;
; interpolate to new grid
;=========================================;
newgrid = f2fsh_Wrap(grid(:,:),(/73,144/))
newgrid1 = f2fsh_Wrap(grid(:,:),(/192,288/))
newgrid2 = f2fsh_Wrap(grid(:,:),(/160,320/))
newgrid3 = f2fsh_Wrap(grid(:,:),(/64,128/))
y= newgrid-rc
y1= newgrid1-rc1
y2= newgrid2-rc2
y3= newgrid3-rc3
copy_VarCoords(rc,y)
copy_VarCoords(rc1,y1)
copy_VarCoords(rc2,y2)
copy_VarCoords(rc3,y3)
mask_specs = (/"Iowa","Wyoming","Idaho","Utah","Wisconsin","Iowa"/)
;************************************************
; plotting parameters
;************************************************
wks =
gsn_open_wks("x11","Tempdifference_Mean_"+ymStrt+"-"+ymLast) ;
specifies a ps plot
gsn_define_colormap(wks,"matlab_jet")
plot = new(4,graphic)
res = True
res at gsnMaximize = True ; make large
res at cnFillOn = True ; turn on color
res at cnLinesOn = False ; turn off contour lines
res at cnLineLabelsOn = False ; turn off contour line
labels
res at cnInfoLabelOn = False
res at lbLabelBarOn = False ; turn off individual cb's
res at gsnTickMarksOn = False
res at mpGridAndLimbOn = False
res at cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
res at cnMinLevelValF = -5 ; set min contour level
res at cnMaxLevelValF = 5.0 ; set max contour level
res at cnLevelSpacingF = 0.5 ; set contour interval
res at gsnAddCyclic = False
res at mpFillOn = False ; turn off default
background gray
res at mpCenterLonF = 180
res at mpMinLatF = 40.
res at mpMaxLatF = 49.
res at mpMinLonF = -116
res at mpMaxLonF = -90
res at gsnStringFont = "helvetica-bold" ; instead of using
txFontHeightF or gsnStringFontHeightF
res at mpGeophysicalLineThicknessF = 3.0
res at mpGeophysicalLineColor = "Black"; (/22/)
;res at mpNationalLineThicknessF = 3.0
res at mpOutlineBoundarySets = "GeophysicalAndUSStates" ; add state boundaries
res at mpNationalLineColor = res at mpGeophysicalLineColor
res at mpUSStateLineThicknessF = 3.0
res at mpUSStateLineColor = res at mpGeophysicalLineColor
; res at gsnCenterString = year(0)+"-"+year(nyrs-1)
res at gsnLeftString = "" ; add the gsn titles
res at gsnRightString = ""
; res at tiMainString = "Trend, Reanalysis-2m
Temperature(~S~o~N~C)" ; fili
;res at tiMainFontHeightF = 0.02
;************************************************
; Turn on masking, and set resource indicating
; areas to mask.
;************************************************
res at mpAreaMaskingOn = 1
res at mpMaskAreaSpecifiers = mask_specs
;:::::::::::::::::::::::::::;;;;;:::::::::::
res at gsnCenterStringFontHeightF = 0.035
res at gsnCenterString = "Obs-Reanal"
plot(0) = gsn_csm_contour_map_ce(wks,y,res)
res at gsnCenterString = "Obs-CCSM4"
plot(1) = gsn_csm_contour_map_ce(wks,y1,res)
res at gsnCenterString = "Obs-EC-Earth"
plot(2) = gsn_csm_contour_map_ce(wks,y2,res)
res at gsnCenterString = "Obs-CanCM4"
plot(3) = gsn_csm_contour_map_ce(wks,y3,res)
;************************************************
; create panel
;************************************************
resP = True ; modify the panel plot
resP at gsnFrame = False ; don't advance the frame,
so we can use gsn_text_ndc
resP at gsnPanelLabelBar = True ; add common colorbar
resP at lbLabelFontHeightF = 0.015 ; set font height of Label
Bar labels
resP at gsnPanelBottom = 0.2 ; shrink panel plot by
setting bottom edge of plot
resP at gsnPanelTop = 0.9 ; shrink panel plot by
setting top edge of plot
resP at pmLabelBarWidthF = 0.3 ; make thinner
resP at pmLabelBarHeightF = 0.05
resP at gsnPanelYWhiteSpacePercent = 5. ; increase spacing along
Y-axis between panel plots
resP at cnLinesOn = False ; turn off contour lines
; resP at cnFillOn = True ; color plot desired
; resP at lbTitleOn = True ; turn on title
resP at lbTitleFont = "helvetica-bold"
resP at lbLabelFontQuality = "high" ; label bar font
resP at lbLabelFont = "helvetica-bold" ; label bar font
resP at lbTitleFontHeightF= .013 ;
resP at lbTitleString = "~S~o~N~C"
resP at cnLineLabelsOn = False
resP at txString = "Mean_Temp_"+ymStrt+"-"+ymLast+""
gsn_panel(wks,plot,(/4,1/),resP) ; now draw as one plot
frame(wks)
end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161209/db596e70/attachment.html
More information about the ncl-talk
mailing list