Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the capability to assimilate the MADIS snow depth data from GTS #1836

Merged
merged 13 commits into from
Sep 13, 2023
Merged
23 changes: 11 additions & 12 deletions ush/python/pygfs/task/land_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,6 @@ def prepare_GTS(self) -> None:
logger.info("Copying GTS obs for bufr2ioda.x")
FileHandler(prep_gts_config.gtsbufr).sync()

# generate bufr2ioda YAML files
for name in ["adpsfc", "snocvr"]:
gts_yaml = os.path.join(self.runtime_config.DATA, f"bufr_{name}_snow.yaml")
logger.info(f"Generate BUFR2IODA YAML file: {gts_yaml}")
temp_yaml = parse_j2yaml(prep_gts_config.bufr2ioda[name], localconf)
save_as_yaml(temp_yaml, gts_yaml)
logger.info(f"Wrote bufr2ioda YAML to: {gts_yaml}")

logger.info("Link BUFR2IODAX into DATA/")
exe_src = self.task_config.BUFR2IODAX
exe_dest = os.path.join(localconf.DATA, os.path.basename(exe_src))
Expand All @@ -118,11 +110,18 @@ def _gtsbufr2iodax(exe, yaml_file):
except Exception:
raise WorkflowException(f"An error occured during execution of {exe} {yaml_file}")

# execute BUFR2IODAX to convert adpsfc bufr data into IODA format
_gtsbufr2iodax(exe, os.path.join(localconf.DATA, "bufr_adpsfc_snow.yaml"))
# Loop over entries in prep_gts_config.bufr2ioda keys
# 1. generate bufr2ioda YAML files
# 2. execute bufr2ioda.x
for name in prep_gts_config.bufr2ioda.keys():
gts_yaml = os.path.join(self.runtime_config.DATA, f"bufr_{name}_snow.yaml")
logger.info(f"Generate BUFR2IODA YAML file: {gts_yaml}")
temp_yaml = parse_j2yaml(prep_gts_config.bufr2ioda[name], localconf)
save_as_yaml(temp_yaml, gts_yaml)
logger.info(f"Wrote bufr2ioda YAML to: {gts_yaml}")

# execute BUFR2IODAX to convert snocvr bufr data into IODA format
_gtsbufr2iodax(exe, os.path.join(localconf.DATA, "bufr_snocvr_snow.yaml"))
# execute BUFR2IODAX to convert {name} bufr data into IODA format
_gtsbufr2iodax(exe, os.path.join(localconf.DATA, f"bufr_{name}_snow.yaml"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_gtsbufr2iodax(exe, os.path.join(localconf.DATA, f"bufr_{name}_snow.yaml"))
_gtsbufr2iodax(exe, gts_yaml)

In my second (revised diff.txt), I removed the need to construct this again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done the changes.


# Ensure the IODA snow depth GTS file is produced by the IODA converter
# If so, copy to COM_OBS/
Expand Down