<div dir="ltr"><div><div><div><div>Hi Mira,<br></div>Try this:<br><br></div>1) Create three distinct maps:<br><br>mpid = gsn_csm_map(wks,res)<br>mpid2 = gsn_csm_map(wks,res)<br>mpid3 = gsn_csm_map(wks,res)<br><br></div>; .... create the 6 plots as you have been doing:<br><br>winds_hi = gsn_csm_vector(wks,uAvgTime_hi,vAvgTime_hi,vcres)<br>winds_lo = gsn_csm_vector(wks,uAvgTime_lo,vAvgTime_lo,vcres)<br>winds_diff = gsn_csm_vector(wks, diff_u, diff_v,vcres)<br><br></div>(snip)<br><br><div>plot(0) = gsn_csm_contour(wks,zAvgTime_hi,zfres)<br>plot(1) = gsn_csm_contour(wks,zAvgTime_lo,zfres)<br>plot(2) = gsn_csm_contour(wks,diff_z,zfres)<br><br>overlay(mpid,plot(0))<br>overlay(mpid,winds_hi)<br><br>overlay(mpid2,plot(1))<br>overlay(mpid2,winds_lo)<br><br>overlay(mpid3,plot(2))<br>overlay(mpid3,winds_diff)<br>;************************************************<br>; create panel<br>;************************************************<br>resP = True ; modify the panel plot<br>resP@txString = "NAO 500mb"<br>gsn_panel(wks,(/mpid,mpid2,mpid3/),(/3,1/),resP) <br><div><div><div><br><br></div><div>Three things to note:<br></div><div>1) If mpid is used as the base plot in overlay (=the first plot indexed), then that is what you should pass to gsn_panel.<br></div><div>2) You could have called gsn_csm_vector_map instead of gsn_csm_vector to draw the vectors and the map at the same time if you had wanted.<br></div><div>3) I would recommend creating new resource lists for your zres and vres resource list (as opposed to creating them from res) to eliminate all the errors one gets when passing mp* resources to non map plotting functions.<br><br></div><div>Hope that helps. If not, or if you have any further questions please respond to the ncl-talk email list.<br></div><div>Adam<br></div><div><br><br><br><br><br><br><br></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 3, 2015 at 1:31 PM, <span dir="ltr"><<a href="mailto:mberdahl@envsci.rutgers.edu" target="_blank">mberdahl@envsci.rutgers.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi again Alex,<br>
<br>
OK - another quick update. When I try to not do panel plots, and just try<br>
to plot one single figure (I comment the 2 following panels out), then I<br>
receive the plot that I'm interested in! So it looks like the problem is<br>
just trying to get this to work as panels, which I'm unclear on how to do.<br>
The working script for the single plot is copied below.<br>
<br>
Best,<br>
Mira<br>
<br>
<br>
<br>
<br>
<br>
;*****************************************<br>
; ; plot average winds overlayed on geopotental filled contours for the<br>
years that are extreme<br>
; the years are found with my matlab script findExtremeYrs.m<br>
; this particlar script does the years that correspond to high correlation<br>
with DJF, SE precip and NAO<br>
;*****************************************<br>
; the original data goes from 1948 January to April 2015.<br>
; I will cut it out to 2014 December, so we have something divisible by 12<br>
so we can do seasonal averages...<br>
<br>
<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"<br>
;************************************************<br>
begin<br>
;************************************************<br>
; read in netCDF file s<br>
;************************************************<br>
a = addfile("<a href="http://uwnd.mon.mean.alllevels.nc" rel="noreferrer" target="_blank">uwnd.mon.mean.alllevels.nc</a>","r") ; u winds<br>
b = addfile("<a href="http://vwnd.mon.mean.alllevels.nc" rel="noreferrer" target="_blank">vwnd.mon.mean.alllevels.nc</a>","r") ; v winds<br>
<br>
c = addfile("../Geopotential/<a href="http://hgt.mon.mean.nc" rel="noreferrer" target="_blank">hgt.mon.mean.nc</a>","r") ; geopotential heights.<br>
<br>
;************************************************<br>
; read in zonal [u] and meridional [v] winds (July)<br>
;************************************************<br>
<br>
u = a->uwnd(0:803,{500},{45:90},{270:357.5})<br>
v = b->vwnd(0:803,{500},{45:90},{270:357.5}) ; Get u, v, time (1),level<br>
(1000hpa),latitude(-90:90) and longitude(0:360) data.<br>
z = c->hgt(0:803,{500},{45:90},{270:357.5}) ; get geopotenial heights...<br>
<br>
printVarSummary(u)<br>
printVarSummary(v)<br>
printVarSummary(z)<br>
<br>
; Calculate the seasonal averages.<br>
uDJF = month_to_season(u, "DJF")<br>
vDJF = month_to_season(v, "DJF")<br>
zDJF = month_to_season(z, "DJF")<br>
<br>
printVarSummary(uDJF)<br>
printVarSummary(vDJF)<br>
printVarSummary(zDJF)<br>
<br>
; from the matlab script i wrote: findExtremeYrs, i pulled out the extreme<br>
years (> or < 1std) that i want to average and plot here.<br>
<br>
; for ans = 4 (NAO)<br>
; yearList_hi = 1973 1975 1983 1989 1995<br>
2000 2007 2012<br>
; yearList_lo = 1963 1964 1965 1969 1977<br>
1979 1996 1997 2010 2011<br>
<br>
<br>
; this data starts at 1948 (this is index 0), so 1953=5, 1963=15 etc.<br>
<br>
uDJF_NAO_hi = uDJF((/25,27,35,41,47,52,59,64/),:,:)<br>
uDJF_NAO_lo = uDJF((/15,16,17,21,29,31,48,49,62,63/),:,:)<br>
<br>
vDJF_NAO_hi = vDJF((/25,27,35,41,47,52,59,64/),:,:)<br>
vDJF_NAO_lo = vDJF((/15,16,17,21,29,31,48,49,62,63/),:,:)<br>
<br>
zDJF_NAO_hi = zDJF((/25,27,35,41,47,52,59,64/),:,:)<br>
zDJF_NAO_lo = zDJF((/15,16,17,21,29,31,48,49,62,63/),:,:)<br>
<br>
<br>
uAvgTime_hi = dim_avg_n_Wrap(uDJF_NAO_hi,0)<br>
uAvgTime_lo = dim_avg_n_Wrap(uDJF_NAO_lo,0)<br>
<br>
printVarSummary(uAvgTime_hi)<br>
printVarSummary(uAvgTime_lo)<br>
<br>
vAvgTime_hi = dim_avg_n_Wrap(vDJF_NAO_hi,0)<br>
vAvgTime_lo = dim_avg_n_Wrap(vDJF_NAO_lo,0)<br>
<br>
printVarSummary(vAvgTime_hi)<br>
printVarSummary(vAvgTime_lo)<br>
<br>
zAvgTime_hi = dim_avg_n_Wrap(zDJF_NAO_hi,0)<br>
zAvgTime_lo = dim_avg_n_Wrap(zDJF_NAO_lo,0)<br>
<br>
printVarSummary(zAvgTime_hi)<br>
printVarSummary(zAvgTime_lo)<br>
<br>
; dirty way to copy metadata over first.<br>
diff_u = uAvgTime_hi;<br>
diff_v = vAvgTime_hi;<br>
diff_z = zAvgTime_hi;<br>
<br>
diff_u = uAvgTime_hi - uAvgTime_lo<br>
diff_v = vAvgTime_hi - vAvgTime_lo<br>
diff_z = zAvgTime_hi - zAvgTime_lo<br>
<br>
printVarSummary(diff_u)<br>
printVarSummary(diff_v)<br>
printVarSummary(diff_z)<br>
<br>
;************************************************<br>
; create plot<br>
;************************************************<br>
wks = gsn_open_wks("ps","Panel_NAO_z_500") ; open a ps file<br>
gsn_define_colormap(wks,"temp1")<br>
<br>
plot = new(3,graphic) ; create a plot array<br>
<br>
;---- set common resources for all plots<br>
res = True<br>
res@gsnDraw = False ; dont draw<br>
res@gsnFrame = False ; dont advance frame<br>
res@cnInfoLabelOn = False ; trn off cn info label<br>
res@gsnAddCyclic = False ; has to do with wrapping the longitude at 0/360<br>
res@cnFillPalette = "matlab_jet"<br>
;************************************************<br>
; Choose a subregion<br>
;************************************************<br>
res@mpMaxLatF = 90 ;maximum latitude<br>
res@mpMinLatF = 45 ;minimum latitude<br>
;res@mpMaxLonF = 357.5 ; ;maximum longitude<br>
;res@mpMinLonF = 270 ;minimum longitude<br>
res@mpMaxLonF = 0<br>
res@mpMinLonF = -90<br>
;res@mpFillBoundarySets = AllBoundaries<br>
res@mpOutlineBoundarySets = "National"<br>
res@mpOutlineOn = True<br>
res@mpOutlineDrawOrder = "PostDraw"<br>
<br>
mpid = gsn_csm_map(wks,res)<br>
<br>
;***********************************************<br>
; ----wind vector plot<br>
;***********************************************<br>
vcres = res<br>
vcres@vcRefAnnoOrthogonalPosF = -1.0 ; move ref vector up<br>
vcres@vcRefMagnitudeF = 10.0 ; define vector ref mag<br>
vcres@vcRefLengthF = 0.045 ; define length of vec ref<br>
vcres@vcGlyphStyle = "CurlyVector" ; turn on curly vectors<br>
vcres@vcMinDistanceF = 0.017<br>
vcres@mpFillOn = False ; turn off gray fill<br>
vcres@mpOutlineBoundarySets = "National" ; turn on country boundaries<br>
;vcres@mpFillBoundarySets = AllBoundaries<br>
vcres@mpGeophysicalLineColor = "Navy" ; color of cont. outlines<br>
vcres@mpGeophysicalLineThicknessF = 1.5 ; thickness of outlines<br>
<br>
<br>
;vcres@gsnLeftString = "DJF High NAO"<br>
; was previously winds_hi =<br>
gsn_csm_vector_map_ce(wks,uAvgTime_hi,vAvgTime_hi,vcres)<br>
winds_hi = gsn_csm_vector(wks,uAvgTime_hi,vAvgTime_hi,vcres)<br>
;vcres@gsnLeftString = "DJF Low NAO"<br>
winds_lo = gsn_csm_vector(wks,uAvgTime_lo,vAvgTime_lo,vcres)<br>
;vcres@gsnLeftString = "Difference of High - Low"<br>
winds_diff = gsn_csm_vector(wks, diff_u, diff_v,vcres)<br>
;************************************************<br>
;---- geopotential height filled contour plot<br>
;***********************************************<br>
zfres = res<br>
zfres@cnFillOn = True<br>
;zfres@cnLevelSelectionMode = "ExplicitLevels<br>
;zfres@cnLevels = ispan(-20,90,5)<br>
zfres@lbLabelFontHeightF = 0.015<br>
zfres@lbOrientation = "Vertical"<br>
zfres@pmLabelBarOrthogonalPosF = -0.005<br>
zfres@cnFillPalette = "BlWhRe"<br>
<br>
contour_zf_hi = gsn_csm_contour(wks,zAvgTime_hi,zfres)<br>
contour_zf_lo = gsn_csm_contour(wks,zAvgTime_lo,zfres)<br>
contour_zf_diff = gsn_csm_contour(wks,diff_z,zfres)<br>
<br>
plot(0) = gsn_csm_contour(wks,zAvgTime_hi,zfres)<br>
plot(1) = gsn_csm_contour(wks,zAvgTime_lo,zfres)<br>
plot(2) = gsn_csm_contour(wks,diff_z,zfres)<br>
<br>
;overlay(plot(0),winds_hi)<br>
overlay(mpid,plot(0))<br>
overlay(mpid,winds_hi)<br>
<br>
;overlay(plot(1),winds_lo)<br>
;overlay(mpid,plot(1))<br>
;overlay(mpid,winds_lo)<br>
<br>
;overlay(plot(2),winds_diff)<br>
;overlay(mpid,plot(2))<br>
;overlay(mpid,winds_lo)<br>
<br>
draw(mpid)<br>
frame(wks)<br>
<br>
;************************************************<br>
; create panel<br>
;************************************************<br>
;resP = True ; modify the panel plot<br>
;resP@txString = "NAO 500mb"<br>
;gsn_panel(wks,plot,(/3,1/),resP) ; now draw as one plot;<br>
<br>
<br>
end<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
Actually, I take that back. I don't get a blank plot (that was a stupid<br>
error), but I do just get the same thing as before... Overlaid contours<br>
and vectors, with no base map.<br>
<br>
mira<br>
<br>
> Hi Alex,<br>
><br>
> Yes! The plot you attached is the map I'd like to have under my wind<br>
vectors and filled contours. However, when I change the max and min lon<br>
in my map resources to what you did (0 and -90), I do not receive any<br>
map - it is a blank page with just a title.<br>
><br>
> I wonder if it has to do with the lines where I extract the longitudes<br>
in my variables:<br>
><br>
> u = a->uwnd(0:803,{500},{45:90},{270:357.5})<br>
> v = b->vwnd(0:803,{500},{45:90},{270:357.5}) ; Get u, v, time (1),level<br>
(1000hpa),latitude(-90:90) and longitude(0:360) data.<br>
> z = c->hgt(0:803,{500},{45:90},{270:357.5}) ; get geopotential heights...<br>
><br>
> Do you think it is something to do with this?<br>
><br>
> Mira<br>
><br>
><br>
><br>
>> Hi Mira,<br>
>><br>
>> I copied these lines from your script and ran them locally:<br>
>><br>
>> wks = gsn_open_wks("ps","Panel_NAO_z_500") ; open a ps file<br>
>> gsn_define_colormap(wks,"temp1")<br>
>><br>
>> plot = new(3,graphic) ; create a plot array<br>
>><br>
>> ;---- set common resources for all plots<br>
>> res = True<br>
>> res@gsnDraw = False ; dont draw<br>
>> res@gsnFrame = False ; dont advance frame<br>
>> res@cnInfoLabelOn = False ; trn off cn info label<br>
>> res@gsnAddCyclic = False ; has to do with wrapping the longitude at<br>
0/360<br>
>> res@cnFillPalette = "matlab_jet"<br>
>> ;************************************************<br>
>> ; Choose a subregion<br>
>> ;************************************************<br>
>> res@mpMaxLatF = 90 ;maximum latitude<br>
>> res@mpMinLatF = 45 ;minimum latitude<br>
>> res@mpMaxLonF = 357.5 ; ;maximum longitude<br>
>> res@mpMinLonF = 270 ;minimum longitude<br>
>> ;res@mpFillBoundarySets = AllBoundaries<br>
>> res@mpOutlineBoundarySets = "National"<br>
>> res@mpOutlineOn = True<br>
>> res@mpOutlineDrawOrder = "PostDraw"<br>
>><br>
>> mpid = gsn_csm_map(wks,res)<br>
>><br>
>><br>
>> I got an error and made a change in your lons. I set them to 0 and -90<br>
respectively and got this base map. Is this what you were looking for?<br>
>><br>
>> -Alex<br>
>><br>
>><br>
>><br>
>><br>
>>> On Jul 30, 2015, at 9:00 PM, <a href="mailto:mberdahl@envsci.rutgers.edu">mberdahl@envsci.rutgers.edu</a> wrote:<br>
>>><br>
>>> Hi Alex,<br>
>>> Thanks again for the help. Setting the workstation colormap worked once<br>
>>> I<br>
>>> realized I have an older version (6.0.0) of NCL so there is a limited set<br>
>>> of colormaps available.<br>
>>> I still, however, can't get a base map plotted. I've tried a couple<br>
things, including what you suggested below, but this doesn't work.<br>
I've<br>
>>> tried creating a map and overlaying it with the contour and vectors, but<br>
>>> it doesn't work. I receive the following error and warnings:<br>
>>><br>
>>><br>
>>> ^Mfatal:NhlAddOverlay: tranform is already an annotation or overlay:<br>
74 ^Mwarning:ContourPlotSetValues: attempt to set overlay member plot<br>
view ignored<br>
>>> ^Mwarning:ContourPlotSetValues: attempt to set overlay member plot<br>
view ignored<br>
>>> ^Mwarning:ContourPlotSetValues: attempt to set overlay member plot<br>
view ignored<br>
>>> ^Mwarning:NhlDraw: cannot draw Plot Member, ID 262, independently<br>
^Mwarning:NhlDraw: cannot draw Plot Member, ID 298, independently<br>
^Mwarning:NhlDraw: cannot draw Plot Member, ID 334, independently<br>
>>><br>
>>><br>
>>><br>
>>> My code is copied below.<br>
>>><br>
>>><br>
>>> Any thoughts?<br>
>>> Thanks again,<br>
>>> Mira<br>
>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>
>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br>
>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"<br>
>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"<br>
>>> ;************************************************<br>
>>> begin<br>
>>> ;************************************************<br>
>>> ; read in netCDF file s<br>
>>> ;************************************************<br>
>>> a = addfile("<a href="http://uwnd.mon.mean.alllevels.nc" rel="noreferrer" target="_blank">uwnd.mon.mean.alllevels.nc</a>","r") ; u winds<br>
>>> b = addfile("<a href="http://vwnd.mon.mean.alllevels.nc" rel="noreferrer" target="_blank">vwnd.mon.mean.alllevels.nc</a>","r") ; v winds<br>
>>><br>
>>> c = addfile("../Geopotential/<a href="http://hgt.mon.mean.nc" rel="noreferrer" target="_blank">hgt.mon.mean.nc</a>","r") ; geopotential<br>
heights.<br>
>>><br>
>>> ;************************************************<br>
>>> ; read in zonal [u] and meridional [v] winds (July)<br>
>>> ;************************************************<br>
>>><br>
>>> u = a->uwnd(0:803,{500},{45:90},{270:357.5})<br>
>>> v = b->vwnd(0:803,{500},{45:90},{270:357.5}) ; Get u, v, time<br>
(1),level (1000hpa),latitude(-90:90) and longitude(0:360) data.<br>
>>> z = c->hgt(0:803,{500},{45:90},{270:357.5}) ; get geopotenial heights...<br>
>>><br>
>>> printVarSummary(u)<br>
>>> printVarSummary(v)<br>
>>> printVarSummary(z)<br>
>>><br>
>>> ; Calculate the seasonal averages.<br>
>>> uDJF = month_to_season(u, "DJF")<br>
>>> vDJF = month_to_season(v, "DJF")<br>
>>> zDJF = month_to_season(z, "DJF")<br>
>>><br>
>>> printVarSummary(uDJF)<br>
>>> printVarSummary(vDJF)<br>
>>> printVarSummary(zDJF)<br>
>>><br>
>>> ; from the matlab script i wrote: findExtremeYrs, i pulled out the<br>
extreme<br>
>>> years (> or < 1std) that i want to average and plot here.<br>
>>><br>
>>> ; for ans = 4 (NAO)<br>
>>> ; yearList_hi = 1973 1975 1983 1989 1995<br>
2000 2007 2012<br>
>>> ; yearList_lo = 1963 1964 1965 1969 1977<br>
1979 1996 1997 2010 2011<br>
>>><br>
>>><br>
>>> ; this data starts at 1948 (this is index 0), so 1953=5, 1963=15 etc.<br>
>>><br>
>>> uDJF_NAO_hi = uDJF((/25,27,35,41,47,52,59,64/),:,:)<br>
>>> uDJF_NAO_lo = uDJF((/15,16,17,21,29,31,48,49,62,63/),:,:)<br>
>>><br>
>>> vDJF_NAO_hi = vDJF((/25,27,35,41,47,52,59,64/),:,:)<br>
>>> vDJF_NAO_lo = vDJF((/15,16,17,21,29,31,48,49,62,63/),:,:)<br>
>>><br>
>>> zDJF_NAO_hi = zDJF((/25,27,35,41,47,52,59,64/),:,:)<br>
>>> zDJF_NAO_lo = zDJF((/15,16,17,21,29,31,48,49,62,63/),:,:)<br>
>>><br>
>>><br>
>>> uAvgTime_hi = dim_avg_n_Wrap(uDJF_NAO_hi,0)<br>
>>> uAvgTime_lo = dim_avg_n_Wrap(uDJF_NAO_lo,0)<br>
>>><br>
>>> printVarSummary(uAvgTime_hi)<br>
>>> printVarSummary(uAvgTime_lo)<br>
>>><br>
>>> vAvgTime_hi = dim_avg_n_Wrap(vDJF_NAO_hi,0)<br>
>>> vAvgTime_lo = dim_avg_n_Wrap(vDJF_NAO_lo,0)<br>
>>><br>
>>> printVarSummary(vAvgTime_hi)<br>
>>> printVarSummary(vAvgTime_lo)<br>
>>><br>
>>> zAvgTime_hi = dim_avg_n_Wrap(zDJF_NAO_hi,0)<br>
>>> zAvgTime_lo = dim_avg_n_Wrap(zDJF_NAO_lo,0)<br>
>>><br>
>>> printVarSummary(zAvgTime_hi)<br>
>>> printVarSummary(zAvgTime_lo)<br>
>>><br>
>>> ; dirty way to copy metadata over first.<br>
>>> diff_u = uAvgTime_hi;<br>
>>> diff_v = vAvgTime_hi;<br>
>>> diff_z = zAvgTime_hi;<br>
>>><br>
>>> diff_u = uAvgTime_hi - uAvgTime_lo<br>
>>> diff_v = vAvgTime_hi - vAvgTime_lo<br>
>>> diff_z = zAvgTime_hi - zAvgTime_lo<br>
>>><br>
>>> printVarSummary(diff_u)<br>
>>> printVarSummary(diff_v)<br>
>>> printVarSummary(diff_z)<br>
>>><br>
>>> ;************************************************<br>
>>> ; create plot<br>
>>> ;************************************************<br>
>>> wks = gsn_open_wks("ps","Panel_NAO_z_500") ; open a ps file<br>
>>> gsn_define_colormap(wks,"temp1")<br>
>>><br>
>>> plot = new(3,graphic) ; create a plot array<br>
>>><br>
>>> ;---- set common resources for all plots<br>
>>> res = True<br>
>>> res@gsnDraw = False ; dont draw<br>
>>> res@gsnFrame = False ; dont advance frame<br>
>>> res@cnInfoLabelOn = False ; trn off cn info label<br>
>>> res@gsnAddCyclic = False ; has to do with wrapping the longitude at<br>
0/360<br>
>>> res@cnFillPalette = "matlab_jet"<br>
>>> ;************************************************<br>
>>> ; Choose a subregion<br>
>>> ;************************************************<br>
>>> res@mpMaxLatF = 90 ;maximum latitude<br>
>>> res@mpMinLatF = 45 ;minimum latitude<br>
>>> res@mpMaxLonF = 357.5 ; ;maximum longitude<br>
>>> res@mpMinLonF = 270 ;minimum longitude<br>
>>> ;res@mpFillBoundarySets = AllBoundaries<br>
>>> res@mpOutlineBoundarySets = "National"<br>
>>> res@mpOutlineOn = True<br>
>>> res@mpOutlineDrawOrder = "PostDraw"<br>
>>><br>
>>> mpid = gsn_csm_map(wks,res)<br>
>>><br>
>>> ;***********************************************<br>
>>> ; ----wind vector plot<br>
>>> ;***********************************************<br>
>>> vcres = res<br>
>>> vcres@vcRefAnnoOrthogonalPosF = -1.0 ; move ref vector up<br>
>>> vcres@vcRefMagnitudeF = 10.0 ; define vector ref mag<br>
>>> vcres@vcRefLengthF = 0.045 ; define length of vec ref<br>
>>> vcres@vcGlyphStyle = "CurlyVector" ; turn on curly vectors<br>
>>> vcres@vcMinDistanceF = 0.017<br>
>>> vcres@mpFillOn = False ; turn off gray fill<br>
>>> vcres@mpOutlineBoundarySets = "National" ; turn on country boundaries<br>
;vcres@mpFillBoundarySets = AllBoundaries<br>
>>> vcres@mpGeophysicalLineColor = "Navy" ; color of cont. outlines<br>
vcres@mpGeophysicalLineThicknessF = 1.5 ; thickness of outlines<br>
>>><br>
>>><br>
>>> ;vcres@gsnLeftString = "DJF High NAO"<br>
>>> ; was previously winds_hi =<br>
>>> gsn_csm_vector_map_ce(wks,uAvgTime_hi,vAvgTime_hi,vcres)<br>
>>> winds_hi = gsn_csm_vector(wks,uAvgTime_hi,vAvgTime_hi,vcres)<br>
>>> ;vcres@gsnLeftString = "DJF Low NAO"<br>
>>> winds_lo = gsn_csm_vector(wks,uAvgTime_lo,vAvgTime_lo,vcres)<br>
>>> ;vcres@gsnLeftString = "Difference of High - Low"<br>
>>> winds_diff = gsn_csm_vector(wks, diff_u, diff_v,vcres)<br>
>>> ;************************************************<br>
>>> ;---- geopotential height filled contour plot<br>
>>> ;***********************************************<br>
>>> zfres = res<br>
>>> zfres@cnFillOn = True<br>
>>> ;zfres@cnLevelSelectionMode = "ExplicitLevels<br>
>>> ;zfres@cnLevels = ispan(-20,90,5)<br>
>>> zfres@lbLabelFontHeightF = 0.015<br>
>>> zfres@lbOrientation = "Vertical"<br>
>>> zfres@pmLabelBarOrthogonalPosF = -0.005<br>
>>> zfres@cnFillPalette = "BlWhRe"<br>
>>><br>
>>> contour_zf_hi = gsn_csm_contour(wks,zAvgTime_hi,zfres)<br>
>>> contour_zf_lo = gsn_csm_contour(wks,zAvgTime_lo,zfres)<br>
>>> contour_zf_diff = gsn_csm_contour(wks,diff_z,zfres)<br>
>>><br>
>>> plot(0) = gsn_csm_contour(wks,zAvgTime_hi,zfres)<br>
>>> plot(1) = gsn_csm_contour(wks,zAvgTime_lo,zfres)<br>
>>> plot(2) = gsn_csm_contour(wks,diff_z,zfres)<br>
>>><br>
>>> ;overlay(plot(0),winds_hi)<br>
>>> overlay(mpid,plot(0))<br>
>>> overlay(mpid,winds_hi)<br>
>>><br>
>>> ;overlay(plot(1),winds_lo)<br>
>>> overlay(mpid,plot(1))<br>
>>> overlay(mpid,winds_lo)<br>
>>><br>
>>> ;overlay(plot(2),winds_diff)<br>
>>> overlay(mpid,plot(2))<br>
>>> overlay(mpid,winds_lo)<br>
>>><br>
>>><br>
>>> ;************************************************<br>
>>> ; create panel<br>
>>> ;************************************************<br>
>>> resP = True ; modify the panel plot<br>
>>> resP@txString = "NAO 500mb"<br>
>>> gsn_panel(wks,plot,(/3,1/),resP) ; now draw as one plot;<br>
>>><br>
>>><br>
>>> end<br>
>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>>> Hi Mira,<br>
>>>><br>
>>>> As for the color bar, I would suggest either using cnFillColors or<br>
setting<br>
>>>> the color table for the workstation, I usually just set the color table<br>
>>>> for workstation.<br>
>>>><br>
>>>> After you open the workstation:<br>
>>>><br>
>>>> wks = gsn_open_wks("ps","Panel_NAO_z_500")<br>
>>>><br>
>>>> Do:<br>
>>>> gsn_define_colormap(wks, “matlab_jet†)<br>
>>>><br>
>>>> You can choose the color palette that you want and put the name in<br>
quotes.<br>
>>>><br>
>>>> As for the coastlines, maybe set:<br>
>>>><br>
>>>> mpDataSetName = “Earth..4â€<br>
>>>><br>
>>>> You can also try setting mpFillBoundarySets = AllBoundaries and see<br>
if that helps.<br>
>>>><br>
>>>> Hope that helps,<br>
>>>> -Alex<br>
>>>><br>
>>>><br>
>>>><br>
>>>><br>
>>>>> On Jul 29, 2015, at 8:28 PM, <a href="mailto:mberdahl@envsci.rutgers.edu">mberdahl@envsci.rutgers.edu</a> wrote:<br>
>>>>><br>
>>>>> Hi Alex,<br>
>>>>><br>
>>>>> Great! Now I have three panels, in the correct region, with filled<br>
contours and overlaid wind vectors. Thanks! I have two outstanding<br>
problems still: I'm trying to change the color bar for the filled<br>
contours, as the default in the older version of ncl is not very<br>
appealing. When I try to do res@cnFillPalette = "matlab_jet", or<br>
any other choice for that matter, I receive the following warning:<br>
>>>>><br>
>>>>> warning:cnFillPalette is not a valid resource in<br>
>>>>> Panel_NAO_z_500_vector<br>
>>>>> at<br>
>>>>> this time<br>
>>>>><br>
>>>>> I'm not exactly sure why I can't seem to change the contour fill<br>
palette.<br>
>>>>><br>
>>>>> Secondly, I still don't see a map of coastlines on my figures. Do you<br>
>>>>> know how to add one?<br>
>>>>><br>
>>>>> Thank you very much again,<br>
>>>>> Mira<br>
>>>>><br>
>>>>><br>
>>>>>> Hi Mira,<br>
>>>>>><br>
>>>>>> You arenÂ’t seeing vectors or map because they a buried under the<br>
filled<br>
>>>>>> contours. You may want to flip the plots around and do the<br>
contours as<br>
>>>>>> a<br>
>>>>>> map and overlay the vectors on top of the contours.<br>
>>>>>><br>
>>>>>> Upon further analysis of your script, you were doing the overlay on<br>
contour plots but then using different contour plots for the panel<br>
plot.<br>
>>>>>> Below I have altered your script, try it this way and see how it goes.<br>
>>>>>><br>
>>>>>> I am not sure if you have made any more recent changes to this script<br>
>>>>>> but<br>
>>>>>> this is using the last one you sent.<br>
>>>>>><br>
>>>>>> Hope that helps,<br>
>>>>>> -Alex<br>
>>>>>><br>
>>>>>><br>
>>>>>> ;*****************************************<br>
>>>>>> ; ; plot average winds overlayed on geopotental filled contours for<br>
the<br>
>>>>>> years that are extreme<br>
>>>>>> ; the years are found with my matlab script findExtremeYrs.m ; this<br>
particlar script does the years that correspond to high correlation<br>
>>>>>> with DJF, SE precip and NAO<br>
>>>>>> ;*****************************************<br>
>>>>>> ; the original data goes from 1948 January to April 2015.<br>
>>>>>> ; I will cut it out to 2014 December, so we have something<br>
divisible by<br>
>>>>>> 12<br>
>>>>>> so we can do seasonal averages...<br>
>>>>>><br>
>>>>>><br>
>>>>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>
>>>>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br>
>>>>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" load<br>
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"<br>
>>>>>> ;************************************************<br>
>>>>>> begin<br>
>>>>>> ;************************************************<br>
>>>>>> ; read in netCDF file s<br>
>>>>>> ;************************************************<br>
>>>>>> a = addfile("<a href="http://uwnd.mon.mean.alllevels.nc" rel="noreferrer" target="_blank">uwnd.mon.mean.alllevels.nc</a>","r") ; u winds<br>
>>>>>> b = addfile("<a href="http://vwnd.mon.mean.alllevels.nc" rel="noreferrer" target="_blank">vwnd.mon.mean.alllevels.nc</a>","r") ; v winds<br>
>>>>>><br>
>>>>>> c = addfile("../Geopotential/<a href="http://hgt.mon.mean.nc" rel="noreferrer" target="_blank">hgt.mon.mean.nc</a>","r") ; geopotential<br>
heights.<br>
>>>>>><br>
>>>>>> ;************************************************<br>
>>>>>> ; read in zonal [u] and meridional [v] winds (July)<br>
>>>>>> ;************************************************<br>
>>>>>><br>
>>>>>> u = a->uwnd(0:803,{500},{45:90},{270:357.5})<br>
>>>>>> v = b->vwnd(0:803,{500},{45:90},{270:357.5}) ; Get u, v, time<br>
(1),level<br>
>>>>>> (1000hpa),latitude(-90:90) and longitude(0:360) data.<br>
>>>>>> z = c->hgt(0:803,{500},{45:90},{270:357.5}) ; get geopotenial<br>
heights...<br>
>>>>>><br>
>>>>>> printVarSummary(u)<br>
>>>>>> printVarSummary(v)<br>
>>>>>> printVarSummary(z)<br>
>>>>>><br>
>>>>>> ; Calculate the seasonal averages.<br>
>>>>>> uDJF = month_to_season(u, "DJF")<br>
>>>>>> vDJF = month_to_season(v, "DJF")<br>
>>>>>> zDJF = month_to_season(z, "DJF")<br>
>>>>>><br>
>>>>>> printVarSummary(uDJF)<br>
>>>>>> printVarSummary(vDJF)<br>
>>>>>> printVarSummary(zDJF)<br>
>>>>>><br>
>>>>>> ; from the matlab script i wrote: findExtremeYrs, i pulled out the<br>
extreme<br>
>>>>>> years (> or < 1std) that i want to average and plot here.<br>
>>>>>><br>
>>>>>> ; for ans = 4 (NAO)<br>
>>>>>> ; yearList_hi = 1973 1975 1983 1989<br>
1995 2000 2007 2012<br>
>>>>>> ; yearList_lo = 1963 1964 1965 1969<br>
1977 1979 1996 1997 2010 2011<br>
>>>>>><br>
>>>>>><br>
>>>>>> ; this data starts at 1948 (this is index 0), so 1953=5, 1963=15 etc.<br>
>>>>>><br>
>>>>>> uDJF_NAO_hi = uDJF((/25,27,35,41,47,52,59,64/),:,:)<br>
>>>>>> uDJF_NAO_lo = uDJF((/15,16,17,21,29,31,48,49,62,63/),:,:)<br>
>>>>>><br>
>>>>>> vDJF_NAO_hi = vDJF((/25,27,35,41,47,52,59,64/),:,:)<br>
>>>>>> vDJF_NAO_lo = vDJF((/15,16,17,21,29,31,48,49,62,63/),:,:)<br>
>>>>>><br>
>>>>>> zDJF_NAO_hi = zDJF((/25,27,35,41,47,52,59,64/),:,:)<br>
>>>>>> zDJF_NAO_lo = zDJF((/15,16,17,21,29,31,48,49,62,63/),:,:)<br>
>>>>>><br>
>>>>>><br>
>>>>>> uAvgTime_hi = dim_avg_n_Wrap(uDJF_NAO_hi,0)<br>
>>>>>> uAvgTime_lo = dim_avg_n_Wrap(uDJF_NAO_lo,0)<br>
>>>>>><br>
>>>>>> printVarSummary(uAvgTime_hi)<br>
>>>>>> printVarSummary(uAvgTime_lo)<br>
>>>>>><br>
>>>>>> vAvgTime_hi = dim_avg_n_Wrap(vDJF_NAO_hi,0)<br>
>>>>>> vAvgTime_lo = dim_avg_n_Wrap(vDJF_NAO_lo,0)<br>
>>>>>><br>
>>>>>> printVarSummary(vAvgTime_hi)<br>
>>>>>> printVarSummary(vAvgTime_lo)<br>
>>>>>><br>
>>>>>> zAvgTime_hi = dim_avg_n_Wrap(zDJF_NAO_hi,0)<br>
>>>>>> zAvgTime_lo = dim_avg_n_Wrap(zDJF_NAO_lo,0)<br>
>>>>>><br>
>>>>>> printVarSummary(zAvgTime_hi)<br>
>>>>>> printVarSummary(zAvgTime_lo)<br>
>>>>>><br>
>>>>>> ; dirty way to copy metadata over first.<br>
>>>>>> diff_u = uAvgTime_hi;<br>
>>>>>> diff_v = vAvgTime_hi;<br>
>>>>>> diff_z = zAvgTime_hi;<br>
>>>>>><br>
>>>>>> diff_u = uAvgTime_hi - uAvgTime_lo<br>
>>>>>> diff_v = vAvgTime_hi - vAvgTime_lo<br>
>>>>>> diff_z = zAvgTime_hi - zAvgTime_lo<br>
>>>>>><br>
>>>>>> printVarSummary(diff_u)<br>
>>>>>> printVarSummary(diff_v)<br>
>>>>>> printVarSummary(diff_z)<br>
>>>>>><br>
>>>>>> ;************************************************<br>
>>>>>> ; create plot<br>
>>>>>> ;************************************************<br>
>>>>>> wks = gsn_open_wks("ps","Panel_NAO_z_500") ; open a ps file plot<br>
= new(3,graphic) ; create a plot array<br>
>>>>>><br>
>>>>>> ;---- set common resources for all plots<br>
>>>>>> res = True<br>
>>>>>> res@gsnDraw = False ; dont draw<br>
>>>>>> res@gsnFrame = False ; dont advance frame<br>
>>>>>> res@cnInfoLabelOn = False ; trn off cn info label<br>
>>>>>> res@gsnAddCyclic = False ; has to do with wrapping the longitude at<br>
>>>>>> 0/360<br>
>>>>>> ;************************************************<br>
>>>>>> ; Choose a subregion<br>
>>>>>> ;************************************************<br>
>>>>>> res@mpMaxLatF = 90 ;maximum latitude<br>
>>>>>> res@mpMinLatF = 45 ;minimum latitude<br>
>>>>>> res@mpMaxLonF = 357.5 ; ;maximum longitude<br>
>>>>>> res@mpMinLonF = 270 ;minimum longitude<br>
>>>>>><br>
>>>>>> ;************************************************<br>
>>>>>> ; Map Options<br>
>>>>>> ;************************************************<br>
>>>>>> res@mpOutlineBoundarySets = "National" ; turn on country<br>
boundaries res@mpGeophysicalLineColor = "Navy" ; color of cont.<br>
outlines res@mpGeophysicalLineThicknessF = 1.5 ; thickness of<br>
outlines<br>
>>>>>><br>
>>>>>> ;***********************************************<br>
>>>>>> ; ----wind vector plot<br>
>>>>>> ;***********************************************<br>
>>>>>> vcres = res<br>
>>>>>> vcres@vcRefAnnoOrthogonalPosF = -1.0 ; move ref vector up<br>
vcres@vcRefMagnitudeF = 10.0 ; define vector ref mag<br>
>>>>>> vcres@vcRefLengthF = 0.045 ; define length of vec ref<br>
>>>>>> vcres@vcGlyphStyle = "CurlyVector" ; turn on curly vectors<br>
vcres@vcMinDistanceF = 0.017<br>
>>>>>> vcres@mpFillOn = False ; turn off gray fill<br>
>>>>>><br>
>>>>>> ;vcres@gsnLeftString = "DJF High NAO"<br>
>>>>>> winds_hi = gsn_csm_vector(wks,uAvgTime_hi,vAvgTime_hi,vcres)<br>
;vcres@gsnLeftString = "DJF Low NAO"<br>
>>>>>> winds_lo = gsn_csm_vector(wks,uAvgTime_lo,vAvgTime_lo,vcres)<br>
;vcres@gsnLeftString = "Difference of High - Low"<br>
>>>>>> winds_diff = gsn_csm_vector(wks, diff_u, diff_v,vcres)<br>
>>>>>> ;************************************************<br>
>>>>>> ;---- geopotential height filled contour plot<br>
>>>>>> ;***********************************************<br>
>>>>>> zfres = res<br>
>>>>>> zfres@cnFillOn = True<br>
>>>>>> ;zfres@cnLevelSelectionMode = "ExplicitLevels<br>
>>>>>> ;zfres@cnLevels = ispan(-20,90,5)<br>
>>>>>> zfres@lbLabelFontHeightF = 0.015<br>
>>>>>> zfres@lbOrientation = "Vertical"<br>
>>>>>> zfres@pmLabelBarOrthogonalPosF = -0.005<br>
>>>>>><br>
>>>>>> plot(0) = gsn_csm_contour_map_ce(wks,zAvgTime_hi,zfres)<br>
>>>>>> plot(1) = gsn_csm_contour_map_ce(wks,zAvgTime_lo,zfres)<br>
>>>>>> plot(2) = gsn_csm_contour_map_ce(wks,diff_z,zfres)<br>
>>>>>><br>
>>>>>> overlay(plot(0),winds_hi)<br>
>>>>>> overlay(plot(1),winds_lo)<br>
>>>>>> overlay(plot(2),winds_diff)<br>
>>>>>><br>
>>>>>> ;************************************************<br>
>>>>>> ; create panel<br>
>>>>>> ;************************************************<br>
>>>>>> resP = True ; modify the panel plot<br>
>>>>>> resP@txString = "NAO 500mb"<br>
>>>>>> gsn_panel(wks,plot,(/3,1/),resP) ; now draw as one plot;<br>
>>>>>><br>
>>>>>><br>
>>>>>> end<br>
>>>>>><br>
>>>>>><br>
>>>>>>> On Jul 29, 2015, at 1:57 PM, <a href="mailto:mberdahl@envsci.rutgers.edu">mberdahl@envsci.rutgers.edu</a> wrote:<br>
>>>>>>><br>
>>>>>>> Hi Alex,<br>
>>>>>>> Great - thanks for the suggestions! That does help, but does not<br>
totally<br>
>>>>>>> solve my problem. Now I get three panel plots of the correct region<br>
>>>>>>> and<br>
>>>>>>> all on one page which is great. But only the filled contours<br>
show. There<br>
>>>>>>> are no overlaid vectors or map of coastal boundaries. Any<br>
suggestions<br>
>>>>>>> would be greatly appreciated.<br>
>>>>>>> Thanks so much!<br>
>>>>>>> Mira<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>><br>
>>>>>>>> Hi Mira,<br>
>>>>>>>><br>
>>>>>>>> I think the issue here is that you set a bunch of resources as<br>
res but<br>
>>>>>>>> then set vres to True instead of res. I think switching it to vres<br>
>>>>>>>> =<br>
>>>>>>>> res<br>
>>>>>>>> will give you the maps you were expecting. I see you also set res =<br>
>>>>>>>> True<br>
>>>>>>>> twice, might be helpful to remove the double.<br>
>>>>>>>><br>
>>>>>>>> Hope that helps,<br>
>>>>>>>> -Alex<br>
>>>>>>>><br>
>>>>>>>><br>
>>>>>>>>> On Jul 27, 2015, at 9:39 PM, <a href="mailto:mberdahl@envsci.rutgers.edu">mberdahl@envsci.rutgers.edu</a> wrote:<br>
>>>>>>>>><br>
>>>>>>>>> Hi Alex,<br>
>>>>>>>>> Thanks for the suggestion. I tried this and now I do not have the<br>
>>>>>>>>> same<br>
>>>>>>>>> error message any more, so that is good. However, I am now just<br>
getting<br>
>>>>>>>>> 3<br>
>>>>>>>>> blank plots of the whole world, even though I'd like plots with<br>
overlaid<br>
>>>>>>>>> geopotential height and winds, for just a region over Greenland.<br>
These<br>
>>>>>>>>> are<br>
>>>>>>>>> followed by a fourth figure that has filled contours of the correct<br>
>>>>>>>>> region, but no map or wind vectors. I'll attach the figures as an<br>
>>>>>>>>> attachment here. They are not panel plots as I want, but each<br>
figure<br>
>>>>>>>>> is<br>
>>>>>>>>> on its own page. I'll copy the updated code below.<br>
>>>>>>>>> Any thoughts?<br>
>>>>>>>>> Thanks!<br>
>>>>>>>>> Mira<br>
>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>>> ;*****************************************<br>
>>>>>>>>> ; ; plot average winds overlayed on geopotental filled contours for<br>
>>>>>>>>> the<br>
>>>>>>>>> years that are extreme<br>
>>>>>>>>> ; the years are found with my matlab script findExtremeYrs.m ;<br>
this particlar script does the years that correspond to high<br>
correlation<br>
>>>>>>>>> with DJF, SE precip and NAO<br>
>>>>>>>>> ;*****************************************<br>
>>>>>>>>> ; the original data goes from 1948 January to April 2015. ; I<br>
will cut it out to 2014 December, so we have something divisible<br>
>>>>>>>>> by<br>
>>>>>>>>> 12<br>
>>>>>>>>> so we can do seasonal averages...<br>
>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load<br>
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br>
>>>>>>>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" load<br>
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"<br>
;************************************************<br>
>>>>>>>>> begin<br>
>>>>>>>>> ;************************************************<br>
>>>>>>>>> ; read in netCDF file s<br>
>>>>>>>>> ;************************************************<br>
>>>>>>>>> a = addfile("<a href="http://uwnd.mon.mean.alllevels.nc" rel="noreferrer" target="_blank">uwnd.mon.mean.alllevels.nc</a>","r") ; u winds<br>
>>>>>>>>> b = addfile("<a href="http://vwnd.mon.mean.alllevels.nc" rel="noreferrer" target="_blank">vwnd.mon.mean.alllevels.nc</a>","r") ; v winds<br>
>>>>>>>>><br>
>>>>>>>>> c = addfile("../Geopotential/<a href="http://hgt.mon.mean.nc" rel="noreferrer" target="_blank">hgt.mon.mean.nc</a>","r") ;<br>
geopotential heights.<br>
>>>>>>>>><br>
>>>>>>>>> ;************************************************<br>
>>>>>>>>> ; read in zonal [u] and meridional [v] winds (July)<br>
>>>>>>>>> ;************************************************<br>
>>>>>>>>><br>
>>>>>>>>> u = a->uwnd(0:803,{500},{45:90},{270:357.5})<br>
>>>>>>>>> v = b->vwnd(0:803,{500},{45:90},{270:357.5}) ; Get u, v, time<br>
(1),level<br>
>>>>>>>>> (1000hpa),latitude(-90:90) and longitude(0:360) data.<br>
>>>>>>>>> z = c->hgt(0:803,{500},{45:90},{270:357.5}) ; get geopotenial<br>
heights...<br>
>>>>>>>>><br>
>>>>>>>>> printVarSummary(u)<br>
>>>>>>>>> printVarSummary(v)<br>
>>>>>>>>> printVarSummary(z)<br>
>>>>>>>>><br>
>>>>>>>>> ; Calculate the seasonal averages.<br>
>>>>>>>>> uDJF = month_to_season(u, "DJF")<br>
>>>>>>>>> vDJF = month_to_season(v, "DJF")<br>
>>>>>>>>> zDJF = month_to_season(z, "DJF")<br>
>>>>>>>>><br>
>>>>>>>>> printVarSummary(uDJF)<br>
>>>>>>>>> printVarSummary(vDJF)<br>
>>>>>>>>> printVarSummary(zDJF)<br>
>>>>>>>>><br>
>>>>>>>>> ; from the matlab script i wrote: findExtremeYrs, i pulled out the<br>
>>>>>>>>> extreme<br>
>>>>>>>>> years (> or < 1std) that i want to average and plot here.<br>
>>>>>>>>><br>
>>>>>>>>> ; for ans = 4 (NAO)<br>
>>>>>>>>> ; yearList_hi = 1973 1975 1983 1989 1995<br>
>>>>>>>>> 2000 2007 2012<br>
>>>>>>>>> ; yearList_lo = 1963 1964 1965 1969 1977<br>
>>>>>>>>> 1979 1996 1997 2010 2011<br>
>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>>> ; this data starts at 1948 (this is index 0), so 1953=5, 1963=15<br>
etc.<br>
>>>>>>>>><br>
>>>>>>>>> uDJF_NAO_hi = uDJF((/25,27,35,41,47,52,59,64/),:,:)<br>
>>>>>>>>> uDJF_NAO_lo = uDJF((/15,16,17,21,29,31,48,49,62,63/),:,:)<br>
>>>>>>>>><br>
>>>>>>>>> vDJF_NAO_hi = vDJF((/25,27,35,41,47,52,59,64/),:,:)<br>
>>>>>>>>> vDJF_NAO_lo = vDJF((/15,16,17,21,29,31,48,49,62,63/),:,:)<br>
>>>>>>>>><br>
>>>>>>>>> zDJF_NAO_hi = zDJF((/25,27,35,41,47,52,59,64/),:,:)<br>
>>>>>>>>> zDJF_NAO_lo = zDJF((/15,16,17,21,29,31,48,49,62,63/),:,:)<br>
>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>>> uAvgTime_hi = dim_avg_n_Wrap(uDJF_NAO_hi,0)<br>
>>>>>>>>> uAvgTime_lo = dim_avg_n_Wrap(uDJF_NAO_lo,0)<br>
>>>>>>>>><br>
>>>>>>>>> printVarSummary(uAvgTime_hi)<br>
>>>>>>>>> printVarSummary(uAvgTime_lo)<br>
>>>>>>>>><br>
>>>>>>>>> vAvgTime_hi = dim_avg_n_Wrap(vDJF_NAO_hi,0)<br>
>>>>>>>>> vAvgTime_lo = dim_avg_n_Wrap(vDJF_NAO_lo,0)<br>
>>>>>>>>><br>
>>>>>>>>> printVarSummary(vAvgTime_hi)<br>
>>>>>>>>> printVarSummary(vAvgTime_lo)<br>
>>>>>>>>><br>
>>>>>>>>> zAvgTime_hi = dim_avg_n_Wrap(zDJF_NAO_hi,0)<br>
>>>>>>>>> zAvgTime_lo = dim_avg_n_Wrap(zDJF_NAO_lo,0)<br>
>>>>>>>>><br>
>>>>>>>>> printVarSummary(zAvgTime_hi)<br>
>>>>>>>>> printVarSummary(zAvgTime_lo)<br>
>>>>>>>>><br>
>>>>>>>>> ; dirty way to copy metadata over first.<br>
>>>>>>>>> diff_u = uAvgTime_hi;<br>
>>>>>>>>> diff_v = vAvgTime_hi;<br>
>>>>>>>>> diff_z = zAvgTime_hi;<br>
>>>>>>>>><br>
>>>>>>>>> diff_u = uAvgTime_hi - uAvgTime_lo<br>
>>>>>>>>> diff_v = vAvgTime_hi - vAvgTime_lo<br>
>>>>>>>>> diff_z = zAvgTime_hi - zAvgTime_lo<br>
>>>>>>>>><br>
>>>>>>>>> printVarSummary(diff_u)<br>
>>>>>>>>> printVarSummary(diff_v)<br>
>>>>>>>>> printVarSummary(diff_z)<br>
>>>>>>>>><br>
>>>>>>>>> ;************************************************<br>
>>>>>>>>> ; create plot<br>
>>>>>>>>> ;************************************************<br>
>>>>>>>>> wks = gsn_open_wks("ps","Panel_NAO_z_500") ; open a ps file<br>
plot = new(3,graphic) ; create a plot array<br>
>>>>>>>>><br>
>>>>>>>>> ;---- set common resources for all plots<br>
>>>>>>>>> res = True<br>
>>>>>>>>> res@gsnDraw = False ; dont draw<br>
>>>>>>>>> res@gsnFrame = False ; dont advance frame<br>
>>>>>>>>> res@cnInfoLabelOn = False ; trn off cn info label<br>
>>>>>>>>> res = True ; plot mods desired<br>
>>>>>>>>> res@gsnAddCyclic = False ; has to do with wrapping the longitude<br>
>>>>>>>>> at<br>
>>>>>>>>> 0/360<br>
>>>>>>>>> ;************************************************<br>
>>>>>>>>> ; Choose a subregion<br>
>>>>>>>>> ;************************************************<br>
>>>>>>>>> res@mpMaxLatF = 90 ;maximum latitude<br>
>>>>>>>>> res@mpMinLatF = 45 ;minimum latitude<br>
>>>>>>>>> res@mpMaxLonF = 357.5 ; ;maximum longitude<br>
>>>>>>>>> res@mpMinLonF = 270 ;minimum longitude<br>
>>>>>>>>><br>
>>>>>>>>> ;***********************************************<br>
>>>>>>>>> ; ----wind vector plot<br>
>>>>>>>>> ;***********************************************<br>
>>>>>>>>> vcres = True<br>
>>>>>>>>> vcres@vcRefAnnoOrthogonalPosF = -1.0 ; move ref vector up<br>
vcres@vcRefMagnitudeF = 10.0 ; define vector ref mag<br>
>>>>>>>>> vcres@vcRefLengthF = 0.045 ; define length of vec ref<br>
vcres@vcGlyphStyle = "CurlyVector" ; turn on curly vectors<br>
vcres@vcMinDistanceF = 0.017<br>
>>>>>>>>> vcres@mpFillOn = False ; turn off gray fill<br>
>>>>>>>>> vcres@mpOutlineBoundarySets = "National" ; turn on country<br>
boundaries<br>
>>>>>>>>> vcres@mpGeophysicalLineColor = "Navy" ; color of cont.<br>
outlines vcres@mpGeophysicalLineThicknessF = 1.5 ; thickness of<br>
outlines<br>
>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>>> ;vcres@gsnLeftString = "DJF High NAO"<br>
>>>>>>>>> winds_hi =<br>
>>>>>>>>> gsn_csm_vector_map_ce(wks,uAvgTime_hi,vAvgTime_hi,vcres)<br>
;vcres@gsnLeftString = "DJF Low NAO"<br>
>>>>>>>>> winds_lo =<br>
>>>>>>>>> gsn_csm_vector_map_ce(wks,uAvgTime_lo,vAvgTime_lo,vcres)<br>
;vcres@gsnLeftString = "Difference of High - Low"<br>
>>>>>>>>> winds_diff = gsn_csm_vector_map_ce(wks, diff_u, diff_v,vcres)<br>
;************************************************<br>
>>>>>>>>> ;---- geopotential height filled contour plot<br>
>>>>>>>>> ;***********************************************<br>
>>>>>>>>> zfres = res<br>
>>>>>>>>> zfres@cnFillOn = True<br>
>>>>>>>>> ;zfres@cnLevelSelectionMode = "ExplicitLevels<br>
>>>>>>>>> ;zfres@cnLevels = ispan(-20,90,5)<br>
>>>>>>>>> zfres@lbLabelFontHeightF = 0.015<br>
>>>>>>>>> zfres@lbOrientation = "Vertical"<br>
>>>>>>>>> zfres@pmLabelBarOrthogonalPosF = -0.005<br>
>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>>> contour_zf_hi = gsn_csm_contour(wks,zAvgTime_hi,zfres)<br>
>>>>>>>>> contour_zf_lo = gsn_csm_contour(wks,zAvgTime_lo,zfres)<br>
>>>>>>>>> contour_zf_diff = gsn_csm_contour(wks,diff_z,zfres)<br>
>>>>>>>>><br>
>>>>>>>>> plot(0) = gsn_csm_contour(wks,zAvgTime_hi,zfres)<br>
>>>>>>>>> plot(1) = gsn_csm_contour(wks,zAvgTime_lo,zfres)<br>
>>>>>>>>> plot(2) = gsn_csm_contour(wks,diff_z,zfres)<br>
>>>>>>>>><br>
>>>>>>>>> overlay(contour_zf_hi,winds_hi)<br>
>>>>>>>>> overlay(contour_zf_lo,winds_lo)<br>
>>>>>>>>> overlay(contour_zf_diff,winds_diff)<br>
>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>>> ;************************************************<br>
>>>>>>>>> ; create panel<br>
>>>>>>>>> ;************************************************<br>
>>>>>>>>> resP = True ; modify the panel plot<br>
>>>>>>>>> resP@txString = "NAO 500mb"<br>
>>>>>>>>> gsn_panel(wks,plot,(/3,1/),resP) ; now draw as one plot;<br>
>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>>> end<br>
>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>>>> Mira,<br>
>>>>>>>>>><br>
>>>>>>>>>> Try this:<br>
>>>>>>>>>><br>
>>>>>>>>>><br>
>>>>>>>>>> plot(0) = gsn_csm_contour(wks,zAvgTime_hi,zfres)<br>
>>>>>>>>>> plot(1) = gsn_csm_contour(wks,zAvgTime_lo,zfres)<br>
>>>>>>>>>> plot(2) = gsn_csm_contour(wks,diff_z,zfres)<br>
>>>>>>>>>><br>
>>>>>>>>>> overlay(contour_zf_hi,winds_hi)<br>
>>>>>>>>>> overlay(contour_zf_lo,winds_lo)<br>
>>>>>>>>>> overlay(contour_diff,winds_diff)<br>
>>>>>>>>>><br>
>>>>>>>>>> I don't believe overlay returns anything and you are trying to<br>
save<br>
>>>>>>>>>> it<br>
>>>>>>>>>> as<br>
>>>>>>>>>> a<br>
>>>>>>>>>> graphic. The code above would replace the lines in your script.<br>
>>>>>>>>>><br>
>>>>>>>>>> Hope that helps,<br>
>>>>>>>>>><br>
>>>>>>>>>> -Alex<br>
>>>>>>>>>><br>
>>>>>>>>>><br>
>>>>>>>>>><br>
>>>>>>>>>><br>
>>>>>>>>>> On Sunday, July 26, 2015, <<a href="mailto:mberdahl@envsci.rutgers.edu">mberdahl@envsci.rutgers.edu</a><br>
>>>>>>>>>> <javascript:_e(%7B%7D,'cvml','<a href="mailto:mberdahl@envsci.rutgers.edu">mberdahl@envsci.rutgers.edu</a><br>
<mailto:<a href="mailto:mberdahl@envsci.rutgers.edu">mberdahl@envsci.rutgers.edu</a><br>
>>>>>>>>>> <mailto:<a href="mailto:mberdahl@envsci.rutgers.edu">mberdahl@envsci.rutgers.edu</a><br>
>>>>>>>>>> <mailto:<a href="mailto:mberdahl@envsci.rutgers.edu">mberdahl@envsci.rutgers.edu</a>>>>');>> wrote:<br>
>>>>>>>>>><br>
>>>>>>>>>>> Hi all,<br>
>>>>>>>>>>><br>
>>>>>>>>>>> I'm trying to adapt a working code I had that was plotting 3<br>
panel<br>
>>>>>>>>>>> plots<br>
>>>>>>>>>>> of wind vectors in a certain region. Now, all I want to do is<br>
add<br>
>>>>>>>>>>> an<br>
>>>>>>>>>>> overlay of geopotential height (filled contours) underneath each<br>
>>>>>>>>>>> of<br>
>>>>>>>>>>> these<br>
>>>>>>>>>>> plots, but the way I'm approaching it is wrong. I've tried<br>
simplifying<br>
>>>>>>>>>>> it<br>
>>>>>>>>>>> to do this without panels, just a single plot, but I still don't<br>
>>>>>>>>>>> get<br>
>>>>>>>>>>> what<br>
>>>>>>>>>>> I need. The error message I am getting now is:<br>
>>>>>>>>>>><br>
>>>>>>>>>>> fatal:syntax error: line 153 in file plotWinds_z_NAO_level.ncl<br>
before<br>
>>>>>>>>>>> or<br>
>>>>>>>>>>> near overlay<br>
>>>>>>>>>>> plot(0)= overlay<br>
>>>>>>>>>>> ---------------^<br>
>>>>>>>>>>><br>
>>>>>>>>>>><br>
>>>>>>>>>>> My code is copied below. Any suggestions are greatly<br>
>>>>>>>>>>> appreciated.<br>
>>>>>>>>>>> Thanks,<br>
>>>>>>>>>>> Mira<br>
>>>>>>>>>>><br>
>>>>>>>>>>> ;*****************************************<br>
>>>>>>>>>>> ; ; plot average winds overlayed on geopotental filled<br>
contours for<br>
>>>>>>>>>>> the<br>
>>>>>>>>>>> years that are extreme<br>
>>>>>>>>>>> ; the years are found with my matlab script findExtremeYrs.m ;<br>
this particlar script does the years that correspond to high<br>
correlation<br>
>>>>>>>>>>> with DJF, SE precip and NAO<br>
>>>>>>>>>>> ;*****************************************<br>
>>>>>>>>>>> ; the original data goes from 1948 January to April 2015. ; I<br>
will cut it out to 2014 December, so we have something<br>
divisible<br>
>>>>>>>>>>> by<br>
>>>>>>>>>>> 12<br>
>>>>>>>>>>> so we can do seasonal averages...<br>
>>>>>>>>>>><br>
>>>>>>>>>>><br>
>>>>>>>>>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load<br>
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" load<br>
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" load<br>
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"<br>
;************************************************<br>
>>>>>>>>>>> begin<br>
>>>>>>>>>>> ;************************************************<br>
>>>>>>>>>>> ; read in netCDF file s<br>
>>>>>>>>>>> ;************************************************<br>
>>>>>>>>>>> a = addfile("<a href="http://uwnd.mon.mean.alllevels.nc" rel="noreferrer" target="_blank">uwnd.mon.mean.alllevels.nc</a>","r") ; u winds b =<br>
addfile("<a href="http://vwnd.mon.mean.alllevels.nc" rel="noreferrer" target="_blank">vwnd.mon.mean.alllevels.nc</a>","r") ; v winds<br>
>>>>>>>>>>><br>
>>>>>>>>>>> c = addfile("../Geopotential/<a href="http://hgt.mon.mean.nc" rel="noreferrer" target="_blank">hgt.mon.mean.nc</a>","r") ;<br>
>>>>>>>>>>> geopotential<br>
>>>>>>>>>>> heights.<br>
>>>>>>>>>>><br>
>>>>>>>>>>> ;************************************************<br>
>>>>>>>>>>> ; read in zonal [u] and meridional [v] winds (July)<br>
>>>>>>>>>>> ;************************************************<br>
>>>>>>>>>>><br>
>>>>>>>>>>> u = a->uwnd(0:803,{500},{45:90},{270:357.5})<br>
>>>>>>>>>>> v = b->vwnd(0:803,{500},{45:90},{270:357.5}) ; Get u, v, time<br>
(1),level<br>
>>>>>>>>>>> (1000hpa),latitude(-90:90) and longitude(0:360) data.<br>
>>>>>>>>>>> z = c->hgt(0:803,{500},{45:90},{270:357.5}) ; get geopotenial<br>
heights...<br>
>>>>>>>>>>><br>
>>>>>>>>>>> printVarSummary(u)<br>
>>>>>>>>>>> printVarSummary(v)<br>
>>>>>>>>>>> printVarSummary(z)<br>
>>>>>>>>>>><br>
>>>>>>>>>>> ; Calculate the seasonal averages.<br>
>>>>>>>>>>> uDJF = month_to_season(u, "DJF")<br>
>>>>>>>>>>> vDJF = month_to_season(v, "DJF")<br>
>>>>>>>>>>> zDJF = month_to_season(z, "DJF")<br>
>>>>>>>>>>><br>
>>>>>>>>>>> printVarSummary(uDJF)<br>
>>>>>>>>>>> printVarSummary(vDJF)<br>
>>>>>>>>>>> printVarSummary(zDJF)<br>
>>>>>>>>>>><br>
>>>>>>>>>>> ; from the matlab script i wrote: findExtremeYrs, i pulled out<br>
the<br>
>>>>>>>>>>> extreme<br>
>>>>>>>>>>> years (> or < 1std) that i want to average and plot here.<br>
>>>>>>>>>>><br>
>>>>>>>>>>> ; for ans = 4 (NAO)<br>
>>>>>>>>>>> ; yearList_hi = 1973 1975 1983 1989 1995<br>
>>>>>>>>>>> 2000 2007 2012<br>
>>>>>>>>>>> ; yearList_lo = 1963 1964 1965 1969 1977<br>
>>>>>>>>>>> 1979 1996 1997 2010 2011<br>
>>>>>>>>>>><br>
>>>>>>>>>>><br>
>>>>>>>>>>> ; this data starts at 1948 (this is index 0), so 1953=5, 1963=15<br>
>>>>>>>>>>> etc.<br>
>>>>>>>>>>><br>
>>>>>>>>>>> uDJF_NAO_hi = uDJF((/25,27,35,41,47,52,59,64/),:,:)<br>
>>>>>>>>>>> uDJF_NAO_lo = uDJF((/15,16,17,21,29,31,48,49,62,63/),:,:)<br>
>>>>>>>>>>><br>
>>>>>>>>>>> vDJF_NAO_hi = vDJF((/25,27,35,41,47,52,59,64/),:,:)<br>
>>>>>>>>>>> vDJF_NAO_lo = vDJF((/15,16,17,21,29,31,48,49,62,63/),:,:)<br>
>>>>>>>>>>><br>
>>>>>>>>>>> zDJF_NAO_hi = zDJF((/25,27,35,41,47,52,59,64/),:,:)<br>
>>>>>>>>>>> zDJF_NAO_lo = zDJF((/15,16,17,21,29,31,48,49,62,63/),:,:)<br>
>>>>>>>>>>><br>
>>>>>>>>>>><br>
>>>>>>>>>>> uAvgTime_hi = dim_avg_n_Wrap(uDJF_NAO_hi,0)<br>
>>>>>>>>>>> uAvgTime_lo = dim_avg_n_Wrap(uDJF_NAO_lo,0)<br>
>>>>>>>>>>><br>
>>>>>>>>>>> printVarSummary(uAvgTime_hi)<br>
>>>>>>>>>>> printVarSummary(uAvgTime_lo)<br>
>>>>>>>>>>><br>
>>>>>>>>>>> vAvgTime_hi = dim_avg_n_Wrap(vDJF_NAO_hi,0)<br>
>>>>>>>>>>> vAvgTime_lo = dim_avg_n_Wrap(vDJF_NAO_lo,0)<br>
>>>>>>>>>>><br>
>>>>>>>>>>> printVarSummary(vAvgTime_hi)<br>
>>>>>>>>>>> printVarSummary(vAvgTime_lo)<br>
>>>>>>>>>>><br>
>>>>>>>>>>> zAvgTime_hi = dim_avg_n_Wrap(zDJF_NAO_hi,0)<br>
>>>>>>>>>>> zAvgTime_lo = dim_avg_n_Wrap(zDJF_NAO_lo,0)<br>
>>>>>>>>>>><br>
>>>>>>>>>>> printVarSummary(zAvgTime_hi)<br>
>>>>>>>>>>> printVarSummary(zAvgTime_lo)<br>
>>>>>>>>>>><br>
>>>>>>>>>>> ; dirty way to copy metadata over first.<br>
>>>>>>>>>>> diff_u = uAvgTime_hi;<br>
>>>>>>>>>>> diff_v = vAvgTime_hi;<br>
>>>>>>>>>>> diff_z = zAvgTime_hi;<br>
>>>>>>>>>>><br>
>>>>>>>>>>> diff_u = uAvgTime_hi - uAvgTime_lo<br>
>>>>>>>>>>> diff_v = vAvgTime_hi - vAvgTime_lo<br>
>>>>>>>>>>> diff_z = zAvgTime_hi - zAvgTime_lo<br>
>>>>>>>>>>><br>
>>>>>>>>>>> printVarSummary(diff_u)<br>
>>>>>>>>>>> printVarSummary(diff_v)<br>
>>>>>>>>>>> printVarSummary(diff_z)<br>
>>>>>>>>>>><br>
>>>>>>>>>>> ;************************************************<br>
>>>>>>>>>>> ; create plot<br>
>>>>>>>>>>> ;************************************************<br>
>>>>>>>>>>> wks = gsn_open_wks("ps","Panel_NAO_z_500") ; open a<br>
>>>>>>>>>>> ps<br>
>>>>>>>>>>> file<br>
>>>>>>>>>>> plot = new(3,graphic) ; create a<br>
plot array<br>
>>>>>>>>>>><br>
>>>>>>>>>>> ;---- set common resources for all plots<br>
>>>>>>>>>>> res = True<br>
>>>>>>>>>>> res@gsnDraw = False ; dont draw<br>
res@gsnFrame = False ; dont advance<br>
frame<br>
>>>>>>>>>>> res@cnInfoLabelOn = False ; trn off cn info<br>
>>>>>>>>>>> label<br>
>>>>>>>>>>> res = True ; plot mods<br>
desired<br>
>>>>>>>>>>> res@gsnAddCyclic = False ; has to do with<br>
>>>>>>>>>>> wrapping<br>
>>>>>>>>>>> the longitude at 0/360<br>
>>>>>>>>>>> ;************************************************<br>
>>>>>>>>>>> ; Choose a subregion<br>
>>>>>>>>>>> ;************************************************<br>
>>>>>>>>>>> res@mpMaxLatF = 90 ;maximum latitude<br>
>>>>>>>>>>> res@mpMinLatF = 45 ;minimum latitude<br>
>>>>>>>>>>> res@mpMaxLonF = 357.5 ; ;maximum<br>
longitude<br>
>>>>>>>>>>> res@mpMinLonF = 270 ;minimum<br>
longitude<br>
>>>>>>>>>>><br>
>>>>>>>>>>> ;***********************************************<br>
>>>>>>>>>>> ; ----wind vector plot<br>
>>>>>>>>>>> ;***********************************************<br>
>>>>>>>>>>> vcres = True<br>
>>>>>>>>>>> vcres@vcRefAnnoOrthogonalPosF = -1.0 ; move ref vector<br>
>>>>>>>>>>> up<br>
>>>>>>>>>>> vcres@vcRefMagnitudeF = 10.0 ; define<br>
vector ref<br>
>>>>>>>>>>> mag<br>
>>>>>>>>>>> vcres@vcRefLengthF = 0.045 ; define<br>
length of<br>
>>>>>>>>>>> vec<br>
>>>>>>>>>>> ref<br>
>>>>>>>>>>> vcres@vcGlyphStyle = "CurlyVector" ; turn on<br>
curly vectors<br>
>>>>>>>>>>> vcres@vcMinDistanceF = 0.017<br>
>>>>>>>>>>> vcres@mpFillOn = False ; turn off<br>
gray fill<br>
>>>>>>>>>>> vcres@mpOutlineBoundarySets = "National" ; turn on country<br>
>>>>>>>>>>> boundaries<br>
>>>>>>>>>>> vcres@mpGeophysicalLineColor = "Navy" ; color of cont.<br>
>>>>>>>>>>> outlines<br>
>>>>>>>>>>> vcres@mpGeophysicalLineThicknessF = 1.5 ; thickness of<br>
outlines<br>
>>>>>>>>>>><br>
>>>>>>>>>>><br>
>>>>>>>>>>> ;vcres@gsnLeftString = "DJF High NAO"<br>
>>>>>>>>>>> winds_hi =<br>
>>>>>>>>>>> gsn_csm_vector_map_ce(wks,uAvgTime_hi,vAvgTime_hi,vcres)<br>
;vcres@gsnLeftString = "DJF Low NAO"<br>
>>>>>>>>>>> winds_lo =<br>
>>>>>>>>>>> gsn_csm_vector_map_ce(wks,uAvgTime_lo,vAvgTime_lo,vcres)<br>
;vcres@gsnLeftString = "Difference of High - Low"<br>
>>>>>>>>>>> winds_diff = gsn_csm_vector_map_ce(wks, diff_u, diff_v,vcres)<br>
;************************************************<br>
>>>>>>>>>>> ;---- geopotential height filled contour plot<br>
>>>>>>>>>>> ;***********************************************<br>
>>>>>>>>>>> zfres = res<br>
>>>>>>>>>>> zfres@cnFillOn = True<br>
>>>>>>>>>>> ;zfres@cnLevelSelectionMode = "ExplicitLevels<br>
>>>>>>>>>>> ;zfres@cnLevels = ispan(-20,90,5)<br>
>>>>>>>>>>> zfres@lbLabelFontHeightF = 0.015<br>
>>>>>>>>>>> zfres@lbOrientation = "Vertical"<br>
>>>>>>>>>>> zfres@pmLabelBarOrthogonalPosF = -0.005<br>
>>>>>>>>>>><br>
>>>>>>>>>>><br>
>>>>>>>>>>> contour_zf_hi = gsn_csm_contour(wks,zAvgTime_hi,zfres)<br>
contour_zf_lo = gsn_csm_contour(wks,zAvgTime_lo,zfres)<br>
contour_zf_diff = gsn_csm_contour(wks,diff_z,zfres)<br>
>>>>>>>>>>><br>
>>>>>>>>>>> plot(0) = overlay(contour_zf_hi,winds_hi)<br>
>>>>>>>>>>> plot(1) = overlay(contour_zf_lo,winds_lo)<br>
>>>>>>>>>>> plot(2) = overlay(contour_diff,winds_diff)<br>
>>>>>>>>>>><br>
>>>>>>>>>>><br>
>>>>>>>>>>> ;************************************************<br>
>>>>>>>>>>> ; create panel<br>
>>>>>>>>>>> ;************************************************<br>
>>>>>>>>>>> resP = True ; modify the<br>
panel<br>
>>>>>>>>>>> plot<br>
>>>>>>>>>>> resP@txString = "NAO 500mb"<br>
>>>>>>>>>>> gsn_panel(wks,plot,(/3,1/),resP) ; now draw as one<br>
>>>>>>>>>>> plot;<br>
>>>>>>>>>>><br>
>>>>>>>>>>><br>
>>>>>>>>>>> end<br>
>>>>>>>>>>><br>
>>>>>>>>>>><br>
>>>>>>>>>>> _______________________________________________<br>
>>>>>>>>>>> ncl-talk mailing list<br>
>>>>>>>>>>> <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
>>>>>>>>>>> List instructions, subscriber options, unsubscribe:<br>
>>>>>>>>>>> <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
>>>>>>>>>>><br>
>>>>>>>>>><br>
>>>>>>>>> <Panel_NAO_z_500.pdf><br>
>>>><br>
>>>><br>
>>><br>
>><br>
>><br>
><br>
<br>
<br>
<br>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist, </font></span><span><font color="#888888">Climate and Global Dynamics Laboratory, NCAR<br></font></span></div></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a> </font></span><span><font color="#888888">303-497-1726 </font></span></div><span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div></div></div></div></div></div></div>
</div>