<div dir="ltr"><div class="gmail_default" style="font-size:small">It looks like you are trying to mix and match the use of wrf_map_overlays, wrf_map_resources, and overlay. Also, you have a "map_res" variable which never gets used and is not needed for anything, so all references to it should be removed.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Since you are calling wrf_map_resources and overlay, you don't need to call wrf_map_overlays, because it actually calls wrf_map_resources and overlay under the hood</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Really, though, you should just use gsn_csm_contour_map, so you don't have to do the overlay yourself.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I think you can replace all the code after you read in tc2 with the following code (UNTESTED):</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style=""><div class="gmail_default" style=""><font face="monospace, monospace"> res = True</font></div><div class="gmail_default" style=""><font face="monospace, monospace"> res@cnFillOn = True</font></div><div class="gmail_default" style=""><font face="monospace, monospace"> res@cnLinesOn = False</font></div><div class="gmail_default" style=""><font face="monospace, monospace"> res@cnLevelSelectionMode = "ExplicitLevels"</font></div><div class="gmail_default" style=""><font face="monospace, monospace"> res@cnLevels = (/ 0.,2.,4,5,6,7,8,9,10,11,12,13,14,15,20/)</font></div><div class="gmail_default" style=""><font face="monospace, monospace"> res@lbLabelStride = 1.</font></div><div class="gmail_default" style=""><font face="monospace, monospace"> res@lbLabelFontHeightF = 0.015</font></div><div class="gmail_default" style=""><font face="monospace, monospace"> res@lbOrientation = "Horizontal"</font></div><div class="gmail_default" style=""><font face="monospace, monospace"> res@pmLabelBarOrthogonalPosF = -0.005</font></div><div class="gmail_default" style=""><font face="monospace, monospace"><br></font></div><div class="gmail_default" style=""><font face="monospace, monospace"> res@tiMainString = "2 m Temperature - "+date</font></div><div class="gmail_default" style=""><font face="monospace, monospace"> res@gsnLeftString = "Temperature (" + tc2@units + ")"</font></div><div class="gmail_default" style=""><font face="monospace, monospace"> res@gsnRightString = ""</font></div><div class="gmail_default" style=""><font face="monospace, monospace"><br></font></div><div class="gmail_default" style=""><font face="monospace, monospace"> res = wrf_map_resources(a,mpres)</font></div><div class="gmail_default" style=""><font face="monospace, monospace"> res@gsnAddCyclic = False</font></div><div class="gmail_default" style=""><font face="monospace, monospace"> res@tfDoNDCOverlay = True</font></div><div class="gmail_default" style=""><font face="monospace, monospace"><br></font></div><div class="gmail_default" style=""><font face="monospace, monospace"> plot = gsn_csm_contour_map(wks,tc2,res)</font></div></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Note that I only have one resource list, and that I'm calling gsn_csm_contour_map, which calls "overlay" for me.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 7, 2015 at 4:17 PM, <span dir="ltr"><<a href="mailto:Solange.Fermepin@lmd.jussieu.fr" target="_blank">Solange.Fermepin@lmd.jussieu.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello everybody!<br>
<br>
I am using NCL to plot fields from a WRF simulation. I am having problems<br>
overlaying the map on the contour plot: the boundary of the country is not<br>
right placed (I checked with ferret).<br>
<br>
I think there might be a projection problem, even though the function<br>
wrf_map_resources gets the right projection (mercator in this case).<br>
<br>
I am lost. If anybody has any ideas, I will be really grateful.<br>
<br>
Below there is my script and I have also attached the figure so you get an<br>
idea. For instante, see the problem at around 0.5W:45.5N).<br>
<br>
Thanks a lot!<br>
Solange<br>
<br>
;----------------------------------------------------------------------<br>
; NCL script to plot fields from a WRF simulation<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/wrf/WRFUserARW.ncl"<br>
;----------------------------------------------------------------------<br>
begin<br>
;---Open WRF output file<br>
frun<br>
="/home/sfermepin/WRF/SNCF/FR2/RUNS/mpWSM3-raRRTM-blYSU-cuKF/20141023_00/wrfout_d01_2014-10-23_00:00:00"<br>
a = addfile(frun,"r")<br>
date="20141023"<br>
dom="03"<br>
;---Read several WRF variables at first time step<br>
it = 0 ; first record<br>
tc2 = wrf_user_getvar(a,"T2",5);<br>
tc2 = tc2-273.15<br>
<br>
;---Change the metadata<br>
tc2@description = "2m Temperature"<br>
tc2@units = "degC"<br>
<br>
;---Set common resources for all plots<br>
res = True<br>
res@gsnFrame = False<br>
res@gsnDraw = False<br>
res@gsnLeftString = ""<br>
res@gsnRightString = ""<br>
<br>
;---Necessary for contours to be overlaid correctly on WRF projection<br>
res@tfDoNDCOverlay = True<br>
<br>
;---Overlay plots on map and draw.<br>
pltres = True<br>
pltres@gsnFrame = False<br>
pltres@gsnDraw = False<br>
<br>
mpres = True<br>
mpres@gsnFrame = False<br>
mpres@gsnDraw = False<br>
mpres@mpGeophysicalLineColor = "black"<br>
mpres@mpLimitMode = "Corners"<br>
mpres = wrf_map_resources(a,mpres)<br>
<br>
;---Map plot<br>
map_res = True<br>
map_res@gsnFrame = False<br>
map_res@gsnDraw = False<br>
<br>
; Output file: temp<br>
wks = gsn_open_wks("pdf","try")<br>
gsn_define_colormap(wks,"precip2_17lev")<br>
;---Temperature filled contour plot<br>
tc_res = res<br>
tc_res@cnFillOn = True<br>
tc_res@cnLinesOn = False<br>
tc_res@cnLevelSelectionMode = "ExplicitLevels"<br>
tc_res@cnLevels = (/ 0.,2.,4,5,6,7,8,9,10,11,12,13,14,15,20/)<br>
;tc_res@cnLevels = (/<br>
0.,1.,2.,2.5,5.,6.,7.,8.,09.,10.,11.,12.,13.,14.,15.,16.,20./)<br>
tc_res@lbLabelStride = 1.<br>
tc_res@lbLabelFontHeightF = 0.015<br>
tc_res@lbOrientation = "Horizontal"<br>
tc_res@pmLabelBarOrthogonalPosF = -0.005<br>
tc_res@gsnLeftString = "Temperature (" + tc2@units + ")"<br>
tc_res@gsnAddCyclic = False<br>
<br>
mpres@tiMainString = "2 m Temperature - "+date<br>
<br>
contour_tc = gsn_csm_contour(wks,tc2,tc_res)<br>
plot = wrf_map_overlays(a,wks,(/contour_tc/),pltres,mpres)<br>
overlay(plot,contour_tc)<br>
draw(plot) ; This will draw all overlaid plots and the map<br>
frame(wks)<br>
end<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
Solange Fermepin, PhD<br>
Laboratoire de Météorologie Dynamique - CNRS/IPSL<br>
Tour 45-55, 3ème étage<br>
4 place Jussieu<br>
75252 Paris cedex 05<br>
France<br>
<br>
Tel: <a href="tel:%2B33%20%280%29%201%2044%2027%2052%2055" value="+33144275255">+33 (0) 1 44 27 52 55</a><br>
E-mail: <a href="mailto:solange.fermepin@lmd.jussieu.fr">solange.fermepin@lmd.jussieu.fr</a></font></span><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></blockquote></div><br></div>