# Re: [ferret_users] mm/day to mm/month

Dear Russel,

The units of my time axis arent in days, so the pseudo variable is not working.

yes? sh axis/l=1:2 time
name       axis              # pts   start                end
TIME      TIME               360 r   15-JAN-1961 12:00    16-DEC-1990 08:06
T0 = 15-JAN-1961 12:00:00
Axis span (to cell edges) = 360

L     T                   TBOX      TBOXLO                TSTEP (months)
1>  15-JAN-1961 12:00:00  1         31-DEC-1960 06:45:27  0
2>  14-FEB-1961 22:29:06  1         30-JAN-1961 17:14:33  1

I created the new variables to define the number of days in each month, but i realized that February 1961 has 29 days, which is false.

On Fri, May 22, 2009 at 2:46 AM, Russell Fiedler <russell.fiedler@xxxxxxxx> wrote:

Peter,

If the data is on a monthly grid multiply by the tbox pseudo variable
associated with the data (if the units are days).

let precip_mm_month = precip*tbox[gt=precip]

alternatively create a new variable

let    YEAR =INT((L-1)/12)
let    MON = MOD(L-1,12)+1
let    DAYS_IN_MONTH = DAYS1900(YEAR[L=@shf:1],MON[l=@shf:1],1)-DAYS1900
(YEAR,MON,1)

let precip_mm_month = precip*days_in_month[gt=precip@asn]

On Thursday 21 May 2009 19:58, you wrote:
> Dear Users,
>
> i have monthly precipitation data set (360 time slices) in format of
> mm/day. It's on a gregorian calendar and i would like to have the data
> values in mm/month. I know, i should multiple the fields by 28/29/30/31. Is
> there a good solution to do that instead of a REPEAT command?
>
> Thanks, Peter