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

remove print statements and dependence on kernelabstractions #127

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
43 changes: 0 additions & 43 deletions src/SurfaceFluxes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ module SurfaceFluxes
import RootSolvers
const RS = RootSolvers

import KernelAbstractions
const KA = KernelAbstractions

using DocStringExtensions
const DSE = DocStringExtensions

Expand All @@ -45,17 +42,6 @@ abstract type SolverScheme end
struct FVScheme <: SolverScheme end
struct FDScheme <: SolverScheme end

# Allow users to skip error on non-convergence
# by importing:
# ```julia
# import SurfaceFluxes
# SurfaceFluxes.error_on_non_convergence() = false
# ```
# Error on convergence must be the default
# behavior because this can result in printing
# very large logs resulting in CI to seemingly hang.
error_on_non_convergence() = true

"""
SurfaceFluxConditions

Expand Down Expand Up @@ -408,35 +394,6 @@ function obukhov_length(
L_MO_init = FT(-1)
sol = RS.find_zero(root_l_mo, RS.NewtonsMethodAD(L_MO_init), soltype, tol, maxiter)
L_MO = sol.root
if !sol.converged
if error_on_non_convergence()
KA.@print("maxiter reached in SurfaceFluxes.jl:\n")
KA.@print(" T_in = ", TD.air_temperature(thermo_params, ts_in(sc)))
KA.@print(", T_sfc = ", TD.air_temperature(thermo_params, ts_sfc(sc)))
KA.@print(", q_in = ", TD.total_specific_humidity(thermo_params, ts_in(sc)))
KA.@print(", q_sfc = ", TD.total_specific_humidity(thermo_params, ts_sfc(sc)))
KA.@print(", u_in = ", u_in(sc))
KA.@print(", u_sfc = ", u_sfc(sc))
KA.@print(", z0_m = ", z0(sc, UF.MomentumTransport()))
KA.@print(", z0_b = ", z0(sc, UF.HeatTransport()))
KA.@print(", Δz = ", Δz(sc))
KA.@print(", ΔDSEᵥ = ", ΔDSEᵥ)
KA.@print("\n")
KA.@print("ts_in(sc) = ", ts_in(sc))
KA.@print("\n")
KA.@print("ts_sfc(sc) = ", ts_sfc(sc))
KA.@print("\n")
if soltype isa RS.CompactSolution
KA.@print(", sol.root = ", sol.root)
else
KA.@print(", sol.root_history = ", sol.root_history)
KA.@print(", sol.err_history = ", sol.err_history)
end
error("Unconverged Surface Fluxes.")
else
KA.@print("Warning: Unconverged Surface Fluxes. Returning last interation.")
end
end
return non_zero(L_MO)
end
end
Expand Down
Loading