InputOutput
This module provides types and utilities for reading input files (i.e. parameters and forcings) as well as saving model outputs.
CryoGrid.InputOutput.CryoGridOutput
— TypeCryoGridOutput{TSol}
Helper type that stores the raw output from a CryoGrid run along with DimArray
views of all logged variables. CryoGridOutput
overrides Base.getproperty
to allow for direct dot-syntax access of state variables. For example, if your model has a grid variable named T
, out.T
returns a DimArray
with indexed time and depth axes. For OrdinaryDiffEq.jl outputs, the ODESolution
can be accessed via out.sol
, or for convenience, the continuous solution at time t
can be computed via out(t)
which is equivalent to withaxes(out.sol(t))
.
CryoGrid.InputOutput.CryoGridOutput
— MethodEvaluates the continuous solution at time t
.
CryoGrid.InputOutput.CryoGridOutput
— MethodCryoGridOutput(sol::TSol, tspan::NTuple{2,Float64}=(-Inf,Inf)) where {TSol<:SciMLBase.AbstractODESolution}
Constructs a CryoGridOutput
from the given ODESolution
. Optional argument tspan
restricts the time span of the output.
CryoGrid.InputOutput.CryoGridParams
— TypeCryoGridParams{T,TM} <: DenseArray{T,1}
Wraps a ModelParameters.Model
parameter handler for CryoGrid types. It is recommended not to use this type directly in math or linear algebra operations but rather to use Base.values
to obtain a normal array of parameter values.
CryoGrid.InputOutput.CryoGridParams
— MethodCryoGridParams(obj)
Constructs a modelParameters.Model
wrapped with CryoGridParams
from obj
. If full_metadata
is true
, additonal fields for nested Parameterization
types will be added.
CryoGrid.InputOutput.FixedParam
— TypeFixedParam(p::NamedTuple)
FixedParam(; kw...)
FixedParam(val)
Subtype of AbstractParam
that rerpesents a "fixed" parameter which should not be included in the set of free parameters for the model.
CryoGrid.InputOutput.ForcingFormat
— TypeRepresents an externally specified format for forcing inputs. IO functions should dispatch on specific types T<:ForcingFormat
that they implement.
CryoGrid.InputOutput.ForcingFormatJSON
— TypeJSON forcing input format (from CryoGridLite) with specified version indicator.
CryoGrid.InputOutput.ForcingFormatNCD
— TypeNetCDF forcing input format.
CryoGrid.InputOutput.Input
— TypeInput{name,attrsType<:NamedTuple}
The Input
type represents a placeholder for (typically time-varying) inputs that will be replaced with the numeric value at runtime. The name
of the Input
will be used to match it to the corresponding input function.
CryoGrid.InputOutput.InputFunctionProvider
— TypeInputFunctionProvider
Generic input provider that simply wraps a NamedTuple
of functions.
CryoGrid.InputOutput.InputProvider
— TypeInputProvider
Base type for Input
providers that realize one or more Input
s.
CryoGrid.InputOutput.LinearTrend
— TypeLinearTrend{id,TSlope,TInt} <: DynamicParameterization
Applies a linear trend to a parameter p
by reparameterizing it as: p = p₁*t + p₀
CryoGrid.InputOutput.ParamsJSON
— TypeJSON parameter input format (from CryoGridLite). Not yet implemented.
CryoGrid.InputOutput.ParamsYAML
— TypeYAML parameter input format matching that of the CryoGrid community model. Not yet implemented.
CryoGrid.InputOutput.PiecewiseLinear
— TypePiecewiseLinear{id,N,T0,TKnots,I} <: DynamicParameterization
Reparameterizes parameter p
as p = p₁δ₁t + ⋯ + pₖδₖt
where δₖ are indicators for when tₖ₋₁ <= t <= tₖ
. To facilitate sampling and optimization, change points tᵢ are parameterized as bin widths, which should be strictly positive. PiecewiseLinear
will normalize them and scale by the size of the time interval.
CryoGrid.InputOutput.Transformed
— TypeTransformed{F,NT} <: DynamicParameterization
Reparameterization corresponding to an arbitrary functional transformation.
CryoGrid.InputOutput.PiecewiseConstant
— MethodSpecial case of PiecewiseLinear
.
CryoGrid.InputOutput.inputs
— Methodinputs(; named_inputs...)
Alias for the constructor of InputFunctionProvider
.
CryoGrid.InputOutput.loadforcings
— Methodloadforcings(filename::String)
loadforcings(resource::Resource; outdir=DEFAULT_FORCINGS_DIR)
loadforcings([format::ForcingFormat], filename::String; outdir=DEFAULT_FORCINGS_DIR)
Loads forcing data from the given file according to the format specified by format
. By default, the forcing format is automatically detected via detectformat
. Returns a DimStack
containing all forcing data and metadata