[Thread Prev][Thread Next][Index]

Re: [ferret_users] modulo=0 ?



Hi Ryo,
I would have expected that to be in the standards as well.

There's brief mention of "modulo" in the COARDS standard, but not a modulo attribute.  As is mentioned in the cf-trac discussion you've found, this attribute has been widely used in Ferret and elsewhere for a very long time.

modulo=0 is used as a shorthand for "modulo property enabled".  I think this is purely a Ferret thing, and so is not portable, and frankly not very intuitive.  Probably what should instead be listed in the attribute is the actual length of the axis as defined.  Note the "axis span" shown here - this is what is used in modulo calculations.

yes? define axis/t0=1-JAN-0001/calendar=noleap/edges/t=0:365/npoints=73\
     /units=days/MODULO pntd

yes? show axis/t pntd
 name       axis              # pts   start                end
 PNTD      TIME                73mr   03-JAN 12:00         29-DEC 12:00
T0 = 1-JAN-0001
CALENDAR = NOLEAP
   Axis span (to cell edges) = 365 (modulo length = axis span)
 
       L     T                   TBOX      TBOXLO                TSTEP (DAYS)
       1>  03-JAN 12:00:00       5          01-JAN 00:00:00         2.5
       2>  08-JAN 12:00:00       5          06-JAN 00:00:00         7.5
       3>  13-JAN 12:00:00       5          11-JAN 00:00:00         12.5
       4>  18-JAN 12:00:00       5          16-JAN 00:00:00         17.5
       5>  23-JAN 12:00:00       5          21-JAN 00:00:00         22.5
       6>  28-JAN 12:00:00       5          26-JAN 00:00:00         27.5
       7>  02-FEB 12:00:00       5          31-JAN 00:00:00         32.5
       8>  07-FEB 12:00:00       5          05-FEB 00:00:00         37.5
       9>  12-FEB 12:00:00       5          10-FEB 00:00:00         42.5
      10>  17-FEB 12:00:00       5          15-FEB 00:00:00         47.5

...




On 9/24/2020 8:46 PM, Ryo Furue wrote:
Dear Ferret users and developers,

I was wondering how the modulo=0 setting is interpreted by Ferret and how common this convention is.

I tried to look up how modulo is defined in the CF convention and was a bit surprised that it's not included in it.  (Please correct me if I'm wrong.)  It seems to have been discussed for a long time without reaching a consensus:

   https://cf-trac.llnl.gov/trac/ticket/95

In this context, I'm interested that when modulo is specified without a value, like so

define axis/t0=1-JAN-0001/calendar=noleap/edges/t=0:365/npoints=73\
     /units=days/MODULO pntd

Ferret saves this axis into a netCDF file with

    PNTD:modulo = 0.f ;

The above time axis has gridpoints at t = 2.5, 7.5, . . . , 362.5 . Does this mean that

1) the span + Δt is taken as the modulo value?  If so,
       modulo = 362.5 - 2.5 + 5 = 365.

2) the calendar year is taken as the modulo value? In this case also modulo = 365.

Which is the case?  For the above particular case, the result is the same, but for other axes, the results will be different.

Also, is modulo=0 a widely used convention?  or is it only Ferret?

Best regards,
Ryo


-- 
Ansley Manke
Science Data Integration Group
NOAA Pacific Marine Environmental Laboratory
7600 Sand Point Way NE
Seattle WA 98115

I am currently teleworking and am available Tue-Wed-Thu.

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement