[Thread Prev][Thread Next][Index]

Re: annual average from monthly mean for precise 365-day years.




On Sat, 17 Mar 2001, Steve Hankin wrote:

> Hi Wei,
>
> I'm not sure what problem you are describing. Here is an example of averaging 24
> months of data into 2 annual averages:
>
>      /export/home/ja3/hankin/tmp> ferret
>              NOAA/PMEL TMAP
>              Program FERRET
>              Version 5.22 - 07/27/00
>              17-Mar-01 14:03
>
>      yes? define axis/t=1-jan-1980:1-jan-1982/npoints=24/edges t24months
>      yes? let my_var = T[gt=t24months]
>      yes? define axis/t=1-jan-1980:1-jan-1982/npoints=2/edges t2years
>      yes? list my_var[gt=t2years@ave]
>                   T[GT=T24MONTHS]
>                   regrid: 8772 hour on T@AVE
>       JUL-1980 / 1:  696546.
>       JUL-1981 / 2:  705318.
>
> Will this approach work for you?

Hi Steve,

Imagine that I have 101 years' monthly means. So the total data points
in month is 101*12 = 1212. If I use:

define axis/edges/t=1:1212:1/npoints=1212/unit=months tax
LET newtaux = stresx[GT=tax@asn]
define axis/edges/t=1:1212:12/UNITS=months tann
let/title="X-component of surface stress (N/m2)" tauxx=newtaux[gt=tann@ave]
list/x=180/y=0 tauxx

Here is part of the output:

 7      /   1:  0.02913
 19     /   2:  0.02431
 31     /   3:  0.03450
 43     /   4:  0.02694
 55     /   5:  0.02979
 67     /   6:  0.02674
 79     /   7:  0.02317
 91     /   8:  0.02608
  ... skipped
 1171   /  98:  0.02994
 1183   /  99:  0.02505
 1195   / 100:  0.02370
 1207   / 101:     ....

Notice that the annual mean variable tauxx is defined at month 7, 19
etc. of the original data and the last data point at month 1207 is a bad
value (I thought it has sth to do with the fact that the total data point
is an even number "1212", not an odd number. Now I am not sure about it).
But, I have 101 years' data; and I should be able to get 101 non-bad
values.

Next, I used "/npoints=101" according to your suggestion:

define axis/edges/t=1:1212:1/npoints=1212/unit=months tax
LET newtaux = stresx[GT=tax@asn]
define axis/edges/t=1:1212:12/npoints=101/UNITS=months tann
let/title="X-component of surface stress (N/m2)" tauxx=newtaux[gt=tann@ave]
list/x=180/y=0 tauxx

And here is part of the output from the above script:

 7      /   1:  0.02914
 19     /   2:  0.02431
 31     /   3:  0.03448
 43     /   4:  0.02703
 55     /   5:  0.02976
 66.9   /   6:  0.02675
 78.9   /   7:  0.02321
 90.9   /   8:  0.02598
 102.9  /   9:  0.03899
 114.9  /  10:  0.02785
  ... skipped
 1134.1 /  95:  0.02630
 1146.1 /  96:  0.02690
 1158   /  97:  0.03507
 1170   /  98:  0.03012
 1182   /  99:  0.02504
 1194   / 100:  0.02452
 1206   / 101:  0.02895

Notice that now I do get 101 good values. However, their time
axis is different from the previous method (and therefore the
value of the variable itself). I think I trust the previous
method more.

Any solutions to the above dilemma? Thanks.

Wei



[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement