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

Introduce an interface to allow attaching a prognostic atmosphere #322

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

simone-silvestri
Copy link
Collaborator

@simone-silvestri simone-silvestri commented Jan 6, 2025

This PR reorganizes a bit the code to allow for a prognostic atmosphere, which means adding some interfaces that can be extended in the atmosphere we want to couple with

@simone-silvestri simone-silvestri changed the title Introduce a PrognosticAtmosphere Introduce an interface to allow attaching a prognostic atmosphere Jan 6, 2025
@@ -28,6 +29,10 @@ function time_step!(coupled_model::OceanSeaIceModel, Δt; callbacks=[], compute_
time_step!(sea_ice)
end

# Time step the atmosphere
# TODO: allow different time-steps for atmosphere and ocean
time_step!(atmosphere)
Copy link
Member

Choose a reason for hiding this comment

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

Somehow you have to ensure the time-step is size Δt

Copy link

@milankl milankl Jan 6, 2025

Choose a reason for hiding this comment

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

Numerically you can't change the time step in SpeedyWeather during the integration (well you can but it requires you to recompute the implicit solver). You can set it flexibly at initialization though. Whether ClimaOcean's dt is used in SpeedyWeather or SpeedyWeather's step is used in ClimaOcean I don't mind.

Copy link
Member

Choose a reason for hiding this comment

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

I think that ClimaOcean should manage the time-step and that the component models time-step should be set based on what ClimaOcean has.

If component models have some restriction then we need to design a way to manage that. This also means that TimeInterval schedule cannot be used in the Simulation of OceanSeaIceModel.

Why don't we write a function like set_time_step!(atmosphere, dt) (also for ocean). Then SpeedyWeather will throw an error if dt is different from its internal unchangeable time-step.

Copy link
Member

Choose a reason for hiding this comment

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

or set_Δt!(atmosphere, Δt).

(we have discussed elsewhere about the fact that we often use "time step" as a noun Δt as well as a verb for actually taking a time-step, ie time_step!... a little annoying)

Copy link
Member

Choose a reason for hiding this comment

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

or set_time_step_size!(atmos, Δt)

Copy link

Choose a reason for hiding this comment

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

normally we choose our time step with Leapfrog(spectral_grid, Δt_at_T31=Minute(40)) with T31 being our default resolution and a linear scaling towards higher resolutions that's automatically applied. But with SpeedyWeather/SpeedyWeather.jl#650 I've just created a PR that also allows to set! the time step more explicitly

Copy link
Member

Choose a reason for hiding this comment

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

Sorry for being dull --- do you mean that #650 makes it so that the user can choose the time-step when setting up a SpeedyWeather simulation?

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.

3 participants