contour plot draw failure

From: <brownmc_at_nyahnyahspammersnyahnyah>
Date: Wed, 14 Dec 2005 10:40:25 -0800 (PST)

Hi All,
I am trying to overlay a probability plot onto a contour plot, but when I
do so, I recieve this error message:

fatal:ContourPlotDraw: ARSCAM/ARPRAM - ALGORITHM FAILURE
fatal:ContourPlotDraw: draw error
warning:WorkstationDeactivate: workstation not active or not opened

I can make the probability plot and the contour plot just fine on their
own, but it fails when I try to overlay them. Any advice would be very
appreciated. Here is my script that I am using:

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

simulation = "sresa1b"
simulation2 = "SRESA1B"
diri = "/data/brownmc/sresa1b/working/"

a = addfile(diri+"sresa1b_ncar_ccsm3_0_run1_200001_200912_clm.nc","r")
b = addfile(diri+"sresa1b_ncar_ccsm3_0_run1_209001_209912_clm.nc","r")
c =
addfile(diri+"sresa1b_ncar_ccsm3_0_run1_209001_209912_200001_200912_diff.nc","r")
d = addfile(diri+"sresa1b_ncar_ccsm3_0_run1_200001_200912_01120.nc","r")
e = addfile(diri+"sresa1b_ncar_ccsm3_0_run1_209001_209912_10811200.nc","r")
f = addfile(diri+"sresa1b_ncar_ccsm3_0_run1_200001_200912.nc","r")
i = addfile(diri+"sresa1b_ncar_ccsm3_0_run1_209001_209912.nc","r")

u = a->pr(0,:,:)
v = b->pr(0,:,:)
w = c->pr(0,:,:)
x = d->pr(0)
y = e->pr(0)
tx = f->pr(:,:,:)
ty = i->pr(:,:,:)
z = f->area(:,:)
xy = y - x
xy = xy*86400

dimXY = dimsizes(tx)
  ntim = dimXY(0)
  mlon = dimXY(1)
  nlat = dimXY(2)

  xtmp = tx(lat|:,lon|:,time|:) ; reorder but do it only once
[temporary]
  ytmp = ty(lat|:,lon|:,time|:)

  xAve = dim_avg (xtmp) ; calculate means at each grid point
  yAve = dim_avg (ytmp)
  xVar = dim_variance (xtmp) ; calculate variances
  yVar = dim_variance (ytmp)

  sigr = 0.05 ; critical sig lvl for r
  xEqv = equiv_sample_size (xtmp, sigr,0)
  yEqv = equiv_sample_size (ytmp, sigr,0)
  wgty = z(:,0)
  xN = wgt_areaave (xEqv, wgty, 1., 0) ; wgty could be gaussian weights
  yN = wgt_areaave (yEqv, wgty, 1., 0)

  iflag= False ; population variance similar
  prob = (/ ttest(xAve,xVar,xN, yAve,yVar,yN, iflag, False) /)
  copy_VarCoords_1(xtmp,prob)

h = "NCAR CCSM 3.0"
lvl = 3.
lvlsp = 0.25
lvl_diff = 30.
lvlsp_diff = 6.
gamma = 2.19
k = "ncar_ccsm"

u = u*86400
u_at_units = "mm/day"
v = v*86400
v_at_units = "mm/day"
w = w*86400
w_at_units = "mm/day"
x = x*86400
x_at_units = "mm/day"
y = y*86400
y_at_units = "mm/day"
w = w/u
w = w*100
w_at_units = "%"

max_diff = max(w)
max_diffRound = decimalPlaces(max_diff,0,True)
min_diff = min(w)
min_diffRound = decimalPlaces(min_diff,0,True)
mean_1stRound = sprintf("%5.2f", x)
mean_lstRound = sprintf("%5.2f", y)
xy1 = sprintf("%5.2f", xy)

wks = gsn_open_wks("ps",k+"3")
setvalues NhlGetWorkspaceObjectId()
      "wsMaximumSize": 50000000
        end setvalues
gsn_define_colormap(wks,"nrl_sirkes_3white")
plot2 = new(1,graphic)
pres = True
pres_at_gsnDraw = False
pres_at_gsnFrame = False
pres_at_cnInfoLabelOn = False
pres_at_cnFillOn = True
pres_at_gsnSpreadColors = True
pres_at_gsnSpreadColorStart = 2
pres_at_gsnSpreadColorEnd = 21
pres_at_lbLabelBarOn = True
pres_at_cnLinesOn = False
pres_at_mpProjection = "Mollweide"
pres_at_mpPerimOn = True
pres_at_mpEllipticalBoundary = True
pres_at_cnInfoLabelFont = "simplex_roman"
pres_at_cnLevelSelectionMode = "ManualLevels"
pres_at_gsnStringFont = "simplex_roman"
pres_at_gsnLeftString = "PR"
pres_at_tiMainString = h
pres_at_gsnRightString = "Mean="+xy1+" mm/day"
gsn_define_colormap(wks,"nrl_sirkes_3white")
pres_at_cnMinLevelValF = -200
pres_at_cnMaxLevelValF = 200
pres_at_cnLevelSpacingF = 20
pres_at_lbAutoManage = False
pres_at_lbLabelAutoStride = False
pres_at_lbLabelStride = 2
pres_at_lbOrientation = "vertical"
pres_at_lbLabelFont = "simplex_roman"
gamma = gamma/3.56
gamma1 = sprintf("%5.2f", gamma)
txres = True
txres_at_txJust = "BottomLeft"
txres_at_txFontHeightF = 0.015
gsn_text_ndc(wks,":F8:l"+"="+":F4:"+gamma1+":F4:K(Wm:S:-2:N:):S:-1",0.09,0.27,txres)
plot2 = gsn_csm_contour_map(wks,w,pres)

res2 = True ; res2 probability plots
res2_at_gsnDraw = False ; Do not draw plot
res2_at_gsnFrame = False ; Do not advance frome
res2_at_cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
res2_at_cnMinLevelValF = 0.00 ; set min contour level
res2_at_cnMaxLevelValF = 1.05 ; set max contour level
res2_at_cnLevelSpacingF = 0.05 ; set contour spacing
res2_at_cnInfoLabelOn = False ; turn off info label
res2_at_cnLinesOn = False ; do not draw contour lines
res2_at_cnLineLabelsOn = False ; do not draw contour labels
res2_at_cnLineColor = "black"
;res2_at_cnLineThicknessF = 1.5
;res2_at_cnLineDashPattern = 2
res2_at_cnFillScaleF = 0.6 ; add extra density
plot3 = gsn_csm_contour(wks,prob(:,:),res2)
plot3 = ShadeLtContour(plot3,0.05,17)
overlay (plot2, plot3)
draw(plot2)
frame(wks)
end

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Dec 14 2005 - 11:40:25 MST

This archive was generated by hypermail 2.2.0 : Tue Dec 20 2005 - 11:10:06 MST