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

Bugfixes due to wrong dimensions in greenline #319

Merged
merged 31 commits into from
Nov 28, 2023
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e164d9e
fix cffi_utils.py tests in tools
halungge Nov 21, 2023
3a0c121
Fix: Explicit roundtrip backend set on advection tests
Nov 21, 2023
dd2fbf0
add backend fixture to test_diffusion_utils.py and test_face_val_ppm_…
halungge Nov 22, 2023
cc8e0b4
pre-commit fix
halungge Nov 22, 2023
34aed88
Add backend fixture to advection tests
Nov 22, 2023
5e45c10
fix stencil test:
halungge Nov 22, 2023
29ea5fa
fix test_cffi_utils.py:
halungge Nov 22, 2023
b4da7e4
pre-commit fix for model/common
halungge Nov 23, 2023
0876be7
fix datatest for model/common
halungge Nov 23, 2023
b5d6781
fix datatest for model/driver
halungge Nov 23, 2023
b504319
pre-commit fixes in test_vertical.py
halungge Nov 23, 2023
5f7fd28
Pre-commit fix in diffusion
Nov 23, 2023
2231057
fixing datatest for diffusion: ignoring assertion failure in verficat…
halungge Nov 23, 2023
8489f6a
fix datatest test_velocity_advection.py
halungge Nov 23, 2023
6bb2410
fix datatest test_solve_nonhydro.py
halungge Nov 23, 2023
26910d4
Merge branch 'fix_tests_advection' of github.com:C2SM/icon4py into fi…
halungge Nov 23, 2023
9cc260a
fix test_divide_flux_area_list_stencil_02.py
halungge Nov 23, 2023
4bc72ac
remove remaining np.asarray in test_diffusion_utils.py
halungge Nov 23, 2023
2157c64
Replace np.asarray with .asnumpy in test_divide_flux_area_list_stenci…
ninaburg Nov 23, 2023
0ff8f3c
fix dimension issue in EdgeParams
halungge Nov 24, 2023
798f101
remove ClassCache that still makes troubles
halungge Nov 24, 2023
281b8ac
Merge branch 'fix_tests_advection' of github.com:C2SM/icon4py into fi…
halungge Nov 24, 2023
b331e3f
remove ClassCache that still makes troubles
halungge Nov 24, 2023
ee58be1
revert change in velocity_advection.py: vertical_upper value in stenc…
halungge Nov 24, 2023
7effec7
fix some more dimensions serialbox_utils.py: edge sparse fields
halungge Nov 24, 2023
dfda465
unfused velocity_advection_stencil_4_5_6 to avoid segfault
halungge Nov 24, 2023
55cc3b6
merge main
halungge Nov 24, 2023
4ed9ed2
remove exclusion of klevel = 0 in test_velocity_advection.py predictor
halungge Nov 24, 2023
c8ed298
remove exclusion of klevel in test_solve_nonhydro.py, remove test ski…
halungge Nov 24, 2023
20329b2
pre-commit
halungge Nov 24, 2023
92ba4ae
identical verification for stencil_19 in corrector and predictor
halungge Nov 28, 2023
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
Fix: Explicit roundtrip backend set on advection tests
Nina Burgdorfer authored and Nina Burgdorfer committed Nov 21, 2023
commit 3a0c12165c333868ec7d3b3327e230314a805553
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later

import numpy as np
from gt4py.next.program_processors.runners import roundtrip

from icon4py.model.atmosphere.advection.btraj_dreg_stencil_01 import btraj_dreg_stencil_01
from icon4py.model.common.dimension import EdgeDim, KDim
@@ -52,7 +53,7 @@ def test_btraj_dreg_stencil_01():
np.asarray(tangent_orientation),
)

btraj_dreg_stencil_01(
btraj_dreg_stencil_01.with_backend(roundtrip.backend)(
lcounterclock,
p_vn,
tangent_orientation,
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@
import numpy as np
from gt4py.next.ffront.fbuiltins import int32
from gt4py.next.iterator.embedded import StridedNeighborOffsetProvider
from gt4py.next.program_processors.runners import roundtrip

from icon4py.model.atmosphere.advection.btraj_dreg_stencil_02 import btraj_dreg_stencil_02
from icon4py.model.common.dimension import E2CDim, ECDim, EdgeDim, KDim
@@ -56,7 +57,7 @@ def test_btraj_dreg_stencil_02():
np.asarray(p_vn), np.asarray(p_vt), np.asarray(edge_cell_length), p_dt
)

btraj_dreg_stencil_02(
btraj_dreg_stencil_02.with_backend(roundtrip.backend)(
p_vn,
p_vt,
edge_cell_length_new,
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@
import numpy as np
from gt4py.next.ffront.fbuiltins import int32
from gt4py.next.iterator.embedded import StridedNeighborOffsetProvider
from gt4py.next.program_processors.runners import roundtrip

from icon4py.model.atmosphere.advection.btraj_dreg_stencil_03 import btraj_dreg_stencil_03
from icon4py.model.common.dimension import E2CDim, ECDim, EdgeDim, KDim
@@ -180,7 +181,7 @@ def test_btraj_dreg_stencil_03():
p_dt,
)

btraj_dreg_stencil_03(
btraj_dreg_stencil_03.with_backend(roundtrip.backend)(
p_vn,
p_vt,
cell_idx_new,
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@
import pytest
from gt4py.next.ffront.fbuiltins import int32
from gt4py.next.iterator.embedded import StridedNeighborOffsetProvider
from gt4py.next.program_processors.runners import roundtrip

from icon4py.model.atmosphere.advection.divide_flux_area_list_stencil_01 import (
divide_flux_area_list_stencil_01,
@@ -738,7 +739,7 @@ def test_divide_flux_area_list_stencil_01():
np.asarray(dreg_patch0_4_lat_dsl),
)

divide_flux_area_list_stencil_01(
divide_flux_area_list_stencil_01.with_backend(roundtrip.backend)(
famask_int,
p_vn,
ptr_v3_lon_field,
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@
import numpy as np
from gt4py.next.ffront.fbuiltins import int32
from gt4py.next.iterator.embedded import StridedNeighborOffsetProvider
from gt4py.next.program_processors.runners import roundtrip

from icon4py.model.atmosphere.advection.divide_flux_area_list_stencil_02 import (
divide_flux_area_list_stencil_02,
@@ -271,7 +272,7 @@ def test_divide_flux_area_list_stencil_02():
np.asarray(dreg_patch2_4_lat_vmask),
)

divide_flux_area_list_stencil_02(
divide_flux_area_list_stencil_02.with_backend(roundtrip.backend)(
famask_int,
p_vn,
bf_cc_patch1_lon_field,
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@
import numpy as np
from gt4py.next.ffront.fbuiltins import int32
from gt4py.next.iterator import embedded as it_embedded
from gt4py.next.program_processors.runners import roundtrip

from icon4py.model.atmosphere.advection.face_val_ppm_stencil_01 import face_val_ppm_stencil_01
from icon4py.model.common.dimension import CellDim, KDim
@@ -81,7 +82,7 @@ def test_face_val_ppm_stencil_01():
elev,
)

face_val_ppm_stencil_01(
face_val_ppm_stencil_01.with_backend(roundtrip.backend)(
p_cc,
p_cellhgt_mc_now,
vert_idx,
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@
import numpy as np
from gt4py.next.ffront.fbuiltins import int32
from gt4py.next.iterator import embedded as it_embedded
from gt4py.next.program_processors.runners import roundtrip

from icon4py.model.atmosphere.advection.face_val_ppm_stencil_02 import face_val_ppm_stencil_02
from icon4py.model.common.dimension import CellDim, KDim
@@ -72,7 +73,7 @@ def test_face_val_ppm_stencil_02():
elevp1,
)

face_val_ppm_stencil_02(
face_val_ppm_stencil_02.with_backend(roundtrip.backend)(
p_cc,
p_cellhgt_mc_now,
p_face_in,
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later

import numpy as np
from gt4py.next.program_processors.runners import roundtrip

from icon4py.model.atmosphere.advection.face_val_ppm_stencil_02a import face_val_ppm_stencil_02a
from icon4py.model.common.dimension import CellDim, KDim
@@ -44,7 +45,7 @@ def test_face_val_ppm_stencil_02a():
np.asarray(p_cellhgt_mc_now),
)

face_val_ppm_stencil_02a(
face_val_ppm_stencil_02a.with_backend(roundtrip.backend)(
p_cc,
p_cellhgt_mc_now,
p_face,
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later

import numpy as np
from gt4py.next.program_processors.runners import roundtrip

from icon4py.model.atmosphere.advection.face_val_ppm_stencil_02b import face_val_ppm_stencil_02b
from icon4py.model.common.dimension import CellDim, KDim
@@ -37,7 +38,7 @@ def test_face_val_ppm_stencil_02b():
np.asarray(p_cc),
)

face_val_ppm_stencil_02b(
face_val_ppm_stencil_02b.with_backend(roundtrip.backend)(
p_cc,
p_face,
offset_provider={"Koff": KDim},
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later

import numpy as np
from gt4py.next.program_processors.runners import roundtrip

from icon4py.model.atmosphere.advection.face_val_ppm_stencil_02c import face_val_ppm_stencil_02c
from icon4py.model.common.dimension import CellDim, KDim
@@ -39,7 +40,7 @@ def test_face_val_ppm_stencil_02c():
np.asarray(p_cc),
)

face_val_ppm_stencil_02c(
face_val_ppm_stencil_02c.with_backend(roundtrip.backend)(
p_cc,
p_face,
offset_provider={"Koff": KDim},
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later

import numpy as np
from gt4py.next.program_processors.runners import roundtrip

from icon4py.model.atmosphere.advection.face_val_ppm_stencil_05 import face_val_ppm_stencil_05
from icon4py.model.common.dimension import CellDim, KDim
@@ -75,7 +76,7 @@ def test_face_val_ppm_stencil_05():
np.asarray(z_slope),
)

face_val_ppm_stencil_05(
face_val_ppm_stencil_05.with_backend(roundtrip.backend)(
p_cc,
p_cellhgt_mc_now,
z_slope,
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@

import numpy as np
from gt4py.next.ffront.fbuiltins import int32
from gt4py.next.program_processors.runners import roundtrip

from icon4py.model.atmosphere.advection.hflux_ffsl_hybrid_stencil_01a import (
hflux_ffsl_hybrid_stencil_01a,
@@ -174,7 +175,7 @@ def test_hflux_ffsl_hybrid_stencil_01a():
np.asarray(patch0_cell_rel_idx_dsl),
)

hflux_ffsl_hybrid_stencil_01a(
hflux_ffsl_hybrid_stencil_01a.with_backend(roundtrip.backend)(
z_lsq_coeff_1,
z_lsq_coeff_2,
z_lsq_coeff_3,
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later

import numpy as np
from gt4py.next.program_processors.runners import roundtrip

from icon4py.model.atmosphere.advection.hflux_ffsl_hybrid_stencil_02 import (
hflux_ffsl_hybrid_stencil_02,
@@ -44,7 +45,7 @@ def test_hflux_ffsl_hybrid_stencil_02():
np.asarray(z_dreg_area),
)

hflux_ffsl_hybrid_stencil_02(
hflux_ffsl_hybrid_stencil_02.with_backend(roundtrip.backend)(
p_out_e_hybrid_2,
p_mass_flx_e,
z_dreg_area,
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later

import numpy as np
from gt4py.next.program_processors.runners import roundtrip

from icon4py.model.atmosphere.advection.hflx_limiter_mo_stencil_01a import (
hflx_limiter_mo_stencil_01a,
@@ -54,7 +55,7 @@ def test_hflx_limiter_mo_stencil_01a():
np.asarray(p_cc),
)

hflx_limiter_mo_stencil_01a(
hflx_limiter_mo_stencil_01a.with_backend(roundtrip.backend)(
p_mflx_tracer_h,
p_mass_flx_e,
p_cc,
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@

import numpy as np
from gt4py.next.iterator.embedded import StridedNeighborOffsetProvider
from gt4py.next.program_processors.runners import roundtrip

from icon4py.model.atmosphere.advection.hflx_limiter_mo_stencil_01b import (
hflx_limiter_mo_stencil_01b,
@@ -96,7 +97,7 @@ def test_hflx_limiter_mo_stencil_01b():
np.asarray(p_dtime),
)

hflx_limiter_mo_stencil_01b(
hflx_limiter_mo_stencil_01b.with_backend(roundtrip.backend)(
geofac_div_new,
p_rhodz_now,
p_rhodz_new,
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later

import numpy as np
from gt4py.next.program_processors.runners import roundtrip
from numpy import int32

from icon4py.model.atmosphere.advection.hflx_limiter_mo_stencil_02 import hflx_limiter_mo_stencil_02
@@ -73,7 +74,7 @@ def test_hflx_limiter_mo_stencil_02_some_matching_condition():
hi_bound,
)

hflx_limiter_mo_stencil_02(
hflx_limiter_mo_stencil_02.with_backend(roundtrip.backend)(
refin_ctrl,
p_cc,
z_tracer_new_low_in,
@@ -110,7 +111,7 @@ def test_hflx_limiter_mo_stencil_02_none_matching_condition():
z_tracer_max = zero_field(grid, CellDim, KDim)
z_tracer_min = zero_field(grid, CellDim, KDim)

hflx_limiter_mo_stencil_02(
hflx_limiter_mo_stencil_02.with_backend(roundtrip.backend)(
refin_ctrl,
p_cc,
z_tracer_new_low_in,
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
import numpy as np
from gt4py.next.program_processors.runners import roundtrip

from icon4py.model.atmosphere.advection.hflx_limiter_mo_stencil_03 import (
hflx_limiter_mo_stencil_03,
@@ -67,7 +68,7 @@ def test_hflx_diffusion_mo_stencil_03_min_max():
beta_fct,
r_beta_fct,
)
hflx_limiter_mo_stencil_03_min_max(
hflx_limiter_mo_stencil_03_min_max.with_backend(roundtrip.backend)(
z_tracer_max,
z_tracer_min,
beta_fct,
@@ -105,7 +106,7 @@ def test_hflx_diffusion_mo_stencil_03():
dbl_eps,
)

hflx_limiter_mo_stencil_03(
hflx_limiter_mo_stencil_03.with_backend(roundtrip.backend)(
z_tracer_max,
z_tracer_min,
beta_fct,
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later

import numpy as np
from gt4py.next.program_processors.runners import roundtrip

from icon4py.model.atmosphere.advection.hflx_limiter_mo_stencil_04 import hflx_limiter_mo_stencil_04
from icon4py.model.common.dimension import CellDim, E2CDim, EdgeDim, KDim
@@ -48,7 +49,7 @@ def test_hflx_limiter_mo_stencil_04():
np.asarray(r_p),
np.asarray(z_mflx_low),
)
hflx_limiter_mo_stencil_04(
hflx_limiter_mo_stencil_04.with_backend(roundtrip.backend)(
z_anti,
r_m,
r_p,
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@

import numpy as np
from gt4py.next.iterator.embedded import StridedNeighborOffsetProvider
from gt4py.next.program_processors.runners import roundtrip

from icon4py.model.atmosphere.advection.hflx_limiter_pd_stencil_01 import hflx_limiter_pd_stencil_01
from icon4py.model.common.dimension import C2EDim, CEDim, CellDim, EdgeDim, KDim
@@ -60,7 +61,7 @@ def test_hflx_limiter_pd_stencil_01():
dbl_eps,
)

hflx_limiter_pd_stencil_01(
hflx_limiter_pd_stencil_01.with_backend(roundtrip.backend)(
as_1D_sparse_field(geofac_div, CEDim),
p_cc,
p_rhodz_now,
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later

import numpy as np
from gt4py.next.program_processors.runners import roundtrip

from icon4py.model.atmosphere.advection.hflx_limiter_pd_stencil_02 import hflx_limiter_pd_stencil_02
from icon4py.model.common.dimension import CellDim, E2CDim, EdgeDim, KDim
@@ -55,7 +56,7 @@ def test_hflx_limiter_pd_stencil_02_nowhere_matching_refin_ctl():
bound,
)

hflx_limiter_pd_stencil_02(
hflx_limiter_pd_stencil_02.with_backend(roundtrip.backend)(
refin_ctrl,
r_m,
p_mflx_tracer_h_in,
@@ -74,7 +75,7 @@ def test_hflx_limiter_pd_stencil_02_everywhere_matching_refin_ctl():
r_m = random_field(grid, CellDim, KDim)
p_mflx_tracer_h_in = random_field(grid, EdgeDim, KDim)

hflx_limiter_pd_stencil_02(
hflx_limiter_pd_stencil_02.with_backend(roundtrip.backend)(
refin_ctrl,
r_m,
p_mflx_tracer_h_in,
@@ -94,7 +95,7 @@ def test_hflx_limiter_pd_stencil_02_partly_matching_refin_ctl():
r_m = random_field(grid, CellDim, KDim)
p_mflx_tracer_h_in = random_field(grid, EdgeDim, KDim)

hflx_limiter_pd_stencil_02(
hflx_limiter_pd_stencil_02.with_backend(roundtrip.backend)(
refin_ctrl,
r_m,
p_mflx_tracer_h_in,
@@ -113,7 +114,7 @@ def test_hflx_limiter_pd_stencil_02_everywhere_matching_refin_ctl_does_not_chang
r_m = random_field(grid, CellDim, KDim)
p_mflx_tracer_h_in = random_field(grid, EdgeDim, KDim)

hflx_limiter_pd_stencil_02(
hflx_limiter_pd_stencil_02.with_backend(roundtrip.backend)(
refin_ctrl,
r_m,
p_mflx_tracer_h_in,
Loading