Skip to content
Snippets Groups Projects

Add new surface energy balance parameterizations

Merged Jan Nitzbon requested to merge jnitzbon/cryogridjulia:feature/fancy-seb into master
2 files
+ 39
39
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 18
18
@@ -12,6 +12,8 @@ using Parameters
import CryoGrid: BoundaryProcess, BoundaryStyle, Neumann, Top
import CryoGrid: initialcondition!, variables, boundaryvalue
export Businger, HøgstrømSHEBA, Iterative, Analytical, Numerical
abstract type SolutionScheme end
"""
Byun 1990
@@ -42,8 +44,6 @@ SHEBA, Uttal et al., 2002, Grachev et al. 2007 (stable conditions)
"""
struct HøgstrømSHEBA <: StabilityFunctions end
#abstract type SEBParams{TSolution,TStabFun} <: Params end
@with_kw struct SEBParams{TSolution,TStabFun} <: Params
# surface properties --> should be associated with the Stratigraphy and maybe made state variables
α::Float"1" = 0.2xu"1" # surface albedo [-]
@@ -71,30 +71,30 @@ struct HøgstrømSHEBA <: StabilityFunctions end
# type-dependet parameters
solscheme::TSolution = Iterative()
stabfun::TStabFun = HøgstrømSHEBA()
# function SEBParams( ss::SolutionScheme, sf::StabilityFunctions )
# solscheme = ss;
# stabfun = sf;
# new{typeof(solscheme),typeof(stabfun)}(solscheme, stabfun)
# end
end
"""
Surface energy balance upper boundary condition.
"""
struct SurfaceEnergyBalance{TSolution,TStabFun,F} <: BoundaryProcess
forcing::F
forcings::F
sebparams::SEBParams{TSolution,TStabFun}
function SurfaceEnergyBalance(Tair::TimeSeriesForcing, p::TimeSeriesForcing, q::TimeSeriesForcing,
wind::TimeSeriesForcing, Lin::TimeSeriesForcing,
Sin::TimeSeriesForcing, z::Float"m";
kwargs...)
forcing = (Tair = Tair, p = p, q = q, wind = wind, Lin = Lin, Sin = Sin, z = z);
function SurfaceEnergyBalance(
Tair::TimeSeriesForcing{Float"°C"},
p::TimeSeriesForcing,
q::TimeSeriesForcing,
wind::TimeSeriesForcing,
Lin::TimeSeriesForcing,
Sin::TimeSeriesForcing,
z::Float"m";
kwargs...
)
forcings = (Tair = Tair, p = p, q = q, wind = wind, Lin = Lin, Sin = Sin, z = z);
sebparams = SEBParams(;kwargs...);
new{typeof(sebparams.solscheme),typeof(sebparams.stabfun),typeof(forcing)}(forcing, sebparams)
new{typeof(sebparams.solscheme),typeof(sebparams.stabfun),typeof(forcings)}(forcings, sebparams)
end
end
include("seb_heat.jl")
export SEBParams, Businger, HøgstrømSHEBA, Iterative, Analytical, Numerical
end
Loading