I am trying to plot contours from a field from a CAM run.
I have three plots on one page and the middle plot does
not fill some of the contours on the left hand portion of the page.
Does anyone know why?
The problem is present if I set gsnAddCyclic or not.
I do not know what would be different between the first and
second plot.
Thanks for the clues.
Andrew Conley
;************************************************
;************************************************
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"
;************************************************
begin
;************************************************
; read in netCDF file
;************************************************
ftotal = addfile("sulfateT31annual.nc","r")
;************************************************
fsntc = ftotal->FSNTC(0,:,:)
fsntc_rf = ftotal->FSNTC_RF(0,:,:)
fsnsc = ftotal->FSNSC(0,:,:)
fsnsc_rf = ftotal->FSNSC_RF(0,:,:)
surface = fsnsc - fsnsc_rf
surface!0 = "lat"
surface!1 = "lon"
surface&lat = ftotal->lat
surface&lon = ftotal->lon
top = fsntc - fsntc_rf
top!0 = "lat"
top!1 = "lon"
top&lat = ftotal->lat
top&lon = ftotal->lon
absorbed = top - surface
absorbed!0 = "lat"
absorbed!1 = "lon"
absorbed&lat = ftotal->lat
absorbed&lon = ftotal->lon
gw = ftotal->gw(:)
surface_avg = wgt_areaave(surface, gw, 1.0, 0)
top_avg = wgt_areaave(top, gw, 1.0, 0)
absorbed_avg = wgt_areaave(absorbed, gw, 1.0, 0)
;************************************************
; create plot
;************************************************
type = "ps" ; create variable to hold info
type@wkColorModel = "cmyk" ; make output cmyk
wks = gsn_open_wks(type,"Sulfate_forcing_T31_dev87") ; open a ps file
cmap =(/ (/255 ,255 ,255/),\
(/0 ,0 ,0 /),\
(/0,0,175/), (/0, 0, 215/), (/0, 55, 255/), (/0, 100, 225/), (/0, 125, 165/),\
(/0, 170, 100/), (/0, 205, 60/), \
(/0, 240, 0/), \
(/100,240,100/), (/180, 255, 180/), (/225,255,225/),\
(/255, 255, 190/), (/255,255,60/), \
(/255,220,0/),(/255,175,0/),(/255,130,0/),(/255,88,0/),\
(/255, 0, 0/),\
(/255,0,128/),(/255,0,192/),(/250,0,250/),(/200,0,200/)\
/) / 255.0
gsn_define_colormap(wks,cmap) ; choose colormap
res = True ; Use plot options
res@cnFillOn = True ; Fill contours
res@cnLinesOn = True ; Fill contours
res@gsnSpreadColors = True ; use full range of colors
res@gsnAddCyclic = True
res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
res@gsnDraw = False ; Do not draw plot
res@gsnFrame = False ; Do not advance frome
res@gsnTickMarksOn = False
res@sfXCStartV = 0
res@sfXCEndV = 360
; res@lbLabelFontAspectF = 1.8
res@trYReverse = True
res@txFontHeightF = 0.020
res@tiMainFontHeightF = 0.025
res@lbOrientation = "Vertical"
res@lbLabelFontHeightF = 0.015
res@lbTitleFontHeightF = 0.018
plot = new(3, graphic)
res@gsnLeftString = "Top"
res@gsnCenterString = ""
res@gsnRightString = "Average = " + sprintf("%6.2f", top_avg) + " W m-2"
res@cnMinLevelValF = -14.0 ; set min contour level
res@cnMaxLevelValF = -1.0 ; set max contour level
res@cnLevelSpacingF = 1.0 ; set contour spacing
plot(0) = gsn_csm_contour_map_ce(wks,top,res)
res@gsnLeftString = "Surface"
res@gsnCenterString = ""
res@gsnRightString = "Average = " + sprintf("%6.2f", surface_avg) + " W m-2"
res@cnMinLevelValF = -14.0 ; set min contour level
res@cnMaxLevelValF = -1.0 ; set max contour level
res@cnLevelSpacingF = 1.0 ; set contour spacing
plot(1) = gsn_csm_contour_map_ce(wks,surface,res)
res@gsnLeftString = "Atmospheric Absorption"
res@gsnCenterString = ""
res@gsnRightString = "Average = " + sprintf("%6.2f", absorbed_avg) + " W m-2"
res@cnMinLevelValF = -.2 ; set min contour level
res@cnMaxLevelValF = 0.5 ; set max contour level
res@cnLevelSpacingF = 0.1 ; set contour spacing
plot(2) = gsn_csm_contour_map_ce(wks,absorbed,res)
;************************************************************
; now create panel plot with its own resources
;************************************************************
resPanel = True ; panel mods desired
resPanel@gsnPanelLabelBar= False
resPanel@gsnMaximize = True ; fill up the page
resPanel@txString = "Sulfate Aerosol Forcing Clear-Sky, T31, annual"
gsn_panel(wks,plot,(/3,1/),resPanel) ; draw: (/down,across/)
end
_______________________________________________
ncl-talk mailing list
ncl-talk@ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
This archive was generated by hypermail 2b29 : Wed Aug 18 2004 - 12:08:46 MDT