yrStrt = 1995
yrLast = 2005
nyrs = yrLast-yrStrt+1
nmos = 12
yyyymmdd = t2&time
yyyymm = yyyymmdd/100
yyyy = yyyymm/100
mm = yyyymm-yyyy*100
tavg = new( (/nyrs,nmos,nlat,mlon/), "float")
do yr=yrStrt,yrLast
nyr = yr-yrStrt
do mo=1,nmos
i = ind(yyyy.eq.yr .and. mo.eq.mm)
tavg(nyr,mo-1,:,:) = dim_avg_n(t2(i,:,:), 0)
delete(i)
end do
end do
On 05/04/2012 03:19 PM, debasish@sca.uqam.ca wrote:
> Dear NCL user,
>
> Is there any function or script in ncl that calculate monthly data from
> daily data.
>
> Input: float t2(time, lat, lon)
> where time = 19950101, 19950102, 19950103,.....20051231 ;
> dimsizes(time) = 4018 (including Leap year)
>
> Output: t(yr,mon,lat,lon)
> where yr = 1995-2005
> mon= 1,12
>
> with regars
> debasish
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri May 4 15:34:04 2012
This archive was generated by hypermail 2.1.8 : Thu May 10 2012 - 16:57:50 MDT