[ncl-talk] How can I remove relaxation zone cells and calculate statistics from WRF output

Dennis Shea shea at ucar.edu
Thu May 14 14:22:04 MDT 2015


Hello,

I am very busy with writing assorted divisional planning documents required
by NSF.

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.

Good Luck
D

On Thu, May 14, 2015 at 2:13 PM, <mmkamal at uwaterloo.ca> wrote:

> 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
>>>
>>>
>>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150514/3b12f66d/attachment.html 


More information about the ncl-talk mailing list