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

Allow for computing multiple fluxes #389

Open
charleskawczynski opened this issue Sep 11, 2023 · 0 comments
Open

Allow for computing multiple fluxes #389

charleskawczynski opened this issue Sep 11, 2023 · 0 comments
Assignees

Comments

@charleskawczynski
Copy link
Member

ClimaAtmos calls RRTMGP in this way:

function update_sw_fluxes!(::AllSkyRadiationWithClearSkyDiagnostics, model)
    RRTMGP.RTESolver.solve_sw!(
        model.solver,
        model.max_threads,
        model.lookups.lookup_sw,
    )
    parent(model.face_clear_sw_flux_up) .= parent(model.face_sw_flux_up)
    parent(model.face_clear_sw_flux_dn) .= parent(model.face_sw_flux_dn)
    parent(model.face_clear_sw_direct_flux_dn) .=
        parent(model.face_sw_direct_flux_dn)
    parent(model.face_clear_sw_flux) .= parent(model.face_sw_flux)
    RRTMGP.RTESolver.solve_sw!(
        model.solver,
        model.max_threads,
        model.lookups.lookup_sw,
        model.lookups.lookup_sw_cld,
    )
end

So, we're doing two passes over solve_sw!, which is likely not ideal. The cost of the callback compared to step! is staggering:
Screen Shot 2023-09-11 at 10 37 17 AM

Despite calling this infrequently, it's still probably worth figuring out a way to do this in a single pass (since some variables may be shareable between the two passes).

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

No branches or pull requests

2 participants