Skip to content

Commit

Permalink
Completes LETKF task, adds WCDA CI test (#1287)
Browse files Browse the repository at this point in the history
Completes LETKF task, adds WCDA CI test

Mutually dependent on
NOAA-EMC/global-workflow#2944

---------

Co-authored-by: Cory Martin <[email protected]>
Co-authored-by: Guillaume Vernieres <[email protected]>
  • Loading branch information
3 people authored Nov 7, 2024
1 parent 1df1ad2 commit dfc871f
Show file tree
Hide file tree
Showing 24 changed files with 195 additions and 37 deletions.
2 changes: 1 addition & 1 deletion mains/gdas.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ int runApp(int argc, char** argv, const std::string traits, const std::string ap
return std::make_unique<oops::HofX4D<Traits, ufo::ObsTraits>>();
};
apps["localensembleda"] = []() {
return std::make_unique<oops::LocalEnsembleDA<fv3jedi::Traits, ufo::ObsTraits>>();
return std::make_unique<oops::LocalEnsembleDA<Traits, ufo::ObsTraits>>();
};
apps["variational"] = []() {
return std::make_unique<oops::Variational<Traits, ufo::ObsTraits>>();
Expand Down
7 changes: 3 additions & 4 deletions parm/soca/ensda/stage_ens_mem.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
# create working directories
######################################
mkdir:
- "{{ DATAenspert }}/ens"

- "{{ ENSPERT_RELPATH }}/ens"
######################################
# copy ensemble background files
######################################
Expand All @@ -22,6 +21,6 @@ copy:
'${YMD}':gPDY,
'${HH}':gcyc,
'${MEMDIR}':"mem" + '%03d' % mem} %}
- ["{{ COM_OCEAN_HISTORY_TMPL | replace_tmpl(tmpl_dict) }}/{{ GDUMP_ENS }}.ocean.t{{ gcyc }}z.inst.f006.nc", "{{ DATAenspert }}/ens/ocean.{{ mem }}.nc"]
- ["{{ COM_ICE_HISTORY_TMPL | replace_tmpl(tmpl_dict) }}/{{ GDUMP_ENS }}.ice.t{{ gcyc }}z.inst.f006.nc", "{{ DATAenspert }}/ens/ice.{{ mem }}.nc"]
- ["{{ COM_OCEAN_HISTORY_TMPL | replace_tmpl(tmpl_dict) }}/{{ GDUMP_ENS }}.ocean.t{{ gcyc }}z.inst.f006.nc", "{{ ENSPERT_RELPATH }}/ens/ocean.{{ mem }}.nc"]
- ["{{ COM_ICE_HISTORY_TMPL | replace_tmpl(tmpl_dict) }}/{{ GDUMP_ENS }}.ice.t{{ gcyc }}z.inst.f006.nc", "{{ ENSPERT_RELPATH }}/ens/ice.{{ mem }}.nc"]
{% endfor %}
29 changes: 15 additions & 14 deletions parm/soca/letkf/letkf.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{% set gcyc = previous_cycle | strftime("%H") %}

geometry:
geom_grid_file: soca_gridspec.nc
mom6_input_nml: mom_input.nml
Expand All @@ -11,11 +13,11 @@ background:
members from template:
template:
date: '{{ WINDOW_MIDDLE | to_isotime }}'
ocn_filename: "{{ RUN }}.ocean.t{{ gcyc }}z.inst.f006.nc"
ice_filename: "{{ RUN }}.ice.t{{ gcyc }}z.inst.f006.nc"
ocn_filename: "ocean.%mem%.nc"
ice_filename: "ice.%mem%.nc"
read_from_file: 1
basename: ./ens/mem%mem%
state variables: [socn, tocn, ssh, uocn, vocn, cicen]
basename: {{ ENSPERT_RELPATH }}/ens/
state variables: [socn, tocn, ssh, hocn, uocn, vocn, cicen]
pattern: '%mem%'
nmembers: {{ NMEM_ENS }}

Expand All @@ -38,32 +40,31 @@ local ensemble DA:
mult: 1.1

output:
datadir: data_output/
datadir: letkf_output/
date: *date
exp: letkf
type: ens

output mean prior:
datadir: data_output/
datadir: letkf_output/
date: *date
exp: letkf
exp: letkf.mean_prior
type: fc

output variance prior:
datadir: data_output/
datadir: letkf_output/
date: *date
exp: letkf
exp: letkf.var_prior
type: fc

output variance posterior:
datadir: data_output/
datadir: letkf_output/
date: *date
exp: letkf
exp: letkf.var_post
type: an

output increment:
datadir: data_output/
datadir: letkf_output/
date: *date
exp: letkf.inc
type: an

type: ens
20 changes: 20 additions & 0 deletions parm/soca/letkf/letkf_save.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{% set PDY = current_cycle | to_YMD %}
{% set cyc = current_cycle | strftime("%H") %}
{% set timestr = WINDOW_BEGIN | to_isotime %}
######################################
# save letkf analysis to comout
######################################

copy:
{% for mem in range(1, NMEM_ENS + 1) %}
{% set tmpl_dict = {'${ROTDIR}':ROTDIR,
'${RUN}': GDUMP_ENS,
'${YMD}':PDY,
'${HH}':cyc,
'${MEMDIR}':"mem" + '%03d' % mem} %}
{% set COMOUT_OCEAN_LETKF_MEM = COM_OCEAN_LETKF_TMPL | replace_tmpl(tmpl_dict) %}
{% set COMOUT_ICE_LETKF_MEM = COM_ICE_LETKF_TMPL | replace_tmpl(tmpl_dict) %}

- ["{{ DATA }}/letkf_output/ocn.letkf.ens.{{ mem }}.{{ timestr }}.PT3H.nc", "{{ COMOUT_OCEAN_LETKF_MEM }}/{{ GDUMP_ENS }}.ocean.t{{ cyc }}z.analysis.nc"]
- ["{{ DATA }}/letkf_output/ice.letkf.ens.{{ mem }}.{{ timestr }}.PT3H.nc", "{{ COMOUT_ICE_LETKF_MEM }}/{{ GDUMP_ENS }}.ice.t{{ cyc }}z.analysis.nc"]
{% endfor %}
29 changes: 24 additions & 5 deletions parm/soca/letkf/letkf_stage.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,11 +1,30 @@
######################################
# create working directories
{% set PDY = current_cycle | to_YMD %}
{% set cyc = current_cycle | strftime("%H") %}
{% set gcyc = previous_cycle | strftime("%H") %}
######################################
mkdir:
- "{{ DATA }}/Data"
- "{{ DATA }}/letkf_output"
- "{{ DATA }}/obs"
copy:
- "{{ DATA }}/diags"
- "{{ COMOUT_OCEAN_LETKF }}"
- "{{ COMOUT_ICE_LETKF }}"
######################################
# make comout directories
######################################
# copy mom input template
{% for mem in range(1, NMEM_ENS + 1) %}
{% set tmpl_dict = {'${ROTDIR}':ROTDIR,
'${RUN}':GDUMP_ENS,
'${YMD}':PDY,
'${HH}':cyc,
'${MEMDIR}':"mem" + '%03d' % mem} %}
- "{{ COM_OCEAN_LETKF_TMPL | replace_tmpl(tmpl_dict) }}"
- "{{ COM_ICE_LETKF_TMPL | replace_tmpl(tmpl_dict) }}"
{% endfor %}
######################################
# copy mom input template and det bkg
######################################
copy:
- ["{{ PARMgfs }}/gdas/soca/fms/input.nml", "{{ DATA }}/mom_input.nml.tmpl"]
- ["{{ PARMgfs }}/gdas/soca/fields_metadata.yaml", "{{ DATA }}/fields_metadata.yaml"]
- ["{{ COMIN_OCEAN_HISTORY_PREV }}/gdas.ocean.t{{ gcyc }}z.inst.f009.nc", "{{ DATA }}/INPUT/MOM.res.nc"]
- ["{{ COMIN_ICE_HISTORY_PREV }}/gdas.ice.t{{ gcyc }}z.inst.f009.nc", "{{ DATA }}/INPUT/cice.res.nc"]
7 changes: 7 additions & 0 deletions parm/soca/obs/config/adt_rads_all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ obs operator:
name: ADT
obs error:
covariance model: diagonal
obs localizations:
- localization method: Rossby
base value: 100.0e3
rossby mult: 1.0
min grid mult: 2.0
min value: 200.0e3
max value: 900.0e3
obs filters:
- filter: Domain Check
where:
Expand Down
7 changes: 7 additions & 0 deletions parm/soca/obs/config/icec_amsr2_north.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,10 @@ obs filters:
where:
- variable: {name: GeoVaLs/distance_from_coast}
minvalue: 100e3
obs localizations:
- localization method: Rossby
base value: 100.0e3
rossby mult: 1.0
min grid mult: 2.0
min value: 200.0e3
max value: 900.0e3
7 changes: 7 additions & 0 deletions parm/soca/obs/config/icec_amsr2_south.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,10 @@ obs filters:
where:
- variable: {name: GeoVaLs/distance_from_coast}
minvalue: 100e3
obs localizations:
- localization method: Rossby
base value: 100.0e3
rossby mult: 1.0
min grid mult: 2.0
min value: 200.0e3
max value: 900.0e3
7 changes: 7 additions & 0 deletions parm/soca/obs/config/insitu_profile_argo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -625,3 +625,10 @@ obs filters:
- ObsError/salinity
coefs:
- 1000.0
obs localizations:
- localization method: Rossby
base value: 100.0e3
rossby mult: 1.0
min grid mult: 2.0
min value: 200.0e3
max value: 900.0e3
7 changes: 7 additions & 0 deletions parm/soca/obs/config/sst_abi_g16_l3c.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,10 @@ obs filters:
- ObsError/seaSurfaceTemperature
coefs:
- 1.0
obs localizations:
- localization method: Rossby
base value: 100.0e3
rossby mult: 1.0
min grid mult: 2.0
min value: 200.0e3
max value: 900.0e3
7 changes: 7 additions & 0 deletions parm/soca/obs/config/sst_abi_g17_l3c.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,10 @@ obs filters:
- ObsError/seaSurfaceTemperature
coefs:
- 1.0
obs localizations:
- localization method: Rossby
base value: 100.0e3
rossby mult: 1.0
min grid mult: 2.0
min value: 200.0e3
max value: 900.0e3
7 changes: 7 additions & 0 deletions parm/soca/obs/config/sst_ahi_h08_l3c.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,10 @@ obs filters:
- ObsError/seaSurfaceTemperature
coefs:
- 1.0
obs localizations:
- localization method: Rossby
base value: 100.0e3
rossby mult: 1.0
min grid mult: 2.0
min value: 200.0e3
max value: 900.0e3
7 changes: 7 additions & 0 deletions parm/soca/obs/config/sst_avhrr_ma_l3u.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,10 @@ obs filters:
- ObsError/seaSurfaceTemperature
coefs:
- 1.0
obs localizations:
- localization method: Rossby
base value: 100.0e3
rossby mult: 1.0
min grid mult: 2.0
min value: 200.0e3
max value: 900.0e3
7 changes: 7 additions & 0 deletions parm/soca/obs/config/sst_avhrr_mb_l3u.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,10 @@ obs filters:
- ObsError/seaSurfaceTemperature
coefs:
- 1.0
obs localizations:
- localization method: Rossby
base value: 100.0e3
rossby mult: 1.0
min grid mult: 2.0
min value: 200.0e3
max value: 900.0e3
7 changes: 7 additions & 0 deletions parm/soca/obs/config/sst_avhrr_mc_l3u.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,10 @@ obs filters:
- ObsError/seaSurfaceTemperature
coefs:
- 1.0
obs localizations:
- localization method: Rossby
base value: 100.0e3
rossby mult: 1.0
min grid mult: 2.0
min value: 200.0e3
max value: 900.0e3
7 changes: 7 additions & 0 deletions parm/soca/obs/config/sst_viirs_n20_l3u.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,10 @@ obs filters:
- ObsError/seaSurfaceTemperature
coefs:
- 1.0
obs localizations:
- localization method: Rossby
base value: 100.0e3
rossby mult: 1.0
min grid mult: 2.0
min value: 200.0e3
max value: 900.0e3
7 changes: 7 additions & 0 deletions parm/soca/obs/config/sst_viirs_npp_l3u.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,10 @@ obs filters:
- ObsError/seaSurfaceTemperature
coefs:
- 1.0
obs localizations:
- localization method: Rossby
base value: 100.0e3
rossby mult: 1.0
min grid mult: 2.0
min value: 200.0e3
max value: 900.0e3
6 changes: 3 additions & 3 deletions parm/soca/soca_ens_bkg_stage.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ copy:
# define variables
# Declare a dict of search and replace terms to GDUMP on each template
{% set tmpl_dict = {'ROTDIR':ROTDIR,
'RUN': RUN,
'RUN': GDUMP_ENS,
'YMD':gPDY,
'HH':gcyc,
'MEMDIR':"mem" + '%03d' % mem} %}
Expand All @@ -35,6 +35,6 @@ copy:
{% set com_prev_ocn.COMIN_OCEAN_HISTORY_MEM = com_prev_ocn.COMIN_OCEAN_HISTORY_MEM.replace(search_term, replace_term) %}
{% set com_prev_ice.COMIN_ICE_HISTORY_MEM = com_prev_ice.COMIN_ICE_HISTORY_MEM.replace(search_term, replace_term) %}
{% endfor %}
- ["{{ com_prev_ocn.COMIN_OCEAN_HISTORY_MEM }}/{{ RUN }}.ocean.t{{ gcyc }}z.inst.f006.nc", "{{ DATAens }}/ens/mem{{ '%03d' % mem }}/{{ RUN }}.ocean.t{{ gcyc }}z.inst.f006.nc"]
- ["{{ com_prev_ice.COMIN_ICE_HISTORY_MEM }}/{{ RUN }}.ice.t{{ gcyc }}z.inst.f006.nc", "{{ DATAens }}/ens/mem{{ '%03d' % mem }}/{{ RUN }}.ice.t{{ gcyc }}z.inst.f006.nc"]
- ["{{ com_prev_ocn.COMIN_OCEAN_HISTORY_MEM }}/{{ GDUMP_ENS }}.ocean.t{{ gcyc }}z.inst.f006.nc", "{{ DATAens }}/ens/mem{{ '%03d' % mem }}/{{ GDUMP_ENS }}.ocean.t{{ gcyc }}z.inst.f006.nc"]
- ["{{ com_prev_ice.COMIN_ICE_HISTORY_MEM }}/{{ GDUMP_ENS }}.ice.t{{ gcyc }}z.inst.f006.nc", "{{ DATAens }}/ens/mem{{ '%03d' % mem }}/{{ GDUMP_ENS }}.ice.t{{ gcyc }}z.inst.f006.nc"]
{% endfor %}
1 change: 0 additions & 1 deletion parm/soca/soca_fix_stage_025.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# TODO(AFE): make resolution dependent
mkdir:
- "{{ DATA }}/INPUT"
######################################
Expand Down
1 change: 0 additions & 1 deletion parm/soca/soca_fix_stage_100.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# TODO(AFE): make resolution dependent
mkdir:
- "{{ DATA }}/INPUT"
######################################
Expand Down
2 changes: 1 addition & 1 deletion parm/soca/soca_fix_stage_500.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# TODO(AFE): make resolution dependent
mkdir:
- "{{ DATA }}/INPUT"
######################################
Expand All @@ -9,6 +8,7 @@ copy:
- ["{{ SOCA_INPUT_FIX_DIR }}/field_table", "{{ DATA }}/field_table"]
- ["{{ SOCA_INPUT_FIX_DIR }}/diag_table", "{{ DATA }}/diag_table"]
- ["{{ SOCA_INPUT_FIX_DIR }}/MOM_input", "{{ DATA }}/MOM_input"]
- ["{{ SOCA_INPUT_FIX_DIR }}/obsop_name_map.yaml", "{{ DATA }}/obsop_name_map.yaml"]
- ["{{ SOCA_INPUT_FIX_DIR }}/INPUT/grid_spec.nc", "{{ DATA }}/INPUT/grid_spec.nc"]
- ["{{ SOCA_INPUT_FIX_DIR }}/INPUT/hycom1_25.nc", "{{ DATA }}/INPUT/hycom1_25.nc"]
- ["{{ SOCA_INPUT_FIX_DIR }}/INPUT/layer_coord25.nc", "{{ DATA }}/INPUT/layer_coord25.nc"]
Expand Down
45 changes: 42 additions & 3 deletions test/gw-ci/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,39 @@ function(add_cycling_tests pslot YAML_PATH HOMEgfs RUNTESTS PROJECT_SOURCE_DIR T
list(GET DATES_LIST 1 FULL_CYCLE)

# stage IC's
message(STATUS "staging the 1/2 cycle IC's for ${test_name} ctest")
message(STATUS "staging the 1/2 cycle IC's for ${pslot} ctest")
add_test(NAME ${test_name}_gdas_stage_ic_${HALF_CYCLE}
COMMAND /bin/bash -c "${PROJECT_SOURCE_DIR}/test/gw-ci/run_exp.sh ${pslot} gdas_stage_ic ${HALF_CYCLE}"
WORKING_DIRECTORY ${RUNTESTS})
set_tests_properties(${test_name}_gdas_stage_ic_${HALF_CYCLE} PROPERTIES LABELS "manual")

# stage ensemble ics
if (letkf)
message(STATUS "preparing enkfgdas_stage_ic for ${pslot} ctest")
add_test(NAME ${test_name}_enkfgdas_stage_ic_${HALF_CYCLE}
COMMAND /bin/bash -c "${PROJECT_SOURCE_DIR}/test/gw-ci/run_exp.sh ${pslot} enkfgdas_stage_ic ${HALF_CYCLE}"
WORKING_DIRECTORY ${RUNTESTS})
set_tests_properties(${test_name}_enkfgdas_stage_ic_${HALF_CYCLE} PROPERTIES LABELS "manual")
endif()

# 1/2 cycle gdas_fcst
message(STATUS "preparing 1/2 cycle gdas_fcst for ${pslot} ctest")
add_test(NAME ${test_name}_gdas_fcst_${HALF_CYCLE}
add_test(NAME ${test_name}_gdas_fcst_seg0_${HALF_CYCLE}
COMMAND /bin/bash -c "${PROJECT_SOURCE_DIR}/test/gw-ci/run_exp.sh ${pslot} gdas_fcst_seg0 ${HALF_CYCLE}"
WORKING_DIRECTORY ${RUNTESTS})
set_tests_properties(${test_name}_gdas_fcst_${HALF_CYCLE} PROPERTIES LABELS "manual")
set_tests_properties(${test_name}_gdas_fcst_seg0_${HALF_CYCLE} PROPERTIES LABELS "manual")

# 1/2 cycle enkfgdas_fcst
if (letkf)
set(ENS_MEMS "mem001" "mem002" "mem003")
foreach(ENS_MEM ${ENS_MEMS})
message(STATUS "preparing 1/2 cycle enkfgdas_fcst_${ENS_MEM} for ${pslot} ctest")
add_test(NAME ${test_name}_enkfgdas_fcst_${ENS_MEM}_${HALF_CYCLE}
COMMAND /bin/bash -c "${PROJECT_SOURCE_DIR}/test/gw-ci/run_exp.sh ${pslot} enkfgdas_fcst_${ENS_MEM} ${HALF_CYCLE}"
WORKING_DIRECTORY ${RUNTESTS})
set_tests_properties(${test_name}_enkfgdas_fcst_${ENS_MEM}_${HALF_CYCLE} PROPERTIES LABELS "manual")
endforeach()
endif()

# Select the list of tasks to run for the full cycle
message(STATUS "Tasks ${TASK_LIST}")
Expand Down Expand Up @@ -62,6 +83,24 @@ if (WORKFLOW_TESTS)
"gdas_marineanlfinal"
)
add_cycling_tests(${pslot} ${YAML_PATH} ${HOMEgfs} ${RUNTESTS} ${PROJECT_SOURCE_DIR} "${TASK_LIST}")

# WCDA, low-res, ensemble da
# -------------
set(pslot "WCDA-hyb-C48mx500")
set(letkf TRUE)
set(YAML_PATH ${HOMEgfs}/ci/cases/pr/C48mx500_hybAOWCDA.yaml)
set(TASK_LIST
"gdas_prepoceanobs"
"gdas_marineanlletkf"
# TODO(AFE) waiting until these are working for hybrid
# "gdas_marinebmat"
# "gdas_marineanlinit"
# "gdas_marineanlvar"
# "gdas_marineanlchkpt"
# "gdas_marineanlfinal"
)
add_cycling_tests(${pslot} ${YAML_PATH} ${HOMEgfs} ${RUNTESTS} ${PROJECT_SOURCE_DIR} "${TASK_LIST}")
set(letkf FALSE)
endif()

option(RUN_GW_CI "Enable the global-workflow CI tests" OFF)
Expand Down
Loading

0 comments on commit dfc871f

Please sign in to comment.