diff --git a/src/glacier/glacier.jl b/src/glacier/glacier.jl index 8b0eebec7..ac2c83633 100644 --- a/src/glacier/glacier.jl +++ b/src/glacier/glacier.jl @@ -33,7 +33,7 @@ end "Struct for storing glacier HBV model parameters" @get_units @grid_loc @with_kw struct GlacierHbvParameters{T} # Threshold temperature for glacier melt [ᵒC] - g_tt::Vector{T} | "ᵒC" + g_ttm::Vector{T} | "ᵒC" # Degree-day factor [mm ᵒC⁻¹ Δt⁻¹] for glacier g_cfmax::Vector{T} | "mm ᵒC-1 dt-1" # Fraction of the snowpack on top of the glacier converted into ice [Δt⁻¹] @@ -55,10 +55,10 @@ struct NoGlacierModel{T} <: AbstractGlacierModel{T} end "Initialize glacier HBV model parameters" function GlacierHbvParameters(nc, config, inds, dt) - g_tt = ncread( + g_ttm = ncread( nc, config, - "vertical.glacier.parameters.g_tt"; + "vertical.glacier.parameters.g_ttm"; sel = inds, defaults = 0.0, type = Float, @@ -94,13 +94,8 @@ function GlacierHbvParameters(nc, config, inds, dt) fill = 0.0, ) max_snow_to_glacier = 8.0 * (dt / basetimestep) - glacier_hbv_params = GlacierHbvParameters(; - g_tt = g_tt, - g_cfmax = g_cfmax, - g_sifrac = g_sifrac, - glacier_frac = glacier_frac, - max_snow_to_glacier = max_snow_to_glacier, - ) + glacier_hbv_params = + GlacierHbvParameters(; g_ttm, g_cfmax, g_sifrac, glacier_frac, max_snow_to_glacier) return glacier_hbv_params end @@ -118,7 +113,7 @@ function update!(model::GlacierHbvModel, atmospheric_forcing::AtmosphericForcing (; temperature) = atmospheric_forcing (; glacier_store, glacier_melt) = model.variables (; snow_storage) = model.boundary_conditions - (; g_tt, g_cfmax, g_sifrac, glacier_frac, max_snow_to_glacier) = model.parameters + (; g_ttm, g_cfmax, g_sifrac, glacier_frac, max_snow_to_glacier) = model.parameters n = length(temperature) @@ -128,7 +123,7 @@ function update!(model::GlacierHbvModel, atmospheric_forcing::AtmosphericForcing glacier_store[i], snow_storage[i], temperature[i], - g_tt[i], + g_ttm[i], g_cfmax[i], g_sifrac[i], max_snow_to_glacier, diff --git a/src/glacier/glacier_process.jl b/src/glacier/glacier_process.jl index 17175b0d4..b838b465b 100644 --- a/src/glacier/glacier_process.jl +++ b/src/glacier/glacier_process.jl @@ -12,7 +12,7 @@ occurs if the snow storage < 10 mm. - `glacierstore` volume of the glacier [mm] w.e. - `snow_storage` snow storage on top of glacier [mm] - `temperature` air temperature [°C] -- `tt` temperature threshold for ice melting [°C] +- `ttm` temperature threshold for ice melting [°C] - `cfmax` ice degree-day factor in [mm/(°C/day)] - `g_sifrac` fraction of the snow turned into ice [-] - `max_snow_to_glacier` maximum snow to glacier conversion rate @@ -29,7 +29,7 @@ function glacier_hbv( glacierstore, snow, temperature, - tt, + ttm, cfmax, g_sifrac, max_snow_to_glacier, @@ -46,7 +46,7 @@ function glacier_hbv( glacierstore = glacierstore + snow_to_glacier # Potential snow melt, based on temperature - potmelt = temperature > tt ? cfmax * (temperature - tt) : 0.0 + potmelt = temperature > ttm ? cfmax * (temperature - ttm) : 0.0 # actual Glacier melt glaciermelt = snow < 10.0 ? min(potmelt, glacierstore) : 0.0