utils.forcing.create_constant_forcing

utils.forcing.create_constant_forcing(value, duration=None)

Build a constant forcing.

Parameters

value : float

The constant value returned for all t.

duration : float = None

If given, returns a :class:~climatecritters.core.ForcingElement. If omitted, returns an indefinite :class:~climatecritters.core.Forcing.

Returns

: Forcing or ForcingElement

Examples

from climatecritters.utils.forcing import create_constant_forcing

f = create_constant_forcing(8.0)
print(f.get_forcing(0.0))    # 8.0
print(f.get_forcing(999.9))  # 8.0