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

Held Suarez temperature forcing #270

Merged
merged 25 commits into from
Mar 31, 2023
Merged

Held Suarez temperature forcing #270

merged 25 commits into from
Mar 31, 2023

Conversation

milankl
Copy link
Member

@milankl milankl commented Mar 28, 2023

In addition to #269 also implements the temperature relaxation

@milankl
Copy link
Member Author

milankl commented Mar 28, 2023

The last commits reduce drastically the time spend in the parameterizations, which was (boundary layer drag only) about 2x slower than for physics=false

image

@milankl milankl added performance 🚀 Faster faster! parameterizations 🌧️ Parameterizations of unresolved physical processes labels Mar 28, 2023
@milankl milankl added this to the v0.5 milestone Mar 28, 2023
@milankl
Copy link
Member Author

milankl commented Mar 28, 2023

@maximilian-gelbrecht the last commits remove the idea to use abstract types in default_parameters.jl to dispatch initial conditions, orography, etc and uses concrete structs instead so that they directly can hold associated parameters. E.g.

run_speedy(initial_conditions=ZonalWind(u₀=25))
run_speedy(orography=ZonalRidge())
run_speedy(boundary_layer=LinearDrag(drag_time=12))

meaning that orography=ZonalRidge will now throw an error because it passes on the type and not an instance of it. Adding the () will, however, initialize with default values.

@milankl
Copy link
Member Author

milankl commented Mar 29, 2023

T63, 8 levels, surface temperature with Held Suarez forcing and full orography from the last commit

out3.mp4

@maximilian-gelbrecht
Copy link
Member

@maximilian-gelbrecht the last commits remove the idea to use abstract types in default_parameters.jl to dispatch initial conditions, orography, etc and uses concrete structs instead so that they directly can hold associated parameters. E.g.

run_speedy(initial_conditions=ZonalWind(u₀=25))
run_speedy(orography=ZonalRidge())
run_speedy(boundary_layer=LinearDrag(drag_time=12))

meaning that orography=ZonalRidge will now throw an error because it passes on the type and not an instance of it. Adding the () will, however, initialize with default values.

Nice! I was already thinking about suggesting that change.

@milankl
Copy link
Member Author

milankl commented Mar 31, 2023

@white-alistair I had to adapt the thermodynamics tests as we now centrally calculate the pressure (and log pressure) on every level in get_column! so that it doesn't have to be recalculated for every parameterization. Meaning column.pres is now a vector of nlev+1 with the last element being the surface

Will also eventually overhaul the vertical interpolation as recalculating the interpolation weights for every grid cell can be avoided. That actually sounds like it should be part of Geometry (in contrast to a lot of other things in there, that don't seem like "Geometry"...)

@milankl
Copy link
Member Author

milankl commented Mar 31, 2023

@white-alistair there seems to be some inconsistencies with the units of pressure across dynamics and various places in the physics. At the moment we have

  • log(Pa) only in the dynamics
  • convert to Pa at every level for the physics through $p_k = \sigma_k \exp(\log(p_s))$ (i.e. 1 exp per grid point)
  • pres_thresh_cnv that is normalised (by 1000hPa, I assume)
  • parameterizations that do pres > pres_thresh_cnv so clearly assume the pressure of the column to be normalised too

Just a note to self (and you) that we may want to unify this somehow and make consistent. I believe we should calculate general quantities like pressure that clearly belog to the column centrally in get_column! and not in individual parameterizations.

@milankl milankl merged commit caa2908 into main Mar 31, 2023
@milankl
Copy link
Member Author

milankl commented Mar 31, 2023

And just to add: I believe at some point it makes sense to implement hybrid $\sigma$-pressure coordinates, because it seems to be widely used standard. It's not suuuper difficult to implement for the dynamics, but it obviously interferes with the physics so want to put this off for now, but it's on my todo wishlist.

@milankl milankl deleted the mk/heldsuarez branch March 31, 2023 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parameterizations 🌧️ Parameterizations of unresolved physical processes performance 🚀 Faster faster!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants