From 5f1b3b57f8280468a0b0c2e6f4c9e6109ca8d5cf Mon Sep 17 00:00:00 2001 From: Joshua Torrance Date: Tue, 17 Mar 2026 11:58:01 +1100 Subject: [PATCH 01/10] 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 02/10] 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 From 7169d5ea4ae26feee13ef2759cc6fea8ee9ab966 Mon Sep 17 00:00:00 2001 From: Joshua Torrance Date: Mon, 23 Mar 2026 15:05:01 +1100 Subject: [PATCH 03/10] Now supporting alternative calendar options from CF. --- .../output/file-metadata/2-1-0/variable/time.json | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 7d3b496..65357e0 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 @@ -12,7 +12,20 @@ "const": "time_bnds" }, "calendar": { - "const": "proleptic_gregorian" + "description": "Calendar defines the set of valid datetimes and their order. Follows the CF-Convention names using lower-case strings. It is recommended that \"proleptic_calendar\" is used.", + "type": "string", + "enum": [ + "standard", + "julian", + "proleptic_gregorian", + "no_leap", + "365_day", + "all_leap", + "366_day", + "360_day", + "utc", + "tai" + ] }, "long_name": { "const": "time" From ac9e56b9b6ee6b6a0d1a1b0053830e9484f5030e Mon Sep 17 00:00:00 2001 From: Joshua Torrance Date: Tue, 24 Mar 2026 12:39:08 +1100 Subject: [PATCH 04/10] Added required to time --- .../model/output/file-metadata/2-1-0/variable/time.json | 8 ++++++++ 1 file changed, 8 insertions(+) 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 65357e0..393ebca 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 @@ -4,6 +4,14 @@ "title": "time", "description": "The time variable for the dataset.", "type": "object", + "required": [ + "axis", + "bounds", + "calendar", + "long_name", + "standard_name", + "units" + ], "properties": { "axis": { "const": "T" From 6cc5cd3881145f509d4af1a1b2b5f0bcd2a0ab1d Mon Sep 17 00:00:00 2001 From: Joshua Torrance Date: Wed, 25 Mar 2026 16:05:27 +1100 Subject: [PATCH 05/10] Moved non-const time attrs into sub-schemas --- .../file-metadata/2-1-0/variable/time.json | 24 ++----------------- .../2-1-0/variable/time/calendar.json | 19 +++++++++++++++ .../2-1-0/variable/time/units.json | 13 ++++++++++ 3 files changed, 34 insertions(+), 22 deletions(-) create mode 100644 au.org.access-nri/model/output/file-metadata/2-1-0/variable/time/calendar.json create mode 100644 au.org.access-nri/model/output/file-metadata/2-1-0/variable/time/units.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 index 393ebca..e4f8b51 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 @@ -20,20 +20,7 @@ "const": "time_bnds" }, "calendar": { - "description": "Calendar defines the set of valid datetimes and their order. Follows the CF-Convention names using lower-case strings. It is recommended that \"proleptic_calendar\" is used.", - "type": "string", - "enum": [ - "standard", - "julian", - "proleptic_gregorian", - "no_leap", - "365_day", - "all_leap", - "366_day", - "360_day", - "utc", - "tai" - ] + "$ref": "time/calendar.json" }, "long_name": { "const": "time" @@ -42,14 +29,7 @@ "const": "time" }, "units": { - "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](:[0-5][0-9])?)?$" + "$ref": "time/units.json" } }, "additionalProperties": false diff --git a/au.org.access-nri/model/output/file-metadata/2-1-0/variable/time/calendar.json b/au.org.access-nri/model/output/file-metadata/2-1-0/variable/time/calendar.json new file mode 100644 index 0000000..2c5accb --- /dev/null +++ b/au.org.access-nri/model/output/file-metadata/2-1-0/variable/time/calendar.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "variable/time/calendar.json", + "title": "calendar", + "description": "Calendar defines the set of valid datetimes and their order. Follows the CF-Convention names using lower-case strings. It is recommended that \"proleptic_calendar\" is used.", + "type": "string", + "enum": [ + "standard", + "julian", + "proleptic_gregorian", + "no_leap", + "365_day", + "all_leap", + "366_day", + "360_day", + "utc", + "tai" + ] +} diff --git a/au.org.access-nri/model/output/file-metadata/2-1-0/variable/time/units.json b/au.org.access-nri/model/output/file-metadata/2-1-0/variable/time/units.json new file mode 100644 index 0000000..ccbc1c3 --- /dev/null +++ b/au.org.access-nri/model/output/file-metadata/2-1-0/variable/time/units.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "variable/time/units.json", + "title": "units", + "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](:[0-5][0-9])?)?$" +} From 3d7b31f2b00a5a41569f1badaea1c6154a50204d Mon Sep 17 00:00:00 2001 From: Joshua Torrance Date: Wed, 25 Mar 2026 16:40:14 +1100 Subject: [PATCH 06/10] Added type to time units --- .../model/output/file-metadata/2-1-0/variable/time/units.json | 1 + 1 file changed, 1 insertion(+) diff --git a/au.org.access-nri/model/output/file-metadata/2-1-0/variable/time/units.json b/au.org.access-nri/model/output/file-metadata/2-1-0/variable/time/units.json index ccbc1c3..a358c57 100644 --- a/au.org.access-nri/model/output/file-metadata/2-1-0/variable/time/units.json +++ b/au.org.access-nri/model/output/file-metadata/2-1-0/variable/time/units.json @@ -9,5 +9,6 @@ "days since 1970-01-01", "days since -5000-12-25" ], + "type": "string", "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])?)?$" } From 211ad1b4d7bb3e1b05a9d388600aab6d98be1a70 Mon Sep 17 00:00:00 2001 From: Joshua Torrance Date: Wed, 25 Mar 2026 16:43:50 +1100 Subject: [PATCH 07/10] Added additional tests. These won't be run yet, should run after merge from neighbouring branch '66-model-ouput-adding-geospatial' --- tests/2-1-0/variable/test_time.json | 40 ++++++++++++++++++++ tests/2-1-0/variable/time/test_calendar.json | 25 ++++++++++++ tests/2-1-0/variable/time/test_units.json | 40 ++++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 tests/2-1-0/variable/test_time.json create mode 100644 tests/2-1-0/variable/time/test_calendar.json create mode 100644 tests/2-1-0/variable/time/test_units.json diff --git a/tests/2-1-0/variable/test_time.json b/tests/2-1-0/variable/test_time.json new file mode 100644 index 0000000..21a0ad8 --- /dev/null +++ b/tests/2-1-0/variable/test_time.json @@ -0,0 +1,40 @@ +{ + "target": "../../../au.org.access-nri/model/output/file-metadata/2-1-0/variable/time.json", + "tests": [ + { + "description": "Full valid time variable", + "valid": true, + "data": { + "axis": "T", + "bounds": "time_bnds", + "calendar": "proleptic_gregorian", + "long_name": "time", + "standard_name": "time", + "units": "days since 0000-01-01" + } + }, + { + "description": "Missing required (long_name)", + "valid": false, + "data": { + "axis": "T", + "bounds": "time_bnds", + "calendar": "proleptic_gregorian", + "standard_name": "time", + "units": "days since 0000-01-01" + } + }, + { + "description": "Const doesn't match", + "valid": false, + "data": { + "axis": "T", + "bounds": "time_bounds", + "calendar": "proleptic_gregorian", + "long_name": "time", + "standard_name": "time", + "units": "days since 0000-01-01" + } + } + ] +} diff --git a/tests/2-1-0/variable/time/test_calendar.json b/tests/2-1-0/variable/time/test_calendar.json new file mode 100644 index 0000000..c011919 --- /dev/null +++ b/tests/2-1-0/variable/time/test_calendar.json @@ -0,0 +1,25 @@ +{ + "target": "../../../../au.org.access-nri/model/output/file-metadata/2-1-0/variable/time/calendar.json", + "tests": [ + { + "description": "Valid calendar", + "valid": true, + "data": "proleptic_gregorian" + }, + { + "description": "Valid calendar but capitalised", + "valid": false, + "data": "PROLEPTIC_GREGORIAN" + }, + { + "description": "Invalid calendar", + "valid": false, + "data": "invalid_calendar" + }, + { + "description": "Not even a string", + "valid": false, + "data": 6 + } + ] +} diff --git a/tests/2-1-0/variable/time/test_units.json b/tests/2-1-0/variable/time/test_units.json new file mode 100644 index 0000000..0a202d9 --- /dev/null +++ b/tests/2-1-0/variable/time/test_units.json @@ -0,0 +1,40 @@ +{ + "target": "../../../../au.org.access-nri/model/output/file-metadata/2-1-0/variable/time/units.json", + "tests": [ + { + "description": "Valid units for time", + "valid": true, + "data": "days since 0001-01-01 00:00:00" + }, + { + "description": "Valid units for time - no seconds", + "valid": true, + "data": "days since 0001-01-01 00:00" + }, + { + "description": "Valid units for time - no time", + "valid": true, + "data": "days since 0001-01-01" + }, + { + "description": "Invalid units for time - not real time", + "valid": false, + "data": "days since 0001-01-01 00:00:61" + }, + { + "description": "Invalid units for time - not days", + "valid": false, + "data": "seconds since 0001-01-01 00:00:00" + }, + { + "description": "Invalid units for time", + "valid": false, + "data": "not even close to valid" + }, + { + "description": "Invalid units for time - not a string", + "valid": false, + "data": 5 + } + ] +} From 0cee882ed3585d9b3c078b79af53373e3007d329 Mon Sep 17 00:00:00 2001 From: Joshua Torrance Date: Fri, 27 Mar 2026 16:08:15 +1100 Subject: [PATCH 08/10] Removed bounds from the required list. --- .../model/output/file-metadata/2-1-0/variable/time.json | 1 - 1 file changed, 1 deletion(-) 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 e4f8b51..bce0f45 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 @@ -6,7 +6,6 @@ "type": "object", "required": [ "axis", - "bounds", "calendar", "long_name", "standard_name", From c2368ecbe26217a8d4825d57d398d699d972370e Mon Sep 17 00:00:00 2001 From: Joshua Torrance Date: Fri, 27 Mar 2026 16:09:05 +1100 Subject: [PATCH 09/10] Added a test for missing bounds --- tests/2-1-0/variable/test_time.json | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/2-1-0/variable/test_time.json b/tests/2-1-0/variable/test_time.json index 21a0ad8..0b8b407 100644 --- a/tests/2-1-0/variable/test_time.json +++ b/tests/2-1-0/variable/test_time.json @@ -13,6 +13,17 @@ "units": "days since 0000-01-01" } }, + { + "description": "Full valid time variable without bounds", + "valid": true, + "data": { + "axis": "T", + "calendar": "proleptic_gregorian", + "long_name": "time", + "standard_name": "time", + "units": "days since 0000-01-01" + } + }, { "description": "Missing required (long_name)", "valid": false, From bc3051d78841fe004b08fe4624666860c6c9bea7 Mon Sep 17 00:00:00 2001 From: Joshua Torrance Date: Fri, 27 Mar 2026 17:34:05 +1100 Subject: [PATCH 10/10] Updated calendar recommendations. @blimlim & @aidanheerdegen --- .../output/file-metadata/2-1-0/variable/time/calendar.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/au.org.access-nri/model/output/file-metadata/2-1-0/variable/time/calendar.json b/au.org.access-nri/model/output/file-metadata/2-1-0/variable/time/calendar.json index 2c5accb..0109b53 100644 --- a/au.org.access-nri/model/output/file-metadata/2-1-0/variable/time/calendar.json +++ b/au.org.access-nri/model/output/file-metadata/2-1-0/variable/time/calendar.json @@ -2,7 +2,7 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "variable/time/calendar.json", "title": "calendar", - "description": "Calendar defines the set of valid datetimes and their order. Follows the CF-Convention names using lower-case strings. It is recommended that \"proleptic_calendar\" is used.", + "description": "Calendar defines the set of valid datetimes and their order. Follows the CF-Convention names using lower-case strings. It is recommended that \"proleptic_gregorian\" is used for data with leap days and \"no_leap\"/\"365_day\" for data without leap days.", "type": "string", "enum": [ "standard",