Skip to content

Introduce concept of initialization update state #4223

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

Merged
merged 5 commits into from
Mar 14, 2025
Merged

Conversation

glwagner
Copy link
Member

No description provided.

@@ -60,8 +60,8 @@ model.velocities.u
@apply_regionally set!(ϕ, value)
end

initialize!(model)
update_state!(model; compute_tendencies=false)
# initialize!(model)
Copy link
Member Author

Choose a reason for hiding this comment

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

@simone-silvestri do you know why this is here? This has to do with free surface. But I am not sure why we need it. Note, it can’t be req for update_state bc the first call is in model constructor. So this may be superfluous, or it needs to happen sooner.

Copy link
Member Author

Choose a reason for hiding this comment

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

Basically we are not guaranteed to call set! So nothing can depend on it

Copy link
Collaborator

@simone-silvestri simone-silvestri Mar 14, 2025

Choose a reason for hiding this comment

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

This was there to make sure that the barotropic velocities are consistent with the velocities provided by set!ting the model.

Copy link
Member Author

Choose a reason for hiding this comment

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

Are the barotropic velocities not computed in update_state!?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Differently from other free surfaces, for the split explicit free surface the "source of truth" is the barotropic velocity, which is used to correct the total velocity in the pressure_correction step. Therefore, the barotropic velocity needs to be initialized in some way if we set the velocities. In this step, the barotropic velocity is initialized with the vertical integral of the total velocity.

Copy link
Member Author

Choose a reason for hiding this comment

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

What is the actual function that computes the barotropic velocities. Is there a way to call this independently? It's challenge that its grouped with initialize!(model). Also it's not clear from reading the code that this is intended to compute the barotropic velocities.

@glwagner glwagner merged commit f761e5e into main Mar 14, 2025
53 checks passed
@glwagner glwagner deleted the glw/init-update-state branch March 14, 2025 17:11
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