# Re: Cyclic variables

Steve Hankin (hankin@rogue.pmel.noaa.gov)
Tue, 4 Jul 1995 23:09:05 -0700 (PDT)

```Hi Harvey,

Since we have been using "cyclic" (or "modulo", as we call them)
netCDF coordinate axes for several years I thought I'd just add
in a few words of support for your standardization efforts.

On Mon, 3 Jul 1995, Harvey DAVIES wrote:

> Some variables are cyclic.
>
> A common example is longitude which has a cycle of 360 degrees.  This means
> that (assuming unit="degrees_east") one should treat a value of 360 as
> equivalent to 0, -180 as equivalent to 180, etc.  In other words the value
> should be treated as modulo 360.
>
> How should such variables be handled by netCDF?
>
> I propose that:
>
> 1. There be a new standard conventional attribute called "cycle_length",
>    (or perhaps "modulus") giving the cycle length (in the units defined by
>    attribute "units").

In this vein we use the attribute "modulo" as a boolean -- if the "modulo"
attribute is present then the axis length is the assumed to be the cycle
length.  Your solution is more general (and a little more complex).

> 2. The unit "degrees_east" (and equivalents degree_east, degreeE, degree_E,
>    degreesE, degrees_E) should imply cycle_length=360.

If we're talking about a general standard then I think we need to
be a little careful with automatic inferences like this.  Perhaps, for
example, the variable defined on this
longitude axis has been integrated in longitude (dx).  Then a cyclic look at
the variable might be inappropriate.  The beauty of the "cycle_length"
(or "modulo") attribute from "1." is that it voluntarily informs
applications that a modulo interpretation is appropriate.

> Note that I consider it better to identify longitude from the unit rather
> than the variable name (which could be "lon", "longitude", etc.)

agreed -- and, I think, consistent with the netCDF U.G. suggestions.

> One could consider 'cyclicity' to be a property of the unit.  It would be
> possible to include in the units database file ('udunits.dat') a new field
> giving the cycle, if any.  However I am inclined to feel this is not really
> necessary and would be more trouble than it is worth.  I am not aware of any
> common units other than "degrees_east" which should always be treated as
> cyclic, although there may well be some.

The situation also arises in the case of climatological (1 year) time
axes.  There is insufficient standardization of this important special
case, too.  In the COARDS conventions (see netCDF anonymous ftp) you'll
find one solution to this is to agree that dates in the year 0000 or 0001
are, in fact climatological dates.  This convention is imperfect,
however, if the goal is for the file to be self-evident and self-describing.

cheers - steve

|  NOAA/PMEL               |  ph. (206) 526-6080
Steve Hankin	|  7600 Sand Point Way NE  |  FAX (206) 526-6744
|  Seattle, WA 98115-0070  |  hankin@pmel.noaa.gov
```