Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
abfc560
stage and archive aerosol bias correction files
May 13, 2025
e8a3a40
Merge branch 'develop' into feature/aero-VarBC
ypwang19 May 14, 2025
58ce61d
Merge branch 'develop' into feature/aero-VarBC
ypwang19 May 14, 2025
e1643a9
Merge branch 'develop' into feature/aero-VarBC
ypwang19 May 15, 2025
0b33ec7
Merge branch 'develop' into feature/aero-VarBC
ypwang19 May 19, 2025
82e858b
Merge branch 'develop' into feature/aero-VarBC
ypwang19 May 21, 2025
b0bf872
update hash
May 21, 2025
96a7849
stage aero bc file for aero DA CI test
May 22, 2025
a8d1b16
resolve conflicts
May 23, 2025
84d2c70
Merge branch 'develop' into feature/aero-VarBC
ypwang19 May 23, 2025
682e116
Merge branch 'develop' into feature/aero-VarBC
ypwang19 May 23, 2025
7ee257d
add an exception for missing BC files
May 27, 2025
c04236d
fix coding norms
May 27, 2025
ba5f105
Merge branch 'develop' into feature/aero-VarBC
ypwang19 May 29, 2025
16ed16f
Merge branch 'develop' into feature/aero-VarBC
DavidHuber-NOAA Jun 2, 2025
c2950b7
Merge branch 'develop' into feature/aero-VarBC
CoryMartin-NOAA Jun 3, 2025
79f945d
export DO_AERO_ANL for all apps
CoryMartin-NOAA Jun 4, 2025
d6684be
Merge branch 'develop' into feature/aero-VarBC
aerorahul Jun 6, 2025
0cf9350
Merge branch 'develop' into feature/do-aero-anl
CoryMartin-NOAA Jun 11, 2025
1424794
working no DA case
CoryMartin-NOAA Jun 12, 2025
3022988
Merge branch 'develop' into feature/aero-VarBC
ypwang19 Jun 16, 2025
541dae5
Merge pull request #1 from CoryMartin-NOAA/feature/do-aero-anl
ypwang19 Jun 16, 2025
019fe84
Revert "Merge pull request #1 from CoryMartin-NOAA/feature/do-aero-anl"
Jun 16, 2025
345e4e3
set DO_AERO_ANL to NO in config of gefs and sfs
Jun 16, 2025
f9040f2
Merge branch 'develop' into feature/aero-VarBC
ypwang19 Jun 16, 2025
df9173a
Merge branch 'develop' into feature/aero-VarBC
DavidHuber-NOAA Jun 18, 2025
9235d8a
Merge branch 'develop' into feature/aero-VarBC
DavidHuber-NOAA Jun 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dev/parm/config/gefs/config.base.j2
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export DO_OCN="NO"
export DO_ICE="NO"
export DO_EXTRACTVARS="{{ DO_EXTRACTVARS }}" # Option to process and extract a subset of products to save on disk
export DO_AERO_FCST="NO"
export DO_AERO_ANL="NO"
export DOBNDPNT_WAVE="NO" # The GEFS buoys file does not currently have any boundary points
export DOIBP_WAV="NO" # Option to create point outputs from input boundary points
export FRAC_GRID=".true."
Expand Down
1 change: 1 addition & 0 deletions dev/parm/config/sfs/config.base.j2
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export DO_OCN="NO"
export DO_ICE="NO"
export DO_EXTRACTVARS="{{ DO_EXTRACTVARS }}" # Option to process and extract a subset of products to save on disk
export DO_AERO_FCST="NO"
export DO_AERO_ANL="NO"
export DOBNDPNT_WAVE="NO" # The SFS buoys file does not currently have any boundary points
export DOIBP_WAV="NO" # Option to create point outputs from input boundary points
export FRAC_GRID=".true."
Expand Down
3 changes: 2 additions & 1 deletion jobs/JGLOBAL_AERO_ANALYSIS_INITIALIZE
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ YMD=${PDY} HH=${cyc} declare_from_tmpl -rx \

RUN=${GDUMP} YMD=${gPDY} HH=${gcyc} declare_from_tmpl -rx \
COMIN_ATMOS_RESTART_PREV:COM_ATMOS_RESTART_TMPL \
COMIN_CHEM_BMAT_PREV:COM_CHEM_BMAT_TMPL
COMIN_CHEM_BMAT_PREV:COM_CHEM_BMAT_TMPL \
COMIN_CHEM_ANALYSIS_PREV:COM_CHEM_ANALYSIS_TMPL

###############################################################
# Run relevant script
Expand Down
2 changes: 1 addition & 1 deletion parm/gdas/aero_stage_variational.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{% else %}
{% set anl_time = current_cycle %}
{% endif %}
{% set fvfiles = ['fv_core.res.', 'fv_tracer.res.'] %}
{% set fvfiles = ['fv_core.res.', 'fv_tracer.res.', 'sfc_data.', 'fv_srf_wnd.res.'] %}
######################################
mkdir:
- "{{ DATA }}/anl"
Expand Down
17 changes: 17 additions & 0 deletions parm/stage/aero.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
aero:
mkdir:
{% for mem in range(first_mem, last_mem + 1) %}
{% set imem = mem - first_mem %}
{% set COMOUT_CHEM_ANALYSIS_MEM = COMOUT_CHEM_ANALYSIS_MEM_list[imem] %}
- "{{ COMOUT_CHEM_ANALYSIS_MEM }}"
{% endfor %}
link_req:
{% for mem in range(first_mem, last_mem + 1) %}
{% set imem = mem - first_mem %}
{% set COMOUT_CHEM_ANALYSIS_MEM = COMOUT_CHEM_ANALYSIS_MEM_list[imem] %}
{% for ftype in ["aero_varbc_params.tar"] %}
{% if path_exists(ICSDIR ~ "/" ~ COMOUT_CHEM_ANALYSIS_MEM | relpath(ROTDIR) ~ "/" ~ RUN ~ ".t" ~ current_cycle_HH ~ "z." ~ ftype) %}
- ["{{ ICSDIR }}/{{ COMOUT_CHEM_ANALYSIS_MEM | relpath(ROTDIR) }}/{{ RUN }}.t{{ current_cycle_HH }}z.{{ ftype }}", "{{ COMOUT_CHEM_ANALYSIS_MEM }}"]
{% endif %}
{% endfor %}
{% endfor %} # mem loop
9 changes: 9 additions & 0 deletions parm/stage/master_gfs.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
{% set COMOUT_OCEAN_ANALYSIS_MEM_list = [] %}
{% set COMOUT_MED_RESTART_PREV_MEM_list = [] %}
{% set COMOUT_WAVE_RESTART_PREV_MEM_list = [] %}
{% set COMOUT_CHEM_ANALYSIS_MEM_list = [] %}

# Construct member COM directory lists
# ------------------------------------
Expand Down Expand Up @@ -110,6 +111,7 @@
{% set COMOUT_OCEAN_ANALYSIS_MEM = COM_OCEAN_ANALYSIS_TMPL | replace_tmpl(current_cycle_dict) %}
{% set COMOUT_MED_RESTART_PREV_MEM = COM_MED_RESTART_TMPL | replace_tmpl(previous_cycle_dict) %}
{% set COMOUT_WAVE_RESTART_PREV_MEM = COM_WAVE_RESTART_TMPL | replace_tmpl(previous_cycle_dict) %}
{% set COMOUT_CHEM_ANALYSIS_MEM = COM_CHEM_ANALYSIS_TMPL | replace_tmpl(current_cycle_dict) %}

# Append the member COM directories
{% do COMOUT_ATMOS_INPUT_MEM_list.append(COMOUT_ATMOS_INPUT_MEM)%}
Expand All @@ -122,6 +124,7 @@
{% do COMOUT_OCEAN_ANALYSIS_MEM_list.append(COMOUT_OCEAN_ANALYSIS_MEM)%}
{% do COMOUT_MED_RESTART_PREV_MEM_list.append(COMOUT_MED_RESTART_PREV_MEM)%}
{% do COMOUT_WAVE_RESTART_PREV_MEM_list.append(COMOUT_WAVE_RESTART_PREV_MEM)%}
{% do COMOUT_CHEM_ANALYSIS_MEM_list.append(COMOUT_CHEM_ANALYSIS_MEM)%}

{% endfor %}

Expand Down Expand Up @@ -189,3 +192,9 @@
{% include "wave.yaml.j2" %}
{% endfilter %}
{% endif %}

{% if DO_AERO_ANL %}
{% filter indent(width=4) %}
{% include "aero.yaml.j2" %}
{% endfilter %}
{% endif %}
2 changes: 1 addition & 1 deletion scripts/exglobal_stage_ic.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def main():
'ROTDIR', 'ICSDIR', 'STAGE_IC_YAML_TMPL', 'DO_JEDIATMVAR',
'OCNRES', 'waveGRD', 'ntiles', 'DOIAU',
'DO_JEDIOCNVAR', 'DO_STARTMEM_FROM_JEDIICE',
'REPLAY_ICS', 'DO_WAVE', 'DO_OCN', 'DO_ICE', 'DO_NEST', 'DO_CA',
'REPLAY_ICS', 'DO_WAVE', 'DO_OCN', 'DO_ICE', 'DO_NEST', 'DO_CA', 'DO_AERO_ANL',
'USE_ATM_ENS_PERTURB_FILES', 'USE_OCN_ENS_PERTURB_FILES']

stage_dict = AttrDict()
Expand Down
39 changes: 27 additions & 12 deletions ush/python/pygfs/task/aero_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,21 @@ def initialize(self) -> None:
logger.debug(f"Observation files:\n{pformat(obs_dict)}")

# # stage bias corrections
# logger.info(f"Staging list of bias correction files")
# bias_dict = self.jedi_dict['aeroanlvar'].render_jcb(self.task_config, 'aero_bias_staging')
# if bias_dict['copy'] is None:
# logger.info(f"No bias correction files to stage")
# else:
# bias_dict['copy'] = Jedi.remove_redundant(bias_dict['copy'])
# FileHandler(bias_dict).sync()
# logger.debug(f"Bias correction files:\n{pformat(bias_dict)}")

# # extract bias corrections
# Jedi.extract_tar_from_filehandler_dict(bias_dict)
logger.info(f"Staging list of bias correction files")
bias_dict = self.jedi_dict['aeroanlvar'].render_jcb(self.task_config, 'aero_bias_staging')

if bias_dict['copy'] is None:
logger.info(f"No bias correction files to stage")
Comment thread
CoryMartin-NOAA marked this conversation as resolved.
else:
try:
bias_dict['copy'] = Jedi.remove_redundant(bias_dict['copy'])
FileHandler(bias_dict).sync()
logger.debug(f"Bias correction files:\n{pformat(bias_dict)}")

# extract bias corrections
Jedi.extract_tar_from_filehandler_dict(bias_dict)
except FileNotFoundError:
logger.error(f"Bias correction files or directories do not exist:\n{pformat(bias_dict)}")

# stage CRTM fix files
logger.info(f"Staging CRTM fix files from {self.task_config.CRTM_FIX_YAML}")
Expand Down Expand Up @@ -184,13 +188,24 @@ def finalize(self) -> None:
self._add_fms_cube_sphere_increments()

# tar up bias correction files
# NOTE TODO
bfile = f"{self.task_config.APREFIX}aero_varbc_params.tar"
aertar = os.path.join(self.task_config.COMOUT_CHEM_ANALYSIS, bfile)

# get lists of aerosol bias correction files to add to tarball
satlist = glob.glob(os.path.join(self.task_config.DATA, 'bc', '*satbias*nc'))

# copy files back to COM
logger.info(f"Copying files to COM based on {self.task_config.AERO_FINALIZE_VARIATIONAL_TMPL}")
aero_var_final_list = parse_j2yaml(self.task_config.AERO_FINALIZE_VARIATIONAL_TMPL, self.task_config)
FileHandler(aero_var_final_list).sync()

# tar aerosol bias correction files to ROTDIR
logger.info(f"Creating aerosol bias correction tar file {aertar}")
with tarfile.open(aertar, 'w') as aerbcor:
for satfile in satlist:
aerbcor.add(satfile, arcname=os.path.basename(satfile))
logger.info(f"Add {aerbcor.getnames()}")

# open tar file for writing
with tarfile.open(aerostat, "w|gz") as archive:
for diagfile in diags:
Expand Down