Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
a8a5255
Archive Verify (-ens) var creation
AntonMFernando-NOAA Dec 2, 2025
34ef1ba
arch_vrfy var creation yamls and exscripts
AntonMFernando-NOAA Dec 2, 2025
295e98a
create nested function ush/python/pygfs/task/archive_vars.py
AntonMFernando-NOAA Dec 2, 2025
662ef4a
add missing key default
AntonMFernando-NOAA Dec 3, 2025
45c23c6
update ush/python/pygfs/task/archive_vars.py
AntonMFernando-NOAA Dec 3, 2025
8c0bee5
update all files
AntonMFernando-NOAA Dec 4, 2025
b727e52
update yamls and arch.py
AntonMFernando-NOAA Dec 4, 2025
bade5e5
update ush/python/pygfs/task/archive_vars.py
AntonMFernando-NOAA Dec 4, 2025
8b2f5de
add filehandler logic
AntonMFernando-NOAA Dec 4, 2025
83a86b3
edits yamls to look more clean
AntonMFernando-NOAA Dec 4, 2025
4469b5a
further edits to yamls
AntonMFernando-NOAA Dec 4, 2025
dab508c
tabbed jinja
AntonMFernando-NOAA Dec 4, 2025
350ce7e
resolve conflicts
AntonMFernando-NOAA Dec 4, 2025
c647205
resolve conflicts
AntonMFernando-NOAA Dec 4, 2025
ac09a81
Merge branch 'NOAA-EMC:develop' into enabler/archive
AntonMFernando-NOAA Dec 4, 2025
4711803
Merge remote-tracking branch 'origin/develop' into enabler/archive
AntonMFernando-NOAA Dec 5, 2025
6cee909
typo
AntonMFernando-NOAA Dec 5, 2025
4c31622
addressed suggestions
AntonMFernando-NOAA Dec 5, 2025
3bd29eb
typo
AntonMFernando-NOAA Dec 5, 2025
0027124
update class attributes
AntonMFernando-NOAA Dec 5, 2025
977915a
update scripts/exglobal_enkf_earc_vrfy.py
AntonMFernando-NOAA Dec 6, 2025
9eb249e
Merge remote-tracking branch 'origin/develop' into enabler/archive
AntonMFernando-NOAA Dec 8, 2025
166dca9
changed location head string
AntonMFernando-NOAA Dec 8, 2025
d465f57
Merge branch 'NOAA-EMC:develop' into enabler/archive
AntonMFernando-NOAA Dec 8, 2025
57508ab
added suggestions
AntonMFernando-NOAA Dec 9, 2025
dabb70f
corrected a typo
AntonMFernando-NOAA Dec 9, 2025
a0e6b2c
update comments
AntonMFernando-NOAA Dec 9, 2025
741cf9c
Merge branch 'NOAA-EMC:develop' into enabler/archive
AntonMFernando-NOAA Dec 9, 2025
934acd6
Update dev/scripts/exglobal_archive_vrfy.py
AntonMFernando-NOAA Dec 9, 2025
35130e6
Update dev/scripts/exglobal_enkf_earc_vrfy.py
AntonMFernando-NOAA Dec 9, 2025
d9ce4cc
Update ush/python/pygfs/utils/archive_vars.py
AntonMFernando-NOAA Dec 9, 2025
b383e1d
change copy_req to copy_opt
AntonMFernando-NOAA Dec 9, 2025
e8ed3b9
typo
AntonMFernando-NOAA Dec 9, 2025
f5299f3
suggestions
AntonMFernando-NOAA Dec 10, 2025
7ec00e9
Merge branch 'NOAA-EMC:develop' into enabler/archive
AntonMFernando-NOAA Dec 10, 2025
733b35e
typo
AntonMFernando-NOAA Dec 10, 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
6 changes: 6 additions & 0 deletions jobs/JGLOBAL_ARCHIVE_VRFY
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ for grid in "0p25" "0p50" "1p00"; do
"COMIN_ATMOS_GRIB_${grid}:COM_ATMOS_GRIB_GRID_TMPL"
done

# GEFS-specific: Ensemble statistics path
if [[ "${RUN}" == "gefs" ]]; then
MEMDIR="ensstat" YMD=${PDY} HH=${cyc} GRID="1p00" declare_from_tmpl -rx \
COMIN_ATMOS_ENSSTAT_1p00:COM_ATMOS_GRIB_GRID_TMPL
fi

###############################################################
# Run archive script
###############################################################
Expand Down
22 changes: 22 additions & 0 deletions parm/archive/enkf_arcdir.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Variables provided by archive_vars.py:
# - cycle_HH, cycle_YMDH, cycle_YMD, head
# - ARCDIR
# - All COMIN_* paths

# Ensemble (EnKF) archiving template
# Used for: enkfgdas, enkfgfs, enkfgcafs, enkfgcdas

mkdir:
- "{{ ARCDIR }}"

copy_req:
# Ensemble analysis statistics - REQUIRED
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is a copy_opt should this comment say this files are optional or is the comment correct that these are required files and should be copy_req?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Removed Required.

{% if DO_JEDIATMENS == True %}
- ["{{ COMIN_ATMOS_ANALYSIS_ENSSTAT }}/{{ head }}stat.atm.tar",
"{{ ARCDIR }}/atmensstat.{{ RUN }}.{{ cycle_YMDH }}"]
{% else %}
- ["{{ COMIN_ATMOS_ANALYSIS_ENSSTAT }}/{{ head }}enkfstat.txt",
"{{ ARCDIR }}/enkfstat.{{ RUN }}.{{ cycle_YMDH }}"]
- ["{{ COMIN_ATMOS_ANALYSIS_ENSSTAT }}/{{ head }}gsistat_ensmean.txt",
"{{ ARCDIR }}/gsistat.{{ RUN }}.{{ cycle_YMDH }}.ensmean"]
{% endif %}
134 changes: 41 additions & 93 deletions parm/archive/gcafs_arcdir.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,107 +1,55 @@
{% set cycle_HH = current_cycle | strftime("%H") %}
{% set cycle_YMDH = current_cycle | to_YMDH %}
{% set cycle_YMD = current_cycle | to_YMD %}
{% set head = RUN + ".t" + cycle_HH + "z." %}
# Variables provided by archive_vars.py:
# - cycle_HH, cycle_YMDH, cycle_YMD, head
# - VFYARC
# - All COMIN_* paths

# Select data to store in the ARCDIR and VFYARC from deterministic runs
# This file set will contain all source-destination pairs to send to the FileHandler for copying
{% set file_set = [] %}
# Deterministic GCAFS/GCDAS archiving template
# Used for: gcafs, gcdas

# Declare the VFYARC where Fit2Obs data will be sent
{% set VFYARC = ROTDIR ~ "/vrfyarch" %}

# Deterministic files
{% if "enkf" not in RUN %}
# Common files to be added to both the gcafs and gcdas keys below
{% set det_files = [] %}

# Deterministic analysis files (generated for cycled experiments)
{% set det_anl_files = [] %}

{% if DO_AERO_ANL %}
{% do det_anl_files.append([COMIN_CHEM_ANALYSIS ~ "/" ~ head ~ "aerostat.tgz",
ARCDIR ~ "/aerostat." ~ RUN ~ "." ~ cycle_YMDH ~ ".tgz"]) %}
{% endif %}

{% if DO_PREP_OBS_AERO == True %}
{% do det_anl_files.append([COMIN_OBS ~ "/" ~ head ~ "aeroobs",
ARCDIR ~ "/aeroobs." ~ RUN ~ "." ~ cycle_YMDH]) %}
{% do det_anl_files.append([COMIN_OBS ~ "/" ~ head ~ "aeroawobs",
ARCDIR ~ "/aeroawobs." ~ RUN ~ "." ~ cycle_YMDH]) %}
{% endif %}
mkdir:
- "{{ ARCDIR }}"
{% if DO_FIT2OBS == True %}
- "{{ VFYARC }}/{{ RUN }}.{{ cycle_YMD }}/{{ cycle_HH }}"
{% endif %}

# GCAFS-specific files
{% set gfs_files = [] %}
copy_req:
{% if RUN == "gcafs" %}
# GCAFS forecast files - REQUIRED
{% for fhr in range(0, FHMAX_GFS + 1, FHOUT_GFS) %}
{% do gfs_files.append([COMIN_ATMOS_GRIB_1p00 ~ "/" ~ head ~ "pres_a.1p00.f" ~ '%03d'|format(fhr) ~ ".grib2",
ARCDIR ~ "/pgbf" ~ '%02d'|format(fhr) ~ "." ~ RUN ~ "." ~ cycle_YMDH ~ ".grib2"]) %}
- ["{{ COMIN_ATMOS_GRIB_1p00 }}/{{ head }}pres_a.1p00.f{{ '%03d'|format(fhr) }}.grib2",
"{{ ARCDIR }}/pgbf{{ '%02d'|format(fhr) }}.{{ RUN }}.{{ cycle_YMDH }}.grib2"]
{% endfor %}

# GCAFS Fit2Obs data
{% set fit2obs_files = [] %}
{% for fhr in range(0, FHMAX_FITS + 1, 6) %}
{% set sfcfile = "/" + head + "sfc.f" + '%03d'|format(fhr) + ".nc" %}
{% set sigfile = "/" + head + "atm.f" + '%03d'|format(fhr) + ".nc" %}
{% do fit2obs_files.append([COMIN_ATMOS_HISTORY ~ "/" ~ sfcfile,
VFYARC ~ "/" ~ RUN ~ "." ~ cycle_YMD ~ "/" ~ cycle_HH ~ "/" ~ sfcfile ]) %}
{% do fit2obs_files.append([COMIN_ATMOS_HISTORY ~ "/" ~ sigfile,
VFYARC ~ "/" ~ RUN ~ "." ~ cycle_YMD ~ "/" ~ cycle_HH ~ "/" ~ sigfile ]) %}
{% endfor %}
{% if DO_FIT2OBS == True %}
# GCAFS Fit2Obs data - REQUIRED if DO_FIT2OBS is enabled
{% for fhr in range(0, FHMAX_FITS + 1, 6) %}
- ["{{ COMIN_ATMOS_HISTORY }}/{{ head }}sfc.f{{ '%03d'|format(fhr) }}.nc",
"{{ VFYARC }}/{{ RUN }}.{{ cycle_YMD }}/{{ cycle_HH }}/{{ head }}sfc.f{{ '%03d'|format(fhr) }}.nc"]
- ["{{ COMIN_ATMOS_HISTORY }}/{{ head }}atm.f{{ '%03d'|format(fhr) }}.nc",
"{{ VFYARC }}/{{ RUN }}.{{ cycle_YMD }}/{{ cycle_HH }}/{{ head }}atm.f{{ '%03d'|format(fhr) }}.nc"]
{% endfor %}
{% endif %}
{% endif %}

# GCDAS-specific files
{% set gdas_files = [] %}
{% if RUN == "gcdas" %}
# GCDAS forecast files - REQUIRED
{% for fhr in range(0, FHMAX + 1, FHOUT) %}
{% do gdas_files.append([COMIN_ATMOS_GRIB_1p00 ~ "/" ~ head ~ "pres_a.1p00.f" ~ '%03d'|format(fhr) ~ ".grib2",
ARCDIR ~ "/pgbf" ~ '%02d'|format(fhr) ~ "." ~ RUN ~ "." ~ cycle_YMDH ~ ".grib2"]) %}
- ["{{ COMIN_ATMOS_GRIB_1p00 }}/{{ head }}pres_a.1p00.f{{ '%03d'|format(fhr) }}.grib2",
"{{ ARCDIR }}/pgbf{{ '%02d'|format(fhr) }}.{{ RUN }}.{{ cycle_YMDH }}.grib2"]
{% endfor %}
{% endif %}

# Now append the necessary file pairs to file_set
# Common deterministic files
{% set file_set = file_set + det_files %}
{% if MODE == "cycled" %}
{% set file_set = file_set + det_anl_files %}
{% endif %}

# Run-specific deterministic files
{% if RUN == "gcafs" %}
{% set file_set = file_set + gfs_files %}
# Fit2Obs files
{% if DO_FIT2OBS == True %}
{% set file_set = file_set + fit2obs_files %}
{% endif %}
{% elif RUN == "gcdas" %}
{% set file_set = file_set + gdas_files %}
{% if MODE == "cycled" %}
# Deterministic analysis files (cycled mode only) - REQUIRED
{% if DO_AERO_ANL %}
- ["{{ COMIN_CHEM_ANALYSIS }}/{{ head }}aerostat.tgz",
"{{ ARCDIR }}/aerostat.{{ RUN }}.{{ cycle_YMDH }}.tgz"]
{% endif %}

{% else %} # End of deterministic files

# Ensemble analysis files
{% set enkf_files = [] %}
{% if DO_JEDIATMENS == True %}
{% do enkf_files.append([COMIN_ATMOS_ANALYSIS_ENSSTAT ~ "/" ~ head ~ "atmensstat",
ARCDIR ~ "/atmensstat." ~ RUN ~ "." ~ cycle_YMDH ]) %}
{% else %}
{% do enkf_files.append([COMIN_ATMOS_ANALYSIS_ENSSTAT ~ "/" ~ head ~ "enkfstat.txt",
ARCDIR ~ "/enkfstat." ~ RUN ~ "." ~ cycle_YMDH ]) %}
{% do enkf_files.append([COMIN_ATMOS_ANALYSIS_ENSSTAT ~ "/" ~ head ~ "gsistat_ensmean.txt",
ARCDIR ~ "/gsistat." ~ RUN ~ "." ~ cycle_YMDH ~ ".ensmean"]) %}
{% if DO_PREP_OBS_AERO == True %}
- ["{{ COMIN_OBS }}/{{ head }}aeroobs",
"{{ ARCDIR }}/aeroobs.{{ RUN }}.{{ cycle_YMDH }}"]
- ["{{ COMIN_OBS }}/{{ head }}aeroawobs",
"{{ ARCDIR }}/aeroawobs.{{ RUN }}.{{ cycle_YMDH }}"]
{% endif %}

# Construct the final file set
{% set file_set = file_set + enkf_files %}

{% endif %}


# Actually write the yaml
mkdir:
- "{{ ARCDIR }}"

{% if DO_FIT2OBS == True %}
- "{{ VFYARC }}/{{ RUN }}.{{ cycle_YMD }}/{{ cycle_HH }}"
{% endif %}

copy:
{% for source_dest_pair in file_set %}
- {{ source_dest_pair }}
{% endfor %}
45 changes: 13 additions & 32 deletions parm/archive/gefs_arcdir.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,36 +1,17 @@
{% set cycle_HH = current_cycle | strftime("%H") %}
{% set cycle_YMDH = current_cycle | to_YMDH %}
{% set cycle_YMD = current_cycle | to_YMD %}
{% set head = RUN + ".t" + cycle_HH + "z." %}
# Variables provided by archive_vars.py:
# - cycle_HH, cycle_YMDH, cycle_YMD, head
# - VFYARC (archive directory)
# - COMIN_ATMOS_ENSSTAT_1p00 (calculated in Python with MEMDIR='ensstat')

# Declare the GEFS_ARCH where atmos data will be sent
{% set GEFS_ARCH = ROTDIR ~ "/gefsarch" %}

{% set file_set = [] %}

{% set tmpl_dict = ({ '${ROTDIR}':ROTDIR,
'${RUN}':RUN,
'${YMD}':cycle_YMD,
'${HH}':cycle_HH,
'${GRID}': '1p00',
'${MEMDIR}': 'ensstat' }) %}

{% set COMIN_ATMOS_ENSSTAT_1p00 = COM_ATMOS_GRIB_GRID_TMPL | replace_tmpl(tmpl_dict) %}
# Create directories first
mkdir:
- "{{ VFYARC }}"

# Select ensstat files to copy to the arcdir
{% set ensstat_files = [] %}
{% if path_exists(COMIN_ATMOS_ENSSTAT_1p00) %}
# Define all source-destination pairs for archiving
# Use copy_req for files that MUST exist (raise error if missing)
copy_req:
# GEFS ensemble mean forecast files - REQUIRED
{% for fhr in range(FHMIN_GFS, FHMAX_GFS + FHOUT_GFS, FHOUT_GFS) %}
{% do ensstat_files.append([COMIN_ATMOS_ENSSTAT_1p00 ~ "/" ~ head ~ "mean.pres_." ~
"1p00" ~ ".f" ~ '%03d'|format(fhr) ~ ".grib2",
GEFS_ARCH]) %}
- ["{{ COMIN_ATMOS_ENSSTAT_1p00 }}/{{ head }}mean.pres_.1p00.f{{ '%03d'|format(fhr) }}.grib2",
"{{ VFYARC }}/{{ head }}mean.pres_.1p00.f{{ '%03d'|format(fhr) }}.grib2"]
{% endfor %}
{% endif %}
{% set file_set = ensstat_files %}
# Actually write the yaml
mkdir:
- "{{ GEFS_ARCH }}"
copy:
{% for source_dest_pair in file_set %}
- {{ source_dest_pair }}
{% endfor %}
Loading