From 886b67899649b5f400ce5c5dad8ea513f9aec251 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Mon, 29 Jan 2024 14:01:00 +0100 Subject: [PATCH 01/60] fix comment --- .../atmosphere/dycore/set_two_cell_kdim_fields_to_zero_vp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/set_two_cell_kdim_fields_to_zero_vp.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/set_two_cell_kdim_fields_to_zero_vp.py index 5532061cd0..cae6f45cfe 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/set_two_cell_kdim_fields_to_zero_vp.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/set_two_cell_kdim_fields_to_zero_vp.py @@ -26,7 +26,7 @@ def _set_two_cell_kdim_fields_to_zero_vp() -> ( tuple[Field[[CellDim, KDim], vpfloat], Field[[CellDim, KDim], vpfloat]] ): - """Formerly known as_mo_solve_nonhydro_stencil_01.""" + """Formerly known as _mo_solve_nonhydro_stencil_01.""" return _set_cell_kdim_field_to_zero_vp(), _set_cell_kdim_field_to_zero_vp() From 832a0093e559567f7ad9aae476afe22808c99edf Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Mon, 29 Jan 2024 14:21:29 +0100 Subject: [PATCH 02/60] rename stencil --- ...ncil_02.py => extrapolate_temporally_exner_pressure.py} | 7 ++++--- .../atmosphere/dycore/nh_solve/solve_nonhydro_program.py | 6 +++--- ...02.py => test_extrapolate_temporally_exner_pressure.py} | 6 +++--- 3 files changed, 10 insertions(+), 9 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_02.py => extrapolate_temporally_exner_pressure.py} (91%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_02.py => test_extrapolate_temporally_exner_pressure.py} (92%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_02.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/extrapolate_temporally_exner_pressure.py similarity index 91% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_02.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/extrapolate_temporally_exner_pressure.py index f479bf1bf7..ae5a56845e 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_02.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/extrapolate_temporally_exner_pressure.py @@ -19,12 +19,13 @@ @field_operator -def _mo_solve_nonhydro_stencil_02( +def _extrapolate_temporally_exner_pressure( exner_exfac: Field[[CellDim, KDim], vpfloat], exner: Field[[CellDim, KDim], wpfloat], exner_ref_mc: Field[[CellDim, KDim], vpfloat], exner_pr: Field[[CellDim, KDim], wpfloat], ) -> tuple[Field[[CellDim, KDim], vpfloat], Field[[CellDim, KDim], wpfloat]]: + '''Formerly known as _mo_solve_nonhydro_stencil_02.''' exner_exfac_wp, exner_ref_mc_wp = astype((exner_exfac, exner_ref_mc), wpfloat) z_exner_ex_pr_wp = (wpfloat("1.0") + exner_exfac_wp) * ( @@ -35,7 +36,7 @@ def _mo_solve_nonhydro_stencil_02( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_02( +def extrapolate_temporally_exner_pressure( exner_exfac: Field[[CellDim, KDim], vpfloat], exner: Field[[CellDim, KDim], wpfloat], exner_ref_mc: Field[[CellDim, KDim], vpfloat], @@ -46,7 +47,7 @@ def mo_solve_nonhydro_stencil_02( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_02( + _extrapolate_temporally_exner_pressure( exner_exfac, exner, exner_ref_mc, 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/nh_solve/solve_nonhydro_program.py index 9b6cde3c8e..9c1faf2280 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/nh_solve/solve_nonhydro_program.py @@ -21,8 +21,8 @@ _compute_pertubation_of_rho_and_theta, ) from icon4py.model.atmosphere.dycore.extrapolate_at_top import _extrapolate_at_top -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_02 import ( - _mo_solve_nonhydro_stencil_02, +from icon4py.model.atmosphere.dycore.extrapolate_temporally_exner_pressure import ( + _extrapolate_temporally_exner_pressure, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_04 import ( _mo_solve_nonhydro_stencil_04, @@ -128,7 +128,7 @@ def _predictor_stencils_2_3( ) -> tuple[Field[[CellDim, KDim], float], Field[[CellDim, KDim], float]]: (z_exner_ex_pr, exner_pr) = where( (k_field >= int32(0)) & (k_field < nlev), - _mo_solve_nonhydro_stencil_02(exner_exfac, exner, exner_ref_mc, exner_pr), + _extrapolate_temporally_exner_pressure(exner_exfac, exner, exner_ref_mc, exner_pr), (z_exner_ex_pr, exner_pr), ) z_exner_ex_pr = where(k_field == nlev, _set_zero_c_k(), z_exner_ex_pr) diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_02.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_extrapolate_temporally_exner_pressure.py similarity index 92% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_02.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_extrapolate_temporally_exner_pressure.py index eef484e3d9..fb49617cfb 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_02.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_extrapolate_temporally_exner_pressure.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_02 import ( - mo_solve_nonhydro_stencil_02, +from icon4py.model.atmosphere.dycore.extrapolate_temporally_exner_pressure import ( + extrapolate_temporally_exner_pressure, ) from icon4py.model.common.dimension import CellDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil02(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_02 + PROGRAM = extrapolate_temporally_exner_pressure OUTPUTS = ("z_exner_ex_pr", "exner_pr") @staticmethod From d024930240b8783bbf585c5758d8a3bf7c40afb9 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Mon, 29 Jan 2024 15:29:33 +0100 Subject: [PATCH 03/60] rename stencil --- ...tencil_04.py => interpolate_to_surface.py} | 27 +++++++++--------- .../mo_solve_nonhydro_stencil_11_upper.py | 9 +++--- .../dycore/nh_solve/solve_nonhydro_program.py | 6 ++-- ...4.py => test_mo_interpolate_to_surface.py} | 28 +++++++++---------- 4 files changed, 35 insertions(+), 35 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_04.py => interpolate_to_surface.py} (68%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_04.py => test_mo_interpolate_to_surface.py} (58%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_04.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_to_surface.py similarity index 68% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_04.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_to_surface.py index 8d7d380629..fcd9be3a6f 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_04.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_to_surface.py @@ -20,32 +20,33 @@ @field_operator -def _mo_solve_nonhydro_stencil_04( +def _interpolate_to_surface( wgtfacq_c: Field[[CellDim, KDim], vpfloat], - z_exner_ex_pr: Field[[CellDim, KDim], vpfloat], + interpolant: Field[[CellDim, KDim], vpfloat], ) -> Field[[CellDim, KDim], vpfloat]: - z_exner_ic_vp = ( - wgtfacq_c(Koff[-1]) * z_exner_ex_pr(Koff[-1]) - + wgtfacq_c(Koff[-2]) * z_exner_ex_pr(Koff[-2]) - + wgtfacq_c(Koff[-3]) * z_exner_ex_pr(Koff[-3]) + '''Formerly known as _mo_solve_nonhydro_stencil_04.''' + interpolation_to_surface = ( + wgtfacq_c(Koff[-1]) * interpolant(Koff[-1]) + + wgtfacq_c(Koff[-2]) * interpolant(Koff[-2]) + + wgtfacq_c(Koff[-3]) * interpolant(Koff[-3]) ) - return z_exner_ic_vp + return interpolation_to_surface @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_04( +def interpolate_to_surface( wgtfacq_c: Field[[CellDim, KDim], vpfloat], - z_exner_ex_pr: Field[[CellDim, KDim], vpfloat], - z_exner_ic: Field[[CellDim, KDim], vpfloat], + interpolant: Field[[CellDim, KDim], vpfloat], + interpolation_to_surface: Field[[CellDim, KDim], vpfloat], horizontal_start: int32, horizontal_end: int32, vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_04( + _interpolate_to_surface( wgtfacq_c, - z_exner_ex_pr, - out=z_exner_ic, + interpolant, + out=interpolation_to_surface, domain={ CellDim: (horizontal_start, horizontal_end), KDim: (vertical_start, vertical_end), diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_11_upper.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_11_upper.py index c8e3b3bccc..aec38d2fa3 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_11_upper.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_11_upper.py @@ -17,6 +17,9 @@ from icon4py.model.common.dimension import CellDim, KDim, Koff from icon4py.model.common.type_alias import vpfloat, wpfloat +from icon4py.model.atmosphere.dycore.interpolate_to_surface import ( + _interpolate_to_surface, +) @field_operator @@ -26,11 +29,7 @@ def _mo_solve_nonhydro_stencil_11_upper( theta_ref_ic: Field[[CellDim, KDim], vpfloat], z_theta_v_pr_ic: Field[[CellDim, KDim], vpfloat], ) -> tuple[Field[[CellDim, KDim], vpfloat], Field[[CellDim, KDim], wpfloat]]: - z_theta_v_pr_ic_vp = ( - wgtfacq_c(Koff[-1]) * z_rth_pr(Koff[-1]) - + wgtfacq_c(Koff[-2]) * z_rth_pr(Koff[-2]) - + wgtfacq_c(Koff[-3]) * z_rth_pr(Koff[-3]) - ) + z_theta_v_pr_ic_vp = _interpolate_to_surface(wgtfacq_c=wgtfacq_c, interpolant=z_rth_pr) theta_v_ic_vp = theta_ref_ic + z_theta_v_pr_ic_vp return z_theta_v_pr_ic_vp, astype(theta_v_ic_vp, wpfloat) 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/nh_solve/solve_nonhydro_program.py index 9c1faf2280..7080ceb704 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/nh_solve/solve_nonhydro_program.py @@ -24,8 +24,8 @@ from icon4py.model.atmosphere.dycore.extrapolate_temporally_exner_pressure import ( _extrapolate_temporally_exner_pressure, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_04 import ( - _mo_solve_nonhydro_stencil_04, +from icon4py.model.atmosphere.dycore.interpolate_to_surface import ( + _interpolate_to_surface, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_05 import ( _mo_solve_nonhydro_stencil_05, @@ -180,7 +180,7 @@ def _predictor_stencils_4_5_6( # Perturbation Exner pressure on bottom half level z_exner_ic = where( k_field == nlev, - _mo_solve_nonhydro_stencil_04(wgtfacq_c_dsl, z_exner_ex_pr), + _interpolate_to_surface(wgtfacq_c_dsl, z_exner_ex_pr), z_exner_ic, ) diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_04.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_interpolate_to_surface.py similarity index 58% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_04.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_interpolate_to_surface.py index 083151aa89..736574e159 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_04.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_interpolate_to_surface.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_04 import ( - mo_solve_nonhydro_stencil_04, +from icon4py.model.atmosphere.dycore.interpolate_to_surface import ( + interpolate_to_surface, ) from icon4py.model.common.dimension import CellDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -24,30 +24,30 @@ class TestMoSolveNonhydroStencil04(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_04 - OUTPUTS = ("z_exner_ic",) + PROGRAM = interpolate_to_surface + OUTPUTS = ("interpolation_to_surface",) @staticmethod def reference( - grid, z_exner_ex_pr: np.array, wgtfacq_c: np.array, z_exner_ic: np.array, **kwargs + grid, interpolant: np.array, wgtfacq_c: np.array, interpolation_to_surface: np.array, **kwargs ) -> dict: - z_exner_ic[:, 3:] = ( - np.roll(wgtfacq_c, shift=1, axis=1) * np.roll(z_exner_ex_pr, shift=1, axis=1) - + np.roll(wgtfacq_c, shift=2, axis=1) * np.roll(z_exner_ex_pr, shift=2, axis=1) - + np.roll(wgtfacq_c, shift=3, axis=1) * np.roll(z_exner_ex_pr, shift=3, axis=1) + interpolation_to_surface[:, 3:] = ( + np.roll(wgtfacq_c, shift=1, axis=1) * np.roll(interpolant, shift=1, axis=1) + + np.roll(wgtfacq_c, shift=2, axis=1) * np.roll(interpolant, shift=2, axis=1) + + np.roll(wgtfacq_c, shift=3, axis=1) * np.roll(interpolant, shift=3, axis=1) )[:, 3:] - return dict(z_exner_ic=z_exner_ic) + return dict(interpolation_to_surface=interpolation_to_surface) @pytest.fixture def input_data(self, grid): - z_exner_ex_pr = random_field(grid, CellDim, KDim, dtype=vpfloat) + interpolant = random_field(grid, CellDim, KDim, dtype=vpfloat) wgtfacq_c = random_field(grid, CellDim, KDim, dtype=vpfloat) - z_exner_ic = zero_field(grid, CellDim, KDim, dtype=vpfloat) + interpolation_to_surface = zero_field(grid, CellDim, KDim, dtype=vpfloat) return dict( - z_exner_ex_pr=z_exner_ex_pr, + interpolant=interpolant, wgtfacq_c=wgtfacq_c, - z_exner_ic=z_exner_ic, + interpolation_to_surface=interpolation_to_surface, horizontal_start=int32(0), horizontal_end=int32(grid.num_cells), vertical_start=int32(3), From 1d5747d2eafb23c0212a50480786dd2ac95dc99e Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Mon, 29 Jan 2024 16:25:15 +0100 Subject: [PATCH 04/60] rename stencil --- ...05.py => interpolate_to_half_levels_vp.py} | 21 ++++++++------- .../dycore/mo_solve_nonhydro_stencil_09.py | 6 ++--- .../dycore/nh_solve/solve_nonhydro_program.py | 6 ++--- ... => test_interpolate_to_half_levels_vp.py} | 26 +++++++++---------- 4 files changed, 30 insertions(+), 29 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_05.py => interpolate_to_half_levels_vp.py} (69%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_05.py => test_interpolate_to_half_levels_vp.py} (58%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_05.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_to_half_levels_vp.py similarity index 69% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_05.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_to_half_levels_vp.py index 81ab5d87ee..73aaeac9ce 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_05.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_to_half_levels_vp.py @@ -20,28 +20,29 @@ @field_operator -def _mo_solve_nonhydro_stencil_05( +def _interpolate_to_half_levels_vp( wgtfac_c: Field[[CellDim, KDim], vpfloat], - z_exner_ex_pr: Field[[CellDim, KDim], vpfloat], + interpolant: Field[[CellDim, KDim], vpfloat], ) -> Field[[CellDim, KDim], vpfloat]: - z_exner_ic_vp = wgtfac_c * z_exner_ex_pr + (vpfloat("1.0") - wgtfac_c) * z_exner_ex_pr(Koff[-1]) - return z_exner_ic_vp + '''Formerly known as _mo_solve_nonhydro_stencil_05.''' + interpolation_to_half_levels_vp = wgtfac_c * interpolant + (vpfloat("1.0") - wgtfac_c) * interpolant(Koff[-1]) + return interpolation_to_half_levels_vp @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_05( +def interpolate_to_half_levels_vp( wgtfac_c: Field[[CellDim, KDim], vpfloat], - z_exner_ex_pr: Field[[CellDim, KDim], vpfloat], - z_exner_ic: Field[[CellDim, KDim], vpfloat], + interpolant: Field[[CellDim, KDim], vpfloat], + interpolation_to_half_levels_vp: Field[[CellDim, KDim], vpfloat], horizontal_start: int32, horizontal_end: int32, vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_05( + _interpolate_to_half_levels_vp( wgtfac_c, - z_exner_ex_pr, - out=z_exner_ic, + interpolant, + out=interpolation_to_half_levels_vp, domain={ CellDim: (horizontal_start, horizontal_end), KDim: (vertical_start, vertical_end), diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_09.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_09.py index 22138e7ab6..e91770ce78 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_09.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_09.py @@ -15,8 +15,8 @@ from gt4py.next.ffront.decorator import field_operator, program from gt4py.next.ffront.fbuiltins import Field, astype, int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_05 import ( - _mo_solve_nonhydro_stencil_05, +from icon4py.model.atmosphere.dycore.interpolate_to_half_levels_vp import ( + _interpolate_to_half_levels_vp, ) from icon4py.model.common.dimension import CellDim, KDim, Koff from icon4py.model.common.type_alias import vpfloat, wpfloat @@ -40,7 +40,7 @@ def _mo_solve_nonhydro_stencil_09( (wgtfac_c, z_rth_pr_2, d_exner_dz_ref_ic, ddqz_z_half), wpfloat ) - z_theta_v_pr_ic_vp = _mo_solve_nonhydro_stencil_05(wgtfac_c=wgtfac_c, z_exner_ex_pr=z_rth_pr_2) + z_theta_v_pr_ic_vp = _interpolate_to_half_levels_vp(wgtfac_c=wgtfac_c, interpolant=z_rth_pr_2) theta_v_ic_wp = wgtfac_c_wp * theta_v + (wpfloat("1.0") - wgtfac_c_wp) * theta_v(Koff[-1]) z_th_ddz_exner_c_wp = vwind_expl_wgt * theta_v_ic_wp * ( exner_pr(Koff[-1]) - exner_pr 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/nh_solve/solve_nonhydro_program.py index 7080ceb704..34e776d06e 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/nh_solve/solve_nonhydro_program.py @@ -27,8 +27,8 @@ from icon4py.model.atmosphere.dycore.interpolate_to_surface import ( _interpolate_to_surface, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_05 import ( - _mo_solve_nonhydro_stencil_05, +from icon4py.model.atmosphere.dycore.interpolate_to_half_levels_vp import ( + _interpolate_to_half_levels_vp, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_06 import ( _mo_solve_nonhydro_stencil_06, @@ -188,7 +188,7 @@ def _predictor_stencils_4_5_6( # possibly GZ will want to consider the cache ramifications of this change for CPU z_exner_ic = where( k_field < nlev, - _mo_solve_nonhydro_stencil_05(wgtfac_c, z_exner_ex_pr), + _interpolate_to_half_levels_vp(wgtfac_c, z_exner_ex_pr), z_exner_ic, ) diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_05.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_to_half_levels_vp.py similarity index 58% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_05.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_to_half_levels_vp.py index 2a97d1f044..d41e50264b 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_05.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_to_half_levels_vp.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_05 import ( - mo_solve_nonhydro_stencil_05, +from icon4py.model.atmosphere.dycore.interpolate_to_half_levels_vp import ( + interpolate_to_half_levels_vp, ) from icon4py.model.common.dimension import CellDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -24,26 +24,26 @@ class TestMoSolveNonhydroStencil05(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_05 - OUTPUTS = ("z_exner_ic",) + PROGRAM = interpolate_to_half_levels_vp + OUTPUTS = ("interpolation_to_half_levels_vp",) @staticmethod - def reference(grid, wgtfac_c: np.array, z_exner_ex_pr: np.array, **kwargs) -> dict: - z_exner_ex_pr_offset_1 = np.roll(z_exner_ex_pr, shift=1, axis=1) - z_exner_ic = wgtfac_c * z_exner_ex_pr + (1.0 - wgtfac_c) * z_exner_ex_pr_offset_1 - z_exner_ic[:, 0] = 0 - return dict(z_exner_ic=z_exner_ic) + def reference(grid, wgtfac_c: np.array, interpolant: np.array, **kwargs) -> dict: + interpolant_offset_1 = np.roll(interpolant, shift=1, axis=1) + interpolation_to_half_levels_vp = wgtfac_c * interpolant + (1.0 - wgtfac_c) * interpolant_offset_1 + interpolation_to_half_levels_vp[:, 0] = 0 + return dict(interpolation_to_half_levels_vp=interpolation_to_half_levels_vp) @pytest.fixture def input_data(self, grid): - z_exner_ex_pr = random_field(grid, CellDim, KDim, dtype=vpfloat) + interpolant = random_field(grid, CellDim, KDim, dtype=vpfloat) wgtfac_c = random_field(grid, CellDim, KDim, dtype=vpfloat) - z_exner_ic = zero_field(grid, CellDim, KDim, dtype=vpfloat) + interpolation_to_half_levels_vp = zero_field(grid, CellDim, KDim, dtype=vpfloat) return dict( wgtfac_c=wgtfac_c, - z_exner_ex_pr=z_exner_ex_pr, - z_exner_ic=z_exner_ic, + interpolant=interpolant, + interpolation_to_half_levels_vp=interpolation_to_half_levels_vp, horizontal_start=int32(0), horizontal_end=int32(grid.num_cells), vertical_start=int32(1), From ad1dc2ce4fadf836b35fc6171f53f2af4950ba89 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Mon, 29 Jan 2024 16:53:55 +0100 Subject: [PATCH 05/60] rename stencil --- ..._stencil_06.py => compute_first_vertical_derivative.py} | 7 ++++--- .../dycore/compute_pertubation_of_rho_and_theta.py | 2 +- .../atmosphere/dycore/mo_solve_nonhydro_stencil_08.py | 1 + .../atmosphere/dycore/nh_solve/solve_nonhydro_program.py | 6 +++--- ...cil_06.py => test_compute_first_vertical_derivative.py} | 6 +++--- 5 files changed, 12 insertions(+), 10 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_06.py => compute_first_vertical_derivative.py} (90%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_06.py => test_compute_first_vertical_derivative.py} (91%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_06.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_first_vertical_derivative.py similarity index 90% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_06.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_first_vertical_derivative.py index 54a48e770a..97ee2ab9dc 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_06.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_first_vertical_derivative.py @@ -20,16 +20,17 @@ @field_operator -def _mo_solve_nonhydro_stencil_06( +def _compute_first_vertical_derivative( z_exner_ic: Field[[CellDim, KDim], vpfloat], inv_ddqz_z_full: Field[[CellDim, KDim], vpfloat], ) -> Field[[CellDim, KDim], vpfloat]: + '''Formerly known as _mo_solve_nonhydro_stencil_06.''' z_dexner_dz_c_1 = (z_exner_ic - z_exner_ic(Koff[1])) * inv_ddqz_z_full return z_dexner_dz_c_1 @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_06( +def compute_first_vertical_derivative( z_exner_ic: Field[[CellDim, KDim], vpfloat], inv_ddqz_z_full: Field[[CellDim, KDim], vpfloat], z_dexner_dz_c_1: Field[[CellDim, KDim], vpfloat], @@ -38,7 +39,7 @@ def mo_solve_nonhydro_stencil_06( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_06( + _compute_first_vertical_derivative( z_exner_ic, inv_ddqz_z_full, out=z_dexner_dz_c_1, diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_pertubation_of_rho_and_theta.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_pertubation_of_rho_and_theta.py index 4f01570b00..6f92f98aed 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_pertubation_of_rho_and_theta.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_pertubation_of_rho_and_theta.py @@ -26,7 +26,7 @@ def _compute_pertubation_of_rho_and_theta( theta_v: Field[[CellDim, KDim], wpfloat], theta_ref_mc: Field[[CellDim, KDim], vpfloat], ) -> tuple[Field[[CellDim, KDim], vpfloat], Field[[CellDim, KDim], vpfloat]]: - """Formerly known as mo_solve_nonhydro_stencil_07 or mo_solve_nonhydro_stencil_13.""" + """Formerly known as _mo_solve_nonhydro_stencil_07 or _mo_solve_nonhydro_stencil_13.""" rho_ref_mc_wp, theta_ref_mc_wp = astype((rho_ref_mc, theta_ref_mc), wpfloat) z_rth_pr_1_wp = rho - rho_ref_mc_wp diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_08.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_08.py index 1adbe47c2d..ec022233a1 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_08.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_08.py @@ -34,6 +34,7 @@ def _mo_solve_nonhydro_stencil_08( Field[[CellDim, KDim], vpfloat], Field[[CellDim, KDim], vpfloat], ]: + '''Formerly known as _mo_solve_nonhydro_stencil_08.''' wgtfac_c_wp = astype(wgtfac_c, wpfloat) rho_ic = wgtfac_c_wp * rho + (wpfloat("1.0") - wgtfac_c_wp) * rho(Koff[-1]) 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/nh_solve/solve_nonhydro_program.py index 34e776d06e..2481dfd0c4 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/nh_solve/solve_nonhydro_program.py @@ -30,8 +30,8 @@ from icon4py.model.atmosphere.dycore.interpolate_to_half_levels_vp import ( _interpolate_to_half_levels_vp, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_06 import ( - _mo_solve_nonhydro_stencil_06, +from icon4py.model.atmosphere.dycore.compute_first_vertical_derivative import ( + _compute_first_vertical_derivative, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_08 import ( _mo_solve_nonhydro_stencil_08, @@ -195,7 +195,7 @@ def _predictor_stencils_4_5_6( # First vertical derivative of perturbation Exner pressure z_dexner_dz_c_1 = where( k_field < nlev, - _mo_solve_nonhydro_stencil_06(z_exner_ic, inv_ddqz_z_full), + _compute_first_vertical_derivative(z_exner_ic, inv_ddqz_z_full), z_dexner_dz_c_1, ) return z_exner_ic, z_dexner_dz_c_1 diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_06.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_first_vertical_derivative.py similarity index 91% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_06.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_first_vertical_derivative.py index 22bb373c89..f0d41658cb 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_06.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_first_vertical_derivative.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_06 import ( - mo_solve_nonhydro_stencil_06, +from icon4py.model.atmosphere.dycore.compute_first_vertical_derivative import ( + compute_first_vertical_derivative, ) from icon4py.model.common.dimension import CellDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil06(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_06 + PROGRAM = compute_first_vertical_derivative OUTPUTS = ("z_dexner_dz_c_1",) @staticmethod From 641b24215687f44d16e3575b2c4a7d4810faeba7 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Mon, 29 Jan 2024 17:03:39 +0100 Subject: [PATCH 06/60] rename stencils --- ...> compute_pertubation_of_rho_and_theta_and_rho_at_ic.py} | 6 +++--- .../atmosphere/dycore/nh_solve/solve_nonhydro_program.py | 6 +++--- ...t_compute_pertubation_of_rho_and_theta_and_rho_at_ic.py} | 6 +++--- tools/tests/liskov/fortran_samples.py | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_08.py => compute_pertubation_of_rho_and_theta_and_rho_at_ic.py} (93%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_08.py => test_compute_pertubation_of_rho_and_theta_and_rho_at_ic.py} (92%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_08.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_pertubation_of_rho_and_theta_and_rho_at_ic.py similarity index 93% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_08.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_pertubation_of_rho_and_theta_and_rho_at_ic.py index ec022233a1..6a04b132ea 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_08.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_pertubation_of_rho_and_theta_and_rho_at_ic.py @@ -23,7 +23,7 @@ @field_operator -def _mo_solve_nonhydro_stencil_08( +def _compute_pertubation_of_rho_and_theta_and_rho_at_ic( wgtfac_c: Field[[CellDim, KDim], vpfloat], rho: Field[[CellDim, KDim], wpfloat], rho_ref_mc: Field[[CellDim, KDim], vpfloat], @@ -45,7 +45,7 @@ def _mo_solve_nonhydro_stencil_08( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_08( +def compute_pertubation_of_rho_and_theta_and_rho_at_ic( wgtfac_c: Field[[CellDim, KDim], vpfloat], rho: Field[[CellDim, KDim], wpfloat], rho_ref_mc: Field[[CellDim, KDim], vpfloat], @@ -59,7 +59,7 @@ def mo_solve_nonhydro_stencil_08( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_08( + _compute_pertubation_of_rho_and_theta_and_rho_at_ic( wgtfac_c, rho, rho_ref_mc, 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/nh_solve/solve_nonhydro_program.py index 2481dfd0c4..32995ff9b9 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/nh_solve/solve_nonhydro_program.py @@ -33,8 +33,8 @@ from icon4py.model.atmosphere.dycore.compute_first_vertical_derivative import ( _compute_first_vertical_derivative, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_08 import ( - _mo_solve_nonhydro_stencil_08, +from icon4py.model.atmosphere.dycore.compute_pertubation_of_rho_and_theta_and_rho_at_ic import ( + _compute_pertubation_of_rho_and_theta_and_rho_at_ic, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_09 import ( _mo_solve_nonhydro_stencil_09, @@ -268,7 +268,7 @@ def _predictor_stencils_7_8_9( (rho_ic, z_rth_pr_1, z_rth_pr_2) = where( k_field >= int32(1), - _mo_solve_nonhydro_stencil_08(wgtfac_c, rho, rho_ref_mc, theta_v, theta_ref_mc), + _compute_pertubation_of_rho_and_theta_and_rho_at_ic(wgtfac_c, rho, rho_ref_mc, theta_v, theta_ref_mc), (rho_ic, z_rth_pr_1, z_rth_pr_2), ) diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_08.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_pertubation_of_rho_and_theta_and_rho_at_ic.py similarity index 92% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_08.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_pertubation_of_rho_and_theta_and_rho_at_ic.py index b5c583a1a1..c11063b70d 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_08.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_pertubation_of_rho_and_theta_and_rho_at_ic.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_08 import ( - mo_solve_nonhydro_stencil_08, +from icon4py.model.atmosphere.dycore.compute_pertubation_of_rho_and_theta_and_rho_at_ic import ( + compute_pertubation_of_rho_and_theta_and_rho_at_ic, ) from icon4py.model.common.dimension import CellDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil08(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_08 + PROGRAM = compute_pertubation_of_rho_and_theta_and_rho_at_ic OUTPUTS = ("rho_ic", "z_rth_pr_1", "z_rth_pr_2") @pytest.fixture diff --git a/tools/tests/liskov/fortran_samples.py b/tools/tests/liskov/fortran_samples.py index da2b056f3b..6393b426c0 100644 --- a/tools/tests/liskov/fortran_samples.py +++ b/tools/tests/liskov/fortran_samples.py @@ -128,7 +128,7 @@ !$DSL z_rth_pr_1=nproma,p_patch%nlev,p_patch%nblks_c; z_rth_pr_2=nproma,p_patch%nlev,p_patch%nblks_c; & !$DSL rho_ic=nproma,p_patch%nlev,p_patch%nblks_c) - !$DSL START STENCIL(name=mo_solve_nonhydro_stencil_08; wgtfac_c=p_nh%metrics%wgtfac_c(:,:,1); rho=p_nh%prog(nnow)%rho(:,:,1); rho_ref_mc=p_nh%metrics%rho_ref_mc(:,:,1); & + !$DSL START STENCIL(name=compute_pertubation_of_rho_and_theta_and_rho_at_ic; wgtfac_c=p_nh%metrics%wgtfac_c(:,:,1); rho=p_nh%prog(nnow)%rho(:,:,1); rho_ref_mc=p_nh%metrics%rho_ref_mc(:,:,1); & !$DSL theta_v=p_nh%prog(nnow)%theta_v(:,:,1); theta_ref_mc=p_nh%metrics%theta_ref_mc(:,:,1); rho_ic=p_nh%diag%rho_ic(:,:,1); z_rth_pr_1=z_rth_pr(:,:,1,1); & !$DSL z_rth_pr_2=z_rth_pr(:,:,1,2); vertical_lower=2; vertical_upper=nlev; horizontal_lower=i_startidx; horizontal_upper=i_endidx) !$ACC PARALLEL IF(i_am_accel_node) DEFAULT(NONE) ASYNC(1) @@ -155,7 +155,7 @@ !$ACC END PARALLEL #endif - !$DSL END STENCIL(name=mo_solve_nonhydro_stencil_08) + !$DSL END STENCIL(name=compute_pertubation_of_rho_and_theta_and_rho_at_ic) !$DSL START STENCIL(name=apply_nabla2_to_vn_in_lateral_boundary; & From d9419c75f03be6c4187e0f442805cd25f39a625c Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Mon, 29 Jan 2024 17:32:10 +0100 Subject: [PATCH 07/60] rename stencil --- ..._and_theta_v_at_ic_and_pressure_gradient_theta.py} | 11 +++++------ .../dycore/nh_solve/solve_nonhydro_program.py | 6 +++--- ..._and_theta_v_at_ic_and_pressure_gradient_theta.py} | 6 +++--- 3 files changed, 11 insertions(+), 12 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_09.py => compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py} (88%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_09.py => test_compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py} (92%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_09.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py similarity index 88% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_09.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py index e91770ce78..ed3253ceec 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_09.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py @@ -23,7 +23,7 @@ @field_operator -def _mo_solve_nonhydro_stencil_09( +def _compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta( wgtfac_c: Field[[CellDim, KDim], vpfloat], z_rth_pr_2: Field[[CellDim, KDim], vpfloat], theta_v: Field[[CellDim, KDim], wpfloat], @@ -36,9 +36,8 @@ def _mo_solve_nonhydro_stencil_09( Field[[CellDim, KDim], wpfloat], Field[[CellDim, KDim], vpfloat], ]: - wgtfac_c_wp, z_rth_pr_2_wp, d_exner_dz_ref_ic_wp, ddqz_z_half_wp = astype( - (wgtfac_c, z_rth_pr_2, d_exner_dz_ref_ic, ddqz_z_half), wpfloat - ) + '''Formerly known as _mo_solve_nonhydro_stencil_09.''' + wgtfac_c_wp, ddqz_z_half_wp = astype( (wgtfac_c, ddqz_z_half), wpfloat ) z_theta_v_pr_ic_vp = _interpolate_to_half_levels_vp(wgtfac_c=wgtfac_c, interpolant=z_rth_pr_2) theta_v_ic_wp = wgtfac_c_wp * theta_v + (wpfloat("1.0") - wgtfac_c_wp) * theta_v(Koff[-1]) @@ -49,7 +48,7 @@ def _mo_solve_nonhydro_stencil_09( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_09( +def compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta( wgtfac_c: Field[[CellDim, KDim], vpfloat], z_rth_pr_2: Field[[CellDim, KDim], vpfloat], theta_v: Field[[CellDim, KDim], wpfloat], @@ -65,7 +64,7 @@ def mo_solve_nonhydro_stencil_09( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_09( + _compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta( wgtfac_c, z_rth_pr_2, theta_v, 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/nh_solve/solve_nonhydro_program.py index 32995ff9b9..ccecbf2802 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/nh_solve/solve_nonhydro_program.py @@ -36,8 +36,8 @@ from icon4py.model.atmosphere.dycore.compute_pertubation_of_rho_and_theta_and_rho_at_ic import ( _compute_pertubation_of_rho_and_theta_and_rho_at_ic, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_09 import ( - _mo_solve_nonhydro_stencil_09, +from icon4py.model.atmosphere.dycore. import ( + _, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_11_upper import ( _mo_solve_nonhydro_stencil_11_upper, @@ -274,7 +274,7 @@ def _predictor_stencils_7_8_9( (z_theta_v_pr_ic, theta_v_ic, z_th_ddz_exner_c) = where( k_field >= int32(1), - _mo_solve_nonhydro_stencil_09( + _( wgtfac_c, z_rth_pr_2, theta_v, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_09.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py similarity index 92% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_09.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py index 41419ad357..ecc3b76e43 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_09.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_09 import ( - mo_solve_nonhydro_stencil_09, +from icon4py.model.atmosphere.dycore.compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta import ( + compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta, ) from icon4py.model.common.dimension import CellDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil09(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_09 + PROGRAM = compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta OUTPUTS = ("z_theta_v_pr_ic", "theta_v_ic", "z_th_ddz_exner_c") @staticmethod From aa9c1120b684fddee052ec56768e87caf678f18c Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Mon, 29 Jan 2024 17:45:25 +0100 Subject: [PATCH 08/60] rename stencil --- ...at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py} | 7 ++++--- .../dycore/mo_solve_nonhydro_stencil_11_upper.py | 1 + .../model/atmosphere/dycore/nh_solve/solve_nonhydro.py | 6 +++--- ...at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py} | 6 +++--- 4 files changed, 11 insertions(+), 9 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_10.py => compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py} (93%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_10.py => test_compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py} (94%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_10.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py similarity index 93% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_10.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py index 49afa5ec79..d58be5786b 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_10.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py @@ -20,7 +20,7 @@ @field_operator -def _mo_solve_nonhydro_stencil_10( +def _compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta( w: Field[[CellDim, KDim], wpfloat], w_concorr_c: Field[[CellDim, KDim], vpfloat], ddqz_z_half: Field[[CellDim, KDim], vpfloat], @@ -42,6 +42,7 @@ def _mo_solve_nonhydro_stencil_10( Field[[CellDim, KDim], wpfloat], Field[[CellDim, KDim], vpfloat], ]: + '''Formerly known as _mo_solve_nonhydro_stencil_10.''' w_concorr_c_wp, wgtfac_c_wp, theta_ref_mc_wp, ddqz_z_half_wp = astype( (w_concorr_c, wgtfac_c, theta_ref_mc, ddqz_z_half), wpfloat ) @@ -83,7 +84,7 @@ def _mo_solve_nonhydro_stencil_10( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_10( +def compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta( w: Field[[CellDim, KDim], wpfloat], w_concorr_c: Field[[CellDim, KDim], vpfloat], ddqz_z_half: Field[[CellDim, KDim], vpfloat], @@ -108,7 +109,7 @@ def mo_solve_nonhydro_stencil_10( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_10( + _compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta( w, w_concorr_c, ddqz_z_half, diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_11_upper.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_11_upper.py index aec38d2fa3..dad3c7fd26 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_11_upper.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_11_upper.py @@ -29,6 +29,7 @@ def _mo_solve_nonhydro_stencil_11_upper( theta_ref_ic: Field[[CellDim, KDim], vpfloat], z_theta_v_pr_ic: Field[[CellDim, KDim], vpfloat], ) -> tuple[Field[[CellDim, KDim], vpfloat], Field[[CellDim, KDim], wpfloat]]: + '''Formerly known as _mo_solve_nonhydro_stencil_11_upper.''' z_theta_v_pr_ic_vp = _interpolate_to_surface(wgtfacq_c=wgtfacq_c, interpolant=z_rth_pr) theta_v_ic_vp = theta_ref_ic + z_theta_v_pr_ic_vp return z_theta_v_pr_ic_vp, astype(theta_v_ic_vp, wpfloat) 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/nh_solve/solve_nonhydro.py index 8ca2d9bca6..34cb0a57f2 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -34,8 +34,8 @@ from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_4th_order_divdamp import ( mo_solve_nonhydro_4th_order_divdamp, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_10 import ( - mo_solve_nonhydro_stencil_10, +from icon4py.model.atmosphere.dycore.compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta import ( + compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_12 import ( mo_solve_nonhydro_stencil_12, @@ -1519,7 +1519,7 @@ def run_corrector_step( offset_provider={}, ) log.debug(f"corrector: start stencil 10") - mo_solve_nonhydro_stencil_10.with_backend(backend)( + compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.with_backend(backend)( w=prognostic_state[nnew].w, w_concorr_c=diagnostic_state_nh.w_concorr_c, ddqz_z_half=self.metric_state_nonhydro.ddqz_z_half, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_10.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py similarity index 94% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_10.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py index d79f88f994..fb5049fb4e 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_10.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_10 import ( - mo_solve_nonhydro_stencil_10, +from icon4py.model.atmosphere.dycore.compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta import ( + compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta, ) from icon4py.model.common.dimension import CellDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil10(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_10 + PROGRAM = compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta OUTPUTS = ("rho_ic", "z_theta_v_pr_ic", "theta_v_ic", "z_th_ddz_exner_c") @staticmethod From 6ed83b7080d8c3ca98ee7616a92c6ceac30367d1 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Mon, 29 Jan 2024 17:59:27 +0100 Subject: [PATCH 09/60] cleanup stencil --- .../atmosphere/dycore/mo_solve_nonhydro_stencil_11_upper.py | 2 -- .../atmosphere/dycore/nh_solve/solve_nonhydro_program.py | 2 +- .../test_mo_solve_nonhydro_stencil_11_upper.py | 5 ++--- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_11_upper.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_11_upper.py index dad3c7fd26..002a85d96f 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_11_upper.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_11_upper.py @@ -27,7 +27,6 @@ def _mo_solve_nonhydro_stencil_11_upper( wgtfacq_c: Field[[CellDim, KDim], vpfloat], z_rth_pr: Field[[CellDim, KDim], vpfloat], theta_ref_ic: Field[[CellDim, KDim], vpfloat], - z_theta_v_pr_ic: Field[[CellDim, KDim], vpfloat], ) -> tuple[Field[[CellDim, KDim], vpfloat], Field[[CellDim, KDim], wpfloat]]: '''Formerly known as _mo_solve_nonhydro_stencil_11_upper.''' z_theta_v_pr_ic_vp = _interpolate_to_surface(wgtfacq_c=wgtfacq_c, interpolant=z_rth_pr) @@ -51,7 +50,6 @@ def mo_solve_nonhydro_stencil_11_upper( wgtfacq_c, z_rth_pr, theta_ref_ic, - z_theta_v_pr_ic, out=(z_theta_v_pr_ic, theta_v_ic), domain={ CellDim: (horizontal_start, horizontal_end), 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/nh_solve/solve_nonhydro_program.py index ccecbf2802..5256955483 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/nh_solve/solve_nonhydro_program.py @@ -360,7 +360,7 @@ def _predictor_stencils_11_lower_upper( (z_theta_v_pr_ic, theta_v_ic) = where( k_field == nlev, - _mo_solve_nonhydro_stencil_11_upper(wgtfacq_c_dsl, z_rth_pr, theta_ref_ic, z_theta_v_pr_ic), + _mo_solve_nonhydro_stencil_11_upper(wgtfacq_c_dsl, z_rth_pr, theta_ref_ic), (z_theta_v_pr_ic, theta_v_ic), ) return z_theta_v_pr_ic, theta_v_ic diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_11_upper.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_11_upper.py index 3c4b9135c6..51c04a464a 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_11_upper.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_11_upper.py @@ -33,16 +33,15 @@ def reference( wgtfacq_c: np.array, z_rth_pr: np.array, theta_ref_ic: np.array, - z_theta_v_pr_ic: np.array, **kwargs, ) -> tuple[np.array, np.array]: - z_theta_v_pr_ic_ref = np.copy(z_theta_v_pr_ic) + z_theta_v_pr_ic_ref = np.copy(theta_ref_ic) z_theta_v_pr_ic_ref[:, -1] = ( np.roll(wgtfacq_c, shift=1, axis=1) * np.roll(z_rth_pr, shift=1, axis=1) + np.roll(wgtfacq_c, shift=2, axis=1) * np.roll(z_rth_pr, shift=2, axis=1) + np.roll(wgtfacq_c, shift=3, axis=1) * np.roll(z_rth_pr, shift=3, axis=1) )[:, -1] - theta_v_ic = np.zeros_like(z_theta_v_pr_ic) + theta_v_ic = np.zeros_like(theta_ref_ic) theta_v_ic[:, -1] = (theta_ref_ic + z_theta_v_pr_ic_ref)[:, -1] return dict(z_theta_v_pr_ic=z_theta_v_pr_ic_ref, theta_v_ic=theta_v_ic) From 73624e431e3daeaf75ca65c463f110298753d457 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Mon, 29 Jan 2024 18:01:08 +0100 Subject: [PATCH 10/60] fix style --- .../compute_first_vertical_derivative.py | 2 +- ...tubation_of_rho_and_theta_and_rho_at_ic.py | 2 +- ...eta_v_at_ic_and_pressure_gradient_theta.py | 2 +- ...eta_v_at_ic_and_pressure_gradient_theta.py | 4 ++-- .../extrapolate_temporally_exner_pressure.py | 2 +- .../dycore/interpolate_to_half_levels_vp.py | 6 ++++-- .../dycore/interpolate_to_surface.py | 2 +- .../mo_solve_nonhydro_stencil_11_upper.py | 6 ++---- .../dycore/nh_solve/solve_nonhydro.py | 10 ++++++---- .../dycore/nh_solve/solve_nonhydro_program.py | 20 ++++++++----------- ...eta_v_at_ic_and_pressure_gradient_theta.py | 4 +++- .../test_interpolate_to_half_levels_vp.py | 4 +++- .../test_mo_interpolate_to_surface.py | 10 ++++++---- 13 files changed, 39 insertions(+), 35 deletions(-) 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/compute_first_vertical_derivative.py index 97ee2ab9dc..2ce4552efb 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_first_vertical_derivative.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_first_vertical_derivative.py @@ -24,7 +24,7 @@ def _compute_first_vertical_derivative( z_exner_ic: Field[[CellDim, KDim], vpfloat], inv_ddqz_z_full: Field[[CellDim, KDim], vpfloat], ) -> Field[[CellDim, KDim], vpfloat]: - '''Formerly known as _mo_solve_nonhydro_stencil_06.''' + """Formerly known as _mo_solve_nonhydro_stencil_06.""" z_dexner_dz_c_1 = (z_exner_ic - z_exner_ic(Koff[1])) * inv_ddqz_z_full return z_dexner_dz_c_1 diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_pertubation_of_rho_and_theta_and_rho_at_ic.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_pertubation_of_rho_and_theta_and_rho_at_ic.py index 6a04b132ea..a9c5017f9e 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_pertubation_of_rho_and_theta_and_rho_at_ic.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_pertubation_of_rho_and_theta_and_rho_at_ic.py @@ -34,7 +34,7 @@ def _compute_pertubation_of_rho_and_theta_and_rho_at_ic( Field[[CellDim, KDim], vpfloat], Field[[CellDim, KDim], vpfloat], ]: - '''Formerly known as _mo_solve_nonhydro_stencil_08.''' + """Formerly known as _mo_solve_nonhydro_stencil_08.""" wgtfac_c_wp = astype(wgtfac_c, wpfloat) rho_ic = wgtfac_c_wp * rho + (wpfloat("1.0") - wgtfac_c_wp) * rho(Koff[-1]) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py index d58be5786b..cbd03371c4 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py @@ -42,7 +42,7 @@ def _compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gr Field[[CellDim, KDim], wpfloat], Field[[CellDim, KDim], vpfloat], ]: - '''Formerly known as _mo_solve_nonhydro_stencil_10.''' + """Formerly known as _mo_solve_nonhydro_stencil_10.""" w_concorr_c_wp, wgtfac_c_wp, theta_ref_mc_wp, ddqz_z_half_wp = astype( (w_concorr_c, wgtfac_c, theta_ref_mc, ddqz_z_half), wpfloat ) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py index ed3253ceec..cf3328f0ed 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py @@ -36,8 +36,8 @@ def _compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta( Field[[CellDim, KDim], wpfloat], Field[[CellDim, KDim], vpfloat], ]: - '''Formerly known as _mo_solve_nonhydro_stencil_09.''' - wgtfac_c_wp, ddqz_z_half_wp = astype( (wgtfac_c, ddqz_z_half), wpfloat ) + """Formerly known as _mo_solve_nonhydro_stencil_09.""" + wgtfac_c_wp, ddqz_z_half_wp = astype((wgtfac_c, ddqz_z_half), wpfloat) z_theta_v_pr_ic_vp = _interpolate_to_half_levels_vp(wgtfac_c=wgtfac_c, interpolant=z_rth_pr_2) theta_v_ic_wp = wgtfac_c_wp * theta_v + (wpfloat("1.0") - wgtfac_c_wp) * theta_v(Koff[-1]) 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/extrapolate_temporally_exner_pressure.py index ae5a56845e..dcf62c4342 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/extrapolate_temporally_exner_pressure.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/extrapolate_temporally_exner_pressure.py @@ -25,7 +25,7 @@ def _extrapolate_temporally_exner_pressure( exner_ref_mc: Field[[CellDim, KDim], vpfloat], exner_pr: Field[[CellDim, KDim], wpfloat], ) -> tuple[Field[[CellDim, KDim], vpfloat], Field[[CellDim, KDim], wpfloat]]: - '''Formerly known as _mo_solve_nonhydro_stencil_02.''' + """Formerly known as _mo_solve_nonhydro_stencil_02.""" exner_exfac_wp, exner_ref_mc_wp = astype((exner_exfac, exner_ref_mc), wpfloat) z_exner_ex_pr_wp = (wpfloat("1.0") + exner_exfac_wp) * ( 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/interpolate_to_half_levels_vp.py index 73aaeac9ce..669a539c62 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_to_half_levels_vp.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_to_half_levels_vp.py @@ -24,8 +24,10 @@ def _interpolate_to_half_levels_vp( wgtfac_c: Field[[CellDim, KDim], vpfloat], interpolant: Field[[CellDim, KDim], vpfloat], ) -> Field[[CellDim, KDim], vpfloat]: - '''Formerly known as _mo_solve_nonhydro_stencil_05.''' - interpolation_to_half_levels_vp = wgtfac_c * interpolant + (vpfloat("1.0") - wgtfac_c) * interpolant(Koff[-1]) + """Formerly known as _mo_solve_nonhydro_stencil_05.""" + interpolation_to_half_levels_vp = wgtfac_c * interpolant + ( + vpfloat("1.0") - wgtfac_c + ) * interpolant(Koff[-1]) return interpolation_to_half_levels_vp diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_to_surface.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_to_surface.py index fcd9be3a6f..7dd11e0f53 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_to_surface.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_to_surface.py @@ -24,7 +24,7 @@ def _interpolate_to_surface( wgtfacq_c: Field[[CellDim, KDim], vpfloat], interpolant: Field[[CellDim, KDim], vpfloat], ) -> Field[[CellDim, KDim], vpfloat]: - '''Formerly known as _mo_solve_nonhydro_stencil_04.''' + """Formerly known as _mo_solve_nonhydro_stencil_04.""" interpolation_to_surface = ( wgtfacq_c(Koff[-1]) * interpolant(Koff[-1]) + wgtfacq_c(Koff[-2]) * interpolant(Koff[-2]) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_11_upper.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_11_upper.py index 002a85d96f..155f9944a2 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_11_upper.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_11_upper.py @@ -15,11 +15,9 @@ from gt4py.next.ffront.decorator import field_operator, program from gt4py.next.ffront.fbuiltins import Field, astype, int32 +from icon4py.model.atmosphere.dycore.interpolate_to_surface import _interpolate_to_surface from icon4py.model.common.dimension import CellDim, KDim, Koff from icon4py.model.common.type_alias import vpfloat, wpfloat -from icon4py.model.atmosphere.dycore.interpolate_to_surface import ( - _interpolate_to_surface, -) @field_operator @@ -28,7 +26,7 @@ def _mo_solve_nonhydro_stencil_11_upper( z_rth_pr: Field[[CellDim, KDim], vpfloat], theta_ref_ic: Field[[CellDim, KDim], vpfloat], ) -> tuple[Field[[CellDim, KDim], vpfloat], Field[[CellDim, KDim], wpfloat]]: - '''Formerly known as _mo_solve_nonhydro_stencil_11_upper.''' + """Formerly known as _mo_solve_nonhydro_stencil_11_upper.""" z_theta_v_pr_ic_vp = _interpolate_to_surface(wgtfacq_c=wgtfacq_c, interpolant=z_rth_pr) theta_v_ic_vp = theta_ref_ic + z_theta_v_pr_ic_vp return z_theta_v_pr_ic_vp, astype(theta_v_ic_vp, wpfloat) 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/nh_solve/solve_nonhydro.py index 34cb0a57f2..028619a7a4 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -24,6 +24,9 @@ from icon4py.model.atmosphere.dycore.compute_pertubation_of_rho_and_theta import ( compute_pertubation_of_rho_and_theta, ) +from icon4py.model.atmosphere.dycore.compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta import ( + compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta, +) from icon4py.model.atmosphere.dycore.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 ( mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl, @@ -34,9 +37,6 @@ from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_4th_order_divdamp import ( mo_solve_nonhydro_4th_order_divdamp, ) -from icon4py.model.atmosphere.dycore.compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta import ( - compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta, -) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_12 import ( mo_solve_nonhydro_stencil_12, ) @@ -1519,7 +1519,9 @@ def run_corrector_step( offset_provider={}, ) log.debug(f"corrector: start stencil 10") - compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.with_backend(backend)( + compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.with_backend( + backend + )( w=prognostic_state[nnew].w, w_concorr_c=diagnostic_state_nh.w_concorr_c, ddqz_z_half=self.metric_state_nonhydro.ddqz_z_half, 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/nh_solve/solve_nonhydro_program.py index 5256955483..a5cc6bf49d 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/nh_solve/solve_nonhydro_program.py @@ -14,31 +14,27 @@ from gt4py.next.ffront.decorator import field_operator, program from gt4py.next.ffront.fbuiltins import int32, where +from icon4py.model.atmosphere.dycore. import _ from icon4py.model.atmosphere.dycore.compute_contravariant_correction import ( _compute_contravariant_correction, ) +from icon4py.model.atmosphere.dycore.compute_first_vertical_derivative import ( + _compute_first_vertical_derivative, +) from icon4py.model.atmosphere.dycore.compute_pertubation_of_rho_and_theta import ( _compute_pertubation_of_rho_and_theta, ) +from icon4py.model.atmosphere.dycore.compute_pertubation_of_rho_and_theta_and_rho_at_ic import ( + _compute_pertubation_of_rho_and_theta_and_rho_at_ic, +) from icon4py.model.atmosphere.dycore.extrapolate_at_top import _extrapolate_at_top from icon4py.model.atmosphere.dycore.extrapolate_temporally_exner_pressure import ( _extrapolate_temporally_exner_pressure, ) -from icon4py.model.atmosphere.dycore.interpolate_to_surface import ( - _interpolate_to_surface, -) from icon4py.model.atmosphere.dycore.interpolate_to_half_levels_vp import ( _interpolate_to_half_levels_vp, ) -from icon4py.model.atmosphere.dycore.compute_first_vertical_derivative import ( - _compute_first_vertical_derivative, -) -from icon4py.model.atmosphere.dycore.compute_pertubation_of_rho_and_theta_and_rho_at_ic import ( - _compute_pertubation_of_rho_and_theta_and_rho_at_ic, -) -from icon4py.model.atmosphere.dycore. import ( - _, -) +from icon4py.model.atmosphere.dycore.interpolate_to_surface import _interpolate_to_surface from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_11_upper import ( _mo_solve_nonhydro_stencil_11_upper, ) diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py index fb5049fb4e..4dfab758df 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py @@ -24,7 +24,9 @@ class TestMoSolveNonhydroStencil10(StencilTest): - PROGRAM = compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta + PROGRAM = ( + compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta + ) OUTPUTS = ("rho_ic", "z_theta_v_pr_ic", "theta_v_ic", "z_th_ddz_exner_c") @staticmethod 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 d41e50264b..ed91de6801 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 @@ -30,7 +30,9 @@ class TestMoSolveNonhydroStencil05(StencilTest): @staticmethod def reference(grid, wgtfac_c: np.array, interpolant: np.array, **kwargs) -> dict: interpolant_offset_1 = np.roll(interpolant, shift=1, axis=1) - interpolation_to_half_levels_vp = wgtfac_c * interpolant + (1.0 - wgtfac_c) * interpolant_offset_1 + interpolation_to_half_levels_vp = ( + wgtfac_c * interpolant + (1.0 - wgtfac_c) * interpolant_offset_1 + ) interpolation_to_half_levels_vp[:, 0] = 0 return dict(interpolation_to_half_levels_vp=interpolation_to_half_levels_vp) diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_interpolate_to_surface.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_interpolate_to_surface.py index 736574e159..405de41d71 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_interpolate_to_surface.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_interpolate_to_surface.py @@ -15,9 +15,7 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.interpolate_to_surface import ( - interpolate_to_surface, -) +from icon4py.model.atmosphere.dycore.interpolate_to_surface import interpolate_to_surface from icon4py.model.common.dimension import CellDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field from icon4py.model.common.type_alias import vpfloat @@ -29,7 +27,11 @@ class TestMoSolveNonhydroStencil04(StencilTest): @staticmethod def reference( - grid, interpolant: np.array, wgtfacq_c: np.array, interpolation_to_surface: np.array, **kwargs + grid, + interpolant: np.array, + wgtfacq_c: np.array, + interpolation_to_surface: np.array, + **kwargs, ) -> dict: interpolation_to_surface[:, 3:] = ( np.roll(wgtfacq_c, shift=1, axis=1) * np.roll(interpolant, shift=1, axis=1) From 18772583a3c10744462d3393758106d24721191a Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Mon, 29 Jan 2024 18:06:35 +0100 Subject: [PATCH 11/60] fix programm --- .../atmosphere/dycore/nh_solve/solve_nonhydro_program.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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/nh_solve/solve_nonhydro_program.py index 5256955483..fce369a5af 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/nh_solve/solve_nonhydro_program.py @@ -37,7 +37,7 @@ _compute_pertubation_of_rho_and_theta_and_rho_at_ic, ) from icon4py.model.atmosphere.dycore. import ( - _, + _compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_11_upper import ( _mo_solve_nonhydro_stencil_11_upper, @@ -274,7 +274,7 @@ def _predictor_stencils_7_8_9( (z_theta_v_pr_ic, theta_v_ic, z_th_ddz_exner_c) = where( k_field >= int32(1), - _( + _compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta( wgtfac_c, z_rth_pr_2, theta_v, From e32d41de2d23b6d85ce25df1fa87f3bc8cad4350 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Mon, 29 Jan 2024 18:14:43 +0100 Subject: [PATCH 12/60] fixes --- .../dycore/mo_solve_nonhydro_stencil_11_upper.py | 2 +- .../dycore/nh_solve/solve_nonhydro_program.py | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_11_upper.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_11_upper.py index 155f9944a2..5961d6f824 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_11_upper.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_11_upper.py @@ -16,7 +16,7 @@ from gt4py.next.ffront.fbuiltins import Field, astype, int32 from icon4py.model.atmosphere.dycore.interpolate_to_surface import _interpolate_to_surface -from icon4py.model.common.dimension import CellDim, KDim, Koff +from icon4py.model.common.dimension import CellDim, KDim from icon4py.model.common.type_alias import vpfloat, wpfloat 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/nh_solve/solve_nonhydro_program.py index f32317b95f..9d8f4383d8 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/nh_solve/solve_nonhydro_program.py @@ -14,6 +14,9 @@ from gt4py.next.ffront.decorator import field_operator, program from gt4py.next.ffront.fbuiltins import int32, where +from icon4py.model.atmosphere.dycore.compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta import ( + _compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta, +) from icon4py.model.atmosphere.dycore.compute_contravariant_correction import ( _compute_contravariant_correction, ) @@ -33,15 +36,6 @@ from icon4py.model.atmosphere.dycore.interpolate_to_half_levels_vp import ( _interpolate_to_half_levels_vp, ) -from icon4py.model.atmosphere.dycore.compute_first_vertical_derivative import ( - _compute_first_vertical_derivative, -) -from icon4py.model.atmosphere.dycore.compute_pertubation_of_rho_and_theta_and_rho_at_ic import ( - _compute_pertubation_of_rho_and_theta_and_rho_at_ic, -) -from icon4py.model.atmosphere.dycore. import ( - _compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta, -) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_11_upper import ( _mo_solve_nonhydro_stencil_11_upper, ) From 2d6baf389e5177da2ba18be4cf8c21de688595cc Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Mon, 29 Jan 2024 18:18:29 +0100 Subject: [PATCH 13/60] fix --- .../dycore/nh_solve/solve_nonhydro_program.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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/nh_solve/solve_nonhydro_program.py index 9d8f4383d8..b343f8e9f4 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/nh_solve/solve_nonhydro_program.py @@ -14,9 +14,6 @@ from gt4py.next.ffront.decorator import field_operator, program from gt4py.next.ffront.fbuiltins import int32, where -from icon4py.model.atmosphere.dycore.compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta import ( - _compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta, -) from icon4py.model.atmosphere.dycore.compute_contravariant_correction import ( _compute_contravariant_correction, ) @@ -29,7 +26,11 @@ from icon4py.model.atmosphere.dycore.compute_pertubation_of_rho_and_theta_and_rho_at_ic import ( _compute_pertubation_of_rho_and_theta_and_rho_at_ic, ) +from icon4py.model.atmosphere.dycore.compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta import ( + _compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta, +) from icon4py.model.atmosphere.dycore.extrapolate_at_top import _extrapolate_at_top +from icon4py.model.atmosphere.dycore.interpolate_to_surface import _interpolate_to_surface from icon4py.model.atmosphere.dycore.extrapolate_temporally_exner_pressure import ( _extrapolate_temporally_exner_pressure, ) @@ -265,7 +266,9 @@ def _predictor_stencils_7_8_9( (rho_ic, z_rth_pr_1, z_rth_pr_2) = where( k_field >= int32(1), - _compute_pertubation_of_rho_and_theta_and_rho_at_ic(wgtfac_c, rho, rho_ref_mc, theta_v, theta_ref_mc), + _compute_pertubation_of_rho_and_theta_and_rho_at_ic( + wgtfac_c, rho, rho_ref_mc, theta_v, theta_ref_mc + ), (rho_ic, z_rth_pr_1, z_rth_pr_2), ) From 489e739979d8a46b3f4cce18c1d93f7dfe5d59a4 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Mon, 29 Jan 2024 18:19:28 +0100 Subject: [PATCH 14/60] fix --- .../model/atmosphere/dycore/nh_solve/solve_nonhydro_program.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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/nh_solve/solve_nonhydro_program.py index b343f8e9f4..219d85f843 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/nh_solve/solve_nonhydro_program.py @@ -30,13 +30,13 @@ _compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta, ) from icon4py.model.atmosphere.dycore.extrapolate_at_top import _extrapolate_at_top -from icon4py.model.atmosphere.dycore.interpolate_to_surface import _interpolate_to_surface from icon4py.model.atmosphere.dycore.extrapolate_temporally_exner_pressure import ( _extrapolate_temporally_exner_pressure, ) from icon4py.model.atmosphere.dycore.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.mo_solve_nonhydro_stencil_11_upper import ( _mo_solve_nonhydro_stencil_11_upper, ) From f826768b20090d900d985c86a334e5aa7324dcdd Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Tue, 30 Jan 2024 17:36:39 +0100 Subject: [PATCH 15/60] fix test --- ...used_velocity_advection_stencil_8_to_14.py | 6 +- ...ntravariant_correct_to_interface_levels.py | 53 ---------------- .../dycore/interpolate_to_half_levels_vp.py | 2 +- .../dycore/nh_solve/solve_nonhydro_program.py | 2 +- .../velocity/velocity_advection_program.py | 6 +- ...used_velocity_advection_stencil_8_to_14.py | 8 +-- ...ntravariant_correct_to_interface_levels.py | 60 ------------------- .../test_interpolate_to_half_levels_vp.py | 14 +++-- ...face.py => test_interpolate_to_surface.py} | 19 ++++-- ...test_mo_solve_nonhydro_stencil_11_upper.py | 19 +++--- 10 files changed, 43 insertions(+), 146 deletions(-) delete mode 100644 model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_contravariant_correct_to_interface_levels.py delete mode 100644 model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_contravariant_correct_to_interface_levels.py rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_interpolate_to_surface.py => test_interpolate_to_surface.py} (85%) 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/fused_velocity_advection_stencil_8_to_14.py index 89ff0a5d7d..03b6f4ae06 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/fused_velocity_advection_stencil_8_to_14.py @@ -21,8 +21,8 @@ from icon4py.model.atmosphere.dycore.correct_contravariant_vertical_velocity import ( _correct_contravariant_vertical_velocity, ) -from icon4py.model.atmosphere.dycore.interpolate_contravariant_correct_to_interface_levels import ( - _interpolate_contravariant_correct_to_interface_levels, +from icon4py.model.atmosphere.dycore.interpolate_to_half_levels_vp import ( + _interpolate_to_half_levels_vp, ) from icon4py.model.atmosphere.dycore.interpolate_to_cell_center import _interpolate_to_cell_center from icon4py.model.atmosphere.dycore.set_cell_kdim_field_to_zero_vp import ( @@ -80,7 +80,7 @@ def _fused_velocity_advection_stencil_8_to_14( w_concorr_c = ( where( nflatlev + 1 < k < nlev, - _interpolate_contravariant_correct_to_interface_levels(z_w_concorr_mc, wgtfac_c), + _interpolate_to_half_levels_vp(interpolant=z_w_concorr_mc, wgtfac_c=wgtfac_c), w_concorr_c, ) if istep == 1 diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_contravariant_correct_to_interface_levels.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_contravariant_correct_to_interface_levels.py deleted file mode 100644 index b31bfd4b4c..0000000000 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_contravariant_correct_to_interface_levels.py +++ /dev/null @@ -1,53 +0,0 @@ -# ICON4Py - ICON inspired code in Python and GT4Py -# -# Copyright (c) 2022, ETH Zurich and MeteoSwiss -# All rights reserved. -# -# This file is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or any later -# version. See the LICENSE.txt file at the top-level directory of this -# distribution for a copy of the license or check . -# -# SPDX-License-Identifier: GPL-3.0-or-later - -from gt4py.next.common import GridType -from gt4py.next.ffront.decorator import field_operator, program -from gt4py.next.ffront.fbuiltins import Field, int32 - -from icon4py.model.common.dimension import CellDim, KDim, Koff -from icon4py.model.common.type_alias import vpfloat - - -@field_operator -def _interpolate_contravariant_correct_to_interface_levels( - z_w_concorr_mc: Field[[CellDim, KDim], vpfloat], - wgtfac_c: Field[[CellDim, KDim], vpfloat], -) -> Field[[CellDim, KDim], vpfloat]: - """Formerly know as _mo_velocity_advection_stencil_10.""" - w_concorr_c_vp = wgtfac_c * z_w_concorr_mc + (vpfloat("1.0") - wgtfac_c) * z_w_concorr_mc( - Koff[-1] - ) - - return w_concorr_c_vp - - -@program(grid_type=GridType.UNSTRUCTURED) -def interpolate_contravariant_correct_to_interface_levels( - z_w_concorr_mc: Field[[CellDim, KDim], vpfloat], - wgtfac_c: Field[[CellDim, KDim], vpfloat], - w_concorr_c: Field[[CellDim, KDim], vpfloat], - horizontal_start: int32, - horizontal_end: int32, - vertical_start: int32, - vertical_end: int32, -): - _interpolate_contravariant_correct_to_interface_levels( - z_w_concorr_mc, - wgtfac_c, - out=w_concorr_c, - domain={ - CellDim: (horizontal_start, horizontal_end), - KDim: (vertical_start, vertical_end), - }, - ) 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/interpolate_to_half_levels_vp.py index 669a539c62..cf4ca1ad03 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_to_half_levels_vp.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_to_half_levels_vp.py @@ -24,7 +24,7 @@ def _interpolate_to_half_levels_vp( wgtfac_c: Field[[CellDim, KDim], vpfloat], interpolant: Field[[CellDim, KDim], vpfloat], ) -> Field[[CellDim, KDim], vpfloat]: - """Formerly known as _mo_solve_nonhydro_stencil_05.""" + """Formerly known mo_velocity_advection_stencil_10 and as _mo_solve_nonhydro_stencil_05.""" interpolation_to_half_levels_vp = wgtfac_c * interpolant + ( vpfloat("1.0") - wgtfac_c ) * interpolant(Koff[-1]) 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/nh_solve/solve_nonhydro_program.py index e5c8cda1df..393c3c09a9 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/nh_solve/solve_nonhydro_program.py @@ -185,7 +185,7 @@ def _predictor_stencils_4_5_6( # possibly GZ will want to consider the cache ramifications of this change for CPU z_exner_ic = where( k_field < nlev, - _interpolate_to_half_levels_vp(wgtfac_c, z_exner_ex_pr), + _interpolate_to_half_levels_vp(wgtfac_c=wgtfac_c, interpolant=z_exner_ex_pr), z_exner_ic, ) 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/velocity_advection_program.py index 8346e385a3..e030c8fda6 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/velocity_advection_program.py @@ -34,8 +34,8 @@ _correct_contravariant_vertical_velocity, ) from icon4py.model.atmosphere.dycore.extrapolate_at_top import _extrapolate_at_top -from icon4py.model.atmosphere.dycore.interpolate_contravariant_correct_to_interface_levels import ( - _interpolate_contravariant_correct_to_interface_levels, +from icon4py.model.atmosphere.dycore.interpolate_to_half_levels_vp import ( + _interpolate_to_half_levels_vp, ) from icon4py.model.atmosphere.dycore.interpolate_to_cell_center import _interpolate_to_cell_center from icon4py.model.atmosphere.dycore.set_cell_kdim_field_to_zero_vp import ( @@ -156,7 +156,7 @@ def _fused_stencils_9_10( w_concorr_c = where( (k_field >= nflatlev_startindex + int32(1)) & (k_field < nlev), - _interpolate_contravariant_correct_to_interface_levels(local_z_w_concorr_mc, wgtfac_c), + _interpolate_to_half_levels_vp(interpolant=local_z_w_concorr_mc, wgtfac_c=wgtfac_c), w_concorr_c, ) diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_velocity_advection_stencil_8_to_14.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_velocity_advection_stencil_8_to_14.py index 9911c752ca..a4db6a2a8b 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_velocity_advection_stencil_8_to_14.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_velocity_advection_stencil_8_to_14.py @@ -34,8 +34,8 @@ from .test_correct_contravariant_vertical_velocity import ( correct_contravariant_vertical_velocity_numpy, ) -from .test_interpolate_contravariant_correct_to_interface_levels import ( - interpolate_contravariant_correct_to_interface_levels_numpy, +from .test_interpolate_to_half_levels_vp import ( + interpolate_to_half_levels_vp_numpy, ) from .test_interpolate_to_cell_center import interpolate_to_cell_center_numpy from .test_set_cell_kdim_field_to_zero_vp import set_cell_kdim_field_to_zero_vp_numpy @@ -93,8 +93,8 @@ def reference( w_concorr_c = np.where( (nflatlev + 1 < k) & (k < nlev), - interpolate_contravariant_correct_to_interface_levels_numpy( - grid, z_w_concorr_mc, wgtfac_c + interpolate_to_half_levels_vp_numpy( + grid=grid, interpolant=z_w_concorr_mc, wgtfac_c=wgtfac_c ), w_concorr_c, ) diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_contravariant_correct_to_interface_levels.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_contravariant_correct_to_interface_levels.py deleted file mode 100644 index 65b3520940..0000000000 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_contravariant_correct_to_interface_levels.py +++ /dev/null @@ -1,60 +0,0 @@ -# ICON4Py - ICON inspired code in Python and GT4Py -# -# Copyright (c) 2022, ETH Zurich and MeteoSwiss -# All rights reserved. -# -# This file is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or any later -# version. See the LICENSE.txt file at the top-level directory of this -# distribution for a copy of the license or check . -# -# SPDX-License-Identifier: GPL-3.0-or-later - -import numpy as np -import pytest -from gt4py.next.ffront.fbuiltins import int32 - -from icon4py.model.atmosphere.dycore.interpolate_contravariant_correct_to_interface_levels import ( - interpolate_contravariant_correct_to_interface_levels, -) -from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field -from icon4py.model.common.type_alias import vpfloat - - -def interpolate_contravariant_correct_to_interface_levels_numpy( - grid, wgtfac_c: np.array, z_w_concorr_mc: np.array -) -> np.array: - z_w_concorr_mc_k_minus_1 = np.roll(z_w_concorr_mc, shift=1, axis=1) - w_concorr_c = wgtfac_c * z_w_concorr_mc + (1.0 - wgtfac_c) * z_w_concorr_mc_k_minus_1 - w_concorr_c[:, 0] = 0 - return w_concorr_c - - -class TestMoVelocityAdvectionStencil10(StencilTest): - PROGRAM = interpolate_contravariant_correct_to_interface_levels - OUTPUTS = ("w_concorr_c",) - - @staticmethod - def reference(grid, wgtfac_c: np.array, z_w_concorr_mc: np.array, **kwargs) -> dict: - w_concorr_c = interpolate_contravariant_correct_to_interface_levels_numpy( - grid, wgtfac_c, z_w_concorr_mc - ) - return dict(w_concorr_c=w_concorr_c) - - @pytest.fixture - def input_data(self, grid): - wgtfac_c = random_field(grid, CellDim, KDim, dtype=vpfloat) - z_w_concorr_mc = random_field(grid, CellDim, KDim, dtype=vpfloat) - w_concorr_c = zero_field(grid, CellDim, KDim, dtype=vpfloat) - - return dict( - z_w_concorr_mc=z_w_concorr_mc, - wgtfac_c=wgtfac_c, - w_concorr_c=w_concorr_c, - horizontal_start=int32(0), - horizontal_end=int32(grid.num_cells), - vertical_start=int32(1), - vertical_end=int32(grid.num_levels), - ) 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 ed91de6801..f195dc55e4 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 @@ -22,6 +22,14 @@ from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field from icon4py.model.common.type_alias import vpfloat +def interpolate_to_half_levels_vp_numpy(grid, wgtfac_c: np.array, interpolant: np.array) -> np.array: + interpolant_offset_1 = np.roll(interpolant, shift=1, axis=1) + interpolation_to_half_levels_vp = ( + wgtfac_c * interpolant + (1.0 - wgtfac_c) * interpolant_offset_1 + ) + interpolation_to_half_levels_vp[:, 0] = 0 + + return interpolation_to_half_levels_vp class TestMoSolveNonhydroStencil05(StencilTest): PROGRAM = interpolate_to_half_levels_vp @@ -29,11 +37,7 @@ class TestMoSolveNonhydroStencil05(StencilTest): @staticmethod def reference(grid, wgtfac_c: np.array, interpolant: np.array, **kwargs) -> dict: - interpolant_offset_1 = np.roll(interpolant, shift=1, axis=1) - interpolation_to_half_levels_vp = ( - wgtfac_c * interpolant + (1.0 - wgtfac_c) * interpolant_offset_1 - ) - interpolation_to_half_levels_vp[:, 0] = 0 + interpolation_to_half_levels_vp = interpolate_to_half_levels_vp_numpy(grid=grid, wgtfac_c=wgtfac_c, interpolant=interpolant) return dict(interpolation_to_half_levels_vp=interpolation_to_half_levels_vp) @pytest.fixture diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_interpolate_to_surface.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_to_surface.py similarity index 85% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_interpolate_to_surface.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_to_surface.py index 405de41d71..b3e46c8fdc 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_interpolate_to_surface.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_interpolate_to_surface.py @@ -21,6 +21,19 @@ from icon4py.model.common.type_alias import vpfloat +def interpolate_to_surface_numpy( + grid, + interpolant: np.array, + wgtfacq_c: np.array, + interpolation_to_surface: np.array) -> np.array: + interpolation_to_surface[:, 3:] = ( + np.roll(wgtfacq_c, shift=1, axis=1) * np.roll(interpolant, shift=1, axis=1) + + np.roll(wgtfacq_c, shift=2, axis=1) * np.roll(interpolant, shift=2, axis=1) + + np.roll(wgtfacq_c, shift=3, axis=1) * np.roll(interpolant, shift=3, axis=1) + )[:, 3:] + return interpolation_to_surface + + class TestMoSolveNonhydroStencil04(StencilTest): PROGRAM = interpolate_to_surface OUTPUTS = ("interpolation_to_surface",) @@ -33,11 +46,7 @@ def reference( interpolation_to_surface: np.array, **kwargs, ) -> dict: - interpolation_to_surface[:, 3:] = ( - np.roll(wgtfacq_c, shift=1, axis=1) * np.roll(interpolant, shift=1, axis=1) - + np.roll(wgtfacq_c, shift=2, axis=1) * np.roll(interpolant, shift=2, axis=1) - + np.roll(wgtfacq_c, shift=3, axis=1) * np.roll(interpolant, shift=3, axis=1) - )[:, 3:] + interpolation_to_surface = interpolate_to_surface_numpy(grid=grid, wgtfacq_c=wgtfacq_c, interpolant=interpolant, interpolation_to_surface=interpolation_to_surface) return dict(interpolation_to_surface=interpolation_to_surface) @pytest.fixture diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_11_upper.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_11_upper.py index 51c04a464a..2e6c3719e3 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_11_upper.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_11_upper.py @@ -15,6 +15,7 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 +from .test_interpolate_to_surface import interpolate_to_surface_numpy from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_11_upper import ( mo_solve_nonhydro_stencil_11_upper, ) @@ -33,17 +34,13 @@ def reference( wgtfacq_c: np.array, z_rth_pr: np.array, theta_ref_ic: np.array, + z_theta_v_pr_ic: np.array, + theta_v_ic: np.array, **kwargs, - ) -> tuple[np.array, np.array]: - z_theta_v_pr_ic_ref = np.copy(theta_ref_ic) - z_theta_v_pr_ic_ref[:, -1] = ( - np.roll(wgtfacq_c, shift=1, axis=1) * np.roll(z_rth_pr, shift=1, axis=1) - + np.roll(wgtfacq_c, shift=2, axis=1) * np.roll(z_rth_pr, shift=2, axis=1) - + np.roll(wgtfacq_c, shift=3, axis=1) * np.roll(z_rth_pr, shift=3, axis=1) - )[:, -1] - theta_v_ic = np.zeros_like(theta_ref_ic) - theta_v_ic[:, -1] = (theta_ref_ic + z_theta_v_pr_ic_ref)[:, -1] - return dict(z_theta_v_pr_ic=z_theta_v_pr_ic_ref, theta_v_ic=theta_v_ic) + ) -> dict: + z_theta_v_pr_ic = interpolate_to_surface_numpy(grid=grid,wgtfacq_c=wgtfacq_c,interpolant=z_rth_pr, interpolation_to_surface=z_theta_v_pr_ic) + theta_v_ic[:, 3:] = (theta_ref_ic + z_theta_v_pr_ic)[:, 3:] + return dict(z_theta_v_pr_ic=z_theta_v_pr_ic, theta_v_ic=theta_v_ic) @pytest.fixture def input_data(self, grid): @@ -61,6 +58,6 @@ def input_data(self, grid): theta_v_ic=theta_v_ic, horizontal_start=int32(0), horizontal_end=int32(grid.num_cells), - vertical_start=int32(grid.num_levels - 1), + vertical_start=int32(3), vertical_end=int32(grid.num_levels), ) From 882bd053296f81bb77d329985dbf76eb12bed23e Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Wed, 31 Jan 2024 13:27:05 +0100 Subject: [PATCH 16/60] rename stencils --- .../model/atmosphere/dycore/mo_solve_nonhydro_stencil_12.py | 1 + .../atmosphere/dycore/nh_solve/solve_nonhydro_program.py | 6 +++--- ...1_upper.py => set_theta_v_prime_ic_at_lower_boundary.py} | 6 +++--- ...er.py => test_set_theta_v_prime_ic_at_lower_boundary.py} | 6 +++--- 4 files changed, 10 insertions(+), 9 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_11_upper.py => set_theta_v_prime_ic_at_lower_boundary.py} (93%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_11_upper.py => test_set_theta_v_prime_ic_at_lower_boundary.py} (92%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_12.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_12.py index 6fa32e5508..3d093e53fe 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_12.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_12.py @@ -26,6 +26,7 @@ def _mo_solve_nonhydro_stencil_12( d2dexdz2_fac2_mc: Field[[CellDim, KDim], vpfloat], z_rth_pr_2: Field[[CellDim, KDim], vpfloat], ) -> Field[[CellDim, KDim], vpfloat]: + '''Formerly known as _mo_solve_nonhydro_stencil_12.''' z_dexner_dz_c_2_vp = -vpfloat("0.5") * ( (z_theta_v_pr_ic - z_theta_v_pr_ic(Koff[1])) * d2dexdz2_fac1_mc + z_rth_pr_2 * d2dexdz2_fac2_mc 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/nh_solve/solve_nonhydro_program.py index 393c3c09a9..ad6f5a535d 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/nh_solve/solve_nonhydro_program.py @@ -39,8 +39,8 @@ _interpolate_to_half_levels_vp, ) from icon4py.model.atmosphere.dycore.interpolate_to_surface import _interpolate_to_surface -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_11_upper import ( - _mo_solve_nonhydro_stencil_11_upper, +from icon4py.model.atmosphere.dycore.set_theta_v_prime_ic_at_lower_boundary import ( + _set_theta_v_prime_ic_at_lower_boundary, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1 import ( _mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1, @@ -359,7 +359,7 @@ def _predictor_stencils_11_lower_upper( (z_theta_v_pr_ic, theta_v_ic) = where( k_field == nlev, - _mo_solve_nonhydro_stencil_11_upper(wgtfacq_c_dsl, z_rth_pr, theta_ref_ic), + _set_theta_v_prime_ic_at_lower_boundary(wgtfacq_c_dsl, z_rth_pr, theta_ref_ic), (z_theta_v_pr_ic, theta_v_ic), ) return z_theta_v_pr_ic, theta_v_ic diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_11_upper.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/set_theta_v_prime_ic_at_lower_boundary.py similarity index 93% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_11_upper.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/set_theta_v_prime_ic_at_lower_boundary.py index 5961d6f824..d4679f32e5 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_11_upper.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/set_theta_v_prime_ic_at_lower_boundary.py @@ -21,7 +21,7 @@ @field_operator -def _mo_solve_nonhydro_stencil_11_upper( +def _set_theta_v_prime_ic_at_lower_boundary( wgtfacq_c: Field[[CellDim, KDim], vpfloat], z_rth_pr: Field[[CellDim, KDim], vpfloat], theta_ref_ic: Field[[CellDim, KDim], vpfloat], @@ -33,7 +33,7 @@ def _mo_solve_nonhydro_stencil_11_upper( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_11_upper( +def set_theta_v_prime_ic_at_lower_boundary( wgtfacq_c: Field[[CellDim, KDim], vpfloat], z_rth_pr: Field[[CellDim, KDim], vpfloat], theta_ref_ic: Field[[CellDim, KDim], vpfloat], @@ -44,7 +44,7 @@ def mo_solve_nonhydro_stencil_11_upper( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_11_upper( + _set_theta_v_prime_ic_at_lower_boundary( wgtfacq_c, z_rth_pr, theta_ref_ic, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_11_upper.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_set_theta_v_prime_ic_at_lower_boundary.py similarity index 92% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_11_upper.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_set_theta_v_prime_ic_at_lower_boundary.py index 2e6c3719e3..2e09113b32 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_11_upper.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_set_theta_v_prime_ic_at_lower_boundary.py @@ -16,8 +16,8 @@ from gt4py.next.ffront.fbuiltins import int32 from .test_interpolate_to_surface import interpolate_to_surface_numpy -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_11_upper import ( - mo_solve_nonhydro_stencil_11_upper, +from icon4py.model.atmosphere.dycore.set_theta_v_prime_ic_at_lower_boundary import ( + set_theta_v_prime_ic_at_lower_boundary, ) from icon4py.model.common.dimension import CellDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -25,7 +25,7 @@ class TestMoSolveNonhydroStencil11Upper(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_11_upper + PROGRAM = set_theta_v_prime_ic_at_lower_boundary OUTPUTS = ("z_theta_v_pr_ic", "theta_v_ic") @staticmethod From fcb77e2cd2a9452413c7ff81c6848c0b60cb450a Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Wed, 31 Jan 2024 13:48:24 +0100 Subject: [PATCH 17/60] rename stencil --- ...> compute_approx_of_2nd_vertical_derivative_of_exner.py} | 6 +++--- .../mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1.py | 1 + .../model/atmosphere/dycore/nh_solve/solve_nonhydro.py | 6 +++--- ...t_compute_approx_of_2nd_vertical_derivative_of_exner.py} | 6 +++--- 4 files changed, 10 insertions(+), 9 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_12.py => compute_approx_of_2nd_vertical_derivative_of_exner.py} (92%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_12.py => test_compute_approx_of_2nd_vertical_derivative_of_exner.py} (91%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_12.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_approx_of_2nd_vertical_derivative_of_exner.py similarity index 92% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_12.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_approx_of_2nd_vertical_derivative_of_exner.py index 3d093e53fe..c2aca6e0e5 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_12.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_approx_of_2nd_vertical_derivative_of_exner.py @@ -20,7 +20,7 @@ @field_operator -def _mo_solve_nonhydro_stencil_12( +def _compute_approx_of_2nd_vertical_derivative_of_exner( z_theta_v_pr_ic: Field[[CellDim, KDim], vpfloat], d2dexdz2_fac1_mc: Field[[CellDim, KDim], vpfloat], d2dexdz2_fac2_mc: Field[[CellDim, KDim], vpfloat], @@ -35,7 +35,7 @@ def _mo_solve_nonhydro_stencil_12( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_12( +def compute_approx_of_2nd_vertical_derivative_of_exner( z_theta_v_pr_ic: Field[[CellDim, KDim], vpfloat], d2dexdz2_fac1_mc: Field[[CellDim, KDim], vpfloat], d2dexdz2_fac2_mc: Field[[CellDim, KDim], vpfloat], @@ -46,7 +46,7 @@ def mo_solve_nonhydro_stencil_12( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_12( + _compute_approx_of_2nd_vertical_derivative_of_exner( z_theta_v_pr_ic, d2dexdz2_fac1_mc, d2dexdz2_fac2_mc, diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1.py index a5023ea02a..16df3ca694 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1.py @@ -145,6 +145,7 @@ def _mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1( z_rth_pr_1: Field[[CellDim, KDim], vpfloat], z_rth_pr_2: Field[[CellDim, KDim], vpfloat], ) -> tuple[Field[[EdgeDim, KDim], wpfloat], Field[[EdgeDim, KDim], wpfloat]]: + '''Formerly known as _mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1.''' (p_distv_bary_1, p_distv_bary_2) = _compute_btraj( p_vn, p_vt, 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/nh_solve/solve_nonhydro.py index 028619a7a4..0769e64204 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -37,8 +37,8 @@ from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_4th_order_divdamp import ( mo_solve_nonhydro_4th_order_divdamp, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_12 import ( - mo_solve_nonhydro_stencil_12, +from icon4py.model.atmosphere.dycore.compute_approx_of_2nd_vertical_derivative_of_exner import ( + compute_approx_of_2nd_vertical_derivative_of_exner, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_17 import ( mo_solve_nonhydro_stencil_17, @@ -817,7 +817,7 @@ def run_predictor_step( if self.config.igradp_method == 3: # Second vertical derivative of perturbation Exner pressure (hydrostatic approximation) - mo_solve_nonhydro_stencil_12.with_backend(backend)( + compute_approx_of_2nd_vertical_derivative_of_exner.with_backend(backend)( z_theta_v_pr_ic=self.z_theta_v_pr_ic, d2dexdz2_fac1_mc=self.metric_state_nonhydro.d2dexdz2_fac1_mc, d2dexdz2_fac2_mc=self.metric_state_nonhydro.d2dexdz2_fac2_mc, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_12.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_approx_of_2nd_vertical_derivative_of_exner.py similarity index 91% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_12.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_approx_of_2nd_vertical_derivative_of_exner.py index 74c39d9ce7..ce87426c83 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_12.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_approx_of_2nd_vertical_derivative_of_exner.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_12 import ( - mo_solve_nonhydro_stencil_12, +from icon4py.model.atmosphere.dycore.compute_approx_of_2nd_vertical_derivative_of_exner import ( + compute_approx_of_2nd_vertical_derivative_of_exner, ) from icon4py.model.common.dimension import CellDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil12(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_12 + PROGRAM = compute_approx_of_2nd_vertical_derivative_of_exner OUTPUTS = ("z_dexner_dz_c_2",) @staticmethod From ab0e5c7fa588ead715cc9241d287628936fc7bdc Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Wed, 31 Jan 2024 14:03:49 +0100 Subject: [PATCH 18/60] rename stencil --- ...y => compute_horizontal_advection_of_rho_and_theta.py} | 6 +++--- .../atmosphere/dycore/mo_solve_nonhydro_stencil_17.py | 1 + .../model/atmosphere/dycore/nh_solve/solve_nonhydro.py | 2 +- .../atmosphere/dycore/nh_solve/solve_nonhydro_program.py | 8 ++++---- ...test_compute_horizontal_advection_of_rho_and_theta.py} | 6 +++--- .../dycore/tests/dycore_tests/test_solve_nonhydro.py | 2 +- 6 files changed, 13 insertions(+), 12 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1.py => compute_horizontal_advection_of_rho_and_theta.py} (97%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1.py => test_compute_horizontal_advection_of_rho_and_theta.py} (97%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_advection_of_rho_and_theta.py similarity index 97% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_advection_of_rho_and_theta.py index 16df3ca694..3ec24a06f6 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_advection_of_rho_and_theta.py @@ -126,7 +126,7 @@ def _sten_16( @field_operator -def _mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1( +def _compute_horizontal_advection_of_rho_and_theta( p_vn: Field[[EdgeDim, KDim], wpfloat], p_vt: Field[[EdgeDim, KDim], vpfloat], pos_on_tplane_e_1: Field[[ECDim], wpfloat], @@ -176,7 +176,7 @@ def _mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1( +def compute_horizontal_advection_of_rho_and_theta( p_vn: Field[[EdgeDim, KDim], wpfloat], p_vt: Field[[EdgeDim, KDim], vpfloat], pos_on_tplane_e_1: Field[[ECDim], wpfloat], @@ -201,7 +201,7 @@ def mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1( + _compute_horizontal_advection_of_rho_and_theta( p_vn, p_vt, pos_on_tplane_e_1, diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_17.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_17.py index 8780de3783..eac7417db3 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_17.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_17.py @@ -27,6 +27,7 @@ def _mo_solve_nonhydro_stencil_17( z_dwdz_dd: Field[[CellDim, KDim], vpfloat], z_graddiv_vn: Field[[EdgeDim, KDim], vpfloat], ) -> Field[[EdgeDim, KDim], vpfloat]: + '''Formerly known as _mo_solve_nonhydro_stencil_17.''' z_graddiv_vn_wp = astype(z_graddiv_vn, wpfloat) scalfac_dd3d = broadcast(scalfac_dd3d, (EdgeDim, KDim)) 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/nh_solve/solve_nonhydro.py index 0769e64204..0c2adbf87c 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -942,7 +942,7 @@ def run_predictor_step( # Note: the length of the backward trajectory should be 0.5*dtime*(vn,vt) in order to arrive # at a second-order accurate FV discretization, but twice the length is needed for numerical stability - nhsolve_prog.mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1.with_backend(backend)( + nhsolve_prog.compute_horizontal_advection_of_rho_and_theta.with_backend(backend)( p_vn=prognostic_state[nnow].vn, p_vt=diagnostic_state_nh.vt, pos_on_tplane_e_1=self.interpolation_state.pos_on_tplane_e_1, 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/nh_solve/solve_nonhydro_program.py index ad6f5a535d..90c0be7f1f 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/nh_solve/solve_nonhydro_program.py @@ -42,8 +42,8 @@ from icon4py.model.atmosphere.dycore.set_theta_v_prime_ic_at_lower_boundary import ( _set_theta_v_prime_ic_at_lower_boundary, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1 import ( - _mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1, +from icon4py.model.atmosphere.dycore.compute_horizontal_advection_of_rho_and_theta import ( + _compute_horizontal_advection_of_rho_and_theta, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_36 import ( _mo_solve_nonhydro_stencil_36, @@ -396,7 +396,7 @@ def predictor_stencils_11_lower_upper( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1( +def compute_horizontal_advection_of_rho_and_theta( p_vn: Field[[EdgeDim, KDim], float], p_vt: Field[[EdgeDim, KDim], float], pos_on_tplane_e_1: Field[[ECDim], float], @@ -421,7 +421,7 @@ def mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1( + _compute_horizontal_advection_of_rho_and_theta( p_vn, p_vt, pos_on_tplane_e_1, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_advection_of_rho_and_theta.py similarity index 97% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_advection_of_rho_and_theta.py index 1448f65558..1f34f5202d 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_advection_of_rho_and_theta.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1 import ( - mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1, +from icon4py.model.atmosphere.dycore.compute_horizontal_advection_of_rho_and_theta import ( + compute_horizontal_advection_of_rho_and_theta, ) from icon4py.model.common.dimension import CellDim, E2CDim, ECDim, EdgeDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, as_1D_sparse_field, random_field @@ -24,7 +24,7 @@ class TestComputeBtraj(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1 + PROGRAM = compute_horizontal_advection_of_rho_and_theta OUTPUTS = ("z_rho_e", "z_theta_v_e") @staticmethod 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 ef97537cd5..eee7ac5c91 100644 --- a/model/atmosphere/dycore/tests/dycore_tests/test_solve_nonhydro.py +++ b/model/atmosphere/dycore/tests/dycore_tests/test_solve_nonhydro.py @@ -272,7 +272,7 @@ def test_nonhydro_predictor_step( atol=1e-21, ) - # mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1 + # compute_horizontal_advection_of_rho_and_theta assert dallclose( solve_nonhydro.intermediate_fields.z_rho_e.asnumpy()[edge_start_lb_plus6:, :], sp_exit.z_rho_e().asnumpy()[edge_start_lb_plus6:, :], From bfa1aae97cd00ea7bcee9f22fa59347b83c5e785 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Wed, 31 Jan 2024 14:32:50 +0100 Subject: [PATCH 19/60] rename stencil --- ...ertical_wind_derivative_to_divergence_damping.py} | 6 +++--- ...f_exner_pressure_for_flat_surface_coordinates.py} | 7 ++++--- .../dycore/mo_solve_nonhydro_stencil_19.py | 1 + .../atmosphere/dycore/nh_solve/solve_nonhydro.py | 12 ++++++------ ...ertical_wind_derivative_to_divergence_damping.py} | 6 +++--- ...f_exner_pressure_for_flat_surface_coordinates.py} | 6 +++--- 6 files changed, 20 insertions(+), 18 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_17.py => add_vertical_wind_derivative_to_divergence_damping.py} (92%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_18.py => compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates.py} (84%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_17.py => test_add_vertical_wind_derivative_to_divergence_damping.py} (92%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_18.py => test_compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates.py} (88%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_17.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_vertical_wind_derivative_to_divergence_damping.py similarity index 92% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_17.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_vertical_wind_derivative_to_divergence_damping.py index eac7417db3..8c252dc888 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_17.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_vertical_wind_derivative_to_divergence_damping.py @@ -20,7 +20,7 @@ @field_operator -def _mo_solve_nonhydro_stencil_17( +def _add_vertical_wind_derivative_to_divergence_damping( hmask_dd3d: Field[[EdgeDim], wpfloat], scalfac_dd3d: Field[[KDim], wpfloat], inv_dual_edge_length: Field[[EdgeDim], wpfloat], @@ -41,7 +41,7 @@ def _mo_solve_nonhydro_stencil_17( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_17( +def add_vertical_wind_derivative_to_divergence_damping( hmask_dd3d: Field[[EdgeDim], wpfloat], scalfac_dd3d: Field[[KDim], wpfloat], inv_dual_edge_length: Field[[EdgeDim], wpfloat], @@ -52,7 +52,7 @@ def mo_solve_nonhydro_stencil_17( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_17( + _add_vertical_wind_derivative_to_divergence_damping( hmask_dd3d, scalfac_dd3d, inv_dual_edge_length, diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_18.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates.py similarity index 84% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_18.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates.py index ce5ee25470..e1ac16b2dc 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_18.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates.py @@ -20,10 +20,11 @@ @field_operator -def _mo_solve_nonhydro_stencil_18( +def _compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates( inv_dual_edge_length: Field[[EdgeDim], wpfloat], z_exner_ex_pr: Field[[CellDim, KDim], vpfloat], ) -> Field[[EdgeDim, KDim], vpfloat]: + '''Formerly konwn as _mo_solve_nonhydro_stencil_18.''' z_gradh_exner_wp = inv_dual_edge_length * astype( z_exner_ex_pr(E2C[1]) - z_exner_ex_pr(E2C[0]), wpfloat @@ -32,7 +33,7 @@ def _mo_solve_nonhydro_stencil_18( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_18( +def compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates( inv_dual_edge_length: Field[[EdgeDim], wpfloat], z_exner_ex_pr: Field[[CellDim, KDim], vpfloat], z_gradh_exner: Field[[EdgeDim, KDim], vpfloat], @@ -41,7 +42,7 @@ def mo_solve_nonhydro_stencil_18( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_18( + _compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates( inv_dual_edge_length, z_exner_ex_pr, out=z_gradh_exner, diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_19.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_19.py index df0c3a7dc6..89514731f0 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_19.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_19.py @@ -27,6 +27,7 @@ def _mo_solve_nonhydro_stencil_19( c_lin_e: Field[[EdgeDim, E2CDim], wpfloat], z_dexner_dz_c_1: Field[[CellDim, KDim], vpfloat], ) -> Field[[EdgeDim, KDim], vpfloat]: + '''Formerly known as _mo_solve_nonhydro_stencil_19.''' ddxn_z_full_wp, z_dexner_dz_c_1_wp = astype((ddxn_z_full, z_dexner_dz_c_1), wpfloat) z_gradh_exner_wp = inv_dual_edge_length * ( 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/nh_solve/solve_nonhydro.py index 0c2adbf87c..be8135bdde 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -40,11 +40,11 @@ from icon4py.model.atmosphere.dycore.compute_approx_of_2nd_vertical_derivative_of_exner import ( compute_approx_of_2nd_vertical_derivative_of_exner, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_17 import ( - mo_solve_nonhydro_stencil_17, +from icon4py.model.atmosphere.dycore.add_vertical_wind_derivative_to_divergence_damping import ( + add_vertical_wind_derivative_to_divergence_damping, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_18 import ( - mo_solve_nonhydro_stencil_18, +from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates import ( + compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_19 import ( mo_solve_nonhydro_stencil_19, @@ -973,7 +973,7 @@ def run_predictor_step( ) # Remaining computations at edge points - mo_solve_nonhydro_stencil_18.with_backend(backend)( + compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates.with_backend(backend)( inv_dual_edge_length=self.edge_geometry.inverse_dual_edge_lengths, z_exner_ex_pr=self.z_exner_ex_pr, z_gradh_exner=z_fields.z_gradh_exner, @@ -1549,7 +1549,7 @@ def run_corrector_step( ) log.debug(f"corrector: start stencil 17") - mo_solve_nonhydro_stencil_17.with_backend(backend)( + add_vertical_wind_derivative_to_divergence_damping.with_backend(backend)( hmask_dd3d=self.metric_state_nonhydro.hmask_dd3d, scalfac_dd3d=self.metric_state_nonhydro.scalfac_dd3d, inv_dual_edge_length=self.edge_geometry.inverse_dual_edge_lengths, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_17.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_vertical_wind_derivative_to_divergence_damping.py similarity index 92% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_17.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_vertical_wind_derivative_to_divergence_damping.py index 0c77265583..71812c856d 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_17.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_vertical_wind_derivative_to_divergence_damping.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_17 import ( - mo_solve_nonhydro_stencil_17, +from icon4py.model.atmosphere.dycore.add_vertical_wind_derivative_to_divergence_damping import ( + add_vertical_wind_derivative_to_divergence_damping, ) from icon4py.model.common.dimension import CellDim, E2CDim, EdgeDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil17(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_17 + PROGRAM = add_vertical_wind_derivative_to_divergence_damping OUTPUTS = ("z_graddiv_vn",) @staticmethod diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_18.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates.py similarity index 88% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_18.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates.py index 15ec35d00a..b7f6b8ce09 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_18.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_18 import ( - mo_solve_nonhydro_stencil_18, +from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates import ( + compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates, ) from icon4py.model.common.dimension import CellDim, E2CDim, EdgeDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil18(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_18 + PROGRAM = compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates OUTPUTS = ("z_gradh_exner",) @staticmethod From 84aa4cf1904d471399ebf0ac4d004946224553a2 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Wed, 31 Jan 2024 14:50:24 +0100 Subject: [PATCH 20/60] rename stencil --- ...of_extner_pressure_for_terrain_following_coordinates.py} | 6 +++--- .../model/atmosphere/dycore/mo_solve_nonhydro_stencil_20.py | 1 + .../model/atmosphere/dycore/nh_solve/solve_nonhydro.py | 6 +++--- ...of_extner_pressure_for_terrain_following_coordinates.py} | 6 +++--- 4 files changed, 10 insertions(+), 9 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_19.py => compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates.py} (89%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_19.py => test_compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates.py} (89%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_19.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates.py similarity index 89% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_19.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates.py index 89514731f0..3792dbeed9 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_19.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates.py @@ -20,7 +20,7 @@ @field_operator -def _mo_solve_nonhydro_stencil_19( +def _compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates( inv_dual_edge_length: Field[[EdgeDim], wpfloat], z_exner_ex_pr: Field[[CellDim, KDim], vpfloat], ddxn_z_full: Field[[EdgeDim, KDim], vpfloat], @@ -37,7 +37,7 @@ def _mo_solve_nonhydro_stencil_19( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_19( +def compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates( inv_dual_edge_length: Field[[EdgeDim], wpfloat], z_exner_ex_pr: Field[[CellDim, KDim], vpfloat], ddxn_z_full: Field[[EdgeDim, KDim], vpfloat], @@ -49,7 +49,7 @@ def mo_solve_nonhydro_stencil_19( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_19( + _compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates( inv_dual_edge_length, z_exner_ex_pr, ddxn_z_full, diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_20.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_20.py index 340f733adc..1823e9620b 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_20.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_20.py @@ -29,6 +29,7 @@ def _mo_solve_nonhydro_stencil_20( z_dexner_dz_c_1: Field[[CellDim, KDim], vpfloat], z_dexner_dz_c_2: Field[[CellDim, KDim], vpfloat], ) -> Field[[EdgeDim, KDim], vpfloat]: + '''Formerly known as _mo_solve_nonhydro_stencil_20.''' z_exner_ex_pr_0 = z_exner_ex_pr(as_offset(Koff, ikoffset(E2EC[0]))) z_exner_ex_pr_1 = z_exner_ex_pr(as_offset(Koff, ikoffset(E2EC[1]))) 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/nh_solve/solve_nonhydro.py index be8135bdde..795375d5a1 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -46,8 +46,8 @@ from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates import ( compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_19 import ( - mo_solve_nonhydro_stencil_19, +from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates import ( + compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_20 import ( mo_solve_nonhydro_stencil_20, @@ -990,7 +990,7 @@ def run_predictor_step( # horizontal gradient of Exner pressure, including metric correction # horizontal gradient of Exner pressure, Taylor-expansion-based reconstruction - mo_solve_nonhydro_stencil_19.with_backend(backend)( + compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates.with_backend(backend)( inv_dual_edge_length=self.edge_geometry.inverse_dual_edge_lengths, z_exner_ex_pr=self.z_exner_ex_pr, ddxn_z_full=self.metric_state_nonhydro.ddxn_z_full, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_19.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates.py similarity index 89% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_19.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates.py index 28f4e8be1a..4c6c02d643 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_19.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_19 import ( - mo_solve_nonhydro_stencil_19, +from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates import ( + compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates, ) from icon4py.model.common.dimension import CellDim, E2CDim, EdgeDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil19(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_19 + PROGRAM = compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates OUTPUTS = ("z_gradh_exner",) @staticmethod From 7212cde847b492e600f79bf8e9c381bff730a6d7 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Wed, 31 Jan 2024 14:51:34 +0100 Subject: [PATCH 21/60] fix style --- ...l_wind_derivative_to_divergence_damping.py | 2 +- ...rox_of_2nd_vertical_derivative_of_exner.py | 2 +- ...e_horizontal_advection_of_rho_and_theta.py | 2 +- ...r_pressure_for_flat_surface_coordinates.py | 2 +- ...ssure_for_terrain_following_coordinates.py | 2 +- ...used_velocity_advection_stencil_8_to_14.py | 2 +- .../dycore/mo_solve_nonhydro_stencil_20.py | 2 +- .../dycore/nh_solve/solve_nonhydro.py | 32 +++++++++++-------- .../dycore/nh_solve/solve_nonhydro_program.py | 16 ++++++---- .../velocity/velocity_advection_program.py | 2 +- ...used_velocity_advection_stencil_8_to_14.py | 4 +-- .../test_interpolate_to_half_levels_vp.py | 10 ++++-- .../test_interpolate_to_surface.py | 27 +++++++++------- ..._set_theta_v_prime_ic_at_lower_boundary.py | 10 ++++-- 14 files changed, 67 insertions(+), 48 deletions(-) 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/add_vertical_wind_derivative_to_divergence_damping.py index 8c252dc888..9c75e04bb8 100644 --- 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/add_vertical_wind_derivative_to_divergence_damping.py @@ -27,7 +27,7 @@ def _add_vertical_wind_derivative_to_divergence_damping( z_dwdz_dd: Field[[CellDim, KDim], vpfloat], z_graddiv_vn: Field[[EdgeDim, KDim], vpfloat], ) -> Field[[EdgeDim, KDim], vpfloat]: - '''Formerly known as _mo_solve_nonhydro_stencil_17.''' + """Formerly known as _mo_solve_nonhydro_stencil_17.""" z_graddiv_vn_wp = astype(z_graddiv_vn, wpfloat) scalfac_dd3d = broadcast(scalfac_dd3d, (EdgeDim, KDim)) 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/compute_approx_of_2nd_vertical_derivative_of_exner.py index c2aca6e0e5..c5ac5b9900 100644 --- 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/compute_approx_of_2nd_vertical_derivative_of_exner.py @@ -26,7 +26,7 @@ def _compute_approx_of_2nd_vertical_derivative_of_exner( d2dexdz2_fac2_mc: Field[[CellDim, KDim], vpfloat], z_rth_pr_2: Field[[CellDim, KDim], vpfloat], ) -> Field[[CellDim, KDim], vpfloat]: - '''Formerly known as _mo_solve_nonhydro_stencil_12.''' + """Formerly known as _mo_solve_nonhydro_stencil_12.""" z_dexner_dz_c_2_vp = -vpfloat("0.5") * ( (z_theta_v_pr_ic - z_theta_v_pr_ic(Koff[1])) * d2dexdz2_fac1_mc + z_rth_pr_2 * d2dexdz2_fac2_mc 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/compute_horizontal_advection_of_rho_and_theta.py index 3ec24a06f6..0205c95a61 100644 --- 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/compute_horizontal_advection_of_rho_and_theta.py @@ -145,7 +145,7 @@ def _compute_horizontal_advection_of_rho_and_theta( z_rth_pr_1: Field[[CellDim, KDim], vpfloat], z_rth_pr_2: Field[[CellDim, KDim], vpfloat], ) -> tuple[Field[[EdgeDim, KDim], wpfloat], Field[[EdgeDim, KDim], wpfloat]]: - '''Formerly known as _mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1.''' + """Formerly known as _mo_solve_nonhydro_stencil_16_fused_btraj_traj_o1.""" (p_distv_bary_1, p_distv_bary_2) = _compute_btraj( p_vn, p_vt, diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates.py index e1ac16b2dc..617dfb60a7 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates.py @@ -24,7 +24,7 @@ def _compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates( inv_dual_edge_length: Field[[EdgeDim], wpfloat], z_exner_ex_pr: Field[[CellDim, KDim], vpfloat], ) -> Field[[EdgeDim, KDim], vpfloat]: - '''Formerly konwn as _mo_solve_nonhydro_stencil_18.''' + """Formerly konwn as _mo_solve_nonhydro_stencil_18.""" z_gradh_exner_wp = inv_dual_edge_length * astype( z_exner_ex_pr(E2C[1]) - z_exner_ex_pr(E2C[0]), wpfloat diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates.py index 3792dbeed9..4a0521cfb7 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates.py @@ -27,7 +27,7 @@ def _compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordi c_lin_e: Field[[EdgeDim, E2CDim], wpfloat], z_dexner_dz_c_1: Field[[CellDim, KDim], vpfloat], ) -> Field[[EdgeDim, KDim], vpfloat]: - '''Formerly known as _mo_solve_nonhydro_stencil_19.''' + """Formerly known as _mo_solve_nonhydro_stencil_19.""" ddxn_z_full_wp, z_dexner_dz_c_1_wp = astype((ddxn_z_full, z_dexner_dz_c_1), wpfloat) z_gradh_exner_wp = inv_dual_edge_length * ( 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/fused_velocity_advection_stencil_8_to_14.py index 03b6f4ae06..d998c4511b 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/fused_velocity_advection_stencil_8_to_14.py @@ -21,10 +21,10 @@ from icon4py.model.atmosphere.dycore.correct_contravariant_vertical_velocity import ( _correct_contravariant_vertical_velocity, ) +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 ( _interpolate_to_half_levels_vp, ) -from icon4py.model.atmosphere.dycore.interpolate_to_cell_center import _interpolate_to_cell_center from icon4py.model.atmosphere.dycore.set_cell_kdim_field_to_zero_vp import ( _set_cell_kdim_field_to_zero_vp, ) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_20.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_20.py index 1823e9620b..20b71eb96e 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_20.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_20.py @@ -29,7 +29,7 @@ def _mo_solve_nonhydro_stencil_20( z_dexner_dz_c_1: Field[[CellDim, KDim], vpfloat], z_dexner_dz_c_2: Field[[CellDim, KDim], vpfloat], ) -> Field[[EdgeDim, KDim], vpfloat]: - '''Formerly known as _mo_solve_nonhydro_stencil_20.''' + """Formerly known as _mo_solve_nonhydro_stencil_20.""" z_exner_ex_pr_0 = z_exner_ex_pr(as_offset(Koff, ikoffset(E2EC[0]))) z_exner_ex_pr_1 = z_exner_ex_pr(as_offset(Koff, ikoffset(E2EC[1]))) 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/nh_solve/solve_nonhydro.py index 795375d5a1..30f817933b 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -21,6 +21,18 @@ import icon4py.model.atmosphere.dycore.nh_solve.solve_nonhydro_program as nhsolve_prog import icon4py.model.common.constants as constants +from icon4py.model.atmosphere.dycore.add_vertical_wind_derivative_to_divergence_damping import ( + add_vertical_wind_derivative_to_divergence_damping, +) +from icon4py.model.atmosphere.dycore.compute_approx_of_2nd_vertical_derivative_of_exner import ( + compute_approx_of_2nd_vertical_derivative_of_exner, +) +from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates import ( + compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates, +) +from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates import ( + compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates, +) from icon4py.model.atmosphere.dycore.compute_pertubation_of_rho_and_theta import ( compute_pertubation_of_rho_and_theta, ) @@ -37,18 +49,6 @@ from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_4th_order_divdamp import ( mo_solve_nonhydro_4th_order_divdamp, ) -from icon4py.model.atmosphere.dycore.compute_approx_of_2nd_vertical_derivative_of_exner import ( - compute_approx_of_2nd_vertical_derivative_of_exner, -) -from icon4py.model.atmosphere.dycore.add_vertical_wind_derivative_to_divergence_damping import ( - add_vertical_wind_derivative_to_divergence_damping, -) -from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates import ( - compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates, -) -from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates import ( - compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates, -) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_20 import ( mo_solve_nonhydro_stencil_20, ) @@ -973,7 +973,9 @@ def run_predictor_step( ) # Remaining computations at edge points - compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates.with_backend(backend)( + compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates.with_backend( + backend + )( inv_dual_edge_length=self.edge_geometry.inverse_dual_edge_lengths, z_exner_ex_pr=self.z_exner_ex_pr, z_gradh_exner=z_fields.z_gradh_exner, @@ -990,7 +992,9 @@ def run_predictor_step( # horizontal gradient of Exner pressure, including metric correction # horizontal gradient of Exner pressure, Taylor-expansion-based reconstruction - compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates.with_backend(backend)( + compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates.with_backend( + backend + )( inv_dual_edge_length=self.edge_geometry.inverse_dual_edge_lengths, z_exner_ex_pr=self.z_exner_ex_pr, ddxn_z_full=self.metric_state_nonhydro.ddxn_z_full, 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/nh_solve/solve_nonhydro_program.py index 90c0be7f1f..bc14c1e37d 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/nh_solve/solve_nonhydro_program.py @@ -19,8 +19,13 @@ ) from icon4py.model.atmosphere.dycore.compute_first_vertical_derivative import ( _compute_first_vertical_derivative, -from icon4py.model.atmosphere.dycore.compute_horizontal_kinetic_energy import ( _compute_horizontal_kinetic_energy, + from, + icon4py.model.atmosphere.dycore.compute_horizontal_kinetic_energy, + import, +) +from icon4py.model.atmosphere.dycore.compute_horizontal_advection_of_rho_and_theta import ( + _compute_horizontal_advection_of_rho_and_theta, ) from icon4py.model.atmosphere.dycore.compute_pertubation_of_rho_and_theta import ( _compute_pertubation_of_rho_and_theta, @@ -39,12 +44,6 @@ _interpolate_to_half_levels_vp, ) from icon4py.model.atmosphere.dycore.interpolate_to_surface import _interpolate_to_surface -from icon4py.model.atmosphere.dycore.set_theta_v_prime_ic_at_lower_boundary import ( - _set_theta_v_prime_ic_at_lower_boundary, -) -from icon4py.model.atmosphere.dycore.compute_horizontal_advection_of_rho_and_theta import ( - _compute_horizontal_advection_of_rho_and_theta, -) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_36 import ( _mo_solve_nonhydro_stencil_36, ) @@ -78,6 +77,9 @@ from icon4py.model.atmosphere.dycore.set_cell_kdim_field_to_zero_vp import ( _set_cell_kdim_field_to_zero_vp, ) +from icon4py.model.atmosphere.dycore.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 _set_zero_c_k, _set_zero_e_k from icon4py.model.common.dimension import CEDim, CellDim, ECDim, EdgeDim, KDim 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/velocity_advection_program.py index e030c8fda6..befafae515 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/velocity_advection_program.py @@ -34,10 +34,10 @@ _correct_contravariant_vertical_velocity, ) from icon4py.model.atmosphere.dycore.extrapolate_at_top import _extrapolate_at_top +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 ( _interpolate_to_half_levels_vp, ) -from icon4py.model.atmosphere.dycore.interpolate_to_cell_center import _interpolate_to_cell_center from icon4py.model.atmosphere.dycore.set_cell_kdim_field_to_zero_vp import ( _set_cell_kdim_field_to_zero_vp, ) diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_velocity_advection_stencil_8_to_14.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_velocity_advection_stencil_8_to_14.py index a4db6a2a8b..148091898c 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_velocity_advection_stencil_8_to_14.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_velocity_advection_stencil_8_to_14.py @@ -34,10 +34,8 @@ from .test_correct_contravariant_vertical_velocity import ( correct_contravariant_vertical_velocity_numpy, ) -from .test_interpolate_to_half_levels_vp import ( - interpolate_to_half_levels_vp_numpy, -) from .test_interpolate_to_cell_center import interpolate_to_cell_center_numpy +from .test_interpolate_to_half_levels_vp import interpolate_to_half_levels_vp_numpy from .test_set_cell_kdim_field_to_zero_vp import set_cell_kdim_field_to_zero_vp_numpy 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 f195dc55e4..9d589e56b0 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 @@ -22,7 +22,10 @@ from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field from icon4py.model.common.type_alias import vpfloat -def interpolate_to_half_levels_vp_numpy(grid, wgtfac_c: np.array, interpolant: np.array) -> np.array: + +def interpolate_to_half_levels_vp_numpy( + grid, wgtfac_c: np.array, interpolant: np.array +) -> np.array: interpolant_offset_1 = np.roll(interpolant, shift=1, axis=1) interpolation_to_half_levels_vp = ( wgtfac_c * interpolant + (1.0 - wgtfac_c) * interpolant_offset_1 @@ -31,13 +34,16 @@ def interpolate_to_half_levels_vp_numpy(grid, wgtfac_c: np.array, interpolant: n return interpolation_to_half_levels_vp + class TestMoSolveNonhydroStencil05(StencilTest): PROGRAM = interpolate_to_half_levels_vp OUTPUTS = ("interpolation_to_half_levels_vp",) @staticmethod def reference(grid, wgtfac_c: np.array, interpolant: np.array, **kwargs) -> dict: - interpolation_to_half_levels_vp = interpolate_to_half_levels_vp_numpy(grid=grid, wgtfac_c=wgtfac_c, interpolant=interpolant) + interpolation_to_half_levels_vp = interpolate_to_half_levels_vp_numpy( + grid=grid, wgtfac_c=wgtfac_c, interpolant=interpolant + ) return dict(interpolation_to_half_levels_vp=interpolation_to_half_levels_vp) @pytest.fixture 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 b3e46c8fdc..bd6574056b 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 @@ -22,17 +22,15 @@ def interpolate_to_surface_numpy( - grid, - interpolant: np.array, - wgtfacq_c: np.array, - interpolation_to_surface: np.array) -> np.array: - interpolation_to_surface[:, 3:] = ( - np.roll(wgtfacq_c, shift=1, axis=1) * np.roll(interpolant, shift=1, axis=1) - + np.roll(wgtfacq_c, shift=2, axis=1) * np.roll(interpolant, shift=2, axis=1) - + np.roll(wgtfacq_c, shift=3, axis=1) * np.roll(interpolant, shift=3, axis=1) - )[:, 3:] - return interpolation_to_surface - + grid, interpolant: np.array, wgtfacq_c: np.array, interpolation_to_surface: np.array +) -> np.array: + interpolation_to_surface[:, 3:] = ( + np.roll(wgtfacq_c, shift=1, axis=1) * np.roll(interpolant, shift=1, axis=1) + + np.roll(wgtfacq_c, shift=2, axis=1) * np.roll(interpolant, shift=2, axis=1) + + np.roll(wgtfacq_c, shift=3, axis=1) * np.roll(interpolant, shift=3, axis=1) + )[:, 3:] + return interpolation_to_surface + class TestMoSolveNonhydroStencil04(StencilTest): PROGRAM = interpolate_to_surface @@ -46,7 +44,12 @@ def reference( interpolation_to_surface: np.array, **kwargs, ) -> dict: - interpolation_to_surface = interpolate_to_surface_numpy(grid=grid, wgtfacq_c=wgtfacq_c, interpolant=interpolant, interpolation_to_surface=interpolation_to_surface) + interpolation_to_surface = interpolate_to_surface_numpy( + grid=grid, + wgtfacq_c=wgtfacq_c, + interpolant=interpolant, + interpolation_to_surface=interpolation_to_surface, + ) return dict(interpolation_to_surface=interpolation_to_surface) @pytest.fixture 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 2e09113b32..284b941961 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 @@ -15,7 +15,6 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from .test_interpolate_to_surface import interpolate_to_surface_numpy from icon4py.model.atmosphere.dycore.set_theta_v_prime_ic_at_lower_boundary import ( set_theta_v_prime_ic_at_lower_boundary, ) @@ -23,6 +22,8 @@ from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field from icon4py.model.common.type_alias import vpfloat, wpfloat +from .test_interpolate_to_surface import interpolate_to_surface_numpy + class TestMoSolveNonhydroStencil11Upper(StencilTest): PROGRAM = set_theta_v_prime_ic_at_lower_boundary @@ -38,7 +39,12 @@ def reference( theta_v_ic: np.array, **kwargs, ) -> dict: - z_theta_v_pr_ic = interpolate_to_surface_numpy(grid=grid,wgtfacq_c=wgtfacq_c,interpolant=z_rth_pr, interpolation_to_surface=z_theta_v_pr_ic) + z_theta_v_pr_ic = interpolate_to_surface_numpy( + grid=grid, + wgtfacq_c=wgtfacq_c, + interpolant=z_rth_pr, + interpolation_to_surface=z_theta_v_pr_ic, + ) theta_v_ic[:, 3:] = (theta_ref_ic + z_theta_v_pr_ic)[:, 3:] return dict(z_theta_v_pr_ic=z_theta_v_pr_ic, theta_v_ic=theta_v_ic) From 9197e86b79d622ef7780964942ea85d03670e719 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Wed, 31 Jan 2024 14:54:02 +0100 Subject: [PATCH 22/60] fix ws --- ...al_gradient_of_exner_pressure_for_flat_surface_coordinates.py | 1 - .../model/atmosphere/dycore/mo_solve_nonhydro_stencil_20.py | 1 - 2 files changed, 2 deletions(-) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates.py index 617dfb60a7..4306f06bd2 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates.py @@ -25,7 +25,6 @@ def _compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates( z_exner_ex_pr: Field[[CellDim, KDim], vpfloat], ) -> Field[[EdgeDim, KDim], vpfloat]: """Formerly konwn as _mo_solve_nonhydro_stencil_18.""" - z_gradh_exner_wp = inv_dual_edge_length * astype( z_exner_ex_pr(E2C[1]) - z_exner_ex_pr(E2C[0]), wpfloat ) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_20.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_20.py index 20b71eb96e..ebc6c99bab 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_20.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_20.py @@ -30,7 +30,6 @@ def _mo_solve_nonhydro_stencil_20( z_dexner_dz_c_2: Field[[CellDim, KDim], vpfloat], ) -> Field[[EdgeDim, KDim], vpfloat]: """Formerly known as _mo_solve_nonhydro_stencil_20.""" - z_exner_ex_pr_0 = z_exner_ex_pr(as_offset(Koff, ikoffset(E2EC[0]))) z_exner_ex_pr_1 = z_exner_ex_pr(as_offset(Koff, ikoffset(E2EC[1]))) From 98694bdde5ef12313cc218de4a1ce151229a60b7 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Wed, 31 Jan 2024 14:56:41 +0100 Subject: [PATCH 23/60] fix --- .../atmosphere/dycore/nh_solve/solve_nonhydro_program.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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/nh_solve/solve_nonhydro_program.py index bc14c1e37d..94527554ce 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/nh_solve/solve_nonhydro_program.py @@ -19,10 +19,9 @@ ) from icon4py.model.atmosphere.dycore.compute_first_vertical_derivative import ( _compute_first_vertical_derivative, +) +from icon4py.model.atmosphere.dycore.compute_horizontal_kinetic_energy import( _compute_horizontal_kinetic_energy, - from, - icon4py.model.atmosphere.dycore.compute_horizontal_kinetic_energy, - import, ) from icon4py.model.atmosphere.dycore.compute_horizontal_advection_of_rho_and_theta import ( _compute_horizontal_advection_of_rho_and_theta, From 6513bcc2861cccb23e365ce32e3d1f95f9a8dfd1 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Wed, 31 Jan 2024 14:57:22 +0100 Subject: [PATCH 24/60] fix --- .../atmosphere/dycore/nh_solve/solve_nonhydro_program.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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/nh_solve/solve_nonhydro_program.py index 94527554ce..e440ab22e5 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/nh_solve/solve_nonhydro_program.py @@ -20,12 +20,12 @@ from icon4py.model.atmosphere.dycore.compute_first_vertical_derivative import ( _compute_first_vertical_derivative, ) -from icon4py.model.atmosphere.dycore.compute_horizontal_kinetic_energy import( - _compute_horizontal_kinetic_energy, -) from icon4py.model.atmosphere.dycore.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 ( + _compute_horizontal_kinetic_energy, +) from icon4py.model.atmosphere.dycore.compute_pertubation_of_rho_and_theta import ( _compute_pertubation_of_rho_and_theta, ) From 07c1f268efb9570a664134a2daa7241e9bf06b2a Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Wed, 31 Jan 2024 15:37:14 +0100 Subject: [PATCH 25/60] rename stencil --- ...ntal_gradient_of_extner_pressure_for_multiple_levels.py} | 6 +++--- .../model/atmosphere/dycore/mo_solve_nonhydro_stencil_21.py | 1 + .../model/atmosphere/dycore/nh_solve/solve_nonhydro.py | 6 +++--- ...ntal_gradient_of_extner_pressure_for_multiple_levels.py} | 6 +++--- 4 files changed, 10 insertions(+), 9 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_20.py => compute_horizontal_gradient_of_extner_pressure_for_multiple_levels.py} (93%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_20.py => test_compute_horizontal_gradient_of_extner_pressure_for_multiple_levels.py} (94%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_20.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_extner_pressure_for_multiple_levels.py similarity index 93% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_20.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_extner_pressure_for_multiple_levels.py index ebc6c99bab..2af6a7cdee 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_20.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_extner_pressure_for_multiple_levels.py @@ -21,7 +21,7 @@ @field_operator -def _mo_solve_nonhydro_stencil_20( +def _compute_horizontal_gradient_of_extner_pressure_for_multiple_levels( inv_dual_edge_length: Field[[EdgeDim], wpfloat], z_exner_ex_pr: Field[[CellDim, KDim], vpfloat], zdiff_gradp: Field[[ECDim, KDim], vpfloat], @@ -59,7 +59,7 @@ def _mo_solve_nonhydro_stencil_20( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_20( +def compute_horizontal_gradient_of_extner_pressure_for_multiple_levels( inv_dual_edge_length: Field[[EdgeDim], wpfloat], z_exner_ex_pr: Field[[CellDim, KDim], vpfloat], zdiff_gradp: Field[[ECDim, KDim], vpfloat], @@ -72,7 +72,7 @@ def mo_solve_nonhydro_stencil_20( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_20( + _compute_horizontal_gradient_of_extner_pressure_for_multiple_levels( inv_dual_edge_length, z_exner_ex_pr, zdiff_gradp, diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_21.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_21.py index ac972c3b83..ae244c317f 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_21.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_21.py @@ -30,6 +30,7 @@ def _mo_solve_nonhydro_stencil_21( inv_dual_edge_length: Field[[EdgeDim], wpfloat], grav_o_cpd: wpfloat, ) -> Field[[EdgeDim, KDim], vpfloat]: + '''Formerly known as _mo_solve_nonhydro_stencil_21.''' zdiff_gradp_wp = astype(zdiff_gradp, wpfloat) theta_v_0 = theta_v(as_offset(Koff, ikoffset(E2EC[0]))) 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/nh_solve/solve_nonhydro.py index 30f817933b..05d94fd8d7 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -49,8 +49,8 @@ from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_4th_order_divdamp import ( mo_solve_nonhydro_4th_order_divdamp, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_20 import ( - mo_solve_nonhydro_stencil_20, +from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_extner_pressure_for_multiple_levels import ( + compute_horizontal_gradient_of_extner_pressure_for_multiple_levels, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_21 import ( mo_solve_nonhydro_stencil_21, @@ -1010,7 +1010,7 @@ def run_predictor_step( }, ) - mo_solve_nonhydro_stencil_20.with_backend(backend)( + compute_horizontal_gradient_of_extner_pressure_for_multiple_levels.with_backend(backend)( inv_dual_edge_length=self.edge_geometry.inverse_dual_edge_lengths, z_exner_ex_pr=self.z_exner_ex_pr, zdiff_gradp=self.metric_state_nonhydro.zdiff_gradp, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_20.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_extner_pressure_for_multiple_levels.py similarity index 94% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_20.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_extner_pressure_for_multiple_levels.py index 0c626cdf91..f45ba1f6c4 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_20.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_extner_pressure_for_multiple_levels.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_20 import ( - mo_solve_nonhydro_stencil_20, +from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_extner_pressure_for_multiple_levels import ( + compute_horizontal_gradient_of_extner_pressure_for_multiple_levels, ) from icon4py.model.common.dimension import CellDim, E2CDim, ECDim, EdgeDim, KDim from icon4py.model.common.test_utils.helpers import ( @@ -29,7 +29,7 @@ class TestMoSolveNonHydroStencil20(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_20 + PROGRAM = compute_horizontal_gradient_of_extner_pressure_for_multiple_levels OUTPUTS = ("z_gradh_exner",) @staticmethod From 62f776d0780ced6768d2d5e1b6ff5eb9a2df68e9 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Wed, 31 Jan 2024 16:21:16 +0100 Subject: [PATCH 26/60] rename stencil --- ...stencil_21.py => compute_hydrostatic_correction_term.py} | 6 +++--- .../model/atmosphere/dycore/mo_solve_nonhydro_stencil_22.py | 1 + .../model/atmosphere/dycore/nh_solve/solve_nonhydro.py | 6 +++--- ...il_21.py => test_compute_hydrostatic_correction_term.py} | 6 +++--- 4 files changed, 10 insertions(+), 9 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_21.py => compute_hydrostatic_correction_term.py} (96%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_21.py => test_compute_hydrostatic_correction_term.py} (96%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_21.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_hydrostatic_correction_term.py similarity index 96% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_21.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_hydrostatic_correction_term.py index ae244c317f..c0955cc4dc 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_21.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_hydrostatic_correction_term.py @@ -21,7 +21,7 @@ @field_operator -def _mo_solve_nonhydro_stencil_21( +def _compute_hydrostatic_correction_term( theta_v: Field[[CellDim, KDim], wpfloat], ikoffset: Field[[ECDim, KDim], int32], zdiff_gradp: Field[[ECDim, KDim], vpfloat], @@ -63,7 +63,7 @@ def _mo_solve_nonhydro_stencil_21( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_21( +def compute_hydrostatic_correction_term( theta_v: Field[[CellDim, KDim], wpfloat], ikoffset: Field[[ECDim, KDim], int32], zdiff_gradp: Field[[ECDim, KDim], vpfloat], @@ -77,7 +77,7 @@ def mo_solve_nonhydro_stencil_21( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_21( + _compute_hydrostatic_correction_term( theta_v, ikoffset, zdiff_gradp, diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_22.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_22.py index bb5004bc63..5575fddcbc 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_22.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_22.py @@ -26,6 +26,7 @@ def _mo_solve_nonhydro_stencil_22( z_hydro_corr: Field[[EdgeDim], vpfloat], z_gradh_exner: Field[[EdgeDim, KDim], vpfloat], ) -> Field[[EdgeDim, KDim], vpfloat]: + '''Formerly known as _mo_solve_nonhydro_stencil_22.''' z_gradh_exner_vp = where(ipeidx_dsl, z_gradh_exner + z_hydro_corr * pg_exdist, z_gradh_exner) return z_gradh_exner_vp 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/nh_solve/solve_nonhydro.py index 05d94fd8d7..a0b251cdb3 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -52,8 +52,8 @@ from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_extner_pressure_for_multiple_levels import ( compute_horizontal_gradient_of_extner_pressure_for_multiple_levels, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_21 import ( - mo_solve_nonhydro_stencil_21, +from icon4py.model.atmosphere.dycore.compute_hydrostatic_correction_term import ( + compute_hydrostatic_correction_term, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_22 import ( mo_solve_nonhydro_stencil_22, @@ -1030,7 +1030,7 @@ def run_predictor_step( ) # compute hydrostatically approximated correction term that replaces downward extrapolation if self.config.igradp_method == 3: - mo_solve_nonhydro_stencil_21.with_backend(backend)( + compute_hydrostatic_correction_term.with_backend(backend)( theta_v=prognostic_state[nnow].theta_v, ikoffset=self.metric_state_nonhydro.vertoffset_gradp, zdiff_gradp=self.metric_state_nonhydro.zdiff_gradp, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_21.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_hydrostatic_correction_term.py similarity index 96% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_21.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_hydrostatic_correction_term.py index 22c7f92507..656b6eaea6 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_21.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_hydrostatic_correction_term.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_21 import ( - mo_solve_nonhydro_stencil_21, +from icon4py.model.atmosphere.dycore.compute_hydrostatic_correction_term import ( + compute_hydrostatic_correction_term, ) from icon4py.model.common.dimension import CellDim, E2CDim, ECDim, EdgeDim, KDim from icon4py.model.common.test_utils.helpers import ( @@ -30,7 +30,7 @@ class TestMoSolveNonHydroStencil21(StencilTest): OUTPUTS = ("z_hydro_corr",) - PROGRAM = mo_solve_nonhydro_stencil_21 + PROGRAM = compute_hydrostatic_correction_term @staticmethod def reference( From 9b7f28213c5c9f393c867c096f10542599e83991 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Wed, 31 Jan 2024 16:39:54 +0100 Subject: [PATCH 27/60] rename stencil --- ..._correction_to_horizontal_gradient_of_exner_pressure.py} | 6 +++--- .../model/atmosphere/dycore/mo_solve_nonhydro_stencil_23.py | 1 + .../model/atmosphere/dycore/nh_solve/solve_nonhydro.py | 6 +++--- ..._correction_to_horizontal_gradient_of_exner_pressure.py} | 6 +++--- 4 files changed, 10 insertions(+), 9 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_22.py => apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure.py} (89%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_22.py => test_apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure.py} (88%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_22.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure.py similarity index 89% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_22.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure.py index 5575fddcbc..61ef45bc2b 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_22.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure.py @@ -20,7 +20,7 @@ @field_operator -def _mo_solve_nonhydro_stencil_22( +def _apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure( ipeidx_dsl: Field[[EdgeDim, KDim], bool], pg_exdist: Field[[EdgeDim, KDim], vpfloat], z_hydro_corr: Field[[EdgeDim], vpfloat], @@ -32,7 +32,7 @@ def _mo_solve_nonhydro_stencil_22( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_22( +def apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure( ipeidx_dsl: Field[[EdgeDim, KDim], bool], pg_exdist: Field[[EdgeDim, KDim], vpfloat], z_hydro_corr: Field[[EdgeDim], vpfloat], @@ -42,7 +42,7 @@ def mo_solve_nonhydro_stencil_22( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_22( + _apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure( ipeidx_dsl, pg_exdist, z_hydro_corr, diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_23.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_23.py index ef016d2096..a73f42fd1b 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_23.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_23.py @@ -32,6 +32,7 @@ def _mo_solve_nonhydro_stencil_23( wgt_nnew_vel: wpfloat, cpd: wpfloat, ) -> Field[[EdgeDim, KDim], wpfloat]: + '''Formerly known as _mo_solve_nonhydro_stencil_23.''' ddt_vn_phy_wp, z_gradh_exner_wp, ddt_vn_apc_ntl1_wp, ddt_vn_apc_ntl2_wp = astype( (ddt_vn_phy, z_gradh_exner, ddt_vn_apc_ntl1, ddt_vn_apc_ntl2), wpfloat ) 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/nh_solve/solve_nonhydro.py index a0b251cdb3..d06fab10f5 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -55,8 +55,8 @@ from icon4py.model.atmosphere.dycore.compute_hydrostatic_correction_term import ( compute_hydrostatic_correction_term, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_22 import ( - mo_solve_nonhydro_stencil_22, +from icon4py.model.atmosphere.dycore.apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure import ( + apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_23 import ( mo_solve_nonhydro_stencil_23, @@ -1054,7 +1054,7 @@ def run_predictor_step( hydro_corr_horizontal = as_field((EdgeDim,), self.z_hydro_corr.asnumpy()[:, lowest_level]) if self.config.igradp_method == 3: - mo_solve_nonhydro_stencil_22.with_backend(backend)( + apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure.with_backend(backend)( ipeidx_dsl=self.metric_state_nonhydro.ipeidx_dsl, pg_exdist=self.metric_state_nonhydro.pg_exdist, z_hydro_corr=hydro_corr_horizontal, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_22.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure.py similarity index 88% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_22.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure.py index d276f67a7d..6b88ac6aea 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_22.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_22 import ( - mo_solve_nonhydro_stencil_22, +from icon4py.model.atmosphere.dycore.apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure import ( + apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure, ) from icon4py.model.common.dimension import EdgeDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, random_mask @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil22(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_22 + PROGRAM = apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure OUTPUTS = ("z_gradh_exner",) @staticmethod From e56112d45a196143bea63186d5d88420a7e8df63 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Wed, 31 Jan 2024 16:41:22 +0100 Subject: [PATCH 28/60] rename stencils --- ...o_horizontal_gradient_of_exner_pressure.py | 2 +- .../compute_hydrostatic_correction_term.py | 2 +- .../dycore/mo_solve_nonhydro_stencil_23.py | 2 +- .../dycore/nh_solve/solve_nonhydro.py | 26 +++++++++++-------- 4 files changed, 18 insertions(+), 14 deletions(-) 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/apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure.py index 61ef45bc2b..85eaf4218a 100644 --- 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/apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure.py @@ -26,7 +26,7 @@ def _apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure( z_hydro_corr: Field[[EdgeDim], vpfloat], z_gradh_exner: Field[[EdgeDim, KDim], vpfloat], ) -> Field[[EdgeDim, KDim], vpfloat]: - '''Formerly known as _mo_solve_nonhydro_stencil_22.''' + """Formerly known as _mo_solve_nonhydro_stencil_22.""" z_gradh_exner_vp = where(ipeidx_dsl, z_gradh_exner + z_hydro_corr * pg_exdist, z_gradh_exner) return z_gradh_exner_vp 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/compute_hydrostatic_correction_term.py index c0955cc4dc..7b16775bdf 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_hydrostatic_correction_term.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_hydrostatic_correction_term.py @@ -30,7 +30,7 @@ def _compute_hydrostatic_correction_term( inv_dual_edge_length: Field[[EdgeDim], wpfloat], grav_o_cpd: wpfloat, ) -> Field[[EdgeDim, KDim], vpfloat]: - '''Formerly known as _mo_solve_nonhydro_stencil_21.''' + """Formerly known as _mo_solve_nonhydro_stencil_21.""" zdiff_gradp_wp = astype(zdiff_gradp, wpfloat) theta_v_0 = theta_v(as_offset(Koff, ikoffset(E2EC[0]))) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_23.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_23.py index a73f42fd1b..7b2f0129a8 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_23.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_23.py @@ -32,7 +32,7 @@ def _mo_solve_nonhydro_stencil_23( wgt_nnew_vel: wpfloat, cpd: wpfloat, ) -> Field[[EdgeDim, KDim], wpfloat]: - '''Formerly known as _mo_solve_nonhydro_stencil_23.''' + """Formerly known as _mo_solve_nonhydro_stencil_23.""" ddt_vn_phy_wp, z_gradh_exner_wp, ddt_vn_apc_ntl1_wp, ddt_vn_apc_ntl2_wp = astype( (ddt_vn_phy, z_gradh_exner, ddt_vn_apc_ntl1, ddt_vn_apc_ntl2), wpfloat ) 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/nh_solve/solve_nonhydro.py index d06fab10f5..8aedd771a3 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -24,15 +24,24 @@ from icon4py.model.atmosphere.dycore.add_vertical_wind_derivative_to_divergence_damping import ( add_vertical_wind_derivative_to_divergence_damping, ) +from icon4py.model.atmosphere.dycore.apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure import ( + apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure, +) from icon4py.model.atmosphere.dycore.compute_approx_of_2nd_vertical_derivative_of_exner import ( compute_approx_of_2nd_vertical_derivative_of_exner, ) from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates import ( compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates, ) +from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_extner_pressure_for_multiple_levels import ( + compute_horizontal_gradient_of_extner_pressure_for_multiple_levels, +) from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates import ( compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates, ) +from icon4py.model.atmosphere.dycore.compute_hydrostatic_correction_term import ( + compute_hydrostatic_correction_term, +) from icon4py.model.atmosphere.dycore.compute_pertubation_of_rho_and_theta import ( compute_pertubation_of_rho_and_theta, ) @@ -49,15 +58,6 @@ from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_4th_order_divdamp import ( mo_solve_nonhydro_4th_order_divdamp, ) -from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_extner_pressure_for_multiple_levels import ( - compute_horizontal_gradient_of_extner_pressure_for_multiple_levels, -) -from icon4py.model.atmosphere.dycore.compute_hydrostatic_correction_term import ( - compute_hydrostatic_correction_term, -) -from icon4py.model.atmosphere.dycore.apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure import ( - apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure, -) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_23 import ( mo_solve_nonhydro_stencil_23, ) @@ -1010,7 +1010,9 @@ def run_predictor_step( }, ) - compute_horizontal_gradient_of_extner_pressure_for_multiple_levels.with_backend(backend)( + compute_horizontal_gradient_of_extner_pressure_for_multiple_levels.with_backend( + backend + )( inv_dual_edge_length=self.edge_geometry.inverse_dual_edge_lengths, z_exner_ex_pr=self.z_exner_ex_pr, zdiff_gradp=self.metric_state_nonhydro.zdiff_gradp, @@ -1054,7 +1056,9 @@ def run_predictor_step( hydro_corr_horizontal = as_field((EdgeDim,), self.z_hydro_corr.asnumpy()[:, lowest_level]) if self.config.igradp_method == 3: - apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure.with_backend(backend)( + apply_hydrostatic_correction_to_horizontal_gradient_of_exner_pressure.with_backend( + backend + )( ipeidx_dsl=self.metric_state_nonhydro.ipeidx_dsl, pg_exdist=self.metric_state_nonhydro.pg_exdist, z_hydro_corr=hydro_corr_horizontal, From 86780d8d8ce15366e3ff0ee8b705e489380ad9c7 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Wed, 31 Jan 2024 16:58:24 +0100 Subject: [PATCH 29/60] rename stencil --- ...endencies_to_vn_by_interpolating_between_time_levels.py} | 6 +++--- .../model/atmosphere/dycore/mo_solve_nonhydro_stencil_24.py | 1 + .../model/atmosphere/dycore/nh_solve/solve_nonhydro.py | 6 +++--- ...endencies_to_vn_by_interpolating_between_time_levels.py} | 6 +++--- 4 files changed, 10 insertions(+), 9 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_23.py => add_temporal_tendencies_to_vn_by_interpolating_between_time_levels.py} (92%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_23.py => test_add_temporal_tendencies_to_vn_by_interpolating_between_time_levels.py} (91%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_23.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_temporal_tendencies_to_vn_by_interpolating_between_time_levels.py similarity index 92% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_23.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_temporal_tendencies_to_vn_by_interpolating_between_time_levels.py index 7b2f0129a8..7a9dc4fcde 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_23.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_temporal_tendencies_to_vn_by_interpolating_between_time_levels.py @@ -20,7 +20,7 @@ @field_operator -def _mo_solve_nonhydro_stencil_23( +def _add_temporal_tendencies_to_vn_by_interpolating_between_time_levels( vn_nnow: Field[[EdgeDim, KDim], wpfloat], ddt_vn_apc_ntl1: Field[[EdgeDim, KDim], vpfloat], ddt_vn_apc_ntl2: Field[[EdgeDim, KDim], vpfloat], @@ -47,7 +47,7 @@ def _mo_solve_nonhydro_stencil_23( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_23( +def add_temporal_tendencies_to_vn_by_interpolating_between_time_levels( vn_nnow: Field[[EdgeDim, KDim], wpfloat], ddt_vn_apc_ntl1: Field[[EdgeDim, KDim], vpfloat], ddt_vn_apc_ntl2: Field[[EdgeDim, KDim], vpfloat], @@ -64,7 +64,7 @@ def mo_solve_nonhydro_stencil_23( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_23( + _add_temporal_tendencies_to_vn_by_interpolating_between_time_levels( vn_nnow, ddt_vn_apc_ntl1, ddt_vn_apc_ntl2, diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_24.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_24.py index 0b77e35d5c..5cacebb923 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_24.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_24.py @@ -29,6 +29,7 @@ def _mo_solve_nonhydro_stencil_24( dtime: wpfloat, cpd: wpfloat, ) -> Field[[EdgeDim, KDim], wpfloat]: + '''Formerly known as _mo_solve_nonhydro_stencil_24.''' z_gradh_exner_wp = astype(z_gradh_exner, wpfloat) vn_nnew_wp = vn_nnow + dtime * ( 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/nh_solve/solve_nonhydro.py index 8aedd771a3..a15d599903 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -58,8 +58,8 @@ from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_4th_order_divdamp import ( mo_solve_nonhydro_4th_order_divdamp, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_23 import ( - mo_solve_nonhydro_stencil_23, +from icon4py.model.atmosphere.dycore.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.mo_solve_nonhydro_stencil_24 import ( mo_solve_nonhydro_stencil_24, @@ -1574,7 +1574,7 @@ def run_corrector_step( if self.config.itime_scheme == 4: log.debug(f"corrector: start stencil 23") - mo_solve_nonhydro_stencil_23.with_backend(backend)( + add_temporal_tendencies_to_vn_by_interpolating_between_time_levels.with_backend(backend)( vn_nnow=prognostic_state[nnow].vn, ddt_vn_apc_ntl1=diagnostic_state_nh.ddt_vn_apc_pc[self.ntl1], ddt_vn_apc_ntl2=diagnostic_state_nh.ddt_vn_apc_pc[self.ntl2], diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_23.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_temporal_tendencies_to_vn_by_interpolating_between_time_levels.py similarity index 91% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_23.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_temporal_tendencies_to_vn_by_interpolating_between_time_levels.py index c3dcf67289..b9a0c32c64 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_23.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_temporal_tendencies_to_vn_by_interpolating_between_time_levels.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_23 import ( - mo_solve_nonhydro_stencil_23, +from icon4py.model.atmosphere.dycore.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.dimension import EdgeDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil23(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_23 + PROGRAM = add_temporal_tendencies_to_vn_by_interpolating_between_time_levels OUTPUTS = ("vn_nnew",) @staticmethod From 099cd947eb084b350ed40934c0255c986ff7ecd6 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Wed, 31 Jan 2024 17:13:29 +0100 Subject: [PATCH 30/60] rename stencil --- ...hydro_stencil_24.py => add_temporal_tendencies_to_vn.py} | 6 +++--- .../model/atmosphere/dycore/mo_solve_nonhydro_stencil_25.py | 1 + .../model/atmosphere/dycore/nh_solve/solve_nonhydro.py | 6 +++--- ..._stencil_24.py => test_add_temporal_tendencies_to_vn.py} | 6 +++--- 4 files changed, 10 insertions(+), 9 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_24.py => add_temporal_tendencies_to_vn.py} (95%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_24.py => test_add_temporal_tendencies_to_vn.py} (93%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_24.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_temporal_tendencies_to_vn.py similarity index 95% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_24.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_temporal_tendencies_to_vn.py index 5cacebb923..e632342138 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_24.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_temporal_tendencies_to_vn.py @@ -20,7 +20,7 @@ @field_operator -def _mo_solve_nonhydro_stencil_24( +def _add_temporal_tendencies_to_vn( vn_nnow: Field[[EdgeDim, KDim], wpfloat], ddt_vn_apc_ntl1: Field[[EdgeDim, KDim], vpfloat], ddt_vn_phy: Field[[EdgeDim, KDim], vpfloat], @@ -41,7 +41,7 @@ def _mo_solve_nonhydro_stencil_24( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_24( +def add_temporal_tendencies_to_vn( vn_nnow: Field[[EdgeDim, KDim], wpfloat], ddt_vn_apc_ntl1: Field[[EdgeDim, KDim], vpfloat], ddt_vn_phy: Field[[EdgeDim, KDim], vpfloat], @@ -55,7 +55,7 @@ def mo_solve_nonhydro_stencil_24( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_24( + _add_temporal_tendencies_to_vn( vn_nnow, ddt_vn_apc_ntl1, ddt_vn_phy, diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_25.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_25.py index e97016d090..0377c8e102 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_25.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_25.py @@ -24,6 +24,7 @@ def _mo_solve_nonhydro_stencil_25( geofac_grdiv: Field[[EdgeDim, E2C2EODim], wpfloat], z_graddiv_vn: Field[[EdgeDim, KDim], vpfloat], ) -> Field[[EdgeDim, KDim], vpfloat]: + '''Formerly known as _mo_solve_nonhydro_stencil_25.''' z_graddiv_vn_wp = astype(z_graddiv_vn, wpfloat) z_graddiv2_vn_wp = neighbor_sum(z_graddiv_vn_wp(E2C2EO) * geofac_grdiv, axis=E2C2EODim) 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/nh_solve/solve_nonhydro.py index a15d599903..a2e90885f6 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -61,8 +61,8 @@ from icon4py.model.atmosphere.dycore.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.mo_solve_nonhydro_stencil_24 import ( - mo_solve_nonhydro_stencil_24, +from icon4py.model.atmosphere.dycore.add_temporal_tendencies_to_vn import ( + add_temporal_tendencies_to_vn, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_25 import ( mo_solve_nonhydro_stencil_25, @@ -1070,7 +1070,7 @@ def run_predictor_step( offset_provider={}, ) - mo_solve_nonhydro_stencil_24.with_backend(backend)( + add_temporal_tendencies_to_vn.with_backend(backend)( vn_nnow=prognostic_state[nnow].vn, ddt_vn_apc_ntl1=diagnostic_state_nh.ddt_vn_apc_pc[self.ntl1], ddt_vn_phy=diagnostic_state_nh.ddt_vn_phy, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_24.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_temporal_tendencies_to_vn.py similarity index 93% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_24.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_temporal_tendencies_to_vn.py index 84260a7840..12760c22ce 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_24.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_temporal_tendencies_to_vn.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_24 import ( - mo_solve_nonhydro_stencil_24, +from icon4py.model.atmosphere.dycore.add_temporal_tendencies_to_vn import ( + add_temporal_tendencies_to_vn, ) from icon4py.model.common.dimension import EdgeDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil24(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_24 + PROGRAM = add_temporal_tendencies_to_vn OUTPUTS = ("vn_nnew",) @staticmethod From 510b74de438a1272052d5ffabc371e0080917cf7 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Thu, 1 Feb 2024 11:20:33 +0100 Subject: [PATCH 31/60] rename --- ...l_26.py => apply_2nd_order_divergence_damping.py} | 7 ++++--- ...hydro_stencil_25.py => compute_graddiv2_of_vn.py} | 6 +++--- .../atmosphere/dycore/nh_solve/solve_nonhydro.py | 12 ++++++------ ...py => test_apply_2nd_order_divergence_damping.py} | 6 +++--- ..._stencil_25.py => test_compute_graddiv2_of_vn.py} | 6 +++--- 5 files changed, 19 insertions(+), 18 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_26.py => apply_2nd_order_divergence_damping.py} (89%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_25.py => compute_graddiv2_of_vn.py} (94%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_26.py => test_apply_2nd_order_divergence_damping.py} (90%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_25.py => test_compute_graddiv2_of_vn.py} (92%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_26.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_2nd_order_divergence_damping.py similarity index 89% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_26.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_2nd_order_divergence_damping.py index 642f642305..fb65184ca7 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_26.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_2nd_order_divergence_damping.py @@ -20,11 +20,12 @@ @field_operator -def _mo_solve_nonhydro_stencil_26( +def _apply_2nd_order_divergence_damping( z_graddiv_vn: Field[[EdgeDim, KDim], vpfloat], vn: Field[[EdgeDim, KDim], wpfloat], scal_divdamp_o2: wpfloat, ) -> Field[[EdgeDim, KDim], wpfloat]: + '''Formerly known as _mo_solve_nonhydro_stencil_26.''' z_graddiv_vn_wp = astype(z_graddiv_vn, wpfloat) vn_wp = vn + (scal_divdamp_o2 * z_graddiv_vn_wp) @@ -32,7 +33,7 @@ def _mo_solve_nonhydro_stencil_26( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_26( +def apply_2nd_order_divergence_damping( z_graddiv_vn: Field[[EdgeDim, KDim], vpfloat], vn: Field[[EdgeDim, KDim], wpfloat], scal_divdamp_o2: wpfloat, @@ -41,7 +42,7 @@ def mo_solve_nonhydro_stencil_26( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_26( + _apply_2nd_order_divergence_damping( z_graddiv_vn, vn, scal_divdamp_o2, diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_25.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_graddiv2_of_vn.py similarity index 94% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_25.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_graddiv2_of_vn.py index 0377c8e102..a0be0e68e5 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_25.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_graddiv2_of_vn.py @@ -20,7 +20,7 @@ @field_operator -def _mo_solve_nonhydro_stencil_25( +def _compute_graddiv2_of_vn( geofac_grdiv: Field[[EdgeDim, E2C2EODim], wpfloat], z_graddiv_vn: Field[[EdgeDim, KDim], vpfloat], ) -> Field[[EdgeDim, KDim], vpfloat]: @@ -32,7 +32,7 @@ def _mo_solve_nonhydro_stencil_25( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_25( +def compute_graddiv2_of_vn( geofac_grdiv: Field[[EdgeDim, E2C2EODim], wpfloat], z_graddiv_vn: Field[[EdgeDim, KDim], vpfloat], z_graddiv2_vn: Field[[EdgeDim, KDim], vpfloat], @@ -41,7 +41,7 @@ def mo_solve_nonhydro_stencil_25( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_25( + _compute_graddiv2_of_vn( geofac_grdiv, z_graddiv_vn, out=z_graddiv2_vn, 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/nh_solve/solve_nonhydro.py index a2e90885f6..2739151bdb 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -64,11 +64,11 @@ from icon4py.model.atmosphere.dycore.add_temporal_tendencies_to_vn import ( add_temporal_tendencies_to_vn, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_25 import ( - mo_solve_nonhydro_stencil_25, +from icon4py.model.atmosphere.dycore.compute_graddiv2_of_vn import ( + compute_graddiv2_of_vn, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_26 import ( - mo_solve_nonhydro_stencil_26, +from icon4py.model.atmosphere.dycore.apply_2nd_order_divergence_damping import ( + apply_2nd_order_divergence_damping, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_27 import ( mo_solve_nonhydro_stencil_27, @@ -1598,7 +1598,7 @@ def run_corrector_step( ): # verified for e-10 log.debug(f"corrector start stencil 25") - mo_solve_nonhydro_stencil_25.with_backend(backend)( + compute_graddiv2_of_vn.with_backend(backend)( geofac_grdiv=self.interpolation_state.geofac_grdiv, z_graddiv_vn=z_fields.z_graddiv_vn, z_graddiv2_vn=self.z_graddiv2_vn, @@ -1614,7 +1614,7 @@ def run_corrector_step( if self.config.lhdiff_rcf: if self.config.divdamp_order == 24 and scal_divdamp_o2 > 1.0e-6: log.debug(f"corrector: start stencil 26") - mo_solve_nonhydro_stencil_26.with_backend(backend)( + apply_2nd_order_divergence_damping.with_backend(backend)( z_graddiv_vn=z_fields.z_graddiv_vn, vn=prognostic_state[nnew].vn, scal_divdamp_o2=scal_divdamp_o2, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_26.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_2nd_order_divergence_damping.py similarity index 90% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_26.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_2nd_order_divergence_damping.py index 0c5454b6ec..2823dc93ae 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_26.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_2nd_order_divergence_damping.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_26 import ( - mo_solve_nonhydro_stencil_26, +from icon4py.model.atmosphere.dycore.apply_2nd_order_divergence_damping import ( + apply_2nd_order_divergence_damping, ) from icon4py.model.common.dimension import EdgeDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil26(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_26 + PROGRAM = apply_2nd_order_divergence_damping OUTPUTS = ("vn",) @staticmethod diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_25.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_graddiv2_of_vn.py similarity index 92% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_25.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_graddiv2_of_vn.py index 7ce30bef74..0b69fcb64f 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_25.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_graddiv2_of_vn.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_25 import ( - mo_solve_nonhydro_stencil_25, +from icon4py.model.atmosphere.dycore.compute_graddiv2_of_vn import ( + compute_graddiv2_of_vn, ) from icon4py.model.common.dimension import E2C2EODim, EdgeDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil25(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_25 + PROGRAM = compute_graddiv2_of_vn OUTPUTS = ("z_graddiv2_vn",) @staticmethod From df1ecf6bfd73e7acf27783f09417c5c464ebdb76 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Thu, 1 Feb 2024 11:31:17 +0100 Subject: [PATCH 32/60] rename --- ...apply_weighted_2nd_and_4th_order_divergence_damping.py} | 7 ++++--- .../atmosphere/dycore/mo_solve_nonhydro_stencil_28.py | 1 + .../model/atmosphere/dycore/nh_solve/solve_nonhydro.py | 6 +++--- ...apply_weighted_2nd_and_4th_order_divergence_damping.py} | 6 +++--- 4 files changed, 11 insertions(+), 9 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_27.py => apply_weighted_2nd_and_4th_order_divergence_damping.py} (89%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_27.py => test_apply_weighted_2nd_and_4th_order_divergence_damping.py} (90%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_27.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_weighted_2nd_and_4th_order_divergence_damping.py similarity index 89% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_27.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_weighted_2nd_and_4th_order_divergence_damping.py index b12f049637..35db716373 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_27.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_weighted_2nd_and_4th_order_divergence_damping.py @@ -20,13 +20,14 @@ @field_operator -def _mo_solve_nonhydro_stencil_27( +def _apply_weighted_2nd_and_4th_order_divergence_damping( scal_divdamp: Field[[KDim], wpfloat], bdy_divdamp: Field[[KDim], wpfloat], nudgecoeff_e: Field[[EdgeDim], wpfloat], z_graddiv2_vn: Field[[EdgeDim, KDim], vpfloat], vn: Field[[EdgeDim, KDim], wpfloat], ) -> Field[[EdgeDim, KDim], wpfloat]: + '''Formelry known as _mo_solve_nonhydro_stencil_27.''' z_graddiv2_vn_wp = astype(z_graddiv2_vn, wpfloat) scal_divdamp = broadcast(scal_divdamp, (EdgeDim, KDim)) @@ -36,7 +37,7 @@ def _mo_solve_nonhydro_stencil_27( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_27( +def apply_weighted_2nd_and_4th_order_divergence_damping( scal_divdamp: Field[[KDim], wpfloat], bdy_divdamp: Field[[KDim], wpfloat], nudgecoeff_e: Field[[EdgeDim], wpfloat], @@ -47,7 +48,7 @@ def mo_solve_nonhydro_stencil_27( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_27( + _apply_weighted_2nd_and_4th_order_divergence_damping( scal_divdamp, bdy_divdamp, nudgecoeff_e, diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_28.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_28.py index 5684537d22..40bea2e7fc 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_28.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_28.py @@ -25,6 +25,7 @@ def _mo_solve_nonhydro_stencil_28( vn: Field[[EdgeDim, KDim], wpfloat], iau_wgt_dyn: wpfloat, ) -> Field[[EdgeDim, KDim], wpfloat]: + '''Formerly known as _mo_solve_nonhydro_stencil_28.''' vn_incr_wp = astype(vn_incr, wpfloat) vn_wp = vn + (iau_wgt_dyn * vn_incr_wp) 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/nh_solve/solve_nonhydro.py index 2739151bdb..2810f2e86e 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -70,8 +70,8 @@ from icon4py.model.atmosphere.dycore.apply_2nd_order_divergence_damping import ( apply_2nd_order_divergence_damping, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_27 import ( - mo_solve_nonhydro_stencil_27, +from icon4py.model.atmosphere.dycore.apply_weighted_2nd_and_4th_order_divergence_damping import ( + apply_weighted_2nd_and_4th_order_divergence_damping, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_28 import ( mo_solve_nonhydro_stencil_28, @@ -1629,7 +1629,7 @@ def run_corrector_step( if self.config.divdamp_order == 24 and divdamp_fac_o2 <= 4 * self.config.divdamp_fac: if self.grid.limited_area: log.debug("corrector: start stencil 27") - mo_solve_nonhydro_stencil_27.with_backend(backend)( + apply_weighted_2nd_and_4th_order_divergence_damping.with_backend(backend)( scal_divdamp=self.scal_divdamp, bdy_divdamp=self._bdy_divdamp, nudgecoeff_e=self.interpolation_state.nudgecoeff_e, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_27.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_weighted_2nd_and_4th_order_divergence_damping.py similarity index 90% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_27.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_weighted_2nd_and_4th_order_divergence_damping.py index 34918f9f47..cfce66f273 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_27.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_apply_weighted_2nd_and_4th_order_divergence_damping.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_27 import ( - mo_solve_nonhydro_stencil_27, +from icon4py.model.atmosphere.dycore.apply_weighted_2nd_and_4th_order_divergence_damping import ( + apply_weighted_2nd_and_4th_order_divergence_damping, ) from icon4py.model.common.dimension import EdgeDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil27(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_27 + PROGRAM = apply_weighted_2nd_and_4th_order_divergence_damping OUTPUTS = ("vn",) @staticmethod From c801293fd5888c52019a106db384ab80e7141dff Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Thu, 1 Feb 2024 11:33:04 +0100 Subject: [PATCH 33/60] cleanup --- .../dycore/add_temporal_tendencies_to_vn.py | 2 +- .../apply_2nd_order_divergence_damping.py | 2 +- ...ed_2nd_and_4th_order_divergence_damping.py | 2 +- .../dycore/compute_graddiv2_of_vn.py | 2 +- .../dycore/mo_solve_nonhydro_stencil_28.py | 2 +- .../dycore/nh_solve/solve_nonhydro.py | 32 +++++++++---------- .../test_compute_graddiv2_of_vn.py | 4 +-- 7 files changed, 22 insertions(+), 24 deletions(-) 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/add_temporal_tendencies_to_vn.py index e632342138..08d6214235 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_temporal_tendencies_to_vn.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_temporal_tendencies_to_vn.py @@ -29,7 +29,7 @@ def _add_temporal_tendencies_to_vn( dtime: wpfloat, cpd: wpfloat, ) -> Field[[EdgeDim, KDim], wpfloat]: - '''Formerly known as _mo_solve_nonhydro_stencil_24.''' + """Formerly known as _mo_solve_nonhydro_stencil_24.""" z_gradh_exner_wp = astype(z_gradh_exner, wpfloat) vn_nnew_wp = vn_nnow + dtime * ( 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/apply_2nd_order_divergence_damping.py index fb65184ca7..e4a3d1c782 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_2nd_order_divergence_damping.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/apply_2nd_order_divergence_damping.py @@ -25,7 +25,7 @@ def _apply_2nd_order_divergence_damping( vn: Field[[EdgeDim, KDim], wpfloat], scal_divdamp_o2: wpfloat, ) -> Field[[EdgeDim, KDim], wpfloat]: - '''Formerly known as _mo_solve_nonhydro_stencil_26.''' + """Formerly known as _mo_solve_nonhydro_stencil_26.""" z_graddiv_vn_wp = astype(z_graddiv_vn, wpfloat) vn_wp = vn + (scal_divdamp_o2 * z_graddiv_vn_wp) 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/apply_weighted_2nd_and_4th_order_divergence_damping.py index 35db716373..16c6ba3fe0 100644 --- 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/apply_weighted_2nd_and_4th_order_divergence_damping.py @@ -27,7 +27,7 @@ def _apply_weighted_2nd_and_4th_order_divergence_damping( z_graddiv2_vn: Field[[EdgeDim, KDim], vpfloat], vn: Field[[EdgeDim, KDim], wpfloat], ) -> Field[[EdgeDim, KDim], wpfloat]: - '''Formelry known as _mo_solve_nonhydro_stencil_27.''' + """Formelry known as _mo_solve_nonhydro_stencil_27.""" z_graddiv2_vn_wp = astype(z_graddiv2_vn, wpfloat) scal_divdamp = broadcast(scal_divdamp, (EdgeDim, KDim)) 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/compute_graddiv2_of_vn.py index a0be0e68e5..3a3a6822ad 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_graddiv2_of_vn.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_graddiv2_of_vn.py @@ -24,7 +24,7 @@ def _compute_graddiv2_of_vn( geofac_grdiv: Field[[EdgeDim, E2C2EODim], wpfloat], z_graddiv_vn: Field[[EdgeDim, KDim], vpfloat], ) -> Field[[EdgeDim, KDim], vpfloat]: - '''Formerly known as _mo_solve_nonhydro_stencil_25.''' + """Formerly known as _mo_solve_nonhydro_stencil_25.""" z_graddiv_vn_wp = astype(z_graddiv_vn, wpfloat) z_graddiv2_vn_wp = neighbor_sum(z_graddiv_vn_wp(E2C2EO) * geofac_grdiv, axis=E2C2EODim) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_28.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_28.py index 40bea2e7fc..1d315ccef5 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_28.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_28.py @@ -25,7 +25,7 @@ def _mo_solve_nonhydro_stencil_28( vn: Field[[EdgeDim, KDim], wpfloat], iau_wgt_dyn: wpfloat, ) -> Field[[EdgeDim, KDim], wpfloat]: - '''Formerly known as _mo_solve_nonhydro_stencil_28.''' + """Formerly known as _mo_solve_nonhydro_stencil_28.""" vn_incr_wp = astype(vn_incr, wpfloat) vn_wp = vn + (iau_wgt_dyn * vn_incr_wp) 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/nh_solve/solve_nonhydro.py index 2810f2e86e..ba3a8d6952 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -21,15 +21,28 @@ import icon4py.model.atmosphere.dycore.nh_solve.solve_nonhydro_program as nhsolve_prog import icon4py.model.common.constants as constants +from icon4py.model.atmosphere.dycore.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 ( + add_temporal_tendencies_to_vn_by_interpolating_between_time_levels, +) from icon4py.model.atmosphere.dycore.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 ( + apply_2nd_order_divergence_damping, +) from icon4py.model.atmosphere.dycore.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_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 ( compute_approx_of_2nd_vertical_derivative_of_exner, ) +from icon4py.model.atmosphere.dycore.compute_graddiv2_of_vn import compute_graddiv2_of_vn from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates import ( compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates, ) @@ -58,21 +71,6 @@ from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_4th_order_divdamp import ( mo_solve_nonhydro_4th_order_divdamp, ) -from icon4py.model.atmosphere.dycore.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_temporal_tendencies_to_vn import ( - add_temporal_tendencies_to_vn, -) -from icon4py.model.atmosphere.dycore.compute_graddiv2_of_vn import ( - compute_graddiv2_of_vn, -) -from icon4py.model.atmosphere.dycore.apply_2nd_order_divergence_damping import ( - apply_2nd_order_divergence_damping, -) -from icon4py.model.atmosphere.dycore.apply_weighted_2nd_and_4th_order_divergence_damping import ( - apply_weighted_2nd_and_4th_order_divergence_damping, -) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_28 import ( mo_solve_nonhydro_stencil_28, ) @@ -1574,7 +1572,9 @@ def run_corrector_step( if self.config.itime_scheme == 4: log.debug(f"corrector: start stencil 23") - add_temporal_tendencies_to_vn_by_interpolating_between_time_levels.with_backend(backend)( + add_temporal_tendencies_to_vn_by_interpolating_between_time_levels.with_backend( + backend + )( vn_nnow=prognostic_state[nnow].vn, ddt_vn_apc_ntl1=diagnostic_state_nh.ddt_vn_apc_pc[self.ntl1], ddt_vn_apc_ntl2=diagnostic_state_nh.ddt_vn_apc_pc[self.ntl2], 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 0b69fcb64f..4a685ff4f3 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 @@ -15,9 +15,7 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.compute_graddiv2_of_vn import ( - compute_graddiv2_of_vn, -) +from icon4py.model.atmosphere.dycore.compute_graddiv2_of_vn import compute_graddiv2_of_vn from icon4py.model.common.dimension import E2C2EODim, EdgeDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field from icon4py.model.common.type_alias import vpfloat, wpfloat From 54a17789e8ca797c95cedcfe3699b22f0983df48 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Thu, 1 Feb 2024 11:48:09 +0100 Subject: [PATCH 34/60] rename --- ...dro_stencil_29.py => compute_vn_on_lateral_boundary.py} | 7 ++++--- .../atmosphere/dycore/mo_solve_nonhydro_stencil_30.py | 1 + .../model/atmosphere/dycore/nh_solve/solve_nonhydro.py | 6 +++--- ...tencil_29.py => test_compute_vn_on_lateral_boundary.py} | 6 +++--- 4 files changed, 11 insertions(+), 9 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_29.py => compute_vn_on_lateral_boundary.py} (90%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_29.py => test_compute_vn_on_lateral_boundary.py} (91%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_29.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_vn_on_lateral_boundary.py similarity index 90% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_29.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_vn_on_lateral_boundary.py index 0bdb9e10f1..bf937d4205 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_29.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_vn_on_lateral_boundary.py @@ -20,17 +20,18 @@ @field_operator -def _mo_solve_nonhydro_stencil_29( +def _compute_vn_on_lateral_boundary( grf_tend_vn: Field[[EdgeDim, KDim], wpfloat], vn_now: Field[[EdgeDim, KDim], wpfloat], dtime: wpfloat, ) -> Field[[EdgeDim, KDim], wpfloat]: + '''Formerly known as _mo_solve_nonhydro_stencil_29.''' vn_new_wp = vn_now + dtime * grf_tend_vn return vn_new_wp @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_29( +def compute_vn_on_lateral_boundary( grf_tend_vn: Field[[EdgeDim, KDim], wpfloat], vn_now: Field[[EdgeDim, KDim], wpfloat], vn_new: Field[[EdgeDim, KDim], wpfloat], @@ -40,7 +41,7 @@ def mo_solve_nonhydro_stencil_29( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_29( + _compute_vn_on_lateral_boundary( grf_tend_vn, vn_now, dtime, diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_30.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_30.py index a8637a17d2..05bc0a9bd4 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_30.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_30.py @@ -34,6 +34,7 @@ def _mo_solve_nonhydro_stencil_30( Field[[EdgeDim, KDim], vpfloat], Field[[EdgeDim, KDim], vpfloat], ]: + '''Formerly known as _mo_solve_nonhydro_stencil_30.''' z_vn_avg_wp = _mo_solve_nonhydro_stencil_31(e_flx_avg=e_flx_avg, vn=vn) z_graddiv_vn_vp = astype(neighbor_sum(geofac_grdiv * vn(E2C2EO), axis=E2C2EODim), vpfloat) vt_vp = _compute_tangential_wind(vn=vn, rbf_vec_coeff_e=rbf_vec_coeff_e) 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/nh_solve/solve_nonhydro.py index ba3a8d6952..15e5260507 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -76,8 +76,8 @@ ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_29 import ( mo_solve_nonhydro_stencil_29, -) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_30 import ( +)compute_vn_on_lateral_boundary +fromcompute_vn_on_lateral_boundarycore.mo_solve_nonhydro_stencil_30 import ( mo_solve_nonhydro_stencil_30, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_31 import ( @@ -1099,7 +1099,7 @@ def run_predictor_step( if self.grid.limited_area: mo_solve_nonhydro_stencil_29.with_backend(backend)( grf_tend_vn=diagnostic_state_nh.grf_tend_vn, - vn_now=prognostic_state[nnow].vn, + compute_vn_on_lateral_boundarynnow].vn, vn_new=prognostic_state[nnew].vn, dtime=dtime, horizontal_start=start_edge_lb, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_29.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_vn_on_lateral_boundary.py similarity index 91% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_29.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_vn_on_lateral_boundary.py index ced830b767..77bdf95b6f 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_29.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_vn_on_lateral_boundary.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_29 import ( - mo_solve_nonhydro_stencil_29, +from icon4py.model.atmosphere.dycore.compute_vn_on_lateral_boundary import ( + compute_vn_on_lateral_boundary, ) from icon4py.model.common.dimension import EdgeDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil29(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_29 + PROGRAM = compute_vn_on_lateral_boundary OUTPUTS = ("vn_new",) @staticmethod From d1a5e9c0b89c1a47469f27a01b094b4ae40eb150 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Thu, 1 Feb 2024 12:01:33 +0100 Subject: [PATCH 35/60] rename --- ...tencil_30.py => compute_avg_vn_and_graddiv_vn_and_vt.py} | 6 +++--- .../model/atmosphere/dycore/mo_solve_nonhydro_stencil_31.py | 1 + .../model/atmosphere/dycore/nh_solve/solve_nonhydro.py | 6 +++--- ...l_30.py => test_compute_avg_vn_and_graddiv_vn_and_vt.py} | 6 +++--- 4 files changed, 10 insertions(+), 9 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_30.py => compute_avg_vn_and_graddiv_vn_and_vt.py} (95%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_30.py => test_compute_avg_vn_and_graddiv_vn_and_vt.py} (94%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_30.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_avg_vn_and_graddiv_vn_and_vt.py similarity index 95% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_30.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_avg_vn_and_graddiv_vn_and_vt.py index 05bc0a9bd4..2ba41ecf54 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_30.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_avg_vn_and_graddiv_vn_and_vt.py @@ -24,7 +24,7 @@ @field_operator -def _mo_solve_nonhydro_stencil_30( +def _compute_avg_vn_and_graddiv_vn_and_vt( e_flx_avg: Field[[EdgeDim, E2C2EODim], wpfloat], vn: Field[[EdgeDim, KDim], wpfloat], geofac_grdiv: Field[[EdgeDim, E2C2EODim], wpfloat], @@ -42,7 +42,7 @@ def _mo_solve_nonhydro_stencil_30( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_30( +def compute_avg_vn_and_graddiv_vn_and_vt( e_flx_avg: Field[[EdgeDim, E2C2EODim], wpfloat], vn: Field[[EdgeDim, KDim], wpfloat], geofac_grdiv: Field[[EdgeDim, E2C2EODim], wpfloat], @@ -55,7 +55,7 @@ def mo_solve_nonhydro_stencil_30( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_30( + _compute_avg_vn_and_graddiv_vn_and_vt( e_flx_avg, vn, geofac_grdiv, diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_31.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_31.py index 0d7d393154..a42b89eca1 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_31.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_31.py @@ -24,6 +24,7 @@ def _mo_solve_nonhydro_stencil_31( e_flx_avg: Field[[EdgeDim, E2C2EODim], wpfloat], vn: Field[[EdgeDim, KDim], wpfloat], ) -> Field[[EdgeDim, KDim], wpfloat]: + '''Formerly known as _mo_solve_nonhydro_stencil_31.''' z_vn_avg_wp = neighbor_sum(e_flx_avg * vn(E2C2EO), axis=E2C2EODim) return z_vn_avg_wp 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/nh_solve/solve_nonhydro.py index 15e5260507..d927986def 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -77,8 +77,8 @@ from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_29 import ( mo_solve_nonhydro_stencil_29, )compute_vn_on_lateral_boundary -fromcompute_vn_on_lateral_boundarycore.mo_solve_nonhydro_stencil_30 import ( - mo_solve_nonhydro_stencil_30, +fromcompute_vn_on_lateral_boundarycore.compute_avg_vn_and_graddiv_vn_and_vt import ( + compute_avg_vn_and_graddiv_vn_and_vt, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_31 import ( mo_solve_nonhydro_stencil_31, @@ -1111,7 +1111,7 @@ def run_predictor_step( log.debug("exchanging prognostic field 'vn' and local field 'z_rho_e'") self._exchange.exchange_and_wait(EdgeDim, prognostic_state[nnew].vn, z_fields.z_rho_e) - mo_solve_nonhydro_stencil_30.with_backend(backend)( + compute_avg_vn_and_graddiv_vn_and_vt.with_backend(backend)( e_flx_avg=self.interpolation_state.e_flx_avg, vn=prognostic_state[nnew].vn, geofac_grdiv=self.interpolation_state.geofac_grdiv, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_30.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_avg_vn_and_graddiv_vn_and_vt.py similarity index 94% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_30.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_avg_vn_and_graddiv_vn_and_vt.py index 75fbeaa6c5..8af31a014f 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_30.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_avg_vn_and_graddiv_vn_and_vt.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_30 import ( - mo_solve_nonhydro_stencil_30, +from icon4py.model.atmosphere.dycore.compute_avg_vn_and_graddiv_vn_and_vt import ( + compute_avg_vn_and_graddiv_vn_and_vt, ) from icon4py.model.common.dimension import E2C2EDim, E2C2EODim, EdgeDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil30(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_30 + PROGRAM = compute_avg_vn_and_graddiv_vn_and_vt OUTPUTS = ("z_vn_avg", "z_graddiv_vn", "vt") @staticmethod From 5076f500997e220ea009119209a19b64dfb18172 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Thu, 1 Feb 2024 12:15:52 +0100 Subject: [PATCH 36/60] rename --- .../{mo_solve_nonhydro_stencil_31.py => compute_avg_vn.py} | 6 +++--- .../dycore/compute_avg_vn_and_graddiv_vn_and_vt.py | 6 +++--- .../model/atmosphere/dycore/mo_solve_nonhydro_stencil_32.py | 1 + .../model/atmosphere/dycore/nh_solve/solve_nonhydro.py | 6 +++--- ..._solve_nonhydro_stencil_31.py => test_compute_avg_vn.py} | 6 +++--- 5 files changed, 13 insertions(+), 12 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_31.py => compute_avg_vn.py} (94%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_31.py => test_compute_avg_vn.py} (92%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_31.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_avg_vn.py similarity index 94% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_31.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_avg_vn.py index a42b89eca1..861fa38ca2 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_31.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_avg_vn.py @@ -20,7 +20,7 @@ @field_operator -def _mo_solve_nonhydro_stencil_31( +def _compute_avg_vn( e_flx_avg: Field[[EdgeDim, E2C2EODim], wpfloat], vn: Field[[EdgeDim, KDim], wpfloat], ) -> Field[[EdgeDim, KDim], wpfloat]: @@ -30,7 +30,7 @@ def _mo_solve_nonhydro_stencil_31( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_31( +def compute_avg_vn( e_flx_avg: Field[[EdgeDim, E2C2EODim], wpfloat], vn: Field[[EdgeDim, KDim], wpfloat], z_vn_avg: Field[[EdgeDim, KDim], wpfloat], @@ -39,7 +39,7 @@ def mo_solve_nonhydro_stencil_31( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_31( + _compute_avg_vn( e_flx_avg, vn, out=z_vn_avg, 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/compute_avg_vn_and_graddiv_vn_and_vt.py index 2ba41ecf54..aef1831145 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/compute_avg_vn_and_graddiv_vn_and_vt.py @@ -16,8 +16,8 @@ from gt4py.next.ffront.fbuiltins import Field, astype, int32, neighbor_sum from icon4py.model.atmosphere.dycore.compute_tangential_wind import _compute_tangential_wind -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_31 import ( - _mo_solve_nonhydro_stencil_31, +from icon4py.model.atmosphere.dycore.compute_avg_vn import ( + _compute_avg_vn, ) from icon4py.model.common.dimension import E2C2EO, E2C2EDim, E2C2EODim, EdgeDim, KDim from icon4py.model.common.type_alias import vpfloat, wpfloat @@ -35,7 +35,7 @@ def _compute_avg_vn_and_graddiv_vn_and_vt( Field[[EdgeDim, KDim], vpfloat], ]: '''Formerly known as _mo_solve_nonhydro_stencil_30.''' - z_vn_avg_wp = _mo_solve_nonhydro_stencil_31(e_flx_avg=e_flx_avg, vn=vn) + z_vn_avg_wp = _compute_avg_vn(e_flx_avg=e_flx_avg, vn=vn) z_graddiv_vn_vp = astype(neighbor_sum(geofac_grdiv * vn(E2C2EO), axis=E2C2EODim), vpfloat) vt_vp = _compute_tangential_wind(vn=vn, rbf_vec_coeff_e=rbf_vec_coeff_e) return z_vn_avg_wp, z_graddiv_vn_vp, vt_vp diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_32.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_32.py index c6a2325586..698c24f178 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_32.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_32.py @@ -26,6 +26,7 @@ def _mo_solve_nonhydro_stencil_32( ddqz_z_full_e: Field[[EdgeDim, KDim], vpfloat], z_theta_v_e: Field[[EdgeDim, KDim], wpfloat], ) -> tuple[Field[[EdgeDim, KDim], wpfloat], Field[[EdgeDim, KDim], wpfloat]]: + '''Formerly known as _mo_solve_nonhydro_stencil_32.''' mass_fl_e_wp = z_rho_e * z_vn_avg * astype(ddqz_z_full_e, wpfloat) z_theta_v_fl_e_wp = mass_fl_e_wp * z_theta_v_e return mass_fl_e_wp, z_theta_v_fl_e_wp 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/nh_solve/solve_nonhydro.py index d927986def..4d385f2ca5 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -80,8 +80,8 @@ fromcompute_vn_on_lateral_boundarycore.compute_avg_vn_and_graddiv_vn_and_vt import ( compute_avg_vn_and_graddiv_vn_and_vt, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_31 import ( - mo_solve_nonhydro_stencil_31, +from icon4py.model.atmosphere.dycore.compute_avg_vn import ( + compute_avg_vn, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_32 import ( mo_solve_nonhydro_stencil_32, @@ -1670,7 +1670,7 @@ def run_corrector_step( log.debug("exchanging prognostic field 'vn'") self._exchange.exchange_and_wait(EdgeDim, (prognostic_state[nnew].vn)) log.debug("corrector: start stencil 31") - mo_solve_nonhydro_stencil_31.with_backend(backend)( + compute_avg_vn.with_backend(backend)( e_flx_avg=self.interpolation_state.e_flx_avg, vn=prognostic_state[nnew].vn, z_vn_avg=self.z_vn_avg, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_31.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_avg_vn.py similarity index 92% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_31.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_avg_vn.py index 131d12ffb6..242e0ae650 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_31.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_avg_vn.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_31 import ( - mo_solve_nonhydro_stencil_31, +from icon4py.model.atmosphere.dycore.compute_avg_vn import ( + compute_avg_vn, ) from icon4py.model.common.dimension import E2C2EODim, EdgeDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil31(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_31 + PROGRAM = compute_avg_vn OUTPUTS = ("z_vn_avg",) @staticmethod From 45194bae040a1d47351e8e5389162d39bcd81bba Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Thu, 1 Feb 2024 12:26:52 +0100 Subject: [PATCH 37/60] rename --- ..._solve_nonhydro_stencil_32.py => compute_mass_flux.py} | 6 +++--- .../atmosphere/dycore/mo_solve_nonhydro_stencil_34.py | 1 + .../model/atmosphere/dycore/nh_solve/solve_nonhydro.py | 8 ++++---- ...e_nonhydro_stencil_32.py => test_compute_mass_flux.py} | 6 +++--- 4 files changed, 11 insertions(+), 10 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_32.py => compute_mass_flux.py} (95%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_32.py => test_compute_mass_flux.py} (93%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_32.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_mass_flux.py similarity index 95% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_32.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_mass_flux.py index 698c24f178..2e3a35037a 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_32.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_mass_flux.py @@ -20,7 +20,7 @@ @field_operator -def _mo_solve_nonhydro_stencil_32( +def _compute_mass_flux( z_rho_e: Field[[EdgeDim, KDim], wpfloat], z_vn_avg: Field[[EdgeDim, KDim], wpfloat], ddqz_z_full_e: Field[[EdgeDim, KDim], vpfloat], @@ -33,7 +33,7 @@ def _mo_solve_nonhydro_stencil_32( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_32( +def compute_mass_flux( z_rho_e: Field[[EdgeDim, KDim], wpfloat], z_vn_avg: Field[[EdgeDim, KDim], wpfloat], ddqz_z_full_e: Field[[EdgeDim, KDim], vpfloat], @@ -45,7 +45,7 @@ def mo_solve_nonhydro_stencil_32( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_32( + _compute_mass_flux( z_rho_e, z_vn_avg, ddqz_z_full_e, diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_34.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_34.py index dde8002600..6234f01e4f 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_34.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_34.py @@ -27,6 +27,7 @@ def _mo_solve_nonhydro_stencil_34( mass_flx_me: Field[[EdgeDim, KDim], wpfloat], r_nsubsteps: wpfloat, ) -> tuple[Field[[EdgeDim, KDim], wpfloat], Field[[EdgeDim, KDim], wpfloat]]: + '''Formerly kown as _mo_solve_nonhydro_stencil_34.''' vn_traj_wp = vn_traj + r_nsubsteps * z_vn_avg mass_flx_me_wp = mass_flx_me + r_nsubsteps * mass_fl_e return vn_traj_wp, mass_flx_me_wp 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/nh_solve/solve_nonhydro.py index 4d385f2ca5..3844027cea 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -83,8 +83,8 @@ from icon4py.model.atmosphere.dycore.compute_avg_vn import ( compute_avg_vn, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_32 import ( - mo_solve_nonhydro_stencil_32, +from icon4py.model.atmosphere.dycore.compute_mass_flux import ( + compute_mass_flux, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_34 import ( mo_solve_nonhydro_stencil_34, @@ -1130,7 +1130,7 @@ def run_predictor_step( ) if self.config.idiv_method == 1: - mo_solve_nonhydro_stencil_32.with_backend(backend)( + compute_mass_flux.with_backend(backend)( z_rho_e=z_fields.z_rho_e, z_vn_avg=self.z_vn_avg, ddqz_z_full_e=self.metric_state_nonhydro.ddqz_z_full_e, @@ -1685,7 +1685,7 @@ def run_corrector_step( if self.config.idiv_method == 1: log.debug("corrector: start stencil 32") - mo_solve_nonhydro_stencil_32.with_backend(backend)( + compute_mass_flux.with_backend(backend)( z_rho_e=z_fields.z_rho_e, z_vn_avg=self.z_vn_avg, ddqz_z_full_e=self.metric_state_nonhydro.ddqz_z_full_e, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_32.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_mass_flux.py similarity index 93% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_32.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_mass_flux.py index 20c32c5941..eb15343a54 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_32.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_mass_flux.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_32 import ( - mo_solve_nonhydro_stencil_32, +from icon4py.model.atmosphere.dycore.compute_mass_flux import ( + compute_mass_flux, ) from icon4py.model.common.dimension import EdgeDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil32(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_32 + PROGRAM = compute_mass_flux OUTPUTS = ("mass_fl_e", "z_theta_v_fl_e") @staticmethod From 7a2385107161e87be45d3ccf3f9aeec14c6f64d1 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Thu, 1 Feb 2024 13:05:24 +0100 Subject: [PATCH 38/60] rename --- ...nonhydro_stencil_34.py => accumulate_prep_adv_fields.py} | 6 +++--- .../model/atmosphere/dycore/nh_solve/solve_nonhydro.py | 6 +++--- ...dro_stencil_34.py => test_accumulate_prep_adv_fields.py} | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_34.py => accumulate_prep_adv_fields.py} (94%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_34.py => test_accumulate_prep_adv_fields.py} (93%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_34.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/accumulate_prep_adv_fields.py similarity index 94% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_34.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/accumulate_prep_adv_fields.py index 6234f01e4f..1e7e7d1769 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_34.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/accumulate_prep_adv_fields.py @@ -20,7 +20,7 @@ @field_operator -def _mo_solve_nonhydro_stencil_34( +def _accumulate_prep_adv_fields( z_vn_avg: Field[[EdgeDim, KDim], wpfloat], mass_fl_e: Field[[EdgeDim, KDim], wpfloat], vn_traj: Field[[EdgeDim, KDim], wpfloat], @@ -34,7 +34,7 @@ def _mo_solve_nonhydro_stencil_34( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_34( +def accumulate_prep_adv_fields( z_vn_avg: Field[[EdgeDim, KDim], wpfloat], mass_fl_e: Field[[EdgeDim, KDim], wpfloat], vn_traj: Field[[EdgeDim, KDim], wpfloat], @@ -45,7 +45,7 @@ def mo_solve_nonhydro_stencil_34( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_34( + _accumulate_prep_adv_fields( z_vn_avg, mass_fl_e, vn_traj, 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/nh_solve/solve_nonhydro.py index 3844027cea..bc69ae15ee 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -86,8 +86,8 @@ from icon4py.model.atmosphere.dycore.compute_mass_flux import ( compute_mass_flux, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_34 import ( - mo_solve_nonhydro_stencil_34, +from icon4py.model.atmosphere.dycore.accumulate_prep_adv_fields import ( + accumulate_prep_adv_fields, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_41 import ( mo_solve_nonhydro_stencil_41, @@ -1713,7 +1713,7 @@ def run_corrector_step( offset_provider={}, ) log.debug(f"corrector: start stencil 34") - mo_solve_nonhydro_stencil_34.with_backend(backend)( + accumulate_prep_adv_fields.with_backend(backend)( z_vn_avg=self.z_vn_avg, mass_fl_e=diagnostic_state_nh.mass_fl_e, vn_traj=prep_adv.vn_traj, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_34.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_accumulate_prep_adv_fields.py similarity index 93% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_34.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_accumulate_prep_adv_fields.py index d21c45e619..47c69398b6 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_34.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_accumulate_prep_adv_fields.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_34 import ( - mo_solve_nonhydro_stencil_34, +from icon4py.model.atmosphere.dycore.accumulate_prep_adv_fields import ( + accumulate_prep_adv_fields, ) from icon4py.model.common.dimension import EdgeDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil34(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_34 + PROGRAM = accumulate_prep_adv_fields OUTPUTS = ("vn_traj", "mass_flx_me") @staticmethod From 07f59480a86a1081667384526d51b0d33cb2362f Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Thu, 1 Feb 2024 13:40:48 +0100 Subject: [PATCH 39/60] rename --- ...terpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges.py} | 7 ++++--- .../atmosphere/dycore/nh_solve/solve_nonhydro_program.py | 6 +++--- ...terpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges.py} | 6 +++--- 3 files changed, 10 insertions(+), 9 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_36.py => interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges.py} (90%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_36.py => testinterpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges.py} (91%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_36.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges.py similarity index 90% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_36.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges.py index 23b5140e2e..03ac81e489 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_36.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges.py @@ -24,7 +24,7 @@ @field_operator -def _mo_solve_nonhydro_stencil_36( +def _interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges( wgtfac_e: Field[[EdgeDim, KDim], vpfloat], vn: Field[[EdgeDim, KDim], wpfloat], vt: Field[[EdgeDim, KDim], vpfloat], @@ -33,6 +33,7 @@ def _mo_solve_nonhydro_stencil_36( Field[[EdgeDim, KDim], vpfloat], Field[[EdgeDim, KDim], vpfloat], ]: + '''Formerly known as _mo_solve_nonhydro_stencil_36.''' z_vt_ie = _interpolate_vt_to_ie(wgtfac_e=wgtfac_e, vt=vt) vn_ie, z_kin_hor_e = _interpolate_vn_to_ie_and_compute_ekin_on_edges( wgtfac_e=wgtfac_e, vn=vn, vt=vt @@ -41,7 +42,7 @@ def _mo_solve_nonhydro_stencil_36( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_36( +def interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges( wgtfac_e: Field[[EdgeDim, KDim], vpfloat], vn: Field[[EdgeDim, KDim], wpfloat], vt: Field[[EdgeDim, KDim], vpfloat], @@ -53,7 +54,7 @@ def mo_solve_nonhydro_stencil_36( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_36( + _interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges( wgtfac_e, vn, vt, 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/nh_solve/solve_nonhydro_program.py index e440ab22e5..cb6b0cb447 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/nh_solve/solve_nonhydro_program.py @@ -43,8 +43,8 @@ _interpolate_to_half_levels_vp, ) from icon4py.model.atmosphere.dycore.interpolate_to_surface import _interpolate_to_surface -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_36 import ( - _mo_solve_nonhydro_stencil_36, +from icon4py.model.atmosphere.dycore.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.mo_solve_nonhydro_stencil_39 import ( _mo_solve_nonhydro_stencil_39, @@ -474,7 +474,7 @@ def _predictor_stencils_35_36( ) (vn_ie, z_vt_ie, z_kin_hor_e) = where( k_field >= int32(1), - _mo_solve_nonhydro_stencil_36(wgtfac_e, vn, vt), + _interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges(wgtfac_e, vn, vt), (vn_ie, z_vt_ie, z_kin_hor_e), ) return z_w_concorr_me, vn_ie, z_vt_ie, z_kin_hor_e diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_36.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/testinterpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges.py similarity index 91% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_36.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/testinterpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges.py index 9151fa8bf7..b04c7ed172 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_36.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/testinterpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_36 import ( - mo_solve_nonhydro_stencil_36, +from icon4py.model.atmosphere.dycore.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.dimension import EdgeDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil36(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_36 + PROGRAM = interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges OUTPUTS = ("vn_ie", "z_vt_ie", "z_kin_hor_e") @staticmethod From 2556d769ac21cb123363abf0232e01c851733906 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Thu, 1 Feb 2024 13:57:56 +0100 Subject: [PATCH 40/60] rename --- ..._39.py => compute_contravariant_correction_of_w.py} | 7 ++++--- .../dycore/fused_solve_nonhydro_stencil_39_40.py | 6 +++--- .../dycore/nh_solve/solve_nonhydro_program.py | 6 +++--- ...y => test_compute_contravariant_correction_of_w.py} | 10 +++++----- .../test_fused_solve_nonhydro_stencil_39_40.py | 4 ++-- 5 files changed, 17 insertions(+), 16 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_39.py => compute_contravariant_correction_of_w.py} (92%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_39.py => test_compute_contravariant_correction_of_w.py} (88%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_39.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_contravariant_correction_of_w.py similarity index 92% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_39.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_contravariant_correction_of_w.py index 211dfe0906..12ee48d406 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_39.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_contravariant_correction_of_w.py @@ -20,11 +20,12 @@ @field_operator -def _mo_solve_nonhydro_stencil_39( +def _compute_contravariant_correction_of_w( e_bln_c_s: Field[[CEDim], wpfloat], z_w_concorr_me: Field[[EdgeDim, KDim], vpfloat], wgtfac_c: Field[[CellDim, KDim], vpfloat], ) -> Field[[CellDim, KDim], vpfloat]: + '''Formerly known as _mo_solve_nonhydro_stencil_39.''' z_w_concorr_me_offset_1 = z_w_concorr_me(Koff[-1]) z_w_concorr_me_wp, z_w_concorr_me_offset_1_wp = astype( @@ -46,7 +47,7 @@ def _mo_solve_nonhydro_stencil_39( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_39( +def compute_contravariant_correction_of_w( e_bln_c_s: Field[[CEDim], wpfloat], z_w_concorr_me: Field[[EdgeDim, KDim], vpfloat], wgtfac_c: Field[[CellDim, KDim], vpfloat], @@ -56,7 +57,7 @@ def mo_solve_nonhydro_stencil_39( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_39( + _compute_contravariant_correction_of_w( e_bln_c_s, z_w_concorr_me, wgtfac_c, 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/fused_solve_nonhydro_stencil_39_40.py index 8b67ea105f..175a79bd4c 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/fused_solve_nonhydro_stencil_39_40.py @@ -14,8 +14,8 @@ from gt4py.next.ffront.decorator import GridType, field_operator, program from gt4py.next.ffront.fbuiltins import Field, int32, where -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_39 import ( - _mo_solve_nonhydro_stencil_39, +from icon4py.model.atmosphere.dycore.compute_contravariant_correction_of_w import ( + _compute_contravariant_correction_of_w, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_40 import ( _mo_solve_nonhydro_stencil_40, @@ -36,7 +36,7 @@ def _fused_solve_nonhydro_stencil_39_40( ) -> Field[[CellDim, KDim], vpfloat]: w_concorr_c = where( nflatlev + 1 <= vert_idx < nlev, - _mo_solve_nonhydro_stencil_39(e_bln_c_s, z_w_concorr_me, wgtfac_c), + _compute_contravariant_correction_of_w(e_bln_c_s, z_w_concorr_me, wgtfac_c), _mo_solve_nonhydro_stencil_40(e_bln_c_s, z_w_concorr_me, wgtfacq_c), ) return w_concorr_c 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/nh_solve/solve_nonhydro_program.py index cb6b0cb447..ccf9c17086 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/nh_solve/solve_nonhydro_program.py @@ -46,8 +46,8 @@ from icon4py.model.atmosphere.dycore.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.mo_solve_nonhydro_stencil_39 import ( - _mo_solve_nonhydro_stencil_39, +from icon4py.model.atmosphere.dycore.compute_contravariant_correction_of_w import ( + _compute_contravariant_correction_of_w, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_40 import ( _mo_solve_nonhydro_stencil_40, @@ -564,7 +564,7 @@ def _stencils_39_40( ) -> Field[[CellDim, KDim], float]: w_concorr_c = where( k_field >= nflatlev_startindex_plus1, # TODO: @abishekg7 does this need to change - _mo_solve_nonhydro_stencil_39(e_bln_c_s, z_w_concorr_me, wgtfac_c), + _compute_contravariant_correction_of_w(e_bln_c_s, z_w_concorr_me, wgtfac_c), w_concorr_c, ) diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_39.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_contravariant_correction_of_w.py similarity index 88% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_39.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_contravariant_correction_of_w.py index fcbb48237d..f8fd71f259 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_39.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_contravariant_correction_of_w.py @@ -15,15 +15,15 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_39 import ( - mo_solve_nonhydro_stencil_39, +from icon4py.model.atmosphere.dycore.compute_contravariant_correction_of_w import ( + compute_contravariant_correction_of_w, ) from icon4py.model.common.dimension import C2EDim, CEDim, CellDim, EdgeDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field from icon4py.model.common.type_alias import vpfloat, wpfloat -def mo_solve_nonhydro_stencil_39_numpy( +def compute_contravariant_correction_of_w_numpy( grid, e_bln_c_s: np.array, z_w_concorr_me: np.array, wgtfac_c: np.array ) -> np.array: c2e = grid.connectivities[C2EDim] @@ -40,7 +40,7 @@ def mo_solve_nonhydro_stencil_39_numpy( class TestMoSolveNonhydroStencil39(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_39 + PROGRAM = compute_contravariant_correction_of_w OUTPUTS = ("w_concorr_c",) @staticmethod @@ -51,7 +51,7 @@ def reference( wgtfac_c: np.array, **kwargs, ) -> dict: - w_concorr_c = mo_solve_nonhydro_stencil_39_numpy(grid, e_bln_c_s, z_w_concorr_me, wgtfac_c) + w_concorr_c = compute_contravariant_correction_of_w_numpy(grid, e_bln_c_s, z_w_concorr_me, wgtfac_c) return dict(w_concorr_c=w_concorr_c) @pytest.fixture 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 7376f8acca..24715e340f 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 @@ -22,7 +22,7 @@ from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field from icon4py.model.common.type_alias import vpfloat, wpfloat -from .test_mo_solve_nonhydro_stencil_39 import mo_solve_nonhydro_stencil_39_numpy +from .test_compute_contravariant_correction_of_w import compute_contravariant_correction_of_w_numpy from .test_mo_solve_nonhydro_stencil_40 import mo_solve_nonhydro_stencil_40_numpy @@ -31,7 +31,7 @@ def _fused_solve_nonhydro_stencil_39_40_numpy( ): w_concorr_c = np.where( (nflatlev < vert_idx) & (vert_idx < nlev), - mo_solve_nonhydro_stencil_39_numpy(grid, e_bln_c_s, z_w_concorr_me, wgtfac_c), + compute_contravariant_correction_of_w_numpy(grid, e_bln_c_s, z_w_concorr_me, wgtfac_c), mo_solve_nonhydro_stencil_40_numpy(grid, e_bln_c_s, z_w_concorr_me, wgtfacq_c), ) From 65aea11f4a24e140795f5699537ef95a52161dbe Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Thu, 1 Feb 2024 14:07:55 +0100 Subject: [PATCH 41/60] rename --- ...ontravariant_correction_of_w_for_lower_boundary.py} | 7 ++++--- .../dycore/fused_solve_nonhydro_stencil_39_40.py | 6 +++--- .../dycore/nh_solve/solve_nonhydro_program.py | 6 +++--- ...ontravariant_correction_of_w_for_lower_boundary.py} | 10 +++++----- .../test_fused_solve_nonhydro_stencil_39_40.py | 4 ++-- 5 files changed, 17 insertions(+), 16 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_40.py => compute_contravariant_correction_of_w_for_lower_boundary.py} (91%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_40.py => test_compute_contravariant_correction_of_w_for_lower_boundary.py} (87%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_40.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_contravariant_correction_of_w_for_lower_boundary.py similarity index 91% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_40.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_contravariant_correction_of_w_for_lower_boundary.py index ff06795e70..b68ba3fe55 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_40.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_contravariant_correction_of_w_for_lower_boundary.py @@ -20,11 +20,12 @@ @field_operator -def _mo_solve_nonhydro_stencil_40( +def _compute_contravariant_correction_of_w_for_lower_boundary( e_bln_c_s: Field[[CEDim], wpfloat], z_w_concorr_me: Field[[EdgeDim, KDim], vpfloat], wgtfacq_c: Field[[CellDim, KDim], vpfloat], ) -> Field[[CellDim, KDim], vpfloat]: + '''Formerly known as _mo_solve_nonhydro_stencil_40.''' z_w_concorr_me_wp = astype(z_w_concorr_me, wpfloat) z_w_concorr_me_offset_1 = z_w_concorr_me_wp(Koff[-1]) @@ -48,7 +49,7 @@ def _mo_solve_nonhydro_stencil_40( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_40( +def compute_contravariant_correction_of_w_for_lower_boundary( e_bln_c_s: Field[[CEDim], wpfloat], z_w_concorr_me: Field[[EdgeDim, KDim], vpfloat], wgtfacq_c: Field[[CellDim, KDim], vpfloat], @@ -58,7 +59,7 @@ def mo_solve_nonhydro_stencil_40( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_40( + _compute_contravariant_correction_of_w_for_lower_boundary( e_bln_c_s, z_w_concorr_me, wgtfacq_c, 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/fused_solve_nonhydro_stencil_39_40.py index 175a79bd4c..203a0408ee 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/fused_solve_nonhydro_stencil_39_40.py @@ -17,8 +17,8 @@ from icon4py.model.atmosphere.dycore.compute_contravariant_correction_of_w import ( _compute_contravariant_correction_of_w, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_40 import ( - _mo_solve_nonhydro_stencil_40, +from icon4py.model.atmosphere.dycore.compute_contravariant_correction_of_w_for_lower_boundary import ( + _compute_contravariant_correction_of_w_for_lower_boundary, ) from icon4py.model.common.dimension import CEDim, CellDim, EdgeDim, KDim from icon4py.model.common.type_alias import vpfloat, wpfloat @@ -37,7 +37,7 @@ def _fused_solve_nonhydro_stencil_39_40( w_concorr_c = where( nflatlev + 1 <= vert_idx < nlev, _compute_contravariant_correction_of_w(e_bln_c_s, z_w_concorr_me, wgtfac_c), - _mo_solve_nonhydro_stencil_40(e_bln_c_s, z_w_concorr_me, wgtfacq_c), + _compute_contravariant_correction_of_w_for_lower_boundary(e_bln_c_s, z_w_concorr_me, wgtfacq_c), ) return w_concorr_c 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/nh_solve/solve_nonhydro_program.py index ccf9c17086..02c8267064 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/nh_solve/solve_nonhydro_program.py @@ -49,8 +49,8 @@ from icon4py.model.atmosphere.dycore.compute_contravariant_correction_of_w import ( _compute_contravariant_correction_of_w, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_40 import ( - _mo_solve_nonhydro_stencil_40, +from icon4py.model.atmosphere.dycore.compute_contravariant_correction_of_w_for_lower_boundary import ( + _compute_contravariant_correction_of_w_for_lower_boundary, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_42 import ( _mo_solve_nonhydro_stencil_42, @@ -570,7 +570,7 @@ def _stencils_39_40( w_concorr_c = where( k_field == nlev, - _mo_solve_nonhydro_stencil_40(e_bln_c_s, z_w_concorr_me, wgtfacq_c_dsl), + _compute_contravariant_correction_of_w_for_lower_boundary(e_bln_c_s, z_w_concorr_me, wgtfacq_c_dsl), w_concorr_c, ) diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_40.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_contravariant_correction_of_w_for_lower_boundary.py similarity index 87% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_40.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_contravariant_correction_of_w_for_lower_boundary.py index f4ca2ffd1d..93f9c258ac 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_40.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_contravariant_correction_of_w_for_lower_boundary.py @@ -15,15 +15,15 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_40 import ( - mo_solve_nonhydro_stencil_40, +from icon4py.model.atmosphere.dycore.compute_contravariant_correction_of_w_for_lower_boundary import ( + compute_contravariant_correction_of_w_for_lower_boundary, ) from icon4py.model.common.dimension import C2EDim, CEDim, CellDim, EdgeDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field from icon4py.model.common.type_alias import vpfloat, wpfloat -def mo_solve_nonhydro_stencil_40_numpy( +def compute_contravariant_correction_of_w_for_lower_boundary_numpy( grid, e_bln_c_s: np.array, z_w_concorr_me: np.array, wgtfacq_c: np.array ) -> np.array: c2e = grid.connectivities[C2EDim] @@ -50,7 +50,7 @@ def mo_solve_nonhydro_stencil_40_numpy( class TestMoSolveNonhydroStencil40(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_40 + PROGRAM = compute_contravariant_correction_of_w_for_lower_boundary OUTPUTS = ("w_concorr_c",) @staticmethod @@ -61,7 +61,7 @@ def reference( wgtfacq_c: np.array, **kwargs, ) -> dict: - w_concorr_c = mo_solve_nonhydro_stencil_40_numpy(grid, e_bln_c_s, z_w_concorr_me, wgtfacq_c) + w_concorr_c = compute_contravariant_correction_of_w_for_lower_boundary_numpy(grid, e_bln_c_s, z_w_concorr_me, wgtfacq_c) return dict(w_concorr_c=w_concorr_c) @pytest.fixture 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 24715e340f..03448e7da9 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 @@ -23,7 +23,7 @@ from icon4py.model.common.type_alias import vpfloat, wpfloat from .test_compute_contravariant_correction_of_w import compute_contravariant_correction_of_w_numpy -from .test_mo_solve_nonhydro_stencil_40 import mo_solve_nonhydro_stencil_40_numpy +from .test_compute_contravariant_correction_of_w_for_lower_boundary import compute_contravariant_correction_of_w_for_lower_boundary_numpy def _fused_solve_nonhydro_stencil_39_40_numpy( @@ -32,7 +32,7 @@ def _fused_solve_nonhydro_stencil_39_40_numpy( w_concorr_c = np.where( (nflatlev < vert_idx) & (vert_idx < nlev), compute_contravariant_correction_of_w_numpy(grid, e_bln_c_s, z_w_concorr_me, wgtfac_c), - mo_solve_nonhydro_stencil_40_numpy(grid, e_bln_c_s, z_w_concorr_me, wgtfacq_c), + compute_contravariant_correction_of_w_for_lower_boundary_numpy(grid, e_bln_c_s, z_w_concorr_me, wgtfacq_c), ) w_concorr_c_res = np.zeros_like(w_concorr_c) From a235f5f574fffdfa0127c57d453f93276d3cdc9c Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Thu, 1 Feb 2024 14:29:28 +0100 Subject: [PATCH 42/60] rename --- ...y => compute_divergence_of_fluxes_of_rho_and_theta.py} | 7 ++++--- .../atmosphere/dycore/mo_solve_nonhydro_stencil_42.py | 1 + .../model/atmosphere/dycore/nh_solve/solve_nonhydro.py | 8 ++++---- ...est_mcompute_divergence_of_fluxes_of_rho_and_theta.py} | 6 +++--- 4 files changed, 12 insertions(+), 10 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_41.py => compute_divergence_of_fluxes_of_rho_and_theta.py} (90%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_41.py => test_mcompute_divergence_of_fluxes_of_rho_and_theta.py} (92%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_41.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_divergence_of_fluxes_of_rho_and_theta.py similarity index 90% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_41.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_divergence_of_fluxes_of_rho_and_theta.py index 85ffb710b1..df85cc3bf6 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_41.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_divergence_of_fluxes_of_rho_and_theta.py @@ -20,18 +20,19 @@ @field_operator -def _mo_solve_nonhydro_stencil_41( +def _compute_divergence_of_fluxes_of_rho_and_theta( geofac_div: Field[[CEDim], wpfloat], mass_fl_e: Field[[EdgeDim, KDim], wpfloat], z_theta_v_fl_e: Field[[EdgeDim, KDim], wpfloat], ) -> tuple[Field[[CellDim, KDim], vpfloat], Field[[CellDim, KDim], vpfloat]]: + '''Formerly known as _mo_solve_nonhydro_stencil_41.''' z_flxdiv_mass_wp = neighbor_sum(geofac_div(C2CE) * mass_fl_e(C2E), axis=C2EDim) z_flxdiv_theta_wp = neighbor_sum(geofac_div(C2CE) * z_theta_v_fl_e(C2E), axis=C2EDim) return astype((z_flxdiv_mass_wp, z_flxdiv_theta_wp), vpfloat) @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_41( +def compute_divergence_of_fluxes_of_rho_and_theta( geofac_div: Field[[CEDim], wpfloat], mass_fl_e: Field[[EdgeDim, KDim], wpfloat], z_theta_v_fl_e: Field[[EdgeDim, KDim], wpfloat], @@ -42,7 +43,7 @@ def mo_solve_nonhydro_stencil_41( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_41( + _compute_divergence_of_fluxes_of_rho_and_theta( geofac_div, mass_fl_e, z_theta_v_fl_e, diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_42.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_42.py index b30a9b1627..20ac198a2c 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_42.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_42.py @@ -33,6 +33,7 @@ def _mo_solve_nonhydro_stencil_42( wgt_nnew_vel: wpfloat, cpd: wpfloat, ) -> tuple[Field[[CellDim, KDim], wpfloat], Field[[CellDim, KDim], wpfloat]]: + '''Formerly known as _mo_solve_nonhydro_stencil_42.''' ddt_w_adv_ntl1_wp, ddt_w_adv_ntl2_wp, z_th_ddz_exner_c_wp, w_concorr_c_wp = astype( (ddt_w_adv_ntl1, ddt_w_adv_ntl2, z_th_ddz_exner_c, w_concorr_c), wpfloat ) 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/nh_solve/solve_nonhydro.py index bc69ae15ee..a0b485c9b1 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -89,8 +89,8 @@ from icon4py.model.atmosphere.dycore.accumulate_prep_adv_fields import ( accumulate_prep_adv_fields, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_41 import ( - mo_solve_nonhydro_stencil_41, +from icon4py.model.atmosphere.dycore.compute_divergence_of_fluxes_of_rho_and_theta import ( + compute_divergence_of_fluxes_of_rho_and_theta, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_50 import ( mo_solve_nonhydro_stencil_50, @@ -1199,7 +1199,7 @@ def run_predictor_step( ) if self.config.idiv_method == 1: - mo_solve_nonhydro_stencil_41.with_backend(backend)( + compute_divergence_of_fluxes_of_rho_and_theta.with_backend(backend)( geofac_div=self.interpolation_state.geofac_div, mass_fl_e=diagnostic_state_nh.mass_fl_e, z_theta_v_fl_e=self.z_theta_v_fl_e, @@ -1729,7 +1729,7 @@ def run_corrector_step( if self.config.idiv_method == 1: # verified for e-9 log.debug(f"corrector: start stencile 41") - mo_solve_nonhydro_stencil_41.with_backend(backend)( + compute_divergence_of_fluxes_of_rho_and_theta.with_backend(backend)( geofac_div=self.interpolation_state.geofac_div, mass_fl_e=diagnostic_state_nh.mass_fl_e, z_theta_v_fl_e=self.z_theta_v_fl_e, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_41.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mcompute_divergence_of_fluxes_of_rho_and_theta.py similarity index 92% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_41.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_mcompute_divergence_of_fluxes_of_rho_and_theta.py index 46ce64ce2d..c71ae9ecfb 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_41.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mcompute_divergence_of_fluxes_of_rho_and_theta.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_41 import ( - mo_solve_nonhydro_stencil_41, +from icon4py.model.atmosphere.dycore.compute_divergence_of_fluxes_of_rho_and_theta import ( + compute_divergence_of_fluxes_of_rho_and_theta, ) from icon4py.model.common.dimension import C2EDim, CEDim, CellDim, EdgeDim, KDim from icon4py.model.common.test_utils.helpers import ( @@ -29,7 +29,7 @@ class TestMoSolveNonhydroStencil41(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_41 + PROGRAM = compute_divergence_of_fluxes_of_rho_and_theta OUTPUTS = ("z_flxdiv_mass", "z_flxdiv_theta") @staticmethod From 8ea2453b963e831ae18560950866ebd431b78f73 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Thu, 1 Feb 2024 15:06:34 +0100 Subject: [PATCH 43/60] rename --- ...ncil_28.py => add_analysis_increments_to_vn.py} | 6 +++--- ...d_speed_and_vertical_velocity_times_density.py} | 6 +++--- .../atmosphere/dycore/nh_solve/solve_nonhydro.py | 14 +++++++------- .../dycore/nh_solve/solve_nonhydro_program.py | 6 +++--- ...28.py => test_add_analysis_increments_to_vn.py} | 6 +++--- ...d_speed_and_vertical_velocity_times_density.py} | 6 +++--- 6 files changed, 22 insertions(+), 22 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_28.py => add_analysis_increments_to_vn.py} (93%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_42.py => compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py} (91%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_28.py => test_add_analysis_increments_to_vn.py} (91%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_42.py => testcompute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py} (91%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_28.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_analysis_increments_to_vn.py similarity index 93% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_28.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_analysis_increments_to_vn.py index 1d315ccef5..f62cfdeadd 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_28.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/add_analysis_increments_to_vn.py @@ -20,7 +20,7 @@ @field_operator -def _mo_solve_nonhydro_stencil_28( +def _add_analysis_increments_to_vn( vn_incr: Field[[EdgeDim, KDim], vpfloat], vn: Field[[EdgeDim, KDim], wpfloat], iau_wgt_dyn: wpfloat, @@ -33,7 +33,7 @@ def _mo_solve_nonhydro_stencil_28( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_28( +def add_analysis_increments_to_vn( vn_incr: Field[[EdgeDim, KDim], vpfloat], vn: Field[[EdgeDim, KDim], wpfloat], iau_wgt_dyn: wpfloat, @@ -42,7 +42,7 @@ def mo_solve_nonhydro_stencil_28( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_28( + _add_analysis_increments_to_vn( vn_incr, vn, iau_wgt_dyn, diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_42.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py similarity index 91% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_42.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py index 20ac198a2c..b7ea91ed37 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_42.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py @@ -20,7 +20,7 @@ @field_operator -def _mo_solve_nonhydro_stencil_42( +def _compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density( w_nnow: Field[[CellDim, KDim], wpfloat], ddt_w_adv_ntl1: Field[[CellDim, KDim], vpfloat], ddt_w_adv_ntl2: Field[[CellDim, KDim], vpfloat], @@ -48,7 +48,7 @@ def _mo_solve_nonhydro_stencil_42( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_42( +def compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density( z_w_expl: Field[[CellDim, KDim], wpfloat], w_nnow: Field[[CellDim, KDim], wpfloat], ddt_w_adv_ntl1: Field[[CellDim, KDim], vpfloat], @@ -67,7 +67,7 @@ def mo_solve_nonhydro_stencil_42( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_42( + _compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density( w_nnow, ddt_w_adv_ntl1, ddt_w_adv_ntl2, 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/nh_solve/solve_nonhydro.py index a0b485c9b1..8e3f0d79be 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -71,11 +71,11 @@ from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_4th_order_divdamp import ( mo_solve_nonhydro_4th_order_divdamp, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_28 import ( - mo_solve_nonhydro_stencil_28, +from icon4py.model.atmosphere.dycore.add_analysis_increments_to_vn import ( + add_analysis_increments_to_vn, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_29 import ( - mo_solve_nonhydro_stencil_29, +from icon4py.model.atmosphere.dycore.compute_vn_on_lateral_boundary import ( + compute_vn_on_lateral_boundary, )compute_vn_on_lateral_boundary fromcompute_vn_on_lateral_boundarycore.compute_avg_vn_and_graddiv_vn_and_vt import ( compute_avg_vn_and_graddiv_vn_and_vt, @@ -1085,7 +1085,7 @@ def run_predictor_step( ) if self.config.is_iau_active: - mo_solve_nonhydro_stencil_28( + add_analysis_increments_to_vn( vn_incr=diagnostic_state_nh.vn_incr, vn=prognostic_state[nnew].vn, iau_wgt_dyn=self.config.iau_wgt_dyn, @@ -1097,7 +1097,7 @@ def run_predictor_step( ) if self.grid.limited_area: - mo_solve_nonhydro_stencil_29.with_backend(backend)( + compute_vn_on_lateral_boundary.with_backend(backend)( grf_tend_vn=diagnostic_state_nh.grf_tend_vn, compute_vn_on_lateral_boundarynnow].vn, vn_new=prognostic_state[nnew].vn, @@ -1657,7 +1657,7 @@ def run_corrector_step( # TODO: this does not get accessed in FORTRAN if self.config.is_iau_active: log.debug("corrector start stencil 28") - mo_solve_nonhydro_stencil_28( + add_analysis_increments_to_vn( diagnostic_state_nh.vn_incr, prognostic_state[nnew].vn, self.config.iau_wgt_dyn, 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/nh_solve/solve_nonhydro_program.py index 02c8267064..e612bc1875 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/nh_solve/solve_nonhydro_program.py @@ -52,8 +52,8 @@ from icon4py.model.atmosphere.dycore.compute_contravariant_correction_of_w_for_lower_boundary import ( _compute_contravariant_correction_of_w_for_lower_boundary, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_42 import ( - _mo_solve_nonhydro_stencil_42, +from icon4py.model.atmosphere.dycore.compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density import ( + _compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_43 import ( _mo_solve_nonhydro_stencil_43, @@ -646,7 +646,7 @@ def _stencils_42_44_45_45b( ]: (z_w_expl, z_contr_w_fl_l) = where( (k_field >= int32(1)) & (k_field < nlev), - _mo_solve_nonhydro_stencil_42( + _compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density( w_nnow, ddt_w_adv_ntl1, ddt_w_adv_ntl2, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_28.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_analysis_increments_to_vn.py similarity index 91% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_28.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_analysis_increments_to_vn.py index 073f94efcb..ecea026423 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_28.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_add_analysis_increments_to_vn.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_28 import ( - mo_solve_nonhydro_stencil_28, +from icon4py.model.atmosphere.dycore.add_analysis_increments_to_vn import ( + add_analysis_increments_to_vn, ) from icon4py.model.common.dimension import EdgeDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil28(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_28 + PROGRAM = add_analysis_increments_to_vn OUTPUTS = ("vn",) @staticmethod diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_42.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/testcompute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py similarity index 91% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_42.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/testcompute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py index 83f41bfff0..604d59098b 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_42.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/testcompute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_42 import ( - mo_solve_nonhydro_stencil_42, +from icon4py.model.atmosphere.dycore.compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density import ( + compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density, ) from icon4py.model.common.dimension import CellDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil42(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_42 + PROGRAM = compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density OUTPUTS = ("z_w_expl", "z_contr_w_fl_l") @staticmethod From d6e7fe762812f8e39174270910f8ec9f6cc32aa8 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Thu, 1 Feb 2024 15:56:30 +0100 Subject: [PATCH 44/60] rename --- ...eraged_advection_and_vertical_velocity_times_density.py} | 6 +++--- .../model/atmosphere/dycore/mo_solve_nonhydro_stencil_43.py | 1 + .../model/atmosphere/dycore/mo_solve_nonhydro_stencil_44.py | 1 + .../atmosphere/dycore/nh_solve/solve_nonhydro_program.py | 6 +++--- ...eraged_advection_and_vertical_velocity_times_density.py} | 6 +++--- 5 files changed, 11 insertions(+), 9 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py => compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density.py} (89%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{testcompute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py => test_compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density.py} (90%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density.py similarity index 89% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density.py index b7ea91ed37..9674534556 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density.py @@ -20,7 +20,7 @@ @field_operator -def _compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density( +def _compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density( w_nnow: Field[[CellDim, KDim], wpfloat], ddt_w_adv_ntl1: Field[[CellDim, KDim], vpfloat], ddt_w_adv_ntl2: Field[[CellDim, KDim], vpfloat], @@ -48,7 +48,7 @@ def _compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_de @program(grid_type=GridType.UNSTRUCTURED) -def compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density( +def compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density( z_w_expl: Field[[CellDim, KDim], wpfloat], w_nnow: Field[[CellDim, KDim], wpfloat], ddt_w_adv_ntl1: Field[[CellDim, KDim], vpfloat], @@ -67,7 +67,7 @@ def compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_den vertical_start: int32, vertical_end: int32, ): - _compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density( + _compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density( w_nnow, ddt_w_adv_ntl1, ddt_w_adv_ntl2, diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_43.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_43.py index 4f3cd1883f..f43c7c151d 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_43.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_43.py @@ -30,6 +30,7 @@ def _mo_solve_nonhydro_stencil_43( dtime: wpfloat, cpd: wpfloat, ) -> tuple[Field[[CellDim, KDim], wpfloat], Field[[CellDim, KDim], wpfloat]]: + '''Formerly known as _mo_solve_nonhydro_stencil_43.''' ddt_w_adv_ntl1_wp, z_th_ddz_exner_c_wp, w_concorr_c_wp = astype( (ddt_w_adv_ntl1, z_th_ddz_exner_c, w_concorr_c), wpfloat ) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_44.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_44.py index ba339dd0c9..6f87bfb5d5 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_44.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_44.py @@ -32,6 +32,7 @@ def _mo_solve_nonhydro_stencil_44( rd: wpfloat, cvd: wpfloat, ) -> tuple[Field[[CellDim, KDim], vpfloat], Field[[CellDim, KDim], vpfloat]]: + '''Formerly known as _mo_solve_nonhydro_stencil_44''' inv_ddqz_z_full_wp = astype(inv_ddqz_z_full, wpfloat) z_beta_wp = dtime * rd * exner_nnow / (cvd * rho_nnow * theta_v_nnow) * inv_ddqz_z_full_wp 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/nh_solve/solve_nonhydro_program.py index e612bc1875..7249ed9398 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/nh_solve/solve_nonhydro_program.py @@ -52,8 +52,8 @@ from icon4py.model.atmosphere.dycore.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_of_vertical_wind_speed_and_vertical_velocity_times_density import ( - _compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density, +from icon4py.model.atmosphere.dycore.compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density import ( + _compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_43 import ( _mo_solve_nonhydro_stencil_43, @@ -646,7 +646,7 @@ def _stencils_42_44_45_45b( ]: (z_w_expl, z_contr_w_fl_l) = where( (k_field >= int32(1)) & (k_field < nlev), - _compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density( + _compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density( w_nnow, ddt_w_adv_ntl1, ddt_w_adv_ntl2, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/testcompute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density.py similarity index 90% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/testcompute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density.py index 604d59098b..eb363aac54 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/testcompute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density import ( - compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density, +from icon4py.model.atmosphere.dycore.compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density import ( + compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density, ) from icon4py.model.common.dimension import CellDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil42(StencilTest): - PROGRAM = compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density + PROGRAM = compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density OUTPUTS = ("z_w_expl", "z_contr_w_fl_l") @staticmethod From ac96f84248a85d84658133cd7976b0863c7943d7 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Thu, 1 Feb 2024 16:06:11 +0100 Subject: [PATCH 45/60] rename --- ...tical_wind_speed_and_vertical_velocity_times_density.py} | 6 +++--- .../atmosphere/dycore/nh_solve/solve_nonhydro_program.py | 6 +++--- ...tical_wind_speed_and_vertical_velocity_times_density.py} | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_43.py => compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py} (90%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_43.py => test_compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py} (89%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_43.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py similarity index 90% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_43.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py index f43c7c151d..462f4af6ea 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_43.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py @@ -20,7 +20,7 @@ @field_operator -def _mo_solve_nonhydro_stencil_43( +def _compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density( w_nnow: Field[[CellDim, KDim], wpfloat], ddt_w_adv_ntl1: Field[[CellDim, KDim], vpfloat], z_th_ddz_exner_c: Field[[CellDim, KDim], vpfloat], @@ -41,7 +41,7 @@ def _mo_solve_nonhydro_stencil_43( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_43( +def compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density( z_w_expl: Field[[CellDim, KDim], wpfloat], w_nnow: Field[[CellDim, KDim], wpfloat], ddt_w_adv_ntl1: Field[[CellDim, KDim], vpfloat], @@ -57,7 +57,7 @@ def mo_solve_nonhydro_stencil_43( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_43( + _compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density( w_nnow, ddt_w_adv_ntl1, z_th_ddz_exner_c, 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/nh_solve/solve_nonhydro_program.py index 7249ed9398..625f45ae74 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/nh_solve/solve_nonhydro_program.py @@ -55,8 +55,8 @@ from icon4py.model.atmosphere.dycore.compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density import ( _compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_43 import ( - _mo_solve_nonhydro_stencil_43, +from icon4py.model.atmosphere.dycore.compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density import ( + _compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_44 import ( _mo_solve_nonhydro_stencil_44, @@ -786,7 +786,7 @@ def _stencils_43_44_45_45b( ]: (z_w_expl, z_contr_w_fl_l) = where( (k_field >= int32(1)) & (k_field < nlev), - _mo_solve_nonhydro_stencil_43( + _compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density( w_nnow, ddt_w_adv_ntl1, z_th_ddz_exner_c, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_43.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py similarity index 89% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_43.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py index 38ba899c57..d18c09a9a9 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_43.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_43 import ( - mo_solve_nonhydro_stencil_43, +from icon4py.model.atmosphere.dycore.compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density import ( + compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density, ) from icon4py.model.common.dimension import CellDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil43(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_43 + PROGRAM = compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density OUTPUTS = ("z_w_expl", "z_contr_w_fl_l") @staticmethod From 3c9409b28ace6aa560ebbbc873bc044a26b0b7f3 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Thu, 1 Feb 2024 16:44:40 +0100 Subject: [PATCH 46/60] rename --- ...tencil_44.py => compute_solver_coefficients_matrix.py} | 6 +++--- .../atmosphere/dycore/mo_solve_nonhydro_stencil_47.py | 1 + .../atmosphere/dycore/nh_solve/solve_nonhydro_program.py | 8 ++++---- ...l_44.py => test_compute_solver_coefficients_matrix.py} | 6 +++--- 4 files changed, 11 insertions(+), 10 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_44.py => compute_solver_coefficients_matrix.py} (95%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_44.py => test_compute_solver_coefficients_matrix.py} (94%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_44.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_solver_coefficients_matrix.py similarity index 95% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_44.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_solver_coefficients_matrix.py index 6f87bfb5d5..b7be734f9f 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_44.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_solver_coefficients_matrix.py @@ -20,7 +20,7 @@ @field_operator -def _mo_solve_nonhydro_stencil_44( +def _compute_solver_coefficients_matrix( exner_nnow: Field[[CellDim, KDim], wpfloat], rho_nnow: Field[[CellDim, KDim], wpfloat], theta_v_nnow: Field[[CellDim, KDim], wpfloat], @@ -41,7 +41,7 @@ def _mo_solve_nonhydro_stencil_44( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_44( +def compute_solver_coefficients_matrix( z_beta: Field[[CellDim, KDim], vpfloat], exner_nnow: Field[[CellDim, KDim], wpfloat], rho_nnow: Field[[CellDim, KDim], wpfloat], @@ -59,7 +59,7 @@ def mo_solve_nonhydro_stencil_44( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_44( + _compute_solver_coefficients_matrix( exner_nnow, rho_nnow, theta_v_nnow, diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_47.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_47.py index 5b93d84d80..3601921bf9 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_47.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_47.py @@ -26,6 +26,7 @@ def _mo_solve_nonhydro_stencil_47( w_concorr_c: Field[[CellDim, KDim], vpfloat] ) -> tuple[Field[[CellDim, KDim], wpfloat], Field[[CellDim, KDim], wpfloat]]: + '''Formerly known as _mo_solve_nonhydro_stencil_47.''' w_concorr_c_wp = astype(w_concorr_c, wpfloat) w_nnew_wp = w_concorr_c_wp 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/nh_solve/solve_nonhydro_program.py index 625f45ae74..ebe5499a47 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/nh_solve/solve_nonhydro_program.py @@ -58,8 +58,8 @@ from icon4py.model.atmosphere.dycore.compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density import ( _compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_44 import ( - _mo_solve_nonhydro_stencil_44, +from icon4py.model.atmosphere.dycore.compute_solver_coefficients_matrix import ( + _compute_solver_coefficients_matrix, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_47 import ( _mo_solve_nonhydro_stencil_47, @@ -664,7 +664,7 @@ def _stencils_42_44_45_45b( (z_beta, z_alpha) = where( (k_field >= int32(0)) & (k_field < nlev), - _mo_solve_nonhydro_stencil_44( + _compute_solver_coefficients_matrix( exner_nnow, rho_nnow, theta_v_nnow, @@ -800,7 +800,7 @@ def _stencils_43_44_45_45b( ) (z_beta, z_alpha) = where( (k_field >= int32(0)) & (k_field < nlev), - _mo_solve_nonhydro_stencil_44( + _compute_solver_coefficients_matrix( exner_nnow, rho_nnow, theta_v_nnow, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_44.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_solver_coefficients_matrix.py similarity index 94% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_44.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_solver_coefficients_matrix.py index 43eda26651..d501fa1d03 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_44.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_solver_coefficients_matrix.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_44 import ( - mo_solve_nonhydro_stencil_44, +from icon4py.model.atmosphere.dycore.compute_solver_coefficients_matrix import ( + compute_solver_coefficients_matrix, ) from icon4py.model.common.dimension import CellDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil44(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_44 + PROGRAM = compute_solver_coefficients_matrix OUTPUTS = ("z_beta", "z_alpha") @staticmethod From 5891d49827439ada71e245928514a082173ced2c Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Thu, 1 Feb 2024 16:54:59 +0100 Subject: [PATCH 47/60] rename --- .../model/atmosphere/dycore/mo_solve_nonhydro_stencil_48.py | 1 + .../atmosphere/dycore/nh_solve/solve_nonhydro_program.py | 6 +++--- ...oundary_condition_for_w_and_contravariant_correction.py} | 6 +++--- ...oundary_condition_for_w_and_contravariant_correction.py} | 6 +++--- 4 files changed, 10 insertions(+), 9 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_47.py => set_lower_boundary_condition_for_w_and_contravariant_correction.py} (89%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_47.py => test_set_lower_boundary_condition_for_w_and_contravariant_correction.py} (87%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_48.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_48.py index 2666d1b37b..5d97c2dfe4 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_48.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_48.py @@ -32,6 +32,7 @@ def _mo_solve_nonhydro_stencil_48( ddt_exner_phy: Field[[CellDim, KDim], vpfloat], dtime: wpfloat, ) -> tuple[Field[[CellDim, KDim], wpfloat], Field[[CellDim, KDim], wpfloat]]: + '''Formerly known as _mo_solve_nonhydro_stencil_48.''' inv_ddqz_z_full_wp, z_flxdiv_mass_wp, z_beta_wp, z_flxdiv_theta_wp, ddt_exner_phy_wp = astype( (inv_ddqz_z_full, z_flxdiv_mass, z_beta, z_flxdiv_theta, ddt_exner_phy), wpfloat ) 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/nh_solve/solve_nonhydro_program.py index ebe5499a47..684a9e52aa 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/nh_solve/solve_nonhydro_program.py @@ -61,8 +61,8 @@ from icon4py.model.atmosphere.dycore.compute_solver_coefficients_matrix import ( _compute_solver_coefficients_matrix, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_47 import ( - _mo_solve_nonhydro_stencil_47, +from icon4py.model.atmosphere.dycore.set_lower_boundary_condition_for_w_and_contravariant_correction import ( + _set_lower_boundary_condition_for_w_and_contravariant_correction, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_49 import ( _mo_solve_nonhydro_stencil_49, @@ -908,7 +908,7 @@ def _stencils_47_48_49( ]: (w_nnew, z_contr_w_fl_l) = where( k_field == nlev, - _mo_solve_nonhydro_stencil_47(w_concorr_c), + _set_lower_boundary_condition_for_w_and_contravariant_correction(w_concorr_c), (w_nnew, z_contr_w_fl_l), ) # 48 and 49 are identical except for bounds diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_47.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/set_lower_boundary_condition_for_w_and_contravariant_correction.py similarity index 89% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_47.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/set_lower_boundary_condition_for_w_and_contravariant_correction.py index 3601921bf9..22ad093041 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_47.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/set_lower_boundary_condition_for_w_and_contravariant_correction.py @@ -23,7 +23,7 @@ @field_operator -def _mo_solve_nonhydro_stencil_47( +def _set_lower_boundary_condition_for_w_and_contravariant_correction( w_concorr_c: Field[[CellDim, KDim], vpfloat] ) -> tuple[Field[[CellDim, KDim], wpfloat], Field[[CellDim, KDim], wpfloat]]: '''Formerly known as _mo_solve_nonhydro_stencil_47.''' @@ -35,7 +35,7 @@ def _mo_solve_nonhydro_stencil_47( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_47( +def set_lower_boundary_condition_for_w_and_contravariant_correction( w_nnew: Field[[CellDim, KDim], wpfloat], z_contr_w_fl_l: Field[[CellDim, KDim], wpfloat], w_concorr_c: Field[[CellDim, KDim], vpfloat], @@ -44,7 +44,7 @@ def mo_solve_nonhydro_stencil_47( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_47( + _set_lower_boundary_condition_for_w_and_contravariant_correction( w_concorr_c, out=(w_nnew, z_contr_w_fl_l), domain={ diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_47.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_set_lower_boundary_condition_for_w_and_contravariant_correction.py similarity index 87% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_47.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_set_lower_boundary_condition_for_w_and_contravariant_correction.py index 24b84e9bc1..b833b630cc 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_47.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_set_lower_boundary_condition_for_w_and_contravariant_correction.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_47 import ( - mo_solve_nonhydro_stencil_47, +from icon4py.model.atmosphere.dycore.set_lower_boundary_condition_for_w_and_contravariant_correction import ( + set_lower_boundary_condition_for_w_and_contravariant_correction, ) from icon4py.model.common.dimension import CellDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil47(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_47 + PROGRAM = set_lower_boundary_condition_for_w_and_contravariant_correction OUTPUTS = ("w_nnew", "z_contr_w_fl_l") @staticmethod From 80e720000d5e354461192b8e76a6daf15f21d6a8 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Fri, 2 Feb 2024 09:27:51 +0100 Subject: [PATCH 48/60] rename --- ...ompute_explicit_part_for_rho_and_exner.py} | 8 +- .../dycore/mo_solve_nonhydro_stencil_49.py | 90 ------------------ .../dycore/nh_solve/solve_nonhydro_program.py | 6 +- ...ompute_explicit_part_for_rho_and_exner.py} | 6 +- .../test_mo_solve_nonhydro_stencil_49.py | 94 ------------------- 5 files changed, 10 insertions(+), 194 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{mo_solve_nonhydro_stencil_48.py => compute_explicit_part_for_rho_and_exner.py} (93%) delete mode 100644 model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_49.py rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_mo_solve_nonhydro_stencil_48.py => test_compute_explicit_part_for_rho_and_exner.py} (94%) delete mode 100644 model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_49.py diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_48.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_for_rho_and_exner.py similarity index 93% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_48.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_for_rho_and_exner.py index 5d97c2dfe4..919490f1ce 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_48.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_for_rho_and_exner.py @@ -20,7 +20,7 @@ @field_operator -def _mo_solve_nonhydro_stencil_48( +def _compute_explicit_part_for_rho_and_exner( rho_nnow: Field[[CellDim, KDim], wpfloat], inv_ddqz_z_full: Field[[CellDim, KDim], vpfloat], z_flxdiv_mass: Field[[CellDim, KDim], vpfloat], @@ -32,7 +32,7 @@ def _mo_solve_nonhydro_stencil_48( ddt_exner_phy: Field[[CellDim, KDim], vpfloat], dtime: wpfloat, ) -> tuple[Field[[CellDim, KDim], wpfloat], Field[[CellDim, KDim], wpfloat]]: - '''Formerly known as _mo_solve_nonhydro_stencil_48.''' + '''Formerly known as _mo_solve_nonhydro_stencil_48 or _mo_solve_nonhydro_stencil_49.''' inv_ddqz_z_full_wp, z_flxdiv_mass_wp, z_beta_wp, z_flxdiv_theta_wp, ddt_exner_phy_wp = astype( (inv_ddqz_z_full, z_flxdiv_mass, z_beta, z_flxdiv_theta, ddt_exner_phy), wpfloat ) @@ -55,7 +55,7 @@ def _mo_solve_nonhydro_stencil_48( @program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_48( +def compute_explicit_part_for_rho_and_exner( z_rho_expl: Field[[CellDim, KDim], wpfloat], z_exner_expl: Field[[CellDim, KDim], wpfloat], rho_nnow: Field[[CellDim, KDim], wpfloat], @@ -73,7 +73,7 @@ def mo_solve_nonhydro_stencil_48( vertical_start: int32, vertical_end: int32, ): - _mo_solve_nonhydro_stencil_48( + _compute_explicit_part_for_rho_and_exner( rho_nnow, inv_ddqz_z_full, z_flxdiv_mass, diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_49.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_49.py deleted file mode 100644 index 89fa74ba1a..0000000000 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/mo_solve_nonhydro_stencil_49.py +++ /dev/null @@ -1,90 +0,0 @@ -# ICON4Py - ICON inspired code in Python and GT4Py -# -# Copyright (c) 2022, ETH Zurich and MeteoSwiss -# All rights reserved. -# -# This file is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or any later -# version. See the LICENSE.txt file at the top-level directory of this -# distribution for a copy of the license or check . -# -# SPDX-License-Identifier: GPL-3.0-or-later - -from gt4py.next.common import GridType -from gt4py.next.ffront.decorator import field_operator, program -from gt4py.next.ffront.fbuiltins import Field, astype, int32 - -from icon4py.model.common.dimension import CellDim, KDim, Koff -from icon4py.model.common.type_alias import vpfloat, wpfloat - - -@field_operator -def _mo_solve_nonhydro_stencil_49( - rho_nnow: Field[[CellDim, KDim], wpfloat], - inv_ddqz_z_full: Field[[CellDim, KDim], vpfloat], - z_flxdiv_mass: Field[[CellDim, KDim], vpfloat], - z_contr_w_fl_l: Field[[CellDim, KDim], wpfloat], - exner_pr: Field[[CellDim, KDim], wpfloat], - z_beta: Field[[CellDim, KDim], vpfloat], - z_flxdiv_theta: Field[[CellDim, KDim], vpfloat], - theta_v_ic: Field[[CellDim, KDim], wpfloat], - ddt_exner_phy: Field[[CellDim, KDim], vpfloat], - dtime: wpfloat, -) -> tuple[Field[[CellDim, KDim], wpfloat], Field[[CellDim, KDim], wpfloat]]: - inv_ddqz_z_full_wp, z_flxdiv_mass_wp, z_beta_wp, z_flxdiv_theta_wp, ddt_exner_phy_wp = astype( - (inv_ddqz_z_full, z_flxdiv_mass, z_beta, z_flxdiv_theta, ddt_exner_phy), wpfloat - ) - - z_rho_expl_wp = rho_nnow - dtime * inv_ddqz_z_full_wp * ( - z_flxdiv_mass_wp + z_contr_w_fl_l - z_contr_w_fl_l(Koff[1]) - ) - z_exner_expl_wp = ( - exner_pr - - z_beta_wp - * ( - z_flxdiv_theta_wp - + theta_v_ic * z_contr_w_fl_l - - theta_v_ic(Koff[1]) * z_contr_w_fl_l(Koff[1]) - ) - + dtime * ddt_exner_phy_wp - ) - return z_rho_expl_wp, z_exner_expl_wp - - -@program(grid_type=GridType.UNSTRUCTURED) -def mo_solve_nonhydro_stencil_49( - z_rho_expl: Field[[CellDim, KDim], wpfloat], - z_exner_expl: Field[[CellDim, KDim], wpfloat], - rho_nnow: Field[[CellDim, KDim], wpfloat], - inv_ddqz_z_full: Field[[CellDim, KDim], vpfloat], - z_flxdiv_mass: Field[[CellDim, KDim], vpfloat], - z_contr_w_fl_l: Field[[CellDim, KDim], wpfloat], - exner_pr: Field[[CellDim, KDim], wpfloat], - z_beta: Field[[CellDim, KDim], vpfloat], - z_flxdiv_theta: Field[[CellDim, KDim], vpfloat], - theta_v_ic: Field[[CellDim, KDim], wpfloat], - ddt_exner_phy: Field[[CellDim, KDim], vpfloat], - dtime: wpfloat, - horizontal_start: int32, - horizontal_end: int32, - vertical_start: int32, - vertical_end: int32, -): - _mo_solve_nonhydro_stencil_49( - rho_nnow, - inv_ddqz_z_full, - z_flxdiv_mass, - z_contr_w_fl_l, - exner_pr, - z_beta, - z_flxdiv_theta, - theta_v_ic, - ddt_exner_phy, - dtime, - out=(z_rho_expl, z_exner_expl), - domain={ - CellDim: (horizontal_start, horizontal_end), - KDim: (vertical_start, vertical_end), - }, - ) 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/nh_solve/solve_nonhydro_program.py index 684a9e52aa..4ae36a013d 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/nh_solve/solve_nonhydro_program.py @@ -64,8 +64,8 @@ from icon4py.model.atmosphere.dycore.set_lower_boundary_condition_for_w_and_contravariant_correction import ( _set_lower_boundary_condition_for_w_and_contravariant_correction, ) -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_49 import ( - _mo_solve_nonhydro_stencil_49, +from icon4py.model.atmosphere.dycore.compute_explicit_part_for_rho_and_exner import ( + _compute_explicit_part_for_rho_and_exner, ) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_61 import ( _mo_solve_nonhydro_stencil_61, @@ -914,7 +914,7 @@ def _stencils_47_48_49( # 48 and 49 are identical except for bounds (z_rho_expl, z_exner_expl) = where( (k_field >= int32(0)) & (k_field < nlev), - _mo_solve_nonhydro_stencil_49( + _compute_explicit_part_for_rho_and_exner( rho_nnow, inv_ddqz_z_full, z_flxdiv_mass, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_48.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_part_for_rho_and_exner.py similarity index 94% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_48.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_part_for_rho_and_exner.py index a517d94f2d..03a2f9728e 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_48.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_part_for_rho_and_exner.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_48 import ( - mo_solve_nonhydro_stencil_48, +from icon4py.model.atmosphere.dycore.compute_explicit_part_for_rho_and_exner import ( + compute_explicit_part_for_rho_and_exner, ) from icon4py.model.common.dimension import CellDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil48(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_48 + PROGRAM = compute_explicit_part_for_rho_and_exner OUTPUTS = ("z_rho_expl", "z_exner_expl") @staticmethod diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_49.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_49.py deleted file mode 100644 index d476c85578..0000000000 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_mo_solve_nonhydro_stencil_49.py +++ /dev/null @@ -1,94 +0,0 @@ -# ICON4Py - ICON inspired code in Python and GT4Py -# -# Copyright (c) 2022, ETH Zurich and MeteoSwiss -# All rights reserved. -# -# This file is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or any later -# version. See the LICENSE.txt file at the top-level directory of this -# distribution for a copy of the license or check . -# -# SPDX-License-Identifier: GPL-3.0-or-later - -import numpy as np -import pytest -from gt4py.next.ffront.fbuiltins import int32 - -from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_49 import ( - mo_solve_nonhydro_stencil_49, -) -from icon4py.model.common.dimension import CellDim, KDim -from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field -from icon4py.model.common.type_alias import vpfloat, wpfloat - - -class TestMoSolveNonhydroStencil49(StencilTest): - PROGRAM = mo_solve_nonhydro_stencil_49 - OUTPUTS = ("z_rho_expl", "z_exner_expl") - - @staticmethod - def reference( - grid, - rho_nnow: np.array, - inv_ddqz_z_full: np.array, - z_flxdiv_mass: np.array, - z_contr_w_fl_l: np.array, - exner_pr: np.array, - z_beta: np.array, - z_flxdiv_theta: np.array, - theta_v_ic: np.array, - ddt_exner_phy: np.array, - dtime, - **kwargs, - ) -> dict: - z_rho_expl = rho_nnow - dtime * inv_ddqz_z_full * ( - z_flxdiv_mass + z_contr_w_fl_l[:, :-1] - z_contr_w_fl_l[:, 1:] - ) - z_exner_expl = ( - exner_pr - - z_beta - * ( - z_flxdiv_theta - + (theta_v_ic * z_contr_w_fl_l)[:, :-1] - - (theta_v_ic * z_contr_w_fl_l)[:, 1:] - ) - + dtime * ddt_exner_phy - ) - return dict(z_rho_expl=z_rho_expl, z_exner_expl=z_exner_expl) - - @pytest.fixture - def input_data(self, grid): - dtime = 7.0 - - rho_nnow = random_field(grid, CellDim, KDim, dtype=wpfloat) - inv_ddqz_z_full = random_field(grid, CellDim, KDim, dtype=vpfloat) - z_flxdiv_mass = random_field(grid, CellDim, KDim, dtype=vpfloat) - z_contr_w_fl_l = random_field(grid, CellDim, KDim, extend={KDim: 1}, dtype=wpfloat) - exner_pr = random_field(grid, CellDim, KDim, dtype=wpfloat) - z_beta = random_field(grid, CellDim, KDim, dtype=vpfloat) - z_flxdiv_theta = random_field(grid, CellDim, KDim, dtype=vpfloat) - theta_v_ic = random_field(grid, CellDim, KDim, extend={KDim: 1}, dtype=wpfloat) - ddt_exner_phy = random_field(grid, CellDim, KDim, dtype=vpfloat) - - z_rho_expl = zero_field(grid, CellDim, KDim, dtype=wpfloat) - z_exner_expl = zero_field(grid, CellDim, KDim, dtype=wpfloat) - - return dict( - z_rho_expl=z_rho_expl, - z_exner_expl=z_exner_expl, - rho_nnow=rho_nnow, - inv_ddqz_z_full=inv_ddqz_z_full, - z_flxdiv_mass=z_flxdiv_mass, - z_contr_w_fl_l=z_contr_w_fl_l, - exner_pr=exner_pr, - z_beta=z_beta, - z_flxdiv_theta=z_flxdiv_theta, - theta_v_ic=theta_v_ic, - ddt_exner_phy=ddt_exner_phy, - dtime=dtime, - horizontal_start=int32(0), - horizontal_end=int32(grid.num_cells), - vertical_start=int32(0), - vertical_end=int32(grid.num_levels), - ) From 6977a6f433302b60aa8cd21fe8b1ae2b42b9617f Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Fri, 2 Feb 2024 09:29:29 +0100 Subject: [PATCH 49/60] fix style --- .../dycore/accumulate_prep_adv_fields.py | 2 +- .../model/atmosphere/dycore/compute_avg_vn.py | 2 +- .../compute_avg_vn_and_graddiv_vn_and_vt.py | 6 +-- .../compute_contravariant_correction_of_w.py | 2 +- ...iant_correction_of_w_for_lower_boundary.py | 2 +- ...e_divergence_of_fluxes_of_rho_and_theta.py | 2 +- ...compute_explicit_part_for_rho_and_exner.py | 2 +- ...eed_and_vertical_velocity_times_density.py | 2 +- ...ion_and_vertical_velocity_times_density.py | 2 +- .../atmosphere/dycore/compute_mass_flux.py | 2 +- .../compute_solver_coefficients_matrix.py | 2 +- .../dycore/compute_vn_on_lateral_boundary.py | 2 +- .../fused_solve_nonhydro_stencil_39_40.py | 4 +- ..._and_vt_to_ie_and_compute_ekin_on_edges.py | 2 +- .../dycore/nh_solve/solve_nonhydro.py | 27 +++++------ .../dycore/nh_solve/solve_nonhydro_program.py | 46 ++++++++++--------- ...tion_for_w_and_contravariant_correction.py | 2 +- .../test_accumulate_prep_adv_fields.py | 4 +- .../test_compute_avg_vn.py | 4 +- ...t_compute_contravariant_correction_of_w.py | 4 +- ...iant_correction_of_w_for_lower_boundary.py | 4 +- .../test_compute_mass_flux.py | 4 +- ...test_fused_solve_nonhydro_stencil_39_40.py | 8 +++- 23 files changed, 68 insertions(+), 69 deletions(-) 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/accumulate_prep_adv_fields.py index 1e7e7d1769..d9650f3729 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/accumulate_prep_adv_fields.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/accumulate_prep_adv_fields.py @@ -27,7 +27,7 @@ def _accumulate_prep_adv_fields( mass_flx_me: Field[[EdgeDim, KDim], wpfloat], r_nsubsteps: wpfloat, ) -> tuple[Field[[EdgeDim, KDim], wpfloat], Field[[EdgeDim, KDim], wpfloat]]: - '''Formerly kown as _mo_solve_nonhydro_stencil_34.''' + """Formerly kown as _mo_solve_nonhydro_stencil_34.""" vn_traj_wp = vn_traj + r_nsubsteps * z_vn_avg mass_flx_me_wp = mass_flx_me + r_nsubsteps * mass_fl_e return vn_traj_wp, mass_flx_me_wp diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_avg_vn.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_avg_vn.py index 861fa38ca2..79872a6fe2 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_avg_vn.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_avg_vn.py @@ -24,7 +24,7 @@ def _compute_avg_vn( e_flx_avg: Field[[EdgeDim, E2C2EODim], wpfloat], vn: Field[[EdgeDim, KDim], wpfloat], ) -> Field[[EdgeDim, KDim], wpfloat]: - '''Formerly known as _mo_solve_nonhydro_stencil_31.''' + """Formerly known as _mo_solve_nonhydro_stencil_31.""" z_vn_avg_wp = neighbor_sum(e_flx_avg * vn(E2C2EO), axis=E2C2EODim) return z_vn_avg_wp 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/compute_avg_vn_and_graddiv_vn_and_vt.py index aef1831145..8d46f8a185 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/compute_avg_vn_and_graddiv_vn_and_vt.py @@ -15,10 +15,8 @@ from gt4py.next.ffront.decorator import field_operator, program from gt4py.next.ffront.fbuiltins import Field, astype, int32, 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.compute_avg_vn import ( - _compute_avg_vn, -) from icon4py.model.common.dimension import E2C2EO, E2C2EDim, E2C2EODim, EdgeDim, KDim from icon4py.model.common.type_alias import vpfloat, wpfloat @@ -34,7 +32,7 @@ def _compute_avg_vn_and_graddiv_vn_and_vt( Field[[EdgeDim, KDim], vpfloat], Field[[EdgeDim, KDim], vpfloat], ]: - '''Formerly known as _mo_solve_nonhydro_stencil_30.''' + """Formerly known as _mo_solve_nonhydro_stencil_30.""" z_vn_avg_wp = _compute_avg_vn(e_flx_avg=e_flx_avg, vn=vn) z_graddiv_vn_vp = astype(neighbor_sum(geofac_grdiv * vn(E2C2EO), axis=E2C2EODim), vpfloat) vt_vp = _compute_tangential_wind(vn=vn, rbf_vec_coeff_e=rbf_vec_coeff_e) 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/compute_contravariant_correction_of_w.py index 12ee48d406..831147c353 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_contravariant_correction_of_w.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_contravariant_correction_of_w.py @@ -25,7 +25,7 @@ def _compute_contravariant_correction_of_w( z_w_concorr_me: Field[[EdgeDim, KDim], vpfloat], wgtfac_c: Field[[CellDim, KDim], vpfloat], ) -> Field[[CellDim, KDim], vpfloat]: - '''Formerly known as _mo_solve_nonhydro_stencil_39.''' + """Formerly known as _mo_solve_nonhydro_stencil_39.""" z_w_concorr_me_offset_1 = z_w_concorr_me(Koff[-1]) z_w_concorr_me_wp, z_w_concorr_me_offset_1_wp = astype( 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/compute_contravariant_correction_of_w_for_lower_boundary.py index b68ba3fe55..1aaf0da5b5 100644 --- 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/compute_contravariant_correction_of_w_for_lower_boundary.py @@ -25,7 +25,7 @@ def _compute_contravariant_correction_of_w_for_lower_boundary( z_w_concorr_me: Field[[EdgeDim, KDim], vpfloat], wgtfacq_c: Field[[CellDim, KDim], vpfloat], ) -> Field[[CellDim, KDim], vpfloat]: - '''Formerly known as _mo_solve_nonhydro_stencil_40.''' + """Formerly known as _mo_solve_nonhydro_stencil_40.""" z_w_concorr_me_wp = astype(z_w_concorr_me, wpfloat) z_w_concorr_me_offset_1 = z_w_concorr_me_wp(Koff[-1]) 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/compute_divergence_of_fluxes_of_rho_and_theta.py index df85cc3bf6..611adcb68d 100644 --- 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/compute_divergence_of_fluxes_of_rho_and_theta.py @@ -25,7 +25,7 @@ def _compute_divergence_of_fluxes_of_rho_and_theta( mass_fl_e: Field[[EdgeDim, KDim], wpfloat], z_theta_v_fl_e: Field[[EdgeDim, KDim], wpfloat], ) -> tuple[Field[[CellDim, KDim], vpfloat], Field[[CellDim, KDim], vpfloat]]: - '''Formerly known as _mo_solve_nonhydro_stencil_41.''' + """Formerly known as _mo_solve_nonhydro_stencil_41.""" z_flxdiv_mass_wp = neighbor_sum(geofac_div(C2CE) * mass_fl_e(C2E), axis=C2EDim) z_flxdiv_theta_wp = neighbor_sum(geofac_div(C2CE) * z_theta_v_fl_e(C2E), axis=C2EDim) return astype((z_flxdiv_mass_wp, z_flxdiv_theta_wp), vpfloat) 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/compute_explicit_part_for_rho_and_exner.py index 919490f1ce..2cdbb9a3bc 100644 --- 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/compute_explicit_part_for_rho_and_exner.py @@ -32,7 +32,7 @@ def _compute_explicit_part_for_rho_and_exner( ddt_exner_phy: Field[[CellDim, KDim], vpfloat], dtime: wpfloat, ) -> tuple[Field[[CellDim, KDim], wpfloat], Field[[CellDim, KDim], wpfloat]]: - '''Formerly known as _mo_solve_nonhydro_stencil_48 or _mo_solve_nonhydro_stencil_49.''' + """Formerly known as _mo_solve_nonhydro_stencil_48 or _mo_solve_nonhydro_stencil_49.""" inv_ddqz_z_full_wp, z_flxdiv_mass_wp, z_beta_wp, z_flxdiv_theta_wp, ddt_exner_phy_wp = astype( (inv_ddqz_z_full, z_flxdiv_mass, z_beta, z_flxdiv_theta, ddt_exner_phy), wpfloat ) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py index 462f4af6ea..645ca0600c 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py @@ -30,7 +30,7 @@ def _compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_de dtime: wpfloat, cpd: wpfloat, ) -> tuple[Field[[CellDim, KDim], wpfloat], Field[[CellDim, KDim], wpfloat]]: - '''Formerly known as _mo_solve_nonhydro_stencil_43.''' + """Formerly known as _mo_solve_nonhydro_stencil_43.""" ddt_w_adv_ntl1_wp, z_th_ddz_exner_c_wp, w_concorr_c_wp = astype( (ddt_w_adv_ntl1, z_th_ddz_exner_c, w_concorr_c), wpfloat ) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density.py index 9674534556..e2eeb3922f 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density.py @@ -33,7 +33,7 @@ def _compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advec wgt_nnew_vel: wpfloat, cpd: wpfloat, ) -> tuple[Field[[CellDim, KDim], wpfloat], Field[[CellDim, KDim], wpfloat]]: - '''Formerly known as _mo_solve_nonhydro_stencil_42.''' + """Formerly known as _mo_solve_nonhydro_stencil_42.""" ddt_w_adv_ntl1_wp, ddt_w_adv_ntl2_wp, z_th_ddz_exner_c_wp, w_concorr_c_wp = astype( (ddt_w_adv_ntl1, ddt_w_adv_ntl2, z_th_ddz_exner_c, w_concorr_c), wpfloat ) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_mass_flux.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_mass_flux.py index 2e3a35037a..7a6c2ba449 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_mass_flux.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_mass_flux.py @@ -26,7 +26,7 @@ def _compute_mass_flux( ddqz_z_full_e: Field[[EdgeDim, KDim], vpfloat], z_theta_v_e: Field[[EdgeDim, KDim], wpfloat], ) -> tuple[Field[[EdgeDim, KDim], wpfloat], Field[[EdgeDim, KDim], wpfloat]]: - '''Formerly known as _mo_solve_nonhydro_stencil_32.''' + """Formerly known as _mo_solve_nonhydro_stencil_32.""" mass_fl_e_wp = z_rho_e * z_vn_avg * astype(ddqz_z_full_e, wpfloat) z_theta_v_fl_e_wp = mass_fl_e_wp * z_theta_v_e return mass_fl_e_wp, z_theta_v_fl_e_wp 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/compute_solver_coefficients_matrix.py index b7be734f9f..91c6667ddb 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_solver_coefficients_matrix.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_solver_coefficients_matrix.py @@ -32,7 +32,7 @@ def _compute_solver_coefficients_matrix( rd: wpfloat, cvd: wpfloat, ) -> tuple[Field[[CellDim, KDim], vpfloat], Field[[CellDim, KDim], vpfloat]]: - '''Formerly known as _mo_solve_nonhydro_stencil_44''' + """Formerly known as _mo_solve_nonhydro_stencil_44.""" inv_ddqz_z_full_wp = astype(inv_ddqz_z_full, wpfloat) z_beta_wp = dtime * rd * exner_nnow / (cvd * rho_nnow * theta_v_nnow) * inv_ddqz_z_full_wp 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/compute_vn_on_lateral_boundary.py index bf937d4205..bf9af8fbbb 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_vn_on_lateral_boundary.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_vn_on_lateral_boundary.py @@ -25,7 +25,7 @@ def _compute_vn_on_lateral_boundary( vn_now: Field[[EdgeDim, KDim], wpfloat], dtime: wpfloat, ) -> Field[[EdgeDim, KDim], wpfloat]: - '''Formerly known as _mo_solve_nonhydro_stencil_29.''' + """Formerly known as _mo_solve_nonhydro_stencil_29.""" vn_new_wp = vn_now + dtime * grf_tend_vn return vn_new_wp 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/fused_solve_nonhydro_stencil_39_40.py index 203a0408ee..fa4425fea3 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/fused_solve_nonhydro_stencil_39_40.py @@ -37,7 +37,9 @@ def _fused_solve_nonhydro_stencil_39_40( w_concorr_c = where( nflatlev + 1 <= vert_idx < nlev, _compute_contravariant_correction_of_w(e_bln_c_s, z_w_concorr_me, wgtfac_c), - _compute_contravariant_correction_of_w_for_lower_boundary(e_bln_c_s, z_w_concorr_me, wgtfacq_c), + _compute_contravariant_correction_of_w_for_lower_boundary( + e_bln_c_s, z_w_concorr_me, wgtfacq_c + ), ) return w_concorr_c 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/interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges.py index 03ac81e489..4a566fcd32 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/interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges.py @@ -33,7 +33,7 @@ def _interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges( Field[[EdgeDim, KDim], vpfloat], Field[[EdgeDim, KDim], vpfloat], ]: - '''Formerly known as _mo_solve_nonhydro_stencil_36.''' + """Formerly known as _mo_solve_nonhydro_stencil_36.""" z_vt_ie = _interpolate_vt_to_ie(wgtfac_e=wgtfac_e, vt=vt) vn_ie, z_kin_hor_e = _interpolate_vn_to_ie_and_compute_ekin_on_edges( wgtfac_e=wgtfac_e, vn=vn, vt=vt 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/nh_solve/solve_nonhydro.py index 8e3f0d79be..80e9f6a188 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -21,6 +21,9 @@ import icon4py.model.atmosphere.dycore.nh_solve.solve_nonhydro_program as nhsolve_prog import icon4py.model.common.constants as constants +from icon4py.model.atmosphere.dycore.add_analysis_increments_to_vn import ( + add_analysis_increments_to_vn, +) from icon4py.model.atmosphere.dycore.add_temporal_tendencies_to_vn import ( add_temporal_tendencies_to_vn, ) @@ -61,6 +64,11 @@ from icon4py.model.atmosphere.dycore.compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta import ( compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta, ) +from icon4py.model.atmosphere.dycore.compute_vn_on_lateral_boundary import ( + compute_vn_on_lateral_boundary, + fromcompute_vn_on_lateral_boundarycore.compute_avg_vn_and_graddiv_vn_and_vt, + import, +) from icon4py.model.atmosphere.dycore.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 ( mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl, @@ -71,27 +79,14 @@ from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_4th_order_divdamp import ( mo_solve_nonhydro_4th_order_divdamp, ) -from icon4py.model.atmosphere.dycore.add_analysis_increments_to_vn import ( - add_analysis_increments_to_vn, -) -from icon4py.model.atmosphere.dycore.compute_vn_on_lateral_boundary import ( - compute_vn_on_lateral_boundary, -)compute_vn_on_lateral_boundary -fromcompute_vn_on_lateral_boundarycore.compute_avg_vn_and_graddiv_vn_and_vt import ( compute_avg_vn_and_graddiv_vn_and_vt, ) -from icon4py.model.atmosphere.dycore.compute_avg_vn import ( - compute_avg_vn, -) -from icon4py.model.atmosphere.dycore.compute_mass_flux import ( - compute_mass_flux, -) -from icon4py.model.atmosphere.dycore.accumulate_prep_adv_fields import ( - accumulate_prep_adv_fields, -) +from icon4py.model.atmosphere.dycore.accumulate_prep_adv_fields import accumulate_prep_adv_fields +from icon4py.model.atmosphere.dycore.compute_avg_vn import compute_avg_vn from icon4py.model.atmosphere.dycore.compute_divergence_of_fluxes_of_rho_and_theta import ( compute_divergence_of_fluxes_of_rho_and_theta, ) +from icon4py.model.atmosphere.dycore.compute_mass_flux import compute_mass_flux from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_50 import ( mo_solve_nonhydro_stencil_50, ) 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/nh_solve/solve_nonhydro_program.py index 4ae36a013d..3d8531a5db 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/nh_solve/solve_nonhydro_program.py @@ -17,6 +17,21 @@ from icon4py.model.atmosphere.dycore.compute_contravariant_correction import ( _compute_contravariant_correction, ) +from icon4py.model.atmosphere.dycore.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 ( + _compute_contravariant_correction_of_w_for_lower_boundary, +) +from icon4py.model.atmosphere.dycore.compute_explicit_part_for_rho_and_exner import ( + _compute_explicit_part_for_rho_and_exner, +) +from icon4py.model.atmosphere.dycore.compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density import ( + _compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density, +) +from icon4py.model.atmosphere.dycore.compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density import ( + _compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density, +) from icon4py.model.atmosphere.dycore.compute_first_vertical_derivative import ( _compute_first_vertical_derivative, ) @@ -32,6 +47,9 @@ from icon4py.model.atmosphere.dycore.compute_pertubation_of_rho_and_theta_and_rho_at_ic import ( _compute_pertubation_of_rho_and_theta_and_rho_at_ic, ) +from icon4py.model.atmosphere.dycore.compute_solver_coefficients_matrix import ( + _compute_solver_coefficients_matrix, +) from icon4py.model.atmosphere.dycore.compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta import ( _compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta, ) @@ -46,27 +64,6 @@ from icon4py.model.atmosphere.dycore.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.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 ( - _compute_contravariant_correction_of_w_for_lower_boundary, -) -from icon4py.model.atmosphere.dycore.compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density import ( - _compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density, -) -from icon4py.model.atmosphere.dycore.compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density import ( - _compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density, -) -from icon4py.model.atmosphere.dycore.compute_solver_coefficients_matrix import ( - _compute_solver_coefficients_matrix, -) -from icon4py.model.atmosphere.dycore.set_lower_boundary_condition_for_w_and_contravariant_correction import ( - _set_lower_boundary_condition_for_w_and_contravariant_correction, -) -from icon4py.model.atmosphere.dycore.compute_explicit_part_for_rho_and_exner import ( - _compute_explicit_part_for_rho_and_exner, -) from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_61 import ( _mo_solve_nonhydro_stencil_61, ) @@ -76,6 +73,9 @@ from icon4py.model.atmosphere.dycore.set_cell_kdim_field_to_zero_vp import ( _set_cell_kdim_field_to_zero_vp, ) +from icon4py.model.atmosphere.dycore.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 ( _set_theta_v_prime_ic_at_lower_boundary, ) @@ -570,7 +570,9 @@ def _stencils_39_40( w_concorr_c = where( k_field == nlev, - _compute_contravariant_correction_of_w_for_lower_boundary(e_bln_c_s, z_w_concorr_me, wgtfacq_c_dsl), + _compute_contravariant_correction_of_w_for_lower_boundary( + e_bln_c_s, z_w_concorr_me, wgtfacq_c_dsl + ), w_concorr_c, ) 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/set_lower_boundary_condition_for_w_and_contravariant_correction.py index 22ad093041..6c0b951ce1 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/set_lower_boundary_condition_for_w_and_contravariant_correction.py @@ -26,7 +26,7 @@ def _set_lower_boundary_condition_for_w_and_contravariant_correction( w_concorr_c: Field[[CellDim, KDim], vpfloat] ) -> tuple[Field[[CellDim, KDim], wpfloat], Field[[CellDim, KDim], wpfloat]]: - '''Formerly known as _mo_solve_nonhydro_stencil_47.''' + """Formerly known as _mo_solve_nonhydro_stencil_47.""" w_concorr_c_wp = astype(w_concorr_c, wpfloat) w_nnew_wp = w_concorr_c_wp 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 47c69398b6..82db2bf019 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 @@ -15,9 +15,7 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.accumulate_prep_adv_fields import ( - accumulate_prep_adv_fields, -) +from icon4py.model.atmosphere.dycore.accumulate_prep_adv_fields import accumulate_prep_adv_fields from icon4py.model.common.dimension import EdgeDim, KDim 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_avg_vn.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_avg_vn.py index 242e0ae650..065b7c52c6 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 @@ -15,9 +15,7 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.compute_avg_vn import ( - compute_avg_vn, -) +from icon4py.model.atmosphere.dycore.compute_avg_vn import compute_avg_vn from icon4py.model.common.dimension import E2C2EODim, EdgeDim, KDim 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_contravariant_correction_of_w.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_contravariant_correction_of_w.py index f8fd71f259..cffb524d71 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 @@ -51,7 +51,9 @@ def reference( wgtfac_c: np.array, **kwargs, ) -> dict: - w_concorr_c = compute_contravariant_correction_of_w_numpy(grid, e_bln_c_s, z_w_concorr_me, wgtfac_c) + w_concorr_c = compute_contravariant_correction_of_w_numpy( + grid, e_bln_c_s, z_w_concorr_me, wgtfac_c + ) return dict(w_concorr_c=w_concorr_c) @pytest.fixture 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 93f9c258ac..940abe28b4 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 @@ -61,7 +61,9 @@ def reference( wgtfacq_c: np.array, **kwargs, ) -> dict: - w_concorr_c = compute_contravariant_correction_of_w_for_lower_boundary_numpy(grid, e_bln_c_s, z_w_concorr_me, wgtfacq_c) + w_concorr_c = compute_contravariant_correction_of_w_for_lower_boundary_numpy( + grid, e_bln_c_s, z_w_concorr_me, wgtfacq_c + ) return dict(w_concorr_c=w_concorr_c) @pytest.fixture 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 eb15343a54..8482ee2680 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 @@ -15,9 +15,7 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.compute_mass_flux import ( - compute_mass_flux, -) +from icon4py.model.atmosphere.dycore.compute_mass_flux import compute_mass_flux from icon4py.model.common.dimension import EdgeDim, KDim 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_fused_solve_nonhydro_stencil_39_40.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_fused_solve_nonhydro_stencil_39_40.py index 03448e7da9..39c1c9b95e 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 @@ -23,7 +23,9 @@ from icon4py.model.common.type_alias import vpfloat, wpfloat from .test_compute_contravariant_correction_of_w import compute_contravariant_correction_of_w_numpy -from .test_compute_contravariant_correction_of_w_for_lower_boundary import compute_contravariant_correction_of_w_for_lower_boundary_numpy +from .test_compute_contravariant_correction_of_w_for_lower_boundary import ( + compute_contravariant_correction_of_w_for_lower_boundary_numpy, +) def _fused_solve_nonhydro_stencil_39_40_numpy( @@ -32,7 +34,9 @@ def _fused_solve_nonhydro_stencil_39_40_numpy( w_concorr_c = np.where( (nflatlev < vert_idx) & (vert_idx < nlev), compute_contravariant_correction_of_w_numpy(grid, e_bln_c_s, z_w_concorr_me, wgtfac_c), - compute_contravariant_correction_of_w_for_lower_boundary_numpy(grid, e_bln_c_s, z_w_concorr_me, wgtfacq_c), + compute_contravariant_correction_of_w_for_lower_boundary_numpy( + grid, e_bln_c_s, z_w_concorr_me, wgtfacq_c + ), ) w_concorr_c_res = np.zeros_like(w_concorr_c) From 045689e2b383cffd8a03c4ef57c2579c3b15538b Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Fri, 2 Feb 2024 09:33:24 +0100 Subject: [PATCH 50/60] fix --- .../model/atmosphere/dycore/nh_solve/solve_nonhydro.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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/nh_solve/solve_nonhydro.py index 80e9f6a188..aee7005146 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -66,8 +66,9 @@ ) from icon4py.model.atmosphere.dycore.compute_vn_on_lateral_boundary import ( compute_vn_on_lateral_boundary, - fromcompute_vn_on_lateral_boundarycore.compute_avg_vn_and_graddiv_vn_and_vt, - import, +) +from icon4py.model.atmosphere.dycore.compute_avg_vn_and_graddiv_vn_and_vt import ( + compute_avg_vn_and_graddiv_vn_and_vt, ) from icon4py.model.atmosphere.dycore.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 ( @@ -79,6 +80,8 @@ from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_4th_order_divdamp import ( mo_solve_nonhydro_4th_order_divdamp, ) + + compute_avg_vn_and_graddiv_vn_and_vt, ) from icon4py.model.atmosphere.dycore.accumulate_prep_adv_fields import accumulate_prep_adv_fields From abca169d6ba67578b6ca4a0434d075c64f25513e Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Fri, 2 Feb 2024 09:35:12 +0100 Subject: [PATCH 51/60] fix --- .../model/atmosphere/dycore/nh_solve/solve_nonhydro.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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/nh_solve/solve_nonhydro.py index aee7005146..978255b6c5 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -45,6 +45,9 @@ from icon4py.model.atmosphere.dycore.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_and_graddiv_vn_and_vt import ( + compute_avg_vn_and_graddiv_vn_and_vt, +) from icon4py.model.atmosphere.dycore.compute_graddiv2_of_vn import compute_graddiv2_of_vn from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates import ( compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates, @@ -67,9 +70,6 @@ from icon4py.model.atmosphere.dycore.compute_vn_on_lateral_boundary import ( compute_vn_on_lateral_boundary, ) -from icon4py.model.atmosphere.dycore.compute_avg_vn_and_graddiv_vn_and_vt import ( - compute_avg_vn_and_graddiv_vn_and_vt, -) from icon4py.model.atmosphere.dycore.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 ( mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl, From 0cdd76341157c6fa8710a8453f385cab0a127bd0 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Fri, 2 Feb 2024 09:35:43 +0100 Subject: [PATCH 52/60] real fix --- .../icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py | 2 -- 1 file changed, 2 deletions(-) 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/nh_solve/solve_nonhydro.py index 978255b6c5..bd308dbfcc 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -82,8 +82,6 @@ ) - compute_avg_vn_and_graddiv_vn_and_vt, -) from icon4py.model.atmosphere.dycore.accumulate_prep_adv_fields import accumulate_prep_adv_fields from icon4py.model.atmosphere.dycore.compute_avg_vn import compute_avg_vn from icon4py.model.atmosphere.dycore.compute_divergence_of_fluxes_of_rho_and_theta import ( From d040f6092fabdcd2edcad6b3fa3bcee17076dcc0 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Fri, 2 Feb 2024 09:38:25 +0100 Subject: [PATCH 53/60] fix --- .../atmosphere/dycore/nh_solve/solve_nonhydro.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) 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/nh_solve/solve_nonhydro.py index bd308dbfcc..78f688414e 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -21,6 +21,7 @@ import icon4py.model.atmosphere.dycore.nh_solve.solve_nonhydro_program as nhsolve_prog import icon4py.model.common.constants as constants +from icon4py.model.atmosphere.dycore.accumulate_prep_adv_fields import accumulate_prep_adv_fields from icon4py.model.atmosphere.dycore.add_analysis_increments_to_vn import ( add_analysis_increments_to_vn, ) @@ -45,9 +46,13 @@ from icon4py.model.atmosphere.dycore.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 ( compute_avg_vn_and_graddiv_vn_and_vt, ) +from icon4py.model.atmosphere.dycore.compute_divergence_of_fluxes_of_rho_and_theta import ( + compute_divergence_of_fluxes_of_rho_and_theta, +) from icon4py.model.atmosphere.dycore.compute_graddiv2_of_vn import compute_graddiv2_of_vn from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates import ( compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates, @@ -61,6 +66,7 @@ from icon4py.model.atmosphere.dycore.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_pertubation_of_rho_and_theta import ( compute_pertubation_of_rho_and_theta, ) @@ -80,14 +86,6 @@ from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_4th_order_divdamp import ( mo_solve_nonhydro_4th_order_divdamp, ) - - -from icon4py.model.atmosphere.dycore.accumulate_prep_adv_fields import accumulate_prep_adv_fields -from icon4py.model.atmosphere.dycore.compute_avg_vn import compute_avg_vn -from icon4py.model.atmosphere.dycore.compute_divergence_of_fluxes_of_rho_and_theta import ( - compute_divergence_of_fluxes_of_rho_and_theta, -) -from icon4py.model.atmosphere.dycore.compute_mass_flux import compute_mass_flux from icon4py.model.atmosphere.dycore.mo_solve_nonhydro_stencil_50 import ( mo_solve_nonhydro_stencil_50, ) @@ -1095,7 +1093,7 @@ def run_predictor_step( if self.grid.limited_area: compute_vn_on_lateral_boundary.with_backend(backend)( grf_tend_vn=diagnostic_state_nh.grf_tend_vn, - compute_vn_on_lateral_boundarynnow].vn, + vn_now=prognostic_state[nnow].vn, vn_new=prognostic_state[nnew].vn, dtime=dtime, horizontal_start=start_edge_lb, From 50b141a64994e77e80fcd12b88721051c6a3ccae Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Fri, 2 Feb 2024 11:06:59 +0100 Subject: [PATCH 54/60] test smaler namesize --- ...e_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py | 6 +++--- .../atmosphere/dycore/nh_solve/solve_nonhydro_program.py | 6 +++--- ...e_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py index cf3328f0ed..fa1c666ec6 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py @@ -23,7 +23,7 @@ @field_operator -def _compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta( +def _compute_maximum_cfl_and_clip_contravariant_vertical_velocity( wgtfac_c: Field[[CellDim, KDim], vpfloat], z_rth_pr_2: Field[[CellDim, KDim], vpfloat], theta_v: Field[[CellDim, KDim], wpfloat], @@ -48,7 +48,7 @@ def _compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta( @program(grid_type=GridType.UNSTRUCTURED) -def compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta( +def compute_maximum_cfl_and_clip_contravariant_vertical_velocity( wgtfac_c: Field[[CellDim, KDim], vpfloat], z_rth_pr_2: Field[[CellDim, KDim], vpfloat], theta_v: Field[[CellDim, KDim], wpfloat], @@ -64,7 +64,7 @@ def compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta( vertical_start: int32, vertical_end: int32, ): - _compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta( + _compute_maximum_cfl_and_clip_contravariant_vertical_velocity( wgtfac_c, z_rth_pr_2, theta_v, 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/nh_solve/solve_nonhydro_program.py index 3d8531a5db..7f65d344f5 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/nh_solve/solve_nonhydro_program.py @@ -50,8 +50,8 @@ from icon4py.model.atmosphere.dycore.compute_solver_coefficients_matrix import ( _compute_solver_coefficients_matrix, ) -from icon4py.model.atmosphere.dycore.compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta import ( - _compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta, +from icon4py.model.atmosphere.dycore.compute_maximum_cfl_and_clip_contravariant_vertical_velocity import ( + _compute_maximum_cfl_and_clip_contravariant_vertical_velocity, ) from icon4py.model.atmosphere.dycore.extrapolate_at_top import _extrapolate_at_top from icon4py.model.atmosphere.dycore.extrapolate_temporally_exner_pressure import ( @@ -274,7 +274,7 @@ def _predictor_stencils_7_8_9( (z_theta_v_pr_ic, theta_v_ic, z_th_ddz_exner_c) = where( k_field >= int32(1), - _compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta( + _compute_maximum_cfl_and_clip_contravariant_vertical_velocity( wgtfac_c, z_rth_pr_2, theta_v, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py index ecc3b76e43..58bc396fba 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta import ( - compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta, +from icon4py.model.atmosphere.dycore.compute_maximum_cfl_and_clip_contravariant_vertical_velocity import ( + compute_maximum_cfl_and_clip_contravariant_vertical_velocity, ) from icon4py.model.common.dimension import CellDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil09(StencilTest): - PROGRAM = compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta + PROGRAM = compute_maximum_cfl_and_clip_contravariant_vertical_velocity OUTPUTS = ("z_theta_v_pr_ic", "theta_v_ic", "z_th_ddz_exner_c") @staticmethod From b515e6a3361c892318b8f29e75964cf1069bd774 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Fri, 2 Feb 2024 11:30:38 +0100 Subject: [PATCH 55/60] Revert "test smaler namesize" This reverts commit 50b141a64994e77e80fcd12b88721051c6a3ccae. --- ...e_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py | 6 +++--- .../atmosphere/dycore/nh_solve/solve_nonhydro_program.py | 6 +++--- ...e_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py index fa1c666ec6..cf3328f0ed 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py @@ -23,7 +23,7 @@ @field_operator -def _compute_maximum_cfl_and_clip_contravariant_vertical_velocity( +def _compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta( wgtfac_c: Field[[CellDim, KDim], vpfloat], z_rth_pr_2: Field[[CellDim, KDim], vpfloat], theta_v: Field[[CellDim, KDim], wpfloat], @@ -48,7 +48,7 @@ def _compute_maximum_cfl_and_clip_contravariant_vertical_velocity( @program(grid_type=GridType.UNSTRUCTURED) -def compute_maximum_cfl_and_clip_contravariant_vertical_velocity( +def compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta( wgtfac_c: Field[[CellDim, KDim], vpfloat], z_rth_pr_2: Field[[CellDim, KDim], vpfloat], theta_v: Field[[CellDim, KDim], wpfloat], @@ -64,7 +64,7 @@ def compute_maximum_cfl_and_clip_contravariant_vertical_velocity( vertical_start: int32, vertical_end: int32, ): - _compute_maximum_cfl_and_clip_contravariant_vertical_velocity( + _compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta( wgtfac_c, z_rth_pr_2, theta_v, 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/nh_solve/solve_nonhydro_program.py index 7f65d344f5..3d8531a5db 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/nh_solve/solve_nonhydro_program.py @@ -50,8 +50,8 @@ from icon4py.model.atmosphere.dycore.compute_solver_coefficients_matrix import ( _compute_solver_coefficients_matrix, ) -from icon4py.model.atmosphere.dycore.compute_maximum_cfl_and_clip_contravariant_vertical_velocity import ( - _compute_maximum_cfl_and_clip_contravariant_vertical_velocity, +from icon4py.model.atmosphere.dycore.compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta import ( + _compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta, ) from icon4py.model.atmosphere.dycore.extrapolate_at_top import _extrapolate_at_top from icon4py.model.atmosphere.dycore.extrapolate_temporally_exner_pressure import ( @@ -274,7 +274,7 @@ def _predictor_stencils_7_8_9( (z_theta_v_pr_ic, theta_v_ic, z_th_ddz_exner_c) = where( k_field >= int32(1), - _compute_maximum_cfl_and_clip_contravariant_vertical_velocity( + _compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta( wgtfac_c, z_rth_pr_2, theta_v, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py index 58bc396fba..ecc3b76e43 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.compute_maximum_cfl_and_clip_contravariant_vertical_velocity import ( - compute_maximum_cfl_and_clip_contravariant_vertical_velocity, +from icon4py.model.atmosphere.dycore.compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta import ( + compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta, ) from icon4py.model.common.dimension import CellDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil09(StencilTest): - PROGRAM = compute_maximum_cfl_and_clip_contravariant_vertical_velocity + PROGRAM = compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta OUTPUTS = ("z_theta_v_pr_ic", "theta_v_ic", "z_th_ddz_exner_c") @staticmethod From ac057613fbf0d048dc8605a28821013dd2e6729c Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Fri, 2 Feb 2024 11:32:57 +0100 Subject: [PATCH 56/60] test smaller namesize --- ....py => compute_theta_v_prime_at_ic_and_theta_v_at_ic.py} | 6 +++--- .../atmosphere/dycore/nh_solve/solve_nonhydro_program.py | 6 +++--- ...> test_compute_theta_v_prime_at_ic_and_theta_v_at_ic.py} | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py => compute_theta_v_prime_at_ic_and_theta_v_at_ic.py} (92%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py => test_compute_theta_v_prime_at_ic_and_theta_v_at_ic.py} (94%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_theta_v_prime_at_ic_and_theta_v_at_ic.py similarity index 92% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_theta_v_prime_at_ic_and_theta_v_at_ic.py index cf3328f0ed..932bd46f8b 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_theta_v_prime_at_ic_and_theta_v_at_ic.py @@ -23,7 +23,7 @@ @field_operator -def _compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta( +def _compute_theta_v_prime_at_ic_and_theta_v_at_ic( wgtfac_c: Field[[CellDim, KDim], vpfloat], z_rth_pr_2: Field[[CellDim, KDim], vpfloat], theta_v: Field[[CellDim, KDim], wpfloat], @@ -48,7 +48,7 @@ def _compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta( @program(grid_type=GridType.UNSTRUCTURED) -def compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta( +def compute_theta_v_prime_at_ic_and_theta_v_at_ic( wgtfac_c: Field[[CellDim, KDim], vpfloat], z_rth_pr_2: Field[[CellDim, KDim], vpfloat], theta_v: Field[[CellDim, KDim], wpfloat], @@ -64,7 +64,7 @@ def compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta( vertical_start: int32, vertical_end: int32, ): - _compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta( + _compute_theta_v_prime_at_ic_and_theta_v_at_ic( wgtfac_c, z_rth_pr_2, theta_v, 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/nh_solve/solve_nonhydro_program.py index 3d8531a5db..4772f9f802 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/nh_solve/solve_nonhydro_program.py @@ -50,8 +50,8 @@ from icon4py.model.atmosphere.dycore.compute_solver_coefficients_matrix import ( _compute_solver_coefficients_matrix, ) -from icon4py.model.atmosphere.dycore.compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta import ( - _compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta, +from icon4py.model.atmosphere.dycore.compute_theta_v_prime_at_ic_and_theta_v_at_ic import ( + _compute_theta_v_prime_at_ic_and_theta_v_at_ic, ) from icon4py.model.atmosphere.dycore.extrapolate_at_top import _extrapolate_at_top from icon4py.model.atmosphere.dycore.extrapolate_temporally_exner_pressure import ( @@ -274,7 +274,7 @@ def _predictor_stencils_7_8_9( (z_theta_v_pr_ic, theta_v_ic, z_th_ddz_exner_c) = where( k_field >= int32(1), - _compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta( + _compute_theta_v_prime_at_ic_and_theta_v_at_ic( wgtfac_c, z_rth_pr_2, theta_v, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_theta_v_prime_at_ic_and_theta_v_at_ic.py similarity index 94% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_theta_v_prime_at_ic_and_theta_v_at_ic.py index ecc3b76e43..ed5eccf67c 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_theta_v_prime_at_ic_and_theta_v_at_ic.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta import ( - compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta, +from icon4py.model.atmosphere.dycore.compute_theta_v_prime_at_ic_and_theta_v_at_ic import ( + compute_theta_v_prime_at_ic_and_theta_v_at_ic, ) from icon4py.model.common.dimension import CellDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil09(StencilTest): - PROGRAM = compute_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta + PROGRAM = compute_theta_v_prime_at_ic_and_theta_v_at_ic OUTPUTS = ("z_theta_v_pr_ic", "theta_v_ic", "z_th_ddz_exner_c") @staticmethod From 17687e79e1334daa9149fa1dbbcbfbd92149a13d Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Fri, 2 Feb 2024 13:22:34 +0100 Subject: [PATCH 57/60] make names shorter --- ...virtual_potential_temperatures_and_pressure_gradient.py} | 6 +++--- ...virtual_potential_temperatures_and_pressure_gradient.py} | 6 +++--- .../model/atmosphere/dycore/nh_solve/solve_nonhydro.py | 6 +++--- .../atmosphere/dycore/nh_solve/solve_nonhydro_program.py | 6 +++--- ...virtual_potential_temperatures_and_pressure_gradient.py} | 6 +++--- ...virtual_potential_temperatures_and_pressure_gradient.py} | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py => compute_rho_virtual_potential_temperatures_and_pressure_gradient.py} (94%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{compute_theta_v_prime_at_ic_and_theta_v_at_ic.py => compute_virtual_potential_temperatures_and_pressure_gradient.py} (93%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py => test_compute_rho_virtual_potential_temperatures_and_pressure_gradient.py} (94%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_compute_theta_v_prime_at_ic_and_theta_v_at_ic.py => test_compute_virtual_potential_temperatures_and_pressure_gradient.py} (93%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_rho_virtual_potential_temperatures_and_pressure_gradient.py similarity index 94% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_rho_virtual_potential_temperatures_and_pressure_gradient.py index cbd03371c4..e7946a1c2f 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_rho_virtual_potential_temperatures_and_pressure_gradient.py @@ -20,7 +20,7 @@ @field_operator -def _compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta( +def _compute_rho_virtual_potential_temperatures_and_pressure_gradient( w: Field[[CellDim, KDim], wpfloat], w_concorr_c: Field[[CellDim, KDim], vpfloat], ddqz_z_half: Field[[CellDim, KDim], vpfloat], @@ -84,7 +84,7 @@ def _compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gr @program(grid_type=GridType.UNSTRUCTURED) -def compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta( +def compute_rho_virtual_potential_temperatures_and_pressure_gradient( w: Field[[CellDim, KDim], wpfloat], w_concorr_c: Field[[CellDim, KDim], vpfloat], ddqz_z_half: Field[[CellDim, KDim], vpfloat], @@ -109,7 +109,7 @@ def compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gra vertical_start: int32, vertical_end: int32, ): - _compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta( + _compute_rho_virtual_potential_temperatures_and_pressure_gradient( w, w_concorr_c, ddqz_z_half, diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_theta_v_prime_at_ic_and_theta_v_at_ic.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_virtual_potential_temperatures_and_pressure_gradient.py similarity index 93% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_theta_v_prime_at_ic_and_theta_v_at_ic.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_virtual_potential_temperatures_and_pressure_gradient.py index 932bd46f8b..440d660e33 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_theta_v_prime_at_ic_and_theta_v_at_ic.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_virtual_potential_temperatures_and_pressure_gradient.py @@ -23,7 +23,7 @@ @field_operator -def _compute_theta_v_prime_at_ic_and_theta_v_at_ic( +def _compute_virtual_potential_temperatures_and_pressure_gradient( wgtfac_c: Field[[CellDim, KDim], vpfloat], z_rth_pr_2: Field[[CellDim, KDim], vpfloat], theta_v: Field[[CellDim, KDim], wpfloat], @@ -48,7 +48,7 @@ def _compute_theta_v_prime_at_ic_and_theta_v_at_ic( @program(grid_type=GridType.UNSTRUCTURED) -def compute_theta_v_prime_at_ic_and_theta_v_at_ic( +def compute_virtual_potential_temperatures_and_pressure_gradient( wgtfac_c: Field[[CellDim, KDim], vpfloat], z_rth_pr_2: Field[[CellDim, KDim], vpfloat], theta_v: Field[[CellDim, KDim], wpfloat], @@ -64,7 +64,7 @@ def compute_theta_v_prime_at_ic_and_theta_v_at_ic( vertical_start: int32, vertical_end: int32, ): - _compute_theta_v_prime_at_ic_and_theta_v_at_ic( + _compute_virtual_potential_temperatures_and_pressure_gradient( wgtfac_c, z_rth_pr_2, theta_v, 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/nh_solve/solve_nonhydro.py index 78f688414e..6b188b1f7b 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -70,8 +70,8 @@ from icon4py.model.atmosphere.dycore.compute_pertubation_of_rho_and_theta import ( compute_pertubation_of_rho_and_theta, ) -from icon4py.model.atmosphere.dycore.compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta import ( - compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta, +from icon4py.model.atmosphere.dycore.compute_rho_virtual_potential_temperatures_and_pressure_gradient import ( + compute_rho_virtual_potential_temperatures_and_pressure_gradient, ) from icon4py.model.atmosphere.dycore.compute_vn_on_lateral_boundary import ( compute_vn_on_lateral_boundary, @@ -1519,7 +1519,7 @@ def run_corrector_step( offset_provider={}, ) log.debug(f"corrector: start stencil 10") - compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.with_backend( + compute_rho_virtual_potential_temperatures_and_pressure_gradient.with_backend( backend )( w=prognostic_state[nnew].w, 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/nh_solve/solve_nonhydro_program.py index 4772f9f802..07b8ac177c 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/nh_solve/solve_nonhydro_program.py @@ -50,8 +50,8 @@ from icon4py.model.atmosphere.dycore.compute_solver_coefficients_matrix import ( _compute_solver_coefficients_matrix, ) -from icon4py.model.atmosphere.dycore.compute_theta_v_prime_at_ic_and_theta_v_at_ic import ( - _compute_theta_v_prime_at_ic_and_theta_v_at_ic, +from icon4py.model.atmosphere.dycore.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 ( @@ -274,7 +274,7 @@ def _predictor_stencils_7_8_9( (z_theta_v_pr_ic, theta_v_ic, z_th_ddz_exner_c) = where( k_field >= int32(1), - _compute_theta_v_prime_at_ic_and_theta_v_at_ic( + _compute_virtual_potential_temperatures_and_pressure_gradient( wgtfac_c, z_rth_pr_2, theta_v, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_rho_virtual_potential_temperatures_and_pressure_gradient.py similarity index 94% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_rho_virtual_potential_temperatures_and_pressure_gradient.py index 4dfab758df..2d69352cdf 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_rho_virtual_potential_temperatures_and_pressure_gradient.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta import ( - compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta, +from icon4py.model.atmosphere.dycore.compute_rho_virtual_potential_temperatures_and_pressure_gradient import ( + compute_rho_virtual_potential_temperatures_and_pressure_gradient, ) from icon4py.model.common.dimension import CellDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -25,7 +25,7 @@ class TestMoSolveNonhydroStencil10(StencilTest): PROGRAM = ( - compute_rho_at_ic_and_theta_v_prime_at_ic_and_theta_v_at_ic_and_pressure_gradient_theta + compute_rho_virtual_potential_temperatures_and_pressure_gradient ) OUTPUTS = ("rho_ic", "z_theta_v_pr_ic", "theta_v_ic", "z_th_ddz_exner_c") diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_theta_v_prime_at_ic_and_theta_v_at_ic.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_virtual_potential_temperatures_and_pressure_gradient.py similarity index 93% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_theta_v_prime_at_ic_and_theta_v_at_ic.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_virtual_potential_temperatures_and_pressure_gradient.py index ed5eccf67c..5a7045c146 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_theta_v_prime_at_ic_and_theta_v_at_ic.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_virtual_potential_temperatures_and_pressure_gradient.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.compute_theta_v_prime_at_ic_and_theta_v_at_ic import ( - compute_theta_v_prime_at_ic_and_theta_v_at_ic, +from icon4py.model.atmosphere.dycore.compute_virtual_potential_temperatures_and_pressure_gradient import ( + compute_virtual_potential_temperatures_and_pressure_gradient, ) from icon4py.model.common.dimension import CellDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil09(StencilTest): - PROGRAM = compute_theta_v_prime_at_ic_and_theta_v_at_ic + PROGRAM = compute_virtual_potential_temperatures_and_pressure_gradient OUTPUTS = ("z_theta_v_pr_ic", "theta_v_ic", "z_th_ddz_exner_c") @staticmethod From 16dee051cdd632d348c7d82622382475af420729 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Fri, 2 Feb 2024 13:34:40 +0100 Subject: [PATCH 58/60] shorten names --- ...wind_from_advection_and_vertical_wind_density.py} | 6 +++--- ...al_wind_speed_and_vertical_wind_times_density.py} | 6 +++--- .../dycore/nh_solve/solve_nonhydro_program.py | 12 ++++++------ ...wind_from_advection_and_vertical_wind_density.py} | 6 +++--- ...al_wind_speed_and_vertical_wind_times_density.py} | 6 +++--- 5 files changed, 18 insertions(+), 18 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density.py => compute_explicit_vertical_wind_from_advection_and_vertical_wind_density.py} (89%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py => compute_explicit_vertical_wind_speed_and_vertical_wind_times_density.py} (90%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density.py => test_compute_explicit_vertical_wind_from_advection_and_vertical_wind_density.py} (88%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py => test_compute_explicit_vertical_wind_speed_and_vertical_wind_times_density.py} (89%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_vertical_wind_from_advection_and_vertical_wind_density.py similarity index 89% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_vertical_wind_from_advection_and_vertical_wind_density.py index e2eeb3922f..fd92650a5a 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_vertical_wind_from_advection_and_vertical_wind_density.py @@ -20,7 +20,7 @@ @field_operator -def _compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density( +def _compute_explicit_vertical_wind_from_advection_and_vertical_wind_density( w_nnow: Field[[CellDim, KDim], wpfloat], ddt_w_adv_ntl1: Field[[CellDim, KDim], vpfloat], ddt_w_adv_ntl2: Field[[CellDim, KDim], vpfloat], @@ -48,7 +48,7 @@ def _compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advec @program(grid_type=GridType.UNSTRUCTURED) -def compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density( +def compute_explicit_vertical_wind_from_advection_and_vertical_wind_density( z_w_expl: Field[[CellDim, KDim], wpfloat], w_nnow: Field[[CellDim, KDim], wpfloat], ddt_w_adv_ntl1: Field[[CellDim, KDim], vpfloat], @@ -67,7 +67,7 @@ def compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advect vertical_start: int32, vertical_end: int32, ): - _compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density( + _compute_explicit_vertical_wind_from_advection_and_vertical_wind_density( w_nnow, ddt_w_adv_ntl1, ddt_w_adv_ntl2, diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_vertical_wind_speed_and_vertical_wind_times_density.py similarity index 90% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_vertical_wind_speed_and_vertical_wind_times_density.py index 645ca0600c..db051b6d18 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_explicit_vertical_wind_speed_and_vertical_wind_times_density.py @@ -20,7 +20,7 @@ @field_operator -def _compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density( +def _compute_explicit_vertical_wind_speed_and_vertical_wind_times_density( w_nnow: Field[[CellDim, KDim], wpfloat], ddt_w_adv_ntl1: Field[[CellDim, KDim], vpfloat], z_th_ddz_exner_c: Field[[CellDim, KDim], vpfloat], @@ -41,7 +41,7 @@ def _compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_de @program(grid_type=GridType.UNSTRUCTURED) -def compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density( +def compute_explicit_vertical_wind_speed_and_vertical_wind_times_density( z_w_expl: Field[[CellDim, KDim], wpfloat], w_nnow: Field[[CellDim, KDim], wpfloat], ddt_w_adv_ntl1: Field[[CellDim, KDim], vpfloat], @@ -57,7 +57,7 @@ def compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_den vertical_start: int32, vertical_end: int32, ): - _compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density( + _compute_explicit_vertical_wind_speed_and_vertical_wind_times_density( w_nnow, ddt_w_adv_ntl1, z_th_ddz_exner_c, 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/nh_solve/solve_nonhydro_program.py index 07b8ac177c..4ff5e77914 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/nh_solve/solve_nonhydro_program.py @@ -26,11 +26,11 @@ from icon4py.model.atmosphere.dycore.compute_explicit_part_for_rho_and_exner import ( _compute_explicit_part_for_rho_and_exner, ) -from icon4py.model.atmosphere.dycore.compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density import ( - _compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density, +from icon4py.model.atmosphere.dycore.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_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density import ( - _compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density, +from icon4py.model.atmosphere.dycore.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_first_vertical_derivative import ( _compute_first_vertical_derivative, @@ -648,7 +648,7 @@ def _stencils_42_44_45_45b( ]: (z_w_expl, z_contr_w_fl_l) = where( (k_field >= int32(1)) & (k_field < nlev), - _compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density( + _compute_explicit_vertical_wind_from_advection_and_vertical_wind_density( w_nnow, ddt_w_adv_ntl1, ddt_w_adv_ntl2, @@ -788,7 +788,7 @@ def _stencils_43_44_45_45b( ]: (z_w_expl, z_contr_w_fl_l) = where( (k_field >= int32(1)) & (k_field < nlev), - _compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density( + _compute_explicit_vertical_wind_speed_and_vertical_wind_times_density( w_nnow, ddt_w_adv_ntl1, z_th_ddz_exner_c, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_vertical_wind_from_advection_and_vertical_wind_density.py similarity index 88% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_vertical_wind_from_advection_and_vertical_wind_density.py index eb363aac54..f7aa8d7a64 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_vertical_wind_from_advection_and_vertical_wind_density.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density import ( - compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density, +from icon4py.model.atmosphere.dycore.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.dimension import CellDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil42(StencilTest): - PROGRAM = compute_explicit_part_of_vertical_wind_speed_from_temporally_averaged_advection_and_vertical_velocity_times_density + PROGRAM = compute_explicit_vertical_wind_from_advection_and_vertical_wind_density OUTPUTS = ("z_w_expl", "z_contr_w_fl_l") @staticmethod diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_vertical_wind_speed_and_vertical_wind_times_density.py similarity index 89% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_vertical_wind_speed_and_vertical_wind_times_density.py index d18c09a9a9..56148077e0 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_explicit_vertical_wind_speed_and_vertical_wind_times_density.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density import ( - compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density, +from icon4py.model.atmosphere.dycore.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.dimension import CellDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field, zero_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil43(StencilTest): - PROGRAM = compute_explicit_part_of_vertical_wind_speed_and_vertical_velocity_times_density + PROGRAM = compute_explicit_vertical_wind_speed_and_vertical_wind_times_density OUTPUTS = ("z_w_expl", "z_contr_w_fl_l") @staticmethod From 876dddd57eb07d9c80c3caa7bb15a41e36e1c7f1 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Fri, 2 Feb 2024 13:50:02 +0100 Subject: [PATCH 59/60] shorten names --- ...adient_of_exner_pressure_for_flat_coordinates.py} | 6 +++--- ...ent_of_exner_pressure_for_nonflat_coordinates.py} | 6 +++--- .../atmosphere/dycore/nh_solve/solve_nonhydro.py | 12 ++++++------ ...adient_of_exner_pressure_for_flat_coordinates.py} | 6 +++--- ...ent_of_exner_pressure_for_nonflat_coordinates.py} | 6 +++--- 5 files changed, 18 insertions(+), 18 deletions(-) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates.py => compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates.py} (87%) rename model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/{compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates.py => compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates.py} (89%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates.py => test_compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates.py} (93%) rename model/atmosphere/dycore/tests/dycore_stencil_tests/{test_compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates.py => test_compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates.py} (92%) diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates.py similarity index 87% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates.py index 4306f06bd2..4ee7291067 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates.py @@ -20,7 +20,7 @@ @field_operator -def _compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates( +def _compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates( inv_dual_edge_length: Field[[EdgeDim], wpfloat], z_exner_ex_pr: Field[[CellDim, KDim], vpfloat], ) -> Field[[EdgeDim, KDim], vpfloat]: @@ -32,7 +32,7 @@ def _compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates( @program(grid_type=GridType.UNSTRUCTURED) -def compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates( +def compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates( inv_dual_edge_length: Field[[EdgeDim], wpfloat], z_exner_ex_pr: Field[[CellDim, KDim], vpfloat], z_gradh_exner: Field[[EdgeDim, KDim], vpfloat], @@ -41,7 +41,7 @@ def compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates( vertical_start: int32, vertical_end: int32, ): - _compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates( + _compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates( inv_dual_edge_length, z_exner_ex_pr, out=z_gradh_exner, diff --git a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates.py b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates.py similarity index 89% rename from model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates.py rename to model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates.py index 4a0521cfb7..8e1bec848d 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates.py @@ -20,7 +20,7 @@ @field_operator -def _compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates( +def _compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates( inv_dual_edge_length: Field[[EdgeDim], wpfloat], z_exner_ex_pr: Field[[CellDim, KDim], vpfloat], ddxn_z_full: Field[[EdgeDim, KDim], vpfloat], @@ -37,7 +37,7 @@ def _compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordi @program(grid_type=GridType.UNSTRUCTURED) -def compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates( +def compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates( inv_dual_edge_length: Field[[EdgeDim], wpfloat], z_exner_ex_pr: Field[[CellDim, KDim], vpfloat], ddxn_z_full: Field[[EdgeDim, KDim], vpfloat], @@ -49,7 +49,7 @@ def compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordin vertical_start: int32, vertical_end: int32, ): - _compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates( + _compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates( inv_dual_edge_length, z_exner_ex_pr, ddxn_z_full, 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/nh_solve/solve_nonhydro.py index 6b188b1f7b..084582ee02 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -54,14 +54,14 @@ compute_divergence_of_fluxes_of_rho_and_theta, ) from icon4py.model.atmosphere.dycore.compute_graddiv2_of_vn import compute_graddiv2_of_vn -from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates import ( - compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates, +from icon4py.model.atmosphere.dycore.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_extner_pressure_for_multiple_levels import ( compute_horizontal_gradient_of_extner_pressure_for_multiple_levels, ) -from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates import ( - compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates, +from icon4py.model.atmosphere.dycore.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_hydrostatic_correction_term import ( compute_hydrostatic_correction_term, @@ -965,7 +965,7 @@ def run_predictor_step( ) # Remaining computations at edge points - compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates.with_backend( + compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates.with_backend( backend )( inv_dual_edge_length=self.edge_geometry.inverse_dual_edge_lengths, @@ -984,7 +984,7 @@ def run_predictor_step( # horizontal gradient of Exner pressure, including metric correction # horizontal gradient of Exner pressure, Taylor-expansion-based reconstruction - compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates.with_backend( + compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates.with_backend( backend )( inv_dual_edge_length=self.edge_geometry.inverse_dual_edge_lengths, diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates.py similarity index 93% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates.py index b7f6b8ce09..a9d39749b9 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates import ( - compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates, +from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates import ( + compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates, ) from icon4py.model.common.dimension import CellDim, E2CDim, EdgeDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil18(StencilTest): - PROGRAM = compute_horizontal_gradient_of_exner_pressure_for_flat_surface_coordinates + PROGRAM = compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates OUTPUTS = ("z_gradh_exner",) @staticmethod diff --git a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates.py b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates.py similarity index 92% rename from model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates.py rename to model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates.py index 4c6c02d643..9e869aa996 100644 --- a/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates.py +++ b/model/atmosphere/dycore/tests/dycore_stencil_tests/test_compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates.py @@ -15,8 +15,8 @@ import pytest from gt4py.next.ffront.fbuiltins import int32 -from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates import ( - compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates, +from icon4py.model.atmosphere.dycore.compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates import ( + compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates, ) from icon4py.model.common.dimension import CellDim, E2CDim, EdgeDim, KDim from icon4py.model.common.test_utils.helpers import StencilTest, random_field @@ -24,7 +24,7 @@ class TestMoSolveNonhydroStencil19(StencilTest): - PROGRAM = compute_horizontal_gradient_of_extner_pressure_for_terrain_following_coordinates + PROGRAM = compute_horizontal_gradient_of_exner_pressure_for_nonflat_coordinates OUTPUTS = ("z_gradh_exner",) @staticmethod From eaf7706c4adf716eb042e0204a81d31326f9ecd4 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Fri, 2 Feb 2024 13:51:28 +0100 Subject: [PATCH 60/60] fix style --- .../atmosphere/dycore/nh_solve/solve_nonhydro.py | 14 +++++--------- .../dycore/nh_solve/solve_nonhydro_program.py | 6 +++--- ...potential_temperatures_and_pressure_gradient.py | 4 +--- 3 files changed, 9 insertions(+), 15 deletions(-) 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/nh_solve/solve_nonhydro.py index 084582ee02..5d700c2b89 100644 --- a/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py +++ b/model/atmosphere/dycore/src/icon4py/model/atmosphere/dycore/nh_solve/solve_nonhydro.py @@ -57,12 +57,12 @@ from icon4py.model.atmosphere.dycore.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_extner_pressure_for_multiple_levels import ( - compute_horizontal_gradient_of_extner_pressure_for_multiple_levels, -) from icon4py.model.atmosphere.dycore.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_extner_pressure_for_multiple_levels import ( + compute_horizontal_gradient_of_extner_pressure_for_multiple_levels, +) from icon4py.model.atmosphere.dycore.compute_hydrostatic_correction_term import ( compute_hydrostatic_correction_term, ) @@ -965,9 +965,7 @@ def run_predictor_step( ) # Remaining computations at edge points - compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates.with_backend( - backend - )( + compute_horizontal_gradient_of_exner_pressure_for_flat_coordinates.with_backend(backend)( inv_dual_edge_length=self.edge_geometry.inverse_dual_edge_lengths, z_exner_ex_pr=self.z_exner_ex_pr, z_gradh_exner=z_fields.z_gradh_exner, @@ -1519,9 +1517,7 @@ def run_corrector_step( offset_provider={}, ) log.debug(f"corrector: start stencil 10") - compute_rho_virtual_potential_temperatures_and_pressure_gradient.with_backend( - backend - )( + compute_rho_virtual_potential_temperatures_and_pressure_gradient.with_backend(backend)( w=prognostic_state[nnew].w, w_concorr_c=diagnostic_state_nh.w_concorr_c, ddqz_z_half=self.metric_state_nonhydro.ddqz_z_half, 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/nh_solve/solve_nonhydro_program.py index 4ff5e77914..7006183854 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/nh_solve/solve_nonhydro_program.py @@ -26,12 +26,12 @@ from icon4py.model.atmosphere.dycore.compute_explicit_part_for_rho_and_exner import ( _compute_explicit_part_for_rho_and_exner, ) -from icon4py.model.atmosphere.dycore.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_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 ( + _compute_explicit_vertical_wind_speed_and_vertical_wind_times_density, +) from icon4py.model.atmosphere.dycore.compute_first_vertical_derivative import ( _compute_first_vertical_derivative, ) 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 2d69352cdf..b1ac5b1ec9 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 @@ -24,9 +24,7 @@ class TestMoSolveNonhydroStencil10(StencilTest): - PROGRAM = ( - compute_rho_virtual_potential_temperatures_and_pressure_gradient - ) + PROGRAM = compute_rho_virtual_potential_temperatures_and_pressure_gradient OUTPUTS = ("rho_ic", "z_theta_v_pr_ic", "theta_v_ic", "z_th_ddz_exner_c") @staticmethod