diff --git a/diag_manager/README.md b/diag_manager/README.md index 60ab87bbd..ddf0dac68 100644 --- a/diag_manager/README.md +++ b/diag_manager/README.md @@ -1,4 +1,4 @@ -The purpose of this document is to document the differences between the old diag manager and the new (modern) diag manager. +The purpose of this document is to document the differences between the old diag manager and the new (modern) diag manager. ## Contents - [1. Diag Table Format](README.md#1-diag-table-format) @@ -10,7 +10,9 @@ The purpose of this document is to document the differences between the old diag - [7. History files data output "changes"](README.md#7-history-files-data-output-changes) ### 1. Diag Table Format -The modern diag manager uses a YAML format instead of the legacy ascii table. A description of the YAML diag table can be found [here](diag_yaml_format.md). +The modern diag manager uses a YAML format instead of the legacy ascii table. A description of the YAML diag table can +be found [here](diag_yaml_format.md). A formal specification, in the form of a JSON schema, can be found in the +[gfdl_msd_schemas](https://github.com/NOAA-GFDL/gfdl_msd_schemas) repository on Github. ### 2. Scalar Axis The old diag manager was adding a `scalar_axis` dimension of size 1 for scalar variables @@ -70,7 +72,7 @@ This time_bounds variable is refernced as a variable attribute of time: ### 4. Subregional Files #### A. `is_subregional` global attribute: -Subregional files will have a global NetCDF attribute `is_subregional = True` set for non-global history files. This attribute will be used in PP tools. +Subregional files will have a global NetCDF attribute `is_subregional = True` set for non-global history files. This attribute will be used in PP tools. #### B. Subregional dimension names: In some cases, the old diag manager was adding `sub0X` to the dimension names where X is a number greater than 1. This was causing problems in PP tools that were expecting the dimension to have `sub01` in the name. The new diag manager will not have this problem. diff --git a/diag_manager/diag_yaml_format.md b/diag_manager/diag_yaml_format.md index 63ed4630c..d8221956d 100644 --- a/diag_manager/diag_yaml_format.md +++ b/diag_manager/diag_yaml_format.md @@ -14,6 +14,7 @@ The purpose of this document is to explain the diag_table yaml format. - [2.5 Global Meta Data Section](diag_yaml_format.md#25-global-meta-data-section) - [2.6 Sub_region Section](diag_yaml_format.md#26-sub_region-section) - [3. More examples](diag_yaml_format.md#3-more-examples) +- [4. Schema](diag_yaml_format.md#4-schema) ### 1. Converting from legacy ascii diag_table format @@ -340,3 +341,8 @@ diag_files: unlimdim: records write_file: false ``` + +### 4. Schema +A formal specification of the file format, in the form of a JSON schema, can be +found in the [gfdl_msd_schemas](https://github.com/NOAA-GFDL/gfdl_msd_schemas) +repository on Github. diff --git a/diag_manager/schema.diag b/diag_manager/schema.diag deleted file mode 100644 index b232577ff..000000000 --- a/diag_manager/schema.diag +++ /dev/null @@ -1,141 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "required": ["title", "base_date"], - "additionalProperties": false, - "properties": { - "title": { - "type": "string" - }, - "base_date": { - "type": "string" - }, - "diag_files": { - "type": "array", - "items": { - "type": "object", - "required": ["file_name", "freq", "time_units", "unlimdim"], - "additionalProperties": false, - "properties": { - "file_name": { - "type": "string" - }, - "freq": { - "anyOf": [ - {"type": "string"}, - {"type": "number"} - ], - "pattern": "^-[1]{1,1} *[ seconds| minutes| hours| days| months| years]*|^0&|^[1-9]+ [seconds|minutes|hours|days|months|years]{1,1}" - }, - "time_units": { - "type": "string", - "enum": ["seconds", "minutes", "hours", "days", "months", "years"] - }, - "unlimdim": { - "type": "string" - }, - "write_file": { - "type": "boolean" - }, - "global_meta": { - }, - "sub_region": { - "type": "array", - "minItems": 1, - "maxItems": 1, - "required": ["grid_type", "corner1", "corner2", "corner3", "corner4"], - "properties": { - "grid_type": { - "type": "string", - "enum": ["indices", "latlon"] - }, - "corner1": { - "type": "array", - "minItems": 2, - "maxItems": 2, - "items": { - "type": "number" - } - }, - "corner2": { - "type": "array", - "minItems": 2, - "maxItems": 2, - "items": { - "type": "number" - } - }, - "corner3": { - "type": "array", - "minItems": 2, - "maxItems": 2, - "items": { - "type": "number" - } - }, - "corner4": { - "type": "array", - "minItems": 2, - "maxItems": 2, - "items": { - "type": "number" - } - }, - "tile": { - "type": "number" - } - } - }, - "new_file_freq": { - "type": "string", - "pattern": "[0-9]{1,} [a-z]{1,}" - }, - "start_time": { - "type": "string" - }, - "file_duration": { - "type": "string" - }, - "varlist": { - "type": "array", - "items": { - "type": "object", - "required": ["var_name", "reduction", "module", "kind"], - "additionalProperties": false, - "properties": { - "kind": { - "type": "string", - "enum": ["r4", "r8", "i4", "i8"] - }, - "module": { - "type": "string" - }, - "reduction": { - "type": "string", - "pattern": "^average$|^min$|^max$|^none$|^rms$|^sum$|^diurnal[1-9]+|^pow[1-9]+" - }, - "var_name": { - "type": "string" - }, - "write_var": { - "type": "boolean" - }, - "output_name": { - "type": "string" - }, - "long_name": { - "type": "string" - }, - "attributes": { - }, - "zbounds": { - "type": "string" - } - } - } - } - } - } - } - } -}