Simulations
ClimaLand.Simulations.LandSimulation
— TypeLandSimulation{
M <: ClimaLand.AbstractModel,
T <: ClimaTimeSteppers.DistributedODEAlgorithm,
UC,
DI,
RC,
CA <: SciMLBase.CallbackSet,
I <: SciMLBase.DEIntegrator,
}
the ClimaLand LandSimulation struct, which specifies
- the discrete set of equations to solve (defined by the
model
); - the timestepping algorithm;
- user callbacks (passed as a tuple) to be executed at specific times in the simulations;
- the diagnostics to output (optional).
User callbacks are optional: examples currently include callbacks that estimate the time to solution and SYPD of the simulation as it runs, checkpoint the state, or check the solution for NaNs. Others can be added here.
Diagnostics are implemented as callbacks, and are also optional. However, a default is provided. diagnostics
is expected to be a list of ClimaDiagnostics.ScheduledDiagnostics
.
Finally, the private field requiredcallbacks consists of callbacks that are required for the simulation to run correctly. Currently, this includes the callbacks which update the atmospheric forcing and update the LAI using prescribed data.
ClimaLand.Simulations.step!
— Functionstep!(landsim::LandSimulation)
Advances the land simulation landsim
forward in time by one step, updating landsim
in place.
ClimaLand.Simulations.solve!
— Functionsolve!(landsim::LandSimulation)
Advances the land simulation landsim
forward from the initial to final time, updating landsim
in place.
ClimaLand.Simulations.make_set_initial_state_from_file
— Functionmake_set_initial_state_from_file(ic_path, land::LandModel{FT}) where {FT}
Returns a function which takes (Y,p,t0,land) as arguments, and updates the state Y in place with initial conditions from ic_path
, a netCDF file. Fields in the cache p
are used as pre-allocated memory and are updated as well, but this does not mean that the cache state is consitent with Y and t entirely.
Currently only tested and used for global simulations, but the same returned function should work for column simulations.
The returned function is a closure for ic_path
. It could also be for land
, as many other ClimaLand functions are, but we wish to preserve the argument land
in set_ic!
for users who wish to define their own initial condition function, which may require parameters, etc, stored in land
.
make_set_initial_state_from_file(ic_path, land::SoilCanopyModel{FT}) where {FT}
Returns a function which takes (Y,p,t0,land) as arguments, and updates the state Y in place with initial conditions from ic_path
, a netCDF file. Fields in the cache p
are used as pre-allocated memory and are updated as well, but this does not mean that the cache state is consitent with Y and t entirely.
Currently only tested and used for global simulations, but the same returned function should work for column simulations.
The returned function is a closure for ic_path
. It could also be for land
, as many other ClimaLand functions are, but we wish to preserve the argument land
in set_ic!
for users who wish to define their own initial condition function, which may require parameters, etc, stored in land
.
make_set_initial_state_from_file(ic_path, model::ClimaLand.Soil.EnergyHydrology{FT}) where {FT}
Returns a function which takes (Y,p,t0,model) as arguments, and updates the state Y in place with initial conditions from ic_path
, a netCDF file. Fields in the cache p
are used as pre-allocated memory and are updated as well, but this does not mean that the cache state is consitent with Y and t entirely.
Currently only tested and used for global simulations, but the same returned function should work for column simulations.
The returned function is a closure for ic_path
. It could also be for model
, as many other ClimaLand functions are, but we wish to preserve the argument model
in set_ic!
for users who wish to define their own initial condition function, which may require parameters, etc, stored in model
.