Make radiation→ocean forcing hook live; rename radiative flux functions#372
Open
glwagner wants to merge 1 commit into
Open
Make radiation→ocean forcing hook live; rename radiative flux functions#372glwagner wants to merge 1 commit into
glwagner wants to merge 1 commit into
Conversation
…ions
Two related cleanups around how radiation drives the ocean:
1. Turn `compute_radiative_forcing!` from dead/backwards code into a live
precompute hook. It is now the generic, overridable entry point for
radiation models whose in-water absorption needs a vertical pass over
ocean tracers (e.g. biogeochemical/chlorophyll-based schemes), and a
no-op for analytic schemes like `TwoColorRadiation` (whose surface flux
is set per-column in the flux kernel). The hook is called from
`compute_radiation_ocean_fluxes!` before launching the kernel. Also fixes
notation `Iˢʷ` → `ℐˢʷ` to match the script-I used elsewhere.
2. Rename the radiative flux family to reflect that the source is the
`radiation` component, not the atmosphere, in the component-pair form
parallel to `compute_atmosphere_ocean_fluxes!`:
apply_air_sea_radiative_fluxes! → compute_radiation_ocean_fluxes!
apply_air_sea_ice_radiative_fluxes! → compute_radiation_sea_ice_fluxes!
apply_air_land_radiative_fluxes! → compute_radiation_land_fluxes!
Files renamed accordingly; all definitions, kernels, fallbacks, and
doc/comment references updated.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two related cleanups around how radiation forces the ocean, prompted by tracing
compute_radiative_forcing!andTwoColorRadiation.1.
compute_radiative_forcing!— from dead code to a live extension hookPreviously
compute_radiative_forcing!was defined but never called, and its dispatch was backwards: the fallback was a no-op while theTwoColorRadiationmethod did host-side work that the in-kernelshortwave_radiative_forcingalready does.It's now the generic, overridable precompute hook for radiation models whose in-water absorption requires a vertical pass over ocean tracers (e.g. biogeochemical / chlorophyll-based schemes):
compute_radiative_forcing!(radiation, coupled_model)— the overridable entry point (fallback no-op),compute_radiative_forcing!(::TwoColorRadiation, coupled_model)— explicit no-op (analytic absorption; its surface flux is set per-column in the flux kernel),compute_radiation_ocean_fluxes!right before the kernellaunch!.Behavior today is unchanged (no-op for the only existing scheme and for
nothing), but the extension point is now genuinely wired in. Also fixes notationIˢʷ→ℐˢʷto match the script-I used in the kernel (ℐꜜˢʷ/ℐₜˢʷ/ℐꜛˡʷ).2. Rename the radiative flux family:
apply_air_*→compute_radiation_*The fluxes are sourced from the
radiationcomponent (coupled_model.radiation), not the atmosphere — these functions never touchcoupled_model.atmosphere. The new names use the component-pair form parallel to the turbulentcompute_atmosphere_ocean_fluxes!:apply_air_sea_radiative_fluxes!compute_radiation_ocean_fluxes!apply_air_sea_ice_radiative_fluxes!compute_radiation_sea_ice_fluxes!apply_air_land_radiative_fluxes!compute_radiation_land_fluxes!Files renamed (
git mv, history preserved); all definitions,_-prefixed kernels,(::Any)/{<:Nothing}fallbacks,includes, and doc/comment references updated.grepconfirms no staleapply_air_*tokens remain.Left intentionally unchanged:
air_sea_interface_radiation_state(describes the radiation state at the surface interface — distinct concept, separate scope).Test plan
🤖 Generated with Claude Code