Skip to content

Add reset_fluxes! function to FluxCalculator#1908

Open
akshaysridhar wants to merge 1 commit into
mainfrom
as/generalize-flux-start
Open

Add reset_fluxes! function to FluxCalculator#1908
akshaysridhar wants to merge 1 commit into
mainfrom
as/generalize-flux-start

Conversation

@akshaysridhar

Copy link
Copy Markdown
Member

Generalizes the flux reset in #1841. FluxCalculator now provides a reset_fluxes hook which can be modified per model component.

@akshaysridhar akshaysridhar requested a review from juliasloan25 May 7, 2026 15:21

@juliasloan25 juliasloan25 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you planning to extend this for the other components as part of this PR or in a followup?

return nothing
end

function FluxCalculator.reset_fluxes!(sim::OceananigansSimulation)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add a brief docstring please?

Comment thread src/FieldExchanger.jl Outdated
"""
function update_model_sims!(model_sims, csf)
for sim in model_sims
FluxCalculator.reset_fluxes!(sim)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how I feel about resetting the fluxes here. To me it would make a little more sense to do it explicitly in the coupler loop, after update_surface_fractions! and before exchange!. That way it's very clear what order things are done in rather than being tucked inside update_model_sims!.

@akshaysridhar akshaysridhar force-pushed the as/generalize-flux-start branch from c0ece09 to 34a94e1 Compare June 2, 2026 16:25
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.

2 participants