[Thread Prev][Thread Next][Index]

Method to obtain annually summed variables

I wrote about 2 months ago to ask for help in writing a script that would
create an annually summed variable out of monthly data. Steve Hankin
helped me on this, but I still couldn't solve it -- I kept on losing the
first or last years. I am writing now to present the commands where I've
implemented this. This is different from a script presented in the Ferret
Manual, where the variable is *written* to a netcdf file. In my opinion,
creating a variable gives more flexibility.

Say you have a variable "PPT" of monthly values, defined from 1983 to
1989. The trick is that the first point in the T definition must be
*exactly* the midpoint in the year; otherwise the first or the last years
are lost. When I use T=30-jun-1983, the first year is lost; and with
T=1-jul-1983, the last year is lost. Then:

DEFINE AXIS/T="30-jun-1983:17:00":"1-jun-1989":1/UNITS=year tannual
LET PPT_YR = PPT[GT=tannual@SUM]

I hope someone finds this useful. And thanks, Steve.

Emilio Mayorga
University of Washington	
School of Oceanography			emiliom@u.washington.edu
Box 357940				ph. (206) 543-5334
Seattle, WA  98195-7940	  USA		FAX (206) 685-3351

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement