Skip to content

Commit

Permalink
changed DIFF -> DIFFUSION and diff -> diffusion in files below
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Tangborn authored and Andrew Tangborn committed Jun 4, 2024
1 parent e09656d commit 62457eb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion parm/config/gfs/config.aeroanlgenb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ echo "BEGIN: config.aeroanlgenb"
source "${EXPDIR}/config.resources" aeroanlgenb

export BMATYAML="${PARMgfs}/gdas/aero/berror/aero_diagb.yaml.j2"
export DIFFYAML="${PARMgfs}/gdas/aero/berror/aero_diffparm.yaml.j2"
export DIFFFFYAML="${PARMgfs}/gdas/aero/berror/aero_diffusionparm.yaml.j2"
export iterations=10
export fixed value=1.0

Expand Down
16 changes: 8 additions & 8 deletions ush/python/pygfs/task/aero_bmatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self, config: Dict[str, Any]) -> None:
_res_anl = int(self.config['CASE_ANL'][1:])

_bmat_yaml = os.path.join(self.runtime_config.DATA, f"{self.runtime_config.CDUMP}.t{self.runtime_config['cyc']:02d}z.chem_diagb.yaml")
_diff_yaml = os.path.join(self.runtime_config.DATA, f"{self.runtime_config.CDUMP}.t{self.runtime_config['cyc']:02d}z.chem_diff.yaml")
_diffusion_yaml = os.path.join(self.runtime_config.DATA, f"{self.runtime_config.CDUMP}.t{self.runtime_config['cyc']:02d}z.chem_diffusion.yaml")

# Create a local dictionary that is repeatedly used across this class
local_dict = AttrDict(
Expand All @@ -42,7 +42,7 @@ def __init__(self, config: Dict[str, Any]) -> None:
'APREFIX': f"{self.runtime_config.CDUMP}.t{self.runtime_config.cyc:02d}z.", # TODO: CDUMP is being replaced by RUN
'GPREFIX': f"gdas.t{self.runtime_config.previous_cycle.hour:02d}z.",
'bmat_yaml': _bmat_yaml,
'diff_yaml': _diff_yaml,
'diffusion_yaml': _diffusion_yaml,
}
)

Expand All @@ -66,9 +66,9 @@ def initialize(self: BMatrix) -> None:
logger.info(f"Wrote bmat YAML to: {self.task_config.bmat_yaml}")

# generate diffusion parameters YAML file
logger.debug(f"Generate diff YAML file: {self.task_config.diff_yaml}")
save_as_yaml(self.task_config.diff_config, self.task_config.diff_yaml)
logger.info(f"Wrote diff YAML to: {self.task_config.diff_yaml}")
logger.debug(f"Generate diffusion YAML file: {self.task_config.diffusion_yaml}")
save_as_yaml(self.task_config.diffusion_config, self.task_config.diffusion_yaml)
logger.info(f"Wrote diffusion YAML to: {self.task_config.diffusion_yaml}")

# create output directory
FileHandler({'mkdir': [os.path.join(self.task_config['DATA'], 'stddev')]}).sync()
Expand Down Expand Up @@ -102,12 +102,12 @@ def finalize(self) -> None:
# copy full YAML from executable to ROTDIR
src = os.path.join(self.task_config['DATA'], f"{self.task_config['CDUMP']}.t{self.runtime_config['cyc']:02d}z.chem_diagb.yaml")
dest = os.path.join(self.task_config.COM_CHEM_ANALYSIS, f"{self.task_config['CDUMP']}.t{self.runtime_config['cyc']:02d}z.chem_diagb.yaml")
src_diff = os.path.join(self.task_config['DATA'], f"{self.task_config['CDUMP']}.t{self.runtime_config['cyc']:02d}z.chem_diff.yaml")
dest_diff = os.path.join(self.task_config.COM_CHEM_ANALYSIS, f"{self.task_config['CDUMP']}.t{self.runtime_config['cyc']:02d}z.chem_diff.yaml")
src_diffusion = os.path.join(self.task_config['DATA'], f"{self.task_config['CDUMP']}.t{self.runtime_config['cyc']:02d}z.chem_diffusion.yaml")
dest_diffusion = os.path.join(self.task_config.COM_CHEM_ANALYSIS, f"{self.task_config['CDUMP']}.t{self.runtime_config['cyc']:02d}z.chem_diffusion.yaml")
yaml_copy = {
'mkdir': [self.task_config.COM_CHEM_ANALYSIS],
'copy': [[src, dest]],
'copy': [[src_diff, dest_diff]]
'copy': [[src_diffusion, dest_diffusion]]
}
FileHandler(yaml_copy).sync()

Expand Down
20 changes: 10 additions & 10 deletions ush/python/pygfs/task/bmatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def initialize(self) -> None:
super().initialize()
# all BMatrix tasks need a config
self.task_config.bmat_config = self.get_bmat_config()
self.task_config.diff_config = self.get_diff_config()
self.task_config.diffusion_config = self.get_diffusion_config()

def finalize(self) -> None:
super().finalize()
Expand All @@ -50,26 +50,26 @@ def get_bmat_config(self) -> Dict[str, Any]:
bmat_config = parse_j2yaml(self.task_config.BMATYAML, self.task_config, searchpath=self.gdasapp_j2tmpl_dir)
logger.debug(f"BMAT config:\n{pformat(bmat_config)}")

return bmat_config
return bmat_config

def get_diff_config(self) -> Dict[str, Any]:
"""Compile a dictionary of diffusion operator configuration from DIFFYAML template file
def get_diffusion_config(self) -> Dict[str, Any]:
"""Compile a dictionary of diffusion operator configuration from DIFFUSIONYAML template file
Parameters
----------
diff_iter
diffusion_iter
fixed_val
horiz_len
Returns
----------
diff_config : Dict
diffusion_config : Dict
a dictionary containing the fully rendered diffusion operator yaml configuration
"""

# generate JEDI YAML file for diffusion parameters
logger.info(f"Generate Diff Parmameter YAML config: {self.task_config.diff_yaml}")
diff_config = parse_j2yaml(self.task_config.DIFFYAML, self.task_config, searchpath=self.gdasapp_j2tmpl_dir)
logger.debug(f"DIFF config:\n{pformat(diff_config)}")
logger.info(f"Generate Diff Parmameter YAML config: {self.task_config.diffusion_yaml}")
diffusion_config = parse_j2yaml(self.task_config.DIFFUSIONYAML, self.task_config, searchpath=self.gdasapp_j2tmpl_dir)
logger.debug(f"DIFFUSION config:\n{pformat(diffusion_config)}")

return diff_config
return diffusion_config

0 comments on commit 62457eb

Please sign in to comment.