define a scalar as a datetime
Requitement:
XIOS can record a defined forecast_reference_time as a scalar, the defined time which the model run considers as T0. XIOS can encode a scalar and include this in the grid, which is great and simple to use. But, to record a datetime, the user must calculate how to transform a date into a relevant value & encode a unit of measure to meet CF Conventions. Even after this, there appears to be no mechanism to attach a calendar. This is error / inconsistency prone and still leaves a definition which does not meet CF metadata compliance.
There is a neat implementation option, which we'd like to explore from a design perspective with you:
"The ability to set an XIOS scalar to a datetime value using a new date attribute. XIOS converts this to a double using the file time unit and calendar time origin. It also adds unit and calendar metadata similar to the default time axes time_instant, time_counter and time_centered."
This date could be limited to just the scalar type. it could be implemented used within XML and within Fortran interfaces. In this way, a newly created scalar, such as forecast_reference_time could be declared within XML, but not configured, then a date set with an xios_set_scalar_attr call in the Fortran, passing in an XIOS date known to the model as the T0 definition. XIOS then handles the unit, calendar and consistency with other time coordinates.
desired outcome:
variables:
double forecast_reference_time ;
forecast_reference_time:name = "forecast_reference_time" ;
forecast_reference_time:standard_name = "forecast_reference_time" ;
forecast_reference_time:calendar = "gregorian" ;
forecast_reference_time:units = "seconds since 2022-12-12 12:00:00" ;
forecast_reference_time:time_origin = "2022-12-12 12:00:00" ;
data:
forecast_reference_time = 129600 ;
Does this seem like a useful feature and sensible design?
Would you like us to propose an implementation?
(this issue was migrated from trac https://forge.ipsl.fr/ioserver/ticket/211)