Skip to content

Commit

Permalink
merge main and correctly set on_gpu in pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
OngChia committed Nov 20, 2024
2 parents 9a21467 + bac96a5 commit d98b497
Show file tree
Hide file tree
Showing 202 changed files with 422 additions and 379 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Please, refer to the LICENSE file in the root directory.
# SPDX-License-Identifier: BSD-3-Clause
import dataclasses
from typing import Optional

import gt4py.next as gtx

Expand Down Expand Up @@ -39,9 +40,9 @@ class DiagnosticStateNonHydro:
ddt_w_adv_ntl2: fa.CellKField[float]

# Analysis increments
rho_incr: fa.EdgeKField[float] # moist density increment [kg/m^3]
vn_incr: fa.EdgeKField[float] # normal velocity increment [m/s]
exner_incr: fa.EdgeKField[float] # exner increment [- ]
rho_incr: Optional[fa.EdgeKField[float]] # moist density increment [kg/m^3]
vn_incr: Optional[fa.EdgeKField[float]] # normal velocity increment [m/s]
exner_incr: Optional[fa.EdgeKField[float]] # exner increment [- ]
exner_dyn_incr: fa.CellKField[float] # exner pressure dynamics increment

@property
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -8,75 +8,75 @@
import gt4py.next as gtx
from gt4py.next.ffront.fbuiltins import where

from icon4py.model.atmosphere.dycore.compute_contravariant_correction import (
from icon4py.model.atmosphere.dycore.dycore_utils import (
_broadcast_zero_to_three_edge_kdim_fields_wp,
)
from icon4py.model.atmosphere.dycore.stencils.compute_contravariant_correction import (
_compute_contravariant_correction,
)
from icon4py.model.atmosphere.dycore.compute_contravariant_correction_of_w import (
from icon4py.model.atmosphere.dycore.stencils.compute_contravariant_correction_of_w import (
_compute_contravariant_correction_of_w,
)
from icon4py.model.atmosphere.dycore.compute_contravariant_correction_of_w_for_lower_boundary import (
from icon4py.model.atmosphere.dycore.stencils.compute_contravariant_correction_of_w_for_lower_boundary import (
_compute_contravariant_correction_of_w_for_lower_boundary,
)
from icon4py.model.atmosphere.dycore.compute_explicit_part_for_rho_and_exner import (
from icon4py.model.atmosphere.dycore.stencils.compute_explicit_part_for_rho_and_exner import (
_compute_explicit_part_for_rho_and_exner,
)
from icon4py.model.atmosphere.dycore.compute_explicit_vertical_wind_from_advection_and_vertical_wind_density import (
from icon4py.model.atmosphere.dycore.stencils.compute_explicit_vertical_wind_from_advection_and_vertical_wind_density import (
_compute_explicit_vertical_wind_from_advection_and_vertical_wind_density,
)
from icon4py.model.atmosphere.dycore.compute_explicit_vertical_wind_speed_and_vertical_wind_times_density import (
from icon4py.model.atmosphere.dycore.stencils.compute_explicit_vertical_wind_speed_and_vertical_wind_times_density import (
_compute_explicit_vertical_wind_speed_and_vertical_wind_times_density,
)
from icon4py.model.atmosphere.dycore.compute_first_vertical_derivative import (
from icon4py.model.atmosphere.dycore.stencils.compute_first_vertical_derivative import (
_compute_first_vertical_derivative,
)
from icon4py.model.atmosphere.dycore.compute_horizontal_advection_of_rho_and_theta import (
from icon4py.model.atmosphere.dycore.stencils.compute_horizontal_advection_of_rho_and_theta import (
_compute_horizontal_advection_of_rho_and_theta,
)
from icon4py.model.atmosphere.dycore.compute_horizontal_kinetic_energy import (
from icon4py.model.atmosphere.dycore.stencils.compute_horizontal_kinetic_energy import (
_compute_horizontal_kinetic_energy,
)
from icon4py.model.atmosphere.dycore.compute_perturbation_of_rho_and_theta import (
from icon4py.model.atmosphere.dycore.stencils.compute_perturbation_of_rho_and_theta import (
_compute_perturbation_of_rho_and_theta,
)
from icon4py.model.atmosphere.dycore.compute_perturbation_of_rho_and_theta_and_rho_interface_cell_centers import (
from icon4py.model.atmosphere.dycore.stencils.compute_perturbation_of_rho_and_theta_and_rho_interface_cell_centers import (
_compute_perturbation_of_rho_and_theta_and_rho_interface_cell_centers,
)
from icon4py.model.atmosphere.dycore.compute_solver_coefficients_matrix import (
from icon4py.model.atmosphere.dycore.stencils.compute_solver_coefficients_matrix import (
_compute_solver_coefficients_matrix,
)
from icon4py.model.atmosphere.dycore.compute_virtual_potential_temperatures_and_pressure_gradient import (
from icon4py.model.atmosphere.dycore.stencils.compute_virtual_potential_temperatures_and_pressure_gradient import (
_compute_virtual_potential_temperatures_and_pressure_gradient,
)
from icon4py.model.atmosphere.dycore.extrapolate_at_top import _extrapolate_at_top
from icon4py.model.atmosphere.dycore.extrapolate_temporally_exner_pressure import (
from icon4py.model.atmosphere.dycore.stencils.extrapolate_at_top import _extrapolate_at_top
from icon4py.model.atmosphere.dycore.stencils.extrapolate_temporally_exner_pressure import (
_extrapolate_temporally_exner_pressure,
)
from icon4py.model.atmosphere.dycore.init_cell_kdim_field_with_zero_vp import (
from icon4py.model.atmosphere.dycore.stencils.init_cell_kdim_field_with_zero_vp import (
_init_cell_kdim_field_with_zero_vp,
)
from icon4py.model.atmosphere.dycore.init_cell_kdim_field_with_zero_wp import (
from icon4py.model.atmosphere.dycore.stencils.init_cell_kdim_field_with_zero_wp import (
_init_cell_kdim_field_with_zero_wp,
)
from icon4py.model.atmosphere.dycore.interpolate_to_half_levels_vp import (
from icon4py.model.atmosphere.dycore.stencils.interpolate_to_half_levels_vp import (
_interpolate_to_half_levels_vp,
)
from icon4py.model.atmosphere.dycore.interpolate_to_surface import _interpolate_to_surface
from icon4py.model.atmosphere.dycore.interpolate_vn_and_vt_to_ie_and_compute_ekin_on_edges import (
from icon4py.model.atmosphere.dycore.stencils.interpolate_to_surface import _interpolate_to_surface
from icon4py.model.atmosphere.dycore.stencils.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.set_lower_boundary_condition_for_w_and_contravariant_correction import (
from icon4py.model.atmosphere.dycore.stencils.set_lower_boundary_condition_for_w_and_contravariant_correction import (
_set_lower_boundary_condition_for_w_and_contravariant_correction,
)
from icon4py.model.atmosphere.dycore.set_theta_v_prime_ic_at_lower_boundary import (
from icon4py.model.atmosphere.dycore.stencils.set_theta_v_prime_ic_at_lower_boundary import (
_set_theta_v_prime_ic_at_lower_boundary,
)
from icon4py.model.atmosphere.dycore.state_utils.utils import (
_broadcast_zero_to_three_edge_kdim_fields_wp,
)
from icon4py.model.atmosphere.dycore.update_density_exner_wind import (
from icon4py.model.atmosphere.dycore.stencils.update_density_exner_wind import (
_update_density_exner_wind,
)
from icon4py.model.atmosphere.dycore.update_wind import _update_wind
from icon4py.model.atmosphere.dycore.stencils.update_wind import _update_wind
from icon4py.model.common import dimension as dims, field_type_aliases as fa


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# ICON4Py - ICON inspired code in Python and GT4Py
#
# Copyright (c) 2022-2024, ETH Zurich and MeteoSwiss
# All rights reserved.
#
# Please, refer to the LICENSE file in the root directory.
# SPDX-License-Identifier: BSD-3-Clause

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
where,
)

from icon4py.model.atmosphere.dycore.init_two_edge_kdim_fields_with_zero_wp import (
from icon4py.model.atmosphere.dycore.stencils.init_two_edge_kdim_fields_with_zero_wp import (
_init_two_edge_kdim_fields_with_zero_wp,
)
from icon4py.model.common import dimension as dims, field_type_aliases as fa
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
from gt4py.next.ffront.decorator import field_operator, program
from gt4py.next.ffront.fbuiltins import astype, 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.stencils.compute_avg_vn import _compute_avg_vn
from icon4py.model.atmosphere.dycore.stencils.compute_tangential_wind import (
_compute_tangential_wind,
)
from icon4py.model.common import dimension as dims, field_type_aliases as fa
from icon4py.model.common.dimension import E2C2EO, E2C2EODim
from icon4py.model.common.type_alias import vpfloat, wpfloat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from gt4py.next.ffront.decorator import field_operator, program
from gt4py.next.ffront.fbuiltins import astype

from icon4py.model.atmosphere.dycore.compute_perturbation_of_rho_and_theta import (
from icon4py.model.atmosphere.dycore.stencils.compute_perturbation_of_rho_and_theta import (
_compute_perturbation_of_rho_and_theta,
)
from icon4py.model.common import dimension as dims, field_type_aliases as fa
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from gt4py.next.ffront.decorator import field_operator, program
from gt4py.next.ffront.fbuiltins import astype

from icon4py.model.atmosphere.dycore.interpolate_to_half_levels_vp import (
from icon4py.model.atmosphere.dycore.stencils.interpolate_to_half_levels_vp import (
_interpolate_to_half_levels_vp,
)
from icon4py.model.atmosphere.dycore.interpolate_to_half_levels_wp import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
from gt4py.next.ffront.decorator import GridType, field_operator, program
from gt4py.next.ffront.fbuiltins import where

from icon4py.model.atmosphere.dycore.compute_contravariant_correction_of_w import (
from icon4py.model.atmosphere.dycore.stencils.compute_contravariant_correction_of_w import (
_compute_contravariant_correction_of_w,
)
from icon4py.model.atmosphere.dycore.compute_contravariant_correction_of_w_for_lower_boundary import (
from icon4py.model.atmosphere.dycore.stencils.compute_contravariant_correction_of_w_for_lower_boundary import (
_compute_contravariant_correction_of_w_for_lower_boundary,
)
from icon4py.model.common import dimension as dims, field_type_aliases as fa
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
from gt4py.next.ffront.decorator import field_operator, program
from gt4py.next.ffront.fbuiltins import broadcast, maximum, where

from icon4py.model.atmosphere.dycore.add_extra_diffusion_for_w_con_approaching_cfl import (
from icon4py.model.atmosphere.dycore.stencils.add_extra_diffusion_for_w_con_approaching_cfl import (
_add_extra_diffusion_for_w_con_approaching_cfl,
)
from icon4py.model.atmosphere.dycore.add_interpolated_horizontal_advection_of_w import (
from icon4py.model.atmosphere.dycore.stencils.add_interpolated_horizontal_advection_of_w import (
_add_interpolated_horizontal_advection_of_w,
)
from icon4py.model.atmosphere.dycore.compute_advective_vertical_wind_tendency import (
from icon4py.model.atmosphere.dycore.stencils.compute_advective_vertical_wind_tendency import (
_compute_advective_vertical_wind_tendency,
)
from icon4py.model.atmosphere.dycore.interpolate_contravariant_vertical_velocity_to_full_levels import (
from icon4py.model.atmosphere.dycore.stencils.interpolate_contravariant_vertical_velocity_to_full_levels import (
_interpolate_contravariant_vertical_velocity_to_full_levels,
)
from icon4py.model.common import dimension as dims, field_type_aliases as fa
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
from gt4py.next.ffront.decorator import field_operator, program
from gt4py.next.ffront.fbuiltins import maximum, where

from icon4py.model.atmosphere.dycore.add_extra_diffusion_for_normal_wind_tendency_approaching_cfl import (
from icon4py.model.atmosphere.dycore.stencils.add_extra_diffusion_for_normal_wind_tendency_approaching_cfl import (
_add_extra_diffusion_for_normal_wind_tendency_approaching_cfl,
)
from icon4py.model.atmosphere.dycore.compute_advective_normal_wind_tendency import (
from icon4py.model.atmosphere.dycore.stencils.compute_advective_normal_wind_tendency import (
_compute_advective_normal_wind_tendency,
)
from icon4py.model.atmosphere.dycore.mo_math_divrot_rot_vertex_ri_dsl import (
from icon4py.model.atmosphere.dycore.stencils.mo_math_divrot_rot_vertex_ri_dsl import (
_mo_math_divrot_rot_vertex_ri_dsl,
)
from icon4py.model.common import dimension as dims, field_type_aliases as fa
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,26 @@
from gt4py.next.ffront.decorator import field_operator, program
from gt4py.next.ffront.fbuiltins import broadcast, where

from icon4py.model.atmosphere.dycore.compute_contravariant_correction import (
from icon4py.model.atmosphere.dycore.stencils.compute_contravariant_correction import (
_compute_contravariant_correction,
)
from icon4py.model.atmosphere.dycore.compute_horizontal_advection_term_for_vertical_velocity import (
from icon4py.model.atmosphere.dycore.stencils.compute_horizontal_advection_term_for_vertical_velocity import (
_compute_horizontal_advection_term_for_vertical_velocity,
)
from icon4py.model.atmosphere.dycore.compute_horizontal_kinetic_energy import (
from icon4py.model.atmosphere.dycore.stencils.compute_horizontal_kinetic_energy import (
_compute_horizontal_kinetic_energy,
)
from icon4py.model.atmosphere.dycore.compute_tangential_wind import _compute_tangential_wind
from icon4py.model.atmosphere.dycore.extrapolate_at_top import _extrapolate_at_top
from icon4py.model.atmosphere.dycore.interpolate_vn_to_ie_and_compute_ekin_on_edges import (
from icon4py.model.atmosphere.dycore.stencils.compute_tangential_wind import (
_compute_tangential_wind,
)
from icon4py.model.atmosphere.dycore.stencils.extrapolate_at_top import _extrapolate_at_top
from icon4py.model.atmosphere.dycore.stencils.interpolate_vn_to_ie_and_compute_ekin_on_edges import (
_interpolate_vn_to_ie_and_compute_ekin_on_edges,
)
from icon4py.model.atmosphere.dycore.interpolate_vt_to_interface_edges import (
from icon4py.model.atmosphere.dycore.stencils.interpolate_vt_to_interface_edges import (
_interpolate_vt_to_interface_edges,
)
from icon4py.model.atmosphere.dycore.mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl import (
from icon4py.model.atmosphere.dycore.stencils.mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl import (
_mo_icon_interpolation_scalar_cells2verts_scalar_ri_dsl,
)
from icon4py.model.common import dimension as dims, field_type_aliases as fa
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,19 @@
from gt4py.next.ffront.decorator import field_operator, program
from gt4py.next.ffront.fbuiltins import where

from icon4py.model.atmosphere.dycore.copy_cell_kdim_field_to_vp import _copy_cell_kdim_field_to_vp
from icon4py.model.atmosphere.dycore.correct_contravariant_vertical_velocity import (
from icon4py.model.atmosphere.dycore.stencils.copy_cell_kdim_field_to_vp import (
_copy_cell_kdim_field_to_vp,
)
from icon4py.model.atmosphere.dycore.stencils.correct_contravariant_vertical_velocity import (
_correct_contravariant_vertical_velocity,
)
from icon4py.model.atmosphere.dycore.init_cell_kdim_field_with_zero_vp import (
from icon4py.model.atmosphere.dycore.stencils.init_cell_kdim_field_with_zero_vp import (
_init_cell_kdim_field_with_zero_vp,
)
from icon4py.model.atmosphere.dycore.interpolate_to_cell_center import _interpolate_to_cell_center
from icon4py.model.atmosphere.dycore.interpolate_to_half_levels_vp import (
from icon4py.model.atmosphere.dycore.stencils.interpolate_to_cell_center import (
_interpolate_to_cell_center,
)
from icon4py.model.atmosphere.dycore.stencils.interpolate_to_half_levels_vp import (
_interpolate_to_half_levels_vp,
)
from icon4py.model.common import dimension as dims, field_type_aliases as fa
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,30 @@
from gt4py.next.ffront.decorator import field_operator, program
from gt4py.next.ffront.fbuiltins import maximum, where

from icon4py.model.atmosphere.dycore.compute_maximum_cfl_and_clip_contravariant_vertical_velocity import (
from icon4py.model.atmosphere.dycore.stencils.compute_maximum_cfl_and_clip_contravariant_vertical_velocity import (
_compute_maximum_cfl_and_clip_contravariant_vertical_velocity,
)
from icon4py.model.atmosphere.dycore.copy_cell_kdim_field_to_vp import _copy_cell_kdim_field_to_vp
from icon4py.model.atmosphere.dycore.correct_contravariant_vertical_velocity import (
from icon4py.model.atmosphere.dycore.stencils.copy_cell_kdim_field_to_vp import (
_copy_cell_kdim_field_to_vp,
)
from icon4py.model.atmosphere.dycore.stencils.correct_contravariant_vertical_velocity import (
_correct_contravariant_vertical_velocity,
)
from icon4py.model.atmosphere.dycore.init_cell_kdim_field_with_zero_vp import (
from icon4py.model.atmosphere.dycore.stencils.init_cell_kdim_field_with_zero_vp import (
_init_cell_kdim_field_with_zero_vp,
)
from icon4py.model.atmosphere.dycore.interpolate_to_cell_center import _interpolate_to_cell_center
from icon4py.model.atmosphere.dycore.interpolate_to_half_levels_vp import (
from icon4py.model.atmosphere.dycore.stencils.interpolate_to_cell_center import (
_interpolate_to_cell_center,
)
from icon4py.model.atmosphere.dycore.stencils.interpolate_to_half_levels_vp import (
_interpolate_to_half_levels_vp,
)
from icon4py.model.common import dimension as dims, field_type_aliases as fa
from icon4py.model.common.settings import backend
from icon4py.model.common.type_alias import vpfloat, wpfloat


# TODO (magdalena) this stencils has no StencilTest, (numpy) reference
@field_operator
def _fused_velocity_advection_stencil_8_to_14(
z_kin_hor_e: fa.EdgeKField[vpfloat],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from gt4py.next.ffront.decorator import field_operator, program
from gt4py.next.ffront.fbuiltins import broadcast, where

from icon4py.model.atmosphere.dycore.init_cell_kdim_field_with_zero_vp import (
from icon4py.model.atmosphere.dycore.stencils.init_cell_kdim_field_with_zero_vp import (
_init_cell_kdim_field_with_zero_vp,
)
from icon4py.model.common import dimension as dims, field_type_aliases as fa
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from gt4py.next.common import GridType
from gt4py.next.ffront.decorator import field_operator, program

from icon4py.model.atmosphere.dycore.init_cell_kdim_field_with_zero_vp import (
from icon4py.model.atmosphere.dycore.stencils.init_cell_kdim_field_with_zero_vp import (
_init_cell_kdim_field_with_zero_vp,
)
from icon4py.model.common import dimension as dims, field_type_aliases as fa
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from gt4py.next.common import GridType
from gt4py.next.ffront.decorator import field_operator, program

from icon4py.model.atmosphere.dycore.init_cell_kdim_field_with_zero_wp import (
from icon4py.model.atmosphere.dycore.stencils.init_cell_kdim_field_with_zero_wp import (
_init_cell_kdim_field_with_zero_wp,
)
from icon4py.model.common import dimension as dims, field_type_aliases as fa
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
from gt4py.next.common import GridType
from gt4py.next.ffront.decorator import field_operator, program

from icon4py.model.atmosphere.dycore.interpolate_vn_to_ie_and_compute_ekin_on_edges import (
from icon4py.model.atmosphere.dycore.stencils.interpolate_vn_to_ie_and_compute_ekin_on_edges import (
_interpolate_vn_to_ie_and_compute_ekin_on_edges,
)
from icon4py.model.atmosphere.dycore.interpolate_vt_to_interface_edges import (
from icon4py.model.atmosphere.dycore.stencils.interpolate_vt_to_interface_edges import (
_interpolate_vt_to_interface_edges,
)
from icon4py.model.common import dimension as dims, field_type_aliases as fa
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from gt4py.next.ffront.decorator import field_operator, program
from gt4py.next.ffront.fbuiltins import astype

from icon4py.model.atmosphere.dycore.compute_horizontal_kinetic_energy import (
from icon4py.model.atmosphere.dycore.stencils.compute_horizontal_kinetic_energy import (
_compute_horizontal_kinetic_energy,
)
from icon4py.model.common import dimension as dims, field_type_aliases as fa
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from gt4py.next.ffront.decorator import field_operator, program
from gt4py.next.ffront.fbuiltins import astype

from icon4py.model.atmosphere.dycore.init_cell_kdim_field_with_zero_wp import (
from icon4py.model.atmosphere.dycore.stencils.init_cell_kdim_field_with_zero_wp import (
_init_cell_kdim_field_with_zero_wp,
)
from icon4py.model.common import dimension as dims, field_type_aliases as fa
Expand Down
Loading

0 comments on commit d98b497

Please sign in to comment.