xso.solvers.StepwiseSolver
- class xso.solvers.StepwiseSolver[source]
Solver that can handle stepwise calculation built into xsimlab framework.
Model output is computed step by step and assigned to the appropriate storage arrays in xsimlab backend.
Methods
__init__()add_forcing(label, forcing_func, model)Compute forcing over model time and provide as array.
add_parameter(label, value)Method to reformat parameter and return array.
add_variable(label, initial_value, model)Method to reformat variable and return storage array.
assemble(model)Assemble full model dimension and order fluxes for proper unpacking.
cleanup()Empty cleanup method, not necessary for this solver.
register_flux(label, flux, model, dims)Method to reformat flux function with appropriate inputs and to proper size.
return_dims_and_array(value, model_time)Helper function to create arrays of appropriate size, and assign initial value(s) to first index
solve(model, time_step)Solve model in a stepwise fashion, calling this function at each time step.