Open aditya-sengupta opened 7 months ago
I love it! We're getting exoplanets 💚
There's a few things we'd need to figure out/discuss/implement/test regarding exoplanets that probably can be moved into their own issues but just to list them for now
atmosphere = EarthAtmosphere()
with a bunch of thermodynamic constants for dry air and water vapour that one would need to adjust. However, a lot of the primitive equations i.e. the PrimitiveWetModel
is build around the idea that there's one dry gas and one condensable gas (which can be zero as in the PrimitiveDryModel
). Adding more gases to that mix is not impossible but certainly harder. Non-ideal gases are probably currently not a good idea because the ideal gas law is somewhat baked into the equations.planet = Earth()
with parameters like planet.axial_tilt
, planet.gravity
, planet.length_of_day
, planet.length_of_year
. Changing the axial tilt currently affects the zenith angle calculation and I don't see any problem there. However, when I implemented that I wanted length_of_day
and length_of_year
to be flexible, but then I realised that because we're also using DateTime
in clock.time
to keep track of the model time, this is a tad harder than I thought it would be. Essentially because some functions like getting time of day (for the solar hour angle) have with DateTime
essentially the length of day hardcoded and we'd need to find an elegant way to use clock.time
to keep track of time while translating into the calendar of that exoplanet.spectral_grid = SpectralGrid(radius=6371e3)
. All equations are scaled with the radius to have non-dimensional gradient operators. However, it might be that the current default choice for time step isn't stable when changin the radius by orders of magnitude. I haven't tested that.I'd say easiest is if you start figuring out "exactly what forms" you'd like to simulate, and then we can work out what's needed and I can give some of these more internal issues a higher priority?
Sounds like a plan!
DateTime
s would be really nice, but of course you'd know more about what makes more sense for the overall project.One dry + one condensable and ideal gases should be plenty to start with, as long as we're not super locked in to those being specifically the same two as Earth - I'll have some discussions and figure out a relatively easy test case.
Can can create EarthAtmosphere()
and also check ?EarthAtmosphere
for the docstring. These are the current parameters that define the atmosphere of your planet. You can define an Earth-like planet by atmosphere = EarthAtmosphere(heat_capacity=500)
and that should propagate this choice across other model components, e.g. the clausius clapeyron calculation. You'd use this in the model constructor like so
spectral_grid = SpectralGrid(trunc=31,nlev=8) # life of every simulation starts by defining the resolution
almost_earth = EarthAtmosphere(heat_capacity=500)
model = PrimtiveWetModel(;spectral_grid, atmosphere=almost_earth)
You could, however, also define your own atmosphere
struct MarsAtmosphere <: SpeedyWeather.AbstractAtmosphere
p1
p2
p3
end
with parameters p1, p2, p3
that define your atmosphere. You currently need to define most of the fields as in EarthAtmosphere
(your atmosphere needs a heat capacity and a gas constant e.g.) but depending on whether you use the PrimitiveDryModel
or the PrimitiveWetModel
some of these aren't accessed.
Reminder to self to document this in the documentation 😉
I'm not sure there is such a thing as a calendar of an exoplanet (yet!) - I think we'd measure model time in Earth days/years but without reference to any particular starting point. If it wouldn't be too much of a rewrite, having a number for absolute time that can be converted either to "days/years since start" or
DateTime
s would be really nice, but of course you'd know more about what makes more sense for the overall project.
Yes, technically our time axis just counts up in seconds, however, for convenience that's pu into a DateTime
object. One can therefore for example do simulation = initialize!(model, time=DateTime(2050,1,1)
to let the model time start in January 2050 and e.g. the surface temperatures would be picked according to that date (it's a repeating seasonal cycle by default) and you'd know it's northern hemisphere winter. What I'm saying is that Jan 1 has no meaning on an exoplanets calendar (whether it exists or not) unless you somehow say at a given reference date earth and our exoplanet were in the same orbital position and since then the exoplanet kept spinning but with a different length of day and year.
Plenty of the higher-order details are a lot more specific than we even know about in exoplanets! I'd say it's important to get vertical and horizontal advection, condensation/evaporation, and some basic cloud formation down (my main project has to do with modeling specifically this part in a way that can be plugged into climate models, so that's a possible integration for the currently-distant future). Would we need more details than that on what forms I'm after?
We have advection, condensation and evaporation, regarding clouds we started to work on this in relation to radiation (see #460). I would love to hear your perspective here on what interaction between the different parameterizations would you envisage, e.g. how large-scale condensation determines clouds, their properties and what of that is important for a general radiation scheme.
I'd be interested in applying SpeedyWeather.jl to exoplanet climate and adding in some commonly-used parameterizations of clouds and chemistry we use! I've yet to work out exactly what forms I want the latter part of this to take, but to start with, I think a lot of the aspects of the physics for Earth models are too precise for what we know about exoplanets. Is there a breakdown of the physics I can start with (the docs don't seem to have much about this) so I can try removing stuff I don't need + adding new components?