Skip to content

Update required input variables for CMIP7 derived variables #2984

@bouweandela

Description

@bouweandela

Derived variables specify which input variables they need for the derivation. In many cases this will work just fine for CMIP7, but in some cases, this will need to be updated.

For example, the CMIP7 project may not be one of the available options:

def required(project):
"""Declare the variables needed for derivation."""
if project == "CMIP5":
required = [{"short_name": "msftmyz", "mip": "Omon"}]
elif project == "CMIP6":
required = [
{"short_name": "msftmz", "optional": True},
{"short_name": "msftyz", "optional": True},
]
else:
msg = f"Project {project} can not be used for Amoc derivation."
raise ValueError(msg)

Or the mip needs to be updated:

def required(project): # noqa: ARG004
"""Declare the variables needed for derivation."""
return [{"short_name": "hfls", "mip": "Amon"}]

(would need to be atmos for CMIP7)

Or if, if some of the input variables have a different branding suffix, a special entry for CMIP7 with a branding suffix may need to be added:

def required(project: str) -> list[Facets]:
"""Declare the variables needed for derivation."""
sftlf: Facets = {"short_name": "sftlf", "mip": "fx"}
if project == "CMIP5":
sftlf["ensemble"] = "r0i0p0"
return [
{"short_name": "baresoilFrac"},
{"short_name": "residualFrac"},
sftlf,
]

(would need to be sftlf: Facets = {"short_name": "sftlf", "branding_suffix": "ti-u-hxy-u", "mip": "atmos"} for CMIP7)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions