Skip to content

Conversation

@nefrathenrici
Copy link
Member

Purpose

Closes #4046

Previously, we encountered an InvalidIRError from the van Leer limiter on CUDA when using itime. This PR fixes the issue by converting dt to an FT before passing it to ᶠlin_vanleer.
We currently convert FT(dt) at a lot of call sites, perhaps we should follow up on this PR and push these conversions into the corresponding methods.
No automated tests catch this, perhaps we should use itime more widely.

Reproducer:

ENV["CLIMACOMMS_CONTEXT"]="SINGLETON"
ENV["CLIMACOMMS_DEVICE"]="CUDA"

import CUDA, ClimaAtmos as CA

config_dict = Dict(
    "apply_limiter" => true,
    "h_elem" => 12,
    "z_elem" => 25,
    "rayleigh_sponge" => false,
    "viscous_sponge" => false,
    "dt" => "1secs",
    "t_end" => "10secs",
    "log_progress" => false,
    "moist" => "nonequil",
    "surface_setup" => "DefaultMoninObukhov",
    "rad" => "allskywithclear",
    "vert_diff" => false,
    "precip_model" => "1M",
    "turbconv" => "diagnostic_edmfx",
    "edmfx_sgs_mass_flux" => true,
    "edmfx_sgs_diffusive_flux" => true,
    "edmfx_sgsflux_upwinding" => "vanleer_limiter",
    "edmfx_tracer_upwinding" => "vanleer_limiter",
    "use_itime" => true,

)
config = CA.AtmosConfig(config_dict)
sim = CA.get_simulation(config)

dt = sim.integrator.dt
cρ = sim.integrator.u.c.ρ
f_u3 = sim.integrator.p.precomputed.ᶠu³
cχ = sim.integrator.u.c.ρq_tot ./ sim.integrator.u.c.ρ

Base.Broadcast.materialize(CA.vertical_transport(cρ, f_u3, cχ, dt, Val(:vanleer_limiter)))

Content


  • I have read and checked the items on the review checklist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GPU compilation error using 1M microphysics

2 participants