InputOutput
This module provides types and utilities for reading input files (i.e. parameters and forcings) as well as saving model outputs.
CryoGrid.InputOutput.ConstantForcing
— Type ConstantForcing{unit,T} <: Forcing{unit,T}
Simple Forcing
type that just returns a constant value. This type is primarily intended for writing tests but could still be used in applications if necessary.
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.Forcing
— Type Forcing{unit,T}
Abstract type representing a generic external forcing term.
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.Forcings
— Type Forcings{names,TF,TMeta}
Generic container for forcing types with optional metadata.
CryoGrid.InputOutput.InterpolatedForcing
— Type InterpolatedForcing{unit,T,TI}
Forcing data provided by a discrete time series of data.
CryoGrid.InputOutput.InterpolatedForcing
— MethodGet interpolated forcing value at t seconds from t0.
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.TimeVaryingForcing
— Type TimeVaryingForcing{unit,T} <: Forcing{unit,T}
Simple Forcing
type that evaluates a given function f(t)
of where t
is the current time.
CryoGrid.InputOutput.TransformedForcing
— Type TransformedForcing(transformed_unit,orig_unit,TF,T,TO<:Forcing{orig_unit,T}) <: Forcing{transformed_unit,T}
Wraps another Forcing
and applies an arbitrary transformation f
when evaluated. The transformed unit can either be automatically determined on construction or specified directly.
CryoGrid.InputOutput.loadforcings
— Methodloadforcings(filename::String)::Forcings
loadforcings(resource::Resource; outdir=DEFAULT_FORCINGS_DIR)::Forcings
loadforcings([format::ForcingFormat], filename::String; outdir=DEFAULT_FORCINGS_DIR)::Forcings
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 Forcings
struct containing all forcing data and metadata
CryoGrid.InputOutput.time_derivative_forcing
— Methodtime_derivative_forcing(
f::InterpolatedForcing{unit},
new_name::Symbol;
interp=Numerics.Linear()
) where {unit}
Computes the finite difference time derivative of the given InterpolatedForcing
time series and returns a new forcing with units [unit].s⁻¹