<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; ">
<div>
<div>
<div>
<div>
<div>
<div>Obadias,</div>
<div><br>
</div>
<div><span class="Apple-style-span">You never define the plot array "plot". F</span><span class="Apple-style-span">or a 4-panel plot, add the following within the time loop but before the pressure level loop:</span></div>
<div>plot = new(4,graphic)</div>
<div><br>
</div>
<div>There is also a warning being produced by your code relating to PanelPlot being improperly used as a map resource. To get rid of it without impacting your output, delete the following:</div>
<div>mpres@PanelPlot = True ; Indicate these plots are to be paneled.</div>
<div><br>
</div>
<div>Good luck,</div>
<div>~Dan</div>
</div>
</div>
</div>
</div>
</div>
<div><br>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Obadias Cossa <<a href="mailto:objacoe@hotmail.com">objacoe@hotmail.com</a>><br>
<span style="font-weight:bold">Date: </span>Tuesday, June 12, 2012 5:05 PM<br>
<span style="font-weight:bold">To: </span>WRF USERS <<a href="mailto:wrf-users@ucar.edu">wrf-users@ucar.edu</a>><br>
<span style="font-weight:bold">Subject: </span>[Wrf-users] ncl moiture fluxes<br>
</div>
<div><br>
</div>
<div><style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
<div class="hmmessage">
<div dir="ltr">Hello!<br>
May anyone help on correcting this script. Its showing error on line plot(0) = wrf_map_overlays(a,wks,(/vector/),pltres,mpres) , but when I check the wrf_map_overlays syntax lookx fine.<br>
See whole script is below!<br>
<br>
Obadias<br>
<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"<br>
begin<br>
;<br>
; The WRF ARW input file. <br>
; This needs to have a ".nc" appended, so just do it.<br>
a = addfile("/media/Obedias/medias/DJF_I/DJF_2001.nc","r") ; DJF_2001.nc is a normao wrf_out file.<br>
; We generate plots, but what kind do we prefer?<br>
type = "pdf"<br>
; type = "pdf"<br>
wks = gsn_open_wks(type,"overlay_1")<br>
; Set some Basic Plot options<br>
res = True<br>
res@MainTitle = "moisture flux trial"<br>
;res@Footer = False<br>
pltres = True<br>
mpres = True<br>
mpres@mpGeophysicalLineColor = "Black"<br>
mpres@mpNationalLineColor = "Black"<br>
mpres@mpUSStateLineColor = "Black"<br>
;mpres@mpGridLineColor = "Black"<br>
mpres@mpLimbLineColor = "Black"<br>
mpres@mpPerimLineColor = "Black"<br>
mpres@mpGeophysicalLineThicknessF = 2.0<br>
;mpres@mpGridLineThicknessF = 1.0<br>
mpres@mpLimbLineThicknessF = 2.0<br>
mpres@mpNationalLineThicknessF = 2.0<br>
mpres@mpUSStateLineThicknessF = 1.0<br>
<br>
pltres@PanelPlot = True ; Indicate these plots are to be paneled.<br>
pltres@PanelPlot = True ; Indicate these plots are to be paneled.<br>
mpres@PanelPlot = True ; Indicate these plots are to be paneled.<br>
mpres@PanelPlot = True ; Indicate these plots are to be paneled.<br>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
; What times and how many time steps are in the data set?<br>
times = wrf_user_list_times(a) ; get times in the file<br>
;ntimes = dimsizes(times) ; number of times in the file.<br>
ntimes = dimsizes(1) ; number of times in the file<br>
; The specific pressure levels that we want the data interpolated to.<br>
pressure_levels = (/ 850., 700., 500., 300./) ; pressure levels to plot<br>
nlevels = dimsizes(pressure_levels) ; number of pressure levels<br>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
<br>
do it = 0,ntimes-1,1 ; TIME LOOP<br>
print("Working on time: " + times(it) )<br>
;res@TimeLabel = times(it) ; Set Valid time to use on plots<br>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
; First get the variables we will need <br>
u = wrf_user_getvar(a,"ua",it) ; <br>
v = wrf_user_getvar(a,"va",it) ; <br>
p = wrf_user_getvar(a, "pressure",it) ; <br>
rh = wrf_user_getvar(a,"rh",it) ; <br>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
do level = 0,nlevels-1 ; LOOP OVER LEVELS<br>
<br>
pressure = pressure_levels(level) <br>
rh_plane = wrf_user_intrp3d(rh,p,"h",pressure,0.,False) ; <br>
u_plane = wrf_user_intrp3d( u,p,"h",pressure,0.,False)<br>
v_plane = wrf_user_intrp3d( v,p,"h",pressure,0.,False)<br>
<b>qu_plane = rh_plane*u_plane ; for fluxs<br>
qv_plane= rh_plane*v_plane ; for fluxs</b><br>
<br>
; Plotting options for Moisture flux <br>
gsn_define_colormap(wks,"sunshine_9lev") ; ("BlWhRe") <br>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; <br>
opts = True<br>
opts@InitTime = False ;Plot initial time on graphic. If True, the initial time will be extracted from the input file.<br>
opts@ValidTime= False ; Plot valid time on graphic. Default is True. A user must set opts@TimeLabel to the correct time.
<br>
opts@vcGlyphStyle = "CurlyVector" ; turn on curley vectors
<br>
opts@FieldTitle = "Moiture flux" ; overwrite Field Title<br>
opts@NumVectors = 40 ; wind barb density<br>
vector = wrf_vector(a,wks,qu_plane,qv_plane,opts)<br>
;#######Genito######## <br>
pltres@gsnFrame = False ; do not advance frame <br>
mpres@gsnFrame = False ; do not advance frame <br>
;#########################<br>
if ( pressure .eq. 850 ) then ; plot temp, rh, height, wind barbs<br>
<b> plot(0) = wrf_map_overlays(a,wks,(/vector/),pltres,mpres)</b><br>
map0=plot(0) ; keep in the memory<br>
end if<br>
<br>
if ( pressure .eq. 700 ) then ; plot temp, height, wind barbs<br>
plot(1) = wrf_map_overlays(a,wks,(/vector/),pltres,mpres)<br>
map1=plot(1); <br>
end if<br>
<br>
if ( pressure .eq. 500 ) then ; plot temp, height, wind barbs<br>
<b>plot(2) = wrf_map_overlays(a,wks,(/vector/),pltres,mpres)</b><br>
map2=plot(2); <br>
end if<br>
<br>
if ( pressure .eq. 300 ) then ; plot windspeed, height, wind barbs<br>
plot(3) = wrf_map_overlays(a,wks,(/vector/),pltres,mpres)<br>
map3=plot(3); <br>
end if<br>
; delete(opts_z)<br>
<br>
pnlres = True<br>
pnlres@gsnFrame = False ; do not advance frame <br>
pnlres@gsnPanelYWhiteSpacePercent = 5<br>
pnlres@gsnPanelXWhiteSpacePercent = 5 ; Adds the white space to the panel plot.<br>
pnlres@gsnPanelFigureStrings= (/"(a)","(b)","(c)","(d)"/)<br>
; gsn_panel(wks,plot,(/2,2/),pnlres)<br>
;***************************************************************************************<br>
end do ; END OF LEVEL LOOP<br>
end do ; END OF TIME LOOP<br>
<br>
gsn_panel(wks,(/map0,map1,map2,map3 /),(/2,2/),pnlres)<br>
frame(wks) ; coloque num frame<br>
end<br>
<br>
</div>
</div>
</div>
</span>
</body>
</html>