Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename stencils from mo_solve_nondyro first batch. #376

Merged
merged 63 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
886b678
fix comment
huppd Jan 29, 2024
832a009
rename stencil
huppd Jan 29, 2024
d024930
rename stencil
huppd Jan 29, 2024
1d5747d
rename stencil
huppd Jan 29, 2024
ad1dc2c
rename stencil
huppd Jan 29, 2024
641b242
rename stencils
huppd Jan 29, 2024
d9419c7
rename stencil
huppd Jan 29, 2024
aa9c112
rename stencil
huppd Jan 29, 2024
6ed83b7
cleanup stencil
huppd Jan 29, 2024
73624e4
fix style
huppd Jan 29, 2024
1877258
fix programm
huppd Jan 29, 2024
ec03e3a
Merge branch 'rename_stencils_II' of github.com:C2SM/icon4py into ren…
huppd Jan 29, 2024
e32d41d
fixes
huppd Jan 29, 2024
2d6baf3
fix
huppd Jan 29, 2024
489e739
fix
huppd Jan 29, 2024
f332a03
Merge remote-tracking branch 'origin/main' into rename_stencils_II
huppd Jan 30, 2024
f826768
fix test
huppd Jan 30, 2024
882bd05
rename stencils
huppd Jan 31, 2024
fcb77e2
rename stencil
huppd Jan 31, 2024
ab0e5c7
rename stencil
huppd Jan 31, 2024
bfa1aae
rename stencil
huppd Jan 31, 2024
84aa4cf
rename stencil
huppd Jan 31, 2024
7212cde
fix style
huppd Jan 31, 2024
9197e86
fix ws
huppd Jan 31, 2024
98694bd
fix
huppd Jan 31, 2024
6513bcc
fix
huppd Jan 31, 2024
07c1f26
rename stencil
huppd Jan 31, 2024
62f776d
rename stencil
huppd Jan 31, 2024
9b7f282
rename stencil
huppd Jan 31, 2024
e56112d
rename stencils
huppd Jan 31, 2024
86780d8
rename stencil
huppd Jan 31, 2024
099cd94
rename stencil
huppd Jan 31, 2024
510b74d
rename
huppd Feb 1, 2024
df1ecf6
rename
huppd Feb 1, 2024
c801293
cleanup
huppd Feb 1, 2024
54a1778
rename
huppd Feb 1, 2024
d1a5e9c
rename
huppd Feb 1, 2024
5076f50
rename
huppd Feb 1, 2024
45194ba
rename
huppd Feb 1, 2024
7a23851
rename
huppd Feb 1, 2024
07f5948
rename
huppd Feb 1, 2024
2556d76
rename
huppd Feb 1, 2024
65aea11
rename
huppd Feb 1, 2024
a235f5f
rename
huppd Feb 1, 2024
8ea2453
rename
huppd Feb 1, 2024
d6e7fe7
rename
huppd Feb 1, 2024
ac96f84
rename
huppd Feb 1, 2024
3c9409b
rename
huppd Feb 1, 2024
5891d49
rename
huppd Feb 1, 2024
80e7200
rename
huppd Feb 2, 2024
6977a6f
fix style
huppd Feb 2, 2024
045689e
fix
huppd Feb 2, 2024
abca169
fix
huppd Feb 2, 2024
0cdd763
real fix
huppd Feb 2, 2024
d040f60
fix
huppd Feb 2, 2024
9765b91
Merge remote-tracking branch 'origin/main' into rename_stencils_II
huppd Feb 2, 2024
50b141a
test smaler namesize
huppd Feb 2, 2024
b515e6a
Revert "test smaler namesize"
huppd Feb 2, 2024
ac05761
test smaller namesize
huppd Feb 2, 2024
17687e7
make names shorter
huppd Feb 2, 2024
16dee05
shorten names
huppd Feb 2, 2024
876dddd
shorten names
huppd Feb 2, 2024
eaf7706
fix style
huppd Feb 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,21 @@


@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],
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


@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],
Expand All @@ -44,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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,20 @@


@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,
) -> 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)
return vn_wp


@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,
Expand All @@ -41,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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand All @@ -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 * (
Expand All @@ -40,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],
Expand All @@ -54,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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand All @@ -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
)
Expand All @@ -46,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],
Expand All @@ -63,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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@


@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],
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))
Expand All @@ -40,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],
Expand All @@ -51,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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,20 @@


@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)
return vn_wp


@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,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,19 @@


@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],
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


@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],
Expand All @@ -41,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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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],
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@


@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],
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
Expand All @@ -34,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],
Expand All @@ -45,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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@


@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]:
"""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


@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],
Expand All @@ -38,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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,14 @@
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.mo_solve_nonhydro_stencil_31 import (
_mo_solve_nonhydro_stencil_31,
)
from icon4py.model.common.dimension import E2C2EO, E2C2EDim, E2C2EODim, EdgeDim, KDim
from icon4py.model.common.type_alias import vpfloat, wpfloat


@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],
Expand All @@ -34,14 +32,15 @@ def _mo_solve_nonhydro_stencil_30(
Field[[EdgeDim, KDim], vpfloat],
Field[[EdgeDim, KDim], vpfloat],
]:
z_vn_avg_wp = _mo_solve_nonhydro_stencil_31(e_flx_avg=e_flx_avg, vn=vn)
"""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)
return z_vn_avg_wp, z_graddiv_vn_vp, vt_vp


@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],
Expand All @@ -54,7 +53,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,
Expand Down
Loading
Loading