Skip to content

Commit

Permalink
update scripts to new working g-w
Browse files Browse the repository at this point in the history
  • Loading branch information
kevindougherty-noaa committed Nov 13, 2024
1 parent 81bbcf9 commit c2d6c7d
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 23 deletions.
4 changes: 2 additions & 2 deletions parm/config/gfs/config.anlstat
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ echo "BEGIN: config.anlstat"
# Get task specific resources
source "${EXPDIR}/config.resources" anlstat

export JCB_BASE_YAML="${PARMgfs}/gdas/stat/jcb-base.yaml.j2"
export JCB_ALGO_YAML="${PARMgfs}/gdas/jcb-gdas/algorithm/obstats/aero/viirs_n20_template.yaml.j2"
export JCB_BASE_YAML="${PARMgfs}/gdas/stat/aero/jcb-base.yaml.j2"
export JCB_ALGO_YAML="${PARMgfs}/gdas/jcb-algorithm/anlstat.yaml.j2"
export JEDIEXE=${HOMEgfs}/sorc/gdas.cd/build/bin/ioda-stats.x

echo "END: config.anlstat"
24 changes: 24 additions & 0 deletions parm/gdas/stat/aero/jcb-base.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Search path for model and obs for JCB
# -------------------------------------
algorithm_path: "{{PARMgfs}}/gdas/jcb-algorithms"
app_path_algorithm: "{{PARMgfs}}/gdas/jcb-gdas/algorithm/obstats/aero"

window_begin: "{{ STAT_WINDOW_BEGIN | to_isotime }}"
window_YMDH: "{{ STAT_WINDOW_BEGIN | to_YMDH }}"
window_length: "{{ STAT_WINDOW_LENGTH }}"

# Inputted list of ob spaces
# --------------------------
obspaces: {{ OBSPACES_LIST }}

# Obspace variable things
# -----------------------
aero_obsdatain_path: "{{ DATA }}"
aero_obsdatatin_simulated_variables: ['aerosolOpticalDepth']
aero_obsdatain_observed_variables: ['aerosolOpticalDepth']

# Variables
# ---------
aero_variables: ['aerosolOpticalDepth']
aero_file_groups: ['bkgmob', 'bkgmob1']
aero_file_qc_groups: ['EffectiveQC0', 'EffectiveQC1']
4 changes: 0 additions & 4 deletions parm/gdas/stat/jcb-base.yaml.j2

This file was deleted.

24 changes: 7 additions & 17 deletions ush/python/pygfs/task/stat_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ def __init__(self, config: Dict[str, Any]):
'npz_ges': self.task_config.LEVS - 1,
'npz': self.task_config.LEVS - 1,
'npz_anl': self.task_config.LEVS - 1,
'ATM_WINDOW_BEGIN': _window_begin,
'ATM_WINDOW_LENGTH': f"PT{self.task_config.assim_freq}H",
'STAT_WINDOW_BEGIN': _window_begin,
'STAT_WINDOW_LENGTH': f"PT{self.task_config.assim_freq}H",
'OPREFIX': f"{self.task_config.RUN}.t{self.task_config.cyc:02d}z.",
'APREFIX': f"{self.task_config.RUN}.t{self.task_config.cyc:02d}z.",
'GPREFIX': f"gdas.t{self.task_config.previous_cycle.hour:02d}z."
Expand All @@ -78,7 +78,7 @@ def __init__(self, config: Dict[str, Any]):
'rundir': self.task_config.DATA,
'exe_src': self.task_config.JEDIEXE,
'jcb_base_yaml': self.task_config.JCB_BASE_YAML,
'jcb_algo': 'viirs_n20_template',
'jcb_algo': 'anlstat',
'jcb_algo_yaml': self.task_config.JCB_ALGO_YAML,
'jedi_args': None
}
Expand All @@ -102,12 +102,6 @@ def initialize(self) -> None:
----------
None
"""
# initialize JEDI application
logger.info(f"Initializing JEDI variational DA application")
self.jedi['statanl'].initialize(self.task_config)

self.jedi['statanl'].render_jcb(self.task_config)

logger.info(f"Copying files to {self.task_config.DATA}/stats")

# Copy stat files to DATA path
Expand All @@ -134,12 +128,8 @@ def initialize(self) -> None:
# Get list of .nc4 files
obs_space_paths = glob.glob(os.path.join(self.task_config.DATA, "*.nc4"))

for path in obs_space_paths:
filename = os.path.basename(path)
obspace = '_'.join(filename.split('_')[1:3])
self.task_config.OBSPACES_LIST = ['_'.join(os.path.basename(path).split('_')[1:3]) for path in obs_space_paths]

# Load g-w obs space intermediate yaml file
with open(self.task_config.JCB_ALGO_YAML, 'r') as yaml_file:
parsed_yaml_file = yaml.safe_load(yaml_file)

print("open obspace yaml and do stuff")
# initialize JEDI application
logger.info(f"Initializing JEDI variational DA application")
self.jedi['statanl'].initialize(self.task_config)

0 comments on commit c2d6c7d

Please sign in to comment.