Re: To create 3-hourly time array

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu Oct 25 2012 - 08:54:21 MDT

There is an undocumented function in contributed.ncl

function yyyymmddhh_time (yrStrt[1]:integer, yrLast[1]:integer,
hrStep[1]:integer, TYPE:string)

   date1 = yyyymmddhh_time( start_year1, end_year1, 3, "integer")

Cheers

On 10/25/12 8:18 AM, Noel Aloysius wrote:
> Hi NCL,
>
> I want to create a 3-hourly time array for the period 1948-2099. I wrote
> a script, appended below, that creates daily time step. Could you help
> to extend this to 3-hourly series.
>
> Thanks,
> Noel
>
>
> ;************************************************************************
>
> start_year1 = 1948
> end_year1 = 2099
>
> nyears1 = (end_year1 - start_year1) + 1 ; no. of sim. years
> years1 = ispan(start_year1,end_year1,1) ; sim. years sequence
>
> nleap1 = num(isleapyear(ispan(start_year1,end_year1,1))) ; no. of
> leap years
>
> ntim1 = ((nleap1*366) +(nyears1-nleap1)*365) * 8 ; no. of time steps
>
> date1 = new (ntim1, integer, "No_FillValue")
>
> nmos = 12 ; no. of months
> hrs = (/03,06,09,12,15,18,21,24/)
>
> n = 0
> do ny=start_year1,end_year1
> do nmo=1,nmos
> YRM = ny*10000 + nmo*100
> ndm = days_in_month(ny,nmo)
> date1(n:n+ndm-1) = YRM + ispan(1,ndm,1)
> n = n + ndm
> end do
> end do
>
> ;************************************************************************
>
>
>
>
> _______________________________________________
> 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 Thu Oct 25 08:54:32 2012

This archive was generated by hypermail 2.1.8 : Wed Oct 31 2012 - 09:14:12 MDT