Skip to content

Commit

Permalink
Model adjustment.
Browse files Browse the repository at this point in the history
  • Loading branch information
Maginor committed Feb 11, 2025
1 parent 0cac54f commit 8c55971
Show file tree
Hide file tree
Showing 2 changed files with 192 additions and 81 deletions.
255 changes: 179 additions & 76 deletions models/example_data/simplyc_langtjern.dat
Original file line number Diff line number Diff line change
@@ -1,159 +1,262 @@
# Saved from model : "simplyc_model.txt"

data_set {

"""
TODO: description
"""


series("langtjern.xlsx")

lu : index_set("Landscape units") [ "Forest" ]

sc : index_set("Subcatchment") [ "Inlet" ]

connection("Downstream") {

r : compartment("River", sc)

directed_graph [
directed_graph [
r[ "Inlet" ] -> out
]
}

series("langtjern.xlsx")


par_group("System") {
par_datetime("Start date")

par_datetime("Start date")
[ 1986-01-01 ]

par_datetime("End date")
par_datetime("End date")
[ 2015-12-31 ]

}

par_group("Catchment data", sc) {
par_real("Catchment area")

par_real("Catchment area")
[ 0.8 ]

}

par_group("Land cover", sc, lu) {

par_real("Land use proportions") [
1
]

}


option_group("SimplyQ configuration") {

par_enum("PET module")
[ degree_day ]

par_enum("River discharge module")
[ simple ]

par_enum("Groundwater module")
[ simple ]

par_enum("N soil layers")
[ one ]

}

module("HBVSnow", version(1, 0, 0)) {

par_group("Snow") {
par_real("Degree-day factor for snowmelt")

par_real("Degree-day factor for snowmelt")
[ 2.91657187378336 ]

par_real("Temperature at which precip falls as snow")
par_real("Temperature at which precip falls as snow")
[ 0.0529440765581686 ]

par_real("Temperature at which snow melts")
par_real("Temperature at which snow melts")
[ -0.0611681153264756 ]

par_real("Refreeze efficiency")
par_real("Refreeze efficiency")
[ 0.114510690439383 ]

par_real("Liquid water fraction")
par_real("Liquid water fraction")
[ 0.0553571251841209 ]

par_real("Initial snow depth (water equivalents)")
par_real("Initial snow depth (water equivalents)")
[ 0 ]

}

}

module("SimplyQ land", version(0, 5, 0)) {

module("SimplyQ land", version(0, 5, 1)) {

par_group("Hydrology general") {
par_real("Baseflow index")

par_real("Baseflow index")
[ 0.485492149817654 ]

par_real("Quick flow inflection point")
par_real("Quick flow inflection point")
[ 160.059149394341 ]

par_real("Permanent wilting point as fraction of field capacity")
[ 0.5 ]

}

par_group("Hydrology land", lu) {
par_real("Field capacity")

par_real("Field capacity")
[ 120 ]

par_real("Soil water time constant")
par_real("Soil water time constant")
[ 2.48486976249477 ]

}

par_group("Groundwater") {
par_real("Groundwater time constant")
[ 30.0527746167028 ]
}

}

module("SimplyQ river", version(0, 5, 0)) {

par_group("Reach parameters", sc) {
par_real("Reach slope")

par_real("Reach slope")
[ 0.014 ]

par_real("Reach length")
par_real("Reach length")
[ 800 ]

par_real("Manning's roughness coefficient")
par_real("Manning's roughness coefficient")
[ 0.04 ]

par_real("Initial reach flow")
par_real("Initial reach flow")
[ 0.001 ]

}

}

module("Degree-day PET", version(1, 0, 0)) {

par_group("Potential evapotranspiration", lu) {
par_real("Degree-day factor for evapotranspiration")

par_real("Degree-day factor for evapotranspiration")
[ 0.12 ]

par_real("Minimal temperature for evapotranspiration")
par_real("Minimal temperature for evapotranspiration")
[ 0 ]

}

}

module("Simply soil temperature", version(0, 1, 0)) {

par_group("Soil temperature general") {
par_real("Snow depth / soil temperature factor")

par_real("Snow depth / soil temperature factor")
[ -0.2 ]

par_real("Initial soil temperature")
par_real("Initial soil temperature")
[ 10 ]

}

par_group("Soil temperature land", lu) {
par_real("Soil thermal conductivity / specific heat capacity")

par_real("Soil thermal conductivity / specific heat capacity")
[ 0.03 ]

}

}

module("SimplyC land", version(1, 0, 1)) {

par_group("DOC general") {
par_real("Baseline soil DOC dissolution rate")

par_real("Baseline soil DOC dissolution rate")
[ 100 ]

par_real("Soil temperature DOC creation linear coefficient")
par_real("Soil temperature DOC creation linear coefficient")
[ 0.0192699922622986 ]

par_real("Soil DOC linear SO4 dependence")
par_real("Soil DOC linear SO4 dependence")
[ 0.076 ]

par_real("Soil temperature DOC creation second-order coefficient")
par_real("Soil temperature DOC creation second-order coefficient")
[ 0.00276834666700925 ]

par_enum("Soil DOC computation type")
par_enum("Soil DOC computation type")
[ equilibrium ]

par_enum("Groundwater DOC computation type")
par_enum("Groundwater DOC computation type")
[ soil_avg ]

}

par_group("DOC land", lu) {
par_real("Baseline soil DOC concentration")

par_real("Baseline soil DOC concentration")
[ 11.5 ]

}

par_group("DOC deep soil") {
par_real("Groundwater DOC half-life")

par_real("Groundwater DOC half-life")
[ 80 ]

par_real("Groundwater DOC concentration")
par_real("Groundwater DOC concentration")
[ 3 ]

}

}

module("RiverTemperature", version(0, 1, 1)) {

par_group("River temperature", sc) {

par_real("Air-river heat exchange coefficient")
[ 1 ]

}

}

module("SimplyC river", version(0, 0, 1)) {

par_group("DOC river", sc) {

par_real("River DOC loss rate at 20°C")
[ 0 ]

par_real("River DOC loss Q10")
[ 1 ]

}

}
}

module("SimplyQ groundwater", version(0, 5, 0)) {

par_group("Groundwater", sc) {

par_real("Groundwater time constant")
[ 30 ]

par_real("Groundwater retention volume")
[ 0 ]

}

par_group("Groundwater extraction", sc) {

par_real("Groundwater extraction")
[ 0 ]

}

}

}
18 changes: 13 additions & 5 deletions models/nivafjord_simplycnp_model.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,28 @@ model("NIVAFjord-SimplyCNP") {

unit_conversion(gw.water, layer.water) { a_catch->> }

# TODO: Maybe factor out
# TODO: Maybe factor out this module
# Needed since we have direct discharge from gw to lake
module("Groundwater temp and O2", version(0,0,0)) {
module("Groundwater temp and O2", version(0, 0, 0)) {

load("stdlib/physiochemistry.txt", library("Water utils"))
load("stdlib/physiochemistry.txt", library("Chemistry"))
load("stdlib/seawater.txt", library("Sea oxygen"))

#par_group("Groundwater temp and O2") {
# t_gw : par_real("Groundwater temperature", [deg_c], 12)
# o2sat_gw : par_real("Groundwater O2 saturation", [], 0.5)
#}

var(gw.water.heat, [J, k m-2], "Groundwater heat") @override {
t := aggregate(soil.temp),
t_gw := aggregate(soil.temp),
V := 1[k m 2]*gw.water -> [m 3],
(water_temp_to_heat(V, t) / 1[k m 2]) ->>
(water_temp_to_heat(V, t_gw) / 1[k m 2]) ->>
}

var(gw.water.o2, [k g, k m-2], "Groundwater oxygen") @override_conc {
var(gw.water.o2, [k g, k m-2], [m g, l-1], "Groundwater oxygen") @override_conc {
conc(river.water.o2) # TODO: do something else here?
#o2sat_gw*o2_saturation_concentration(t_gw, 0) * o2_mol_mass ->>
}
}

Expand Down

0 comments on commit 8c55971

Please sign in to comment.