Skip to content

Commit

Permalink
Simplify stencil (#397)
Browse files Browse the repository at this point in the history
Simpler implementation of stencil btraj_dreg_stencil_01, without broadcasting of scalar value.
  • Loading branch information
edopao authored Feb 26, 2024
1 parent 9bf7a0b commit 2327b40
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ def _btraj_dreg_stencil_01(
tangent_orientation: Field[[EdgeDim], float],
) -> Field[[EdgeDim, KDim], bool]:
tangent_orientation = broadcast(tangent_orientation, (EdgeDim, KDim))
lvn_sys_pos_true = where(p_vn * tangent_orientation >= 0.0, True, False)
mask_lcounterclock = broadcast(lcounterclock, (EdgeDim, KDim))
lvn_sys_pos = where(mask_lcounterclock, lvn_sys_pos_true, False)
return lvn_sys_pos
return where(p_vn * tangent_orientation >= 0.0, lcounterclock, False)


@program(grid_type=GridType.UNSTRUCTURED)
Expand Down

0 comments on commit 2327b40

Please sign in to comment.