From a8dfe6cbfa0377441ff7ba0307905ba046613542 Mon Sep 17 00:00:00 2001 From: Yonggang Yu Date: Wed, 18 Feb 2026 19:08:07 -0500 Subject: [PATCH 1/4] LocalEnsembleDA: - background: datetime: set to the middle of time window - let window_type be 3D --- .../interfaces/geos_atmosphere/model/background_ensemble.py | 1 - src/swell/suites/localensembleda/suite_config.py | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/swell/configuration/jedi/interfaces/geos_atmosphere/model/background_ensemble.py b/src/swell/configuration/jedi/interfaces/geos_atmosphere/model/background_ensemble.py index 9b904fb41..351ec1644 100644 --- a/src/swell/configuration/jedi/interfaces/geos_atmosphere/model/background_ensemble.py +++ b/src/swell/configuration/jedi/interfaces/geos_atmosphere/model/background_ensemble.py @@ -17,7 +17,6 @@ def background_ensemble(template_dict: Mapping) -> Mapping: horizontal_resolution = template_dict['horizontal_resolution'] background_ensemble = { - 'date': template_dict['window_begin_iso'], 'members from template': { 'template': { 'datetime': template_dict['local_background_time_iso'], diff --git a/src/swell/suites/localensembleda/suite_config.py b/src/swell/suites/localensembleda/suite_config.py index 437dd35ab..e4c670272 100644 --- a/src/swell/suites/localensembleda/suite_config.py +++ b/src/swell/suites/localensembleda/suite_config.py @@ -42,6 +42,7 @@ class SuiteConfig(QuestionContainer, Enum): qd.npx_proc(3), qd.npy_proc(3), qd.cycle_times(['T00']), + qd.background_time_offset("PT3H"), qd.ensemble_num_members(3), qd.skip_ensemble_hofx(True), qd.local_ensemble_solver("Deterministic GETKF"), @@ -55,7 +56,7 @@ class SuiteConfig(QuestionContainer, Enum): qd.observations([ "atms_n20", ]), - qd.window_type("4D"), + qd.window_type("3D"), qd.clean_patterns(['*.txt']) ] ) @@ -82,6 +83,7 @@ class SuiteConfig(QuestionContainer, Enum): qd.npy_proc(4), # qd.perhost(32), qd.cycle_times(['T00']), + qd.background_time_offset("PT3H"), qd.ensemble_num_members(16), qd.skip_ensemble_hofx(True), qd.local_ensemble_solver("Deterministic GETKF"), @@ -121,7 +123,7 @@ class SuiteConfig(QuestionContainer, Enum): "amsua_metop-b", "amsua_metop-c" ]), - qd.window_type("4D"), + qd.window_type("3D"), qd.clean_patterns(['*.txt']) ] ) From 93885be5587b03048e44b94a5c05a6d2fc92050c Mon Sep 17 00:00:00 2001 From: Yonggang Yu Date: Mon, 9 Mar 2026 14:33:27 -0400 Subject: [PATCH 2/4] add keywords --- .../geos_atmosphere/model/ensemble_solver.py | 9 ++++-- .../geos_atmosphere/task_questions.yaml | 11 ++++++- .../suites/localensembleda/suite_config.py | 6 ++++ src/swell/tasks/run_jedi_etkf_observer.py | 4 +++ src/swell/tasks/run_jedi_etkf_solver.py | 4 +++ .../run_jedi_local_ensemble_da_executable.py | 4 +++ src/swell/tasks/task_questions.py | 6 ++++ src/swell/utilities/question_defaults.py | 30 ++++++++++++++++++- .../utilities/render_jedi_interface_files.py | 2 ++ 9 files changed, 71 insertions(+), 5 deletions(-) diff --git a/src/swell/configuration/jedi/interfaces/geos_atmosphere/model/ensemble_solver.py b/src/swell/configuration/jedi/interfaces/geos_atmosphere/model/ensemble_solver.py index 6e3c7257f..e6ae06710 100644 --- a/src/swell/configuration/jedi/interfaces/geos_atmosphere/model/ensemble_solver.py +++ b/src/swell/configuration/jedi/interfaces/geos_atmosphere/model/ensemble_solver.py @@ -18,14 +18,17 @@ def ensemble_solver(template_dict: Mapping) -> Mapping: local_ensemble_inflation_rtps = template_dict['local_ensemble_inflation_rtps'] local_ensemble_inflation_rtpp = template_dict['local_ensemble_inflation_rtpp'] local_ensemble_inflation_mult = template_dict['local_ensemble_inflation_mult'] + frac_retained_variance = template_dict['vertical_localization_frac_retained_variance'] + vertical_localization_lengthscale = template_dict['vertical_localization_lengthscale'] + vert_loc_unit = template_dict['vertical_localization_unit'] ensemble_solver = { 'solver': local_ensemble_solver, 'use linear observer': local_ensemble_use_linear_observer, 'vertical localization': { - 'fraction of retained variance': 0.5, - 'lengthscale': 1.5, - 'lengthscale units': 'logp' + 'fraction of retained variance': frac_retained_variance, + 'lengthscale': vertical_localization_lengthscale, + 'lengthscale units': vert_loc_units }, 'inflation': { 'rtps': local_ensemble_inflation_rtps, diff --git a/src/swell/configuration/jedi/interfaces/geos_atmosphere/task_questions.yaml b/src/swell/configuration/jedi/interfaces/geos_atmosphere/task_questions.yaml index 636e49e1c..a8e11d2c9 100644 --- a/src/swell/configuration/jedi/interfaces/geos_atmosphere/task_questions.yaml +++ b/src/swell/configuration/jedi/interfaces/geos_atmosphere/task_questions.yaml @@ -351,8 +351,17 @@ vertical_localization_ioda_vertical_coord_group: options: - MetaData +vertical_localization_unit: + default_value: 'logp' + options: + - 'levels' + - 'logp' + vertical_localization_lengthscale: - default_value: 4 + default_value: 2 + +vertical_localization_frac_retained_variance: + default_value: 0.95 vertical_localization_method: default_value: Vertical localization diff --git a/src/swell/suites/localensembleda/suite_config.py b/src/swell/suites/localensembleda/suite_config.py index a94dc3331..90b9360f1 100644 --- a/src/swell/suites/localensembleda/suite_config.py +++ b/src/swell/suites/localensembleda/suite_config.py @@ -46,6 +46,9 @@ class SuiteConfig(QuestionContainer, Enum): qd.skip_ensemble_hofx(True), qd.local_ensemble_solver("Deterministic GETKF"), qd.local_ensemble_use_linear_observer(True), + qd.vertical_localization_unit('logp'), + qd.vertical_localization_lengthscale(2.0), + qd.vertical_localization_frac_retained_variance(0.95), qd.ensmean_only(False), qd.local_ensemble_save_posterior_mean(True), qd.local_ensemble_save_posterior_mean_increment(True), @@ -91,6 +94,9 @@ class SuiteConfig(QuestionContainer, Enum): qd.skip_ensemble_hofx(True), qd.local_ensemble_solver("Deterministic GETKF"), qd.local_ensemble_use_linear_observer(True), + qd.vertical_localization_unit('logp'), + qd.vertical_localization_lengthscale(2.0), + qd.vertical_localization_frac_retained_variance(0.95), qd.ensmean_only(False), qd.local_ensemble_save_posterior_mean(True), qd.local_ensemble_save_posterior_mean_increment(True), diff --git a/src/swell/tasks/run_jedi_etkf_observer.py b/src/swell/tasks/run_jedi_etkf_observer.py index 4b80ed3ec..b4cb1c530 100644 --- a/src/swell/tasks/run_jedi_etkf_observer.py +++ b/src/swell/tasks/run_jedi_etkf_observer.py @@ -87,8 +87,12 @@ def execute(self) -> None: self.config.vertical_localization_method()) self.jedi_rendering.add_key('vertical_localization_apply_log_transform', self.config.vertical_localization_apply_log_transform()) + self.jedi_rendering.add_key('vertical_localization_unit', + self.config.vertical_localization_unit()) self.jedi_rendering.add_key('vertical_localization_lengthscale', self.config.vertical_localization_lengthscale()) + self.jedi_rendering.add_key('vertical_localization_frac_retained_variance', + self.config.vertical_localization_frac_retained_variance()) self.jedi_rendering.add_key('vertical_localization_ioda_vertical_coord', self.config.vertical_localization_ioda_vertical_coord()) self.jedi_rendering.add_key('vertical_localization_ioda_vertical_coord_group', diff --git a/src/swell/tasks/run_jedi_etkf_solver.py b/src/swell/tasks/run_jedi_etkf_solver.py index ba43a9d24..89b838819 100644 --- a/src/swell/tasks/run_jedi_etkf_solver.py +++ b/src/swell/tasks/run_jedi_etkf_solver.py @@ -86,8 +86,12 @@ def execute(self) -> None: self.config.vertical_localization_method()) self.jedi_rendering.add_key('vertical_localization_apply_log_transform', self.config.vertical_localization_apply_log_transform()) + self.jedi_rendering.add_key('vertical_localization_unit', + self.config.vertical_localization_unit()) self.jedi_rendering.add_key('vertical_localization_lengthscale', self.config.vertical_localization_lengthscale()) + self.jedi_rendering.add_key('vertical_localization_frac_retained_variance', + self.config.vertical_localization_frac_retained_variance()) self.jedi_rendering.add_key('vertical_localization_ioda_vertical_coord', self.config.vertical_localization_ioda_vertical_coord()) self.jedi_rendering.add_key('vertical_localization_ioda_vertical_coord_group', diff --git a/src/swell/tasks/run_jedi_local_ensemble_da_executable.py b/src/swell/tasks/run_jedi_local_ensemble_da_executable.py index e01ead301..d762451e9 100644 --- a/src/swell/tasks/run_jedi_local_ensemble_da_executable.py +++ b/src/swell/tasks/run_jedi_local_ensemble_da_executable.py @@ -93,8 +93,12 @@ def execute(self) -> None: self.config.vertical_localization_method()) self.jedi_rendering.add_key('vertical_localization_apply_log_transform', self.config.vertical_localization_apply_log_transform()) + self.jedi_rendering.add_key('vertical_localization_unit', + self.config.vertical_localization_unit()) self.jedi_rendering.add_key('vertical_localization_lengthscale', self.config.vertical_localization_lengthscale()) + self.jedi_rendering.add_key('vertical_localization_frac_retained_variance', + self.config.vertical_localization_frac_retained_variance()) self.jedi_rendering.add_key('vertical_localization_ioda_vertical_coord', self.config.vertical_localization_ioda_vertical_coord()) self.jedi_rendering.add_key('vertical_localization_ioda_vertical_coord_group', diff --git a/src/swell/tasks/task_questions.py b/src/swell/tasks/task_questions.py index 6bc94ed5b..0e2806420 100644 --- a/src/swell/tasks/task_questions.py +++ b/src/swell/tasks/task_questions.py @@ -696,6 +696,8 @@ class TaskQuestions(QuestionContainer, Enum): qd.vertical_localization_ioda_vertical_coord(), qd.vertical_localization_ioda_vertical_coord_group(), qd.vertical_localization_lengthscale(), + qd.vertical_localization_unit(), + qd.vertical_localization_frac_retained_variance(), qd.vertical_localization_method(), qd.perhost(), qd.change_vbc_to_sbc(), @@ -751,6 +753,8 @@ class TaskQuestions(QuestionContainer, Enum): qd.vertical_localization_ioda_vertical_coord(), qd.vertical_localization_ioda_vertical_coord_group(), qd.vertical_localization_lengthscale(), + qd.vertical_localization_unit(), + qd.vertical_localization_frac_retained_variance(), qd.vertical_localization_method(), qd.perhost(), qd.change_vbc_to_sbc(), @@ -788,6 +792,8 @@ class TaskQuestions(QuestionContainer, Enum): qd.vertical_localization_ioda_vertical_coord(), qd.vertical_localization_ioda_vertical_coord_group(), qd.vertical_localization_lengthscale(), + qd.vertical_localization_unit(), + qd.vertical_localization_frac_retained_variance(), qd.vertical_localization_method(), qd.perhost(), qd.change_vbc_to_sbc(), diff --git a/src/swell/utilities/question_defaults.py b/src/swell/utilities/question_defaults.py index 865df7971..e33caabba 100644 --- a/src/swell/utilities/question_defaults.py +++ b/src/swell/utilities/question_defaults.py @@ -1445,7 +1445,35 @@ class vertical_localization_lengthscale(TaskQuestion): "geos_atmosphere" ]) prompt: str = "What is the length scale for vertical covariance localization?" - widget_type: WType = WType.INTEGER + widget_type: WType = WType.FLOAT + + # -------------------------------------------------------------------------------------------------- + + @dataclass + class vertical_localization_frac_retained_variance(TaskQuestion): + default_value: str = "defer_to_model" + question_name: str = "vertical_localization_frac_retained_variance" + ask_question: bool = True + options: str = "defer_to_model" + models: List[str] = mutable_field([ + "geos_atmosphere" + ]) + prompt: str = "What is the fraction of vertical retained variance for GETKF?" + widget_type: WType = WType.FLOAT + + # -------------------------------------------------------------------------------------------------- + + @dataclass + class vertical_localization_unit (TaskQuestion): + default_value: str = "defer_to_model" + question_name: str = "vertical_localization__unit" + ask_question: bool = True + options: str = "defer_to_model" + models: List[str] = mutable_field([ + "geos_atmosphere" + ]) + prompt: str = "What is the vertical localization unit for GETKF?" + widget_type: WType = WType.STRING # -------------------------------------------------------------------------------------------------- diff --git a/src/swell/utilities/render_jedi_interface_files.py b/src/swell/utilities/render_jedi_interface_files.py index 779a73fb1..62632aa24 100644 --- a/src/swell/utilities/render_jedi_interface_files.py +++ b/src/swell/utilities/render_jedi_interface_files.py @@ -125,6 +125,8 @@ def __init__( 'vertical_localization_ioda_vertical_coord', 'vertical_localization_ioda_vertical_coord_group', 'vertical_localization_lengthscale', + 'vertical_localization_unit', + 'vertical_localization_frac_retained_variance', 'vertical_localization_method', 'vertical_resolution', 'window_begin', From 03cc4ec2b4195616c2f4ac5f3f38b63177d95cad Mon Sep 17 00:00:00 2001 From: Yonggang Yu Date: Tue, 10 Mar 2026 12:09:03 -0400 Subject: [PATCH 3/4] correct a few typos --- .../jedi/interfaces/geos_atmosphere/model/ensemble_solver.py | 2 +- src/swell/utilities/question_defaults.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/swell/configuration/jedi/interfaces/geos_atmosphere/model/ensemble_solver.py b/src/swell/configuration/jedi/interfaces/geos_atmosphere/model/ensemble_solver.py index e6ae06710..c7bd0e7ad 100644 --- a/src/swell/configuration/jedi/interfaces/geos_atmosphere/model/ensemble_solver.py +++ b/src/swell/configuration/jedi/interfaces/geos_atmosphere/model/ensemble_solver.py @@ -28,7 +28,7 @@ def ensemble_solver(template_dict: Mapping) -> Mapping: 'vertical localization': { 'fraction of retained variance': frac_retained_variance, 'lengthscale': vertical_localization_lengthscale, - 'lengthscale units': vert_loc_units + 'lengthscale units': vert_loc_unit }, 'inflation': { 'rtps': local_ensemble_inflation_rtps, diff --git a/src/swell/utilities/question_defaults.py b/src/swell/utilities/question_defaults.py index e33caabba..7cd8735d5 100644 --- a/src/swell/utilities/question_defaults.py +++ b/src/swell/utilities/question_defaults.py @@ -1466,7 +1466,7 @@ class vertical_localization_frac_retained_variance(TaskQuestion): @dataclass class vertical_localization_unit (TaskQuestion): default_value: str = "defer_to_model" - question_name: str = "vertical_localization__unit" + question_name: str = "vertical_localization_unit" ask_question: bool = True options: str = "defer_to_model" models: List[str] = mutable_field([ From 89e619d2bca75ed326c6400a9b1bdd7e65a7d56c Mon Sep 17 00:00:00 2001 From: Yonggang Yu Date: Thu, 6 Aug 2026 10:23:50 -0400 Subject: [PATCH 4/4] Add back to background_ensemble.py: 'date': template_dict['window_begin_iso'], --- .../jedi/interfaces/geos_atmosphere/model/background_ensemble.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/swell/configuration/jedi/interfaces/geos_atmosphere/model/background_ensemble.py b/src/swell/configuration/jedi/interfaces/geos_atmosphere/model/background_ensemble.py index 351ec1644..9b904fb41 100644 --- a/src/swell/configuration/jedi/interfaces/geos_atmosphere/model/background_ensemble.py +++ b/src/swell/configuration/jedi/interfaces/geos_atmosphere/model/background_ensemble.py @@ -17,6 +17,7 @@ def background_ensemble(template_dict: Mapping) -> Mapping: horizontal_resolution = template_dict['horizontal_resolution'] background_ensemble = { + 'date': template_dict['window_begin_iso'], 'members from template': { 'template': { 'datetime': template_dict['local_background_time_iso'],