From 4a09efa8c6074a7d44b3a688d3a7446680d0ef27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20M=C3=BCller?= Date: Thu, 4 Dec 2025 13:25:58 +0100 Subject: [PATCH 01/18] Remove iau from init --- .../tools/py2fgen/wrappers/dycore_wrapper.py | 4 ---- .../py2fgen/fortran_samples/test_dycore.f90 | 4 ---- .../wrappers/references/dycore/dycore.f90 | 16 +--------------- .../py2fgen/wrappers/references/dycore/dycore.h | 14 +++++++------- .../py2fgen/wrappers/references/dycore/dycore.py | 4 ---- .../py2fgen/wrappers/test_dycore_wrapper.py | 8 -------- 6 files changed, 8 insertions(+), 42 deletions(-) diff --git a/tools/src/icon4py/tools/py2fgen/wrappers/dycore_wrapper.py b/tools/src/icon4py/tools/py2fgen/wrappers/dycore_wrapper.py index d111eba826..2b85c3cfc6 100644 --- a/tools/src/icon4py/tools/py2fgen/wrappers/dycore_wrapper.py +++ b/tools/src/icon4py/tools/py2fgen/wrappers/dycore_wrapper.py @@ -104,8 +104,6 @@ def solve_nh_init( rayleigh_type: gtx.int32, rayleigh_coeff: gtx.float64, divdamp_order: gtx.int32, - is_iau_active: bool, - iau_wgt_dyn: gtx.float64, divdamp_type: gtx.int32, divdamp_trans_start: gtx.float64, divdamp_trans_end: gtx.float64, @@ -141,8 +139,6 @@ def solve_nh_init( rayleigh_type=rayleigh_type, rayleigh_coeff=rayleigh_coeff, divdamp_order=divdamp_order, - is_iau_active=is_iau_active, - iau_wgt_dyn=iau_wgt_dyn, divdamp_type=divdamp_type, divdamp_trans_start=divdamp_trans_start, divdamp_trans_end=divdamp_trans_end, diff --git a/tools/tests/tools/py2fgen/fortran_samples/test_dycore.f90 b/tools/tests/tools/py2fgen/fortran_samples/test_dycore.f90 index 632b8f28c0..e757a5b31a 100644 --- a/tools/tests/tools/py2fgen/fortran_samples/test_dycore.f90 +++ b/tools/tests/tools/py2fgen/fortran_samples/test_dycore.f90 @@ -174,8 +174,6 @@ program solve_nh_simulation integer(c_int), parameter :: rayleigh_type = 1 real(c_double), parameter :: rayleigh_coeff = 0.1 integer(c_int), parameter :: divdamp_order = 24 ! divdamp order can only be 24 - logical(c_int), parameter :: is_iau_active = .false. - real(c_double), parameter :: iau_wgt_dyn = 0.5 real(c_double), parameter :: divdamp_fac_o2 = 0.5 integer(c_int), parameter :: divdamp_type = 1 real(c_double), parameter :: divdamp_trans_start = 1000.0 @@ -755,8 +753,6 @@ program solve_nh_simulation rayleigh_type=rayleigh_type, & rayleigh_coeff=rayleigh_coeff, & divdamp_order=divdamp_order, & - is_iau_active=is_iau_active, & - iau_wgt_dyn=iau_wgt_dyn, & divdamp_type=divdamp_type, & divdamp_trans_start=divdamp_trans_start, & divdamp_trans_end=divdamp_trans_end, & diff --git a/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.f90 b/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.f90 index eb11d9fe70..cad4f5ea8a 100644 --- a/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.f90 +++ b/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.f90 @@ -504,8 +504,6 @@ function solve_nh_init_wrapper(c_lin_e, & rayleigh_type, & rayleigh_coeff, & divdamp_order, & - is_iau_active, & - iau_wgt_dyn, & divdamp_type, & divdamp_trans_start, & divdamp_trans_end, & @@ -825,10 +823,6 @@ function solve_nh_init_wrapper(c_lin_e, & integer(c_int), value, target :: divdamp_order - logical(c_int), value, target :: is_iau_active - - real(c_double), value, target :: iau_wgt_dyn - integer(c_int), value, target :: divdamp_type real(c_double), value, target :: divdamp_trans_start @@ -1524,8 +1518,6 @@ subroutine solve_nh_init(c_lin_e, & rayleigh_type, & rayleigh_coeff, & divdamp_order, & - is_iau_active, & - iau_wgt_dyn, & divdamp_type, & divdamp_trans_start, & divdamp_trans_end, & @@ -1658,10 +1650,6 @@ subroutine solve_nh_init(c_lin_e, & integer(c_int), value, target :: divdamp_order - logical(c_int), value, target :: is_iau_active - - real(c_double), value, target :: iau_wgt_dyn - integer(c_int), value, target :: divdamp_type real(c_double), value, target :: divdamp_trans_start @@ -2236,8 +2224,6 @@ subroutine solve_nh_init(c_lin_e, & rayleigh_type=rayleigh_type, & rayleigh_coeff=rayleigh_coeff, & divdamp_order=divdamp_order, & - is_iau_active=is_iau_active, & - iau_wgt_dyn=iau_wgt_dyn, & divdamp_type=divdamp_type, & divdamp_trans_start=divdamp_trans_start, & divdamp_trans_end=divdamp_trans_end, & @@ -2308,4 +2294,4 @@ subroutine solve_nh_init(c_lin_e, & !$acc end host_data end subroutine solve_nh_init -end module \ No newline at end of file +end module diff --git a/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.h b/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.h index 9886e6791b..f05afe384e 100644 --- a/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.h +++ b/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.h @@ -89,10 +89,10 @@ extern int solve_nh_init_wrapper( int coeff2_dwdz_size_1, double *coeff_gradekin, int coeff_gradekin_size_0, int coeff_gradekin_size_1, int *c_owner_mask, int c_owner_mask_size_0, int itime_scheme, int iadv_rhotheta, int igradp_method, int rayleigh_type, - double rayleigh_coeff, int divdamp_order, int is_iau_active, - double iau_wgt_dyn, int divdamp_type, double divdamp_trans_start, - double divdamp_trans_end, int l_vert_nested, double rhotheta_offctr, - double veladv_offctr, double nudge_max_coeff, double divdamp_fac, - double divdamp_fac2, double divdamp_fac3, double divdamp_fac4, - double divdamp_z, double divdamp_z2, double divdamp_z3, double divdamp_z4, - int nflat_gradp, int backend, int on_gpu); \ No newline at end of file + double rayleigh_coeff, int divdamp_order, int divdamp_type, + double divdamp_trans_start, double divdamp_trans_end, int l_vert_nested, + double rhotheta_offctr, double veladv_offctr, double nudge_max_coeff, + double divdamp_fac, double divdamp_fac2, double divdamp_fac3, + double divdamp_fac4, double divdamp_z, double divdamp_z2, + double divdamp_z3, double divdamp_z4, int nflat_gradp, int backend, + int on_gpu); diff --git a/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.py b/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.py index d7fd6e42f2..6e1ba7338d 100644 --- a/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.py +++ b/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.py @@ -1319,8 +1319,6 @@ def solve_nh_init_wrapper( rayleigh_type, rayleigh_coeff, divdamp_order, - is_iau_active, - iau_wgt_dyn, divdamp_type, divdamp_trans_start, divdamp_trans_end, @@ -1854,8 +1852,6 @@ def solve_nh_init_wrapper( rayleigh_type=rayleigh_type, rayleigh_coeff=rayleigh_coeff, divdamp_order=divdamp_order, - is_iau_active=is_iau_active, - iau_wgt_dyn=iau_wgt_dyn, divdamp_type=divdamp_type, divdamp_trans_start=divdamp_trans_start, divdamp_trans_end=divdamp_trans_end, diff --git a/tools/tests/tools/py2fgen/wrappers/test_dycore_wrapper.py b/tools/tests/tools/py2fgen/wrappers/test_dycore_wrapper.py index d393b91700..3cc53b2de5 100644 --- a/tools/tests/tools/py2fgen/wrappers/test_dycore_wrapper.py +++ b/tools/tests/tools/py2fgen/wrappers/test_dycore_wrapper.py @@ -44,8 +44,6 @@ def solve_nh_init( rayleigh_type = constants.RayleighType.KLEMP rayleigh_coeff = 0.05 divdamp_order = dycore_states.DivergenceDampingOrder.COMBINED - is_iau_active = False - iau_wgt_dyn = 1.0 divdamp_type = 3 divdamp_trans_start = 12500.0 divdamp_trans_end = 17500.0 @@ -210,8 +208,6 @@ def solve_nh_init( rayleigh_type=rayleigh_type, rayleigh_coeff=rayleigh_coeff, divdamp_order=divdamp_order, - is_iau_active=is_iau_active, - iau_wgt_dyn=iau_wgt_dyn, divdamp_type=divdamp_type, divdamp_trans_start=divdamp_trans_start, divdamp_trans_end=divdamp_trans_end, @@ -281,8 +277,6 @@ def test_dycore_wrapper_granule_inputs( rayleigh_type = constants.RayleighType.KLEMP rayleigh_coeff = 0.05 divdamp_order = dycore_states.DivergenceDampingOrder.COMBINED - is_iau_active = False - iau_wgt_dyn = 1.0 divdamp_type = 3 divdamp_trans_start = 12500.0 divdamp_trans_end = 17500.0 @@ -634,8 +628,6 @@ def test_dycore_wrapper_granule_inputs( rayleigh_type=rayleigh_type, rayleigh_coeff=rayleigh_coeff, divdamp_order=divdamp_order, - is_iau_active=is_iau_active, - iau_wgt_dyn=iau_wgt_dyn, divdamp_type=divdamp_type, divdamp_trans_start=divdamp_trans_start, divdamp_trans_end=divdamp_trans_end, From ac7e775c334e39602c9a15d86e70536aa8ee8e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20M=C3=BCller?= Date: Tue, 9 Dec 2025 14:20:56 +0100 Subject: [PATCH 02/18] Add iau as runtime parameter to dycore --- .../model/atmosphere/dycore/solve_nonhydro.py | 44 +++++++++++-------- .../tools/py2fgen/wrappers/dycore_wrapper.py | 4 ++ 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py index 8b939ed6d6..fe25457161 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py @@ -157,8 +157,6 @@ def __init__( rayleigh_type: constants.RayleighType = constants.RayleighType.KLEMP, rayleigh_coeff: float = 0.05, divdamp_order: dycore_states.DivergenceDampingOrder = dycore_states.DivergenceDampingOrder.COMBINED, # the ICON default is 4, - is_iau_active: bool = False, - iau_wgt_dyn: float = 0.0, divdamp_type: dycore_states.DivergenceDampingType = dycore_states.DivergenceDampingType.THREE_DIMENSIONAL, divdamp_trans_start: float = 12500.0, divdamp_trans_end: float = 17500.0, @@ -284,12 +282,6 @@ def __init__( #: use vertical nesting self.l_vert_nested: bool = l_vert_nested - #: from mo_initicon_nml.f90/ mo_initicon_config.f90 - #: whether IAU is active at current time - self.is_iau_active: bool = is_iau_active - #: IAU weight for dynamics fields - self.iau_wgt_dyn: float = iau_wgt_dyn - self._validate() def _validate(self): @@ -470,10 +462,11 @@ def __init__( "ipeidx_dsl": self._metric_state_nonhydro.pg_edgeidx_dsl, "pg_exdist": self._metric_state_nonhydro.pg_exdist, "inv_dual_edge_length": self._edge_geometry.inverse_dual_edge_lengths, - "iau_wgt_dyn": self._config.iau_wgt_dyn, - "is_iau_active": self._config.is_iau_active, "limited_area": self._grid.limited_area, }, + variants={ + "is_iau_active": [False, True], + }, horizontal_sizes={ "start_edge_lateral_boundary": self._start_edge_lateral_boundary, "start_edge_lateral_boundary_level_7": self._start_edge_lateral_boundary_level_7, @@ -503,13 +496,12 @@ def __init__( "geofac_grdiv": self._interpolation_state.geofac_grdiv, "advection_explicit_weight_parameter": self._params.advection_explicit_weight_parameter, "advection_implicit_weight_parameter": self._params.advection_implicit_weight_parameter, - "iau_wgt_dyn": self._config.iau_wgt_dyn, - "is_iau_active": self._config.is_iau_active, "limited_area": self._grid.limited_area, }, variants={ "apply_2nd_order_divergence_damping": [False, True], "apply_4th_order_divergence_damping": [False, True], + "is_iau_active": [False, True], }, horizontal_sizes={ "horizontal_start": gtx.int32(self._start_edge_nudging_level_2), @@ -582,13 +574,12 @@ def __init__( "e_bln_c_s": self._interpolation_state.e_bln_c_s, "wgtfac_c": self._metric_state_nonhydro.wgtfac_c, "wgtfacq_c": self._metric_state_nonhydro.wgtfacq_c, - "iau_wgt_dyn": self._config.iau_wgt_dyn, - "is_iau_active": self._config.is_iau_active, "rayleigh_type": self._config.rayleigh_type, "divdamp_type": self._config.divdamp_type, }, variants={ "at_first_substep": [False, True], + "is_iau_active": [False, True], }, horizontal_sizes={ "start_cell_index_nudging": self._start_cell_nudging, @@ -617,14 +608,13 @@ def __init__( "reference_exner_at_cells_on_model_levels": self._metric_state_nonhydro.reference_exner_at_cells_on_model_levels, "advection_explicit_weight_parameter": self._params.advection_explicit_weight_parameter, "advection_implicit_weight_parameter": self._params.advection_implicit_weight_parameter, - "iau_wgt_dyn": self._config.iau_wgt_dyn, - "is_iau_active": self._config.is_iau_active, "rayleigh_type": self._config.rayleigh_type, }, variants={ "at_first_substep": [False, True], "at_last_substep": [False, True], - "lprep_adv": [False, True], + "prepare_advection": [False, True], + "is_iau_active": [False, True], }, horizontal_sizes={ "start_cell_index_nudging": self._start_cell_nudging, @@ -1038,6 +1028,8 @@ def time_step( lprep_adv: bool, at_first_substep: bool, at_last_substep: bool, + is_iau_active: bool, + iau_wgt_dyn: float, ): """ Update prognostic variables (prognostic_states.next) after the dynamical process over one substep. @@ -1072,6 +1064,8 @@ def time_step( dtime=dtime, at_initial_timestep=at_initial_timestep, at_first_substep=at_first_substep, + is_iau_active=is_iau_active, + iau_wgt_dyn=iau_wgt_dyn, ) self.run_corrector_step( @@ -1085,6 +1079,8 @@ def time_step( lprep_adv=lprep_adv, at_first_substep=at_first_substep, at_last_substep=at_last_substep, + is_iau_active=is_iau_active, + iau_wgt_dyn=iau_wgt_dyn, ) if self._grid.limited_area: self._compute_theta_and_exner( @@ -1115,6 +1111,8 @@ def run_predictor_step( dtime: float, at_initial_timestep: bool, at_first_substep: bool, + is_iau_active: bool, + iau_wgt_dyn: float, ): """ Runs the predictor step of the non-hydrostatic solver. @@ -1185,6 +1183,8 @@ def run_predictor_step( normal_wind_tendency_due_to_slow_physics_process=diagnostic_state_nh.normal_wind_tendency_due_to_slow_physics_process, normal_wind_iau_increment=diagnostic_state_nh.normal_wind_iau_increment, grf_tend_vn=diagnostic_state_nh.grf_tend_vn, + is_iau_active=self._config.is_iau_active, + iau_wgt_dyn=self._config.iau_wgt_dyn, dtime=dtime, ) @@ -1234,6 +1234,8 @@ def run_predictor_step( rayleigh_damping_factor=self._get_rayleigh_damping_factor(dtime), dtime=dtime, at_first_substep=at_first_substep, + is_iau_active=self._config.is_iau_active, + iau_wgt_dyn=self._config.iau_wgt_dyn, ) if self._grid.limited_area: @@ -1280,6 +1282,8 @@ def run_corrector_step( lprep_adv: bool, at_first_substep: bool, at_last_substep: bool, + is_iau_active: bool, + iau_wgt_dyn: float, ): log.info( f"running corrector step: dtime = {dtime}, prep_adv = {lprep_adv}, " @@ -1358,6 +1362,8 @@ def run_corrector_step( dtime=dtime, apply_2nd_order_divergence_damping=apply_2nd_order_divergence_damping, apply_4th_order_divergence_damping=apply_4th_order_divergence_damping, + is_iau_active=self._config.is_iau_active, + iau_wgt_dyn=self._config.iau_wgt_dyn, ) log.debug("exchanging prognostic field 'vn'") @@ -1402,8 +1408,10 @@ def run_corrector_step( exner_tendency_due_to_slow_physics=diagnostic_state_nh.exner_tendency_due_to_slow_physics, rho_iau_increment=diagnostic_state_nh.rho_iau_increment, exner_iau_increment=diagnostic_state_nh.exner_iau_increment, + is_iau_active=self._config.is_iau_active, + iau_wgt_dyn=self._config.iau_wgt_dyn, rayleigh_damping_factor=self._get_rayleigh_damping_factor(dtime), - lprep_adv=lprep_adv, + prepare_advection=lprep_adv, r_nsubsteps=r_nsubsteps, ndyn_substeps_var=float(ndyn_substeps_var), dtime=dtime, diff --git a/tools/src/icon4py/tools/py2fgen/wrappers/dycore_wrapper.py b/tools/src/icon4py/tools/py2fgen/wrappers/dycore_wrapper.py index 2b85c3cfc6..db99cc775d 100644 --- a/tools/src/icon4py/tools/py2fgen/wrappers/dycore_wrapper.py +++ b/tools/src/icon4py/tools/py2fgen/wrappers/dycore_wrapper.py @@ -289,6 +289,8 @@ def solve_nh_run( divdamp_fac_o2: gtx.float64, ndyn_substeps_var: gtx.int32, idyn_timestep: gtx.int32, + is_iau_active: bool, + iau_wgt_dyn: gtx.float64, ): if granule is None: raise RuntimeError("SolveNonhydro granule not initialized. Call 'solve_nh_init' first.") @@ -376,6 +378,8 @@ def solve_nh_run( lprep_adv=lprep_adv, at_first_substep=idyn_timestep == 0, at_last_substep=idyn_timestep == (ndyn_substeps_var - 1), + is_iau_active=is_iau_active, + iau_wgt_dyn=iau_wgt_dyn, ) # TODO(havogt): create separate bindings for writing the timers From 133ed2d96fc43e30a45aad23937f0b14e7a5064f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20M=C3=BCller?= Date: Tue, 9 Dec 2025 14:44:04 +0100 Subject: [PATCH 03/18] Only pre-compile both iau options if there is an actual iau init in icon --- .../src/icon4py/model/atmosphere/dycore/solve_nonhydro.py | 8 ++++---- tools/src/icon4py/tools/py2fgen/wrappers/grid_wrapper.py | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py index fe25457161..b0d68ed56c 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py @@ -465,7 +465,7 @@ def __init__( "limited_area": self._grid.limited_area, }, variants={ - "is_iau_active": [False, True], + "is_iau_active": [False, True] if self._grid.iau_init else [False] }, horizontal_sizes={ "start_edge_lateral_boundary": self._start_edge_lateral_boundary, @@ -501,7 +501,7 @@ def __init__( variants={ "apply_2nd_order_divergence_damping": [False, True], "apply_4th_order_divergence_damping": [False, True], - "is_iau_active": [False, True], + "is_iau_active": [False, True] if self._grid.iau_init else [False] }, horizontal_sizes={ "horizontal_start": gtx.int32(self._start_edge_nudging_level_2), @@ -579,7 +579,7 @@ def __init__( }, variants={ "at_first_substep": [False, True], - "is_iau_active": [False, True], + "is_iau_active": [False, True] if self._grid.iau_init else [False] }, horizontal_sizes={ "start_cell_index_nudging": self._start_cell_nudging, @@ -614,7 +614,7 @@ def __init__( "at_first_substep": [False, True], "at_last_substep": [False, True], "prepare_advection": [False, True], - "is_iau_active": [False, True], + "is_iau_active": [False, True] if self._grid.iau_init else [False] }, horizontal_sizes={ "start_cell_index_nudging": self._start_cell_nudging, diff --git a/tools/src/icon4py/tools/py2fgen/wrappers/grid_wrapper.py b/tools/src/icon4py/tools/py2fgen/wrappers/grid_wrapper.py index f1a30c222a..7b8cee0b0a 100644 --- a/tools/src/icon4py/tools/py2fgen/wrappers/grid_wrapper.py +++ b/tools/src/icon4py/tools/py2fgen/wrappers/grid_wrapper.py @@ -116,6 +116,7 @@ def grid_init( num_edges: gtx.int32, vertical_size: gtx.int32, limited_area: bool, + iau_init: bool backend: gtx.int32, ) -> None: on_gpu = c2e.array_ns != np # TODO(havogt): expose `on_gpu` from py2fgen @@ -145,6 +146,7 @@ def grid_init( num_edges=num_edges, vertical_size=vertical_size, limited_area=limited_area, + iau_init=iau_init, mean_cell_area=mean_cell_area, allocator=allocator, ) From 9b5c3f29b2f8d94de77703e668c0c28f5591a360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20M=C3=BCller?= Date: Thu, 11 Dec 2025 17:39:51 +0100 Subject: [PATCH 04/18] Add komma --- tools/src/icon4py/tools/py2fgen/wrappers/grid_wrapper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/src/icon4py/tools/py2fgen/wrappers/grid_wrapper.py b/tools/src/icon4py/tools/py2fgen/wrappers/grid_wrapper.py index 7b8cee0b0a..92310aa687 100644 --- a/tools/src/icon4py/tools/py2fgen/wrappers/grid_wrapper.py +++ b/tools/src/icon4py/tools/py2fgen/wrappers/grid_wrapper.py @@ -116,7 +116,7 @@ def grid_init( num_edges: gtx.int32, vertical_size: gtx.int32, limited_area: bool, - iau_init: bool + iau_init: bool, backend: gtx.int32, ) -> None: on_gpu = c2e.array_ns != np # TODO(havogt): expose `on_gpu` from py2fgen From 1d1a929f2b94bd4b3749c9233537b039e3afeaf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20M=C3=BCller?= Date: Sun, 14 Dec 2025 12:44:09 +0100 Subject: [PATCH 05/18] Add iau to grid --- model/common/src/icon4py/model/common/grid/base.py | 5 +++++ tools/src/icon4py/tools/py2fgen/wrappers/common.py | 2 ++ 2 files changed, 7 insertions(+) diff --git a/model/common/src/icon4py/model/common/grid/base.py b/model/common/src/icon4py/model/common/grid/base.py index b78c3efed5..741e9b6a63 100644 --- a/model/common/src/icon4py/model/common/grid/base.py +++ b/model/common/src/icon4py/model/common/grid/base.py @@ -51,6 +51,7 @@ class GridConfig: # TODO(halungge): Decouple the vertical from horizontal grid. vertical_size: int limited_area: bool = True + iau_init: bool = False n_shift_total: int = 0 length_rescale_factor: float = 1.0 lvertnest: bool = False @@ -151,6 +152,10 @@ def num_levels(self) -> int: def limited_area(self) -> bool: return self.config.limited_area + @property + def iau_init(self) -> bool: + return self.config.iau_init + def get_connectivity(self, offset: str | gtx.FieldOffset) -> gtx_common.NeighborTable: """Get the connectivity by its name.""" if isinstance(offset, gtx.FieldOffset): diff --git a/tools/src/icon4py/tools/py2fgen/wrappers/common.py b/tools/src/icon4py/tools/py2fgen/wrappers/common.py index f0804e3969..70537a2ba6 100644 --- a/tools/src/icon4py/tools/py2fgen/wrappers/common.py +++ b/tools/src/icon4py/tools/py2fgen/wrappers/common.py @@ -127,6 +127,7 @@ def construct_icon_grid( num_edges: int, vertical_size: int, limited_area: bool, + iau_init: bool, mean_cell_area: gtx.float64, # type:ignore[name-defined] # TODO(): fix type hint allocator: gtx_allocators.FieldBufferAllocationUtil | None, ) -> icon.IconGrid: @@ -172,6 +173,7 @@ def construct_icon_grid( ), vertical_size=vertical_size, limited_area=limited_area, + iau_init=iau_init, keep_skip_values=False, ) From f5b87691203465f3953ebc4500c95bfb228047f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20M=C3=BCller?= Date: Sun, 14 Dec 2025 17:52:49 +0100 Subject: [PATCH 06/18] Undo prepare_advection renaming --- .../src/icon4py/model/atmosphere/dycore/solve_nonhydro.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py index b0d68ed56c..eff3b681a7 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py @@ -613,7 +613,7 @@ def __init__( variants={ "at_first_substep": [False, True], "at_last_substep": [False, True], - "prepare_advection": [False, True], + "lprep_adv": [False, True], "is_iau_active": [False, True] if self._grid.iau_init else [False] }, horizontal_sizes={ @@ -1411,7 +1411,7 @@ def run_corrector_step( is_iau_active=self._config.is_iau_active, iau_wgt_dyn=self._config.iau_wgt_dyn, rayleigh_damping_factor=self._get_rayleigh_damping_factor(dtime), - prepare_advection=lprep_adv, + lprep_adv=lprep_adv, r_nsubsteps=r_nsubsteps, ndyn_substeps_var=float(ndyn_substeps_var), dtime=dtime, From be7be0ad048254b2028fb6d26fad016e5b8f3d8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20M=C3=BCller?= Date: Fri, 19 Dec 2025 15:39:06 +0100 Subject: [PATCH 07/18] Use arguments passed to nonhydro stepping function --- .../model/atmosphere/dycore/solve_nonhydro.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py index eff3b681a7..95d54d1491 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py @@ -1183,8 +1183,8 @@ def run_predictor_step( normal_wind_tendency_due_to_slow_physics_process=diagnostic_state_nh.normal_wind_tendency_due_to_slow_physics_process, normal_wind_iau_increment=diagnostic_state_nh.normal_wind_iau_increment, grf_tend_vn=diagnostic_state_nh.grf_tend_vn, - is_iau_active=self._config.is_iau_active, - iau_wgt_dyn=self._config.iau_wgt_dyn, + is_iau_active=is_iau_active, + iau_wgt_dyn=iau_wgt_dyn, dtime=dtime, ) @@ -1234,8 +1234,8 @@ def run_predictor_step( rayleigh_damping_factor=self._get_rayleigh_damping_factor(dtime), dtime=dtime, at_first_substep=at_first_substep, - is_iau_active=self._config.is_iau_active, - iau_wgt_dyn=self._config.iau_wgt_dyn, + is_iau_active=is_iau_active, + iau_wgt_dyn=iau_wgt_dyn, ) if self._grid.limited_area: @@ -1362,8 +1362,8 @@ def run_corrector_step( dtime=dtime, apply_2nd_order_divergence_damping=apply_2nd_order_divergence_damping, apply_4th_order_divergence_damping=apply_4th_order_divergence_damping, - is_iau_active=self._config.is_iau_active, - iau_wgt_dyn=self._config.iau_wgt_dyn, + is_iau_active=is_iau_active, + iau_wgt_dyn=iau_wgt_dyn, ) log.debug("exchanging prognostic field 'vn'") @@ -1408,8 +1408,8 @@ def run_corrector_step( exner_tendency_due_to_slow_physics=diagnostic_state_nh.exner_tendency_due_to_slow_physics, rho_iau_increment=diagnostic_state_nh.rho_iau_increment, exner_iau_increment=diagnostic_state_nh.exner_iau_increment, - is_iau_active=self._config.is_iau_active, - iau_wgt_dyn=self._config.iau_wgt_dyn, + is_iau_active=is_iau_active, + iau_wgt_dyn=iau_wgt_dyn, rayleigh_damping_factor=self._get_rayleigh_damping_factor(dtime), lprep_adv=lprep_adv, r_nsubsteps=r_nsubsteps, From c4408c6af8903c16fc31a0ee7bfc5f92cc8617f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20M=C3=BCller?= Date: Thu, 26 Feb 2026 12:15:01 +0100 Subject: [PATCH 08/18] Fix formatting and unit tests --- .../icon4py/model/atmosphere/dycore/solve_nonhydro.py | 10 ++++------ .../integration_tests/test_benchmark_solve_nonhydro.py | 1 - .../dycore/mpi_tests/test_parallel_solve_nonhydro.py | 2 ++ model/testing/src/icon4py/model/testing/definitions.py | 1 - 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py index 76dbf0e1ba..7726606980 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py @@ -457,9 +457,7 @@ def __init__( "inv_dual_edge_length": self._edge_geometry.inverse_dual_edge_lengths, "limited_area": self._grid.limited_area, }, - variants={ - "is_iau_active": [False, True] if self._grid.iau_init else [False] - }, + variants={"is_iau_active": [False, True] if self._grid.iau_init else [False]}, horizontal_sizes={ "start_edge_lateral_boundary": self._start_edge_lateral_boundary, "start_edge_lateral_boundary_level_7": self._start_edge_lateral_boundary_level_7, @@ -498,7 +496,7 @@ def __init__( variants={ "apply_2nd_order_divergence_damping": [False, True], "apply_4th_order_divergence_damping": [False, True], - "is_iau_active": [False, True] if self._grid.iau_init else [False] + "is_iau_active": [False, True] if self._grid.iau_init else [False], }, horizontal_sizes={ "horizontal_start": gtx.int32(self._start_edge_nudging_level_2), @@ -576,7 +574,7 @@ def __init__( }, variants={ "at_first_substep": [False, True], - "is_iau_active": [False, True] if self._grid.iau_init else [False] + "is_iau_active": [False, True] if self._grid.iau_init else [False], }, horizontal_sizes={ "start_cell_index_nudging": self._start_cell_nudging, @@ -611,7 +609,7 @@ def __init__( "at_first_substep": [False, True], "at_last_substep": [False, True], "lprep_adv": [False, True], - "is_iau_active": [False, True] if self._grid.iau_init else [False] + "is_iau_active": [False, True] if self._grid.iau_init else [False], }, horizontal_sizes={ "start_cell_index_nudging": self._start_cell_nudging, diff --git a/model/atmosphere/dycore/tests/dycore/integration_tests/test_benchmark_solve_nonhydro.py b/model/atmosphere/dycore/tests/dycore/integration_tests/test_benchmark_solve_nonhydro.py index 3224ce7065..b1093470a3 100644 --- a/model/atmosphere/dycore/tests/dycore/integration_tests/test_benchmark_solve_nonhydro.py +++ b/model/atmosphere/dycore/tests/dycore/integration_tests/test_benchmark_solve_nonhydro.py @@ -55,7 +55,6 @@ def solve_nonhydro( config = solve_nh.NonHydrostaticConfig( rayleigh_coeff=0.1, divdamp_order=dycore_states.DivergenceDampingOrder.COMBINED, # type: ignore[arg-type] - iau_wgt_dyn=1.0, fourth_order_divdamp_factor=0.004, max_nudging_coefficient=0.375, ) diff --git a/model/atmosphere/dycore/tests/dycore/mpi_tests/test_parallel_solve_nonhydro.py b/model/atmosphere/dycore/tests/dycore/mpi_tests/test_parallel_solve_nonhydro.py index ea57fde4c1..1af60f0083 100644 --- a/model/atmosphere/dycore/tests/dycore/mpi_tests/test_parallel_solve_nonhydro.py +++ b/model/atmosphere/dycore/tests/dycore/mpi_tests/test_parallel_solve_nonhydro.py @@ -152,6 +152,8 @@ def test_run_solve_nonhydro_single_step( lprep_adv=lprep_adv, at_first_substep=(substep_init == 1), at_last_substep=(substep_init == ndyn_substeps), + is_iau_active=False, + iau_wgt_dyn=0.0, ) print(f"rank={processor_props.rank}/{processor_props.comm_size}: dycore step run ") diff --git a/model/testing/src/icon4py/model/testing/definitions.py b/model/testing/src/icon4py/model/testing/definitions.py index 0668ffca5a..f15b1ad8c4 100644 --- a/model/testing/src/icon4py/model/testing/definitions.py +++ b/model/testing/src/icon4py/model/testing/definitions.py @@ -245,7 +245,6 @@ def construct_nonhydrostatic_config(experiment: Experiment) -> solve_nh.NonHydro if experiment == Experiments.MCH_CH_R04B09: return solve_nh.NonHydrostaticConfig( divdamp_order=dycore_states.DivergenceDampingOrder.COMBINED, # type: ignore[arg-type] # TODO(havogt): typing in `NonHydrostaticConfig` needs to be fixed - iau_wgt_dyn=1.0, fourth_order_divdamp_factor=0.004, max_nudging_coefficient=0.375, ) From cf0c69c20d1e8c85a04f7ef396ebd0407fe0cc93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20M=C3=BCller?= Date: Thu, 26 Feb 2026 17:20:24 +0100 Subject: [PATCH 09/18] Update tests --- .../wrappers/references/diffusion/diffusion.h | 31 +----- .../wrappers/references/dycore/dycore.f90 | 16 ++- .../wrappers/references/dycore/dycore.h | 99 +------------------ .../wrappers/references/dycore/dycore.py | 4 + .../py2fgen/wrappers/references/grid/grid.f90 | 7 ++ .../py2fgen/wrappers/references/grid/grid.h | 45 +-------- .../py2fgen/wrappers/references/grid/grid.py | 2 + .../py2fgen/wrappers/test_dycore_wrapper.py | 6 ++ .../tools/py2fgen/wrappers/test_grid_init.py | 1 + 9 files changed, 40 insertions(+), 171 deletions(-) diff --git a/tools/tests/tools/py2fgen/wrappers/references/diffusion/diffusion.h b/tools/tests/tools/py2fgen/wrappers/references/diffusion/diffusion.h index 833b38ff3d..c634661271 100644 --- a/tools/tests/tools/py2fgen/wrappers/references/diffusion/diffusion.h +++ b/tools/tests/tools/py2fgen/wrappers/references/diffusion/diffusion.h @@ -1,29 +1,2 @@ -extern int diffusion_run_wrapper( - double *w, int w_size_0, int w_size_1, double *vn, int vn_size_0, - int vn_size_1, double *exner, int exner_size_0, int exner_size_1, - double *theta_v, int theta_v_size_0, int theta_v_size_1, double *rho, - int rho_size_0, int rho_size_1, double *hdef_ic, int hdef_ic_size_0, - int hdef_ic_size_1, double *div_ic, int div_ic_size_0, int div_ic_size_1, - double *dwdx, int dwdx_size_0, int dwdx_size_1, double *dwdy, - int dwdy_size_0, int dwdy_size_1, double dtime, int linit, int on_gpu); -extern int diffusion_init_wrapper( - double *theta_ref_mc, int theta_ref_mc_size_0, int theta_ref_mc_size_1, - double *wgtfac_c, int wgtfac_c_size_0, int wgtfac_c_size_1, - double *e_bln_c_s, int e_bln_c_s_size_0, int e_bln_c_s_size_1, - double *geofac_div, int geofac_div_size_0, int geofac_div_size_1, - double *geofac_grg_x, int geofac_grg_x_size_0, int geofac_grg_x_size_1, - double *geofac_grg_y, int geofac_grg_y_size_0, int geofac_grg_y_size_1, - double *geofac_n2s, int geofac_n2s_size_0, int geofac_n2s_size_1, - double *nudgecoeff_e, int nudgecoeff_e_size_0, double *rbf_coeff_1, - int rbf_coeff_1_size_0, int rbf_coeff_1_size_1, double *rbf_coeff_2, - int rbf_coeff_2_size_0, int rbf_coeff_2_size_1, int *mask_hdiff, - int mask_hdiff_size_0, int mask_hdiff_size_1, double *zd_diffcoef, - int zd_diffcoef_size_0, int zd_diffcoef_size_1, int *zd_vertoffset, - int zd_vertoffset_size_0, int zd_vertoffset_size_1, - int zd_vertoffset_size_2, double *zd_intcoef, int zd_intcoef_size_0, - int zd_intcoef_size_1, int zd_intcoef_size_2, int ndyn_substeps, - int diffusion_type, int hdiff_w, int hdiff_vn, int zdiffu_t, - int type_t_diffu, int type_vn_diffu, double hdiff_efdt_ratio, - double smagorinski_scaling_factor, int hdiff_temp, double thslp_zdiffu, - double thhgtd_zdiffu, double denom_diffu_v, double nudge_max_coeff, - int itype_sher, int ltkeshs, int backend, int on_gpu); \ No newline at end of file +extern int diffusion_run_wrapper(double* w, int w_size_0, int w_size_1, double* vn, int vn_size_0, int vn_size_1, double* exner, int exner_size_0, int exner_size_1, double* theta_v, int theta_v_size_0, int theta_v_size_1, double* rho, int rho_size_0, int rho_size_1, double* hdef_ic, int hdef_ic_size_0, int hdef_ic_size_1, double* div_ic, int div_ic_size_0, int div_ic_size_1, double* dwdx, int dwdx_size_0, int dwdx_size_1, double* dwdy, int dwdy_size_0, int dwdy_size_1, double dtime, int linit, int on_gpu); +extern int diffusion_init_wrapper(double* theta_ref_mc, int theta_ref_mc_size_0, int theta_ref_mc_size_1, double* wgtfac_c, int wgtfac_c_size_0, int wgtfac_c_size_1, double* e_bln_c_s, int e_bln_c_s_size_0, int e_bln_c_s_size_1, double* geofac_div, int geofac_div_size_0, int geofac_div_size_1, double* geofac_grg_x, int geofac_grg_x_size_0, int geofac_grg_x_size_1, double* geofac_grg_y, int geofac_grg_y_size_0, int geofac_grg_y_size_1, double* geofac_n2s, int geofac_n2s_size_0, int geofac_n2s_size_1, double* nudgecoeff_e, int nudgecoeff_e_size_0, double* rbf_coeff_1, int rbf_coeff_1_size_0, int rbf_coeff_1_size_1, double* rbf_coeff_2, int rbf_coeff_2_size_0, int rbf_coeff_2_size_1, int* mask_hdiff, int mask_hdiff_size_0, int mask_hdiff_size_1, double* zd_diffcoef, int zd_diffcoef_size_0, int zd_diffcoef_size_1, int* zd_vertoffset, int zd_vertoffset_size_0, int zd_vertoffset_size_1, int zd_vertoffset_size_2, double* zd_intcoef, int zd_intcoef_size_0, int zd_intcoef_size_1, int zd_intcoef_size_2, int ndyn_substeps, int diffusion_type, int hdiff_w, int hdiff_vn, int zdiffu_t, int type_t_diffu, int type_vn_diffu, double hdiff_efdt_ratio, double smagorinski_scaling_factor, int hdiff_temp, double thslp_zdiffu, double thhgtd_zdiffu, double denom_diffu_v, double nudge_max_coeff, int itype_sher, int ltkeshs, int backend, int on_gpu); \ No newline at end of file diff --git a/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.f90 b/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.f90 index 660749c36c..9c6cdcf681 100644 --- a/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.f90 +++ b/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.f90 @@ -121,6 +121,8 @@ function solve_nh_run_wrapper(rho_now, & divdamp_fac_o2, & ndyn_substeps_var, & idyn_timestep, & + is_iau_active, & + iau_wgt_dyn, & on_gpu) bind(c, name="solve_nh_run_wrapper") result(rc) import :: c_int, c_double, c_bool, c_ptr integer(c_int) :: rc ! Stores the return code @@ -351,6 +353,10 @@ function solve_nh_run_wrapper(rho_now, & integer(c_int), value, target :: idyn_timestep + logical(c_int), value, target :: is_iau_active + + real(c_double), value, target :: iau_wgt_dyn + logical(c_int), value :: on_gpu end function solve_nh_run_wrapper @@ -901,6 +907,8 @@ subroutine solve_nh_run(rho_now, & divdamp_fac_o2, & ndyn_substeps_var, & idyn_timestep, & + is_iau_active, & + iau_wgt_dyn, & rc) use, intrinsic :: iso_c_binding @@ -988,6 +996,10 @@ subroutine solve_nh_run(rho_now, & integer(c_int), value, target :: idyn_timestep + logical(c_int), value, target :: is_iau_active + + real(c_double), value, target :: iau_wgt_dyn + logical(c_int) :: on_gpu integer(c_int) :: rho_now_size_0 @@ -1418,6 +1430,8 @@ subroutine solve_nh_run(rho_now, & divdamp_fac_o2=divdamp_fac_o2, & ndyn_substeps_var=ndyn_substeps_var, & idyn_timestep=idyn_timestep, & + is_iau_active=is_iau_active, & + iau_wgt_dyn=iau_wgt_dyn, & on_gpu=on_gpu) !$acc end host_data !$acc end host_data @@ -2277,4 +2291,4 @@ subroutine solve_nh_init(c_lin_e, & !$acc end host_data end subroutine solve_nh_init -end module +end module \ No newline at end of file diff --git a/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.h b/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.h index ebd579c4b3..3bb6677983 100644 --- a/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.h +++ b/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.h @@ -1,97 +1,2 @@ -extern int solve_nh_run_wrapper( - double *rho_now, int rho_now_size_0, int rho_now_size_1, double *rho_new, - int rho_new_size_0, int rho_new_size_1, double *exner_now, - int exner_now_size_0, int exner_now_size_1, double *exner_new, - int exner_new_size_0, int exner_new_size_1, double *w_now, int w_now_size_0, - int w_now_size_1, double *w_new, int w_new_size_0, int w_new_size_1, - double *theta_v_now, int theta_v_now_size_0, int theta_v_now_size_1, - double *theta_v_new, int theta_v_new_size_0, int theta_v_new_size_1, - double *vn_now, int vn_now_size_0, int vn_now_size_1, double *vn_new, - int vn_new_size_0, int vn_new_size_1, double *w_concorr_c, - int w_concorr_c_size_0, int w_concorr_c_size_1, double *ddt_vn_apc_ntl1, - int ddt_vn_apc_ntl1_size_0, int ddt_vn_apc_ntl1_size_1, - double *ddt_vn_apc_ntl2, int ddt_vn_apc_ntl2_size_0, - int ddt_vn_apc_ntl2_size_1, double *ddt_w_adv_ntl1, - int ddt_w_adv_ntl1_size_0, int ddt_w_adv_ntl1_size_1, - double *ddt_w_adv_ntl2, int ddt_w_adv_ntl2_size_0, - int ddt_w_adv_ntl2_size_1, double *theta_v_ic, int theta_v_ic_size_0, - int theta_v_ic_size_1, double *rho_ic, int rho_ic_size_0, int rho_ic_size_1, - double *exner_pr, int exner_pr_size_0, int exner_pr_size_1, - double *exner_dyn_incr, int exner_dyn_incr_size_0, - int exner_dyn_incr_size_1, double *ddt_exner_phy, int ddt_exner_phy_size_0, - int ddt_exner_phy_size_1, double *grf_tend_rho, int grf_tend_rho_size_0, - int grf_tend_rho_size_1, double *grf_tend_thv, int grf_tend_thv_size_0, - int grf_tend_thv_size_1, double *grf_tend_w, int grf_tend_w_size_0, - int grf_tend_w_size_1, double *mass_fl_e, int mass_fl_e_size_0, - int mass_fl_e_size_1, double *ddt_vn_phy, int ddt_vn_phy_size_0, - int ddt_vn_phy_size_1, double *grf_tend_vn, int grf_tend_vn_size_0, - int grf_tend_vn_size_1, double *vn_ie, int vn_ie_size_0, int vn_ie_size_1, - double *vt, int vt_size_0, int vt_size_1, double *vn_incr, - int vn_incr_size_0, int vn_incr_size_1, double *rho_incr, - int rho_incr_size_0, int rho_incr_size_1, double *exner_incr, - int exner_incr_size_0, int exner_incr_size_1, double *mass_flx_me, - int mass_flx_me_size_0, int mass_flx_me_size_1, double *mass_flx_ic, - int mass_flx_ic_size_0, int mass_flx_ic_size_1, double *vol_flx_ic, - int vol_flx_ic_size_0, int vol_flx_ic_size_1, double *vn_traj, - int vn_traj_size_0, int vn_traj_size_1, double dtime, - double *max_vcfl_size1_array, int max_vcfl_size1_array_size_0, - int lprep_adv, int at_initial_timestep, double divdamp_fac_o2, - int ndyn_substeps_var, int idyn_timestep, int on_gpu); -extern int solve_nh_init_wrapper( - double *c_lin_e, int c_lin_e_size_0, int c_lin_e_size_1, double *c_intp, - int c_intp_size_0, int c_intp_size_1, double *e_flx_avg, - int e_flx_avg_size_0, int e_flx_avg_size_1, double *geofac_grdiv, - int geofac_grdiv_size_0, int geofac_grdiv_size_1, double *geofac_rot, - int geofac_rot_size_0, int geofac_rot_size_1, double *pos_on_tplane_e_1, - int pos_on_tplane_e_1_size_0, int pos_on_tplane_e_1_size_1, - double *pos_on_tplane_e_2, int pos_on_tplane_e_2_size_0, - int pos_on_tplane_e_2_size_1, double *rbf_vec_coeff_e, - int rbf_vec_coeff_e_size_0, int rbf_vec_coeff_e_size_1, double *e_bln_c_s, - int e_bln_c_s_size_0, int e_bln_c_s_size_1, double *rbf_coeff_1, - int rbf_coeff_1_size_0, int rbf_coeff_1_size_1, double *rbf_coeff_2, - int rbf_coeff_2_size_0, int rbf_coeff_2_size_1, double *geofac_div, - int geofac_div_size_0, int geofac_div_size_1, double *geofac_n2s, - int geofac_n2s_size_0, int geofac_n2s_size_1, double *geofac_grg_x, - int geofac_grg_x_size_0, int geofac_grg_x_size_1, double *geofac_grg_y, - int geofac_grg_y_size_0, int geofac_grg_y_size_1, double *nudgecoeff_e, - int nudgecoeff_e_size_0, int *mask_prog_halo_c, int mask_prog_halo_c_size_0, - double *rayleigh_w, int rayleigh_w_size_0, double *exner_exfac, - int exner_exfac_size_0, int exner_exfac_size_1, double *exner_ref_mc, - int exner_ref_mc_size_0, int exner_ref_mc_size_1, double *wgtfac_c, - int wgtfac_c_size_0, int wgtfac_c_size_1, double *wgtfacq_c, - int wgtfacq_c_size_0, int wgtfacq_c_size_1, double *inv_ddqz_z_full, - int inv_ddqz_z_full_size_0, int inv_ddqz_z_full_size_1, double *rho_ref_mc, - int rho_ref_mc_size_0, int rho_ref_mc_size_1, double *theta_ref_mc, - int theta_ref_mc_size_0, int theta_ref_mc_size_1, double *vwind_expl_wgt, - int vwind_expl_wgt_size_0, double *d_exner_dz_ref_ic, - int d_exner_dz_ref_ic_size_0, int d_exner_dz_ref_ic_size_1, - double *ddqz_z_half, int ddqz_z_half_size_0, int ddqz_z_half_size_1, - double *theta_ref_ic, int theta_ref_ic_size_0, int theta_ref_ic_size_1, - double *d2dexdz2_fac1_mc, int d2dexdz2_fac1_mc_size_0, - int d2dexdz2_fac1_mc_size_1, double *d2dexdz2_fac2_mc, - int d2dexdz2_fac2_mc_size_0, int d2dexdz2_fac2_mc_size_1, - double *rho_ref_me, int rho_ref_me_size_0, int rho_ref_me_size_1, - double *theta_ref_me, int theta_ref_me_size_0, int theta_ref_me_size_1, - double *ddxn_z_full, int ddxn_z_full_size_0, int ddxn_z_full_size_1, - double *zdiff_gradp, int zdiff_gradp_size_0, int zdiff_gradp_size_1, - int zdiff_gradp_size_2, int *vertoffset_gradp, int vertoffset_gradp_size_0, - int vertoffset_gradp_size_1, int vertoffset_gradp_size_2, int *ipeidx_dsl, - int ipeidx_dsl_size_0, int ipeidx_dsl_size_1, double *pg_exdist, - int pg_exdist_size_0, int pg_exdist_size_1, double *ddqz_z_full_e, - int ddqz_z_full_e_size_0, int ddqz_z_full_e_size_1, double *ddxt_z_full, - int ddxt_z_full_size_0, int ddxt_z_full_size_1, double *wgtfac_e, - int wgtfac_e_size_0, int wgtfac_e_size_1, double *wgtfacq_e, - int wgtfacq_e_size_0, int wgtfacq_e_size_1, double *vwind_impl_wgt, - int vwind_impl_wgt_size_0, double *hmask_dd3d, int hmask_dd3d_size_0, - double *scalfac_dd3d, int scalfac_dd3d_size_0, double *coeff1_dwdz, - int coeff1_dwdz_size_0, int coeff1_dwdz_size_1, double *coeff2_dwdz, - int coeff2_dwdz_size_0, int coeff2_dwdz_size_1, double *coeff_gradekin, - int coeff_gradekin_size_0, int coeff_gradekin_size_1, int *c_owner_mask, - int c_owner_mask_size_0, int itime_scheme, int iadv_rhotheta, - int igradp_method, int rayleigh_type, double rayleigh_coeff, - int divdamp_order, int divdamp_type, double divdamp_trans_start, - double divdamp_trans_end, int l_vert_nested, double rhotheta_offctr, - double veladv_offctr, double nudge_max_coeff, double divdamp_fac, - double divdamp_fac2, double divdamp_fac3, double divdamp_fac4, - double divdamp_z, double divdamp_z2, double divdamp_z3, - double divdamp_z4, int nflat_gradp, int backend, int on_gpu); +extern int solve_nh_run_wrapper(double* rho_now, int rho_now_size_0, int rho_now_size_1, double* rho_new, int rho_new_size_0, int rho_new_size_1, double* exner_now, int exner_now_size_0, int exner_now_size_1, double* exner_new, int exner_new_size_0, int exner_new_size_1, double* w_now, int w_now_size_0, int w_now_size_1, double* w_new, int w_new_size_0, int w_new_size_1, double* theta_v_now, int theta_v_now_size_0, int theta_v_now_size_1, double* theta_v_new, int theta_v_new_size_0, int theta_v_new_size_1, double* vn_now, int vn_now_size_0, int vn_now_size_1, double* vn_new, int vn_new_size_0, int vn_new_size_1, double* w_concorr_c, int w_concorr_c_size_0, int w_concorr_c_size_1, double* ddt_vn_apc_ntl1, int ddt_vn_apc_ntl1_size_0, int ddt_vn_apc_ntl1_size_1, double* ddt_vn_apc_ntl2, int ddt_vn_apc_ntl2_size_0, int ddt_vn_apc_ntl2_size_1, double* ddt_w_adv_ntl1, int ddt_w_adv_ntl1_size_0, int ddt_w_adv_ntl1_size_1, double* ddt_w_adv_ntl2, int ddt_w_adv_ntl2_size_0, int ddt_w_adv_ntl2_size_1, double* theta_v_ic, int theta_v_ic_size_0, int theta_v_ic_size_1, double* rho_ic, int rho_ic_size_0, int rho_ic_size_1, double* exner_pr, int exner_pr_size_0, int exner_pr_size_1, double* exner_dyn_incr, int exner_dyn_incr_size_0, int exner_dyn_incr_size_1, double* ddt_exner_phy, int ddt_exner_phy_size_0, int ddt_exner_phy_size_1, double* grf_tend_rho, int grf_tend_rho_size_0, int grf_tend_rho_size_1, double* grf_tend_thv, int grf_tend_thv_size_0, int grf_tend_thv_size_1, double* grf_tend_w, int grf_tend_w_size_0, int grf_tend_w_size_1, double* mass_fl_e, int mass_fl_e_size_0, int mass_fl_e_size_1, double* ddt_vn_phy, int ddt_vn_phy_size_0, int ddt_vn_phy_size_1, double* grf_tend_vn, int grf_tend_vn_size_0, int grf_tend_vn_size_1, double* vn_ie, int vn_ie_size_0, int vn_ie_size_1, double* vt, int vt_size_0, int vt_size_1, double* vn_incr, int vn_incr_size_0, int vn_incr_size_1, double* rho_incr, int rho_incr_size_0, int rho_incr_size_1, double* exner_incr, int exner_incr_size_0, int exner_incr_size_1, double* mass_flx_me, int mass_flx_me_size_0, int mass_flx_me_size_1, double* mass_flx_ic, int mass_flx_ic_size_0, int mass_flx_ic_size_1, double* vol_flx_ic, int vol_flx_ic_size_0, int vol_flx_ic_size_1, double* vn_traj, int vn_traj_size_0, int vn_traj_size_1, double dtime, double* max_vcfl_size1_array, int max_vcfl_size1_array_size_0, int lprep_adv, int at_initial_timestep, double divdamp_fac_o2, int ndyn_substeps_var, int idyn_timestep, int is_iau_active, double iau_wgt_dyn, int on_gpu); +extern int solve_nh_init_wrapper(double* c_lin_e, int c_lin_e_size_0, int c_lin_e_size_1, double* c_intp, int c_intp_size_0, int c_intp_size_1, double* e_flx_avg, int e_flx_avg_size_0, int e_flx_avg_size_1, double* geofac_grdiv, int geofac_grdiv_size_0, int geofac_grdiv_size_1, double* geofac_rot, int geofac_rot_size_0, int geofac_rot_size_1, double* pos_on_tplane_e_1, int pos_on_tplane_e_1_size_0, int pos_on_tplane_e_1_size_1, double* pos_on_tplane_e_2, int pos_on_tplane_e_2_size_0, int pos_on_tplane_e_2_size_1, double* rbf_vec_coeff_e, int rbf_vec_coeff_e_size_0, int rbf_vec_coeff_e_size_1, double* e_bln_c_s, int e_bln_c_s_size_0, int e_bln_c_s_size_1, double* rbf_coeff_1, int rbf_coeff_1_size_0, int rbf_coeff_1_size_1, double* rbf_coeff_2, int rbf_coeff_2_size_0, int rbf_coeff_2_size_1, double* geofac_div, int geofac_div_size_0, int geofac_div_size_1, double* geofac_n2s, int geofac_n2s_size_0, int geofac_n2s_size_1, double* geofac_grg_x, int geofac_grg_x_size_0, int geofac_grg_x_size_1, double* geofac_grg_y, int geofac_grg_y_size_0, int geofac_grg_y_size_1, double* nudgecoeff_e, int nudgecoeff_e_size_0, int* mask_prog_halo_c, int mask_prog_halo_c_size_0, double* rayleigh_w, int rayleigh_w_size_0, double* exner_exfac, int exner_exfac_size_0, int exner_exfac_size_1, double* exner_ref_mc, int exner_ref_mc_size_0, int exner_ref_mc_size_1, double* wgtfac_c, int wgtfac_c_size_0, int wgtfac_c_size_1, double* wgtfacq_c, int wgtfacq_c_size_0, int wgtfacq_c_size_1, double* inv_ddqz_z_full, int inv_ddqz_z_full_size_0, int inv_ddqz_z_full_size_1, double* rho_ref_mc, int rho_ref_mc_size_0, int rho_ref_mc_size_1, double* theta_ref_mc, int theta_ref_mc_size_0, int theta_ref_mc_size_1, double* vwind_expl_wgt, int vwind_expl_wgt_size_0, double* d_exner_dz_ref_ic, int d_exner_dz_ref_ic_size_0, int d_exner_dz_ref_ic_size_1, double* ddqz_z_half, int ddqz_z_half_size_0, int ddqz_z_half_size_1, double* theta_ref_ic, int theta_ref_ic_size_0, int theta_ref_ic_size_1, double* d2dexdz2_fac1_mc, int d2dexdz2_fac1_mc_size_0, int d2dexdz2_fac1_mc_size_1, double* d2dexdz2_fac2_mc, int d2dexdz2_fac2_mc_size_0, int d2dexdz2_fac2_mc_size_1, double* rho_ref_me, int rho_ref_me_size_0, int rho_ref_me_size_1, double* theta_ref_me, int theta_ref_me_size_0, int theta_ref_me_size_1, double* ddxn_z_full, int ddxn_z_full_size_0, int ddxn_z_full_size_1, double* zdiff_gradp, int zdiff_gradp_size_0, int zdiff_gradp_size_1, int zdiff_gradp_size_2, int* vertoffset_gradp, int vertoffset_gradp_size_0, int vertoffset_gradp_size_1, int vertoffset_gradp_size_2, int* ipeidx_dsl, int ipeidx_dsl_size_0, int ipeidx_dsl_size_1, double* pg_exdist, int pg_exdist_size_0, int pg_exdist_size_1, double* ddqz_z_full_e, int ddqz_z_full_e_size_0, int ddqz_z_full_e_size_1, double* ddxt_z_full, int ddxt_z_full_size_0, int ddxt_z_full_size_1, double* wgtfac_e, int wgtfac_e_size_0, int wgtfac_e_size_1, double* wgtfacq_e, int wgtfacq_e_size_0, int wgtfacq_e_size_1, double* vwind_impl_wgt, int vwind_impl_wgt_size_0, double* hmask_dd3d, int hmask_dd3d_size_0, double* scalfac_dd3d, int scalfac_dd3d_size_0, double* coeff1_dwdz, int coeff1_dwdz_size_0, int coeff1_dwdz_size_1, double* coeff2_dwdz, int coeff2_dwdz_size_0, int coeff2_dwdz_size_1, double* coeff_gradekin, int coeff_gradekin_size_0, int coeff_gradekin_size_1, int* c_owner_mask, int c_owner_mask_size_0, int itime_scheme, int iadv_rhotheta, int igradp_method, int rayleigh_type, double rayleigh_coeff, int divdamp_order, int divdamp_type, double divdamp_trans_start, double divdamp_trans_end, int l_vert_nested, double rhotheta_offctr, double veladv_offctr, double nudge_max_coeff, double divdamp_fac, double divdamp_fac2, double divdamp_fac3, double divdamp_fac4, double divdamp_z, double divdamp_z2, double divdamp_z3, double divdamp_z4, int nflat_gradp, int backend, int on_gpu); \ No newline at end of file diff --git a/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.py b/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.py index 7c2980e247..9e92072d53 100644 --- a/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.py +++ b/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.py @@ -137,6 +137,8 @@ def solve_nh_run_wrapper( divdamp_fac_o2, ndyn_substeps_var, idyn_timestep, + is_iau_active, + iau_wgt_dyn, on_gpu, ): with runtime_config.HOOK_BINDINGS_FUNCTION["solve_nh_run"]: @@ -566,6 +568,8 @@ def solve_nh_run_wrapper( divdamp_fac_o2=divdamp_fac_o2, ndyn_substeps_var=ndyn_substeps_var, idyn_timestep=idyn_timestep, + is_iau_active=is_iau_active, + iau_wgt_dyn=iau_wgt_dyn, ) if __debug__: diff --git a/tools/tests/tools/py2fgen/wrappers/references/grid/grid.f90 b/tools/tests/tools/py2fgen/wrappers/references/grid/grid.f90 index 924e4ff898..a63111e68d 100644 --- a/tools/tests/tools/py2fgen/wrappers/references/grid/grid.f90 +++ b/tools/tests/tools/py2fgen/wrappers/references/grid/grid.f90 @@ -123,6 +123,7 @@ function grid_init_wrapper(cell_starts, & num_edges, & vertical_size, & limited_area, & + iau_init, & backend, & on_gpu) bind(c, name="grid_init_wrapper") result(rc) import :: c_int, c_double, c_bool, c_ptr @@ -362,6 +363,8 @@ function grid_init_wrapper(cell_starts, & logical(c_int), value, target :: limited_area + logical(c_int), value, target :: iau_init + integer(c_int), value, target :: backend logical(c_int), value :: on_gpu @@ -428,6 +431,7 @@ subroutine grid_init(cell_starts, & num_edges, & vertical_size, & limited_area, & + iau_init, & backend, & rc) use, intrinsic :: iso_c_binding @@ -544,6 +548,8 @@ subroutine grid_init(cell_starts, & logical(c_int), value, target :: limited_area + logical(c_int), value, target :: iau_init + integer(c_int), value, target :: backend logical(c_int) :: on_gpu @@ -934,6 +940,7 @@ subroutine grid_init(cell_starts, & num_edges=num_edges, & vertical_size=vertical_size, & limited_area=limited_area, & + iau_init=iau_init, & backend=backend, & on_gpu=on_gpu) !$acc end host_data diff --git a/tools/tests/tools/py2fgen/wrappers/references/grid/grid.h b/tools/tests/tools/py2fgen/wrappers/references/grid/grid.h index 88ee0b39fc..b0884aa1cf 100644 --- a/tools/tests/tools/py2fgen/wrappers/references/grid/grid.h +++ b/tools/tests/tools/py2fgen/wrappers/references/grid/grid.h @@ -1,44 +1 @@ -extern int grid_init_wrapper( - int *cell_starts, int cell_starts_size_0, int *cell_ends, - int cell_ends_size_0, int *vertex_starts, int vertex_starts_size_0, - int *vertex_ends, int vertex_ends_size_0, int *edge_starts, - int edge_starts_size_0, int *edge_ends, int edge_ends_size_0, int *c2e, - int c2e_size_0, int c2e_size_1, int *e2c, int e2c_size_0, int e2c_size_1, - int *c2e2c, int c2e2c_size_0, int c2e2c_size_1, int *e2c2e, - int e2c2e_size_0, int e2c2e_size_1, int *e2v, int e2v_size_0, - int e2v_size_1, int *v2e, int v2e_size_0, int v2e_size_1, int *v2c, - int v2c_size_0, int v2c_size_1, int *e2c2v, int e2c2v_size_0, - int e2c2v_size_1, int *c2v, int c2v_size_0, int c2v_size_1, - int *c_owner_mask, int c_owner_mask_size_0, int *e_owner_mask, - int e_owner_mask_size_0, int *v_owner_mask, int v_owner_mask_size_0, - int *c_glb_index, int c_glb_index_size_0, int *e_glb_index, - int e_glb_index_size_0, int *v_glb_index, int v_glb_index_size_0, - double *tangent_orientation, int tangent_orientation_size_0, - double *inverse_primal_edge_lengths, int inverse_primal_edge_lengths_size_0, - double *inv_dual_edge_length, int inv_dual_edge_length_size_0, - double *inv_vert_vert_length, int inv_vert_vert_length_size_0, - double *edge_areas, int edge_areas_size_0, double *f_e, int f_e_size_0, - double *cell_center_lat, int cell_center_lat_size_0, - double *cell_center_lon, int cell_center_lon_size_0, double *cell_areas, - int cell_areas_size_0, double *primal_normal_vert_x, - int primal_normal_vert_x_size_0, int primal_normal_vert_x_size_1, - double *primal_normal_vert_y, int primal_normal_vert_y_size_0, - int primal_normal_vert_y_size_1, double *dual_normal_vert_x, - int dual_normal_vert_x_size_0, int dual_normal_vert_x_size_1, - double *dual_normal_vert_y, int dual_normal_vert_y_size_0, - int dual_normal_vert_y_size_1, double *primal_normal_cell_x, - int primal_normal_cell_x_size_0, int primal_normal_cell_x_size_1, - double *primal_normal_cell_y, int primal_normal_cell_y_size_0, - int primal_normal_cell_y_size_1, double *dual_normal_cell_x, - int dual_normal_cell_x_size_0, int dual_normal_cell_x_size_1, - double *dual_normal_cell_y, int dual_normal_cell_y_size_0, - int dual_normal_cell_y_size_1, double *edge_center_lat, - int edge_center_lat_size_0, double *edge_center_lon, - int edge_center_lon_size_0, double *primal_normal_x, - int primal_normal_x_size_0, double *primal_normal_y, - int primal_normal_y_size_0, double *vct_a, int vct_a_size_0, double *vct_b, - int vct_b_size_0, double lowest_layer_thickness, double model_top_height, - double stretch_factor, double flat_height, double rayleigh_damping_height, - double mean_cell_area, int comm_id, int num_vertices, int num_cells, - int num_edges, int vertical_size, int limited_area, int backend, - int on_gpu); \ No newline at end of file +extern int grid_init_wrapper(int* cell_starts, int cell_starts_size_0, int* cell_ends, int cell_ends_size_0, int* vertex_starts, int vertex_starts_size_0, int* vertex_ends, int vertex_ends_size_0, int* edge_starts, int edge_starts_size_0, int* edge_ends, int edge_ends_size_0, int* c2e, int c2e_size_0, int c2e_size_1, int* e2c, int e2c_size_0, int e2c_size_1, int* c2e2c, int c2e2c_size_0, int c2e2c_size_1, int* e2c2e, int e2c2e_size_0, int e2c2e_size_1, int* e2v, int e2v_size_0, int e2v_size_1, int* v2e, int v2e_size_0, int v2e_size_1, int* v2c, int v2c_size_0, int v2c_size_1, int* e2c2v, int e2c2v_size_0, int e2c2v_size_1, int* c2v, int c2v_size_0, int c2v_size_1, int* c_owner_mask, int c_owner_mask_size_0, int* e_owner_mask, int e_owner_mask_size_0, int* v_owner_mask, int v_owner_mask_size_0, int* c_glb_index, int c_glb_index_size_0, int* e_glb_index, int e_glb_index_size_0, int* v_glb_index, int v_glb_index_size_0, double* tangent_orientation, int tangent_orientation_size_0, double* inverse_primal_edge_lengths, int inverse_primal_edge_lengths_size_0, double* inv_dual_edge_length, int inv_dual_edge_length_size_0, double* inv_vert_vert_length, int inv_vert_vert_length_size_0, double* edge_areas, int edge_areas_size_0, double* f_e, int f_e_size_0, double* cell_center_lat, int cell_center_lat_size_0, double* cell_center_lon, int cell_center_lon_size_0, double* cell_areas, int cell_areas_size_0, double* primal_normal_vert_x, int primal_normal_vert_x_size_0, int primal_normal_vert_x_size_1, double* primal_normal_vert_y, int primal_normal_vert_y_size_0, int primal_normal_vert_y_size_1, double* dual_normal_vert_x, int dual_normal_vert_x_size_0, int dual_normal_vert_x_size_1, double* dual_normal_vert_y, int dual_normal_vert_y_size_0, int dual_normal_vert_y_size_1, double* primal_normal_cell_x, int primal_normal_cell_x_size_0, int primal_normal_cell_x_size_1, double* primal_normal_cell_y, int primal_normal_cell_y_size_0, int primal_normal_cell_y_size_1, double* dual_normal_cell_x, int dual_normal_cell_x_size_0, int dual_normal_cell_x_size_1, double* dual_normal_cell_y, int dual_normal_cell_y_size_0, int dual_normal_cell_y_size_1, double* edge_center_lat, int edge_center_lat_size_0, double* edge_center_lon, int edge_center_lon_size_0, double* primal_normal_x, int primal_normal_x_size_0, double* primal_normal_y, int primal_normal_y_size_0, double* vct_a, int vct_a_size_0, double* vct_b, int vct_b_size_0, double lowest_layer_thickness, double model_top_height, double stretch_factor, double flat_height, double rayleigh_damping_height, double mean_cell_area, int comm_id, int num_vertices, int num_cells, int num_edges, int vertical_size, int limited_area, int iau_init, int backend, int on_gpu); \ No newline at end of file diff --git a/tools/tests/tools/py2fgen/wrappers/references/grid/grid.py b/tools/tests/tools/py2fgen/wrappers/references/grid/grid.py index 266fee7eb2..e622c0e087 100644 --- a/tools/tests/tools/py2fgen/wrappers/references/grid/grid.py +++ b/tools/tests/tools/py2fgen/wrappers/references/grid/grid.py @@ -140,6 +140,7 @@ def grid_init_wrapper( num_edges, vertical_size, limited_area, + iau_init, backend, on_gpu, ): @@ -471,6 +472,7 @@ def grid_init_wrapper( num_edges=num_edges, vertical_size=vertical_size, limited_area=limited_area, + iau_init=iau_init, backend=backend, ) diff --git a/tools/tests/tools/py2fgen/wrappers/test_dycore_wrapper.py b/tools/tests/tools/py2fgen/wrappers/test_dycore_wrapper.py index 7cd64ba808..a81bdf12da 100644 --- a/tools/tests/tools/py2fgen/wrappers/test_dycore_wrapper.py +++ b/tools/tests/tools/py2fgen/wrappers/test_dycore_wrapper.py @@ -740,6 +740,8 @@ def test_dycore_wrapper_granule_inputs( divdamp_fac_o2=second_order_divdamp_factor, ndyn_substeps_var=ndyn_substeps, idyn_timestep=substep, + is_iau_active=False, + iau_wgt_dyn=0.0, ) # Check input arguments to SolveNonhydro.time_step @@ -934,6 +936,8 @@ def test_granule_solve_nonhydro_single_step_regional( divdamp_fac_o2=second_order_divdamp_factor, # This is a scalar ndyn_substeps_var=ndyn_substeps, idyn_timestep=substep, + is_iau_active=False, + iau_wgt_dyn=0.0, ) # Comparison asserts should now use py2fgen.as_array @@ -1122,6 +1126,8 @@ def test_granule_solve_nonhydro_multi_step_regional( divdamp_fac_o2=second_order_divdamp_factor, ndyn_substeps_var=ndyn_substeps, idyn_timestep=i_substep, + is_iau_active=False, + iau_wgt_dyn=0.0, ) w_new, w_now = w_now, w_new diff --git a/tools/tests/tools/py2fgen/wrappers/test_grid_init.py b/tools/tests/tools/py2fgen/wrappers/test_grid_init.py index 6d7e381621..44ad3a5e9c 100644 --- a/tools/tests/tools/py2fgen/wrappers/test_grid_init.py +++ b/tools/tests/tools/py2fgen/wrappers/test_grid_init.py @@ -161,6 +161,7 @@ def grid_init(grid_savepoint): e_owner_mask=e_owner_mask, v_owner_mask=v_owner_mask, comm_id=None, + iau_init=False, backend=wrapper_common.BackendIntEnum.DEFAULT, ) From 20f3dc19105d4431cbf4b0328d8737a2962ed026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20M=C3=BCller?= Date: Fri, 20 Mar 2026 12:16:53 +0100 Subject: [PATCH 10/18] Add iau to icon4py driver time_step --- model/driver/src/icon4py/model/driver/icon4py_driver.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/model/driver/src/icon4py/model/driver/icon4py_driver.py b/model/driver/src/icon4py/model/driver/icon4py_driver.py index 2d7d8a69bd..91a083c722 100644 --- a/model/driver/src/icon4py/model/driver/icon4py_driver.py +++ b/model/driver/src/icon4py/model/driver/icon4py_driver.py @@ -299,6 +299,8 @@ def _do_dyn_substepping( lprep_adv=do_prep_adv, at_first_substep=self._is_first_substep(dyn_substep), at_last_substep=self._is_last_substep(dyn_substep), + is_iau_active=False, + iau_wgt_dyn=0.0, ) if not self._is_last_substep(dyn_substep): From 04e6fbde1b2aac33d116c200ba3b409ba1094d56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20M=C3=BCller?= Date: Fri, 20 Mar 2026 15:09:26 +0100 Subject: [PATCH 11/18] Hopefully the last fix --- model/driver/src/icon4py/model/driver/icon4py_configuration.py | 1 - 1 file changed, 1 deletion(-) diff --git a/model/driver/src/icon4py/model/driver/icon4py_configuration.py b/model/driver/src/icon4py/model/driver/icon4py_configuration.py index cec879df8b..bfad4f9c3d 100644 --- a/model/driver/src/icon4py/model/driver/icon4py_configuration.py +++ b/model/driver/src/icon4py/model/driver/icon4py_configuration.py @@ -90,7 +90,6 @@ def _mch_ch_r04b09_diffusion_config(): def _mch_ch_r04b09_nonhydro_config(): return solve_nh.NonHydrostaticConfig( divdamp_order=dycore_states.DivergenceDampingOrder.COMBINED, - iau_wgt_dyn=1.0, fourth_order_divdamp_factor=0.004, max_nudging_coefficient=0.375, ) From 6a6a218fd0d4322717edb0d8c70d19f2ee0afac8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20M=C3=BCller?= Date: Fri, 20 Mar 2026 17:44:18 +0100 Subject: [PATCH 12/18] Add iau to yet more tests --- .../tests/dycore/integration_tests/test_solve_nonhydro.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/model/atmosphere/dycore/tests/dycore/integration_tests/test_solve_nonhydro.py b/model/atmosphere/dycore/tests/dycore/integration_tests/test_solve_nonhydro.py index 011800753a..0f701ef441 100644 --- a/model/atmosphere/dycore/tests/dycore/integration_tests/test_solve_nonhydro.py +++ b/model/atmosphere/dycore/tests/dycore/integration_tests/test_solve_nonhydro.py @@ -229,6 +229,8 @@ def test_nonhydro_predictor_step( dtime=dtime, at_initial_timestep=at_initial_timestep, at_first_substep=at_first_substep, + is_iau_active=False, + iau_wgt_dyn=0.0, ) cell_domain = h_grid.domain(dims.CellDim) @@ -583,6 +585,8 @@ def test_nonhydro_corrector_step( lprep_adv=lprep_adv, at_first_substep=at_first_substep, at_last_substep=at_last_substep, + is_iau_active=False, + iau_wgt_dyn=0.0, ) # stencil 10 @@ -765,6 +769,8 @@ def test_run_solve_nonhydro_single_step( lprep_adv=lprep_adv, at_first_substep=substep_init == 1, at_last_substep=substep_init == ndyn_substeps, + is_iau_active=False, + iau_wgt_dyn=0.0, ) prognostic_state_nnew = prognostic_states.next assert test_utils.dallclose( @@ -904,6 +910,8 @@ def test_run_solve_nonhydro_multi_step( lprep_adv=lprep_adv, at_first_substep=at_first_substep, at_last_substep=at_last_substep, + is_iau_active=False, + iau_wgt_dyn=0.0, ) if not at_last_substep: From 22ce86f838b2ba8199a104ec424df4a5180d589a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20M=C3=BCller?= Date: Tue, 24 Mar 2026 16:26:36 +0100 Subject: [PATCH 13/18] Fixes and comments --- ...ge_diagnostics_for_dycore_and_update_vn.py | 16 +++--- .../integration_tests/test_solve_nonhydro.py | 57 +++++++++++++------ 2 files changed, 48 insertions(+), 25 deletions(-) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_edge_diagnostics_for_dycore_and_update_vn.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_edge_diagnostics_for_dycore_and_update_vn.py index 8f681a4ad5..5682511635 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_edge_diagnostics_for_dycore_and_update_vn.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_edge_diagnostics_for_dycore_and_update_vn.py @@ -169,8 +169,8 @@ def _compute_rho_theta_pgrad_and_update_vn( pg_exdist: fa.EdgeKField[ta.vpfloat], inv_dual_edge_length: fa.EdgeField[ta.wpfloat], dtime: ta.wpfloat, - iau_wgt_dyn: ta.wpfloat, is_iau_active: bool, + iau_wgt_dyn: ta.wpfloat, limited_area: bool, nflatlev: gtx.int32, nflat_gradp: gtx.int32, @@ -299,8 +299,8 @@ def _apply_divergence_damping_and_update_vn( advection_explicit_weight_parameter: ta.wpfloat, advection_implicit_weight_parameter: ta.wpfloat, dtime: ta.wpfloat, - iau_wgt_dyn: ta.wpfloat, is_iau_active: bool, + iau_wgt_dyn: ta.wpfloat, limited_area: bool, apply_2nd_order_divergence_damping: bool, apply_4th_order_divergence_damping: bool, @@ -411,8 +411,8 @@ def compute_rho_theta_pgrad_and_update_vn( pg_exdist: fa.EdgeKField[ta.vpfloat], inv_dual_edge_length: fa.EdgeField[ta.wpfloat], dtime: ta.wpfloat, - iau_wgt_dyn: ta.wpfloat, is_iau_active: bool, + iau_wgt_dyn: ta.wpfloat, limited_area: bool, nflatlev: gtx.int32, nflat_gradp: gtx.int32, @@ -467,8 +467,8 @@ def compute_rho_theta_pgrad_and_update_vn( - pg_exdist: vertical distance between current cell height and neighboring cell height for hydrostatic correction [m] - inv_dual_edge_length: inverse dual edge length [m] - dtime: time step [s] - - iau_wgt_dyn: a scaling factor for iau increment - is_iau_active: option for iau increment analysis + - iau_wgt_dyn: a scaling factor for iau increment - limited_area: option indicating the grid is limited area or not - iadv_rhotheta: advection type for air density and virtual potential temperature (see RhoThetaAdvectionType) - igradp_method: option for pressure gradient computation (see HorizontalPressureDiscretizationType) @@ -516,8 +516,8 @@ def compute_rho_theta_pgrad_and_update_vn( pg_exdist=pg_exdist, inv_dual_edge_length=inv_dual_edge_length, dtime=dtime, - iau_wgt_dyn=iau_wgt_dyn, is_iau_active=is_iau_active, + iau_wgt_dyn=iau_wgt_dyn, limited_area=limited_area, nflatlev=nflatlev, nflat_gradp=nflat_gradp, @@ -561,8 +561,8 @@ def apply_divergence_damping_and_update_vn( advection_explicit_weight_parameter: ta.wpfloat, advection_implicit_weight_parameter: ta.wpfloat, dtime: ta.wpfloat, - iau_wgt_dyn: ta.wpfloat, is_iau_active: bool, + iau_wgt_dyn: ta.wpfloat, limited_area: bool, apply_2nd_order_divergence_damping: bool, apply_4th_order_divergence_damping: bool, @@ -605,8 +605,8 @@ def apply_divergence_damping_and_update_vn( - advection_explicit_weight_parameter: explicitness weight of normal_wind_advective_tendency - advection_implicit_weight_parameter: implicitness weight of normal_wind_advective_tendency - dtime: time step [s] - - iau_wgt_dyn: a scaling factor for iau increment - is_iau_active: option for iau increment analysis + - iau_wgt_dyn: a scaling factor for iau increment - limited_area: option indicating the grid is limited area or not - apply_2nd_order_divergence_damping: scaling factor for second order divergence damping - apply_4th_order_divergence_damping: scaling factor for fourth order divergence damping @@ -640,8 +640,8 @@ def apply_divergence_damping_and_update_vn( advection_explicit_weight_parameter=advection_explicit_weight_parameter, advection_implicit_weight_parameter=advection_implicit_weight_parameter, dtime=dtime, - iau_wgt_dyn=iau_wgt_dyn, is_iau_active=is_iau_active, + iau_wgt_dyn=iau_wgt_dyn, limited_area=limited_area, apply_2nd_order_divergence_damping=apply_2nd_order_divergence_damping, apply_4th_order_divergence_damping=apply_4th_order_divergence_damping, diff --git a/model/atmosphere/dycore/tests/dycore/integration_tests/test_solve_nonhydro.py b/model/atmosphere/dycore/tests/dycore/integration_tests/test_solve_nonhydro.py index 0f701ef441..5ee3dd1306 100644 --- a/model/atmosphere/dycore/tests/dycore/integration_tests/test_solve_nonhydro.py +++ b/model/atmosphere/dycore/tests/dycore/integration_tests/test_solve_nonhydro.py @@ -222,6 +222,10 @@ def test_nonhydro_predictor_step( if not at_first_substep: diagnostic_state_nh.normal_wind_advective_tendency.swap() + # TODO: Load iau config from serialized data + is_iau_active = False + iau_wgt_dyn = 0.0 + solve_nonhydro.run_predictor_step( diagnostic_state_nh=diagnostic_state_nh, prognostic_states=prognostic_states, @@ -229,8 +233,8 @@ def test_nonhydro_predictor_step( dtime=dtime, at_initial_timestep=at_initial_timestep, at_first_substep=at_first_substep, - is_iau_active=False, - iau_wgt_dyn=0.0, + is_iau_active=is_iau_active, + iau_wgt_dyn=iau_wgt_dyn, ) cell_domain = h_grid.domain(dims.CellDim) @@ -574,6 +578,10 @@ def test_nonhydro_corrector_step( if not at_first_substep: diagnostic_state_nh.normal_wind_advective_tendency.swap() + # TODO: Load iau config from serialized data + is_iau_active = False + iau_wgt_dyn = 0.0 + solve_nonhydro.run_corrector_step( diagnostic_state_nh=diagnostic_state_nh, prognostic_states=prognostic_states, @@ -585,8 +593,8 @@ def test_nonhydro_corrector_step( lprep_adv=lprep_adv, at_first_substep=at_first_substep, at_last_substep=at_last_substep, - is_iau_active=False, - iau_wgt_dyn=0.0, + is_iau_active=is_iau_active, + iau_wgt_dyn=iau_wgt_dyn, ) # stencil 10 @@ -757,6 +765,10 @@ def test_run_solve_nonhydro_single_step( prognostic_states = utils.create_prognostic_states(sp) + # TODO: Load iau config from serialized data + is_iau_active = False + iau_wgt_dyn = 0.0 + second_order_divdamp_factor = sp.divdamp_fac_o2() solve_nonhydro.time_step( diagnostic_state_nh=diagnostic_state_nh, @@ -769,8 +781,8 @@ def test_run_solve_nonhydro_single_step( lprep_adv=lprep_adv, at_first_substep=substep_init == 1, at_last_substep=substep_init == ndyn_substeps, - is_iau_active=False, - iau_wgt_dyn=0.0, + is_iau_active=is_iau_active, + iau_wgt_dyn=iau_wgt_dyn, ) prognostic_state_nnew = prognostic_states.next assert test_utils.dallclose( @@ -899,6 +911,10 @@ def test_run_solve_nonhydro_multi_step( if not at_first_substep: diagnostic_state_nh.normal_wind_advective_tendency.swap() + # TODO: Load iau config from serialized data + is_iau_active = False + iau_wgt_dyn = 0.0 + solve_nonhydro.time_step( diagnostic_state_nh=diagnostic_state_nh, prognostic_states=prognostic_states, @@ -910,8 +926,8 @@ def test_run_solve_nonhydro_multi_step( lprep_adv=lprep_adv, at_first_substep=at_first_substep, at_last_substep=at_last_substep, - is_iau_active=False, - iau_wgt_dyn=0.0, + is_iau_active=is_iau_active, + iau_wgt_dyn=iau_wgt_dyn, ) if not at_last_substep: @@ -1452,8 +1468,10 @@ def test_compute_rho_theta_pgrad_and_update_vn( dual_normal_cell_1 = grid_savepoint.dual_normal_cell_x() dual_normal_cell_2 = grid_savepoint.dual_normal_cell_y() - iau_wgt_dyn = config.iau_wgt_dyn - is_iau_active = config.is_iau_active + # TODO: Load iau config from serialized data + iau_wgt_dyn = 0.0 + is_iau_active = False + igradp_method = config.igradp_method z_rho_e_ref = sp_stencil_exit.z_rho_e() @@ -1637,7 +1655,10 @@ def test_apply_divergence_damping_and_update_vn( allocator=backend, ) - iau_wgt_dyn = config.iau_wgt_dyn + # TODO: Load iau config from serialized data + is_iau_active = False + iau_wgt_dyn = 0.0 + divdamp_order = config.divdamp_order second_order_divdamp_scaling_coeff = sp_nh_init.divdamp_fac_o2() * mean_cell_area second_order_divdamp_factor = savepoint_nonhydro_init.divdamp_fac_o2() @@ -1652,7 +1673,6 @@ def test_apply_divergence_damping_and_update_vn( and second_order_divdamp_factor <= (4.0 * config.fourth_order_divdamp_factor) ) ) - is_iau_active = config.is_iau_active vn_ref = sp_nh_exit.vn_new() @@ -1692,8 +1712,8 @@ def test_apply_divergence_damping_and_update_vn( advection_explicit_weight_parameter=savepoint_nonhydro_init.wgt_nnow_vel(), advection_implicit_weight_parameter=savepoint_nonhydro_init.wgt_nnew_vel(), dtime=savepoint_nonhydro_init.get_metadata("dtime").get("dtime"), - iau_wgt_dyn=iau_wgt_dyn, is_iau_active=is_iau_active, + iau_wgt_dyn=iau_wgt_dyn, limited_area=grid_savepoint.get_metadata("limited_area").get("limited_area"), apply_2nd_order_divergence_damping=apply_2nd_order_divergence_damping, apply_4th_order_divergence_damping=apply_4th_order_divergence_damping, @@ -2099,8 +2119,10 @@ def test_vertically_implicit_solver_at_predictor_step( dwdz_at_cells_on_model_levels = sp_stencil_init.z_dwdz_dd() exner_dynamical_increment = sp_stencil_init.exner_dyn_incr() - iau_wgt_dyn = config.iau_wgt_dyn - is_iau_active = config.is_iau_active + # TODO: Load iau config from serialized data + is_iau_active = False + iau_wgt_dyn = 0.0 + divdamp_type = config.divdamp_type w_concorr_c_ref = sp_nh_exit.w_concorr_c() @@ -2308,8 +2330,9 @@ def test_vertically_implicit_solver_at_corrector_step( r_nsubsteps = 1.0 / ndyn_substeps kstart_moist = vertical_params.kstart_moist - iau_wgt_dyn = config.iau_wgt_dyn - is_iau_active = config.is_iau_active + # TODO: Load iau config from serialized data + is_iau_active = False + iau_wgt_dyn = 0.0 w_ref = sp_nh_exit.w_new() rho_ref = sp_nh_exit.rho_new() From ad21c771d87c64a05b14ee024d4dc135006ce54d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20M=C3=BCller?= Date: Wed, 25 Mar 2026 00:18:03 +0100 Subject: [PATCH 14/18] Put iau stuff for tests into a fixture --- .../integration_tests/test_solve_nonhydro.py | 48 +++++++------------ .../model/testing/fixtures/datatest.py | 10 ++++ 2 files changed, 26 insertions(+), 32 deletions(-) diff --git a/model/atmosphere/dycore/tests/dycore/integration_tests/test_solve_nonhydro.py b/model/atmosphere/dycore/tests/dycore/integration_tests/test_solve_nonhydro.py index 5ee3dd1306..983b867061 100644 --- a/model/atmosphere/dycore/tests/dycore/integration_tests/test_solve_nonhydro.py +++ b/model/atmosphere/dycore/tests/dycore/integration_tests/test_solve_nonhydro.py @@ -167,6 +167,8 @@ def test_nonhydro_predictor_step( model_top_height, stretch_factor, damping_height, + is_iau_active, + iau_wgt_dyn, grid_savepoint, metrics_savepoint, interpolation_savepoint, @@ -222,10 +224,6 @@ def test_nonhydro_predictor_step( if not at_first_substep: diagnostic_state_nh.normal_wind_advective_tendency.swap() - # TODO: Load iau config from serialized data - is_iau_active = False - iau_wgt_dyn = 0.0 - solve_nonhydro.run_predictor_step( diagnostic_state_nh=diagnostic_state_nh, prognostic_states=prognostic_states, @@ -504,6 +502,8 @@ def test_nonhydro_corrector_step( model_top_height, stretch_factor, damping_height, + is_iau_active, + iau_wgt_dyn, grid_savepoint, metrics_savepoint, interpolation_savepoint, @@ -578,10 +578,6 @@ def test_nonhydro_corrector_step( if not at_first_substep: diagnostic_state_nh.normal_wind_advective_tendency.swap() - # TODO: Load iau config from serialized data - is_iau_active = False - iau_wgt_dyn = 0.0 - solve_nonhydro.run_corrector_step( diagnostic_state_nh=diagnostic_state_nh, prognostic_states=prognostic_states, @@ -709,6 +705,8 @@ def test_run_solve_nonhydro_single_step( model_top_height, stretch_factor, damping_height, + is_iau_active, + iau_wgt_dyn, grid_savepoint, metrics_savepoint, interpolation_savepoint, @@ -765,10 +763,6 @@ def test_run_solve_nonhydro_single_step( prognostic_states = utils.create_prognostic_states(sp) - # TODO: Load iau config from serialized data - is_iau_active = False - iau_wgt_dyn = 0.0 - second_order_divdamp_factor = sp.divdamp_fac_o2() solve_nonhydro.time_step( diagnostic_state_nh=diagnostic_state_nh, @@ -845,6 +839,8 @@ def test_run_solve_nonhydro_multi_step( model_top_height, stretch_factor, damping_height, + is_iau_active, + iau_wgt_dyn, grid_savepoint, metrics_savepoint, interpolation_savepoint, @@ -911,10 +907,6 @@ def test_run_solve_nonhydro_multi_step( if not at_first_substep: diagnostic_state_nh.normal_wind_advective_tendency.swap() - # TODO: Load iau config from serialized data - is_iau_active = False - iau_wgt_dyn = 0.0 - solve_nonhydro.time_step( diagnostic_state_nh=diagnostic_state_nh, prognostic_states=prognostic_states, @@ -1401,6 +1393,8 @@ def test_compute_rho_theta_pgrad_and_update_vn( model_top_height, stretch_factor, damping_height, + is_iau_active, + iau_wgt_dyn, grid_savepoint, metrics_savepoint, interpolation_savepoint, @@ -1468,10 +1462,6 @@ def test_compute_rho_theta_pgrad_and_update_vn( dual_normal_cell_1 = grid_savepoint.dual_normal_cell_x() dual_normal_cell_2 = grid_savepoint.dual_normal_cell_y() - # TODO: Load iau config from serialized data - iau_wgt_dyn = 0.0 - is_iau_active = False - igradp_method = config.igradp_method z_rho_e_ref = sp_stencil_exit.z_rho_e() @@ -1618,6 +1608,8 @@ def test_apply_divergence_damping_and_update_vn( model_top_height, stretch_factor, damping_height, + is_iau_active, + iau_wgt_dyn, grid_savepoint, metrics_savepoint, interpolation_savepoint, @@ -1655,10 +1647,6 @@ def test_apply_divergence_damping_and_update_vn( allocator=backend, ) - # TODO: Load iau config from serialized data - is_iau_active = False - iau_wgt_dyn = 0.0 - divdamp_order = config.divdamp_order second_order_divdamp_scaling_coeff = sp_nh_init.divdamp_fac_o2() * mean_cell_area second_order_divdamp_factor = savepoint_nonhydro_init.divdamp_fac_o2() @@ -2070,6 +2058,8 @@ def test_vertically_implicit_solver_at_predictor_step( model_top_height, stretch_factor, damping_height, + is_iau_active, + iau_wgt_dyn, grid_savepoint, metrics_savepoint, interpolation_savepoint, @@ -2119,10 +2109,6 @@ def test_vertically_implicit_solver_at_predictor_step( dwdz_at_cells_on_model_levels = sp_stencil_init.z_dwdz_dd() exner_dynamical_increment = sp_stencil_init.exner_dyn_incr() - # TODO: Load iau config from serialized data - is_iau_active = False - iau_wgt_dyn = 0.0 - divdamp_type = config.divdamp_type w_concorr_c_ref = sp_nh_exit.w_concorr_c() @@ -2277,6 +2263,8 @@ def test_vertically_implicit_solver_at_corrector_step( model_top_height, stretch_factor, damping_height, + is_iau_active, + iau_wgt_dyn, grid_savepoint, metrics_savepoint, interpolation_savepoint, @@ -2330,10 +2318,6 @@ def test_vertically_implicit_solver_at_corrector_step( r_nsubsteps = 1.0 / ndyn_substeps kstart_moist = vertical_params.kstart_moist - # TODO: Load iau config from serialized data - is_iau_active = False - iau_wgt_dyn = 0.0 - w_ref = sp_nh_exit.w_new() rho_ref = sp_nh_exit.rho_new() exner_ref = sp_nh_exit.exner_new() diff --git a/model/testing/src/icon4py/model/testing/fixtures/datatest.py b/model/testing/src/icon4py/model/testing/fixtures/datatest.py index 7730656d5a..867a6616f2 100644 --- a/model/testing/src/icon4py/model/testing/fixtures/datatest.py +++ b/model/testing/src/icon4py/model/testing/fixtures/datatest.py @@ -598,3 +598,13 @@ def rayleigh_type() -> int: @pytest.fixture def top_height_limit_for_maximal_layer_thickness() -> float: return 15000.0 + + +@pytest.fixture +def is_iau_active() -> bool: + return False + + +@pytest.fixture +def iau_wgt_dyn() -> float: + return 0.0 From 7d8eafef0082d2ffb1f5088d610b197fe5bcc38d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20M=C3=BCller?= Date: Wed, 25 Mar 2026 00:27:49 +0100 Subject: [PATCH 15/18] Add default value for is_iau_active and iau_dyn_wgt to dycore step --- .../src/icon4py/model/atmosphere/dycore/solve_nonhydro.py | 6 ++++-- model/driver/src/icon4py/model/driver/icon4py_driver.py | 2 -- .../icon4py/model/standalone_driver/standalone_driver.py | 2 -- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py index 1ff5c0b6f0..a82b6264b0 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py @@ -996,8 +996,8 @@ def time_step( lprep_adv: bool, at_first_substep: bool, at_last_substep: bool, - is_iau_active: bool, - iau_wgt_dyn: float, + is_iau_active: bool = False, + iau_wgt_dyn: float = 0.0, ): """ Update prognostic variables (prognostic_states.next) after the dynamical process over one substep. @@ -1012,6 +1012,8 @@ def time_step( lprep_adv: Preparation for tracer advection at_first_substep: first substep at_last_substep: last substep + is_iau_active: Incremental analysis update active during dycore step + iau_wgt_dyn: weight scalar for the incremental analysis update """ log.info( f"running timestep: dtime = {dtime}, initial_timestep = {at_initial_timestep}, first_substep = {at_first_substep}, last_substep = {at_last_substep}, prep_adv = {lprep_adv}" diff --git a/model/driver/src/icon4py/model/driver/icon4py_driver.py b/model/driver/src/icon4py/model/driver/icon4py_driver.py index 91a083c722..2d7d8a69bd 100644 --- a/model/driver/src/icon4py/model/driver/icon4py_driver.py +++ b/model/driver/src/icon4py/model/driver/icon4py_driver.py @@ -299,8 +299,6 @@ def _do_dyn_substepping( lprep_adv=do_prep_adv, at_first_substep=self._is_first_substep(dyn_substep), at_last_substep=self._is_last_substep(dyn_substep), - is_iau_active=False, - iau_wgt_dyn=0.0, ) if not self._is_last_substep(dyn_substep): diff --git a/model/standalone_driver/src/icon4py/model/standalone_driver/standalone_driver.py b/model/standalone_driver/src/icon4py/model/standalone_driver/standalone_driver.py index 29ed8e287a..276be59f83 100644 --- a/model/standalone_driver/src/icon4py/model/standalone_driver/standalone_driver.py +++ b/model/standalone_driver/src/icon4py/model/standalone_driver/standalone_driver.py @@ -271,8 +271,6 @@ def _do_dyn_substepping( lprep_adv=do_prep_adv, at_first_substep=self._is_first_substep(dyn_substep), at_last_substep=self._is_last_substep(dyn_substep), - is_iau_active=False, - iau_wgt_dyn=0.0, ) timer_solve_nh.capture() From dc47ca8b79120677163db2bb5476eff40ee7f8a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20M=C3=BCller?= Date: Wed, 25 Mar 2026 00:42:18 +0100 Subject: [PATCH 16/18] Move iau init to dycore init from grid init --- .../model/atmosphere/dycore/solve_nonhydro.py | 12 ++++++++---- model/common/src/icon4py/model/common/grid/base.py | 5 ----- tools/src/icon4py/tools/py2fgen/wrappers/common.py | 2 -- .../icon4py/tools/py2fgen/wrappers/dycore_wrapper.py | 2 ++ .../icon4py/tools/py2fgen/wrappers/grid_wrapper.py | 2 -- .../py2fgen/wrappers/references/dycore/dycore.f90 | 7 +++++++ .../py2fgen/wrappers/references/dycore/dycore.h | 2 +- .../py2fgen/wrappers/references/dycore/dycore.py | 2 ++ .../tools/py2fgen/wrappers/references/grid/grid.f90 | 7 ------- .../tools/py2fgen/wrappers/references/grid/grid.h | 4 ++-- .../tools/py2fgen/wrappers/references/grid/grid.py | 2 -- .../tools/py2fgen/wrappers/test_dycore_wrapper.py | 4 ++++ tools/tests/tools/py2fgen/wrappers/test_grid_init.py | 1 - 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py index a82b6264b0..083bd1527c 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py @@ -159,6 +159,7 @@ def __init__( divdamp_trans_end: float = 17500.0, l_vert_nested: bool = False, deepatmos_mode: bool = False, + iau_init: bool = False, rhotheta_offctr: float = -0.1, veladv_offctr: float = 0.25, _nudge_max_coeff: float | None = None, # default is set in __init__ @@ -284,6 +285,9 @@ def __init__( #: deep atmosphere mode, originally defined as ldeepatmo in ICON self.deepatmos_mode: bool = deepatmos_mode + #: incremental analysis init mode, defined as one of the ICON init modes + self.iau_init: bool = iau_init, + self._validate() def _validate(self): @@ -452,7 +456,7 @@ def __init__( "inv_dual_edge_length": self._edge_geometry.inverse_dual_edge_lengths, "limited_area": self._grid.limited_area, }, - variants={"is_iau_active": [False, True] if self._grid.iau_init else [False]}, + variants={"is_iau_active": [False, True] if self._config.iau_init else [False]}, horizontal_sizes={ "start_edge_lateral_boundary": self._start_edge_lateral_boundary, "start_edge_lateral_boundary_level_7": self._start_edge_lateral_boundary_level_7, @@ -491,7 +495,7 @@ def __init__( variants={ "apply_2nd_order_divergence_damping": [False, True], "apply_4th_order_divergence_damping": [False, True], - "is_iau_active": [False, True] if self._grid.iau_init else [False], + "is_iau_active": [False, True] if self._config.iau_init else [False], }, horizontal_sizes={ "horizontal_start": gtx.int32(self._start_edge_nudging_level_2), @@ -569,7 +573,7 @@ def __init__( }, variants={ "at_first_substep": [False, True], - "is_iau_active": [False, True] if self._grid.iau_init else [False], + "is_iau_active": [False, True] if self._config.iau_init else [False], }, horizontal_sizes={ "start_cell_index_nudging": self._start_cell_nudging, @@ -604,7 +608,7 @@ def __init__( "at_first_substep": [False, True], "at_last_substep": [False, True], "lprep_adv": [False, True], - "is_iau_active": [False, True] if self._grid.iau_init else [False], + "is_iau_active": [False, True] if self._config.iau_init else [False], }, horizontal_sizes={ "start_cell_index_nudging": self._start_cell_nudging, diff --git a/model/common/src/icon4py/model/common/grid/base.py b/model/common/src/icon4py/model/common/grid/base.py index 0403c15a2b..c981b7a8dd 100644 --- a/model/common/src/icon4py/model/common/grid/base.py +++ b/model/common/src/icon4py/model/common/grid/base.py @@ -51,7 +51,6 @@ class GridConfig: # TODO(halungge): Decouple the vertical from horizontal grid. vertical_size: int limited_area: bool = True - iau_init: bool = False distributed: bool = False n_shift_total: int = 0 length_rescale_factor: float = 1.0 @@ -153,10 +152,6 @@ def num_levels(self) -> int: def limited_area(self) -> bool: return self.config.limited_area - @property - def iau_init(self) -> bool: - return self.config.iau_init - def get_connectivity(self, offset: str | gtx.FieldOffset) -> gtx_common.NeighborTable: """Get the connectivity by its name.""" if isinstance(offset, gtx.FieldOffset): diff --git a/tools/src/icon4py/tools/py2fgen/wrappers/common.py b/tools/src/icon4py/tools/py2fgen/wrappers/common.py index 4a95ef8d15..79785b991e 100644 --- a/tools/src/icon4py/tools/py2fgen/wrappers/common.py +++ b/tools/src/icon4py/tools/py2fgen/wrappers/common.py @@ -194,7 +194,6 @@ def construct_icon_grid( num_edges: int, vertical_size: int, limited_area: bool, - iau_init: bool, distributed: bool, allocator: gtx_typing.Allocator | None, ) -> icon.IconGrid: @@ -240,7 +239,6 @@ def construct_icon_grid( ), vertical_size=vertical_size, limited_area=limited_area, - iau_init=iau_init, distributed=distributed, keep_skip_values=False, ) diff --git a/tools/src/icon4py/tools/py2fgen/wrappers/dycore_wrapper.py b/tools/src/icon4py/tools/py2fgen/wrappers/dycore_wrapper.py index 34d3f45a26..c2bb59803e 100644 --- a/tools/src/icon4py/tools/py2fgen/wrappers/dycore_wrapper.py +++ b/tools/src/icon4py/tools/py2fgen/wrappers/dycore_wrapper.py @@ -110,6 +110,7 @@ def solve_nh_init( divdamp_trans_end: gtx.float64, l_vert_nested: bool, ldeepatmo: bool, + iau_init: bool, rhotheta_offctr: gtx.float64, veladv_offctr: gtx.float64, nudge_max_coeff: gtx.float64, # note: this is the scaled ICON value, i.e. not the namelist value @@ -163,6 +164,7 @@ def solve_nh_init( divdamp_trans_end=divdamp_trans_end, l_vert_nested=l_vert_nested, deepatmos_mode=ldeepatmo, + iau_init=iau_init, rhotheta_offctr=rhotheta_offctr, veladv_offctr=veladv_offctr, max_nudging_coefficient=nudge_max_coeff, diff --git a/tools/src/icon4py/tools/py2fgen/wrappers/grid_wrapper.py b/tools/src/icon4py/tools/py2fgen/wrappers/grid_wrapper.py index 27065199b0..1c1b79b547 100644 --- a/tools/src/icon4py/tools/py2fgen/wrappers/grid_wrapper.py +++ b/tools/src/icon4py/tools/py2fgen/wrappers/grid_wrapper.py @@ -115,7 +115,6 @@ def grid_init( num_edges: gtx.int32, vertical_size: gtx.int32, limited_area: bool, - iau_init: bool, backend: gtx.int32, ) -> None: on_gpu = c2e.array_ns != np # TODO(havogt): expose `on_gpu` from py2fgen @@ -169,7 +168,6 @@ def grid_init( num_edges=num_edges, vertical_size=vertical_size, limited_area=limited_area, - iau_init=iau_init, distributed=not processor_props.is_single_rank(), allocator=allocator, ) diff --git a/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.f90 b/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.f90 index 6b82531e13..3a64c4f3eb 100644 --- a/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.f90 +++ b/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.f90 @@ -513,6 +513,7 @@ function solve_nh_init_wrapper(c_lin_e, & divdamp_trans_end, & l_vert_nested, & ldeepatmo, & + iau_init, & rhotheta_offctr, & veladv_offctr, & nudge_max_coeff, & @@ -834,6 +835,8 @@ function solve_nh_init_wrapper(c_lin_e, & logical(c_int), value, target :: ldeepatmo + logical(c_int), value, target :: iau_init + real(c_double), value, target :: rhotheta_offctr real(c_double), value, target :: veladv_offctr @@ -1534,6 +1537,7 @@ subroutine solve_nh_init(c_lin_e, & divdamp_trans_end, & l_vert_nested, & ldeepatmo, & + iau_init, & rhotheta_offctr, & veladv_offctr, & nudge_max_coeff, & @@ -1672,6 +1676,8 @@ subroutine solve_nh_init(c_lin_e, & logical(c_int), value, target :: ldeepatmo + logical(c_int), value, target :: iau_init + real(c_double), value, target :: rhotheta_offctr real(c_double), value, target :: veladv_offctr @@ -2256,6 +2262,7 @@ subroutine solve_nh_init(c_lin_e, & divdamp_trans_end=divdamp_trans_end, & l_vert_nested=l_vert_nested, & ldeepatmo=ldeepatmo, & + iau_init=iau_init, & rhotheta_offctr=rhotheta_offctr, & veladv_offctr=veladv_offctr, & nudge_max_coeff=nudge_max_coeff, & diff --git a/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.h b/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.h index 7508906013..f0ab3cddc1 100644 --- a/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.h +++ b/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.h @@ -91,7 +91,7 @@ extern int solve_nh_init_wrapper( int c_owner_mask_size_0, int itime_scheme, int iadv_rhotheta, int igradp_method, int rayleigh_type, double rayleigh_coeff, int divdamp_order, int divdamp_type, double divdamp_trans_start, - double divdamp_trans_end, int l_vert_nested, int ldeepatmo, + double divdamp_trans_end, int l_vert_nested, int ldeepatmo, int iau_init, double rhotheta_offctr, double veladv_offctr, double nudge_max_coeff, double divdamp_fac, double divdamp_fac2, double divdamp_fac3, double divdamp_fac4, double divdamp_z, double divdamp_z2, double divdamp_z3, diff --git a/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.py b/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.py index f4839b0c15..a0dbc47271 100644 --- a/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.py +++ b/tools/tests/tools/py2fgen/wrappers/references/dycore/dycore.py @@ -1326,6 +1326,7 @@ def solve_nh_init_wrapper( divdamp_trans_end, l_vert_nested, ldeepatmo, + iau_init, rhotheta_offctr, veladv_offctr, nudge_max_coeff, @@ -1844,6 +1845,7 @@ def solve_nh_init_wrapper( divdamp_trans_end=divdamp_trans_end, l_vert_nested=l_vert_nested, ldeepatmo=ldeepatmo, + iau_init=iau_init, rhotheta_offctr=rhotheta_offctr, veladv_offctr=veladv_offctr, nudge_max_coeff=nudge_max_coeff, diff --git a/tools/tests/tools/py2fgen/wrappers/references/grid/grid.f90 b/tools/tests/tools/py2fgen/wrappers/references/grid/grid.f90 index c18fc8fd13..3454fb731c 100644 --- a/tools/tests/tools/py2fgen/wrappers/references/grid/grid.f90 +++ b/tools/tests/tools/py2fgen/wrappers/references/grid/grid.f90 @@ -121,7 +121,6 @@ function grid_init_wrapper(cell_starts, & num_edges, & vertical_size, & limited_area, & - iau_init, & backend, & on_gpu) bind(c, name="grid_init_wrapper") result(rc) import :: c_int, c_double, c_bool, c_ptr @@ -357,8 +356,6 @@ function grid_init_wrapper(cell_starts, & logical(c_int), value, target :: limited_area - logical(c_int), value, target :: iau_init - integer(c_int), value, target :: backend logical(c_int), value :: on_gpu @@ -424,7 +421,6 @@ subroutine grid_init(cell_starts, & num_edges, & vertical_size, & limited_area, & - iau_init, & backend, & rc) use, intrinsic :: iso_c_binding @@ -539,8 +535,6 @@ subroutine grid_init(cell_starts, & logical(c_int), value, target :: limited_area - logical(c_int), value, target :: iau_init - integer(c_int), value, target :: backend logical(c_int) :: on_gpu @@ -924,7 +918,6 @@ subroutine grid_init(cell_starts, & num_edges=num_edges, & vertical_size=vertical_size, & limited_area=limited_area, & - iau_init=iau_init, & backend=backend, & on_gpu=on_gpu) !$acc end host_data diff --git a/tools/tests/tools/py2fgen/wrappers/references/grid/grid.h b/tools/tests/tools/py2fgen/wrappers/references/grid/grid.h index 772a712faa..7a06b5779d 100644 --- a/tools/tests/tools/py2fgen/wrappers/references/grid/grid.h +++ b/tools/tests/tools/py2fgen/wrappers/references/grid/grid.h @@ -40,5 +40,5 @@ extern int grid_init_wrapper( double lowest_layer_thickness, double model_top_height, double stretch_factor, double flat_height, double rayleigh_damping_height, double mean_cell_area, int comm_id, int num_vertices, int num_cells, - int num_edges, int vertical_size, int limited_area, int iau_init, - int backend, int on_gpu); \ No newline at end of file + int num_edges, int vertical_size, int limited_area, int backend, + int on_gpu); \ No newline at end of file diff --git a/tools/tests/tools/py2fgen/wrappers/references/grid/grid.py b/tools/tests/tools/py2fgen/wrappers/references/grid/grid.py index c296e1287d..93a6b72923 100644 --- a/tools/tests/tools/py2fgen/wrappers/references/grid/grid.py +++ b/tools/tests/tools/py2fgen/wrappers/references/grid/grid.py @@ -138,7 +138,6 @@ def grid_init_wrapper( num_edges, vertical_size, limited_area, - iau_init, backend, on_gpu, ): @@ -467,7 +466,6 @@ def grid_init_wrapper( num_edges=num_edges, vertical_size=vertical_size, limited_area=limited_area, - iau_init=iau_init, backend=backend, ) diff --git a/tools/tests/tools/py2fgen/wrappers/test_dycore_wrapper.py b/tools/tests/tools/py2fgen/wrappers/test_dycore_wrapper.py index 9cbffc4e42..5233089782 100644 --- a/tools/tests/tools/py2fgen/wrappers/test_dycore_wrapper.py +++ b/tools/tests/tools/py2fgen/wrappers/test_dycore_wrapper.py @@ -49,6 +49,7 @@ def solve_nh_init( divdamp_trans_end = 17500.0 l_vert_nested = False ldeepatmo = False + iau_init = False rhotheta_offctr = -0.1 veladv_offctr = 0.25 max_nudging_coefficient = 0.375 @@ -211,6 +212,7 @@ def solve_nh_init( divdamp_trans_end=divdamp_trans_end, l_vert_nested=l_vert_nested, ldeepatmo=ldeepatmo, + iau_init=iau_init, rhotheta_offctr=rhotheta_offctr, veladv_offctr=veladv_offctr, nudge_max_coeff=max_nudging_coefficient, @@ -281,6 +283,7 @@ def test_dycore_wrapper_granule_inputs( divdamp_trans_end = 17500.0 l_vert_nested = False ldeepatmo = False + iau_init = False rhotheta_offctr = -0.1 veladv_offctr = 0.25 max_nudging_coefficient = 0.375 @@ -628,6 +631,7 @@ def test_dycore_wrapper_granule_inputs( divdamp_trans_end=divdamp_trans_end, l_vert_nested=l_vert_nested, ldeepatmo=ldeepatmo, + iau_init=iau_init, rhotheta_offctr=rhotheta_offctr, veladv_offctr=veladv_offctr, nudge_max_coeff=max_nudging_coefficient, diff --git a/tools/tests/tools/py2fgen/wrappers/test_grid_init.py b/tools/tests/tools/py2fgen/wrappers/test_grid_init.py index 3d7f7909ec..690ae39352 100644 --- a/tools/tests/tools/py2fgen/wrappers/test_grid_init.py +++ b/tools/tests/tools/py2fgen/wrappers/test_grid_init.py @@ -159,7 +159,6 @@ def grid_init(grid_savepoint): e_owner_mask=e_owner_mask, v_owner_mask=v_owner_mask, comm_id=None, - iau_init=False, backend=wrapper_common.BackendIntEnum.DEFAULT, ) From 66ad5848823c1548eba66a03fb5cd9b1840613c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20M=C3=BCller?= Date: Wed, 25 Mar 2026 09:03:36 +0100 Subject: [PATCH 17/18] Fixed wildcard import not able to "see" is_iau_active fixture --- .../model/atmosphere/dycore/solve_nonhydro.py | 2 +- .../integration_tests/test_solve_nonhydro.py | 38 ++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py index 083bd1527c..2de72b691f 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py @@ -286,7 +286,7 @@ def __init__( self.deepatmos_mode: bool = deepatmos_mode #: incremental analysis init mode, defined as one of the ICON init modes - self.iau_init: bool = iau_init, + self.iau_init: bool = iau_init self._validate() diff --git a/model/atmosphere/dycore/tests/dycore/integration_tests/test_solve_nonhydro.py b/model/atmosphere/dycore/tests/dycore/integration_tests/test_solve_nonhydro.py index 983b867061..e0ea2d010e 100644 --- a/model/atmosphere/dycore/tests/dycore/integration_tests/test_solve_nonhydro.py +++ b/model/atmosphere/dycore/tests/dycore/integration_tests/test_solve_nonhydro.py @@ -27,9 +27,45 @@ from icon4py.model.common.math import smagorinsky from icon4py.model.common.utils import data_allocation as data_alloc from icon4py.model.testing import definitions, test_utils +from icon4py.model.testing.fixtures import ( + backend, + damping_height, + data_provider, + download_ser_data, + experiment, + flat_height, + grid_savepoint, + htop_moist_proc, + iau_wgt_dyn, + icon_grid, + interpolation_savepoint, + is_iau_active, + istep_exit, + istep_init, + lowest_layer_thickness, + maximal_layer_thickness, + metrics_savepoint, + model_top_height, + ndyn_substeps, + processor_props, + savepoint_compute_edge_diagnostics_for_dycore_and_update_vn_exit, + savepoint_compute_edge_diagnostics_for_dycore_and_update_vn_init, + savepoint_dycore_30_to_38_exit, + savepoint_dycore_30_to_38_init, + savepoint_nonhydro_exit, + savepoint_nonhydro_init, + savepoint_nonhydro_step_final, + savepoint_velocity_init, + savepoint_vertically_implicit_dycore_solver_init, + step_date_exit, + step_date_init, + stretch_factor, + substep_exit, + substep_init, + top_height_limit_for_maximal_layer_thickness, +) from .. import utils -from ..fixtures import * # noqa: F403 if TYPE_CHECKING: From 32b4c04afb03236064512335fb7a146001d17fef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20M=C3=BCller?= Date: Wed, 25 Mar 2026 14:31:21 +0100 Subject: [PATCH 18/18] Address review comments --- .../dycore/tests/dycore/fixtures.py | 2 + .../integration_tests/test_solve_nonhydro.py | 38 +------------------ .../mpi_tests/test_parallel_solve_nonhydro.py | 6 ++- 3 files changed, 7 insertions(+), 39 deletions(-) diff --git a/model/atmosphere/dycore/tests/dycore/fixtures.py b/model/atmosphere/dycore/tests/dycore/fixtures.py index 6fc5afa77d..c7131d5146 100644 --- a/model/atmosphere/dycore/tests/dycore/fixtures.py +++ b/model/atmosphere/dycore/tests/dycore/fixtures.py @@ -17,8 +17,10 @@ flat_height, grid_savepoint, htop_moist_proc, + iau_wgt_dyn, icon_grid, interpolation_savepoint, + is_iau_active, istep_exit, istep_init, linit, diff --git a/model/atmosphere/dycore/tests/dycore/integration_tests/test_solve_nonhydro.py b/model/atmosphere/dycore/tests/dycore/integration_tests/test_solve_nonhydro.py index 005053bf8a..1b5867deb0 100644 --- a/model/atmosphere/dycore/tests/dycore/integration_tests/test_solve_nonhydro.py +++ b/model/atmosphere/dycore/tests/dycore/integration_tests/test_solve_nonhydro.py @@ -27,45 +27,9 @@ from icon4py.model.common.math import smagorinsky from icon4py.model.common.utils import data_allocation as data_alloc from icon4py.model.testing import definitions, test_utils -from icon4py.model.testing.fixtures import ( - backend, - damping_height, - data_provider, - download_ser_data, - experiment, - flat_height, - grid_savepoint, - htop_moist_proc, - iau_wgt_dyn, - icon_grid, - interpolation_savepoint, - is_iau_active, - istep_exit, - istep_init, - lowest_layer_thickness, - maximal_layer_thickness, - metrics_savepoint, - model_top_height, - ndyn_substeps, - processor_props, - savepoint_compute_edge_diagnostics_for_dycore_and_update_vn_exit, - savepoint_compute_edge_diagnostics_for_dycore_and_update_vn_init, - savepoint_dycore_30_to_38_exit, - savepoint_dycore_30_to_38_init, - savepoint_nonhydro_exit, - savepoint_nonhydro_init, - savepoint_nonhydro_step_final, - savepoint_velocity_init, - savepoint_vertically_implicit_dycore_solver_init, - step_date_exit, - step_date_init, - stretch_factor, - substep_exit, - substep_init, - top_height_limit_for_maximal_layer_thickness, -) from .. import utils +from ..fixtures import * # noqa: F403 if TYPE_CHECKING: diff --git a/model/atmosphere/dycore/tests/dycore/mpi_tests/test_parallel_solve_nonhydro.py b/model/atmosphere/dycore/tests/dycore/mpi_tests/test_parallel_solve_nonhydro.py index 7c03f8bf83..afad94b36d 100644 --- a/model/atmosphere/dycore/tests/dycore/mpi_tests/test_parallel_solve_nonhydro.py +++ b/model/atmosphere/dycore/tests/dycore/mpi_tests/test_parallel_solve_nonhydro.py @@ -58,6 +58,8 @@ def test_run_solve_nonhydro_single_step( model_top_height: ta.wpfloat, stretch_factor: ta.wpfloat, damping_height: ta.wpfloat, + is_iau_active: bool, + iau_wgt_dyn: ta.wpfloat, grid_savepoint: serialbox.IconGridSavepoint, metrics_savepoint: serialbox.MetricSavepoint, interpolation_savepoint: serialbox.InterpolationSavepoint, @@ -157,8 +159,8 @@ def test_run_solve_nonhydro_single_step( lprep_adv=lprep_adv, at_first_substep=(substep_init == 1), at_last_substep=(substep_init == ndyn_substeps), - is_iau_active=False, - iau_wgt_dyn=0.0, + is_iau_active=is_iau_active, + iau_wgt_dyn=iau_wgt_dyn, ) _log.info(f"rank={processor_props.rank}/{processor_props.comm_size}: dycore step run ")