Markus,
I see that I had one error in what I wrote. I should have said,
...
I imagine that what you want is that each year starts with the
beginning of January and ends with the end of December.
...
On 8/29/2011 1:49 PM, Ansley Manke wrote:
Hi -
Your script looks fine except for one thing. I think that you
haven't defined the yearly time axis that you really want to use.
Here's what you have:
yes? define
axis/t=16-jan-1850:16-dec-2005:12/unit=months/calendar=noleap
year_noleap
*** NOTE: /UNIT=MONTHS ... using 1/12 of 365.00 days
yes? list t[gt=year_noleap]
VARIABLE : T
axis YEAR_NOLEAP
SUBSET : 157 points (TIME)
CALENDAR : NOLEAP
JAN-1850 / 1: 600.
JAN-1851 / 2: 612.
JAN-1852 / 3: 624.
JAN-1853 / 4: 636.
JAN-1854 / 5: 648.
...
This means that for this axis, the years are centered at January
16 of each year, with each year starting and ending in mid-July.
I imagine that what you want is that each year starts with the
beginning of January and ends with the end of January. To do
that, start and end at the edges of the year, use units of YEAR
and use the /EDGES qualifier to tell Ferret that the dates you
give are to be used as the edges of grid cells.
yes? define
axis/t=1-jan-1850:31-dec-2005:1/unit=year/EDGES/calendar=noleap
year_noleap
You do NOT need to use the same units (months) for time
calculations. Ferret translates between time units when working
with calendar time.
Ansley
On 8/26/2011 3:17 AM, markus.mingel@xxxxxxxxx wrote:
Dear users,
I have a problems and I'm not sure I'm solving it in the right
way.
I have a monthly surface temperature (you can see the features
of the axis
below)
yes? SHOW grid/T/l=1:12 tas
GRID GHF2
name axis # pts start end
LON LONGITUDE 96mr 0E 3.75W
LAT LATITUDE 96 i 90S 90N
normal Z
TIME TIME 1872 i 16-JAN-1850 12:00
16-DEC-2005 12:00
L T TBOX
TBOXLO TSTEP (days)
1> 16-JAN-1850 12:00:00 31 01-JAN-1850
00:00:00 15.5
2> 15-FEB-1850 00:00:00 28 01-FEB-1850
00:00:00 45
3> 16-MAR-1850 12:00:00 31 01-MAR-1850
00:00:00 74.5
4> 16-APR-1850 00:00:00 30 01-APR-1850
00:00:00 105
5> 16-MAY-1850 12:00:00 31 01-MAY-1850
00:00:00 135.5
6> 16-JUN-1850 00:00:00 30 01-JUN-1850
00:00:00 166
7> 16-JUL-1850 12:00:00 31 01-JUL-1850
00:00:00 196.5
8> 16-AUG-1850 12:00:00 31 01-AUG-1850
00:00:00 227.5
9> 16-SEP-1850 00:00:00 30 01-SEP-1850
00:00:00 258
10> 16-OCT-1850 12:00:00 31 01-OCT-1850
00:00:00 288.5
11> 16-NOV-1850 00:00:00 30 01-NOV-1850
00:00:00 319
12> 16-DEC-1850 12:00:00 31 01-DEC-1850
00:00:00 349.5
and I would compute from these monthly values the yearly means.
According to
previous post I did the following to compute the yearly values:
! Define monthly calendar time axis.
define
axis/t=16-jan-1850:16-dec-2005:1/unit=months/calendar=noleap
month_noleap
! Regrid on new time axis
let tas_monthly = tas[gt=month_noleap@asn]
! Define yearly calendar time axis.
define
axis/t=16-jan-1850:16-dec-2005:12/unit=months/calendar=noleap
year_noleap
! Regrid to get annual averages.
DEFINE VARIABLE/title="yearly tas [C]" tas_yearly = tas_monthly
[gt=year_noleap@ave]
So is it right? Otherwise, if I'm wrong, which is the best way
to do that?
I believe there is something wrong, since I get 2 spikes at the
first and last
year, respectively (namely the temperature is 1C lower that it
should be).
Thanks into advance for help
Best Regards
Markus
|