[Thread Prev][Thread Next][Index]
Re: [ferret_users] NO_LEAP, 365_DAYS axis
I look for some lines to define in the simplest way a noleap axis with
months or days units ?
yes? def
axis/t="01-JAN-2000":"31-DEC-2005":1/units=months/edges/cal=365_days
myannual
*** NOTE: /UNIT=MONTHS ... using 1/12 of 365.00 days
Could the define command be extented to allow a direct definition of
an axis
with a 365 days calendar and a months unit or days unit ?
Each month should start at 01-MM-YYYY
Answering to myself...
You can use the attached script:
yes? go def_monthaxis_noleap_days.jnl 2002 2005 2001 mytaxis
name axis # pts start end
MYTAXIS TIME 48 i 16-JAN-2002 12:00 16-DEC-2005 12:00
T0 = 01-JAN-2001
CALENDAR = NOLEAP
Axis span (to cell edges) = 1460
yes? show axis/t mytaxis
name axis # pts start end
MYTAXIS TIME 48 i 16-JAN-2002 12:00 16-DEC-2005 12:00
T0 = 01-JAN-2001
CALENDAR = NOLEAP
Axis span (to cell edges) = 1460
L T TBOX TBOXLO TSTEP
(DAYS)
1> 16-JAN-2002 12:00:00 31 01-JAN-2002 00:00:00 380.5
2> 15-FEB-2002 00:00:00 28 01-FEB-2002 00:00:00 410
3> 16-MAR-2002 12:00:00 31 01-MAR-2002 00:00:00 439.5
4> 16-APR-2002 00:00:00 30 01-APR-2002 00:00:00 470
5> 16-MAY-2002 12:00:00 31 01-MAY-2002 00:00:00 500.5
6> 16-JUN-2002 00:00:00 30 01-JUN-2002 00:00:00 531
...
Patrick
\cancel mode verify
!**************************************************************
! Description: Define a noleap (365 days) time axis in days
! Each month begins at first of the month
!
! Usage: go def_monthaxis_noleap_days.jnl year_start year_end [year_ref] [axis_name]
!
! Example: go def_monthaxis_noleap_days.jnl 2002 2005 2001 mytaxis
!
! Notes:
!
! Calls:
!
! Author: Patrick Brockmann
! Contact: Patrick.Brockmann@xxxxxx
! $Date: $
! $Name: $
! $Revision: $
! History:
! Modification:
!
!**************************************************************
let year_start=($01)
let year_end=($02)
let year_ref=($03%($01)%)
let nbyears=year_end-year_start+1
let nbdays={31,28,31,30,31,30,31,31,30,31,30,31}
define axis/units="days"/T0="01-JAN-`year_ref`"/edges/cal="noleap" ($04%monthaxis%) = `(year_start-year_ref)*365`+xcat(0,xsequence(365*(j[j=1:`nbyears`]-1)+nbdays[i=@rsum]))
show axis ($04%monthaxis%)
!**************************************************************
set mode/last verify
[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce /
NOAA /
OAR /
PMEL /
Ferret
Privacy Policy | Disclaimer | Accessibility Statement