To compute daily sum from 3-hourly precipitation

From: Noel Aloysius <noel.aloysius_at_nyahnyahspammersnyahnyah>
Date: Tue May 29 2012 - 15:06:44 MDT

Hi NCL-Talk,

In order to compute daily totals from 3-hourly precipitation data, I wrote
a script as below. But, I wonder if there is a better/shorter or efficient
way to do it.

f = addfile("prec_1948-1948.nc","r")
P = f->data
nt = 2928 ; no. of records (leap year)
j=-1
Pday = new((/366,180,360/),"float") ; array for daily values in leap year

do i=7,nt,8
   j = j+1
   x = P(i-7:i,:,:)
   Pday(j,:,:) = dim_sum_n_Wrap(x,0)
end do

Thanks,

Noel

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue May 29 15:06:53 2012

This archive was generated by hypermail 2.1.8 : Wed Jun 06 2012 - 15:17:44 MDT