From 5f1b3b57f8280468a0b0c2e6f4c9e6109ca8d5cf Mon Sep 17 00:00:00 2001 From: Joshua Torrance Date: Tue, 17 Mar 2026 11:58:01 +1100 Subject: [PATCH 1/2] Added time and time_bnds --- .../output/file-metadata/2-1-0/2-1-0.json | 8 +++++ .../file-metadata/2-1-0/variable/time.json | 34 +++++++++++++++++++ .../2-1-0/variable/time_bnds.json | 7 ++++ tests/2-1-0/test.json | 10 ++++++ 4 files changed, 59 insertions(+) create mode 100644 au.org.access-nri/model/output/file-metadata/2-1-0/variable/time.json create mode 100644 au.org.access-nri/model/output/file-metadata/2-1-0/variable/time_bnds.json diff --git a/au.org.access-nri/model/output/file-metadata/2-1-0/2-1-0.json b/au.org.access-nri/model/output/file-metadata/2-1-0/2-1-0.json index ed32c50..9c40887 100644 --- a/au.org.access-nri/model/output/file-metadata/2-1-0/2-1-0.json +++ b/au.org.access-nri/model/output/file-metadata/2-1-0/2-1-0.json @@ -10,6 +10,14 @@ }, "variables": { "type": "object", + "properties": { + "time": { + "$ref": "variable/time.json" + }, + "time_bnds": { + "$ref": "variable/time_bnds.json" + } + }, "patternProperties": { "^.+$": { "$ref": "variable.json" diff --git a/au.org.access-nri/model/output/file-metadata/2-1-0/variable/time.json b/au.org.access-nri/model/output/file-metadata/2-1-0/variable/time.json new file mode 100644 index 0000000..fc458fd --- /dev/null +++ b/au.org.access-nri/model/output/file-metadata/2-1-0/variable/time.json @@ -0,0 +1,34 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "variable/time.json", + "title": "time", + "description": "The time variable for the dataset.", + "type": "object", + "properties": { + "axis": { + "const": "T" + }, + "bounds": { + "const": "time_bnds" + }, + "calendar": { + "const": "proleptic_gregorian" + }, + "long_name": { + "const": "time" + }, + "standard_name": { + "const": "time" + }, + "units": { + "description": "Units for time should be given as \"days since X\" where X is a date or datetime formatted as yyyy-mm-dd (HH:MM).", + "examples": [ + "days since 0001-01-01 00:00", + "days since 1970-01-01", + "days since -5000-12-25" + ], + "pattern": "^days since -?\\d{4}-(1[012]|0[1-9])-(3[01]|[12][0-9]|0[1-9])( ([01][0-9]|2[0-3]):[0-5][0-9])?$" + } + }, + "additionalProperties": false +} diff --git a/au.org.access-nri/model/output/file-metadata/2-1-0/variable/time_bnds.json b/au.org.access-nri/model/output/file-metadata/2-1-0/variable/time_bnds.json new file mode 100644 index 0000000..41147fd --- /dev/null +++ b/au.org.access-nri/model/output/file-metadata/2-1-0/variable/time_bnds.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "variable/time_bnds.json", + "title": "time_bnds", + "description": "The time_bnds variable for the dataset. Note this variable has no attributes.", + "const": {} +} diff --git a/tests/2-1-0/test.json b/tests/2-1-0/test.json index 7191d75..64938b0 100644 --- a/tests/2-1-0/test.json +++ b/tests/2-1-0/test.json @@ -38,6 +38,16 @@ "standard_name": "latitude", "units": "degrees_north", "long_name": "latitude" + }, + "time": { + "axis": "T", + "bounds": "time_bnds", + "calendar": "proleptic_gregorian", + "long_name": "time", + "standard_name": "time", + "units": "days since 0001-01-01 00:00" + }, + "time_bnds": { } } } From 09bf5892a86a23417283a4f64f2385ba898e3bfc Mon Sep 17 00:00:00 2001 From: Joshua Torrance Date: Wed, 18 Mar 2026 13:25:09 +1100 Subject: [PATCH 2/2] Added option for units of reference datetime to have seconds --- .../model/output/file-metadata/2-1-0/variable/time.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/au.org.access-nri/model/output/file-metadata/2-1-0/variable/time.json b/au.org.access-nri/model/output/file-metadata/2-1-0/variable/time.json index fc458fd..7d3b496 100644 --- a/au.org.access-nri/model/output/file-metadata/2-1-0/variable/time.json +++ b/au.org.access-nri/model/output/file-metadata/2-1-0/variable/time.json @@ -21,13 +21,14 @@ "const": "time" }, "units": { - "description": "Units for time should be given as \"days since X\" where X is a date or datetime formatted as yyyy-mm-dd (HH:MM).", + "description": "Units for time should be given as \"days since X\" where X is a date (yyyy-mm-dd) or a datetime (yyyy-mm-dd HH:MM or yyyy-mm-dd HH:MM:SS)", "examples": [ + "days since 0001-01-01 00:00:00", "days since 0001-01-01 00:00", "days since 1970-01-01", "days since -5000-12-25" ], - "pattern": "^days since -?\\d{4}-(1[012]|0[1-9])-(3[01]|[12][0-9]|0[1-9])( ([01][0-9]|2[0-3]):[0-5][0-9])?$" + "pattern": "^days since -?\\d{4}-(1[012]|0[1-9])-(3[01]|[12][0-9]|0[1-9])( ([01][0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?)?$" } }, "additionalProperties": false