Skip to content

Commit

Permalink
Add workaround for julia 1.10 and CUDA
Browse files Browse the repository at this point in the history
As of CUDA 5.1.1, there are some issues with ClimaAtmos and Julia 1.10.
It seems that the issue is with this particular function and the error
is due to added calles to gc_frame functions that cannot be compiled on
a GPU.

For unknown reasons, the code compiles when we remove the keyword
arguments. While the issue is being investigated, we can work around it
by excluding the offending branch
  • Loading branch information
Sbozzolo committed Jan 8, 2024
1 parent 00d4bd4 commit 5057b32
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/SurfaceFluxes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,12 @@ function surface_conditions(
noniterative_stable_sol::Bool = true,
) where {FT}
uft = SFP.universal_func_type(param_set)
L_MO = obukhov_length(param_set, sc, uft, scheme; tol, tol_neutral, maxiter, soltype, noniterative_stable_sol)
# FIXME: Workaround for julia 1.10 and GPUs.
if sc isa Coefficients || sc isa FluxesAndFrictionVelocity
L_MO = obukhov_length(param_set, sc, uft, scheme)
else
L_MO = obukhov_length(param_set, sc, uft, scheme; tol, tol_neutral, maxiter, soltype, noniterative_stable_sol)
end
ustar = compute_ustar(param_set, L_MO, sc, uft, scheme)
Cd = momentum_exchange_coefficient(param_set, L_MO, sc, uft, scheme, tol_neutral)
Ch = heat_exchange_coefficient(param_set, L_MO, sc, uft, scheme, tol_neutral)
Expand Down

0 comments on commit 5057b32

Please sign in to comment.