Skip to content

Commit

Permalink
add logic to set realm from pod global_env_vars if provided instead o…
Browse files Browse the repository at this point in the history
…f assuming realm attribute is defined for each pod variable (#598)
  • Loading branch information
wrongkindofdoctor authored Jun 20, 2024
1 parent 0e87523 commit ed3875b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/varlist_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ def from_struct(cls, global_settings_d, dims_d, name, parent, **kwargs):
new_kw = global_settings_d.copy()
new_kw['coords'] = []
new_kw['convention'] = parent.pod_settings.get('convention', 'cmip')
if parent.pod_settings.get('realm', None) is not None:
new_kw['realm'] = parent.pod_settings.get('realm') # populated if realm defined in pod_env_vars instead
# of an attribute for each POD variable
if 'dimensions' not in kwargs:
raise ValueError(f"No dimensions specified for Varlist entry {name}.")
# validate: check for duplicate coord names
Expand Down

0 comments on commit ed3875b

Please sign in to comment.