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
Changes from 1 commit
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
Prev Previous commit
Next Next commit
rename
  • Loading branch information
huppd committed Feb 1, 2024
commit 2556d769ac21cb123363abf0232e01c851733906
Original file line number Diff line number Diff line change
@@ -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,
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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,
)

Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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),
)