<div dir="ltr"><div><div><div><div>Hello,<br><br></div>I am very busy with writing assorted divisional planning documents required by NSF. <br><br></div>I just do not have the time to help debug programs. I think you should debug by (say) plotting and printing assorted information. This is what I would end up doing.<br><br></div>Good Luck<br></div>D<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 14, 2015 at 2:13 PM, <span dir="ltr"><<a href="mailto:mmkamal@uwaterloo.ca" target="_blank">mmkamal@uwaterloo.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Dennis,<br>
<br>
Please correct me if I am wrong: your code will give me an output variable with the same number of grid box with FillValue at the relaxation zone cells.<br>
<br>
I have had a chance to do it slightly other way. Could you please check my code whether I have done it correctly or make some mistake:<br>
<br>
============================================================<br>
f = addfile ("/scratch/mkamal/<a href="http://wrfout_d01_2014.nc" target="_blank">wrfout_d01_2014.nc</a>","r")<br>
<br>
;*********************************************************<br>
conv_prcp = f->RAINC(0,:,:)<br>
non_conv_prcp = f->RAINNC(0,:,:)<br>
<br>
conv_prcp = conv_prcp > 0.0<br>
non_conv_prcp = non_conv_prcp > 0.0<br>
total_prcp = conv_prcp+non_conv_prcp<br>
printVarSummary(total_prcp)<br>
<br>
x = 224 ; originally 225 grid cell along east-west<br>
y = 174 ; 175 grid-box along south-north<br>
<br>
;--------- Remove relaxation zone cells<br>
<br>
total_prcp_no_rz_cell = total_prcp(9:(y-11),9:(x-11))<br>
<br>
printVarSummary(total_prcp_no_rz_cell)<br>
<br>
;--------- assing missing values<br>
<br>
total_prcp_no_rz_cell@_FillValue = -999<br>
<br>
;--------- Compute average precipitation<br>
<br>
dom_avg_prcp = avg(total_prcp_no_rz_cell)<br>
<br>
printVarSummary(dom_avg_prcp)<br>
<br>
print(dom_avg_prcp)<br>
<br>
==============================================<br>
<br>
Thanks<br>
Kamal<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
Quoting Dennis Shea <<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>>:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Try something like the following.<br>
<br>
x(NY,NX)<br>
x@_FillValue<br>
<br>
nx = 10 ; allow for different 'relax boundaries'<br>
ny = 10<br>
<br>
x(0:ny-1,0:nx-1) = x@_FillValue<br>
<br>
nxStrt = NX-nx<br>
nxLast = NX-1<br>
nyStrt = NY-ny<br>
nyLast = NY-1<br>
x(nyStrt:nyLast,nxStrt:nxLast) = x@_FillValue<br>
<br>
Use<br>
<br>
print(x)<br>
<br>
or plot to debug<br>
=============<br>
<br>
<br>
Better: make it into a function and place into your personal libray<br>
<br>
<br>
On Fri, May 8, 2015 at 11:11 AM, <<a href="mailto:mmkamal@uwaterloo.ca" target="_blank">mmkamal@uwaterloo.ca</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I want to calculate statistics except the relaxation zone cells<br>
(outermost 10 grid cells) from WRF output. Any help will be greatly<br>
appreciated.<br>
<br>
<br>
Thanks<br>
Kamal<br>
<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br>
</blockquote>
<br>
</blockquote>
<br>
<br>
<br>
<br>
<br>
</div></div></blockquote></div><br></div>