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

Adapt to new sparse field handling #168

Merged
merged 5 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -16,6 +16,7 @@
from gt4py.next.iterator.builtins import (
deref,
if_,
list_get,
named_range,
shift,
unstructured_domain,
Expand All @@ -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))
)

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