Skip to content

Commit

Permalink
Move YAML save out of get_jedi_config method
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidNew-NOAA committed Aug 8, 2024
1 parent 2a313b2 commit b2536c5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
7 changes: 6 additions & 1 deletion ush/python/pygfs/task/atm_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def initialize(self) -> None:
This method will initialize a global atm analysis using JEDI.
This includes:
- generating and saving JEDI YAML config
- staging observation files
- staging bias correction files
- staging CRTM fix files
Expand All @@ -72,9 +73,13 @@ def initialize(self) -> None:
"""
super().initialize()

# get JEDI variational configuration and save to YAML file
# get JEDI variational configuration
self.jedi.get_config(self.task_config)

# save JEDI config to YAML file
logger.debug(f"Writing JEDI YAML file to: {self.yaml}")
save_as_yaml(jedi.config, jedi.yaml)

# link JEDI variational executable
self.jedi.link_exe(self.task_config)

Expand Down
7 changes: 6 additions & 1 deletion ush/python/pygfs/task/atmens_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def initialize_letkf(self) -> None:
This method will initialize a global atmens analysis using JEDI.
This includes:
- generating and saving JEDI YAML config
- staging observation files
- staging bias correction files
- staging CRTM fix files
Expand All @@ -80,9 +81,13 @@ def initialize_letkf(self) -> None:
"""
super().initialize()

# get JEDI ensemble DA config dictionary and save to YAML file
# get JEDI ensemble DA config dictionary
self.jedi.get_config(self.task_config)

# save JEDI config to YAML file
logger.debug(f"Writing JEDI YAML file to: {self.yaml}")
save_as_yaml(jedi.config, jedi.yaml)

# link JEDI ensemble DA executable
self.jedi.link_exe(self.task_config)

Expand Down
5 changes: 0 additions & 5 deletions ush/python/pygfs/task/jedi.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ def get_config(self, task_config: AttrDict[str, Any], algorithm: Optional[str] =

logger.debug(f"JEDI config:\n{pformat(self.config)}")

# Save YAML to disk
logger.debug(f"Write YAML file to: {self.yaml}")
save_as_yaml(self.config, self.yaml)
logger.info(f"Wrote YAML file to: {self.yaml}")

@logit(logger)
def execute(self, task_config: AttrDict[str, Any], aprun_cmd: str, jedi_args: Optional[List] = None) -> None:
"""Execute JEDI application
Expand Down

0 comments on commit b2536c5

Please sign in to comment.