From d489897d52c060d7df9573efd643436b611defc1 Mon Sep 17 00:00:00 2001 From: Hannes Vogt Date: Mon, 27 Feb 2023 15:43:13 +0000 Subject: [PATCH 1/3] Adapt to new sparse field handling --- .../icon4py/atm_dyn_iconam/mo_nh_diffusion_stencil_15.py | 7 ++++--- .../icon4py/atm_dyn_iconam/mo_solve_nonhydro_stencil_20.py | 5 +++-- .../icon4py/atm_dyn_iconam/mo_solve_nonhydro_stencil_21.py | 5 +++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/atm_dyn_iconam/src/icon4py/atm_dyn_iconam/mo_nh_diffusion_stencil_15.py b/atm_dyn_iconam/src/icon4py/atm_dyn_iconam/mo_nh_diffusion_stencil_15.py index d4d8ba5294..5be007ecb7 100644 --- a/atm_dyn_iconam/src/icon4py/atm_dyn_iconam/mo_nh_diffusion_stencil_15.py +++ b/atm_dyn_iconam/src/icon4py/atm_dyn_iconam/mo_nh_diffusion_stencil_15.py @@ -16,6 +16,7 @@ from gt4py.next.iterator.builtins import ( deref, if_, + list_get, named_range, shift, unstructured_domain, @@ -29,9 +30,9 @@ @fundef def step(i, geofac_n2s_nbh, vcoef, theta_v, zd_vertoffset): - d_vcoef = deref(shift(i)(vcoef)) - s_theta_v = shift(C2E2C, i, Koff, deref(shift(i)(zd_vertoffset)))(theta_v) - return deref(shift(i)(geofac_n2s_nbh)) * ( + d_vcoef = list_get(i, deref(vcoef)) + s_theta_v = shift(C2E2C, i, Koff, list_get(i, deref(zd_vertoffset)))(theta_v) + return list_get(i, deref(geofac_n2s_nbh)) * ( d_vcoef * deref(s_theta_v) + (1.0 - d_vcoef) * deref(shift(Koff, 1)(s_theta_v)) ) diff --git a/atm_dyn_iconam/src/icon4py/atm_dyn_iconam/mo_solve_nonhydro_stencil_20.py b/atm_dyn_iconam/src/icon4py/atm_dyn_iconam/mo_solve_nonhydro_stencil_20.py index e107aafdbf..c1a954227e 100644 --- a/atm_dyn_iconam/src/icon4py/atm_dyn_iconam/mo_solve_nonhydro_stencil_20.py +++ b/atm_dyn_iconam/src/icon4py/atm_dyn_iconam/mo_solve_nonhydro_stencil_20.py @@ -15,6 +15,7 @@ from gt4py.next.ffront import program_ast as past from gt4py.next.iterator.builtins import ( deref, + list_get, named_range, shift, unstructured_domain, @@ -35,11 +36,11 @@ def step( z_dexner_dz_c_1, z_dexner_dz_c_2, ): - d_ikoffset = deref(shift(i)(ikoffset)) + d_ikoffset = list_get(i, deref(ikoffset)) d_z_exner_exp_pr = deref(shift(Koff, d_ikoffset, E2C, i)(z_exner_ex_pr)) d_z_dexner_dz_c_1 = deref(shift(Koff, d_ikoffset, E2C, i)(z_dexner_dz_c_1)) d_z_dexner_dz_c_2 = deref(shift(Koff, d_ikoffset, E2C, i)(z_dexner_dz_c_2)) - d_zdiff_gradp = deref(shift(i)(zdiff_gradp)) + d_zdiff_gradp = list_get(i, deref(zdiff_gradp)) return d_z_exner_exp_pr + d_zdiff_gradp * ( d_z_dexner_dz_c_1 + d_zdiff_gradp * d_z_dexner_dz_c_2 diff --git a/atm_dyn_iconam/src/icon4py/atm_dyn_iconam/mo_solve_nonhydro_stencil_21.py b/atm_dyn_iconam/src/icon4py/atm_dyn_iconam/mo_solve_nonhydro_stencil_21.py index 036422b119..b55e3b2194 100644 --- a/atm_dyn_iconam/src/icon4py/atm_dyn_iconam/mo_solve_nonhydro_stencil_21.py +++ b/atm_dyn_iconam/src/icon4py/atm_dyn_iconam/mo_solve_nonhydro_stencil_21.py @@ -15,6 +15,7 @@ from gt4py.next.ffront import program_ast as past from gt4py.next.iterator.builtins import ( deref, + list_get, named_range, power, shift, @@ -29,14 +30,14 @@ @fundef def step(i, theta_v, ikoffset, zdiff_gradp, theta_v_ic, inv_ddqz_z_full): - d_ikoffset = deref(shift(i)(ikoffset)) + d_ikoffset = list_get(i, deref(ikoffset)) d_theta_v = deref(shift(Koff, d_ikoffset, E2C, i)(theta_v)) s_theta_v_ic = shift(Koff, d_ikoffset, E2C, i)(theta_v_ic) d_theta_v_ic = deref(s_theta_v_ic) d_theta_v_ic_p1 = deref(shift(Koff, 1)(s_theta_v_ic)) d_inv_ddqz_z_full = deref(shift(Koff, d_ikoffset, E2C, i)(inv_ddqz_z_full)) - d_zdiff_gradp = deref(shift(i)(zdiff_gradp)) + d_zdiff_gradp = list_get(i, deref(zdiff_gradp)) return ( d_theta_v + d_zdiff_gradp * (d_theta_v_ic - d_theta_v_ic_p1) * d_inv_ddqz_z_full From ee46c95d78464e7699183ff415ca37c0ff14d3d0 Mon Sep 17 00:00:00 2001 From: Hannes Vogt Date: Mon, 27 Feb 2023 15:44:55 +0000 Subject: [PATCH 2/3] point to branch --- base-requirements-dev.txt | 2 +- base-requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/base-requirements-dev.txt b/base-requirements-dev.txt index b133520c93..fa3adb601f 100644 --- a/base-requirements-dev.txt +++ b/base-requirements-dev.txt @@ -1,5 +1,5 @@ # VCS --e git+https://github.com/GridTools/gt4py.git@main#egg=gt4py +-e git+https://github.com/havogt/gt4py.git@no_partial_shifts#egg=gt4py # PyPI flake8>=3.8 diff --git a/base-requirements.txt b/base-requirements.txt index 4e204ea2f5..d10ee7f7dd 100644 --- a/base-requirements.txt +++ b/base-requirements.txt @@ -1,2 +1,2 @@ # VCS -gt4py @ git+https://github.com/GridTools/gt4py.git@main +gt4py @ git+https://github.com/havogt/gt4py.git@no_partial_shifts From 55580ee34fa9a37b8ba38196765e663056b990ec Mon Sep 17 00:00:00 2001 From: Hannes Vogt Date: Thu, 23 Mar 2023 11:37:37 +0000 Subject: [PATCH 3/3] Revert "point to branch" This reverts commit ee46c95d78464e7699183ff415ca37c0ff14d3d0. --- base-requirements-dev.txt | 2 +- base-requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/base-requirements-dev.txt b/base-requirements-dev.txt index fa3adb601f..b133520c93 100644 --- a/base-requirements-dev.txt +++ b/base-requirements-dev.txt @@ -1,5 +1,5 @@ # VCS --e git+https://github.com/havogt/gt4py.git@no_partial_shifts#egg=gt4py +-e git+https://github.com/GridTools/gt4py.git@main#egg=gt4py # PyPI flake8>=3.8 diff --git a/base-requirements.txt b/base-requirements.txt index d10ee7f7dd..4e204ea2f5 100644 --- a/base-requirements.txt +++ b/base-requirements.txt @@ -1,2 +1,2 @@ # VCS -gt4py @ git+https://github.com/havogt/gt4py.git@no_partial_shifts +gt4py @ git+https://github.com/GridTools/gt4py.git@main