-
Notifications
You must be signed in to change notification settings - Fork 3
Initial coupling to SpeedyWeather via example script #42
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
Conversation
7b26375 to
4885ba5
Compare
e8bc479 to
bc92f65
Compare
4885ba5 to
8983060
Compare
cdcca5c to
555f03b
Compare
266a90c to
fa84f6d
Compare
555f03b to
44992da
Compare
maximilian-gelbrecht
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the general approach.
So currently in the actual running code in the script you just define Terrarium as a land component of SpeedyWeather. And you don't actually use the CoupledSoilAtmosphereModel that you define in the package. Can you give a bit of the thought process in which situations you would do what. Also are there any problems still with CoupledSoilAtmosphereModel that there's no example or test?
|
The current setup where the SoilModel is coupled directly to Speedy via a temperature-BC is not really meaningful or useful for any practical coupled land-atmosphere modeling. It was only intended as a first step. There might be isolated cases where it's still useful, like coupled thermal simulations over large spatiotemporal scales, but... those use cases are far and few between. The We still need to figure out what the problem is there, but I suspect part of the problem is that Terrarium uses a fairly small upper soil layer of 5-10 cm in thickness (ideally we should actually be targeting 1-2 cm... especially for soil water and carbon), whereas Speedy's bucket land model uses a thicker 20 cm layer. Possible bugs in the flux calculations notwithstanding, the two solutions in the end will probably be (a) take smaller timesteps or (b) use an implicit time stepper. |
2b48a57 to
e6f85be
Compare
f46f6fb to
132223f
Compare
|
What do you see as TODOs here aside from some cleanup. I guess this PR will be more focussed on the initial temperature BC coupling, and then we try to resolve the outstanding issues in a follow up? |
|
Yeah I'll just clean up the script and make sure it's working with the temperature-only coupling. In a meeting with @milankl, we determined that the cause of instability in temperature-only coupling with small surface layers (5 cm thick) was due to Speedy taking timesteps that were too big. So I think for |
Also rename boundary_conditions method to merge_boundary_conditions
Cleaned up to only use surface temperature coupling (radiative fluxes are ignored)
132223f to
f0a26f2
Compare
|
@maximilian-gelbrecht I think this is ready to go. We will definitely need to investigate performance and how to speed things up. Even working around the weird SpeedyWeather FFTW threading bug, I get ~4-5x slowdown compared to running Speedy standalone with its default bucket land model. Of course the other logical next step is investigating the stability issues with SEB coupling. In addition, I tried running a 1-year simulation with this temperature-only coupling and it crashed with NaNs near the end :( So yeah, long way to go, but this is nonetheless a good start, I think. |
|
@maximilian-gelbrecht Would you prefer if initialize(model::AbstractModel, timestepper::AbstractTimeStepper, inputs::InputSource...) |
|
Already done in d2db0f5 :) |
|
I think that would make it just more convenient. |
|
Ok that took an unreasonable amount of time, but it's fixed now... |
This PR is an initial attempt at coupling Terrarium to SpeedyWeather by extending
SpeedyWeather.AbstractLand.Currently, we couple the
PrimitiveDryModelto a Terrarium soil column on a rocky planet (no oceans).Coupling is via skin temperature only. Surface energy fluxes from radiation are currently ignored. There is still some work to be done in debugging instability with the implicit skin temperature scheme and surface energy balance.
This PR also adds a
CoupledSoilAtmosphereModelwhich combines aSoilModelwith aSurfaceEnergyBalanceandPrescribedAtmosphere.Additional changes:
FieldInputSourcejust defineinputvariables rather than storing its ownFields; this is simpler and less redundant.Resolves #41