ioos/compliance-checker

Improve CF Conformance: 4.4 Time Coordinate

jamesdoyle21 opened this issue · 4 comments

4.4 Time Coordinate
Requirements:

  • The time units of a time coordinate variable must contain a reference date/time.

  • The reference date/time of a time coordinate variable must be a legal date/time in the specified calendar.

  • The reference date/time in time units is not allowed to contain seconds equal to or greater than 60.

Note can't fine a check for the above mentioned requirement.

Recommendations:

  • The use of time coordinates in year 0 and reference date/times in year 0 to indicate climatological time is deprecated.

  • Units of year and month and any equivalent units should be used with caution.

under TODO: year zero climatological time warning

@ocefpaf, do you know where the format for reference times is documented? I occasionally have seen reference times such as "seconds since 2009-8-1 08:5:6" used, and indeed, cftime will parse these, but they are not ISO 8601 compliant. I'm going to make a best guess based upon what I think it expects unless I can find something in source code or documentation.

@ocefpaf, do you know where the format for reference times is documented?

I'm not sure if there is a clear documentation on the best practice for the reference time. You probably already found this in the udunits2 but let me post it here to help our discussion:

https://github.com/Unidata/UDUNITS-2/blob/c83da987387db1174cd2266b73dd5dd556f4476b/lib/udunits2lib.texi#L1554-L1564

When you throw in the mix the paleo and climate calendars that are support by CF it makes this even harder to check.

I don't know what CC does at the moment but maybe checking for consistency of the metadata should be a second part of the implementation and the first would we could focus on checking the individual metadata. For example,

double time(time) ;
  time:long_name = "time" ;
  time:units = "days since 1-1-1 0:0:0" ;
  time:calendar = "126 kyr B.P." ;
  time:month_lengths = 34, 31, 32, 30, 29, 27, 28, 28, 28, 32, 32, 34 ;

is valid. If I change the calendar to Gregorian, that is wrong. But should CC catch that? Or CC should just report that all the individual fields are correct? Without warning on their consistency. (Does that make sense?)

I don't see that CF provides guidance on month lengths being present when a standard calendar is used, despite these calendars having a more or less fixed month length, leap years notwithstanding.

Closed by #1014