[ncl-talk] summing each of three time-series values

Dennis Shea shea at ucar.edu
Mon Nov 2 10:37:02 MST 2015


http://test.www.ncl.ucar.edu/Document/Functions/Built-in/dim_acumrun_n.shtml

w_mean = dim_acumrun_n(w,3,0,0) /3

On Mon, Nov 2, 2015 at 10:10 AM, sangeeta maharjan
<sangeetamaharjan at gmail.com> wrote:
> hi,
>
> I am planning to use following codes in my scripts to meet my requirements
> that i have mentioned in former email.
> ------------------------------------------------------------------------------------------------------------------------------------------------
>
> W     = wrf_user_getvar(f,"wa", -1)
>
> dim_w=dimsizes(W)
>
> W1 = new((/dim_w(1),dim_w(2),dim_w(3)/),float
>
> W2 = new((/dim_w(1),dim_w(2),dim_w(3)/),float)
>
> W3 = new((/dim_w(1),dim_w(2),dim_w(3)/),float)
>
> MEAN_W = new((/dim_w(0)-4,dim_w(1),dim_w(2),dim_w(3)/),float)
>
>  do n=0,dim_w(0)-5
>
>    W1(:,:,:)=W(n,:,:,:)
>    W2(:,:,:)=W(n+1,:,:,:)
>    W3(:,:,:)=W(n+2,:,:,:)
>
>   MEAN_W(n,:,:,:)=(W1+W2+W3)/3
>
>  end do
>
> -------------------------------------------------------------------------
>
> I suppose these will be fine.
>
>
> Regards,
>
> Sangeeta Maharjan.
>
>
>
> On Sun, Nov 1, 2015 at 11:13 PM, sangeeta maharjan
> <sangeetamaharjan at gmail.com> wrote:
>>
>> Dear NCL Users,
>>
>>
>>
>> I have variable of 4 dimesion, eg :- W (97(time), 28 (lev), 52 (lat),
>> 52(lon)).
>>
>>
>>
>> I want to retain sum of  three consecutive values starting from time 0,
>> again sum of three consecutive values starting from time 1, again sum of
>> three consecutive  values starting from time 2 and so on.  The same process
>> is carried  in  every grid point and every vertical levels such that the
>> values are stored in new variable, W_sum(93 (time), 28(lev),52 (lat), 52
>> (lon)).
>>
>>
>>
>> Available functions ,sum (), dim_sum(),dim_sum_n() are not working in my
>> case.
>>
>>
>>
>> Can you suggest me a suitable method to carry my  operations
>>
>>
>>
>> Thanks & Regards.
>>
>> Sangeeta Mahrjan.
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>


More information about the ncl-talk mailing list