Skip to content

Commit

Permalink
Try using StaticOneTo instead of Val in unrolled_reduce
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisYatunin committed Sep 19, 2024
1 parent 5939f49 commit 481b49f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ function waveforcing_column_accumulate!(
# check break condition for each gravity waves and calculate momentum flux of breaking gravity waves at each level
# We use the unrolled_reduce function here because it performs better for parallel execution on the GPU, avoiding type instabilities.
(mask, fm) =
unrolled_reduce(Val(nc), (mask, FT1(0.0))) do (mask, fm), (n)
unrolled_reduce(StaticOneTo(nc), (mask, FT1(0.0))) do (mask, fm), (n)
if (mask[n]) == true
c_hat = c[n] - u_kp1 # c0mu
# f phase speed matches the wind speed, remove c(n) from the set of propagating waves.
Expand Down

0 comments on commit 481b49f

Please sign in to comment.