From ab436b22dacbf730937af4c07f12d1239c42705d Mon Sep 17 00:00:00 2001 From: Till Ehrengruber Date: Fri, 15 Nov 2024 19:05:22 +0100 Subject: [PATCH 1/7] Use tagged release (#599) Force mergeing, see above. --- base-requirements-dev.txt | 2 +- base-requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/base-requirements-dev.txt b/base-requirements-dev.txt index 3665fc66e3..16a42ff79f 100644 --- a/base-requirements-dev.txt +++ b/base-requirements-dev.txt @@ -1,5 +1,5 @@ # VCS --e git+https://github.com/GridTools/gt4py.git@main#egg=gt4py +-e git+https://github.com/GridTools/gt4py.git@icon4py_20241113#egg=gt4py # use tagged release until #596 & gt4py#1738 is merged git+https://github.com/GridTools/serialbox#egg=serialbox&subdirectory=src/serialbox-python # PyPI diff --git a/base-requirements.txt b/base-requirements.txt index 94b26e57ef..0f64865e49 100644 --- a/base-requirements.txt +++ b/base-requirements.txt @@ -1,3 +1,3 @@ # VCS -gt4py @ git+https://github.com/GridTools/gt4py.git@main +gt4py @ git+https://github.com/GridTools/gt4py.git@icon4py_20241113 # use tagged release until #596 & gt4py#1738 is merged From 8525847d7013bd983eddc1cdc0c6f0cbf3e8992a Mon Sep 17 00:00:00 2001 From: Magdalena Date: Tue, 19 Nov 2024 10:39:25 +0100 Subject: [PATCH 2/7] remove old microphysics path (#601) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index eaff90e5d0..339f0b5224 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,7 +7,7 @@ ./model/atmosphere/subgrid_scale_physics/microphysics ./model/common[io] ./model/driver -./model/physics/microphysics + # icon4pytools ./tools From bac96a5464d3b0928ba5f58cdd210fceb437eb93 Mon Sep 17 00:00:00 2001 From: Magdalena Date: Tue, 19 Nov 2024 15:23:16 +0100 Subject: [PATCH 3/7] move dycore stencils to sub packages stencils (#595) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * move dycore stencils to sub packages stencils --------- Co-authored-by: Enrique González Paredes --- .../states.py => dycore_states.py} | 7 +- .../{state_utils/utils.py => dycore_utils.py} | 0 .../dycore/{nh_solve => }/solve_nonhydro.py | 142 +++++++++--------- ..._program.py => solve_nonhydro_stencils.py} | 54 +++---- .../atmosphere/dycore/stencils/__init__.py | 8 + .../accumulate_prep_adv_fields.py | 0 ...lysis_increments_from_data_assimilation.py | 0 .../add_analysis_increments_to_vn.py | 0 ...or_normal_wind_tendency_approaching_cfl.py | 2 +- ...tra_diffusion_for_w_con_approaching_cfl.py | 0 ..._interpolated_horizontal_advection_of_w.py | 0 .../add_temporal_tendencies_to_vn.py | 0 ...vn_by_interpolating_between_time_levels.py | 0 ...l_wind_derivative_to_divergence_damping.py | 0 .../apply_2nd_order_divergence_damping.py | 0 .../apply_4th_order_divergence_damping.py | 0 ...o_horizontal_gradient_of_exner_pressure.py | 0 .../apply_rayleigh_damping_mechanism.py | 0 ...ed_2nd_and_4th_order_divergence_damping.py | 0 .../compute_advective_normal_wind_tendency.py | 0 ...ompute_advective_vertical_wind_tendency.py | 0 .../dycore/{ => stencils}/compute_airmass.py | 0 ...rox_of_2nd_vertical_derivative_of_exner.py | 0 .../dycore/{ => stencils}/compute_avg_vn.py | 0 .../compute_avg_vn_and_graddiv_vn_and_vt.py | 6 +- .../compute_contravariant_correction.py | 0 .../compute_contravariant_correction_of_w.py | 0 ...iant_correction_of_w_for_lower_boundary.py | 0 ...e_divergence_of_fluxes_of_rho_and_theta.py | 0 .../compute_dwdz_for_divergence_damping.py | 0 .../compute_exner_from_rhotheta.py | 0 ...compute_explicit_part_for_rho_and_exner.py | 0 ...rom_advection_and_vertical_wind_density.py | 0 ...d_speed_and_vertical_wind_times_density.py | 0 .../compute_first_vertical_derivative.py | 0 .../{ => stencils}/compute_graddiv2_of_vn.py | 0 ...e_horizontal_advection_of_rho_and_theta.py | 0 ...al_advection_term_for_vertical_velocity.py | 0 ..._of_exner_pressure_for_flat_coordinates.py | 0 ...t_of_exner_pressure_for_multiple_levels.py | 0 ..._exner_pressure_for_nonflat_coordinates.py | 0 .../compute_horizontal_kinetic_energy.py | 0 .../compute_hydrostatic_correction_term.py | 0 .../{ => stencils}/compute_mass_flux.py | 0 ...nd_clip_contravariant_vertical_velocity.py | 0 .../compute_perturbation_of_rho_and_theta.py | 0 ...nd_theta_and_rho_interface_cell_centers.py | 2 +- ...ute_results_for_thermodynamic_variables.py | 0 ...tial_temperatures_and_pressure_gradient.py | 0 .../compute_solver_coefficients_matrix.py | 0 .../{ => stencils}/compute_tangential_wind.py | 0 .../{ => stencils}/compute_theta_and_exner.py | 0 ...tial_temperatures_and_pressure_gradient.py | 2 +- .../compute_vn_on_lateral_boundary.py | 0 .../copy_cell_kdim_field_to_vp.py | 0 ...correct_contravariant_vertical_velocity.py | 0 .../{ => stencils}/extrapolate_at_top.py | 0 .../extrapolate_temporally_exner_pressure.py | 0 .../fused_solve_nonhydro_stencil_39_40.py | 4 +- ...sed_velocity_advection_stencil_15_to_18.py | 8 +- ...sed_velocity_advection_stencil_19_to_20.py | 6 +- ...fused_velocity_advection_stencil_1_to_7.py | 18 ++- ...used_velocity_advection_stencil_8_to_13.py | 14 +- ...used_velocity_advection_stencil_8_to_14.py | 17 ++- .../init_cell_kdim_field_with_zero_vp.py | 0 .../init_cell_kdim_field_with_zero_wp.py | 0 ...two_cell_kdim_fields_index_with_zero_vp.py | 2 +- .../init_two_cell_kdim_fields_with_zero_vp.py | 2 +- .../init_two_cell_kdim_fields_with_zero_wp.py | 2 +- .../init_two_edge_kdim_fields_with_zero_wp.py | 0 ...ariant_vertical_velocity_to_full_levels.py | 0 .../interpolate_to_cell_center.py | 0 .../interpolate_to_half_levels_vp.py | 0 .../{ => stencils}/interpolate_to_surface.py | 0 ..._and_vt_to_ie_and_compute_ekin_on_edges.py | 4 +- ...late_vn_to_ie_and_compute_ekin_on_edges.py | 2 +- .../interpolate_vt_to_interface_edges.py | 0 ...lation_scalar_cells2verts_scalar_ri_dsl.py | 0 .../mo_math_divrot_rot_vertex_ri_dsl.py | 0 ...ath_gradients_grad_green_gauss_cell_dsl.py | 0 .../mo_solve_nonhydro_stencil_51.py | 0 .../atmosphere/dycore/{ => stencils}/py.typed | 0 ...tion_for_w_and_contravariant_correction.py | 2 +- .../set_theta_v_prime_ic_at_lower_boundary.py | 2 +- ...diagonal_matrix_for_w_back_substitution.py | 0 ..._tridiagonal_matrix_for_w_forward_sweep.py | 0 .../update_density_exner_wind.py | 2 +- .../update_dynamical_exner_time_increment.py | 0 .../update_mass_flux_weighted.py | 0 .../{ => stencils}/update_mass_volume_flux.py | 0 .../dycore/{ => stencils}/update_theta_v.py | 0 .../dycore/{ => stencils}/update_wind.py | 0 .../{velocity => }/velocity_advection.py | 52 ++++--- ...gram.py => velocity_advection_stencils.py} | 26 ++-- .../test_accumulate_prep_adv_fields.py | 4 +- ...lysis_increments_from_data_assimilation.py | 2 +- .../test_add_analysis_increments_to_vn.py | 2 +- ...or_normal_wind_tendency_approaching_cfl.py | 2 +- ...tra_diffusion_for_w_con_approaching_cfl.py | 2 +- ..._interpolated_horizontal_advection_of_w.py | 2 +- .../test_add_temporal_tendencies_to_vn.py | 2 +- ...vn_by_interpolating_between_time_levels.py | 2 +- ...l_wind_derivative_to_divergence_damping.py | 2 +- ...test_apply_2nd_order_divergence_damping.py | 2 +- ...test_apply_4th_order_divergence_damping.py | 2 +- ...o_horizontal_gradient_of_exner_pressure.py | 2 +- .../test_apply_rayleigh_damping_mechanism.py | 2 +- ...ed_2nd_and_4th_order_divergence_damping.py | 2 +- ..._compute_advective_normal_wind_tendency.py | 2 +- ...ompute_advective_vertical_wind_tendency.py | 2 +- .../test_compute_airmass.py | 2 +- ...rox_of_2nd_vertical_derivative_of_exner.py | 2 +- .../test_compute_avg_vn.py | 2 +- ...st_compute_avg_vn_and_graddiv_vn_and_vt.py | 2 +- .../test_compute_contravariant_correction.py | 2 +- ...t_compute_contravariant_correction_of_w.py | 2 +- ...iant_correction_of_w_for_lower_boundary.py | 2 +- ...est_compute_dwdz_for_divergence_damping.py | 2 +- .../test_compute_exner_from_rhotheta.py | 4 +- ...compute_explicit_part_for_rho_and_exner.py | 2 +- ...rom_advection_and_vertical_wind_density.py | 2 +- ...d_speed_and_vertical_wind_times_density.py | 2 +- .../test_compute_first_vertical_derivative.py | 2 +- .../test_compute_graddiv2_of_vn.py | 2 +- ...e_horizontal_advection_of_rho_and_theta.py | 2 +- ...al_advection_term_for_vertical_velocity.py | 2 +- ..._of_exner_pressure_for_flat_coordinates.py | 2 +- ...t_of_exner_pressure_for_multiple_levels.py | 2 +- ..._exner_pressure_for_nonflat_coordinates.py | 2 +- .../test_compute_horizontal_kinetic_energy.py | 2 +- ...est_compute_hydrostatic_correction_term.py | 2 +- .../test_compute_mass_flux.py | 2 +- ...nd_clip_contravariant_vertical_velocity.py | 2 +- ...t_compute_perturbation_of_rho_and_theta.py | 2 +- ...nd_theta_and_rho_interface_cell_centers.py | 2 +- ...ute_results_for_thermodynamic_variables.py | 2 +- ...tial_temperatures_and_pressure_gradient.py | 2 +- ...test_compute_solver_coefficients_matrix.py | 2 +- .../test_compute_tangential_wind.py | 2 +- .../test_compute_theta_and_exner.py | 2 +- ...tial_temperatures_and_pressure_gradient.py | 2 +- .../test_compute_vn_on_lateral_boundary.py | 2 +- .../test_copy_cell_kdim_field_to_vp.py | 4 +- ...correct_contravariant_vertical_velocity.py | 2 +- .../test_extrapolate_at_top.py | 2 +- ...t_extrapolate_temporally_exner_pressure.py | 2 +- ...test_fused_solve_nonhydro_stencil_39_40.py | 2 +- ...sed_velocity_advection_stencil_15_to_18.py | 2 +- ...sed_velocity_advection_stencil_19_to_20.py | 2 +- ...fused_velocity_advection_stencil_1_to_7.py | 2 +- ...used_velocity_advection_stencil_8_to_13.py | 2 +- .../test_init_cell_kdim_field_with_zero_vp.py | 2 +- .../test_init_cell_kdim_field_with_zero_wp.py | 2 +- ...two_cell_kdim_fields_index_with_zero_vp.py | 2 +- ..._init_two_cell_kdim_fields_with_zero_vp.py | 2 +- ..._init_two_cell_kdim_fields_with_zero_wp.py | 2 +- ..._init_two_edge_kdim_fields_with_zero_wp.py | 2 +- ...ariant_vertical_velocity_to_full_levels.py | 2 +- .../test_interpolate_to_cell_center.py | 4 +- .../test_interpolate_to_half_levels_vp.py | 2 +- .../test_interpolate_to_surface.py | 2 +- ..._and_vt_to_ie_and_compute_ekin_on_edges.py | 2 +- ...late_vn_to_ie_and_compute_ekin_on_edges.py | 2 +- .../test_interpolate_vt_to_interface_edges.py | 2 +- ...e_divergence_of_fluxes_of_rho_and_theta.py | 2 +- ...lation_scalar_cells2verts_scalar_ri_dsl.py | 2 +- .../test_mo_math_divrot_rot_vertex_ri_dsl.py | 2 +- ...ath_gradients_grad_green_gauss_cell_dsl.py | 2 +- .../test_mo_solve_nonhydro_stencil_51.py | 2 +- ...tion_for_w_and_contravariant_correction.py | 2 +- ..._set_theta_v_prime_ic_at_lower_boundary.py | 2 +- ...diagonal_matrix_for_w_back_substitution.py | 2 +- ..._tridiagonal_matrix_for_w_forward_sweep.py | 2 +- .../test_update_density_exner_wind.py | 4 +- ...t_update_dynamical_exner_time_increment.py | 2 +- .../test_update_mass_flux_weighted.py | 4 +- .../test_update_mass_volume_flux.py | 2 +- .../test_update_theta_v.py | 2 +- .../dycore_stencil_tests/test_update_wind.py | 2 +- .../mpi_tests/test_parallel_solve_nonhydro.py | 7 +- .../{test_utils.py => test_dycore_utils.py} | 10 +- .../tests/dycore_tests/test_solve_nonhydro.py | 20 +-- .../dycore_tests/test_velocity_advection.py | 17 +-- .../dycore/tests/dycore_tests/utils.py | 13 +- .../tests/metric_tests/test_metric_fields.py | 5 +- model/docs/stencil_naming_convention.md | 4 +- .../model/driver/icon4py_configuration.py | 2 +- .../icon4py/model/driver/icon4py_driver.py | 15 +- .../model/driver/initialization_utils.py | 32 ++-- .../model/driver/test_cases/gauss3d.py | 16 +- .../test_cases/jablonowski_williamson.py | 16 +- .../tests/driver_tests/test_timeloop.py | 11 +- model/driver/tests/driver_tests/utils.py | 6 +- tools/src/icon4pytools/icon4pygen/cli.py | 2 +- .../src/icon4pytools/liskov/external/gt4py.py | 2 +- .../py2fgen/wrappers/dycore_wrapper.py | 14 +- tools/tests/icon4pygen/test_codegen.py | 6 +- tools/tests/py2fgen/test_dycore_wrapper.py | 15 +- tools/tests/py2fgen/utils.py | 2 +- 199 files changed, 409 insertions(+), 374 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{state_utils/states.py => dycore_states.py} (95%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{state_utils/utils.py => dycore_utils.py} (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{nh_solve => }/solve_nonhydro.py (93%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{nh_solve/solve_nonhydro_program.py => solve_nonhydro_stencils.py} (91%) create mode 100644 model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/__init__.py rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/accumulate_prep_adv_fields.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/add_analysis_increments_from_data_assimilation.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/add_analysis_increments_to_vn.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/add_extra_diffusion_for_normal_wind_tendency_approaching_cfl.py (97%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/add_extra_diffusion_for_w_con_approaching_cfl.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/add_interpolated_horizontal_advection_of_w.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/add_temporal_tendencies_to_vn.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/add_temporal_tendencies_to_vn_by_interpolating_between_time_levels.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/add_vertical_wind_derivative_to_divergence_damping.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/apply_2nd_order_divergence_damping.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/apply_4th_order_divergence_damping.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/apply_rayleigh_damping_mechanism.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/apply_weighted_2nd_and_4th_order_divergence_damping.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_advective_normal_wind_tendency.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_advective_vertical_wind_tendency.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_airmass.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_approx_of_2nd_vertical_derivative_of_exner.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_avg_vn.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_avg_vn_and_graddiv_vn_and_vt.py (92%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_contravariant_correction.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_contravariant_correction_of_w.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_contravariant_correction_of_w_for_lower_boundary.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_divergence_of_fluxes_of_rho_and_theta.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_dwdz_for_divergence_damping.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_exner_from_rhotheta.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_explicit_part_for_rho_and_exner.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_explicit_vertical_wind_from_advection_and_vertical_wind_density.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_explicit_vertical_wind_speed_and_vertical_wind_times_density.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_first_vertical_derivative.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_graddiv2_of_vn.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_horizontal_advection_of_rho_and_theta.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_horizontal_advection_term_for_vertical_velocity.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_horizontal_gradient_of_exner_pressure_for_multiple_levels.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_horizontal_kinetic_energy.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_hydrostatic_correction_term.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_mass_flux.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_maximum_cfl_and_clip_contravariant_vertical_velocity.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_perturbation_of_rho_and_theta.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_perturbation_of_rho_and_theta_and_rho_interface_cell_centers.py (96%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_results_for_thermodynamic_variables.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_rho_virtual_potential_temperatures_and_pressure_gradient.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_solver_coefficients_matrix.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_tangential_wind.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_theta_and_exner.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_virtual_potential_temperatures_and_pressure_gradient.py (97%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/compute_vn_on_lateral_boundary.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/copy_cell_kdim_field_to_vp.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/correct_contravariant_vertical_velocity.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/extrapolate_at_top.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/extrapolate_temporally_exner_pressure.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/fused_solve_nonhydro_stencil_39_40.py (91%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/fused_velocity_advection_stencil_15_to_18.py (93%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/fused_velocity_advection_stencil_19_to_20.py (94%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/fused_velocity_advection_stencil_1_to_7.py (94%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/fused_velocity_advection_stencil_8_to_13.py (93%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/fused_velocity_advection_stencil_8_to_14.py (85%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/init_cell_kdim_field_with_zero_vp.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/init_cell_kdim_field_with_zero_wp.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/init_two_cell_kdim_fields_index_with_zero_vp.py (96%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/init_two_cell_kdim_fields_with_zero_vp.py (94%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/init_two_cell_kdim_fields_with_zero_wp.py (94%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/init_two_edge_kdim_fields_with_zero_wp.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/interpolate_contravariant_vertical_velocity_to_full_levels.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/interpolate_to_cell_center.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/interpolate_to_half_levels_vp.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/interpolate_to_surface.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges.py (91%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/interpolate_vn_to_ie_and_compute_ekin_on_edges.py (95%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/interpolate_vt_to_interface_edges.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/mo_math_divrot_rot_vertex_ri_dsl.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/mo_math_gradients_grad_green_gauss_cell_dsl.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/mo_solve_nonhydro_stencil_51.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/py.typed (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/set_lower_boundary_condition_for_w_and_contravariant_correction.py (95%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/set_theta_v_prime_ic_at_lower_boundary.py (94%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/solve_tridiagonal_matrix_for_w_back_substitution.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/solve_tridiagonal_matrix_for_w_forward_sweep.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/update_density_exner_wind.py (96%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/update_dynamical_exner_time_increment.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/update_mass_flux_weighted.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/update_mass_volume_flux.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/update_theta_v.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{ => stencils}/update_wind.py (100%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{velocity => }/velocity_advection.py (92%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{velocity/velocity_advection_program.py => velocity_advection_stencils.py} (89%) rename model/atmosphere/dycore/tests/dycore_tests/{test_utils.py => test_dycore_utils.py} (90%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/state_utils/states.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/dycore_states.py similarity index 95% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/state_utils/states.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/dycore_states.py index b85ffed2a7..f550688272 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/state_utils/states.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/dycore_states.py @@ -6,6 +6,7 @@ # Please, refer to the LICENSE file in the root directory. # SPDX-License-Identifier: BSD-3-Clause import dataclasses +from typing import Optional import gt4py.next as gtx @@ -39,9 +40,9 @@ class DiagnosticStateNonHydro: ddt_w_adv_ntl2: fa.CellKField[float] # Analysis increments - rho_incr: fa.EdgeKField[float] # moist density increment [kg/m^3] - vn_incr: fa.EdgeKField[float] # normal velocity increment [m/s] - exner_incr: fa.EdgeKField[float] # exner increment [- ] + rho_incr: Optional[fa.EdgeKField[float]] # moist density increment [kg/m^3] + vn_incr: Optional[fa.EdgeKField[float]] # normal velocity increment [m/s] + exner_incr: Optional[fa.EdgeKField[float]] # exner increment [- ] exner_dyn_incr: fa.CellKField[float] # exner pressure dynamics increment @property diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/state_utils/utils.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/dycore_utils.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/state_utils/utils.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/dycore_utils.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py similarity index 93% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py index e61def7847..201d8a7444 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro.py @@ -12,133 +12,133 @@ import gt4py.next as gtx -import icon4py.model.atmosphere.dycore.nh_solve.solve_nonhydro_program as nhsolve_prog +import icon4py.model.atmosphere.dycore.solve_nonhydro_stencils as nhsolve_stencils import icon4py.model.common.grid.states as grid_states from gt4py.next import backend from icon4py.model.common import constants -from icon4py.model.atmosphere.dycore.init_cell_kdim_field_with_zero_wp import ( +from icon4py.model.atmosphere.dycore.stencils.init_cell_kdim_field_with_zero_wp import ( init_cell_kdim_field_with_zero_wp, ) -from icon4py.model.atmosphere.dycore.accumulate_prep_adv_fields import ( +from icon4py.model.atmosphere.dycore.stencils.accumulate_prep_adv_fields import ( accumulate_prep_adv_fields, ) -from icon4py.model.atmosphere.dycore.add_analysis_increments_from_data_assimilation import ( +from icon4py.model.atmosphere.dycore.stencils.add_analysis_increments_from_data_assimilation import ( add_analysis_increments_from_data_assimilation, ) -from icon4py.model.atmosphere.dycore.add_analysis_increments_to_vn import ( +from icon4py.model.atmosphere.dycore.stencils.add_analysis_increments_to_vn import ( add_analysis_increments_to_vn, ) -from icon4py.model.atmosphere.dycore.add_temporal_tendencies_to_vn import ( +from icon4py.model.atmosphere.dycore.stencils.add_temporal_tendencies_to_vn import ( add_temporal_tendencies_to_vn, ) -from icon4py.model.atmosphere.dycore.add_temporal_tendencies_to_vn_by_interpolating_between_time_levels import ( +from icon4py.model.atmosphere.dycore.stencils.add_temporal_tendencies_to_vn_by_interpolating_between_time_levels import ( add_temporal_tendencies_to_vn_by_interpolating_between_time_levels, ) -from icon4py.model.atmosphere.dycore.add_vertical_wind_derivative_to_divergence_damping import ( +from icon4py.model.atmosphere.dycore.stencils.add_vertical_wind_derivative_to_divergence_damping import ( add_vertical_wind_derivative_to_divergence_damping, ) -from icon4py.model.atmosphere.dycore.apply_2nd_order_divergence_damping import ( +from icon4py.model.atmosphere.dycore.stencils.apply_2nd_order_divergence_damping import ( apply_2nd_order_divergence_damping, ) -from icon4py.model.atmosphere.dycore.apply_4th_order_divergence_damping import ( +from icon4py.model.atmosphere.dycore.stencils.apply_4th_order_divergence_damping import ( apply_4th_order_divergence_damping, ) -from icon4py.model.atmosphere.dycore.apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure import ( +from icon4py.model.atmosphere.dycore.stencils.apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure import ( apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure, ) -from icon4py.model.atmosphere.dycore.apply_rayleigh_damping_mechanism import ( +from icon4py.model.atmosphere.dycore.stencils.apply_rayleigh_damping_mechanism import ( apply_rayleigh_damping_mechanism, ) -from icon4py.model.atmosphere.dycore.apply_weighted_2nd_and_4th_order_divergence_damping import ( +from icon4py.model.atmosphere.dycore.stencils.apply_weighted_2nd_and_4th_order_divergence_damping import ( apply_weighted_2nd_and_4th_order_divergence_damping, ) -from icon4py.model.atmosphere.dycore.compute_approx_of_2nd_vertical_derivative_of_exner import ( +from icon4py.model.atmosphere.dycore.stencils.compute_approx_of_2nd_vertical_derivative_of_exner import ( compute_approx_of_2nd_vertical_derivative_of_exner, ) -from icon4py.model.atmosphere.dycore.compute_avg_vn import compute_avg_vn -from icon4py.model.atmosphere.dycore.compute_avg_vn_and_graddiv_vn_and_vt import ( +from icon4py.model.atmosphere.dycore.stencils.compute_avg_vn import compute_avg_vn +from icon4py.model.atmosphere.dycore.stencils.compute_avg_vn_and_graddiv_vn_and_vt import ( compute_avg_vn_and_graddiv_vn_and_vt, ) -from icon4py.model.atmosphere.dycore.compute_divergence_of_fluxes_of_rho_and_theta import ( +from icon4py.model.atmosphere.dycore.stencils.compute_divergence_of_fluxes_of_rho_and_theta import ( compute_divergence_of_fluxes_of_rho_and_theta, ) -from icon4py.model.atmosphere.dycore.compute_dwdz_for_divergence_damping import ( +from icon4py.model.atmosphere.dycore.stencils.compute_dwdz_for_divergence_damping import ( compute_dwdz_for_divergence_damping, ) -from icon4py.model.atmosphere.dycore.compute_exner_from_rhotheta import ( +from icon4py.model.atmosphere.dycore.stencils.compute_exner_from_rhotheta import ( compute_exner_from_rhotheta, ) -from icon4py.model.atmosphere.dycore.compute_graddiv2_of_vn import ( +from icon4py.model.atmosphere.dycore.stencils.compute_graddiv2_of_vn import ( compute_graddiv2_of_vn, ) -from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates import ( +from icon4py.model.atmosphere.dycore.stencils.compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates import ( compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates, ) -from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates import ( +from icon4py.model.atmosphere.dycore.stencils.compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates import ( compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates, ) -from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_exner_pressure_for_multiple_levels import ( +from icon4py.model.atmosphere.dycore.stencils.compute_horizontal_gradient_of_exner_pressure_for_multiple_levels import ( compute_horizontal_gradient_of_exner_pressure_for_multiple_levels, ) -from icon4py.model.atmosphere.dycore.compute_hydrostatic_correction_term import ( +from icon4py.model.atmosphere.dycore.stencils.compute_hydrostatic_correction_term import ( compute_hydrostatic_correction_term, ) -from icon4py.model.atmosphere.dycore.compute_mass_flux import compute_mass_flux -from icon4py.model.atmosphere.dycore.compute_perturbation_of_rho_and_theta import ( +from icon4py.model.atmosphere.dycore.stencils.compute_mass_flux import compute_mass_flux +from icon4py.model.atmosphere.dycore.stencils.compute_perturbation_of_rho_and_theta import ( compute_perturbation_of_rho_and_theta, ) -from icon4py.model.atmosphere.dycore.compute_results_for_thermodynamic_variables import ( +from icon4py.model.atmosphere.dycore.stencils.compute_results_for_thermodynamic_variables import ( compute_results_for_thermodynamic_variables, ) -from icon4py.model.atmosphere.dycore.compute_rho_virtual_potential_temperatures_and_pressure_gradient import ( +from icon4py.model.atmosphere.dycore.stencils.compute_rho_virtual_potential_temperatures_and_pressure_gradient import ( compute_rho_virtual_potential_temperatures_and_pressure_gradient, ) -from icon4py.model.atmosphere.dycore.compute_theta_and_exner import ( +from icon4py.model.atmosphere.dycore.stencils.compute_theta_and_exner import ( compute_theta_and_exner, ) -from icon4py.model.atmosphere.dycore.compute_vn_on_lateral_boundary import ( +from icon4py.model.atmosphere.dycore.stencils.compute_vn_on_lateral_boundary import ( compute_vn_on_lateral_boundary, ) -from icon4py.model.atmosphere.dycore.copy_cell_kdim_field_to_vp import ( +from icon4py.model.atmosphere.dycore.stencils.copy_cell_kdim_field_to_vp import ( copy_cell_kdim_field_to_vp, ) -from icon4py.model.atmosphere.dycore.mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl import ( +from icon4py.model.atmosphere.dycore.stencils.mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl import ( mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl, ) -from icon4py.model.atmosphere.dycore.mo_math_gradients_grad_green_gauss_cell_dsl import ( +from icon4py.model.atmosphere.dycore.stencils.mo_math_gradients_grad_green_gauss_cell_dsl import ( mo_math_gradients_grad_green_gauss_cell_dsl, ) -from icon4py.model.atmosphere.dycore.init_two_cell_kdim_fields_with_zero_vp import ( +from icon4py.model.atmosphere.dycore.stencils.init_two_cell_kdim_fields_with_zero_vp import ( init_two_cell_kdim_fields_with_zero_vp, ) -from icon4py.model.atmosphere.dycore.init_two_cell_kdim_fields_with_zero_wp import ( +from icon4py.model.atmosphere.dycore.stencils.init_two_cell_kdim_fields_with_zero_wp import ( init_two_cell_kdim_fields_with_zero_wp, ) -from icon4py.model.atmosphere.dycore.init_two_edge_kdim_fields_with_zero_wp import ( +from icon4py.model.atmosphere.dycore.stencils.init_two_edge_kdim_fields_with_zero_wp import ( init_two_edge_kdim_fields_with_zero_wp, ) -from icon4py.model.atmosphere.dycore.solve_tridiagonal_matrix_for_w_back_substitution import ( +from icon4py.model.atmosphere.dycore.stencils.solve_tridiagonal_matrix_for_w_back_substitution import ( solve_tridiagonal_matrix_for_w_back_substitution, ) -from icon4py.model.atmosphere.dycore.solve_tridiagonal_matrix_for_w_forward_sweep import ( +from icon4py.model.atmosphere.dycore.stencils.solve_tridiagonal_matrix_for_w_forward_sweep import ( solve_tridiagonal_matrix_for_w_forward_sweep, ) -from icon4py.model.atmosphere.dycore.state_utils import ( - states as solve_nh_states, - utils as solve_nh_utils, +from icon4py.model.atmosphere.dycore import ( + dycore_states, + dycore_utils, ) -from icon4py.model.atmosphere.dycore.update_dynamical_exner_time_increment import ( +from icon4py.model.atmosphere.dycore.stencils.update_dynamical_exner_time_increment import ( update_dynamical_exner_time_increment, ) -from icon4py.model.atmosphere.dycore.update_mass_volume_flux import ( +from icon4py.model.atmosphere.dycore.stencils.update_mass_volume_flux import ( update_mass_volume_flux, ) -from icon4py.model.atmosphere.dycore.update_mass_flux_weighted import ( +from icon4py.model.atmosphere.dycore.stencils.update_mass_flux_weighted import ( update_mass_flux_weighted, ) -from icon4py.model.atmosphere.dycore.update_theta_v import update_theta_v -from icon4py.model.atmosphere.dycore.velocity.velocity_advection import ( +from icon4py.model.atmosphere.dycore.stencils.update_theta_v import update_theta_v +from icon4py.model.atmosphere.dycore.velocity_advection import ( VelocityAdvection, ) from icon4py.model.common.decomposition import definitions as decomposition @@ -442,8 +442,8 @@ def __init__( grid: icon_grid.IconGrid, config: NonHydrostaticConfig, params: NonHydrostaticParams, - metric_state_nonhydro: solve_nh_states.MetricStateNonHydro, - interpolation_state: solve_nh_states.InterpolationState, + metric_state_nonhydro: dycore_states.MetricStateNonHydro, + interpolation_state: dycore_states.InterpolationState, vertical_params: v_grid.VerticalGrid, edge_geometry: grid_states.EdgeParams, cell_geometry: grid_states.CellParams, @@ -583,37 +583,43 @@ def __init__( self._backend ) self._update_mass_flux_weighted = update_mass_flux_weighted.with_backend(self._backend) - self._compute_z_raylfac = solve_nh_utils.compute_z_raylfac.with_backend(self._backend) - self._predictor_stencils_2_3 = nhsolve_prog.predictor_stencils_2_3.with_backend( + self._compute_z_raylfac = dycore_utils.compute_z_raylfac.with_backend(self._backend) + self._predictor_stencils_2_3 = nhsolve_stencils.predictor_stencils_2_3.with_backend( self._backend ) - self._predictor_stencils_4_5_6 = nhsolve_prog.predictor_stencils_4_5_6.with_backend( + self._predictor_stencils_4_5_6 = nhsolve_stencils.predictor_stencils_4_5_6.with_backend( self._backend ) - self._compute_pressure_gradient_and_perturbed_rho_and_potential_temperatures = nhsolve_prog.compute_pressure_gradient_and_perturbed_rho_and_potential_temperatures.with_backend( + self._compute_pressure_gradient_and_perturbed_rho_and_potential_temperatures = nhsolve_stencils.compute_pressure_gradient_and_perturbed_rho_and_potential_temperatures.with_backend( self._backend ) self._predictor_stencils_11_lower_upper = ( - nhsolve_prog.predictor_stencils_11_lower_upper.with_backend(self._backend) + nhsolve_stencils.predictor_stencils_11_lower_upper.with_backend(self._backend) ) self._compute_horizontal_advection_of_rho_and_theta = ( - nhsolve_prog.compute_horizontal_advection_of_rho_and_theta.with_backend(self._backend) + nhsolve_stencils.compute_horizontal_advection_of_rho_and_theta.with_backend( + self._backend + ) + ) + self._predictor_stencils_35_36 = nhsolve_stencils.predictor_stencils_35_36.with_backend( + self._backend ) - self._predictor_stencils_35_36 = nhsolve_prog.predictor_stencils_35_36.with_backend( + self._predictor_stencils_37_38 = nhsolve_stencils.predictor_stencils_37_38.with_backend( self._backend ) - self._predictor_stencils_37_38 = nhsolve_prog.predictor_stencils_37_38.with_backend( + self._stencils_39_40 = nhsolve_stencils.stencils_39_40.with_backend(self._backend) + self._stencils_43_44_45_45b = nhsolve_stencils.stencils_43_44_45_45b.with_backend( self._backend ) - self._stencils_39_40 = nhsolve_prog.stencils_39_40.with_backend(self._backend) - self._stencils_43_44_45_45b = nhsolve_prog.stencils_43_44_45_45b.with_backend(self._backend) - self._stencils_47_48_49 = nhsolve_prog.stencils_47_48_49.with_backend(self._backend) - self._stencils_61_62 = nhsolve_prog.stencils_61_62.with_backend(self._backend) + self._stencils_47_48_49 = nhsolve_stencils.stencils_47_48_49.with_backend(self._backend) + self._stencils_61_62 = nhsolve_stencils.stencils_61_62.with_backend(self._backend) self._en_smag_fac_for_zero_nshift = smagorinsky.en_smag_fac_for_zero_nshift.with_backend( self._backend ) - self._init_test_fields = nhsolve_prog.init_test_fields.with_backend(self._backend) - self._stencils_42_44_45_45b = nhsolve_prog.stencils_42_44_45_45b.with_backend(self._backend) + self._init_test_fields = nhsolve_stencils.init_test_fields.with_backend(self._backend) + self._stencils_42_44_45_45b = nhsolve_stencils.stencils_42_44_45_45b.with_backend( + self._backend + ) self.velocity_advection = VelocityAdvection( grid, @@ -803,9 +809,9 @@ def set_timelevels(self, nnow, nnew): def time_step( self, - diagnostic_state_nh: solve_nh_states.DiagnosticStateNonHydro, + diagnostic_state_nh: dycore_states.DiagnosticStateNonHydro, prognostic_state_ls: list[prognostics.PrognosticState], - prep_adv: solve_nh_states.PrepAdvection, + prep_adv: dycore_states.PrepAdvection, divdamp_fac_o2: float, dtime: float, l_recompute: bool, @@ -912,7 +918,7 @@ def time_step( # flake8: noqa: C901 def run_predictor_step( self, - diagnostic_state_nh: solve_nh_states.DiagnosticStateNonHydro, + diagnostic_state_nh: dycore_states.DiagnosticStateNonHydro, prognostic_state: list[prognostics.PrognosticState], z_fields: IntermediateFields, dtime: float, @@ -1637,11 +1643,11 @@ def run_predictor_step( def run_corrector_step( self, - diagnostic_state_nh: solve_nh_states.DiagnosticStateNonHydro, + diagnostic_state_nh: dycore_states.DiagnosticStateNonHydro, prognostic_state: list[prognostics.PrognosticState], z_fields: IntermediateFields, divdamp_fac_o2: float, - prep_adv: solve_nh_states.PrepAdvection, + prep_adv: dycore_states.PrepAdvection, dtime: float, nnew: int, nnow: int, @@ -1664,7 +1670,7 @@ def run_corrector_step( # Coefficient for reduced fourth-order divergence d scal_divdamp_o2 = divdamp_fac_o2 * self._cell_params.mean_cell_area - solve_nh_utils._calculate_divdamp_fields( + dycore_utils._calculate_divdamp_fields( self.enh_divdamp_fac, gtx.int32(self._config.divdamp_order), self._cell_params.mean_cell_area, diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro_program.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro_stencils.py similarity index 91% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro_program.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro_stencils.py index 7fc369018c..a39a273f31 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro_program.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_nonhydro_stencils.py @@ -8,75 +8,75 @@ import gt4py.next as gtx from gt4py.next.ffront.fbuiltins import where -from icon4py.model.atmosphere.dycore.compute_contravariant_correction import ( +from icon4py.model.atmosphere.dycore.dycore_utils import ( + _broadcast_zero_to_three_edge_kdim_fields_wp, +) +from icon4py.model.atmosphere.dycore.stencils.compute_contravariant_correction import ( _compute_contravariant_correction, ) -from icon4py.model.atmosphere.dycore.compute_contravariant_correction_of_w import ( +from icon4py.model.atmosphere.dycore.stencils.compute_contravariant_correction_of_w import ( _compute_contravariant_correction_of_w, ) -from icon4py.model.atmosphere.dycore.compute_contravariant_correction_of_w_for_lower_boundary import ( +from icon4py.model.atmosphere.dycore.stencils.compute_contravariant_correction_of_w_for_lower_boundary import ( _compute_contravariant_correction_of_w_for_lower_boundary, ) -from icon4py.model.atmosphere.dycore.compute_explicit_part_for_rho_and_exner import ( +from icon4py.model.atmosphere.dycore.stencils.compute_explicit_part_for_rho_and_exner import ( _compute_explicit_part_for_rho_and_exner, ) -from icon4py.model.atmosphere.dycore.compute_explicit_vertical_wind_from_advection_and_vertical_wind_density import ( +from icon4py.model.atmosphere.dycore.stencils.compute_explicit_vertical_wind_from_advection_and_vertical_wind_density import ( _compute_explicit_vertical_wind_from_advection_and_vertical_wind_density, ) -from icon4py.model.atmosphere.dycore.compute_explicit_vertical_wind_speed_and_vertical_wind_times_density import ( +from icon4py.model.atmosphere.dycore.stencils.compute_explicit_vertical_wind_speed_and_vertical_wind_times_density import ( _compute_explicit_vertical_wind_speed_and_vertical_wind_times_density, ) -from icon4py.model.atmosphere.dycore.compute_first_vertical_derivative import ( +from icon4py.model.atmosphere.dycore.stencils.compute_first_vertical_derivative import ( _compute_first_vertical_derivative, ) -from icon4py.model.atmosphere.dycore.compute_horizontal_advection_of_rho_and_theta import ( +from icon4py.model.atmosphere.dycore.stencils.compute_horizontal_advection_of_rho_and_theta import ( _compute_horizontal_advection_of_rho_and_theta, ) -from icon4py.model.atmosphere.dycore.compute_horizontal_kinetic_energy import ( +from icon4py.model.atmosphere.dycore.stencils.compute_horizontal_kinetic_energy import ( _compute_horizontal_kinetic_energy, ) -from icon4py.model.atmosphere.dycore.compute_perturbation_of_rho_and_theta import ( +from icon4py.model.atmosphere.dycore.stencils.compute_perturbation_of_rho_and_theta import ( _compute_perturbation_of_rho_and_theta, ) -from icon4py.model.atmosphere.dycore.compute_perturbation_of_rho_and_theta_and_rho_interface_cell_centers import ( +from icon4py.model.atmosphere.dycore.stencils.compute_perturbation_of_rho_and_theta_and_rho_interface_cell_centers import ( _compute_perturbation_of_rho_and_theta_and_rho_interface_cell_centers, ) -from icon4py.model.atmosphere.dycore.compute_solver_coefficients_matrix import ( +from icon4py.model.atmosphere.dycore.stencils.compute_solver_coefficients_matrix import ( _compute_solver_coefficients_matrix, ) -from icon4py.model.atmosphere.dycore.compute_virtual_potential_temperatures_and_pressure_gradient import ( +from icon4py.model.atmosphere.dycore.stencils.compute_virtual_potential_temperatures_and_pressure_gradient import ( _compute_virtual_potential_temperatures_and_pressure_gradient, ) -from icon4py.model.atmosphere.dycore.extrapolate_at_top import _extrapolate_at_top -from icon4py.model.atmosphere.dycore.extrapolate_temporally_exner_pressure import ( +from icon4py.model.atmosphere.dycore.stencils.extrapolate_at_top import _extrapolate_at_top +from icon4py.model.atmosphere.dycore.stencils.extrapolate_temporally_exner_pressure import ( _extrapolate_temporally_exner_pressure, ) -from icon4py.model.atmosphere.dycore.init_cell_kdim_field_with_zero_vp import ( +from icon4py.model.atmosphere.dycore.stencils.init_cell_kdim_field_with_zero_vp import ( _init_cell_kdim_field_with_zero_vp, ) -from icon4py.model.atmosphere.dycore.init_cell_kdim_field_with_zero_wp import ( +from icon4py.model.atmosphere.dycore.stencils.init_cell_kdim_field_with_zero_wp import ( _init_cell_kdim_field_with_zero_wp, ) -from icon4py.model.atmosphere.dycore.interpolate_to_half_levels_vp import ( +from icon4py.model.atmosphere.dycore.stencils.interpolate_to_half_levels_vp import ( _interpolate_to_half_levels_vp, ) -from icon4py.model.atmosphere.dycore.interpolate_to_surface import _interpolate_to_surface -from icon4py.model.atmosphere.dycore.interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges import ( +from icon4py.model.atmosphere.dycore.stencils.interpolate_to_surface import _interpolate_to_surface +from icon4py.model.atmosphere.dycore.stencils.interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges import ( _interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges, ) -from icon4py.model.atmosphere.dycore.set_lower_boundary_condition_for_w_and_contravariant_correction import ( +from icon4py.model.atmosphere.dycore.stencils.set_lower_boundary_condition_for_w_and_contravariant_correction import ( _set_lower_boundary_condition_for_w_and_contravariant_correction, ) -from icon4py.model.atmosphere.dycore.set_theta_v_prime_ic_at_lower_boundary import ( +from icon4py.model.atmosphere.dycore.stencils.set_theta_v_prime_ic_at_lower_boundary import ( _set_theta_v_prime_ic_at_lower_boundary, ) -from icon4py.model.atmosphere.dycore.state_utils.utils import ( - _broadcast_zero_to_three_edge_kdim_fields_wp, -) -from icon4py.model.atmosphere.dycore.update_density_exner_wind import ( +from icon4py.model.atmosphere.dycore.stencils.update_density_exner_wind import ( _update_density_exner_wind, ) -from icon4py.model.atmosphere.dycore.update_wind import _update_wind +from icon4py.model.atmosphere.dycore.stencils.update_wind import _update_wind from icon4py.model.common import dimension as dims, field_type_aliases as fa diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/__init__.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/__init__.py new file mode 100644 index 0000000000..80b673df7e --- /dev/null +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/__init__.py @@ -0,0 +1,8 @@ +# ICON4Py - ICON inspired code in Python and GT4Py +# +# Copyright (c) 2022-2024, ETH Zurich and MeteoSwiss +# All rights reserved. +# +# Please, refer to the LICENSE file in the root directory. +# SPDX-License-Identifier: BSD-3-Clause + diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/accumulate_prep_adv_fields.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/accumulate_prep_adv_fields.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/accumulate_prep_adv_fields.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/accumulate_prep_adv_fields.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_analysis_increments_from_data_assimilation.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/add_analysis_increments_from_data_assimilation.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_analysis_increments_from_data_assimilation.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/add_analysis_increments_from_data_assimilation.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_analysis_increments_to_vn.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/add_analysis_increments_to_vn.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_analysis_increments_to_vn.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/add_analysis_increments_to_vn.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_extra_diffusion_for_normal_wind_tendency_approaching_cfl.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/add_extra_diffusion_for_normal_wind_tendency_approaching_cfl.py similarity index 97% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_extra_diffusion_for_normal_wind_tendency_approaching_cfl.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/add_extra_diffusion_for_normal_wind_tendency_approaching_cfl.py index 7364f4e891..180090acea 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_extra_diffusion_for_normal_wind_tendency_approaching_cfl.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/add_extra_diffusion_for_normal_wind_tendency_approaching_cfl.py @@ -16,7 +16,7 @@ where, ) -from icon4py.model.atmosphere.dycore.init_two_edge_kdim_fields_with_zero_wp import ( +from icon4py.model.atmosphere.dycore.stencils.init_two_edge_kdim_fields_with_zero_wp import ( _init_two_edge_kdim_fields_with_zero_wp, ) from icon4py.model.common import dimension as dims, field_type_aliases as fa diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_extra_diffusion_for_w_con_approaching_cfl.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/add_extra_diffusion_for_w_con_approaching_cfl.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_extra_diffusion_for_w_con_approaching_cfl.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/add_extra_diffusion_for_w_con_approaching_cfl.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_interpolated_horizontal_advection_of_w.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/add_interpolated_horizontal_advection_of_w.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_interpolated_horizontal_advection_of_w.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/add_interpolated_horizontal_advection_of_w.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_temporal_tendencies_to_vn.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/add_temporal_tendencies_to_vn.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_temporal_tendencies_to_vn.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/add_temporal_tendencies_to_vn.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_temporal_tendencies_to_vn_by_interpolating_between_time_levels.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/add_temporal_tendencies_to_vn_by_interpolating_between_time_levels.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_temporal_tendencies_to_vn_by_interpolating_between_time_levels.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/add_temporal_tendencies_to_vn_by_interpolating_between_time_levels.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_vertical_wind_derivative_to_divergence_damping.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/add_vertical_wind_derivative_to_divergence_damping.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_vertical_wind_derivative_to_divergence_damping.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/add_vertical_wind_derivative_to_divergence_damping.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_2nd_order_divergence_damping.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/apply_2nd_order_divergence_damping.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_2nd_order_divergence_damping.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/apply_2nd_order_divergence_damping.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_4th_order_divergence_damping.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/apply_4th_order_divergence_damping.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_4th_order_divergence_damping.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/apply_4th_order_divergence_damping.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_rayleigh_damping_mechanism.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/apply_rayleigh_damping_mechanism.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_rayleigh_damping_mechanism.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/apply_rayleigh_damping_mechanism.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_weighted_2nd_and_4th_order_divergence_damping.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/apply_weighted_2nd_and_4th_order_divergence_damping.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_weighted_2nd_and_4th_order_divergence_damping.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/apply_weighted_2nd_and_4th_order_divergence_damping.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_advective_normal_wind_tendency.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_advective_normal_wind_tendency.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_advective_normal_wind_tendency.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_advective_normal_wind_tendency.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_advective_vertical_wind_tendency.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_advective_vertical_wind_tendency.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_advective_vertical_wind_tendency.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_advective_vertical_wind_tendency.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_airmass.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_airmass.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_airmass.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_airmass.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_approx_of_2nd_vertical_derivative_of_exner.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_approx_of_2nd_vertical_derivative_of_exner.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_approx_of_2nd_vertical_derivative_of_exner.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_approx_of_2nd_vertical_derivative_of_exner.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_avg_vn.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_avg_vn.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_avg_vn.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_avg_vn.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_avg_vn_and_graddiv_vn_and_vt.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_avg_vn_and_graddiv_vn_and_vt.py similarity index 92% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_avg_vn_and_graddiv_vn_and_vt.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_avg_vn_and_graddiv_vn_and_vt.py index 2632f6f6bb..508d252ace 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_avg_vn_and_graddiv_vn_and_vt.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_avg_vn_and_graddiv_vn_and_vt.py @@ -10,8 +10,10 @@ from gt4py.next.ffront.decorator import field_operator, program from gt4py.next.ffront.fbuiltins import astype, neighbor_sum -from icon4py.model.atmosphere.dycore.compute_avg_vn import _compute_avg_vn -from icon4py.model.atmosphere.dycore.compute_tangential_wind import _compute_tangential_wind +from icon4py.model.atmosphere.dycore.stencils.compute_avg_vn import _compute_avg_vn +from icon4py.model.atmosphere.dycore.stencils.compute_tangential_wind import ( + _compute_tangential_wind, +) from icon4py.model.common import dimension as dims, field_type_aliases as fa from icon4py.model.common.dimension import E2C2EO, E2C2EODim from icon4py.model.common.type_alias import vpfloat, wpfloat diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_contravariant_correction.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_contravariant_correction.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_contravariant_correction.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_contravariant_correction.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_contravariant_correction_of_w.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_contravariant_correction_of_w.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_contravariant_correction_of_w.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_contravariant_correction_of_w.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_contravariant_correction_of_w_for_lower_boundary.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_contravariant_correction_of_w_for_lower_boundary.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_contravariant_correction_of_w_for_lower_boundary.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_contravariant_correction_of_w_for_lower_boundary.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_divergence_of_fluxes_of_rho_and_theta.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_divergence_of_fluxes_of_rho_and_theta.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_divergence_of_fluxes_of_rho_and_theta.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_divergence_of_fluxes_of_rho_and_theta.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_dwdz_for_divergence_damping.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_dwdz_for_divergence_damping.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_dwdz_for_divergence_damping.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_dwdz_for_divergence_damping.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_exner_from_rhotheta.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_exner_from_rhotheta.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_exner_from_rhotheta.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_exner_from_rhotheta.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_for_rho_and_exner.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_explicit_part_for_rho_and_exner.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_for_rho_and_exner.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_explicit_part_for_rho_and_exner.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_vertical_wind_from_advection_and_vertical_wind_density.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_explicit_vertical_wind_from_advection_and_vertical_wind_density.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_vertical_wind_from_advection_and_vertical_wind_density.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_explicit_vertical_wind_from_advection_and_vertical_wind_density.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_vertical_wind_speed_and_vertical_wind_times_density.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_explicit_vertical_wind_speed_and_vertical_wind_times_density.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_vertical_wind_speed_and_vertical_wind_times_density.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_explicit_vertical_wind_speed_and_vertical_wind_times_density.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_first_vertical_derivative.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_first_vertical_derivative.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_first_vertical_derivative.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_first_vertical_derivative.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_graddiv2_of_vn.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_graddiv2_of_vn.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_graddiv2_of_vn.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_graddiv2_of_vn.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_advection_of_rho_and_theta.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_horizontal_advection_of_rho_and_theta.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_advection_of_rho_and_theta.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_horizontal_advection_of_rho_and_theta.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_advection_term_for_vertical_velocity.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_horizontal_advection_term_for_vertical_velocity.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_advection_term_for_vertical_velocity.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_horizontal_advection_term_for_vertical_velocity.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_exner_pressure_for_multiple_levels.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_horizontal_gradient_of_exner_pressure_for_multiple_levels.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_exner_pressure_for_multiple_levels.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_horizontal_gradient_of_exner_pressure_for_multiple_levels.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_kinetic_energy.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_horizontal_kinetic_energy.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_kinetic_energy.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_horizontal_kinetic_energy.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_hydrostatic_correction_term.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_hydrostatic_correction_term.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_hydrostatic_correction_term.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_hydrostatic_correction_term.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_mass_flux.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_mass_flux.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_mass_flux.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_mass_flux.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_maximum_cfl_and_clip_contravariant_vertical_velocity.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_maximum_cfl_and_clip_contravariant_vertical_velocity.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_maximum_cfl_and_clip_contravariant_vertical_velocity.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_maximum_cfl_and_clip_contravariant_vertical_velocity.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_perturbation_of_rho_and_theta.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_perturbation_of_rho_and_theta.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_perturbation_of_rho_and_theta.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_perturbation_of_rho_and_theta.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_perturbation_of_rho_and_theta_and_rho_interface_cell_centers.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_perturbation_of_rho_and_theta_and_rho_interface_cell_centers.py similarity index 96% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_perturbation_of_rho_and_theta_and_rho_interface_cell_centers.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_perturbation_of_rho_and_theta_and_rho_interface_cell_centers.py index f0692e2163..af7978c0a8 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_perturbation_of_rho_and_theta_and_rho_interface_cell_centers.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_perturbation_of_rho_and_theta_and_rho_interface_cell_centers.py @@ -10,7 +10,7 @@ from gt4py.next.ffront.decorator import field_operator, program from gt4py.next.ffront.fbuiltins import astype -from icon4py.model.atmosphere.dycore.compute_perturbation_of_rho_and_theta import ( +from icon4py.model.atmosphere.dycore.stencils.compute_perturbation_of_rho_and_theta import ( _compute_perturbation_of_rho_and_theta, ) from icon4py.model.common import dimension as dims, field_type_aliases as fa diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_results_for_thermodynamic_variables.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_results_for_thermodynamic_variables.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_results_for_thermodynamic_variables.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_results_for_thermodynamic_variables.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_rho_virtual_potential_temperatures_and_pressure_gradient.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_rho_virtual_potential_temperatures_and_pressure_gradient.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_rho_virtual_potential_temperatures_and_pressure_gradient.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_rho_virtual_potential_temperatures_and_pressure_gradient.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_solver_coefficients_matrix.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_solver_coefficients_matrix.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_solver_coefficients_matrix.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_solver_coefficients_matrix.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_tangential_wind.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_tangential_wind.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_tangential_wind.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_tangential_wind.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_theta_and_exner.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_theta_and_exner.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_theta_and_exner.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_theta_and_exner.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_virtual_potential_temperatures_and_pressure_gradient.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_virtual_potential_temperatures_and_pressure_gradient.py similarity index 97% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_virtual_potential_temperatures_and_pressure_gradient.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_virtual_potential_temperatures_and_pressure_gradient.py index eaf32aef0a..36d1403d46 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_virtual_potential_temperatures_and_pressure_gradient.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_virtual_potential_temperatures_and_pressure_gradient.py @@ -10,7 +10,7 @@ from gt4py.next.ffront.decorator import field_operator, program from gt4py.next.ffront.fbuiltins import astype -from icon4py.model.atmosphere.dycore.interpolate_to_half_levels_vp import ( +from icon4py.model.atmosphere.dycore.stencils.interpolate_to_half_levels_vp import ( _interpolate_to_half_levels_vp, ) from icon4py.model.common import dimension as dims, field_type_aliases as fa diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_vn_on_lateral_boundary.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_vn_on_lateral_boundary.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_vn_on_lateral_boundary.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/compute_vn_on_lateral_boundary.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/copy_cell_kdim_field_to_vp.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/copy_cell_kdim_field_to_vp.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/copy_cell_kdim_field_to_vp.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/copy_cell_kdim_field_to_vp.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/correct_contravariant_vertical_velocity.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/correct_contravariant_vertical_velocity.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/correct_contravariant_vertical_velocity.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/correct_contravariant_vertical_velocity.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/extrapolate_at_top.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/extrapolate_at_top.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/extrapolate_at_top.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/extrapolate_at_top.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/extrapolate_temporally_exner_pressure.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/extrapolate_temporally_exner_pressure.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/extrapolate_temporally_exner_pressure.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/extrapolate_temporally_exner_pressure.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/fused_solve_nonhydro_stencil_39_40.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/fused_solve_nonhydro_stencil_39_40.py similarity index 91% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/fused_solve_nonhydro_stencil_39_40.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/fused_solve_nonhydro_stencil_39_40.py index b1f4334418..88248ecad5 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/fused_solve_nonhydro_stencil_39_40.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/fused_solve_nonhydro_stencil_39_40.py @@ -9,10 +9,10 @@ from gt4py.next.ffront.decorator import GridType, field_operator, program from gt4py.next.ffront.fbuiltins import where -from icon4py.model.atmosphere.dycore.compute_contravariant_correction_of_w import ( +from icon4py.model.atmosphere.dycore.stencils.compute_contravariant_correction_of_w import ( _compute_contravariant_correction_of_w, ) -from icon4py.model.atmosphere.dycore.compute_contravariant_correction_of_w_for_lower_boundary import ( +from icon4py.model.atmosphere.dycore.stencils.compute_contravariant_correction_of_w_for_lower_boundary import ( _compute_contravariant_correction_of_w_for_lower_boundary, ) from icon4py.model.common import dimension as dims, field_type_aliases as fa diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/fused_velocity_advection_stencil_15_to_18.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/fused_velocity_advection_stencil_15_to_18.py similarity index 93% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/fused_velocity_advection_stencil_15_to_18.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/fused_velocity_advection_stencil_15_to_18.py index d0ec2b346e..6c2a60614b 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/fused_velocity_advection_stencil_15_to_18.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/fused_velocity_advection_stencil_15_to_18.py @@ -10,16 +10,16 @@ from gt4py.next.ffront.decorator import field_operator, program from gt4py.next.ffront.fbuiltins import broadcast, maximum, where -from icon4py.model.atmosphere.dycore.add_extra_diffusion_for_w_con_approaching_cfl import ( +from icon4py.model.atmosphere.dycore.stencils.add_extra_diffusion_for_w_con_approaching_cfl import ( _add_extra_diffusion_for_w_con_approaching_cfl, ) -from icon4py.model.atmosphere.dycore.add_interpolated_horizontal_advection_of_w import ( +from icon4py.model.atmosphere.dycore.stencils.add_interpolated_horizontal_advection_of_w import ( _add_interpolated_horizontal_advection_of_w, ) -from icon4py.model.atmosphere.dycore.compute_advective_vertical_wind_tendency import ( +from icon4py.model.atmosphere.dycore.stencils.compute_advective_vertical_wind_tendency import ( _compute_advective_vertical_wind_tendency, ) -from icon4py.model.atmosphere.dycore.interpolate_contravariant_vertical_velocity_to_full_levels import ( +from icon4py.model.atmosphere.dycore.stencils.interpolate_contravariant_vertical_velocity_to_full_levels import ( _interpolate_contravariant_vertical_velocity_to_full_levels, ) from icon4py.model.common import dimension as dims, field_type_aliases as fa diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/fused_velocity_advection_stencil_19_to_20.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/fused_velocity_advection_stencil_19_to_20.py similarity index 94% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/fused_velocity_advection_stencil_19_to_20.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/fused_velocity_advection_stencil_19_to_20.py index e0572ea7c0..3c57cc6928 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/fused_velocity_advection_stencil_19_to_20.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/fused_velocity_advection_stencil_19_to_20.py @@ -10,13 +10,13 @@ from gt4py.next.ffront.decorator import field_operator, program from gt4py.next.ffront.fbuiltins import maximum, where -from icon4py.model.atmosphere.dycore.add_extra_diffusion_for_normal_wind_tendency_approaching_cfl import ( +from icon4py.model.atmosphere.dycore.stencils.add_extra_diffusion_for_normal_wind_tendency_approaching_cfl import ( _add_extra_diffusion_for_normal_wind_tendency_approaching_cfl, ) -from icon4py.model.atmosphere.dycore.compute_advective_normal_wind_tendency import ( +from icon4py.model.atmosphere.dycore.stencils.compute_advective_normal_wind_tendency import ( _compute_advective_normal_wind_tendency, ) -from icon4py.model.atmosphere.dycore.mo_math_divrot_rot_vertex_ri_dsl import ( +from icon4py.model.atmosphere.dycore.stencils.mo_math_divrot_rot_vertex_ri_dsl import ( _mo_math_divrot_rot_vertex_ri_dsl, ) from icon4py.model.common import dimension as dims, field_type_aliases as fa diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/fused_velocity_advection_stencil_1_to_7.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/fused_velocity_advection_stencil_1_to_7.py similarity index 94% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/fused_velocity_advection_stencil_1_to_7.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/fused_velocity_advection_stencil_1_to_7.py index 85ab8b661e..5cee4cb9e0 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/fused_velocity_advection_stencil_1_to_7.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/fused_velocity_advection_stencil_1_to_7.py @@ -10,24 +10,26 @@ from gt4py.next.ffront.decorator import field_operator, program from gt4py.next.ffront.fbuiltins import broadcast, where -from icon4py.model.atmosphere.dycore.compute_contravariant_correction import ( +from icon4py.model.atmosphere.dycore.stencils.compute_contravariant_correction import ( _compute_contravariant_correction, ) -from icon4py.model.atmosphere.dycore.compute_horizontal_advection_term_for_vertical_velocity import ( +from icon4py.model.atmosphere.dycore.stencils.compute_horizontal_advection_term_for_vertical_velocity import ( _compute_horizontal_advection_term_for_vertical_velocity, ) -from icon4py.model.atmosphere.dycore.compute_horizontal_kinetic_energy import ( +from icon4py.model.atmosphere.dycore.stencils.compute_horizontal_kinetic_energy import ( _compute_horizontal_kinetic_energy, ) -from icon4py.model.atmosphere.dycore.compute_tangential_wind import _compute_tangential_wind -from icon4py.model.atmosphere.dycore.extrapolate_at_top import _extrapolate_at_top -from icon4py.model.atmosphere.dycore.interpolate_vn_to_ie_and_compute_ekin_on_edges import ( +from icon4py.model.atmosphere.dycore.stencils.compute_tangential_wind import ( + _compute_tangential_wind, +) +from icon4py.model.atmosphere.dycore.stencils.extrapolate_at_top import _extrapolate_at_top +from icon4py.model.atmosphere.dycore.stencils.interpolate_vn_to_ie_and_compute_ekin_on_edges import ( _interpolate_vn_to_ie_and_compute_ekin_on_edges, ) -from icon4py.model.atmosphere.dycore.interpolate_vt_to_interface_edges import ( +from icon4py.model.atmosphere.dycore.stencils.interpolate_vt_to_interface_edges import ( _interpolate_vt_to_interface_edges, ) -from icon4py.model.atmosphere.dycore.mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl import ( +from icon4py.model.atmosphere.dycore.stencils.mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl import ( _mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl, ) from icon4py.model.common import dimension as dims, field_type_aliases as fa diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/fused_velocity_advection_stencil_8_to_13.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/fused_velocity_advection_stencil_8_to_13.py similarity index 93% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/fused_velocity_advection_stencil_8_to_13.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/fused_velocity_advection_stencil_8_to_13.py index 73478f37df..63bf7a2446 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/fused_velocity_advection_stencil_8_to_13.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/fused_velocity_advection_stencil_8_to_13.py @@ -10,15 +10,19 @@ from gt4py.next.ffront.decorator import field_operator, program from gt4py.next.ffront.fbuiltins import where -from icon4py.model.atmosphere.dycore.copy_cell_kdim_field_to_vp import _copy_cell_kdim_field_to_vp -from icon4py.model.atmosphere.dycore.correct_contravariant_vertical_velocity import ( +from icon4py.model.atmosphere.dycore.stencils.copy_cell_kdim_field_to_vp import ( + _copy_cell_kdim_field_to_vp, +) +from icon4py.model.atmosphere.dycore.stencils.correct_contravariant_vertical_velocity import ( _correct_contravariant_vertical_velocity, ) -from icon4py.model.atmosphere.dycore.init_cell_kdim_field_with_zero_vp import ( +from icon4py.model.atmosphere.dycore.stencils.init_cell_kdim_field_with_zero_vp import ( _init_cell_kdim_field_with_zero_vp, ) -from icon4py.model.atmosphere.dycore.interpolate_to_cell_center import _interpolate_to_cell_center -from icon4py.model.atmosphere.dycore.interpolate_to_half_levels_vp import ( +from icon4py.model.atmosphere.dycore.stencils.interpolate_to_cell_center import ( + _interpolate_to_cell_center, +) +from icon4py.model.atmosphere.dycore.stencils.interpolate_to_half_levels_vp import ( _interpolate_to_half_levels_vp, ) from icon4py.model.common import dimension as dims, field_type_aliases as fa diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/fused_velocity_advection_stencil_8_to_14.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/fused_velocity_advection_stencil_8_to_14.py similarity index 85% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/fused_velocity_advection_stencil_8_to_14.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/fused_velocity_advection_stencil_8_to_14.py index 80dc062173..d608161766 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/fused_velocity_advection_stencil_8_to_14.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/fused_velocity_advection_stencil_8_to_14.py @@ -10,18 +10,22 @@ from gt4py.next.ffront.decorator import field_operator, program from gt4py.next.ffront.fbuiltins import maximum, where -from icon4py.model.atmosphere.dycore.compute_maximum_cfl_and_clip_contravariant_vertical_velocity import ( +from icon4py.model.atmosphere.dycore.stencils.compute_maximum_cfl_and_clip_contravariant_vertical_velocity import ( _compute_maximum_cfl_and_clip_contravariant_vertical_velocity, ) -from icon4py.model.atmosphere.dycore.copy_cell_kdim_field_to_vp import _copy_cell_kdim_field_to_vp -from icon4py.model.atmosphere.dycore.correct_contravariant_vertical_velocity import ( +from icon4py.model.atmosphere.dycore.stencils.copy_cell_kdim_field_to_vp import ( + _copy_cell_kdim_field_to_vp, +) +from icon4py.model.atmosphere.dycore.stencils.correct_contravariant_vertical_velocity import ( _correct_contravariant_vertical_velocity, ) -from icon4py.model.atmosphere.dycore.init_cell_kdim_field_with_zero_vp import ( +from icon4py.model.atmosphere.dycore.stencils.init_cell_kdim_field_with_zero_vp import ( _init_cell_kdim_field_with_zero_vp, ) -from icon4py.model.atmosphere.dycore.interpolate_to_cell_center import _interpolate_to_cell_center -from icon4py.model.atmosphere.dycore.interpolate_to_half_levels_vp import ( +from icon4py.model.atmosphere.dycore.stencils.interpolate_to_cell_center import ( + _interpolate_to_cell_center, +) +from icon4py.model.atmosphere.dycore.stencils.interpolate_to_half_levels_vp import ( _interpolate_to_half_levels_vp, ) from icon4py.model.common import dimension as dims, field_type_aliases as fa @@ -29,6 +33,7 @@ from icon4py.model.common.type_alias import vpfloat, wpfloat +# TODO (magdalena) this stencils has no StencilTest, (numpy) reference @field_operator def _fused_velocity_advection_stencil_8_to_14( z_kin_hor_e: fa.EdgeKField[vpfloat], diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/init_cell_kdim_field_with_zero_vp.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/init_cell_kdim_field_with_zero_vp.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/init_cell_kdim_field_with_zero_vp.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/init_cell_kdim_field_with_zero_vp.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/init_cell_kdim_field_with_zero_wp.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/init_cell_kdim_field_with_zero_wp.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/init_cell_kdim_field_with_zero_wp.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/init_cell_kdim_field_with_zero_wp.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/init_two_cell_kdim_fields_index_with_zero_vp.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/init_two_cell_kdim_fields_index_with_zero_vp.py similarity index 96% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/init_two_cell_kdim_fields_index_with_zero_vp.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/init_two_cell_kdim_fields_index_with_zero_vp.py index 42d89679ce..0e9141621c 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/init_two_cell_kdim_fields_index_with_zero_vp.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/init_two_cell_kdim_fields_index_with_zero_vp.py @@ -10,7 +10,7 @@ from gt4py.next.ffront.decorator import field_operator, program from gt4py.next.ffront.fbuiltins import broadcast, where -from icon4py.model.atmosphere.dycore.init_cell_kdim_field_with_zero_vp import ( +from icon4py.model.atmosphere.dycore.stencils.init_cell_kdim_field_with_zero_vp import ( _init_cell_kdim_field_with_zero_vp, ) from icon4py.model.common import dimension as dims, field_type_aliases as fa diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/init_two_cell_kdim_fields_with_zero_vp.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/init_two_cell_kdim_fields_with_zero_vp.py similarity index 94% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/init_two_cell_kdim_fields_with_zero_vp.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/init_two_cell_kdim_fields_with_zero_vp.py index fa169f9cfa..627b1e12ee 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/init_two_cell_kdim_fields_with_zero_vp.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/init_two_cell_kdim_fields_with_zero_vp.py @@ -9,7 +9,7 @@ from gt4py.next.common import GridType from gt4py.next.ffront.decorator import field_operator, program -from icon4py.model.atmosphere.dycore.init_cell_kdim_field_with_zero_vp import ( +from icon4py.model.atmosphere.dycore.stencils.init_cell_kdim_field_with_zero_vp import ( _init_cell_kdim_field_with_zero_vp, ) from icon4py.model.common import dimension as dims, field_type_aliases as fa diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/init_two_cell_kdim_fields_with_zero_wp.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/init_two_cell_kdim_fields_with_zero_wp.py similarity index 94% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/init_two_cell_kdim_fields_with_zero_wp.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/init_two_cell_kdim_fields_with_zero_wp.py index 774e90ac5d..13092ddc9f 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/init_two_cell_kdim_fields_with_zero_wp.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/init_two_cell_kdim_fields_with_zero_wp.py @@ -9,7 +9,7 @@ from gt4py.next.common import GridType from gt4py.next.ffront.decorator import field_operator, program -from icon4py.model.atmosphere.dycore.init_cell_kdim_field_with_zero_wp import ( +from icon4py.model.atmosphere.dycore.stencils.init_cell_kdim_field_with_zero_wp import ( _init_cell_kdim_field_with_zero_wp, ) from icon4py.model.common import dimension as dims, field_type_aliases as fa diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/init_two_edge_kdim_fields_with_zero_wp.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/init_two_edge_kdim_fields_with_zero_wp.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/init_two_edge_kdim_fields_with_zero_wp.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/init_two_edge_kdim_fields_with_zero_wp.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_contravariant_vertical_velocity_to_full_levels.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/interpolate_contravariant_vertical_velocity_to_full_levels.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_contravariant_vertical_velocity_to_full_levels.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/interpolate_contravariant_vertical_velocity_to_full_levels.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_to_cell_center.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/interpolate_to_cell_center.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_to_cell_center.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/interpolate_to_cell_center.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_to_half_levels_vp.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/interpolate_to_half_levels_vp.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_to_half_levels_vp.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/interpolate_to_half_levels_vp.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_to_surface.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/interpolate_to_surface.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_to_surface.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/interpolate_to_surface.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges.py similarity index 91% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges.py index f46594fbef..ab8ac9ee96 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges.py @@ -9,10 +9,10 @@ from gt4py.next.common import GridType from gt4py.next.ffront.decorator import field_operator, program -from icon4py.model.atmosphere.dycore.interpolate_vn_to_ie_and_compute_ekin_on_edges import ( +from icon4py.model.atmosphere.dycore.stencils.interpolate_vn_to_ie_and_compute_ekin_on_edges import ( _interpolate_vn_to_ie_and_compute_ekin_on_edges, ) -from icon4py.model.atmosphere.dycore.interpolate_vt_to_interface_edges import ( +from icon4py.model.atmosphere.dycore.stencils.interpolate_vt_to_interface_edges import ( _interpolate_vt_to_interface_edges, ) from icon4py.model.common import dimension as dims, field_type_aliases as fa diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_vn_to_ie_and_compute_ekin_on_edges.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/interpolate_vn_to_ie_and_compute_ekin_on_edges.py similarity index 95% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_vn_to_ie_and_compute_ekin_on_edges.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/interpolate_vn_to_ie_and_compute_ekin_on_edges.py index 6dc5ef2d0d..dd4c666ab3 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_vn_to_ie_and_compute_ekin_on_edges.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/interpolate_vn_to_ie_and_compute_ekin_on_edges.py @@ -10,7 +10,7 @@ from gt4py.next.ffront.decorator import field_operator, program from gt4py.next.ffront.fbuiltins import astype -from icon4py.model.atmosphere.dycore.compute_horizontal_kinetic_energy import ( +from icon4py.model.atmosphere.dycore.stencils.compute_horizontal_kinetic_energy import ( _compute_horizontal_kinetic_energy, ) from icon4py.model.common import dimension as dims, field_type_aliases as fa diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_vt_to_interface_edges.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/interpolate_vt_to_interface_edges.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_vt_to_interface_edges.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/interpolate_vt_to_interface_edges.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_math_divrot_rot_vertex_ri_dsl.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/mo_math_divrot_rot_vertex_ri_dsl.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_math_divrot_rot_vertex_ri_dsl.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/mo_math_divrot_rot_vertex_ri_dsl.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_math_gradients_grad_green_gauss_cell_dsl.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/mo_math_gradients_grad_green_gauss_cell_dsl.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_math_gradients_grad_green_gauss_cell_dsl.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/mo_math_gradients_grad_green_gauss_cell_dsl.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_51.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/mo_solve_nonhydro_stencil_51.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_51.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/mo_solve_nonhydro_stencil_51.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/py.typed b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/py.typed similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/py.typed rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/py.typed diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/set_lower_boundary_condition_for_w_and_contravariant_correction.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/set_lower_boundary_condition_for_w_and_contravariant_correction.py similarity index 95% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/set_lower_boundary_condition_for_w_and_contravariant_correction.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/set_lower_boundary_condition_for_w_and_contravariant_correction.py index 9d4a002a91..3802a7fffc 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/set_lower_boundary_condition_for_w_and_contravariant_correction.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/set_lower_boundary_condition_for_w_and_contravariant_correction.py @@ -10,7 +10,7 @@ from gt4py.next.ffront.decorator import field_operator, program from gt4py.next.ffront.fbuiltins import astype -from icon4py.model.atmosphere.dycore.init_cell_kdim_field_with_zero_wp import ( +from icon4py.model.atmosphere.dycore.stencils.init_cell_kdim_field_with_zero_wp import ( _init_cell_kdim_field_with_zero_wp, ) from icon4py.model.common import dimension as dims, field_type_aliases as fa diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/set_theta_v_prime_ic_at_lower_boundary.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/set_theta_v_prime_ic_at_lower_boundary.py similarity index 94% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/set_theta_v_prime_ic_at_lower_boundary.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/set_theta_v_prime_ic_at_lower_boundary.py index cda1a2ca40..d0a834022f 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/set_theta_v_prime_ic_at_lower_boundary.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/set_theta_v_prime_ic_at_lower_boundary.py @@ -10,7 +10,7 @@ from gt4py.next.ffront.decorator import field_operator, program from gt4py.next.ffront.fbuiltins import astype -from icon4py.model.atmosphere.dycore.interpolate_to_surface import _interpolate_to_surface +from icon4py.model.atmosphere.dycore.stencils.interpolate_to_surface import _interpolate_to_surface from icon4py.model.common import dimension as dims, field_type_aliases as fa from icon4py.model.common.settings import backend from icon4py.model.common.type_alias import vpfloat, wpfloat diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_tridiagonal_matrix_for_w_back_substitution.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/solve_tridiagonal_matrix_for_w_back_substitution.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_tridiagonal_matrix_for_w_back_substitution.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/solve_tridiagonal_matrix_for_w_back_substitution.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_tridiagonal_matrix_for_w_forward_sweep.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/solve_tridiagonal_matrix_for_w_forward_sweep.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/solve_tridiagonal_matrix_for_w_forward_sweep.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/solve_tridiagonal_matrix_for_w_forward_sweep.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/update_density_exner_wind.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/update_density_exner_wind.py similarity index 96% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/update_density_exner_wind.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/update_density_exner_wind.py index c39e34893a..772c1110d0 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/update_density_exner_wind.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/update_density_exner_wind.py @@ -9,7 +9,7 @@ from gt4py.next.common import GridType from gt4py.next.ffront.decorator import field_operator, program -from icon4py.model.atmosphere.dycore.update_wind import _update_wind +from icon4py.model.atmosphere.dycore.stencils.update_wind import _update_wind from icon4py.model.common import dimension as dims, field_type_aliases as fa from icon4py.model.common.settings import backend from icon4py.model.common.type_alias import wpfloat diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/update_dynamical_exner_time_increment.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/update_dynamical_exner_time_increment.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/update_dynamical_exner_time_increment.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/update_dynamical_exner_time_increment.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/update_mass_flux_weighted.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/update_mass_flux_weighted.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/update_mass_flux_weighted.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/update_mass_flux_weighted.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/update_mass_volume_flux.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/update_mass_volume_flux.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/update_mass_volume_flux.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/update_mass_volume_flux.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/update_theta_v.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/update_theta_v.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/update_theta_v.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/update_theta_v.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/update_wind.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/update_wind.py similarity index 100% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/update_wind.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/stencils/update_wind.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/velocity/velocity_advection.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/velocity_advection.py similarity index 92% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/velocity/velocity_advection.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/velocity_advection.py index ddee52a386..dac570952d 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/velocity/velocity_advection.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/velocity_advection.py @@ -8,39 +8,39 @@ import gt4py.next as gtx from gt4py.next import backend -import icon4py.model.atmosphere.dycore.velocity.velocity_advection_program as velocity_prog -from icon4py.model.atmosphere.dycore.add_extra_diffusion_for_normal_wind_tendency_approaching_cfl import ( +import icon4py.model.atmosphere.dycore.velocity_advection_stencils as velocity_stencils +from icon4py.model.atmosphere.dycore import dycore_states +from icon4py.model.atmosphere.dycore.stencils.add_extra_diffusion_for_normal_wind_tendency_approaching_cfl import ( add_extra_diffusion_for_normal_wind_tendency_approaching_cfl, ) -from icon4py.model.atmosphere.dycore.add_extra_diffusion_for_w_con_approaching_cfl import ( +from icon4py.model.atmosphere.dycore.stencils.add_extra_diffusion_for_w_con_approaching_cfl import ( add_extra_diffusion_for_w_con_approaching_cfl, ) -from icon4py.model.atmosphere.dycore.compute_advective_normal_wind_tendency import ( +from icon4py.model.atmosphere.dycore.stencils.compute_advective_normal_wind_tendency import ( compute_advective_normal_wind_tendency, ) -from icon4py.model.atmosphere.dycore.compute_horizontal_advection_term_for_vertical_velocity import ( +from icon4py.model.atmosphere.dycore.stencils.compute_horizontal_advection_term_for_vertical_velocity import ( compute_horizontal_advection_term_for_vertical_velocity, ) -from icon4py.model.atmosphere.dycore.compute_tangential_wind import compute_tangential_wind -from icon4py.model.atmosphere.dycore.interpolate_contravariant_vertical_velocity_to_full_levels import ( +from icon4py.model.atmosphere.dycore.stencils.compute_tangential_wind import compute_tangential_wind +from icon4py.model.atmosphere.dycore.stencils.interpolate_contravariant_vertical_velocity_to_full_levels import ( interpolate_contravariant_vertical_velocity_to_full_levels, ) -from icon4py.model.atmosphere.dycore.interpolate_to_cell_center import ( +from icon4py.model.atmosphere.dycore.stencils.interpolate_to_cell_center import ( interpolate_to_cell_center, ) -from icon4py.model.atmosphere.dycore.interpolate_vn_to_ie_and_compute_ekin_on_edges import ( +from icon4py.model.atmosphere.dycore.stencils.interpolate_vn_to_ie_and_compute_ekin_on_edges import ( interpolate_vn_to_ie_and_compute_ekin_on_edges, ) -from icon4py.model.atmosphere.dycore.interpolate_vt_to_interface_edges import ( +from icon4py.model.atmosphere.dycore.stencils.interpolate_vt_to_interface_edges import ( interpolate_vt_to_interface_edges, ) -from icon4py.model.atmosphere.dycore.mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl import ( +from icon4py.model.atmosphere.dycore.stencils.mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl import ( mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl, ) -from icon4py.model.atmosphere.dycore.mo_math_divrot_rot_vertex_ri_dsl import ( +from icon4py.model.atmosphere.dycore.stencils.mo_math_divrot_rot_vertex_ri_dsl import ( mo_math_divrot_rot_vertex_ri_dsl, ) -from icon4py.model.atmosphere.dycore.state_utils import states as solve_nh_states from icon4py.model.common import dimension as dims, field_type_aliases as fa from icon4py.model.common.grid import ( horizontal as h_grid, @@ -57,8 +57,8 @@ class VelocityAdvection: def __init__( self, grid: icon_grid.IconGrid, - metric_state: solve_nh_states.MetricStateNonHydro, - interpolation_state: solve_nh_states.InterpolationState, + metric_state: dycore_states.MetricStateNonHydro, + interpolation_state: dycore_states.InterpolationState, vertical_params: v_grid.VerticalGrid, edge_params: grid_states.EdgeParams, owner_mask: fa.CellField[bool], @@ -66,8 +66,8 @@ def __init__( ): self.grid: icon_grid.IconGrid = grid self._backend = backend - self.metric_state: solve_nh_states.MetricStateNonHydro = metric_state - self.interpolation_state: solve_nh_states.InterpolationState = interpolation_state + self.metric_state: dycore_states.MetricStateNonHydro = metric_state + self.interpolation_state: dycore_states.InterpolationState = interpolation_state self.vertical_params = vertical_params self.edge_params = edge_params self.c_owner_mask = owner_mask @@ -90,21 +90,23 @@ def __init__( self._interpolate_vt_to_interface_edges = interpolate_vt_to_interface_edges.with_backend( self._backend ) - self._fused_stencils_4_5 = velocity_prog.fused_stencils_4_5.with_backend(self._backend) - self._extrapolate_at_top = velocity_prog.extrapolate_at_top.with_backend(self._backend) + self._fused_stencils_4_5 = velocity_stencils.fused_stencils_4_5.with_backend(self._backend) + self._extrapolate_at_top = velocity_stencils.extrapolate_at_top.with_backend(self._backend) self._compute_horizontal_advection_term_for_vertical_velocity = ( compute_horizontal_advection_term_for_vertical_velocity.with_backend(self._backend) ) self._interpolate_to_cell_center = interpolate_to_cell_center.with_backend(self._backend) - self._fused_stencils_9_10 = velocity_prog.fused_stencils_9_10.with_backend(self._backend) - self._fused_stencils_11_to_13 = velocity_prog.fused_stencils_11_to_13.with_backend( + self._fused_stencils_9_10 = velocity_stencils.fused_stencils_9_10.with_backend( self._backend ) - self._fused_stencil_14 = velocity_prog.fused_stencil_14.with_backend(self._backend) + self._fused_stencils_11_to_13 = velocity_stencils.fused_stencils_11_to_13.with_backend( + self._backend + ) + self._fused_stencil_14 = velocity_stencils.fused_stencil_14.with_backend(self._backend) self._interpolate_contravariant_vertical_velocity_to_full_levels = ( interpolate_contravariant_vertical_velocity_to_full_levels.with_backend(self._backend) ) - self._fused_stencils_16_to_17 = velocity_prog.fused_stencils_16_to_17.with_backend( + self._fused_stencils_16_to_17 = velocity_stencils.fused_stencils_16_to_17.with_backend( self._backend ) self._add_extra_diffusion_for_w_con_approaching_cfl = ( @@ -188,7 +190,7 @@ def _determine_local_domains(self): def run_predictor_step( self, vn_only: bool, - diagnostic_state: solve_nh_states.DiagnosticStateNonHydro, + diagnostic_state: dycore_states.DiagnosticStateNonHydro, prognostic_state: prognostics.PrognosticState, z_w_concorr_me: fa.EdgeKField[float], z_kin_hor_e: fa.EdgeKField[float], @@ -469,7 +471,7 @@ def _scale_factors_by_dtime(self, dtime): def run_corrector_step( self, vn_only: bool, - diagnostic_state: solve_nh_states.DiagnosticStateNonHydro, + diagnostic_state: dycore_states.DiagnosticStateNonHydro, prognostic_state: prognostics.PrognosticState, z_kin_hor_e: fa.EdgeKField[float], z_vt_ie: fa.EdgeKField[float], diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/velocity/velocity_advection_program.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/velocity_advection_stencils.py similarity index 89% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/velocity/velocity_advection_program.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/velocity_advection_stencils.py index c980d0d578..0fac9b2d50 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/velocity/velocity_advection_program.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/velocity_advection_stencils.py @@ -8,31 +8,35 @@ import gt4py.next as gtx from gt4py.next.ffront.fbuiltins import where -from icon4py.model.atmosphere.dycore.add_interpolated_horizontal_advection_of_w import ( +from icon4py.model.atmosphere.dycore.stencils.add_interpolated_horizontal_advection_of_w import ( _add_interpolated_horizontal_advection_of_w, ) -from icon4py.model.atmosphere.dycore.compute_advective_vertical_wind_tendency import ( +from icon4py.model.atmosphere.dycore.stencils.compute_advective_vertical_wind_tendency import ( _compute_advective_vertical_wind_tendency, ) -from icon4py.model.atmosphere.dycore.compute_contravariant_correction import ( +from icon4py.model.atmosphere.dycore.stencils.compute_contravariant_correction import ( _compute_contravariant_correction, ) -from icon4py.model.atmosphere.dycore.compute_horizontal_kinetic_energy import ( +from icon4py.model.atmosphere.dycore.stencils.compute_horizontal_kinetic_energy import ( _compute_horizontal_kinetic_energy, ) -from icon4py.model.atmosphere.dycore.compute_maximum_cfl_and_clip_contravariant_vertical_velocity import ( +from icon4py.model.atmosphere.dycore.stencils.compute_maximum_cfl_and_clip_contravariant_vertical_velocity import ( _compute_maximum_cfl_and_clip_contravariant_vertical_velocity, ) -from icon4py.model.atmosphere.dycore.copy_cell_kdim_field_to_vp import _copy_cell_kdim_field_to_vp -from icon4py.model.atmosphere.dycore.correct_contravariant_vertical_velocity import ( +from icon4py.model.atmosphere.dycore.stencils.copy_cell_kdim_field_to_vp import ( + _copy_cell_kdim_field_to_vp, +) +from icon4py.model.atmosphere.dycore.stencils.correct_contravariant_vertical_velocity import ( _correct_contravariant_vertical_velocity, ) -from icon4py.model.atmosphere.dycore.extrapolate_at_top import _extrapolate_at_top -from icon4py.model.atmosphere.dycore.init_cell_kdim_field_with_zero_vp import ( +from icon4py.model.atmosphere.dycore.stencils.extrapolate_at_top import _extrapolate_at_top +from icon4py.model.atmosphere.dycore.stencils.init_cell_kdim_field_with_zero_vp import ( _init_cell_kdim_field_with_zero_vp, ) -from icon4py.model.atmosphere.dycore.interpolate_to_cell_center import _interpolate_to_cell_center -from icon4py.model.atmosphere.dycore.interpolate_to_half_levels_vp import ( +from icon4py.model.atmosphere.dycore.stencils.interpolate_to_cell_center import ( + _interpolate_to_cell_center, +) +from icon4py.model.atmosphere.dycore.stencils.interpolate_to_half_levels_vp import ( _interpolate_to_half_levels_vp, ) from icon4py.model.common import dimension as dims, field_type_aliases as fa diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_accumulate_prep_adv_fields.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_accumulate_prep_adv_fields.py index edabde6eda..310774acba 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_accumulate_prep_adv_fields.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_accumulate_prep_adv_fields.py @@ -9,7 +9,9 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.accumulate_prep_adv_fields import accumulate_prep_adv_fields +from icon4py.model.atmosphere.dycore.stencils.accumulate_prep_adv_fields import ( + accumulate_prep_adv_fields, +) from icon4py.model.common import dimension as dims from icon4py.model.common.test_utils.helpers import StencilTest, random_field from icon4py.model.common.type_alias import wpfloat diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_analysis_increments_from_data_assimilation.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_analysis_increments_from_data_assimilation.py index 6b6ca4bb0b..ee385fbef4 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_analysis_increments_from_data_assimilation.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_analysis_increments_from_data_assimilation.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.add_analysis_increments_from_data_assimilation import ( +from icon4py.model.atmosphere.dycore.stencils.add_analysis_increments_from_data_assimilation import ( add_analysis_increments_from_data_assimilation, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_analysis_increments_to_vn.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_analysis_increments_to_vn.py index d08e56d0f7..9d6782e0fd 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_analysis_increments_to_vn.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_analysis_increments_to_vn.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.add_analysis_increments_to_vn import ( +from icon4py.model.atmosphere.dycore.stencils.add_analysis_increments_to_vn import ( add_analysis_increments_to_vn, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_extra_diffusion_for_normal_wind_tendency_approaching_cfl.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_extra_diffusion_for_normal_wind_tendency_approaching_cfl.py index 95a4339aca..4d6153ccdb 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_extra_diffusion_for_normal_wind_tendency_approaching_cfl.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_extra_diffusion_for_normal_wind_tendency_approaching_cfl.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.add_extra_diffusion_for_normal_wind_tendency_approaching_cfl import ( +from icon4py.model.atmosphere.dycore.stencils.add_extra_diffusion_for_normal_wind_tendency_approaching_cfl import ( add_extra_diffusion_for_normal_wind_tendency_approaching_cfl, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_extra_diffusion_for_w_con_approaching_cfl.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_extra_diffusion_for_w_con_approaching_cfl.py index 0a4810b0ab..4392d89762 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_extra_diffusion_for_w_con_approaching_cfl.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_extra_diffusion_for_w_con_approaching_cfl.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.add_extra_diffusion_for_w_con_approaching_cfl import ( +from icon4py.model.atmosphere.dycore.stencils.add_extra_diffusion_for_w_con_approaching_cfl import ( add_extra_diffusion_for_w_con_approaching_cfl, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_interpolated_horizontal_advection_of_w.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_interpolated_horizontal_advection_of_w.py index cd8a31a956..ea2680d3a9 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_interpolated_horizontal_advection_of_w.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_interpolated_horizontal_advection_of_w.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.add_interpolated_horizontal_advection_of_w import ( +from icon4py.model.atmosphere.dycore.stencils.add_interpolated_horizontal_advection_of_w import ( add_interpolated_horizontal_advection_of_w, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_temporal_tendencies_to_vn.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_temporal_tendencies_to_vn.py index acf34903dc..862a86232d 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_temporal_tendencies_to_vn.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_temporal_tendencies_to_vn.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.add_temporal_tendencies_to_vn import ( +from icon4py.model.atmosphere.dycore.stencils.add_temporal_tendencies_to_vn import ( add_temporal_tendencies_to_vn, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_temporal_tendencies_to_vn_by_interpolating_between_time_levels.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_temporal_tendencies_to_vn_by_interpolating_between_time_levels.py index 75372243c1..453d771936 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_temporal_tendencies_to_vn_by_interpolating_between_time_levels.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_temporal_tendencies_to_vn_by_interpolating_between_time_levels.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.add_temporal_tendencies_to_vn_by_interpolating_between_time_levels import ( +from icon4py.model.atmosphere.dycore.stencils.add_temporal_tendencies_to_vn_by_interpolating_between_time_levels import ( add_temporal_tendencies_to_vn_by_interpolating_between_time_levels, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_vertical_wind_derivative_to_divergence_damping.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_vertical_wind_derivative_to_divergence_damping.py index 60e7883fae..d4d4de268b 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_vertical_wind_derivative_to_divergence_damping.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_vertical_wind_derivative_to_divergence_damping.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.add_vertical_wind_derivative_to_divergence_damping import ( +from icon4py.model.atmosphere.dycore.stencils.add_vertical_wind_derivative_to_divergence_damping import ( add_vertical_wind_derivative_to_divergence_damping, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_2nd_order_divergence_damping.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_2nd_order_divergence_damping.py index f8974dd0bc..e154dce319 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_2nd_order_divergence_damping.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_2nd_order_divergence_damping.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.apply_2nd_order_divergence_damping import ( +from icon4py.model.atmosphere.dycore.stencils.apply_2nd_order_divergence_damping import ( apply_2nd_order_divergence_damping, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_4th_order_divergence_damping.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_4th_order_divergence_damping.py index eeca0d61a5..dbfab04748 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_4th_order_divergence_damping.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_4th_order_divergence_damping.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.apply_4th_order_divergence_damping import ( +from icon4py.model.atmosphere.dycore.stencils.apply_4th_order_divergence_damping import ( apply_4th_order_divergence_damping, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure.py index 75a57db896..86bb625782 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure import ( +from icon4py.model.atmosphere.dycore.stencils.apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure import ( apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_rayleigh_damping_mechanism.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_rayleigh_damping_mechanism.py index e567f189a7..f678b21594 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_rayleigh_damping_mechanism.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_rayleigh_damping_mechanism.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.apply_rayleigh_damping_mechanism import ( +from icon4py.model.atmosphere.dycore.stencils.apply_rayleigh_damping_mechanism import ( apply_rayleigh_damping_mechanism, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_weighted_2nd_and_4th_order_divergence_damping.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_weighted_2nd_and_4th_order_divergence_damping.py index 154515b748..c8cc615104 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_weighted_2nd_and_4th_order_divergence_damping.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_weighted_2nd_and_4th_order_divergence_damping.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.apply_weighted_2nd_and_4th_order_divergence_damping import ( +from icon4py.model.atmosphere.dycore.stencils.apply_weighted_2nd_and_4th_order_divergence_damping import ( apply_weighted_2nd_and_4th_order_divergence_damping, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_advective_normal_wind_tendency.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_advective_normal_wind_tendency.py index 829308b937..758302bd6a 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_advective_normal_wind_tendency.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_advective_normal_wind_tendency.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_advective_normal_wind_tendency import ( +from icon4py.model.atmosphere.dycore.stencils.compute_advective_normal_wind_tendency import ( compute_advective_normal_wind_tendency, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_advective_vertical_wind_tendency.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_advective_vertical_wind_tendency.py index 3ecdb85191..af73cd6341 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_advective_vertical_wind_tendency.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_advective_vertical_wind_tendency.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_advective_vertical_wind_tendency import ( +from icon4py.model.atmosphere.dycore.stencils.compute_advective_vertical_wind_tendency import ( compute_advective_vertical_wind_tendency, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_airmass.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_airmass.py index 44b021a6fa..fa9c21c5ad 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_airmass.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_airmass.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_airmass import compute_airmass +from icon4py.model.atmosphere.dycore.stencils.compute_airmass import compute_airmass from icon4py.model.common import dimension as dims from icon4py.model.common.test_utils.helpers import StencilTest, random_field from icon4py.model.common.type_alias import wpfloat diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_approx_of_2nd_vertical_derivative_of_exner.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_approx_of_2nd_vertical_derivative_of_exner.py index cfc37c86bd..4345cfb8ae 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_approx_of_2nd_vertical_derivative_of_exner.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_approx_of_2nd_vertical_derivative_of_exner.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_approx_of_2nd_vertical_derivative_of_exner import ( +from icon4py.model.atmosphere.dycore.stencils.compute_approx_of_2nd_vertical_derivative_of_exner import ( compute_approx_of_2nd_vertical_derivative_of_exner, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_avg_vn.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_avg_vn.py index c2901b6bbc..dd39ef06e6 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_avg_vn.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_avg_vn.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_avg_vn import compute_avg_vn +from icon4py.model.atmosphere.dycore.stencils.compute_avg_vn import compute_avg_vn from icon4py.model.common import dimension as dims from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field from icon4py.model.common.type_alias import wpfloat diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_avg_vn_and_graddiv_vn_and_vt.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_avg_vn_and_graddiv_vn_and_vt.py index 3469ee82eb..e50f96447b 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_avg_vn_and_graddiv_vn_and_vt.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_avg_vn_and_graddiv_vn_and_vt.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_avg_vn_and_graddiv_vn_and_vt import ( +from icon4py.model.atmosphere.dycore.stencils.compute_avg_vn_and_graddiv_vn_and_vt import ( compute_avg_vn_and_graddiv_vn_and_vt, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_contravariant_correction.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_contravariant_correction.py index 8a50fffcff..c18fd9cf9c 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_contravariant_correction.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_contravariant_correction.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_contravariant_correction import ( +from icon4py.model.atmosphere.dycore.stencils.compute_contravariant_correction import ( compute_contravariant_correction, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_contravariant_correction_of_w.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_contravariant_correction_of_w.py index 6716fda687..1858c5b81c 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_contravariant_correction_of_w.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_contravariant_correction_of_w.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_contravariant_correction_of_w import ( +from icon4py.model.atmosphere.dycore.stencils.compute_contravariant_correction_of_w import ( compute_contravariant_correction_of_w, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_contravariant_correction_of_w_for_lower_boundary.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_contravariant_correction_of_w_for_lower_boundary.py index a4f4ac137b..f2f4c67573 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_contravariant_correction_of_w_for_lower_boundary.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_contravariant_correction_of_w_for_lower_boundary.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_contravariant_correction_of_w_for_lower_boundary import ( +from icon4py.model.atmosphere.dycore.stencils.compute_contravariant_correction_of_w_for_lower_boundary import ( compute_contravariant_correction_of_w_for_lower_boundary, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_dwdz_for_divergence_damping.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_dwdz_for_divergence_damping.py index f9c4adbad0..7f74257a31 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_dwdz_for_divergence_damping.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_dwdz_for_divergence_damping.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_dwdz_for_divergence_damping import ( +from icon4py.model.atmosphere.dycore.stencils.compute_dwdz_for_divergence_damping import ( compute_dwdz_for_divergence_damping, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_exner_from_rhotheta.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_exner_from_rhotheta.py index 38026053e1..878b9d796f 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_exner_from_rhotheta.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_exner_from_rhotheta.py @@ -9,7 +9,9 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_exner_from_rhotheta import compute_exner_from_rhotheta +from icon4py.model.atmosphere.dycore.stencils.compute_exner_from_rhotheta import ( + compute_exner_from_rhotheta, +) from icon4py.model.common import dimension as dims from icon4py.model.common.test_utils.helpers import StencilTest, random_field from icon4py.model.common.type_alias import wpfloat diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_part_for_rho_and_exner.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_part_for_rho_and_exner.py index 77fdb25132..7047923e9d 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_part_for_rho_and_exner.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_part_for_rho_and_exner.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_explicit_part_for_rho_and_exner import ( +from icon4py.model.atmosphere.dycore.stencils.compute_explicit_part_for_rho_and_exner import ( compute_explicit_part_for_rho_and_exner, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_vertical_wind_from_advection_and_vertical_wind_density.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_vertical_wind_from_advection_and_vertical_wind_density.py index a5a0f7f579..a04582f0d4 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_vertical_wind_from_advection_and_vertical_wind_density.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_vertical_wind_from_advection_and_vertical_wind_density.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_explicit_vertical_wind_from_advection_and_vertical_wind_density import ( +from icon4py.model.atmosphere.dycore.stencils.compute_explicit_vertical_wind_from_advection_and_vertical_wind_density import ( compute_explicit_vertical_wind_from_advection_and_vertical_wind_density, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_vertical_wind_speed_and_vertical_wind_times_density.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_vertical_wind_speed_and_vertical_wind_times_density.py index d078990c19..61d158b2b7 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_vertical_wind_speed_and_vertical_wind_times_density.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_vertical_wind_speed_and_vertical_wind_times_density.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_explicit_vertical_wind_speed_and_vertical_wind_times_density import ( +from icon4py.model.atmosphere.dycore.stencils.compute_explicit_vertical_wind_speed_and_vertical_wind_times_density import ( compute_explicit_vertical_wind_speed_and_vertical_wind_times_density, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_first_vertical_derivative.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_first_vertical_derivative.py index 8c54431c9e..104b069566 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_first_vertical_derivative.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_first_vertical_derivative.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_first_vertical_derivative import ( +from icon4py.model.atmosphere.dycore.stencils.compute_first_vertical_derivative import ( compute_first_vertical_derivative, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_graddiv2_of_vn.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_graddiv2_of_vn.py index a340dd1079..03aaeebe45 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_graddiv2_of_vn.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_graddiv2_of_vn.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_graddiv2_of_vn import compute_graddiv2_of_vn +from icon4py.model.atmosphere.dycore.stencils.compute_graddiv2_of_vn import compute_graddiv2_of_vn from icon4py.model.common import dimension as dims from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field from icon4py.model.common.type_alias import vpfloat, wpfloat diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_advection_of_rho_and_theta.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_advection_of_rho_and_theta.py index b83c31f119..6785ce8667 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_advection_of_rho_and_theta.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_advection_of_rho_and_theta.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_horizontal_advection_of_rho_and_theta import ( +from icon4py.model.atmosphere.dycore.stencils.compute_horizontal_advection_of_rho_and_theta import ( compute_horizontal_advection_of_rho_and_theta, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_advection_term_for_vertical_velocity.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_advection_term_for_vertical_velocity.py index 346cf9699e..0165505f16 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_advection_term_for_vertical_velocity.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_advection_term_for_vertical_velocity.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_horizontal_advection_term_for_vertical_velocity import ( +from icon4py.model.atmosphere.dycore.stencils.compute_horizontal_advection_term_for_vertical_velocity import ( compute_horizontal_advection_term_for_vertical_velocity, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates.py index 7e0dd8c716..fe26c93d1b 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates import ( +from icon4py.model.atmosphere.dycore.stencils.compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates import ( compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_multiple_levels.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_multiple_levels.py index 0f261e74d9..c8c2ae9192 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_multiple_levels.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_multiple_levels.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_exner_pressure_for_multiple_levels import ( +from icon4py.model.atmosphere.dycore.stencils.compute_horizontal_gradient_of_exner_pressure_for_multiple_levels import ( compute_horizontal_gradient_of_exner_pressure_for_multiple_levels, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates.py index bb7dd16711..8d3cfda9e9 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates import ( +from icon4py.model.atmosphere.dycore.stencils.compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates import ( compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_kinetic_energy.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_kinetic_energy.py index 1faea05be9..7b1d186845 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_kinetic_energy.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_kinetic_energy.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_horizontal_kinetic_energy import ( +from icon4py.model.atmosphere.dycore.stencils.compute_horizontal_kinetic_energy import ( compute_horizontal_kinetic_energy, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_hydrostatic_correction_term.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_hydrostatic_correction_term.py index 10fb201342..8c77bca940 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_hydrostatic_correction_term.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_hydrostatic_correction_term.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_hydrostatic_correction_term import ( +from icon4py.model.atmosphere.dycore.stencils.compute_hydrostatic_correction_term import ( compute_hydrostatic_correction_term, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_mass_flux.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_mass_flux.py index 172e3ac05e..5cc4bb1cba 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_mass_flux.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_mass_flux.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_mass_flux import compute_mass_flux +from icon4py.model.atmosphere.dycore.stencils.compute_mass_flux import compute_mass_flux from icon4py.model.common import dimension as dims from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field from icon4py.model.common.type_alias import vpfloat, wpfloat diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_maximum_cfl_and_clip_contravariant_vertical_velocity.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_maximum_cfl_and_clip_contravariant_vertical_velocity.py index 04440258bc..34d2d5e375 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_maximum_cfl_and_clip_contravariant_vertical_velocity.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_maximum_cfl_and_clip_contravariant_vertical_velocity.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_maximum_cfl_and_clip_contravariant_vertical_velocity import ( +from icon4py.model.atmosphere.dycore.stencils.compute_maximum_cfl_and_clip_contravariant_vertical_velocity import ( compute_maximum_cfl_and_clip_contravariant_vertical_velocity, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_perturbation_of_rho_and_theta.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_perturbation_of_rho_and_theta.py index d28b632d75..2c85507ea7 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_perturbation_of_rho_and_theta.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_perturbation_of_rho_and_theta.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_perturbation_of_rho_and_theta import ( +from icon4py.model.atmosphere.dycore.stencils.compute_perturbation_of_rho_and_theta import ( compute_perturbation_of_rho_and_theta, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_perturbation_of_rho_and_theta_and_rho_interface_cell_centers.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_perturbation_of_rho_and_theta_and_rho_interface_cell_centers.py index ded446e7ee..68f6603d59 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_perturbation_of_rho_and_theta_and_rho_interface_cell_centers.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_perturbation_of_rho_and_theta_and_rho_interface_cell_centers.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_perturbation_of_rho_and_theta_and_rho_interface_cell_centers import ( +from icon4py.model.atmosphere.dycore.stencils.compute_perturbation_of_rho_and_theta_and_rho_interface_cell_centers import ( compute_perturbation_of_rho_and_theta_and_rho_interface_cell_centers, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_results_for_thermodynamic_variables.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_results_for_thermodynamic_variables.py index 289f0d3035..8fad95ae56 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_results_for_thermodynamic_variables.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_results_for_thermodynamic_variables.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_results_for_thermodynamic_variables import ( +from icon4py.model.atmosphere.dycore.stencils.compute_results_for_thermodynamic_variables import ( compute_results_for_thermodynamic_variables, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_rho_virtual_potential_temperatures_and_pressure_gradient.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_rho_virtual_potential_temperatures_and_pressure_gradient.py index c40104529e..84baa798f5 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_rho_virtual_potential_temperatures_and_pressure_gradient.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_rho_virtual_potential_temperatures_and_pressure_gradient.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_rho_virtual_potential_temperatures_and_pressure_gradient import ( +from icon4py.model.atmosphere.dycore.stencils.compute_rho_virtual_potential_temperatures_and_pressure_gradient import ( compute_rho_virtual_potential_temperatures_and_pressure_gradient, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_solver_coefficients_matrix.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_solver_coefficients_matrix.py index efc4c1577b..2c6613a51d 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_solver_coefficients_matrix.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_solver_coefficients_matrix.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_solver_coefficients_matrix import ( +from icon4py.model.atmosphere.dycore.stencils.compute_solver_coefficients_matrix import ( compute_solver_coefficients_matrix, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_tangential_wind.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_tangential_wind.py index a77c6519ee..9920c5a4ce 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_tangential_wind.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_tangential_wind.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_tangential_wind import compute_tangential_wind +from icon4py.model.atmosphere.dycore.stencils.compute_tangential_wind import compute_tangential_wind from icon4py.model.common import dimension as dims from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field from icon4py.model.common.type_alias import vpfloat, wpfloat diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_theta_and_exner.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_theta_and_exner.py index 606d078e5d..cf82f66b0c 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_theta_and_exner.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_theta_and_exner.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_theta_and_exner import compute_theta_and_exner +from icon4py.model.atmosphere.dycore.stencils.compute_theta_and_exner import compute_theta_and_exner from icon4py.model.common import dimension as dims from icon4py.model.common.test_utils.helpers import StencilTest, random_field, random_mask from icon4py.model.common.type_alias import wpfloat diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_virtual_potential_temperatures_and_pressure_gradient.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_virtual_potential_temperatures_and_pressure_gradient.py index dc01b22a97..040131a455 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_virtual_potential_temperatures_and_pressure_gradient.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_virtual_potential_temperatures_and_pressure_gradient.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_virtual_potential_temperatures_and_pressure_gradient import ( +from icon4py.model.atmosphere.dycore.stencils.compute_virtual_potential_temperatures_and_pressure_gradient import ( compute_virtual_potential_temperatures_and_pressure_gradient, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_vn_on_lateral_boundary.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_vn_on_lateral_boundary.py index 42da05171b..cd83f98bff 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_vn_on_lateral_boundary.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_vn_on_lateral_boundary.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_vn_on_lateral_boundary import ( +from icon4py.model.atmosphere.dycore.stencils.compute_vn_on_lateral_boundary import ( compute_vn_on_lateral_boundary, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_copy_cell_kdim_field_to_vp.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_copy_cell_kdim_field_to_vp.py index 06147d5748..f9697ae99a 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_copy_cell_kdim_field_to_vp.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_copy_cell_kdim_field_to_vp.py @@ -9,7 +9,9 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.copy_cell_kdim_field_to_vp import copy_cell_kdim_field_to_vp +from icon4py.model.atmosphere.dycore.stencils.copy_cell_kdim_field_to_vp import ( + copy_cell_kdim_field_to_vp, +) from icon4py.model.common import dimension as dims from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field from icon4py.model.common.type_alias import vpfloat, wpfloat diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_correct_contravariant_vertical_velocity.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_correct_contravariant_vertical_velocity.py index 6f58284064..f12a375794 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_correct_contravariant_vertical_velocity.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_correct_contravariant_vertical_velocity.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.correct_contravariant_vertical_velocity import ( +from icon4py.model.atmosphere.dycore.stencils.correct_contravariant_vertical_velocity import ( correct_contravariant_vertical_velocity, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_extrapolate_at_top.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_extrapolate_at_top.py index ddaf4faf27..422556e96e 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_extrapolate_at_top.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_extrapolate_at_top.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.extrapolate_at_top import extrapolate_at_top +from icon4py.model.atmosphere.dycore.stencils.extrapolate_at_top import extrapolate_at_top from icon4py.model.common import dimension as dims from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field from icon4py.model.common.type_alias import vpfloat, wpfloat diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_extrapolate_temporally_exner_pressure.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_extrapolate_temporally_exner_pressure.py index 1d6c8d9bf5..266da925a9 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_extrapolate_temporally_exner_pressure.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_extrapolate_temporally_exner_pressure.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.extrapolate_temporally_exner_pressure import ( +from icon4py.model.atmosphere.dycore.stencils.extrapolate_temporally_exner_pressure import ( extrapolate_temporally_exner_pressure, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_solve_nonhydro_stencil_39_40.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_solve_nonhydro_stencil_39_40.py index 0a92b83a87..7acd2ca0cb 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_solve_nonhydro_stencil_39_40.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_solve_nonhydro_stencil_39_40.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.fused_solve_nonhydro_stencil_39_40 import ( +from icon4py.model.atmosphere.dycore.stencils.fused_solve_nonhydro_stencil_39_40 import ( fused_solve_nonhydro_stencil_39_40, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_velocity_advection_stencil_15_to_18.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_velocity_advection_stencil_15_to_18.py index 3859ffb3e3..f582be92c3 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_velocity_advection_stencil_15_to_18.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_velocity_advection_stencil_15_to_18.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.fused_velocity_advection_stencil_15_to_18 import ( +from icon4py.model.atmosphere.dycore.stencils.fused_velocity_advection_stencil_15_to_18 import ( fused_velocity_advection_stencil_15_to_18, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_velocity_advection_stencil_19_to_20.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_velocity_advection_stencil_19_to_20.py index fb24cb97a0..d8866d8aad 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_velocity_advection_stencil_19_to_20.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_velocity_advection_stencil_19_to_20.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.fused_velocity_advection_stencil_19_to_20 import ( +from icon4py.model.atmosphere.dycore.stencils.fused_velocity_advection_stencil_19_to_20 import ( fused_velocity_advection_stencil_19_to_20, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_velocity_advection_stencil_1_to_7.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_velocity_advection_stencil_1_to_7.py index aded069291..36834c4c09 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_velocity_advection_stencil_1_to_7.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_velocity_advection_stencil_1_to_7.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.fused_velocity_advection_stencil_1_to_7 import ( +from icon4py.model.atmosphere.dycore.stencils.fused_velocity_advection_stencil_1_to_7 import ( fused_velocity_advection_stencil_1_to_7, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_velocity_advection_stencil_8_to_13.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_velocity_advection_stencil_8_to_13.py index a1f4d0fca7..da23a87872 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_velocity_advection_stencil_8_to_13.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_velocity_advection_stencil_8_to_13.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.fused_velocity_advection_stencil_8_to_13 import ( +from icon4py.model.atmosphere.dycore.stencils.fused_velocity_advection_stencil_8_to_13 import ( fused_velocity_advection_stencil_8_to_13, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_init_cell_kdim_field_with_zero_vp.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_init_cell_kdim_field_with_zero_vp.py index 9d776bb50c..89f904df2a 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_init_cell_kdim_field_with_zero_vp.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_init_cell_kdim_field_with_zero_vp.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.init_cell_kdim_field_with_zero_vp import ( +from icon4py.model.atmosphere.dycore.stencils.init_cell_kdim_field_with_zero_vp import ( init_cell_kdim_field_with_zero_vp, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_init_cell_kdim_field_with_zero_wp.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_init_cell_kdim_field_with_zero_wp.py index 0b0cfd1692..47704fb74e 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_init_cell_kdim_field_with_zero_wp.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_init_cell_kdim_field_with_zero_wp.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.init_cell_kdim_field_with_zero_wp import ( +from icon4py.model.atmosphere.dycore.stencils.init_cell_kdim_field_with_zero_wp import ( init_cell_kdim_field_with_zero_wp, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_init_two_cell_kdim_fields_index_with_zero_vp.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_init_two_cell_kdim_fields_index_with_zero_vp.py index 65a3f645ac..cc7e4b7ca1 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_init_two_cell_kdim_fields_index_with_zero_vp.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_init_two_cell_kdim_fields_index_with_zero_vp.py @@ -9,7 +9,7 @@ import numpy as np import pytest as pytest -from icon4py.model.atmosphere.dycore.init_two_cell_kdim_fields_index_with_zero_vp import ( +from icon4py.model.atmosphere.dycore.stencils.init_two_cell_kdim_fields_index_with_zero_vp import ( init_two_cell_kdim_fields_index_with_zero_vp, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_init_two_cell_kdim_fields_with_zero_vp.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_init_two_cell_kdim_fields_with_zero_vp.py index 9e803db98c..6cb13892e3 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_init_two_cell_kdim_fields_with_zero_vp.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_init_two_cell_kdim_fields_with_zero_vp.py @@ -9,7 +9,7 @@ import numpy as np import pytest as pytest -from icon4py.model.atmosphere.dycore.init_two_cell_kdim_fields_with_zero_vp import ( +from icon4py.model.atmosphere.dycore.stencils.init_two_cell_kdim_fields_with_zero_vp import ( init_two_cell_kdim_fields_with_zero_vp, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_init_two_cell_kdim_fields_with_zero_wp.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_init_two_cell_kdim_fields_with_zero_wp.py index e85b804901..a1e524b191 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_init_two_cell_kdim_fields_with_zero_wp.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_init_two_cell_kdim_fields_with_zero_wp.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.init_two_cell_kdim_fields_with_zero_wp import ( +from icon4py.model.atmosphere.dycore.stencils.init_two_cell_kdim_fields_with_zero_wp import ( init_two_cell_kdim_fields_with_zero_wp, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_init_two_edge_kdim_fields_with_zero_wp.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_init_two_edge_kdim_fields_with_zero_wp.py index eaec9003c3..35b418f0c3 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_init_two_edge_kdim_fields_with_zero_wp.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_init_two_edge_kdim_fields_with_zero_wp.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.init_two_edge_kdim_fields_with_zero_wp import ( +from icon4py.model.atmosphere.dycore.stencils.init_two_edge_kdim_fields_with_zero_wp import ( init_two_edge_kdim_fields_with_zero_wp, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_contravariant_vertical_velocity_to_full_levels.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_contravariant_vertical_velocity_to_full_levels.py index 4233accc14..b34776aaed 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_contravariant_vertical_velocity_to_full_levels.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_contravariant_vertical_velocity_to_full_levels.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.interpolate_contravariant_vertical_velocity_to_full_levels import ( +from icon4py.model.atmosphere.dycore.stencils.interpolate_contravariant_vertical_velocity_to_full_levels import ( interpolate_contravariant_vertical_velocity_to_full_levels, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_to_cell_center.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_to_cell_center.py index 9fabfdf384..2d60332a2d 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_to_cell_center.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_to_cell_center.py @@ -9,7 +9,9 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.interpolate_to_cell_center import interpolate_to_cell_center +from icon4py.model.atmosphere.dycore.stencils.interpolate_to_cell_center import ( + interpolate_to_cell_center, +) from icon4py.model.common import dimension as dims from icon4py.model.common.test_utils.helpers import ( StencilTest, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_to_half_levels_vp.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_to_half_levels_vp.py index ef4bc5313a..099eaa0e19 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_to_half_levels_vp.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_to_half_levels_vp.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.interpolate_to_half_levels_vp import ( +from icon4py.model.atmosphere.dycore.stencils.interpolate_to_half_levels_vp import ( interpolate_to_half_levels_vp, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_to_surface.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_to_surface.py index b579711ec9..58341219ed 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_to_surface.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_to_surface.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.interpolate_to_surface import interpolate_to_surface +from icon4py.model.atmosphere.dycore.stencils.interpolate_to_surface import interpolate_to_surface from icon4py.model.common import dimension as dims from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field from icon4py.model.common.type_alias import vpfloat diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges.py index 394d56fab3..39d996e77f 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges import ( +from icon4py.model.atmosphere.dycore.stencils.interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges import ( interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_vn_to_ie_and_compute_ekin_on_edges.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_vn_to_ie_and_compute_ekin_on_edges.py index f9be9b3521..62c46008d6 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_vn_to_ie_and_compute_ekin_on_edges.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_vn_to_ie_and_compute_ekin_on_edges.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.interpolate_vn_to_ie_and_compute_ekin_on_edges import ( +from icon4py.model.atmosphere.dycore.stencils.interpolate_vn_to_ie_and_compute_ekin_on_edges import ( interpolate_vn_to_ie_and_compute_ekin_on_edges, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_vt_to_interface_edges.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_vt_to_interface_edges.py index 58264d7a86..4eb2d55a2e 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_vt_to_interface_edges.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_vt_to_interface_edges.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.interpolate_vt_to_interface_edges import ( +from icon4py.model.atmosphere.dycore.stencils.interpolate_vt_to_interface_edges import ( interpolate_vt_to_interface_edges, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mcompute_divergence_of_fluxes_of_rho_and_theta.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mcompute_divergence_of_fluxes_of_rho_and_theta.py index 7aedbc03fc..8d4c95c1cb 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mcompute_divergence_of_fluxes_of_rho_and_theta.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mcompute_divergence_of_fluxes_of_rho_and_theta.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.compute_divergence_of_fluxes_of_rho_and_theta import ( +from icon4py.model.atmosphere.dycore.stencils.compute_divergence_of_fluxes_of_rho_and_theta import ( compute_divergence_of_fluxes_of_rho_and_theta, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl.py index deab84fc4a..e9169af626 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl import ( +from icon4py.model.atmosphere.dycore.stencils.mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl import ( mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_math_divrot_rot_vertex_ri_dsl.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_math_divrot_rot_vertex_ri_dsl.py index db8ebe4653..eccc3a303b 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_math_divrot_rot_vertex_ri_dsl.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_math_divrot_rot_vertex_ri_dsl.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.mo_math_divrot_rot_vertex_ri_dsl import ( +from icon4py.model.atmosphere.dycore.stencils.mo_math_divrot_rot_vertex_ri_dsl import ( mo_math_divrot_rot_vertex_ri_dsl, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_math_gradients_grad_green_gauss_cell_dsl.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_math_gradients_grad_green_gauss_cell_dsl.py index b384fa7229..618c8b620f 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_math_gradients_grad_green_gauss_cell_dsl.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_math_gradients_grad_green_gauss_cell_dsl.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.mo_math_gradients_grad_green_gauss_cell_dsl import ( +from icon4py.model.atmosphere.dycore.stencils.mo_math_gradients_grad_green_gauss_cell_dsl import ( mo_math_gradients_grad_green_gauss_cell_dsl, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_51.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_51.py index 40c9ea51be..30cd1638ab 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_51.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_51.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_51 import ( +from icon4py.model.atmosphere.dycore.stencils.mo_solve_nonhydro_stencil_51 import ( mo_solve_nonhydro_stencil_51, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_set_lower_boundary_condition_for_w_and_contravariant_correction.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_set_lower_boundary_condition_for_w_and_contravariant_correction.py index beef12e273..d1ec4920cc 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_set_lower_boundary_condition_for_w_and_contravariant_correction.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_set_lower_boundary_condition_for_w_and_contravariant_correction.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.set_lower_boundary_condition_for_w_and_contravariant_correction import ( +from icon4py.model.atmosphere.dycore.stencils.set_lower_boundary_condition_for_w_and_contravariant_correction import ( set_lower_boundary_condition_for_w_and_contravariant_correction, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_set_theta_v_prime_ic_at_lower_boundary.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_set_theta_v_prime_ic_at_lower_boundary.py index 813e2cd5ff..1a43abbbad 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_set_theta_v_prime_ic_at_lower_boundary.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_set_theta_v_prime_ic_at_lower_boundary.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.set_theta_v_prime_ic_at_lower_boundary import ( +from icon4py.model.atmosphere.dycore.stencils.set_theta_v_prime_ic_at_lower_boundary import ( set_theta_v_prime_ic_at_lower_boundary, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_solve_tridiagonal_matrix_for_w_back_substitution.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_solve_tridiagonal_matrix_for_w_back_substitution.py index f712d85259..b15eafe7e9 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_solve_tridiagonal_matrix_for_w_back_substitution.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_solve_tridiagonal_matrix_for_w_back_substitution.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.solve_tridiagonal_matrix_for_w_back_substitution import ( +from icon4py.model.atmosphere.dycore.stencils.solve_tridiagonal_matrix_for_w_back_substitution import ( solve_tridiagonal_matrix_for_w_back_substitution, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_solve_tridiagonal_matrix_for_w_forward_sweep.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_solve_tridiagonal_matrix_for_w_forward_sweep.py index 528f4bd76b..36583635ca 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_solve_tridiagonal_matrix_for_w_forward_sweep.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_solve_tridiagonal_matrix_for_w_forward_sweep.py @@ -9,7 +9,7 @@ import numpy as np from gt4py.next.program_processors.runners.gtfn import run_gtfn -from icon4py.model.atmosphere.dycore.solve_tridiagonal_matrix_for_w_forward_sweep import ( +from icon4py.model.atmosphere.dycore.stencils.solve_tridiagonal_matrix_for_w_forward_sweep import ( solve_tridiagonal_matrix_for_w_forward_sweep, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_update_density_exner_wind.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_update_density_exner_wind.py index a1035ed279..daae2c7c8a 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_update_density_exner_wind.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_update_density_exner_wind.py @@ -9,7 +9,9 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.update_density_exner_wind import update_density_exner_wind +from icon4py.model.atmosphere.dycore.stencils.update_density_exner_wind import ( + update_density_exner_wind, +) from icon4py.model.common import dimension as dims from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field from icon4py.model.common.type_alias import wpfloat diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_update_dynamical_exner_time_increment.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_update_dynamical_exner_time_increment.py index 18fbc0ee03..8c94a99eb8 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_update_dynamical_exner_time_increment.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_update_dynamical_exner_time_increment.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.update_dynamical_exner_time_increment import ( +from icon4py.model.atmosphere.dycore.stencils.update_dynamical_exner_time_increment import ( update_dynamical_exner_time_increment, ) from icon4py.model.common import dimension as dims diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_update_mass_flux_weighted.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_update_mass_flux_weighted.py index b1bb061676..5ff885b65c 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_update_mass_flux_weighted.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_update_mass_flux_weighted.py @@ -9,7 +9,9 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.update_mass_flux_weighted import update_mass_flux_weighted +from icon4py.model.atmosphere.dycore.stencils.update_mass_flux_weighted import ( + update_mass_flux_weighted, +) from icon4py.model.common import dimension as dims from icon4py.model.common.test_utils.helpers import StencilTest, random_field from icon4py.model.common.type_alias import vpfloat, wpfloat diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_update_mass_volume_flux.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_update_mass_volume_flux.py index 681e004a17..7b3e3118d7 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_update_mass_volume_flux.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_update_mass_volume_flux.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.update_mass_volume_flux import update_mass_volume_flux +from icon4py.model.atmosphere.dycore.stencils.update_mass_volume_flux import update_mass_volume_flux from icon4py.model.common import dimension as dims from icon4py.model.common.test_utils.helpers import StencilTest, random_field from icon4py.model.common.type_alias import wpfloat diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_update_theta_v.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_update_theta_v.py index 8ecda112b0..aecfd29942 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_update_theta_v.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_update_theta_v.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.update_theta_v import update_theta_v +from icon4py.model.atmosphere.dycore.stencils.update_theta_v import update_theta_v from icon4py.model.common import dimension as dims from icon4py.model.common.test_utils.helpers import StencilTest, random_field, random_mask from icon4py.model.common.type_alias import wpfloat diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_update_wind.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_update_wind.py index e50f777f10..0b44dcc146 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_update_wind.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_update_wind.py @@ -9,7 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.update_wind import update_wind +from icon4py.model.atmosphere.dycore.stencils.update_wind import update_wind from icon4py.model.common import dimension as dims from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field from icon4py.model.common.type_alias import wpfloat diff --git a/model/atmosphere/dycore/tests/dycore_tests/mpi_tests/test_parallel_solve_nonhydro.py b/model/atmosphere/dycore/tests/dycore_tests/mpi_tests/test_parallel_solve_nonhydro.py index 5c231de902..3f9e275f05 100644 --- a/model/atmosphere/dycore/tests/dycore_tests/mpi_tests/test_parallel_solve_nonhydro.py +++ b/model/atmosphere/dycore/tests/dycore_tests/mpi_tests/test_parallel_solve_nonhydro.py @@ -9,8 +9,7 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.nh_solve import solve_nonhydro as nh -from icon4py.model.atmosphere.dycore.state_utils import states +from icon4py.model.atmosphere.dycore import dycore_states, solve_nonhydro as nh from icon4py.model.common import dimension as dims from icon4py.model.common.decomposition import definitions from icon4py.model.common.grid import states as grid_states, vertical as v_grid @@ -95,7 +94,7 @@ def test_run_solve_nonhydro_single_step( dtime = sp_v.get_metadata("dtime").get("dtime") lprep_adv = sp_v.get_metadata("prep_adv").get("prep_adv") clean_mflx = sp_v.get_metadata("clean_mflx").get("clean_mflx") - prep_adv = states.PrepAdvection( + prep_adv = dycore_states.PrepAdvection( vn_traj=sp.vn_traj(), mass_flx_me=sp.mass_flx_me(), mass_flx_ic=sp.mass_flx_ic(), @@ -107,7 +106,7 @@ def test_run_solve_nonhydro_single_step( recompute = sp_v.get_metadata("recompute").get("recompute") linit = sp_v.get_metadata("linit").get("linit") - diagnostic_state_nh = states.DiagnosticStateNonHydro( + diagnostic_state_nh = dycore_states.DiagnosticStateNonHydro( theta_v_ic=sp.theta_v_ic(), exner_pr=sp.exner_pr(), rho_ic=sp.rho_ic(), diff --git a/model/atmosphere/dycore/tests/dycore_tests/test_utils.py b/model/atmosphere/dycore/tests/dycore_tests/test_dycore_utils.py similarity index 90% rename from model/atmosphere/dycore/tests/dycore_tests/test_utils.py rename to model/atmosphere/dycore/tests/dycore_tests/test_dycore_utils.py index f2f9e7fb7a..d33c839a5f 100644 --- a/model/atmosphere/dycore/tests/dycore_tests/test_utils.py +++ b/model/atmosphere/dycore/tests/dycore_tests/test_dycore_utils.py @@ -8,7 +8,7 @@ import gt4py.next as gtx import numpy as np -from icon4py.model.atmosphere.dycore.state_utils import utils as solve_nh_utils +from icon4py.model.atmosphere.dycore import dycore_utils from icon4py.model.common import constants, dimension as dims from icon4py.model.common.grid import simple as simple_grid from icon4py.model.common.settings import backend @@ -32,7 +32,7 @@ def test_caclulate_scal_divdamp_order_24(): enh_divdamp_fac = helpers.random_field(grid, dims.KDim) out = helpers.random_field(grid, dims.KDim) - solve_nh_utils._calculate_scal_divdamp.with_backend(backend)( + dycore_utils._calculate_scal_divdamp.with_backend(backend)( enh_divdamp_fac=enh_divdamp_fac, divdamp_fac_o2=divdamp_fac_o2, divdamp_order=divdamp_order, @@ -53,7 +53,7 @@ def test_calculate_scal_divdamp_any_order(): enh_divdamp_fac = helpers.random_field(grid, dims.KDim) out = helpers.random_field(grid, dims.KDim) - solve_nh_utils._calculate_scal_divdamp.with_backend(backend)( + dycore_utils._calculate_scal_divdamp.with_backend(backend)( enh_divdamp_fac=enh_divdamp_fac, divdamp_fac_o2=divdamp_fac_o2, divdamp_order=divdamp_order, @@ -70,7 +70,7 @@ def test_calculate_bdy_divdamp(): scal_divdamp = helpers.random_field(grid, dims.KDim) out = helpers.zero_field(grid, dims.KDim) coeff = 0.3 - solve_nh_utils._calculate_bdy_divdamp.with_backend(backend)( + dycore_utils._calculate_bdy_divdamp.with_backend(backend)( scal_divdamp, coeff, constants.DBL_EPS, out=out, offset_provider={} ) assert helpers.dallclose(out.asnumpy(), bdy_divdamp_numpy(coeff, scal_divdamp.asnumpy())) @@ -92,7 +92,7 @@ def test_calculate_divdamp_fields(): boundary_ref = bdy_divdamp_numpy(nudge_max_coeff, scaled_ref) - solve_nh_utils._calculate_divdamp_fields.with_backend(backend)( + dycore_utils._calculate_divdamp_fields.with_backend(backend)( divdamp_field, divdamp_order, mean_cell_area, diff --git a/model/atmosphere/dycore/tests/dycore_tests/test_solve_nonhydro.py b/model/atmosphere/dycore/tests/dycore_tests/test_solve_nonhydro.py index b987b6844f..aa65e92fa2 100644 --- a/model/atmosphere/dycore/tests/dycore_tests/test_solve_nonhydro.py +++ b/model/atmosphere/dycore/tests/dycore_tests/test_solve_nonhydro.py @@ -11,10 +11,10 @@ import pytest import icon4py.model.common.grid.states as grid_states -from icon4py.model.atmosphere.dycore.nh_solve import solve_nonhydro as solve_nh -from icon4py.model.atmosphere.dycore.state_utils import ( - states as solve_nh_states, - utils as solve_nh_utils, +from icon4py.model.atmosphere.dycore import ( + dycore_states, + dycore_utils, + solve_nonhydro as solve_nh, ) from icon4py.model.common import constants, dimension as dims from icon4py.model.common.grid import horizontal as h_grid, vertical as v_grid @@ -54,7 +54,7 @@ def test_validate_divdamp_fields_against_savepoint_values( enh_divdamp_fac, offset_provider={"Koff": dims.KDim}, ) - solve_nh_utils._calculate_scal_divdamp.with_backend(backend)( + dycore_utils._calculate_scal_divdamp.with_backend(backend)( enh_divdamp_fac=enh_divdamp_fac, divdamp_order=config.divdamp_order, mean_cell_area=mean_cell_area, @@ -62,7 +62,7 @@ def test_validate_divdamp_fields_against_savepoint_values( out=scal_divdamp, offset_provider={}, ) - solve_nh_utils._calculate_bdy_divdamp.with_backend(backend)( + dycore_utils._calculate_bdy_divdamp.with_backend(backend)( scal_divdamp, config.nudge_max_coeff, constants.DBL_EPS, @@ -515,7 +515,7 @@ def test_nonhydro_corrector_step( dtime = sp.get_metadata("dtime").get("dtime") clean_mflx = sp.get_metadata("clean_mflx").get("clean_mflx") lprep_adv = sp.get_metadata("prep_adv").get("prep_adv") - prep_adv = solve_nh_states.PrepAdvection( + prep_adv = dycore_states.PrepAdvection( vn_traj=sp.vn_traj(), mass_flx_me=sp.mass_flx_me(), mass_flx_ic=sp.mass_flx_ic(), @@ -665,7 +665,7 @@ def test_nonhydro_corrector_step( @pytest.mark.datatest -@pytest.mark.parametrize("istep_init,jstep_init, istep_exit,jstep_exit", [(1, 0, 2, 0)]) +@pytest.mark.parametrize("istep_init, jstep_init, istep_exit, jstep_exit", [(1, 0, 2, 0)]) @pytest.mark.parametrize( "experiment,step_date_init, step_date_exit", [ @@ -720,7 +720,7 @@ def test_run_solve_nonhydro_single_step( dtime = sp.get_metadata("dtime").get("dtime") lprep_adv = sp.get_metadata("prep_adv").get("prep_adv") clean_mflx = sp.get_metadata("clean_mflx").get("clean_mflx") - prep_adv = solve_nh_states.PrepAdvection( + prep_adv = dycore_states.PrepAdvection( vn_traj=sp.vn_traj(), mass_flx_me=sp.mass_flx_me(), mass_flx_ic=sp.mass_flx_ic(), @@ -848,7 +848,7 @@ def test_run_solve_nonhydro_multi_step( dtime = sp.get_metadata("dtime").get("dtime") lprep_adv = sp.get_metadata("prep_adv").get("prep_adv") clean_mflx = sp.get_metadata("clean_mflx").get("clean_mflx") - prep_adv = solve_nh_states.PrepAdvection( + prep_adv = dycore_states.PrepAdvection( vn_traj=sp.vn_traj(), mass_flx_me=sp.mass_flx_me(), mass_flx_ic=sp.mass_flx_ic(), diff --git a/model/atmosphere/dycore/tests/dycore_tests/test_velocity_advection.py b/model/atmosphere/dycore/tests/dycore_tests/test_velocity_advection.py index e5f82f7cd8..f8d22ab3ca 100644 --- a/model/atmosphere/dycore/tests/dycore_tests/test_velocity_advection.py +++ b/model/atmosphere/dycore/tests/dycore_tests/test_velocity_advection.py @@ -7,8 +7,7 @@ # SPDX-License-Identifier: BSD-3-Clause import pytest -from icon4py.model.atmosphere.dycore.state_utils import states as solve_nh_states -from icon4py.model.atmosphere.dycore.velocity import velocity_advection as vel_adv +from icon4py.model.atmosphere.dycore import dycore_states, velocity_advection as advection from icon4py.model.common import dimension as dims from icon4py.model.common.grid import ( horizontal as h_grid, @@ -33,7 +32,7 @@ def create_vertical_params(vertical_config, grid_savepoint): @pytest.mark.datatest def test_scalfactors(savepoint_velocity_init, icon_grid, backend): dtime = savepoint_velocity_init.get_metadata("dtime").get("dtime") - velocity_advection = vel_adv.VelocityAdvection( + velocity_advection = advection.VelocityAdvection( grid=icon_grid, metric_state=None, interpolation_state=None, @@ -73,7 +72,7 @@ def test_velocity_init( ) vertical_params = create_vertical_params(vertical_config, grid_savepoint) - velocity_advection = vel_adv.VelocityAdvection( + velocity_advection = advection.VelocityAdvection( grid=icon_grid, metric_state=metric_state_nonhydro, interpolation_state=interpolation_state, @@ -126,7 +125,7 @@ def test_verify_velocity_init_against_regular_savepoint( ) vertical_params = create_vertical_params(vertical_config, grid_savepoint) - velocity_advection = vel_adv.VelocityAdvection( + velocity_advection = advection.VelocityAdvection( grid=icon_grid, metric_state=metric_state_nonhydro, interpolation_state=interpolation_state, @@ -174,7 +173,7 @@ def test_velocity_predictor_step( ntnd = sp_v.get_metadata("ntnd").get("ntnd") dtime = sp_v.get_metadata("dtime").get("dtime") - diagnostic_state = solve_nh_states.DiagnosticStateNonHydro( + diagnostic_state = dycore_states.DiagnosticStateNonHydro( vt=sp_v.vt(), vn_ie=sp_v.vn_ie(), w_concorr_c=sp_v.w_concorr_c(), @@ -219,7 +218,7 @@ def test_velocity_predictor_step( ) vertical_params = create_vertical_params(vertical_config, grid_savepoint) - velocity_advection = vel_adv.VelocityAdvection( + velocity_advection = advection.VelocityAdvection( grid=icon_grid, metric_state=metric_state_nonhydro, interpolation_state=interpolation_state, @@ -343,7 +342,7 @@ def test_velocity_corrector_step( ntnd = sp_v.get_metadata("ntnd").get("ntnd") dtime = sp_v.get_metadata("dtime").get("dtime") - diagnostic_state = solve_nh_states.DiagnosticStateNonHydro( + diagnostic_state = dycore_states.DiagnosticStateNonHydro( vt=sp_v.vt(), vn_ie=sp_v.vn_ie(), w_concorr_c=sp_v.w_concorr_c(), @@ -390,7 +389,7 @@ def test_velocity_corrector_step( ) vertical_params = create_vertical_params(vertical_config, grid_savepoint) - velocity_advection = vel_adv.VelocityAdvection( + velocity_advection = advection.VelocityAdvection( grid=icon_grid, metric_state=metric_state_nonhydro, interpolation_state=interpolation_state, diff --git a/model/atmosphere/dycore/tests/dycore_tests/utils.py b/model/atmosphere/dycore/tests/dycore_tests/utils.py index 33b8f92303..62904b85a1 100644 --- a/model/atmosphere/dycore/tests/dycore_tests/utils.py +++ b/model/atmosphere/dycore/tests/dycore_tests/utils.py @@ -6,8 +6,7 @@ # Please, refer to the LICENSE file in the root directory. # SPDX-License-Identifier: BSD-3-Clause -from icon4py.model.atmosphere.dycore.nh_solve import solve_nonhydro as solve_nh -from icon4py.model.atmosphere.dycore.state_utils import states as solve_nh_states +from icon4py.model.atmosphere.dycore import dycore_states, solve_nonhydro as solve_nh from icon4py.model.common import dimension as dims from icon4py.model.common.grid import vertical as v_grid from icon4py.model.common.states import prognostic_state as prognostics @@ -16,9 +15,9 @@ def construct_interpolation_state( savepoint: sb.InterpolationSavepoint, -) -> solve_nh_states.InterpolationState: +) -> dycore_states.InterpolationState: grg = savepoint.geofac_grg() - return solve_nh_states.InterpolationState( + return dycore_states.InterpolationState( c_lin_e=savepoint.c_lin_e(), c_intp=savepoint.c_intp(), e_flx_avg=savepoint.e_flx_avg(), @@ -40,8 +39,8 @@ def construct_interpolation_state( def construct_metric_state( savepoint: sb.MetricSavepoint, num_k_lev -) -> solve_nh_states.MetricStateNonHydro: - return solve_nh_states.MetricStateNonHydro( +) -> dycore_states.MetricStateNonHydro: + return dycore_states.MetricStateNonHydro( bdy_halo_c=savepoint.bdy_halo_c(), mask_prog_halo_c=savepoint.mask_prog_halo_c(), rayleigh_w=savepoint.rayleigh_w(), @@ -118,7 +117,7 @@ def create_vertical_params( def construct_diagnostics(init_savepoint: sb.IconNonHydroInitSavepoint): - return solve_nh_states.DiagnosticStateNonHydro( + return dycore_states.DiagnosticStateNonHydro( theta_v_ic=init_savepoint.theta_v_ic(), exner_pr=init_savepoint.exner_pr(), rho_ic=init_savepoint.rho_ic(), diff --git a/model/common/tests/metric_tests/test_metric_fields.py b/model/common/tests/metric_tests/test_metric_fields.py index 8d7f958b37..a81d3afae2 100644 --- a/model/common/tests/metric_tests/test_metric_fields.py +++ b/model/common/tests/metric_tests/test_metric_fields.py @@ -11,9 +11,6 @@ import numpy as np import pytest -from icon4py.model.atmosphere.dycore.nh_solve.solve_nonhydro import ( - HorizontalPressureDiscretizationType, -) from icon4py.model.common import constants, dimension as dims from icon4py.model.common.grid import horizontal from icon4py.model.common.interpolation.stencils.cell_2_edge_interpolation import ( @@ -283,7 +280,7 @@ def test_compute_d2dexdz2_fac_mc(icon_grid, metrics_savepoint, grid_savepoint, b del_t_bg=del_t_bg, h_scal_bg=h_scal_bg, igradp_method=3, - igradp_constant=HorizontalPressureDiscretizationType.TAYLOR_HYDRO, + igradp_constant=3, horizontal_start=0, horizontal_end=icon_grid.num_cells, vertical_start=0, diff --git a/model/docs/stencil_naming_convention.md b/model/docs/stencil_naming_convention.md index ad13d09b7a..d05be966dc 100644 --- a/model/docs/stencil_naming_convention.md +++ b/model/docs/stencil_naming_convention.md @@ -1,10 +1,10 @@ # Naming convection of stencils in ICON4Py -This naming convection should help to have a common style for stencil names. +This naming convention should help to have a common style for stencil names. It should help to read and understand stencil code. ## Multiple-word identifier format -The stencils should should flow snake case. +The stencils must follow snake case. ## Length of name The program name of the stencil needs to have less then 70 characters. diff --git a/model/driver/src/icon4py/model/driver/icon4py_configuration.py b/model/driver/src/icon4py/model/driver/icon4py_configuration.py index 66e1073559..a41a75fa04 100644 --- a/model/driver/src/icon4py/model/driver/icon4py_configuration.py +++ b/model/driver/src/icon4py/model/driver/icon4py_configuration.py @@ -11,7 +11,7 @@ import logging from icon4py.model.atmosphere.diffusion import diffusion -from icon4py.model.atmosphere.dycore.nh_solve import solve_nonhydro as solve_nh +from icon4py.model.atmosphere.dycore import solve_nonhydro as solve_nh from icon4py.model.common.grid import vertical as v_grid from icon4py.model.driver import initialization_utils as driver_init diff --git a/model/driver/src/icon4py/model/driver/icon4py_driver.py b/model/driver/src/icon4py/model/driver/icon4py_driver.py index cee359ccf1..c567146b3a 100644 --- a/model/driver/src/icon4py/model/driver/icon4py_driver.py +++ b/model/driver/src/icon4py/model/driver/icon4py_driver.py @@ -20,8 +20,7 @@ diffusion, diffusion_states, ) -from icon4py.model.atmosphere.dycore.nh_solve import solve_nonhydro as solve_nh -from icon4py.model.atmosphere.dycore.state_utils import states as solve_nh_states +from icon4py.model.atmosphere.dycore import dycore_states, solve_nonhydro as solve_nh from icon4py.model.common.decomposition import definitions as decomposition from icon4py.model.common.states import prognostic_state as prognostics from icon4py.model.driver import ( @@ -125,11 +124,11 @@ def _full_name(self, func: Callable): def time_integration( self, diffusion_diagnostic_state: diffusion_states.DiffusionDiagnosticState, - solve_nonhydro_diagnostic_state: solve_nh_states.DiagnosticStateNonHydro, + solve_nonhydro_diagnostic_state: dycore_states.DiagnosticStateNonHydro, # TODO (Chia Rui): expand the PrognosticState to include indices of now and next, now it is always assumed that now = 0, next = 1 at the beginning prognostic_state_list: list[prognostics.PrognosticState], # below is a long list of arguments for dycore time_step that many can be moved to initialization of SolveNonhydro) - prep_adv: solve_nh_states.PrepAdvection, + prep_adv: dycore_states.PrepAdvection, inital_divdamp_fac_o2: float, do_prep_adv: bool, ): @@ -197,9 +196,9 @@ def time_integration( def _integrate_one_time_step( self, diffusion_diagnostic_state: diffusion_states.DiffusionDiagnosticState, - solve_nonhydro_diagnostic_state: solve_nh_states.DiagnosticStateNonHydro, + solve_nonhydro_diagnostic_state: dycore_states.DiagnosticStateNonHydro, prognostic_state_list: list[prognostics.PrognosticState], - prep_adv: solve_nh_states.PrepAdvection, + prep_adv: dycore_states.PrepAdvection, inital_divdamp_fac_o2: float, do_prep_adv: bool, ): @@ -224,9 +223,9 @@ def _integrate_one_time_step( def _do_dyn_substepping( self, - solve_nonhydro_diagnostic_state: solve_nh_states.DiagnosticStateNonHydro, + solve_nonhydro_diagnostic_state: dycore_states.DiagnosticStateNonHydro, prognostic_state_list: list[prognostics.PrognosticState], - prep_adv: solve_nh_states.PrepAdvection, + prep_adv: dycore_states.PrepAdvection, inital_divdamp_fac_o2: float, do_prep_adv: bool, ): diff --git a/model/driver/src/icon4py/model/driver/initialization_utils.py b/model/driver/src/icon4py/model/driver/initialization_utils.py index 24f3746e05..f70669d299 100644 --- a/model/driver/src/icon4py/model/driver/initialization_utils.py +++ b/model/driver/src/icon4py/model/driver/initialization_utils.py @@ -11,8 +11,8 @@ import logging import pathlib -from icon4py.model.atmosphere.diffusion import diffusion_states as diffus_states -from icon4py.model.atmosphere.dycore.state_utils import states as solve_nh_states +from icon4py.model.atmosphere.diffusion import diffusion_states +from icon4py.model.atmosphere.dycore import dycore_states from icon4py.model.common import dimension as dims, field_type_aliases as fa from icon4py.model.common.decomposition import ( definitions as decomposition, @@ -93,9 +93,9 @@ def read_icon_grid( def model_initialization_serialbox( grid: icon_grid.IconGrid, path: pathlib.Path, rank=0 ) -> tuple[ - diffus_states.DiffusionDiagnosticState, - solve_nh_states.DiagnosticStateNonHydro, - solve_nh_states.PrepAdvection, + diffusion_states.DiffusionDiagnosticState, + dycore_states.DiagnosticStateNonHydro, + dycore_states.PrepAdvection, float, diagnostics.DiagnosticState, prognostics.PrognosticState, @@ -128,7 +128,7 @@ def model_initialization_serialbox( diffusion_diagnostic_state = driver_sb.construct_diagnostics_for_diffusion( diffusion_init_savepoint, ) - solve_nonhydro_diagnostic_state = solve_nh_states.DiagnosticStateNonHydro( + solve_nonhydro_diagnostic_state = dycore_states.DiagnosticStateNonHydro( theta_v_ic=solve_nonhydro_init_savepoint.theta_v_ic(), exner_pr=solve_nonhydro_init_savepoint.exner_pr(), rho_ic=solve_nonhydro_init_savepoint.rho_ic(), @@ -171,7 +171,7 @@ def model_initialization_serialbox( exner=solve_nonhydro_init_savepoint.exner_new(), ) - prep_adv = solve_nh_states.PrepAdvection( + prep_adv = dycore_states.PrepAdvection( vn_traj=solve_nonhydro_init_savepoint.vn_traj(), mass_flx_me=solve_nonhydro_init_savepoint.mass_flx_me(), mass_flx_ic=solve_nonhydro_init_savepoint.mass_flx_ic(), @@ -197,9 +197,9 @@ def read_initial_state( rank=0, experiment_type: ExperimentType = ExperimentType.ANY, ) -> tuple[ - diffus_states.DiffusionDiagnosticState, - solve_nh_states.DiagnosticStateNonHydro, - solve_nh_states.PrepAdvection, + diffusion_states.DiffusionDiagnosticState, + dycore_states.DiagnosticStateNonHydro, + dycore_states.PrepAdvection, float, diagnostics.DiagnosticState, prognostics.PrognosticState, @@ -344,10 +344,10 @@ def read_static_fields( rank=0, ser_type: SerializationType = SerializationType.SB, ) -> tuple[ - diffus_states.DiffusionMetricState, - diffus_states.DiffusionInterpolationState, - solve_nh_states.MetricStateNonHydro, - solve_nh_states.InterpolationState, + diffusion_states.DiffusionMetricState, + diffusion_states.DiffusionInterpolationState, + dycore_states.MetricStateNonHydro, + dycore_states.InterpolationState, diagnostics.DiagnosticMetricState, ]: """ @@ -375,7 +375,7 @@ def read_static_fields( ) interpolation_savepoint = data_provider.from_interpolation_savepoint() grg = interpolation_savepoint.geofac_grg() - solve_nonhydro_interpolation_state = solve_nh_states.InterpolationState( + solve_nonhydro_interpolation_state = dycore_states.InterpolationState( c_lin_e=interpolation_savepoint.c_lin_e(), c_intp=interpolation_savepoint.c_intp(), e_flx_avg=interpolation_savepoint.e_flx_avg(), @@ -394,7 +394,7 @@ def read_static_fields( nudgecoeff_e=interpolation_savepoint.nudgecoeff_e(), ) metrics_savepoint = data_provider.from_metrics_savepoint() - solve_nonhydro_metric_state = solve_nh_states.MetricStateNonHydro( + solve_nonhydro_metric_state = dycore_states.MetricStateNonHydro( bdy_halo_c=metrics_savepoint.bdy_halo_c(), mask_prog_halo_c=metrics_savepoint.mask_prog_halo_c(), rayleigh_w=metrics_savepoint.rayleigh_w(), diff --git a/model/driver/src/icon4py/model/driver/test_cases/gauss3d.py b/model/driver/src/icon4py/model/driver/test_cases/gauss3d.py index 5e31f259f3..b708225543 100644 --- a/model/driver/src/icon4py/model/driver/test_cases/gauss3d.py +++ b/model/driver/src/icon4py/model/driver/test_cases/gauss3d.py @@ -10,8 +10,8 @@ import gt4py.next as gtx -from icon4py.model.atmosphere.diffusion import diffusion_states as diffus_states -from icon4py.model.atmosphere.dycore.state_utils import states as solve_nh_states +from icon4py.model.atmosphere.diffusion import diffusion_states +from icon4py.model.atmosphere.dycore import dycore_states from icon4py.model.common import constants as phy_const, dimension as dims from icon4py.model.common.grid import horizontal as h_grid, icon as icon_grid, states as grid_states from icon4py.model.common.interpolation.stencils import ( @@ -37,9 +37,9 @@ def model_initialization_gauss3d( path: pathlib.Path, rank=0, ) -> tuple[ - diffus_states.DiffusionDiagnosticState, - solve_nh_states.DiagnosticStateNonHydro, - solve_nh_states.PrepAdvection, + diffusion_states.DiffusionDiagnosticState, + dycore_states.DiagnosticStateNonHydro, + dycore_states.PrepAdvection, float, diagnostics.DiagnosticState, prognostics.PrognosticState, @@ -242,7 +242,7 @@ def model_initialization_gauss3d( exner=exner_next, ) - diffusion_diagnostic_state = diffus_states.DiffusionDiagnosticState( + diffusion_diagnostic_state = diffusion_states.DiffusionDiagnosticState( hdef_ic=field_alloc.allocate_zero_field( dims.CellDim, dims.KDim, grid=grid, is_halfdim=True ), @@ -250,7 +250,7 @@ def model_initialization_gauss3d( dwdx=field_alloc.allocate_zero_field(dims.CellDim, dims.KDim, grid=grid, is_halfdim=True), dwdy=field_alloc.allocate_zero_field(dims.CellDim, dims.KDim, grid=grid, is_halfdim=True), ) - solve_nonhydro_diagnostic_state = solve_nh_states.DiagnosticStateNonHydro( + solve_nonhydro_diagnostic_state = dycore_states.DiagnosticStateNonHydro( theta_v_ic=field_alloc.allocate_zero_field( dims.CellDim, dims.KDim, grid=grid, is_halfdim=True ), @@ -284,7 +284,7 @@ def model_initialization_gauss3d( exner_dyn_incr=field_alloc.allocate_zero_field(dims.CellDim, dims.KDim, grid=grid), ) - prep_adv = solve_nh_states.PrepAdvection( + prep_adv = dycore_states.PrepAdvection( vn_traj=field_alloc.allocate_zero_field(dims.EdgeDim, dims.KDim, grid=grid), mass_flx_me=field_alloc.allocate_zero_field(dims.EdgeDim, dims.KDim, grid=grid), mass_flx_ic=field_alloc.allocate_zero_field(dims.CellDim, dims.KDim, grid=grid), diff --git a/model/driver/src/icon4py/model/driver/test_cases/jablonowski_williamson.py b/model/driver/src/icon4py/model/driver/test_cases/jablonowski_williamson.py index 7dc0d62807..2ffe558d80 100644 --- a/model/driver/src/icon4py/model/driver/test_cases/jablonowski_williamson.py +++ b/model/driver/src/icon4py/model/driver/test_cases/jablonowski_williamson.py @@ -11,8 +11,8 @@ import gt4py.next as gtx -from icon4py.model.atmosphere.diffusion import diffusion_states as diffus_states -from icon4py.model.atmosphere.dycore.state_utils import states as solve_nh_states +from icon4py.model.atmosphere.diffusion import diffusion_states +from icon4py.model.atmosphere.dycore import dycore_states from icon4py.model.common import constants as phy_const, dimension as dims from icon4py.model.common.grid import horizontal as h_grid, icon as icon_grid, states as grid_states from icon4py.model.common.interpolation.stencils import ( @@ -39,9 +39,9 @@ def model_initialization_jabw( path: pathlib.Path, rank=0, ) -> tuple[ - diffus_states.DiffusionDiagnosticState, - solve_nh_states.DiagnosticStateNonHydro, - solve_nh_states.PrepAdvection, + diffusion_states.DiffusionDiagnosticState, + dycore_states.DiagnosticStateNonHydro, + dycore_states.PrepAdvection, float, diagnostics.DiagnosticState, prognostics.PrognosticState, @@ -304,7 +304,7 @@ def model_initialization_jabw( exner=exner_next, ) - diffusion_diagnostic_state = diffus_states.DiffusionDiagnosticState( + diffusion_diagnostic_state = diffusion_states.DiffusionDiagnosticState( hdef_ic=field_alloc.allocate_zero_field( dims.CellDim, dims.KDim, grid=grid, is_halfdim=True ), @@ -312,7 +312,7 @@ def model_initialization_jabw( dwdx=field_alloc.allocate_zero_field(dims.CellDim, dims.KDim, grid=grid, is_halfdim=True), dwdy=field_alloc.allocate_zero_field(dims.CellDim, dims.KDim, grid=grid, is_halfdim=True), ) - solve_nonhydro_diagnostic_state = solve_nh_states.DiagnosticStateNonHydro( + solve_nonhydro_diagnostic_state = dycore_states.DiagnosticStateNonHydro( theta_v_ic=field_alloc.allocate_zero_field( dims.CellDim, dims.KDim, grid=grid, is_halfdim=True ), @@ -346,7 +346,7 @@ def model_initialization_jabw( exner_dyn_incr=field_alloc.allocate_zero_field(dims.CellDim, dims.KDim, grid=grid), ) - prep_adv = solve_nh_states.PrepAdvection( + prep_adv = dycore_states.PrepAdvection( vn_traj=field_alloc.allocate_zero_field(dims.EdgeDim, dims.KDim, grid=grid), mass_flx_me=field_alloc.allocate_zero_field(dims.EdgeDim, dims.KDim, grid=grid), mass_flx_ic=field_alloc.allocate_zero_field(dims.CellDim, dims.KDim, grid=grid), diff --git a/model/driver/tests/driver_tests/test_timeloop.py b/model/driver/tests/driver_tests/test_timeloop.py index 0c9dc6c0f5..5ed02db104 100644 --- a/model/driver/tests/driver_tests/test_timeloop.py +++ b/model/driver/tests/driver_tests/test_timeloop.py @@ -10,8 +10,7 @@ import icon4py.model.common.grid.states as grid_states from icon4py.model.atmosphere.diffusion import diffusion -from icon4py.model.atmosphere.dycore.nh_solve import solve_nonhydro as solve_nh -from icon4py.model.atmosphere.dycore.state_utils import states as solve_nh_states +from icon4py.model.atmosphere.dycore import dycore_states, solve_nonhydro as solve_nh from icon4py.model.common import dimension as dims from icon4py.model.common.grid import vertical as v_grid from icon4py.model.common.states import prognostic_state as prognostics @@ -185,7 +184,7 @@ def test_run_timeloop_single_step( do_prep_adv = sp_v.get_metadata("prep_adv").get("prep_adv") grg = interpolation_savepoint.geofac_grg() - nonhydro_interpolation_state = solve_nh_states.InterpolationState( + nonhydro_interpolation_state = dycore_states.InterpolationState( c_lin_e=interpolation_savepoint.c_lin_e(), c_intp=interpolation_savepoint.c_intp(), e_flx_avg=interpolation_savepoint.e_flx_avg(), @@ -203,7 +202,7 @@ def test_run_timeloop_single_step( geofac_grg_y=grg[1], nudgecoeff_e=interpolation_savepoint.nudgecoeff_e(), ) - nonhydro_metric_state = solve_nh_states.MetricStateNonHydro( + nonhydro_metric_state = dycore_states.MetricStateNonHydro( bdy_halo_c=metrics_savepoint.bdy_halo_c(), mask_prog_halo_c=metrics_savepoint.mask_prog_halo_c(), rayleigh_w=metrics_savepoint.rayleigh_w(), @@ -256,14 +255,14 @@ def test_run_timeloop_single_step( timeloop_diffusion_savepoint_init, ) - prep_adv = solve_nh_states.PrepAdvection( + prep_adv = dycore_states.PrepAdvection( vn_traj=sp.vn_traj(), mass_flx_me=sp.mass_flx_me(), mass_flx_ic=sp.mass_flx_ic(), vol_flx_ic=field_alloc.allocate_zero_field(dims.CellDim, dims.KDim, grid=icon_grid), ) - nonhydro_diagnostic_state = solve_nh_states.DiagnosticStateNonHydro( + nonhydro_diagnostic_state = dycore_states.DiagnosticStateNonHydro( theta_v_ic=sp.theta_v_ic(), exner_pr=sp.exner_pr(), rho_ic=sp.rho_ic(), diff --git a/model/driver/tests/driver_tests/utils.py b/model/driver/tests/driver_tests/utils.py index 60335eeb3c..4e68fa04c4 100644 --- a/model/driver/tests/driver_tests/utils.py +++ b/model/driver/tests/driver_tests/utils.py @@ -9,7 +9,7 @@ from datetime import datetime, timedelta from icon4py.model.atmosphere.diffusion import diffusion -from icon4py.model.atmosphere.dycore.nh_solve import solve_nonhydro as solve_nh +from icon4py.model.atmosphere.dycore import solve_nonhydro as solve_nh from icon4py.model.driver import icon4py_configuration as driver_config @@ -77,7 +77,7 @@ def mch_ch_r04b09_dsl_nonhydrostatic_config(ndyn_substeps): """Create configuration matching the mch_chR04b09_dsl experiment.""" config = solve_nh.NonHydrostaticConfig( ndyn_substeps_var=ndyn_substeps, - divdamp_order=24, + divdamp_order=solve_nh.DivergenceDampingOrder.COMBINED, iau_wgt_dyn=1.0, divdamp_fac=0.004, max_nudging_coeff=0.075, @@ -89,7 +89,7 @@ def exclaim_ape_nonhydrostatic_config(ndyn_substeps): """Create configuration for EXCLAIM APE experiment.""" return solve_nh.NonHydrostaticConfig( rayleigh_coeff=0.1, - divdamp_order=24, + divdamp_order=solve_nh.DivergenceDampingOrder.COMBINED, ndyn_substeps_var=ndyn_substeps, ) diff --git a/tools/src/icon4pytools/icon4pygen/cli.py b/tools/src/icon4pytools/icon4pygen/cli.py index 0ff8fbf2dd..f034dcc7c4 100644 --- a/tools/src/icon4pytools/icon4pygen/cli.py +++ b/tools/src/icon4pytools/icon4pygen/cli.py @@ -18,7 +18,7 @@ class ModuleType(click.ParamType): - dycore_import_path = "icon4py.model.atmosphere.dycore" + dycore_import_path = "icon4py.model.atmosphere.dycore.stencils" names: ClassVar[list[str]] = [ f"{dycore_import_path}.mo_nh_diffusion_stencil_", f"{dycore_import_path}.mo_solve_nonhydro_stencil_", diff --git a/tools/src/icon4pytools/liskov/external/gt4py.py b/tools/src/icon4pytools/liskov/external/gt4py.py index 7785b10ec3..1f263b9111 100644 --- a/tools/src/icon4pytools/liskov/external/gt4py.py +++ b/tools/src/icon4pytools/liskov/external/gt4py.py @@ -28,7 +28,7 @@ class UpdateFieldsWithGt4PyStencils(Step): _STENCIL_PACKAGES: ClassVar[list[str]] = [ - "atmosphere.dycore", + "atmosphere.dycore.stencils", "atmosphere.advection.stencils", "atmosphere.diffusion.stencils", "common.interpolation.stencils", diff --git a/tools/src/icon4pytools/py2fgen/wrappers/dycore_wrapper.py b/tools/src/icon4pytools/py2fgen/wrappers/dycore_wrapper.py index 9e1b51a964..153c333a72 100644 --- a/tools/src/icon4pytools/py2fgen/wrappers/dycore_wrapper.py +++ b/tools/src/icon4pytools/py2fgen/wrappers/dycore_wrapper.py @@ -34,9 +34,7 @@ import gt4py.next as gtx import icon4py.model.common.grid.states as grid_states from gt4py.next import common as gt4py_common -from icon4py.model.atmosphere.dycore.nh_solve import solve_nonhydro -from icon4py.model.atmosphere.dycore.nh_solve.solve_nonhydro import SolveNonhydro -from icon4py.model.atmosphere.dycore.state_utils import states as nh_states +from icon4py.model.atmosphere.dycore import dycore_states, solve_nonhydro from icon4py.model.common import dimension as dims, settings from icon4py.model.common.dimension import ( C2E2CODim, @@ -260,7 +258,7 @@ def solve_nh_init( length_rescale_factor=1.0, ) - interpolation_state = nh_states.InterpolationState( + interpolation_state = dycore_states.InterpolationState( c_lin_e=c_lin_e, c_intp=c_intp, e_flx_avg=e_flx_avg, @@ -279,7 +277,7 @@ def solve_nh_init( nudgecoeff_e=nudgecoeff_e, ) - metric_state_nonhydro = nh_states.MetricStateNonHydro( + metric_state_nonhydro = dycore_states.MetricStateNonHydro( bdy_halo_c=bdy_halo_c, mask_prog_halo_c=mask_prog_halo_c, rayleigh_w=rayleigh_w, @@ -332,7 +330,7 @@ def solve_nh_init( _min_index_flat_horizontal_grad_pressure=nflat_gradp, ) - dycore_wrapper_state["granule"] = SolveNonhydro( + dycore_wrapper_state["granule"] = solve_nonhydro.SolveNonhydro( grid=dycore_wrapper_state["grid"], config=config, params=nonhydro_params, @@ -391,14 +389,14 @@ def solve_nh_run( ): logger.info(f"Using Device = {settings.device}") - prep_adv = nh_states.PrepAdvection( + prep_adv = dycore_states.PrepAdvection( vn_traj=vn_traj, mass_flx_me=mass_flx_me, mass_flx_ic=mass_flx_ic, vol_flx_ic=zero_field(dycore_wrapper_state["grid"], CellDim, KDim, dtype=gtx.float64), ) - diagnostic_state_nh = nh_states.DiagnosticStateNonHydro( + diagnostic_state_nh = dycore_states.DiagnosticStateNonHydro( theta_v_ic=theta_v_ic, exner_pr=exner_pr, rho_ic=rho_ic, diff --git a/tools/tests/icon4pygen/test_codegen.py b/tools/tests/icon4pygen/test_codegen.py index f0b4a11579..013e108d1d 100644 --- a/tools/tests/icon4pygen/test_codegen.py +++ b/tools/tests/icon4pygen/test_codegen.py @@ -13,7 +13,7 @@ from importlib import reload import icon4py.model.atmosphere.diffusion.stencils as diffusion -import icon4py.model.atmosphere.dycore as dycore +import icon4py.model.atmosphere.dycore.stencils as dycore import icon4py.model.common.interpolation.stencils as intp import icon4py.model.common.type_alias as type_alias import pytest @@ -24,7 +24,7 @@ from .conftest import get_stencil_module_path -DYCORE_PKG = "atmosphere.dycore" +DYCORE_PKG = "atmosphere.dycore.stencils" INTERPOLATION_PKG = "common.interpolation.stencils" DIFFUSION_PKG = "atmosphere.diffusion.stencils" @@ -125,7 +125,7 @@ def check_code_was_generated(stencil_name: str) -> None: # TODO: (samkellerhals) add temporaries codegen here once all work. @pytest.mark.parametrize( ("stencil_module", "stencil_name"), - dycore_fencils() + interpolation_fencils() + diffusion_fencils(), + dycore_fencils(), ) @pytest.mark.parametrize("flags", [()], ids=["normal"]) def test_codegen(cli, stencil_module, stencil_name, flags, test_temp_dir) -> None: diff --git a/tools/tests/py2fgen/test_dycore_wrapper.py b/tools/tests/py2fgen/test_dycore_wrapper.py index eca60c4e73..211f5eb1ac 100644 --- a/tools/tests/py2fgen/test_dycore_wrapper.py +++ b/tools/tests/py2fgen/test_dycore_wrapper.py @@ -24,8 +24,7 @@ import gt4py.next as gtx import pytest -from icon4py.model.atmosphere.dycore.nh_solve import solve_nonhydro as solve_nh -from icon4py.model.atmosphere.dycore.state_utils import states as solve_nh_states +from icon4py.model.atmosphere.dycore import dycore_states, solve_nonhydro as solve_nh from icon4py.model.common import constants, dimension as dims from icon4py.model.common.grid import horizontal as h_grid, vertical as v_grid from icon4py.model.common.grid.vertical import VerticalGridConfig @@ -301,7 +300,7 @@ def test_dycore_wrapper_granule_inputs( expected_icon_grid = icon_grid expected_edge_geometry = grid_savepoint.construct_edge_geometry() expected_cell_geometry = grid_savepoint.construct_cell_geometry() - expected_interpolation_state = solve_nh_states.InterpolationState( + expected_interpolation_state = dycore_states.InterpolationState( c_lin_e=interpolation_savepoint.c_lin_e(), c_intp=interpolation_savepoint.c_intp(), e_flx_avg=interpolation_savepoint.e_flx_avg(), @@ -319,7 +318,7 @@ def test_dycore_wrapper_granule_inputs( geofac_grg_y=interpolation_savepoint.geofac_grg()[1], nudgecoeff_e=interpolation_savepoint.nudgecoeff_e(), ) - expected_metric_state = solve_nh_states.MetricStateNonHydro( + expected_metric_state = dycore_states.MetricStateNonHydro( bdy_halo_c=metrics_savepoint.bdy_halo_c(), mask_prog_halo_c=metrics_savepoint.mask_prog_halo_c(), rayleigh_w=metrics_savepoint.rayleigh_w(), @@ -371,7 +370,7 @@ def test_dycore_wrapper_granule_inputs( expected_additional_parameters = solve_nh.NonHydrostaticParams(expected_config) # --- Expected objects that form inputs into run function --- - expected_diagnostic_state_nh = solve_nh_states.DiagnosticStateNonHydro( + expected_diagnostic_state_nh = dycore_states.DiagnosticStateNonHydro( theta_v_ic=sp.theta_v_ic(), exner_pr=sp.exner_pr(), rho_ic=sp.rho_ic(), @@ -410,7 +409,7 @@ def test_dycore_wrapper_granule_inputs( ) expected_prognostic_state_ls = [prognostic_state_nnow, prognostic_state_nnew] - expected_prep_adv = solve_nh_states.PrepAdvection( + expected_prep_adv = dycore_states.PrepAdvection( vn_traj=sp.vn_traj(), mass_flx_me=sp.mass_flx_me(), mass_flx_ic=sp.mass_flx_ic(), @@ -455,7 +454,7 @@ def test_dycore_wrapper_granule_inputs( # --- Mock and Test SolveNonhydro.init --- with mock.patch( - "icon4py.model.atmosphere.dycore.nh_solve.solve_nonhydro.SolveNonhydro.__init__", + "icon4py.model.atmosphere.dycore.solve_nonhydro.SolveNonhydro.__init__", return_value=None, ) as mock_init: dycore_wrapper.solve_nh_init( @@ -620,7 +619,7 @@ def test_dycore_wrapper_granule_inputs( # --- Mock and Test SolveNonhydro.run --- with mock.patch( - "icon4py.model.atmosphere.dycore.nh_solve.solve_nonhydro.SolveNonhydro.time_step" + "icon4py.model.atmosphere.dycore.solve_nonhydro.SolveNonhydro.time_step" ) as mock_init: dycore_wrapper.solve_nh_run( rho_now=rho_now, diff --git a/tools/tests/py2fgen/utils.py b/tools/tests/py2fgen/utils.py index 94438f5740..823b3cacb0 100644 --- a/tools/tests/py2fgen/utils.py +++ b/tools/tests/py2fgen/utils.py @@ -9,7 +9,7 @@ from gt4py.next.embedded.nd_array_field import NdArrayField from icon4py.model.atmosphere.diffusion import diffusion -from icon4py.model.atmosphere.dycore.nh_solve import solve_nonhydro as solve_nh +from icon4py.model.atmosphere.dycore import solve_nonhydro as solve_nh from icon4py.model.common.settings import xp From df0c34a6796c9806b684c7102890128569cb84f8 Mon Sep 17 00:00:00 2001 From: Rico Haeuselmann Date: Wed, 20 Nov 2024 09:00:52 +0100 Subject: [PATCH 4/7] Fix parallel diffusion tests with dace orchestration (#572) * filter out unused connectivities * remove diffusion_instance fixture * update member blacklist in Diffusion.orchestration_uid --- .../model/atmosphere/diffusion/diffusion.py | 19 ++--- .../tests/diffusion_tests/conftest.py | 2 - .../mpi_tests/test_parallel_diffusion.py | 54 +++++++++++-- .../tests/diffusion_tests/test_diffusion.py | 13 +++- .../diffusion/tests/diffusion_tests/utils.py | 78 ------------------- .../model/common/orchestration/decorator.py | 17 ++-- 6 files changed, 72 insertions(+), 111 deletions(-) diff --git a/model/atmosphere/diffusion/src/icon4py/model/atmosphere/diffusion/diffusion.py b/model/atmosphere/diffusion/src/icon4py/model/atmosphere/diffusion/diffusion.py index e3349e5233..7c7f56159e 100644 --- a/model/atmosphere/diffusion/src/icon4py/model/atmosphere/diffusion/diffusion.py +++ b/model/atmosphere/diffusion/src/icon4py/model/atmosphere/diffusion/diffusion.py @@ -922,19 +922,12 @@ def orchestration_uid(self) -> str: members_to_disregard = [ "_backend", "_exchange", - "mo_intp_rbf_rbf_vec_interpol_vertex", - "calculate_nabla2_and_smag_coefficients_for_vn", - "calculate_diagnostic_quantities_for_turbulence", - "apply_diffusion_to_vn", - "apply_diffusion_to_w_and_compute_horizontal_gradients_for_turbulence", - "calculate_enhanced_diffusion_coefficients_for_grid_point_cold_pools", - "calculate_nabla2_for_theta", - "truly_horizontal_diffusion_nabla_of_theta_over_steep_points", - "update_theta_and_exner", - "copy_field", - "scale_k", - "setup_fields_for_initial_step", - "init_diffusion_local_fields_for_regular_timestep", + "_grid", + *[ + name + for name in self.__dict__.keys() + if isinstance(self.__dict__[name], gtx.ffront.decorator.Program) + ], ] return orchestration.generate_orchestration_uid( self, members_to_disregard=members_to_disregard diff --git a/model/atmosphere/diffusion/tests/diffusion_tests/conftest.py b/model/atmosphere/diffusion/tests/diffusion_tests/conftest.py index e9308cee16..f8ef9ed339 100644 --- a/model/atmosphere/diffusion/tests/diffusion_tests/conftest.py +++ b/model/atmosphere/diffusion/tests/diffusion_tests/conftest.py @@ -33,5 +33,3 @@ stretch_factor, top_height_limit_for_maximal_layer_thickness, ) - -from .utils import diffusion_instance # noqa: F401 # import fixtures from test_utils package diff --git a/model/atmosphere/diffusion/tests/diffusion_tests/mpi_tests/test_parallel_diffusion.py b/model/atmosphere/diffusion/tests/diffusion_tests/mpi_tests/test_parallel_diffusion.py index 59d9b65223..b1889adb95 100644 --- a/model/atmosphere/diffusion/tests/diffusion_tests/mpi_tests/test_parallel_diffusion.py +++ b/model/atmosphere/diffusion/tests/diffusion_tests/mpi_tests/test_parallel_diffusion.py @@ -15,7 +15,6 @@ from icon4py.model.common.test_utils import datatest_utils, helpers, parallel_helpers from .. import utils -from ..utils import diffusion_instance # noqa @pytest.mark.mpi @@ -41,7 +40,6 @@ def test_parallel_diffusion( damping_height, caplog, backend, - diffusion_instance, # noqa: F811 ): caplog.set_level("INFO") parallel_helpers.check_comm_size(processor_props) @@ -66,8 +64,50 @@ def test_parallel_diffusion( print( f"rank={processor_props.rank}/{processor_props.comm_size}: setup: using {processor_props.comm_name} with {processor_props.comm_size} nodes" ) + vertical_config = v_grid.VerticalGridConfig( + icon_grid.num_levels, + lowest_layer_thickness=lowest_layer_thickness, + model_top_height=model_top_height, + stretch_factor=stretch_factor, + rayleigh_damping_height=damping_height, + ) - diffusion = diffusion_instance # the fixture makes sure that the orchestrator cache is cleared properly between pytest runs -if applicable- + diffusion_params = diffusion_.DiffusionParams(config) + metric_state = diffusion_states.DiffusionMetricState( + mask_hdiff=metrics_savepoint.mask_hdiff(), + theta_ref_mc=metrics_savepoint.theta_ref_mc(), + wgtfac_c=metrics_savepoint.wgtfac_c(), + zd_intcoef=metrics_savepoint.zd_intcoef(), + zd_vertoffset=metrics_savepoint.zd_vertoffset(), + zd_diffcoef=metrics_savepoint.zd_diffcoef(), + ) + interpolation_state = diffusion_states.DiffusionInterpolationState( + e_bln_c_s=helpers.as_1D_sparse_field(interpolation_savepoint.e_bln_c_s(), dims.CEDim), + rbf_coeff_1=interpolation_savepoint.rbf_vec_coeff_v1(), + rbf_coeff_2=interpolation_savepoint.rbf_vec_coeff_v2(), + geofac_div=helpers.as_1D_sparse_field(interpolation_savepoint.geofac_div(), dims.CEDim), + geofac_n2s=interpolation_savepoint.geofac_n2s(), + geofac_grg_x=interpolation_savepoint.geofac_grg()[0], + geofac_grg_y=interpolation_savepoint.geofac_grg()[1], + nudgecoeff_e=interpolation_savepoint.nudgecoeff_e(), + ) + cell_geometry = grid_savepoint.construct_cell_geometry() + edge_geometry = grid_savepoint.construct_edge_geometry() + exchange = definitions.create_exchange(processor_props, decomposition_info) + diffusion = diffusion_.Diffusion( + grid=icon_grid, + config=config, + params=diffusion_params, + vertical_grid=v_grid.VerticalGrid( + vertical_config, grid_savepoint.vct_a(), grid_savepoint.vct_b() + ), + metric_state=metric_state, + interpolation_state=interpolation_state, + edge_params=edge_geometry, + cell_params=cell_geometry, + exchange=exchange, + backend=backend, + ) print(f"rank={processor_props.rank}/{processor_props.comm_size}: diffusion initialized ") @@ -127,7 +167,6 @@ def test_parallel_diffusion_multiple_steps( damping_height, caplog, backend, - diffusion_instance, # noqa: F811 ): if settings.dace_orchestration is None: raise pytest.skip("This test is only executed for `--dace-orchestration=True`.") @@ -244,9 +283,8 @@ def test_parallel_diffusion_multiple_steps( ###################################################################### settings.dace_orchestration = True - diffusion = diffusion_instance # the fixture makes sure that the orchestrator cache is cleared properly between pytest runs -if applicable- - - diffusion.init( + exchange = definitions.create_exchange(processor_props, decomposition_info) + diffusion = diffusion_.Diffusion( grid=icon_grid, config=config, params=diffusion_params, @@ -257,6 +295,8 @@ def test_parallel_diffusion_multiple_steps( interpolation_state=interpolation_state, edge_params=edge_geometry, cell_params=cell_geometry, + exchange=exchange, + backend=backend, ) print(f"rank={processor_props.rank}/{processor_props.comm_size}: diffusion initialized ") diff --git a/model/atmosphere/diffusion/tests/diffusion_tests/test_diffusion.py b/model/atmosphere/diffusion/tests/diffusion_tests/test_diffusion.py index 6f9e57fdba..8b73824ce8 100644 --- a/model/atmosphere/diffusion/tests/diffusion_tests/test_diffusion.py +++ b/model/atmosphere/diffusion/tests/diffusion_tests/test_diffusion.py @@ -511,7 +511,6 @@ def test_run_diffusion_multiple_steps( damping_height, ndyn_substeps, backend, - diffusion_instance, # F811 fixture icon_grid, ): if settings.dace_orchestration is None: @@ -605,7 +604,17 @@ def test_run_diffusion_multiple_steps( ) prognostic_state_dace_orch = savepoint_diffusion_init.construct_prognostics() - diffusion_granule = diffusion_instance # the fixture makes sure that the orchestrator cache is cleared properly between pytest runs -if applicable- + diffusion_granule = diffusion.Diffusion( + grid=icon_grid, + config=config, + params=additional_parameters, + vertical_grid=vertical_params, + metric_state=metric_state, + interpolation_state=interpolation_state, + edge_params=edge_geometry, + cell_params=cell_geometry, + backend=backend, + ) for _ in range(3): diffusion_granule.run( diff --git a/model/atmosphere/diffusion/tests/diffusion_tests/utils.py b/model/atmosphere/diffusion/tests/diffusion_tests/utils.py index a4bc4997a3..804f8b4bf3 100644 --- a/model/atmosphere/diffusion/tests/diffusion_tests/utils.py +++ b/model/atmosphere/diffusion/tests/diffusion_tests/utils.py @@ -7,13 +7,8 @@ # SPDX-License-Identifier: BSD-3-Clause import numpy as np -import pytest -import icon4py.model.common.dimension as dims from icon4py.model.atmosphere.diffusion import diffusion, diffusion_states -from icon4py.model.common import settings -from icon4py.model.common.decomposition import definitions -from icon4py.model.common.grid import vertical as v_grid from icon4py.model.common.states import prognostic_state as prognostics from icon4py.model.common.test_utils import helpers, serialbox_utils as sb @@ -159,76 +154,3 @@ def compare_dace_orchestration_multiple_steps( assert np.allclose(vn_dace_non_orch, vn_dace_orch) else: raise ValueError("Field type not recognized") - - -@pytest.fixture -def diffusion_instance( - icon_grid, - metrics_savepoint, - interpolation_savepoint, - ndyn_substeps, - experiment, - lowest_layer_thickness, - model_top_height, - stretch_factor, - damping_height, - grid_savepoint, - backend, - processor_props, # fixture - decomposition_info, # fixture -): - """Fixture to create a diffusion instance and clear the orchestration cache properly -if applicable-.""" - exchange = definitions.create_exchange(processor_props, decomposition_info) - edge_geometry = grid_savepoint.construct_edge_geometry() - cell_geometry = grid_savepoint.construct_cell_geometry() - vertical_config = v_grid.VerticalGridConfig( - icon_grid.num_levels, - lowest_layer_thickness=lowest_layer_thickness, - model_top_height=model_top_height, - stretch_factor=stretch_factor, - rayleigh_damping_height=damping_height, - ) - vertical_params = v_grid.VerticalGrid( - config=vertical_config, - vct_a=grid_savepoint.vct_a(), - vct_b=grid_savepoint.vct_b(), - _min_index_flat_horizontal_grad_pressure=grid_savepoint.nflat_gradp(), - ) - config = construct_diffusion_config(experiment, ndyn_substeps=ndyn_substeps) - additional_parameters = diffusion.DiffusionParams(config) - metric_state = diffusion_states.DiffusionMetricState( - mask_hdiff=metrics_savepoint.mask_hdiff(), - theta_ref_mc=metrics_savepoint.theta_ref_mc(), - wgtfac_c=metrics_savepoint.wgtfac_c(), - zd_intcoef=metrics_savepoint.zd_intcoef(), - zd_vertoffset=metrics_savepoint.zd_vertoffset(), - zd_diffcoef=metrics_savepoint.zd_diffcoef(), - ) - interpolation_state = diffusion_states.DiffusionInterpolationState( - e_bln_c_s=helpers.as_1D_sparse_field(interpolation_savepoint.e_bln_c_s(), dims.CEDim), - rbf_coeff_1=interpolation_savepoint.rbf_vec_coeff_v1(), - rbf_coeff_2=interpolation_savepoint.rbf_vec_coeff_v2(), - geofac_div=helpers.as_1D_sparse_field(interpolation_savepoint.geofac_div(), dims.CEDim), - geofac_n2s=interpolation_savepoint.geofac_n2s(), - geofac_grg_x=interpolation_savepoint.geofac_grg()[0], - geofac_grg_y=interpolation_savepoint.geofac_grg()[1], - nudgecoeff_e=interpolation_savepoint.nudgecoeff_e(), - ) - - diffusion_instance_ = diffusion.Diffusion( - grid=icon_grid, - config=config, - params=additional_parameters, - vertical_grid=vertical_params, - metric_state=metric_state, - interpolation_state=interpolation_state, - edge_params=edge_geometry, - cell_params=cell_geometry, - backend=backend, - exchange=exchange, - ) - - yield diffusion_instance_ - - if settings.dace_orchestration is not None: - diffusion_instance_._do_diffusion_step.clear_cache() diff --git a/model/common/src/icon4py/model/common/orchestration/decorator.py b/model/common/src/icon4py/model/common/orchestration/decorator.py index 10a2b8be74..5b303164db 100644 --- a/model/common/src/icon4py/model/common/orchestration/decorator.py +++ b/model/common/src/icon4py/model/common/orchestration/decorator.py @@ -166,7 +166,14 @@ def wrapper(*args, **kwargs): ) updated_kwargs = { **updated_kwargs, - **dace_specific_kwargs(exchange_obj, grid.offset_providers), + **dace_specific_kwargs( + exchange_obj, + { + k: v + for k, v in grid.offset_providers.items() + if connectivity_identifier(k) in sdfg.arrays + }, + ), } updated_kwargs = { **updated_kwargs, @@ -183,14 +190,6 @@ def wrapper(*args, **kwargs): configure_dace_temp_env(default_build_folder) return compiled_sdfg(**sdfg_args) - # Pytest does not clear the cache between runs in a proper way -pytest.mark.parametrize(...)-. - # This leads to corrupted cache and subsequent errors. - # To avoid this, we provide a way to clear the cache. - def clear_cache(): - orchestrator_cache.clear() - - wrapper.clear_cache = clear_cache - return wrapper else: From b5b0011732b29ee356ce87cae91c73219f07136c Mon Sep 17 00:00:00 2001 From: Magdalena Date: Wed, 20 Nov 2024 11:32:02 +0100 Subject: [PATCH 5/7] fix the path to the stencil tests in the spack pytest config (#598) --- jenkins/spack/pytest.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jenkins/spack/pytest.ini b/jenkins/spack/pytest.ini index 4c6ddb66b2..3a54040ded 100644 --- a/jenkins/spack/pytest.ini +++ b/jenkins/spack/pytest.ini @@ -8,7 +8,7 @@ addopts = -p icon4py.model.common.test_utils.pytest_config testpaths = tools/tests/f2ser tools/tests/icon4pygen tools/tests/liskov - model/atmosphere/dycore/tests/stencil_tests - model/atmosphere/diffusion/tests/stencil_tests - model/atmosphere/advection/tests/stencil_tests + model/atmosphere/dycore/tests/dycore_stencil_tests + model/atmosphere/diffusion/tests/diffusion_stencil_tests + model/atmosphere/advection/tests/advection_stencil_tests model/common/tests/stencil_tests From 5820a8e391e888b9c8068d14c4a63d2578eac2d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20Gonz=C3=A1lez=20Paredes?= Date: Wed, 20 Nov 2024 17:15:57 +0100 Subject: [PATCH 6/7] feat: enhance common model utils with classes for implementing double buffering (#602) Refactor and expand the model/common/utils module with simple implementation of utilities for to double-buffering like Pair. Additionally, fix the existing doctest for chainable. --- .../icon4py/model/common/utils/__init__.py | 20 +- .../src/icon4py/model/common/utils/_common.py | 308 ++++++++++++++---- 2 files changed, 261 insertions(+), 67 deletions(-) diff --git a/model/common/src/icon4py/model/common/utils/__init__.py b/model/common/src/icon4py/model/common/utils/__init__.py index af9faae75e..315b415edd 100644 --- a/model/common/src/icon4py/model/common/utils/__init__.py +++ b/model/common/src/icon4py/model/common/utils/__init__.py @@ -8,10 +8,26 @@ from __future__ import annotations -from ._common import Swapping, chainable +from . import gt4py_field_allocation +from ._common import ( + DoubleBuffering, + NextStepPair, + Pair, + PreviousStepPair, + chainable, + named_property, +) __all__ = [ + # Classes + "DoubleBuffering", + "NextStepPair", + "Pair", + "PreviousStepPair", + "named_property", + # Functions "chainable", - "Swapping", + # Modules + "gt4py_field_allocation", ] diff --git a/model/common/src/icon4py/model/common/utils/_common.py b/model/common/src/icon4py/model/common/utils/_common.py index 361c5b3fd7..13d2dd7bbf 100644 --- a/model/common/src/icon4py/model/common/utils/_common.py +++ b/model/common/src/icon4py/model/common/utils/_common.py @@ -9,110 +9,288 @@ from __future__ import annotations +import abc +import copy import functools from collections.abc import Callable -from typing import Concatenate, Generic, ParamSpec, TypeVar +from typing import ( + ClassVar, + Concatenate, + Final, + Generator, + Generic, + Literal, + ParamSpec, + Protocol, + TypeVar, + runtime_checkable, +) -__all__ = [ - "chainable", - "Swapping", -] +@runtime_checkable +class DoubleBuffering(Protocol): + @abc.abstractmethod + def swap_buffers(self) -> None: + ... + -P = ParamSpec("P") T = TypeVar("T") +C = TypeVar("C") -def chainable(method_fn: Callable[Concatenate[T, P], None]) -> Callable[Concatenate[T, P], T]: +class named_property(property, Generic[C, T]): """ - Make an instance method return the actual instance so it can used in a chain of calls. + A simple extension of the built-in `property` descriptor storing + the name of the attribute it is assigned to. - Typically used for simple fluent interfaces. + The name is stored in the `name` attribute of the property instance. Examples: >>> class A: - ... @chainable - ... def set_value(self, value: int) -> None: - ... self.value = value + ... @named_property + ... def value(self) -> int: + ... return self._value ... - ... @chainable - ... def increment(self, value: int) -> None: - ... self.value += value - ... - ... - ... a = A() - ... a.set_value(1).increment(2) - ... a.value - 3 + ... @value.setter + ... def value(self, value: int) -> None: + ... self._value = value + >>> a = A() + >>> a.value = 1 + >>> print(A.value.name) + value """ - @functools.wraps(method_fn) - def wrapper(self: T, *args: P.args, **kwargs: P.kwargs) -> T: - method_fn(self, *args, **kwargs) - return self + name: str | None = None - return wrapper + def __set_name__(self, owner: C, name: str) -> None: + """ + Set the name of the attribute the property is assigned to. + + Note that if the same descriptor is assigned to multiple attributes + or if it is reused in other classes, only the first assigned name + is stored. + """ + if self.name is None: + self.name = name + + def getter(self: named_property[C, T], fget: Callable[[C], T]) -> named_property[C, T]: + result = super().getter(fget) + result.name = getattr(self, "name", None) + return result + def setter(self: named_property[C, T], fset: Callable[[C, T], None]) -> named_property[C, T]: + result = super().setter(fset) + result.name = getattr(self, "name", None) + return result -class Swapping(Generic[T]): + def deleter(self: named_property[C, T], fdel: Callable[[C], None]) -> named_property[C, T]: + result = super().deleter(fdel) + result.name = getattr(self, "name", None) + return result + + def __copy__(self) -> named_property[C, T]: + result = type(self)(self.fget, self.fset, self.fdel, self.__doc__) + result.name = self.name + return result + + +class Pair(Generic[T]): """ - Generic double container for swapping between two values. + Generic class representing a pair of values. - This is useful for double buffering in numerical algorithms. + The name of the pair attributes can be customized by defining new + descriptors in the subclasses. - Examples: - >>> a = Swapping(current=1, other=2) - Swapping(1, 2) + See the examples below. - >>> a.swap() - Swapping(current=2, other=1) + Examples: + >>> class MyPair(Pair[T]): + ... a: T = Pair.first + ... b: T = Pair.frozen_second + >>> pair = MyPair(1, 2) + >>> print(pair) + MyPair(a=1, b=2) - >>> a.current = 3 - ... a - Swapping(current=3, other=1) + >>> pair.swap() + MyPair(a=2, b=1) - >>> a != ~a + >>> pair == MyPair(2, 1) True - >>> a == ~~a - True + >>> pair.a = -1 + >>> pair[0] + -1 - >>> a.current == (~a).other - True + >>> pair[0] = 100 + >>> pair.a + 100 + + >>> pair.b = 3 + Traceback (most recent call last): + ... + AttributeError: can't set attribute + + >>> pair[1] = 3 + Traceback (most recent call last): + ... + AttributeError: can't set attribute - >>> b = ~a - ... a.swap() - ... a == b - True """ - __slots__ = ("current", "_other", "__weakref__") + _FIRST_ACCESSOR_ID: Final = "FIRST" + _SECOND_ACCESSOR_ID: Final = "SECOND" - current: T - _other: T + __first_attr_name: ClassVar[str] = "first" + __second_attr_name: ClassVar[str] = "second" - @property - def other(self) -> T: - return self._other + def __init_subclass__(cls) -> None: + for key, value in {**cls.__dict__}.items(): + if (attr_id := getattr(value, "_pair_accessor_id_", None)) is not None: + assert isinstance(value, named_property) + if key != value.name: + # If one of the original descriptors from the `Pair` class has been + # directly assigned to another class member with a different name + # (likely in a subclass) instead of creating a proper copy, it is + # copied and initialized here with the right name. + descriptor_copy = copy.copy(value) + descriptor_copy.name = key + setattr(cls, key, descriptor_copy) + if attr_id == Pair._FIRST_ACCESSOR_ID: + cls.__first_attr_name = key + elif attr_id == Pair._SECOND_ACCESSOR_ID: + cls.__second_attr_name = key + else: + raise TypeError(f"Invalid '{key}' pair accessor descriptor: {value}") - def __init__(self, current: T, other: T) -> None: - self.current = current - self._other = other + __first: T + __second: T - def __repr__(self) -> str: - return f"{self.__class__.__name__}(current={self.current!r}, other={self._other!r})" + def __init__(self, first: T, second: T, /) -> None: + self.__first = first + self.__second = second + + @named_property + def first(self) -> T: + """Property descriptor for the first element of the pair.""" + return self.__first + + @first.setter + def first(self, value: T) -> None: + self.__first = value + + @named_property + def second(self) -> T: + """Property descriptor for the second element of the pair.""" + return self.__second + + @second.setter + def second(self, value: T) -> None: + self.__second = value + + @named_property + def frozen_first(self) -> T: + """Read-only property descriptor for the first element of the pair (mainly for subclassing).""" + return self.__first + + @named_property + def frozen_second(self) -> T: + """Read-only property descriptor for the second element of the pair (mainly for subclassing).""" + return self.__second + + first._pair_accessor_id_ = frozen_first._pair_accessor_id_ = _FIRST_ACCESSOR_ID + second._pair_accessor_id_ = frozen_second._pair_accessor_id_ = _SECOND_ACCESSOR_ID def __eq__(self, other: object) -> bool: - return ( - isinstance(other, Swapping) - and self.current == other.current - and self._other == other._other + return type(self) is type(other) and ( + self.__first == other.__first and self.__second == other.__second ) # `__hash__` is implicitly set to None when `__eq__` is redefined, so instances are not hashable. - def swap(self) -> None: - self.current, self._other = self._other, self.current + def __getitem__(self, index: Literal[0, 1]) -> T: + match index: + case 0: + return self.__first + case 1: + return self.__second + case _: + raise IndexError(f"Pair index out of range: {index}") + + def __setitem__(self, index: Literal[0, 1], value: T) -> None: + # Go through the attribute descriptors to respect the read-only indication + match index: + case 0: + attr_name = self.__first_attr_name + case 1: + attr_name = self.__second_attr_name + case _: + raise IndexError(f"Pair index out of range: {index}") - def __invert__(self) -> Swapping[T]: - return type(self)(current=self._other, other=self.current) + setattr(self, attr_name, value) + + def __iter__(self) -> Generator[T, None, None]: + yield self.__first + yield self.__second + + def __repr__(self) -> str: + first_name = type(self).__first_attr_name + second_name = type(self).__second_attr_name + return f"{self.__class__.__name__}({first_name}={self.__first!r}, {second_name}={self.__second!r})" + + def swap(self: Pair[T]) -> Pair[T]: + """ + Swap the values of the first and second attributes of the instance. + + Returns: + The instance with swapped values (for fluent interfaces). + """ + self.__first, self.__second = self.__second, self.__first + return self + + swap_buffers = swap + + +class NextStepPair(Pair[T]): + current: T = Pair.first + next: T = Pair.frozen_second + + +class PreviousStepPair(Pair[T]): + current: T = Pair.first + previous: T = Pair.frozen_second + + +P = ParamSpec("P") +T = TypeVar("T") + + +def chainable(method_fn: Callable[Concatenate[T, P], None]) -> Callable[Concatenate[T, P], T]: + """ + Make an instance method return the actual instance so it can be used in a chain of calls. + + Typically used for simple fluent interfaces. + + Examples: + >>> class A: + ... @chainable + ... def set_value(self, value: int) -> None: + ... self.value = value + ... + ... @chainable + ... def increment(self, value: int) -> None: + ... self.value += value + + >>> a = A() + >>> a.set_value(1).increment(2) # doctest:+ELLIPSIS + <__main__.A object at ...> + + >>> a.value + 3 + """ + + @functools.wraps(method_fn) + def wrapper(self: T, *args: P.args, **kwargs: P.kwargs) -> T: + method_fn(self, *args, **kwargs) + return self + + return wrapper From a1244cdb8ec5a4d598bf342fbe449a3680171ff7 Mon Sep 17 00:00:00 2001 From: Magdalena Date: Fri, 22 Nov 2024 09:09:11 +0100 Subject: [PATCH 7/7] add some cell version of math stencils (#603) * add some cell version of math stencils fix wrong return value in gvec2cvec --- .../src/icon4py/model/common/grid/geometry.py | 2 +- .../model/common/grid/geometry_stencils.py | 10 +- .../src/icon4py/model/common/math/helpers.py | 109 ++++++++++++++++-- model/common/tests/math_tests/test_helpers.py | 2 +- 4 files changed, 104 insertions(+), 19 deletions(-) diff --git a/model/common/src/icon4py/model/common/grid/geometry.py b/model/common/src/icon4py/model/common/grid/geometry.py index 6eaf3914b5..a3be7e7d9b 100644 --- a/model/common/src/icon4py/model/common/grid/geometry.py +++ b/model/common/src/icon4py/model/common/grid/geometry.py @@ -429,7 +429,7 @@ def _inverse_field_provider(self, field_name: str): name = meta["standard_name"] self._attrs.update({name: meta}) provider = factory.ProgramFieldProvider( - func=math_helpers.compute_inverse, + func=math_helpers.compute_inverse_on_edges, deps={"f": field_name}, fields={"f_inverse": name}, domain={ diff --git a/model/common/src/icon4py/model/common/grid/geometry_stencils.py b/model/common/src/icon4py/model/common/grid/geometry_stencils.py index 915e49fcce..670919455a 100644 --- a/model/common/src/icon4py/model/common/grid/geometry_stencils.py +++ b/model/common/src/icon4py/model/common/grid/geometry_stencils.py @@ -13,10 +13,10 @@ from icon4py.model.common.dimension import E2C, E2C2V, E2V, EdgeDim from icon4py.model.common.math.helpers import ( arc_length, - cross_product, + cross_product_on_edges, geographical_to_cartesian_on_edges, geographical_to_cartesian_on_vertex, - normalize_cartesian_vector, + normalize_cartesian_vector_on_edges, zonal_and_meridional_components_on_edges, ) @@ -49,7 +49,7 @@ def cartesian_coordinates_of_edge_tangent( y = edge_orientation * (vertex_y(E2V[1]) - vertex_y(E2V[0])) z = edge_orientation * (vertex_z(E2V[1]) - vertex_z(E2V[0])) - return normalize_cartesian_vector(x, y, z) + return normalize_cartesian_vector_on_edges(x, y, z) @gtx.field_operator @@ -83,10 +83,10 @@ def cartesian_coordinates_of_edge_normal( edge_center_x, edge_center_y, edge_center_z = geographical_to_cartesian_on_edges( edge_lat, edge_lon ) - x, y, z = cross_product( + x, y, z = cross_product_on_edges( edge_center_x, edge_tangent_x, edge_center_y, edge_tangent_y, edge_center_z, edge_tangent_z ) - return normalize_cartesian_vector(x, y, z) + return normalize_cartesian_vector_on_edges(x, y, z) @gtx.field_operator diff --git a/model/common/src/icon4py/model/common/math/helpers.py b/model/common/src/icon4py/model/common/math/helpers.py index 26e4840a1a..1574071d51 100644 --- a/model/common/src/icon4py/model/common/math/helpers.py +++ b/model/common/src/icon4py/model/common/math/helpers.py @@ -187,7 +187,7 @@ def geographical_to_cartesian_on_vertex( @gtx.field_operator -def dot_product( +def dot_product_on_edges( x1: fa.EdgeField[ta.wpfloat], x2: fa.EdgeField[ta.wpfloat], y1: fa.EdgeField[ta.wpfloat], @@ -200,7 +200,20 @@ def dot_product( @gtx.field_operator -def cross_product( +def dot_product_on_cells( + x1: fa.CellField[ta.wpfloat], + x2: fa.CellField[ta.wpfloat], + y1: fa.CellField[ta.wpfloat], + y2: fa.CellField[ta.wpfloat], + z1: fa.CellField[ta.wpfloat], + z2: fa.CellField[ta.wpfloat], +) -> fa.CellField[ta.wpfloat]: + """Compute dot product of cartesian vectors (x1, y1, z1) * (x2, y2, z2)""" + return x1 * x2 + y1 * y2 + z1 * z2 + + +@gtx.field_operator +def cross_product_on_edges( x1: fa.EdgeField[ta.wpfloat], x2: fa.EdgeField[ta.wpfloat], y1: fa.EdgeField[ta.wpfloat], @@ -216,7 +229,7 @@ def cross_product( @gtx.field_operator -def norm2( +def norm2_on_edges( x: fa.EdgeField[ta.wpfloat], y: fa.EdgeField[ta.wpfloat], z: fa.EdgeField[ta.wpfloat] ) -> fa.EdgeField[ta.wpfloat]: """ @@ -230,11 +243,29 @@ def norm2( norma """ - return sqrt(dot_product(x, x, y, y, z, z)) + return sqrt(dot_product_on_edges(x, x, y, y, z, z)) + + +@gtx.field_operator +def norm2_on_cells( + x: fa.CellField[ta.wpfloat], y: fa.CellField[ta.wpfloat], z: fa.CellField[ta.wpfloat] +) -> fa.CellField[ta.wpfloat]: + """ + Compute 2 norm of a cartesian vector (x, y, z) + Args: + x: x coordinate + y: y coordinate + z: z coordinate + + Returns: + norma + + """ + return sqrt(dot_product_on_cells(x, x, y, y, z, z)) @gtx.field_operator -def normalize_cartesian_vector( +def normalize_cartesian_vector_on_edges( v_x: fa.EdgeField[ta.wpfloat], v_y: fa.EdgeField[ta.wpfloat], v_z: fa.EdgeField[ta.wpfloat] ) -> tuple[fa.EdgeField[ta.wpfloat], fa.EdgeField[ta.wpfloat], fa.EdgeField[ta.wpfloat]]: """ @@ -249,12 +280,12 @@ def normalize_cartesian_vector( normalized vector """ - norm = norm2(v_x, v_y, v_z) + norm = norm2_on_edges(v_x, v_y, v_z) return v_x / norm, v_y / norm, v_z / norm @gtx.field_operator -def invert(f: fa.EdgeField[ta.wpfloat]) -> fa.EdgeField[ta.wpfloat]: +def invert_edge_field(f: fa.EdgeField[ta.wpfloat]) -> fa.EdgeField[ta.wpfloat]: """ Invert values. Args: @@ -267,13 +298,13 @@ def invert(f: fa.EdgeField[ta.wpfloat]) -> fa.EdgeField[ta.wpfloat]: @gtx.program(grid_type=gtx.GridType.UNSTRUCTURED) -def compute_inverse( +def compute_inverse_on_edges( f: fa.EdgeField[ta.wpfloat], f_inverse: fa.EdgeField[ta.wpfloat], horizontal_start: gtx.int32, horizontal_end: gtx.int32, ): - invert(f, out=f_inverse, domain={dims.EdgeDim: (horizontal_start, horizontal_end)}) + invert_edge_field(f, out=f_inverse, domain={dims.EdgeDim: (horizontal_start, horizontal_end)}) @gtx.field_operator(grid_type=gtx.GridType.UNSTRUCTURED) @@ -389,8 +420,8 @@ def cartesian_coordinates_from_zonal_and_meridional_components_on_edges( y = u * cos_lon - v * sin_lat * sin_lon z = cos_lat * v - norm = norm2(x, y, z) - return x / norm, y / norm, y / norm + norm = norm2_on_edges(x, y, z) + return x / norm, y / norm, z / norm @gtx.program @@ -415,6 +446,60 @@ def compute_cartesian_coordinates_from_zonal_and_meridional_components_on_edges( ) +@gtx.field_operator +def cartesian_coordinates_from_zonal_and_meridional_components_on_cells( + lat: fa.CellField[ta.wpfloat], + lon: fa.CellField[ta.wpfloat], + u: fa.CellField[ta.wpfloat], + v: fa.CellField[ta.wpfloat], +) -> tuple[fa.CellField[ta.wpfloat], fa.CellField[ta.wpfloat], fa.CellField[ta.wpfloat]]: + """ + Compute cartesian coordinates form zonal an meridonal components at position (lat, lon) + Args: + lat: latitude + lon: longitude + u: zonal component + v: meridional component + + Returns: + x, y, z cartesian components + + """ + cos_lat = cos(lat) + sin_lat = sin(lat) + cos_lon = cos(lon) + sin_lon = sin(lon) + + x = -u * sin_lon - v * sin_lat * cos_lon + y = u * cos_lon - v * sin_lat * sin_lon + z = cos_lat * v + + norm = norm2_on_cells(x, y, z) + return x / norm, y / norm, z / norm + + +@gtx.program +def compute_cartesian_coordinates_from_zonal_and_meridional_components_on_cells( + cell_lat: fa.CellField[ta.wpfloat], + cell_lon: fa.CellField[ta.wpfloat], + u: fa.CellField[ta.wpfloat], + v: fa.CellField[ta.wpfloat], + x: fa.CellField[ta.wpfloat], + y: fa.CellField[ta.wpfloat], + z: fa.CellField[ta.wpfloat], + horizontal_start: gtx.int32, + horizontal_end: gtx.int32, +): + cartesian_coordinates_from_zonal_and_meridional_components_on_cells( + cell_lat, + cell_lon, + u, + v, + out=(x, y, z), + domain={dims.CellDim: (horizontal_start, horizontal_end)}, + ) + + @gtx.field_operator def arc_length( x0: fa.EdgeField[ta.wpfloat], @@ -443,4 +528,4 @@ def arc_length( arc length """ - return radius * arccos(dot_product(x0, x1, y0, y1, z0, z1)) + return radius * arccos(dot_product_on_edges(x0, x1, y0, y1, z0, z1)) diff --git a/model/common/tests/math_tests/test_helpers.py b/model/common/tests/math_tests/test_helpers.py index baf7011882..9c864e599d 100644 --- a/model/common/tests/math_tests/test_helpers.py +++ b/model/common/tests/math_tests/test_helpers.py @@ -25,7 +25,7 @@ def test_cross_product(backend): y = test_helpers.zero_field(mesh, dims.EdgeDim) z = test_helpers.zero_field(mesh, dims.EdgeDim) - helpers.cross_product.with_backend(backend)( + helpers.cross_product_on_edges.with_backend(backend)( x1, x2, y1, y2, z1, z2, out=(x, y, z), offset_provider={} ) a = xp.column_stack((x1.ndarray, y1.ndarray, z1.ndarray))