From 1365b39198de91f6cd54ccbbac5ff38aa4277168 Mon Sep 17 00:00:00 2001 From: Christina Holt <56881914+christinaholtNOAA@users.noreply.github.com> Date: Fri, 16 Aug 2024 12:46:00 -0600 Subject: [PATCH] Add missing namelist option to UPP Schema. (#576) User reported missing namelist option in JSON Schema. This fixes that omission. It also adds the new option for submodelname = MPAS to the enum list. This will be an upcoming addition to UPP. --- docs/sections/user_guide/yaml/components/upp.rst | 2 +- docs/shared/upp.yaml | 1 + recipe/meta.json | 2 +- src/uwtools/resources/info.json | 2 +- src/uwtools/resources/jsonschema/upp.jsonschema | 7 +++++++ src/uwtools/tests/test_schemas.py | 4 ++++ 6 files changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/sections/user_guide/yaml/components/upp.rst b/docs/sections/user_guide/yaml/components/upp.rst index 8da54286b..1f7e5cc4c 100644 --- a/docs/sections/user_guide/yaml/components/upp.rst +++ b/docs/sections/user_guide/yaml/components/upp.rst @@ -45,7 +45,7 @@ The following namelists and variables can be customized: * - Namelist - Variables * - ``model_inputs`` - - ``datestr``, ``filename``, ``filenameflat``, ``filenameflux``, ``grib``, ``ioform``, ``modelname`` + - ``datestr``, ``filename``, ``filenameflat``, ``filenameflux``, ``grib``, ``ioform``, ``modelname``, ``submodelname`` * - ``nampgb`` - ``aqf_on``, ``d2d_chem``, ``d3d_on``, ``filenameaer``, ``gccpp_on``, ``gocart_on``, ``gtg_on``, ``hyb_sigp``, ``kpo``, ``kpv``, ``kth``, ``method_blsn``, ``nasa_on``, ``numx``, ``po``, ``popascal``, ``pv``, ``rdaod``, ``slrutah_on``, ``th``, ``vtimeunits``, ``write_ifi_debug_files`` diff --git a/docs/shared/upp.yaml b/docs/shared/upp.yaml index c9cf33b5e..769212bad 100644 --- a/docs/shared/upp.yaml +++ b/docs/shared/upp.yaml @@ -27,6 +27,7 @@ upp: grib: grib2 ioform: netcdf modelname: FV3R + submodelname: RTMA nampgb: kpo: 3 numx: 1 diff --git a/recipe/meta.json b/recipe/meta.json index 704f97e1c..c37b5486b 100644 --- a/recipe/meta.json +++ b/recipe/meta.json @@ -33,5 +33,5 @@ "pyyaml =6.0.*" ] }, - "version": "2.4.0" + "version": "2.4.1" } diff --git a/src/uwtools/resources/info.json b/src/uwtools/resources/info.json index a65c42fdf..3fc5690e5 100644 --- a/src/uwtools/resources/info.json +++ b/src/uwtools/resources/info.json @@ -1,4 +1,4 @@ { - "version": "2.4.0", + "version": "2.4.1", "buildnum": "0" } diff --git a/src/uwtools/resources/jsonschema/upp.jsonschema b/src/uwtools/resources/jsonschema/upp.jsonschema index 8393b5a9c..1ca647919 100644 --- a/src/uwtools/resources/jsonschema/upp.jsonschema +++ b/src/uwtools/resources/jsonschema/upp.jsonschema @@ -74,6 +74,13 @@ "NMM" ], "type": "string" + }, + "submodelname": { + "enum": [ + "MPAS", + "RTMA" + ], + "type": "string" } }, "type": "object" diff --git a/src/uwtools/tests/test_schemas.py b/src/uwtools/tests/test_schemas.py index 256d57c8f..d270d5cc2 100644 --- a/src/uwtools/tests/test_schemas.py +++ b/src/uwtools/tests/test_schemas.py @@ -1956,6 +1956,10 @@ def test_schema_upp_namelist(upp_prop): assert "not one of ['FV3R', '3DRTMA', 'GFS', 'RAPR', 'NMM']" in errors( {"update_values": {"model_inputs": {"modelname": "foo"}}} ) + # model_inputs: Only certain submodelname values are supported: + assert "not one of ['MPAS', 'RTMA']" in errors( + {"update_values": {"model_inputs": {"submodelname": "foo"}}} + ) # model_inputs: No other keys are supported: assert "Additional properties are not allowed" in errors( {"update_values": {"model_inputs": {"something": "else"}}}