[ncl-talk] How can I remove relaxation zone cells and calculate statistics from WRF output
mmkamal at uwaterloo.ca
mmkamal at uwaterloo.ca
Thu May 14 14:13:36 MDT 2015
Hi Dennis,
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.
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:
============================================================
f = addfile ("/scratch/mkamal/wrfout_d01_2014.nc","r")
;*********************************************************
conv_prcp = f->RAINC(0,:,:)
non_conv_prcp = f->RAINNC(0,:,:)
conv_prcp = conv_prcp > 0.0
non_conv_prcp = non_conv_prcp > 0.0
total_prcp = conv_prcp+non_conv_prcp
printVarSummary(total_prcp)
x = 224 ; originally 225 grid cell along east-west
y = 174 ; 175 grid-box along south-north
;--------- Remove relaxation zone cells
total_prcp_no_rz_cell = total_prcp(9:(y-11),9:(x-11))
printVarSummary(total_prcp_no_rz_cell)
;--------- assing missing values
total_prcp_no_rz_cell at _FillValue = -999
;--------- Compute average precipitation
dom_avg_prcp = avg(total_prcp_no_rz_cell)
printVarSummary(dom_avg_prcp)
print(dom_avg_prcp)
==============================================
Thanks
Kamal
Quoting Dennis Shea <shea at ucar.edu>:
> Try something like the following.
>
> x(NY,NX)
> x at _FillValue
>
> nx = 10 ; allow for different 'relax boundaries'
> ny = 10
>
> x(0:ny-1,0:nx-1) = x at _FillValue
>
> nxStrt = NX-nx
> nxLast = NX-1
> nyStrt = NY-ny
> nyLast = NY-1
> x(nyStrt:nyLast,nxStrt:nxLast) = x at _FillValue
>
> Use
>
> print(x)
>
> or plot to debug
> =============
>
>
> Better: make it into a function and place into your personal libray
>
>
> On Fri, May 8, 2015 at 11:11 AM, <mmkamal at uwaterloo.ca> wrote:
>
>> Hi,
>>
>> I want to calculate statistics except the relaxation zone cells
>> (outermost 10 grid cells) from WRF output. Any help will be greatly
>> appreciated.
>>
>>
>> Thanks
>> Kamal
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
More information about the ncl-talk
mailing list