Skip to content

Commit

Permalink
Pad the year in time.reference_date with zeros (see #533)
Browse files Browse the repository at this point in the history
CF conventions say that the form of the reference date is defined by UDUNITS.

UDUNITS says that the "date" in "time_unit since date" has the form be Y-M-D, where

- Y consists of 1,2,3 or 4 digits,
- M is (possibly zero-padded) month number
- D is (possibly zero-padded) day number

PISM uses UDUNITS and CalCalcs by David W. Pierce to handle time units, but CalCalcs
does *not* parse units strings itself (it uses the "ut_unit" data type from UDUNITS), so
zero-padding will not affect PISM's use of CalCalcs.

In summary: zero-padding years in the reference date should not affect anything except
xarray.
  • Loading branch information
ckhroulev committed Jan 9, 2024
1 parent 1d89636 commit d463d41
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pism_config.cdl
Original file line number Diff line number Diff line change
Expand Up @@ -2714,7 +2714,7 @@ netcdf pism_config {
pism_config:time.holocene_start_type = "number";
pism_config:time.holocene_start_units = "years";

pism_config:time.reference_date = "1-1-1";
pism_config:time.reference_date = "0001-1-1";
pism_config:time.reference_date_doc = "year-month-day; reference date used for calendar computations and in PISM output files";
pism_config:time.reference_date_type = "string";

Expand Down

0 comments on commit d463d41

Please sign in to comment.