diff --git a/server/test/client.jl b/server/test/client.jl index 58f039923..afea06e3d 100644 --- a/server/test/client.jl +++ b/server/test/client.jl @@ -35,8 +35,8 @@ end @test request((fn = "get_input_item_count",)) == Dict("input_item_count" => 202) @test request((fn = "get_output_item_count",)) == Dict("output_item_count" => 202) to_check = [ - "vertical.soil.parameters.nlayers", - "vertical.soil.parameters.theta_r", + "land.soil.parameters.nlayers", + "land.soil.parameters.theta_r", "lateral.river.variables.q", "lateral.river.boundary_conditions.reservoir.variables.outflow", ] @@ -51,28 +51,28 @@ vwc_1_size = 0 @testset "variable information and get and set functions" begin @test request((fn = "get_var_itemsize", name = "lateral.subsurface.variables.ssf")) == Dict("var_itemsize" => sizeof(Wflow.Float)) - @test request((fn = "get_var_type", name = "vertical.n"))["status"] == "ERROR" - @test request((fn = "get_var_units", name = "vertical.soil.parameters.theta_s")) == + @test request((fn = "get_var_type", name = "land.n"))["status"] == "ERROR" + @test request((fn = "get_var_units", name = "land.soil.parameters.theta_s")) == Dict("var_units" => "-") @test request((fn = "get_var_location", name = "lateral.river.variables.q")) == Dict("var_location" => "node") zi_nbytes = - request((fn = "get_var_nbytes", name = "vertical.soil.variables.zi"))["var_nbytes"] + request((fn = "get_var_nbytes", name = "land.soil.variables.zi"))["var_nbytes"] @test zi_nbytes == 400504 zi_itemsize = - request((fn = "get_var_itemsize", name = "vertical.soil.variables.zi"))["var_itemsize"] + request((fn = "get_var_itemsize", name = "land.soil.variables.zi"))["var_itemsize"] zi_size = Int(zi_nbytes / zi_itemsize) vwc_1_nbytes = - request((fn = "get_var_nbytes", name = "vertical.soil.variables.vwc[1]"))["var_nbytes"] + request((fn = "get_var_nbytes", name = "land.soil.variables.vwc[1]"))["var_nbytes"] @test vwc_1_nbytes == 400504 vwc_1_itemsize = - request((fn = "get_var_itemsize", name = "vertical.soil.variables.vwc[1]"))["var_itemsize"] + request((fn = "get_var_itemsize", name = "land.soil.variables.vwc[1]"))["var_itemsize"] vwc_1_size = Int(vwc_1_nbytes / vwc_1_itemsize) @test request((fn = "get_var_grid", name = "lateral.river.variables.h")) == Dict("var_grid" => 3) - msg = (fn = "get_value", name = "vertical.soil.variables.zi", dest = fill(0.0, zi_size)) + msg = (fn = "get_value", name = "land.soil.variables.zi", dest = fill(0.0, zi_size)) @test mean(request(msg)["value"]) ≈ 277.3620724821974 - msg = (fn = "get_value_ptr", name = "vertical.soil.parameters.theta_s") + msg = (fn = "get_value_ptr", name = "land.soil.parameters.theta_s") @test mean(request(msg)["value_ptr"]) ≈ 0.4409211971535584 msg = ( fn = "get_value_at_indices", @@ -82,68 +82,64 @@ vwc_1_size = 0 ) @test request(msg)["value_at_indices"] ≈ [2.1007361866518766, 2.5702292750107687, 3.2904803551115727] - msg = - (fn = "set_value", name = "vertical.soil.variables.zi", src = fill(300.0, zi_size)) + msg = (fn = "set_value", name = "land.soil.variables.zi", src = fill(300.0, zi_size)) @test request(msg) == Dict("status" => "OK") - msg = (fn = "get_value", name = "vertical.soil.variables.zi", dest = fill(0.0, zi_size)) + msg = (fn = "get_value", name = "land.soil.variables.zi", dest = fill(0.0, zi_size)) @test mean(request(msg)["value"]) == 300.0 msg = ( fn = "set_value_at_indices", - name = "vertical.soil.variables.zi", + name = "land.soil.variables.zi", src = [250.0, 350.0], inds = [1, 2], ) @test request(msg) == Dict("status" => "OK") msg = ( fn = "get_value_at_indices", - name = "vertical.soil.variables.zi", + name = "land.soil.variables.zi", dest = [0.0, 0.0, 0.0], inds = [1, 2, 3], ) @test request(msg)["value_at_indices"] == [250.0, 350.0, 300.0] msg = ( fn = "get_value", - name = "vertical.soil.variables.vwc[1]", + name = "land.soil.variables.vwc[1]", dest = fill(0.0, vwc_1_size), ) @test mean(request(msg)["value"]) ≈ 0.18600013563085036f0 msg = ( fn = "get_value_at_indices", - name = "vertical.soil.variables.vwc[1]", + name = "land.soil.variables.vwc[1]", dest = [0.0, 0.0, 0.0], inds = [1, 2, 3], ) @test request(msg)["value_at_indices"] ≈ [0.12089607119560242f0, 0.11968416924304527f0, 0.14602328618707333f0] - msg = ( - fn = "set_value", - name = "vertical.soil.variables.vwc[1]", - src = fill(0.3, vwc_1_size), - ) + msg = + (fn = "set_value", name = "land.soil.variables.vwc[1]", src = fill(0.3, vwc_1_size)) @test request(msg) == Dict("status" => "OK") msg = ( fn = "get_value", - name = "vertical.soil.variables.vwc[1]", + name = "land.soil.variables.vwc[1]", dest = fill(0.0, vwc_1_size), ) @test mean(request(msg)["value"]) ≈ 0.3f0 msg = ( fn = "get_value_at_indices", - name = "vertical.soil.variables.vwc[1]", + name = "land.soil.variables.vwc[1]", dest = [0.0, 0.0, 0.0], inds = [1, 2, 3], ) @test request(msg)["value_at_indices"] == [0.3, 0.3, 0.3] msg = ( fn = "set_value_at_indices", - name = "vertical.soil.variables.vwc[1]", + name = "land.soil.variables.vwc[1]", src = [0.1, 0.25], inds = [1, 2], ) @test request(msg) == Dict("status" => "OK") msg = ( fn = "get_value_at_indices", - name = "vertical.soil.variables.vwc[1]", + name = "land.soil.variables.vwc[1]", dest = [0.0, 0.0], inds = [1, 2], ) diff --git a/server/test/sbm_config.toml b/server/test/sbm_config.toml index 9e805a61f..36ffb73e0 100644 --- a/server/test/sbm_config.toml +++ b/server/test/sbm_config.toml @@ -19,15 +19,15 @@ path_output = "outstates-moselle.nc" # if listed, the variable must be present in the NetCDF or error # if not listed, the variable can get a default value if it has one -[state.vertical.interception.variables] +[state.land.interception.variables] canopy_storage = "canopystorage" -[state.vertical.soil.variables] +[state.land.soil.variables] satwaterdepth = "satwaterdepth" tsoil = "tsoil" ustorelayerdepth = "ustorelayerdepth" -[state.vertical.snow.variables] +[state.land.snow.variables] snow_storage = "snow" snow_water = "snowwater" @@ -60,32 +60,32 @@ subcatchment = "wflow_subcatch" # specify the internal IDs of the parameters which vary over time # the external name mapping needs to be below together with the other mappings forcing = [ - "vertical.atmospheric_forcing.precipitation", - "vertical.atmospheric_forcing.temperature", - "vertical.atmospheric_forcing.potential_evaporation", + "land.atmospheric_forcing.precipitation", + "land.atmospheric_forcing.temperature", + "land.atmospheric_forcing.potential_evaporation", ] -cyclic = ["vertical.vegetation_parameter_set.leaf_area_index"] +cyclic = ["land.vegetation_parameter_set.leaf_area_index"] -[input.vertical.vegetation_parameter_set] +[input.land.vegetation_parameter_set] leaf_area_index = "LAI" kext = "Kext" storage_specific_leaf = "Sl" storage_wood = "Swood" rootingdepth = "RootingDepth" -[input.vertical.runoff.parameters] +[input.land.runoff.parameters] waterfrac = "WaterFrac" -[input.vertical.interception.parameters] +[input.land.interception.parameters] e_r = "EoverR" -[input.vertical.atmospheric_forcing] +[input.land.atmospheric_forcing] potential_evaporation = "pet" precipitation = "precip" temperature = "temp" -[input.vertical.soil.parameters] +[input.land.soil.parameters] c = "c" cf_soil = "cf_soil" f = "f" @@ -99,13 +99,13 @@ pathfrac = "PathFrac" rootdistpar = "rootdistpar" soilthickness = "SoilThickness" -[input.vertical.snow.parameters] +[input.land.snow.parameters] tt = "TT" tti = "TTI" ttm = "TTM" cfmax = "Cfmax" -[input.vertical.soil.parameters.kv_0] +[input.land.soil.parameters.kv_0] netcdf.variable.name = "KsatVer" scale = 1.0 offset = 0.0 @@ -149,15 +149,15 @@ min_streamorder_land = 5 [output] path = "output_moselle.nc" -[output.vertical.interception.variables] +[output.land.interception.variables] canopy_storage = "canopystorage" -[output.vertical.soil.variables] +[output.land.soil.variables] satwaterdepth = "satwaterdepth" tsoil = "tsoil" ustorelayerdepth = "ustorelayerdepth" -[output.vertical.snow.variables] +[output.land.snow.variables] snow_storage = "snow" snow_water = "snowwater" @@ -188,14 +188,14 @@ coordinate.x = 6.255 coordinate.y = 50.012 name = "temp_coord" location = "temp_bycoord" -parameter = "vertical.atmospheric_forcing.temperature" +parameter = "land.atmospheric_forcing.temperature" [[netcdf.variable]] location = "temp_byindex" name = "temp_index" index.x = 100 index.y = 264 -parameter = "vertical.atmospheric_forcing.temperature" +parameter = "land.atmospheric_forcing.temperature" [csv] path = "output_moselle.csv" @@ -214,20 +214,20 @@ parameter = "lateral.river.boundary_conditions.reservoir.variables.volume" coordinate.x = 6.255 coordinate.y = 50.012 header = "temp_bycoord" -parameter = "vertical.atmospheric_forcing.temperature" +parameter = "land.atmospheric_forcing.temperature" [[csv.column]] coordinate.x = 6.255 coordinate.y = 50.012 header = "vwc_layer2_bycoord" -parameter = "vertical.soil.variables.vwc" +parameter = "land.soil.variables.vwc" layer = 2 [[csv.column]] header = "temp_byindex" index.x = 100 index.y = 264 -parameter = "vertical.atmospheric_forcing.temperature" +parameter = "land.atmospheric_forcing.temperature" [[csv.column]] header = "Q" @@ -237,24 +237,24 @@ parameter = "lateral.river.variables.q" [[csv.column]] header = "recharge" map = "subcatchment" -parameter = "vertical.soil.variables.recharge" +parameter = "land.soil.variables.recharge" reducer = "mean" [API] components = [ - "vertical.atmospheric_forcing", - "vertical.vegetation_parameter_set", - "vertical.runoff.boundary_conditions", - "vertical.runoff.variables", - "vertical.runoff.parameters", - "vertical.soil.boundary_conditions", - "vertical.soil.variables", - "vertical.soil.parameters", - "vertical.interception.variables", - "vertical.interception.parameters", - "vertical.snow.boundary_conditions", - "vertical.snow.variables", - "vertical.snow.parameters", + "land.atmospheric_forcing", + "land.vegetation_parameter_set", + "land.runoff.boundary_conditions", + "land.runoff.variables", + "land.runoff.parameters", + "land.soil.boundary_conditions", + "land.soil.variables", + "land.soil.parameters", + "land.interception.variables", + "land.interception.parameters", + "land.snow.boundary_conditions", + "land.snow.variables", + "land.snow.parameters", "lateral.subsurface.boundary_conditions", "lateral.subsurface.variables", "lateral.subsurface.parameters", diff --git a/src/Wflow.jl b/src/Wflow.jl index ae00be2b9..b7ad546b7 100644 --- a/src/Wflow.jl +++ b/src/Wflow.jl @@ -118,7 +118,7 @@ include("io.jl") include("network.jl") abstract type AbstractModel{T} end -abstract type AbstractLandSurface end +abstract type AbstractLandModel end # different model types (used for dispatch) abstract type AbstractModelType end @@ -127,23 +127,23 @@ struct SbmGwfModel <: AbstractModelType end # "sbm_gwf" type / sbm_gwf_mode struct SedimentModel <: AbstractModelType end # "sediment" type / sediment_model.jl """ - Model{L, V, R, W, T} + Model{L, LM, NR, W, T} Composite type that represents all different aspects of a Wflow Model, such as the network, parameters, clock, configuration and input and output. """ struct Model{ L <: Lateral, - V <: AbstractLandSurface, - R <: NCReader, + LM <: AbstractLandModel, + NR <: NCReader, T <: AbstractModelType, } <: AbstractModel{T} config::Config # all configuration options network::Network # connectivity information, directed graph lateral::L # lateral model that holds lateral state, moves along network - vertical::V # vertical model that holds vertical state, independent of each other + land::LM # land model simulating vertical fluxes, independent of each other clock::Clock # to keep track of simulation time - reader::R # provides the model with dynamic input + reader::NR # provides the model with dynamic input writer::Writer # writes model output type::T # model type end diff --git a/src/demand/water_demand.jl b/src/demand/water_demand.jl index 156d9f895..6fcffc7bc 100644 --- a/src/demand/water_demand.jl +++ b/src/demand/water_demand.jl @@ -36,7 +36,7 @@ function NonIrrigationDemand(dataset, config, indices, dt, sector) ncread( dataset, config, - "vertical.demand.$(sector).demand_gross"; + "land.demand.$(sector).demand_gross"; sel = indices, defaults = 0.0, type = Float, @@ -45,7 +45,7 @@ function NonIrrigationDemand(dataset, config, indices, dt, sector) ncread( dataset, config, - "vertical.demand.$(sector).demand_net"; + "land.demand.$(sector).demand_net"; sel = indices, defaults = 0.0, type = Float, @@ -87,7 +87,7 @@ function NonPaddy(dataset, config, indices, dt) efficiency = ncread( dataset, config, - "vertical.demand.nonpaddy.parameters.irrigation_efficiency"; + "land.demand.nonpaddy.parameters.irrigation_efficiency"; sel = indices, defaults = 1.0, type = Float, @@ -95,7 +95,7 @@ function NonPaddy(dataset, config, indices, dt) areas = ncread( dataset, config, - "vertical.demand.nonpaddy.parameters.irrigation_areas"; + "land.demand.nonpaddy.parameters.irrigation_areas"; sel = indices, defaults = 1, optional = false, @@ -104,7 +104,7 @@ function NonPaddy(dataset, config, indices, dt) irrigation_trigger = ncread( dataset, config, - "vertical.demand.nonpaddy.parameters.irrigation_trigger"; + "land.demand.nonpaddy.parameters.irrigation_trigger"; sel = indices, defaults = 1, optional = false, @@ -114,7 +114,7 @@ function NonPaddy(dataset, config, indices, dt) ncread( dataset, config, - "vertical.demand.nonpaddy.parameters.maximum_irrigation_rate"; + "land.demand.nonpaddy.parameters.maximum_irrigation_rate"; sel = indices, defaults = 25.0, type = Float, @@ -233,7 +233,7 @@ function Paddy(dataset, config, indices, dt) h_min = ncread( dataset, config, - "vertical.demand.paddy.parameters.h_min"; + "land.demand.paddy.parameters.h_min"; sel = indices, defaults = 20.0, type = Float, @@ -241,7 +241,7 @@ function Paddy(dataset, config, indices, dt) h_opt = ncread( dataset, config, - "vertical.demand.paddy.parameters.h_opt"; + "land.demand.paddy.parameters.h_opt"; sel = indices, defaults = 50.0, type = Float, @@ -249,7 +249,7 @@ function Paddy(dataset, config, indices, dt) h_max = ncread( dataset, config, - "vertical.demand.paddy.parameters.h_max"; + "land.demand.paddy.parameters.h_max"; sel = indices, defaults = 80.0, type = Float, @@ -257,7 +257,7 @@ function Paddy(dataset, config, indices, dt) efficiency = ncread( dataset, config, - "vertical.demand.paddy.parameters.irrigation_efficiency"; + "land.demand.paddy.parameters.irrigation_efficiency"; sel = indices, defaults = 1.0, type = Float, @@ -265,7 +265,7 @@ function Paddy(dataset, config, indices, dt) areas = ncread( dataset, config, - "vertical.demand.paddy.parameters.irrigation_areas"; + "land.demand.paddy.parameters.irrigation_areas"; sel = indices, optional = false, type = Bool, @@ -273,7 +273,7 @@ function Paddy(dataset, config, indices, dt) irrigation_trigger = ncread( dataset, config, - "vertical.demand.paddy.parameters.irrigation_trigger"; + "land.demand.paddy.parameters.irrigation_trigger"; sel = indices, optional = false, type = Bool, @@ -282,7 +282,7 @@ function Paddy(dataset, config, indices, dt) ncread( dataset, config, - "vertical.demand.paddy.parameters.maximum_irrigation_rate"; + "land.demand.paddy.parameters.maximum_irrigation_rate"; sel = indices, defaults = 25.0, type = Float, @@ -548,7 +548,7 @@ function AllocationLand(dataset, config, indices) frac_sw_used = ncread( dataset, config, - "vertical.allocation.parameters.frac_sw_used"; + "land.allocation.parameters.frac_sw_used"; sel = indices, defaults = 1, type = Float, @@ -556,7 +556,7 @@ function AllocationLand(dataset, config, indices) areas = ncread( dataset, config, - "vertical.allocation.parameters.areas"; + "land.allocation.parameters.areas"; sel = indices, defaults = 1, type = Int, diff --git a/src/erosion.jl b/src/erosion.jl index d7ee7ec22..7bf3eed24 100644 --- a/src/erosion.jl +++ b/src/erosion.jl @@ -1,5 +1,5 @@ "Soil loss model" -@with_kw struct SoilLoss{RE, OFE, SE, T} <: AbstractLandSurface +@with_kw struct SoilLoss{RE, OFE, SE, T} <: AbstractLandModel atmospheric_forcing::AtmosphericForcing{T} hydrological_forcing::HydrologicalForcing{T} geometry::LandGeometry{T} diff --git a/src/glacier/glacier.jl b/src/glacier/glacier.jl index 38d0be93a..55da76e1a 100644 --- a/src/glacier/glacier.jl +++ b/src/glacier/glacier.jl @@ -13,7 +13,7 @@ function GlacierVariables(dataset, config, indices) glacier_store = ncread( dataset, config, - "vertical.glacier.variables.glacier_store"; + "land.glacier.variables.glacier_store"; sel = indices, defaults = 5500.0, type = Float, @@ -58,7 +58,7 @@ function GlacierHbvParameters(dataset, config, indices, dt) g_ttm = ncread( dataset, config, - "vertical.glacier.parameters.g_ttm"; + "land.glacier.parameters.g_ttm"; sel = indices, defaults = 0.0, type = Float, @@ -68,7 +68,7 @@ function GlacierHbvParameters(dataset, config, indices, dt) ncread( dataset, config, - "vertical.glacier.parameters.g_cfmax"; + "land.glacier.parameters.g_cfmax"; sel = indices, defaults = 3.0, type = Float, @@ -78,7 +78,7 @@ function GlacierHbvParameters(dataset, config, indices, dt) ncread( dataset, config, - "vertical.glacier.parameters.g_sifrac"; + "land.glacier.parameters.g_sifrac"; sel = indices, defaults = 0.001, type = Float, @@ -87,7 +87,7 @@ function GlacierHbvParameters(dataset, config, indices, dt) glacier_frac = ncread( dataset, config, - "vertical.glacier.parameters.glacier_frac"; + "land.glacier.parameters.glacier_frac"; sel = indices, defaults = 0.0, type = Float, diff --git a/src/io.jl b/src/io.jl index 90d2da595..d02f74f63 100644 --- a/src/io.jl +++ b/src/io.jl @@ -183,25 +183,25 @@ end function get_param_res(model) return Dict( - symbols"vertical.atmospheric_forcing.precipitation" => + symbols"land.atmospheric_forcing.precipitation" => model.lateral.river.boundary_conditions.reservoir.boundary_conditions.precipitation, - symbols"vertical.atmospheric_forcing.potential_evaporation" => + symbols"land.atmospheric_forcing.potential_evaporation" => model.lateral.river.boundary_conditions.reservoir.boundary_conditions.evaporation, ) end function get_param_lake(model) return Dict( - symbols"vertical.atmospheric_forcing.precipitation" => + symbols"land.atmospheric_forcing.precipitation" => model.lateral.river.boundary_conditions.lake.boundary_conditions.precipitation, - symbols"vertical.atmospheric_forcing.potential_evaporation" => + symbols"land.atmospheric_forcing.potential_evaporation" => model.lateral.river.boundary_conditions.lake.boundary_conditions.evaporation, ) end mover_params = ( - symbols"vertical.atmospheric_forcing.precipitation", - symbols"vertical.atmospheric_forcing.potential_evaporation", + symbols"land.atmospheric_forcing.precipitation", + symbols"land.atmospheric_forcing.potential_evaporation", ) function load_fixed_forcing!(model) @@ -228,7 +228,7 @@ function load_fixed_forcing!(model) param_vector .= val # set fixed precipitation and evaporation over the lakes and reservoirs and put # these into the lakes and reservoirs structs and set the precipitation and - # evaporation to 0 in the vertical model + # evaporation to 0 in the land model if par in mover_params if do_reservoirs for (i, sel_reservoir) in enumerate(sel_reservoirs) @@ -283,7 +283,7 @@ function update_forcing!(model) # calculate the mean precipitation and evaporation over the lakes and reservoirs # and put these into the lakes and reservoirs structs - # and set the precipitation and evaporation to 0 in the vertical model + # and set the precipitation and evaporation to 0 in the land model if par in mover_params if do_reservoirs for (i, sel_reservoir) in enumerate(sel_reservoirs) @@ -858,7 +858,7 @@ Ignores top level values in the Dict. This function is used to convert a TOML su [output] path = "path/to/file.nc" -[output.vertical] +[output.land] canopystorage = "my_canopystorage" [output.lateral.river] @@ -870,7 +870,7 @@ values are ignored since the output path is not a netCDF name. ```julia Dict( - (:vertical, :canopystorage) => "my_canopystorage, + (:land, :canopystorage) => "my_canopystorage, (:lateral, :river, :q) => "my_q, ) ``` @@ -1623,9 +1623,9 @@ end "Get `index` for dimension name `layer` based on `model`" function get_index_dimension(var, model)::Int - (; vertical) = model + (; land) = model if haskey(var, "layer") - inds = collect(1:(vertical.soil.parameters.maxlayers)) + inds = collect(1:(land.soil.parameters.maxlayers)) index = inds[var["layer"]] else error("Unrecognized or missing dimension name to index $(var)") diff --git a/src/parameters.jl b/src/parameters.jl index 0200feb2c..0bfdda558 100644 --- a/src/parameters.jl +++ b/src/parameters.jl @@ -24,7 +24,7 @@ function VegetationParameters(dataset, config, indices) rootingdepth = ncread( dataset, config, - "vertical.vegetation_parameter_set.rootingdepth"; + "land.vegetation_parameter_set.rootingdepth"; sel = indices, defaults = 750.0, type = Float, @@ -32,16 +32,16 @@ function VegetationParameters(dataset, config, indices) kc = ncread( dataset, config, - "vertical.vegetation_parameter_set.kc"; + "land.vegetation_parameter_set.kc"; sel = indices, defaults = 1.0, type = Float, ) - if haskey(config.input.vertical.vegetation_parameter_set, "leaf_area_index") + if haskey(config.input.land.vegetation_parameter_set, "leaf_area_index") storage_specific_leaf = ncread( dataset, config, - "vertical.vegetation_parameter_set.storage_specific_leaf"; + "land.vegetation_parameter_set.storage_specific_leaf"; optional = false, sel = indices, type = Float, @@ -49,7 +49,7 @@ function VegetationParameters(dataset, config, indices) storage_wood = ncread( dataset, config, - "vertical.vegetation_parameter_set.storage_wood"; + "land.vegetation_parameter_set.storage_wood"; optional = false, sel = indices, type = Float, @@ -57,7 +57,7 @@ function VegetationParameters(dataset, config, indices) kext = ncread( dataset, config, - "vertical.vegetation_parameter_set.kext"; + "land.vegetation_parameter_set.kext"; optional = false, sel = indices, type = Float, @@ -76,7 +76,7 @@ function VegetationParameters(dataset, config, indices) canopygapfraction = ncread( dataset, config, - "vertical.vegetation_parameter_set.canopygapfraction"; + "land.vegetation_parameter_set.canopygapfraction"; sel = indices, defaults = 0.1, type = Float, @@ -84,7 +84,7 @@ function VegetationParameters(dataset, config, indices) cmax = ncread( dataset, config, - "vertical.vegetation_parameter_set.cmax"; + "land.vegetation_parameter_set.cmax"; sel = indices, defaults = 1.0, type = Float, @@ -129,7 +129,7 @@ function LandGeometry(nc, config, inds) landslope = ncread( nc, config, - "vertical.land_parameter_set.slope"; + "land.land_parameter_set.slope"; optional = false, sel = inds, type = Float, diff --git a/src/routing/subsurface.jl b/src/routing/subsurface.jl index 3bf73f642..f8f4489d3 100644 --- a/src/routing/subsurface.jl +++ b/src/routing/subsurface.jl @@ -57,7 +57,7 @@ function LateralSsfParameters( (; theta_s, theta_r, soilthickness) = soil soilthickness = soilthickness .* 0.001 - kh_profile_type = get(config.input.vertical, "ksat_profile", "exponential")::String + kh_profile_type = get(config.input.land, "ksat_profile", "exponential")::String dt = Second(config.timestepsecs) / basetimestep if kh_profile_type == "exponential" (; kv_0, f) = soil.kv_profile diff --git a/src/routing/surface_routing.jl b/src/routing/surface_routing.jl index ddaa10250..5b247c343 100644 --- a/src/routing/surface_routing.jl +++ b/src/routing/surface_routing.jl @@ -5,8 +5,8 @@ Run surface routing (land and river) for a single timestep. Kinematic wave for o and kinematic wave or local inertial model for river flow. """ function surface_routing!(model) - (; vertical, lateral, network, config, clock) = model - (; soil, runoff, allocation) = vertical + (; land, lateral, network, config, clock) = model + (; soil, runoff, allocation) = land (; land, river, subsurface) = lateral dt = tosecond(clock.dt) @@ -46,9 +46,9 @@ Run surface routing (land and river) for a model type that contains the lateral function surface_routing!( model::Model{L}, ) where {L <: Lateral{<:LocalInertialOverlandFlow, <:LocalInertialRiverFlow}} - (; lateral, vertical, network, clock) = model + (; lateral, land, network, clock) = model + (; soil, runoff) = land (; land, river, subsurface) = lateral - (; soil, runoff) = vertical dt = tosecond(clock.dt) update_boundary_conditions!(land, (; river, subsurface, soil, runoff), network, dt) diff --git a/src/sbm.jl b/src/sbm.jl index 44ddf28f1..67bd67145 100644 --- a/src/sbm.jl +++ b/src/sbm.jl @@ -1,5 +1,5 @@ "Land hydrology model with SBM soil model" -@with_kw struct LandHydrologySBM{T, D, A} <: AbstractLandSurface +@with_kw struct LandHydrologySBM{T, D, A} <: AbstractLandModel atmospheric_forcing::AtmosphericForcing{T} vegetation_parameter_set::VegetationParameters{T} interception::AbstractInterceptionModel{T} diff --git a/src/sbm_gwf_model.jl b/src/sbm_gwf_model.jl index 06e02466d..11e3cc7a3 100644 --- a/src/sbm_gwf_model.jl +++ b/src/sbm_gwf_model.jl @@ -92,7 +92,7 @@ function initialize_sbm_gwf_model(config::Config) inds_river, reverse_inds_river = active_indices(river_location_2d, 0) n_river_cells = length(inds_river) - # initialize vertical SBM concept + # initialize SBM concept land_hydrology = LandHydrologySBM(dataset, config, river_fraction, indices) # reservoirs @@ -352,7 +352,7 @@ function initialize_sbm_gwf_model(config::Config) end modelmap = ( - vertical = land_hydrology, + land = land_hydrology, lateral = (subsurface = subsurface_map, land = overland_flow, river = river_flow), ) indices_reverse = ( @@ -480,14 +480,14 @@ end "update the sbm_gwf model for a single timestep" function update!(model::AbstractModel{<:SbmGwfModel}) - (; lateral, vertical, network, clock, config) = model - (; soil, runoff, demand) = vertical + (; lateral, land, network, clock, config) = model + (; soil, runoff, demand) = land do_water_demand = haskey(config.model, "water_demand") aquifer = lateral.subsurface.flow.aquifer dt = tosecond(clock.dt) - update!(vertical, lateral, network, config, dt) + update!(land, lateral, network, config, dt) # set river stage (groundwater) to average h from kinematic wave lateral.subsurface.river.variables.stage .= @@ -511,7 +511,7 @@ function update!(model::AbstractModel{<:SbmGwfModel}) soil.variables.recharge / 1000.0 * (1.0 / dt_sbm) if do_water_demand @. lateral.subsurface.recharge.variables.rate -= - vertical.allocation.variables.act_groundwater_abst / 1000.0 * (1.0 / dt_sbm) + land.allocation.variables.act_groundwater_abst / 1000.0 * (1.0 / dt_sbm) end # update groundwater domain update!(lateral.subsurface.flow, Q, dt_sbm, conductivity_profile) diff --git a/src/sbm_model.jl b/src/sbm_model.jl index d08c16ae8..d956fb1b3 100644 --- a/src/sbm_model.jl +++ b/src/sbm_model.jl @@ -148,7 +148,7 @@ function initialize_sbm_model(config::Config) y_length, ) # update variables `ssf`, `ssfmax` and `kh` (layered profile) based on ksat_profile - kh_profile_type = get(config.input.vertical, "ksat_profile", "exponential")::String + kh_profile_type = get(config.input.land, "ksat_profile", "exponential")::String if kh_profile_type == "exponential" || kh_profile_type == "exponential_constant" initialize_lateralssf!(subsurface_flow, subsurface_flow.parameters.kh_profile) elseif kh_profile_type == "layered" || kh_profile_type == "layered_exponential" @@ -298,7 +298,7 @@ function initialize_sbm_model(config::Config) end modelmap = ( - vertical = land_hydrology, + land = land_hydrology, lateral = (subsurface = subsurface_flow, land = overland_flow, river = river_flow), ) indices_reverse = ( @@ -412,24 +412,24 @@ end "update SBM model for a single timestep" function update!(model::AbstractModel{<:SbmModel}) - (; lateral, vertical, network, clock, config) = model + (; lateral, land, network, clock, config) = model dt = tosecond(clock.dt) do_water_demand = haskey(config.model, "water_demand") - (; kv_profile) = vertical.soil.parameters + (; kv_profile) = land.soil.parameters update_until_recharge!(model) # exchange of recharge between SBM soil model and subsurface flow domain lateral.subsurface.boundary_conditions.recharge .= - vertical.soil.variables.recharge ./ 1000.0 + land.soil.variables.recharge ./ 1000.0 if do_water_demand @. lateral.subsurface.boundary_conditions.recharge -= - vertical.allocation.variables.act_groundwater_abst / 1000.0 + land.allocation.variables.act_groundwater_abst / 1000.0 end lateral.subsurface.boundary_conditions.recharge .*= lateral.subsurface.parameters.flow_width - lateral.subsurface.variables.zi .= vertical.soil.variables.zi ./ 1000.0 + lateral.subsurface.variables.zi .= land.soil.variables.zi ./ 1000.0 # update lateral subsurface flow domain (kinematic wave) - kh_layered_profile!(vertical.soil, lateral.subsurface, kv_profile, dt) + kh_layered_profile!(land.soil, lateral.subsurface, kv_profile, dt) update!(lateral.subsurface, network.land, clock.dt / basetimestep) update_after_subsurfaceflow!(model) update_total_water_storage!(model) @@ -443,9 +443,9 @@ Update SBM model until recharge for a single timestep. This function is also acc through BMI, to couple the SBM model to an external groundwater model. """ function update_until_recharge!(model::AbstractModel{<:SbmModel}) - (; lateral, vertical, network, clock, config) = model + (; lateral, land, network, clock, config) = model dt = tosecond(clock.dt) - update!(vertical, lateral, network, config, dt) + update!(land, lateral, network, config, dt) return nothing end @@ -456,8 +456,8 @@ Update SBM model after subsurface flow for a single timestep. This function is a accessible through BMI, to couple the SBM model to an external groundwater model. """ function update_after_subsurfaceflow!(model::AbstractModel{<:SbmModel}) - (; lateral, vertical) = model - (; soil, runoff, demand) = vertical + (; lateral, land) = model + (; soil, runoff, demand) = land (; subsurface) = lateral # update SBM soil model (runoff, ustorelayerdepth and satwaterdepth) @@ -474,12 +474,12 @@ Update of the total water storage at the end of each timestep per model cell. This is done here at model level. """ function update_total_water_storage!(model::AbstractModel{<:SbmModel}) - (; lateral, vertical, network) = model + (; lateral, land, network) = model - # Update the total water storage based on vertical states + # Update the total water storage based on land states # TODO Maybe look at routing in the near future update_total_water_storage!( - vertical, + land, network.river.land_indices, network.land.area, lateral.river, @@ -489,7 +489,7 @@ function update_total_water_storage!(model::AbstractModel{<:SbmModel}) end function set_states!(model::AbstractModel{<:Union{SbmModel, SbmGwfModel}}) - (; lateral, vertical, network, config) = model + (; lateral, land, network, config) = model land_v = lateral.land.variables land_p = lateral.land.parameters river_v = lateral.river.variables @@ -512,11 +512,11 @@ function set_states!(model::AbstractModel{<:Union{SbmModel, SbmGwfModel}}) zi = max.( 0.0, - vertical.soil.parameters.soilthickness .- - vertical.soil.variables.satwaterdepth ./ - (vertical.soil.parameters.theta_s .- vertical.soil.parameters.theta_r), + land.soil.parameters.soilthickness .- + land.soil.variables.satwaterdepth ./ + (land.soil.parameters.theta_s .- land.soil.parameters.theta_r), ) - vertical.soil.variables.zi .= zi + land.soil.variables.zi .= zi if land_routing == "kinematic-wave" # make sure land cells with zero flow width are set to zero q and h for i in eachindex(land_p.flow_width) diff --git a/src/sediment/erosion/overland_flow_erosion.jl b/src/sediment/erosion/overland_flow_erosion.jl index 879af50fd..c1d613912 100644 --- a/src/sediment/erosion/overland_flow_erosion.jl +++ b/src/sediment/erosion/overland_flow_erosion.jl @@ -37,7 +37,7 @@ function OverlandFlowErosionAnswersParameters(dataset, config, indices) usle_k = ncread( dataset, config, - "vertical.overland_flow_erosion.parameters.usle_k"; + "land.overland_flow_erosion.parameters.usle_k"; sel = indices, defaults = 0.1, type = Float, @@ -45,7 +45,7 @@ function OverlandFlowErosionAnswersParameters(dataset, config, indices) usle_c = ncread( dataset, config, - "vertical.overland_flow_erosion.parameters.usle_c"; + "land.overland_flow_erosion.parameters.usle_c"; sel = indices, defaults = 0.01, type = Float, @@ -53,7 +53,7 @@ function OverlandFlowErosionAnswersParameters(dataset, config, indices) answers_k = ncread( dataset, config, - "vertical.overland_flow_erosion.parameters.answers_k"; + "land.overland_flow_erosion.parameters.answers_k"; sel = indices, defaults = 0.9, type = Float, diff --git a/src/sediment/erosion/rainfall_erosion.jl b/src/sediment/erosion/rainfall_erosion.jl index 73016f874..02460567b 100644 --- a/src/sediment/erosion/rainfall_erosion.jl +++ b/src/sediment/erosion/rainfall_erosion.jl @@ -54,7 +54,7 @@ function RainfallErosionEurosemParameters(dataset, config, indices) soil_detachability = ncread( dataset, config, - "vertical.rainfall_erosion.parameters.soil_detachability"; + "land.rainfall_erosion.parameters.soil_detachability"; sel = indices, defaults = 0.6, type = Float, @@ -62,7 +62,7 @@ function RainfallErosionEurosemParameters(dataset, config, indices) eurosem_exponent = ncread( dataset, config, - "vertical.rainfall_erosion.parameters.eurosem_exponent"; + "land.rainfall_erosion.parameters.eurosem_exponent"; sel = indices, defaults = 2.0, type = Float, @@ -70,7 +70,7 @@ function RainfallErosionEurosemParameters(dataset, config, indices) canopyheight = ncread( dataset, config, - "vertical.rainfall_erosion.parameters.canopyheight"; + "land.rainfall_erosion.parameters.canopyheight"; sel = indices, defaults = 0.5, type = Float, @@ -78,7 +78,7 @@ function RainfallErosionEurosemParameters(dataset, config, indices) canopygapfraction = ncread( dataset, config, - "vertical.rainfall_erosion.parameters.canopygapfraction"; + "land.rainfall_erosion.parameters.canopygapfraction"; sel = indices, defaults = 0.1, type = Float, @@ -86,7 +86,7 @@ function RainfallErosionEurosemParameters(dataset, config, indices) soilcover_fraction = ncread( dataset, config, - "vertical.rainfall_erosion.parameters.pathfrac"; + "land.rainfall_erosion.parameters.pathfrac"; sel = indices, defaults = 0.01, type = Float, @@ -187,7 +187,7 @@ function RainfallErosionAnswersParameters(dataset, config, indices) usle_k = ncread( dataset, config, - "vertical.rainfall_erosion.parameters.usle_k"; + "land.rainfall_erosion.parameters.usle_k"; sel = indices, defaults = 0.1, type = Float, @@ -195,7 +195,7 @@ function RainfallErosionAnswersParameters(dataset, config, indices) usle_c = ncread( dataset, config, - "vertical.rainfall_erosion.parameters.usle_c"; + "land.rainfall_erosion.parameters.usle_c"; sel = indices, defaults = 0.01, type = Float, diff --git a/src/sediment/erosion/soil_erosion.jl b/src/sediment/erosion/soil_erosion.jl index 6578a0dbe..9186ee516 100644 --- a/src/sediment/erosion/soil_erosion.jl +++ b/src/sediment/erosion/soil_erosion.jl @@ -75,7 +75,7 @@ function SoilErosionParameters(dataset, config, indices) clay_fraction = ncread( dataset, config, - "vertical.soil_erosion.parameters.clay_fraction"; + "land.soil_erosion.parameters.clay_fraction"; sel = indices, defaults = 0.4, type = Float, @@ -83,7 +83,7 @@ function SoilErosionParameters(dataset, config, indices) silt_fraction = ncread( dataset, config, - "vertical.soil_erosion.parameters.silt_fraction"; + "land.soil_erosion.parameters.silt_fraction"; sel = indices, defaults = 0.3, type = Float, @@ -91,7 +91,7 @@ function SoilErosionParameters(dataset, config, indices) sand_fraction = ncread( dataset, config, - "vertical.soil_erosion.parameters.sand_fraction"; + "land.soil_erosion.parameters.sand_fraction"; sel = indices, defaults = 0.3, type = Float, @@ -99,7 +99,7 @@ function SoilErosionParameters(dataset, config, indices) sagg_fraction = ncread( dataset, config, - "vertical.soil_erosion.parameters.sagg_fraction"; + "land.soil_erosion.parameters.sagg_fraction"; sel = indices, defaults = 0.0, type = Float, @@ -107,7 +107,7 @@ function SoilErosionParameters(dataset, config, indices) lagg_fraction = ncread( dataset, config, - "vertical.soil_erosion.parameters.lagg_fraction"; + "land.soil_erosion.parameters.lagg_fraction"; sel = indices, defaults = 0.0, type = Float, diff --git a/src/sediment_model.jl b/src/sediment_model.jl index 39d72bcf0..7d15f0875 100644 --- a/src/sediment_model.jl +++ b/src/sediment_model.jl @@ -82,7 +82,7 @@ function initialize_sediment_model(config::Config) landslope = ncread( dataset, config, - "vertical.land_parameter_set.slope"; + "land.land_parameter_set.slope"; optional = false, sel = indices, type = Float, @@ -94,10 +94,8 @@ function initialize_sediment_model(config::Config) river_sediment = RiverSediment(dataset, config, indices_riv, waterbodies) - modelmap = ( - vertical = soilloss, - lateral = (land = overland_flow_sediment, river = river_sediment), - ) + modelmap = + (land = soilloss, lateral = (land = overland_flow_sediment, river = river_sediment)) indices_reverse = (land = rev_indices, river = rev_indices_riv) y_dataset = read_y_axis(dataset) x_dataset = read_x_axis(dataset) @@ -136,14 +134,14 @@ end "update sediment model for a single timestep" function update!(model::AbstractModel{<:SedimentModel}) - (; lateral, vertical, network, config, clock) = model + (; lateral, land, network, config, clock) = model dt = tosecond(clock.dt) # Soil erosion - update!(vertical, dt) + update!(land, dt) # Overland flow sediment transport - update!(lateral.land, vertical.soil_erosion, network.land, dt) + update!(lateral.land, land.soil_erosion, network.land, dt) # River sediment transport do_river = get(config.model, "run_river_model", false)::Bool diff --git a/src/snow/snow.jl b/src/snow/snow.jl index c67c54ea5..4f9a98f99 100644 --- a/src/snow/snow.jl +++ b/src/snow/snow.jl @@ -73,7 +73,7 @@ function SnowHbvParameters(dataset, config, indices, dt) ncread( dataset, config, - "vertical.snow.parameters.cfmax"; + "land.snow.parameters.cfmax"; sel = indices, defaults = 3.75653, type = Float, @@ -81,7 +81,7 @@ function SnowHbvParameters(dataset, config, indices, dt) tt = ncread( dataset, config, - "vertical.snow.parameters.tt"; + "land.snow.parameters.tt"; sel = indices, defaults = 0.0, type = Float, @@ -89,7 +89,7 @@ function SnowHbvParameters(dataset, config, indices, dt) tti = ncread( dataset, config, - "vertical.snow.parameters.tti"; + "land.snow.parameters.tti"; sel = indices, defaults = 1.0, type = Float, @@ -97,7 +97,7 @@ function SnowHbvParameters(dataset, config, indices, dt) ttm = ncread( dataset, config, - "vertical.snow.parameters.ttm"; + "land.snow.parameters.ttm"; sel = indices, defaults = 0.0, type = Float, @@ -105,7 +105,7 @@ function SnowHbvParameters(dataset, config, indices, dt) whc = ncread( dataset, config, - "vertical.snow.parameters.whc"; + "land.snow.parameters.whc"; sel = indices, defaults = 0.1, type = Float, diff --git a/src/soil/soil.jl b/src/soil/soil.jl index bdd649e9d..e42a4b1d7 100644 --- a/src/soil/soil.jl +++ b/src/soil/soil.jl @@ -211,7 +211,7 @@ function sbm_kv_profiles( sumlayers, dt, ) - kv_profile_type = get(config.input.vertical, "ksat_profile", "exponential")::String + kv_profile_type = get(config.input.land, "ksat_profile", "exponential")::String n = length(indices) if kv_profile_type == "exponential" kv_profile = KvExponential(kv_0, f) @@ -219,7 +219,7 @@ function sbm_kv_profiles( z_exp = ncread( dataset, config, - "vertical.soil.parameters.z_exp"; + "land.soil.parameters.z_exp"; optional = false, sel = indices, type = Float, @@ -231,14 +231,14 @@ function sbm_kv_profiles( ncread( dataset, config, - "vertical.soil.parameters.kv"; + "land.soil.parameters.kv"; sel = indices, defaults = 1000.0, type = Float, dimname = :layer, ) .* (dt / basetimestep) if size(kv, 1) != maxlayers - parname = param(config.input.vertical.soil.parameter, "kv") + parname = param(config.input.land.soil.parameter, "kv") size1 = size(kv, 1) error("$parname needs a layer dimension of size $maxlayers, but is $size1") end @@ -248,7 +248,7 @@ function sbm_kv_profiles( z_layered = ncread( dataset, config, - "vertical.soil.parameters.z_layered"; + "land.soil.parameters.z_layered"; optional = false, sel = indices, type = Float, @@ -356,7 +356,7 @@ function SbmSoilParameters(dataset, config, vegetation_parameter_set, indices, d ncread( dataset, config, - "vertical.soil.parameters.w_soil"; + "land.soil.parameters.w_soil"; sel = indices, defaults = 0.1125, type = Float, @@ -364,7 +364,7 @@ function SbmSoilParameters(dataset, config, vegetation_parameter_set, indices, d cf_soil = ncread( dataset, config, - "vertical.soil.parameters.cf_soil"; + "land.soil.parameters.cf_soil"; sel = indices, defaults = 0.038, type = Float, @@ -373,7 +373,7 @@ function SbmSoilParameters(dataset, config, vegetation_parameter_set, indices, d theta_s = ncread( dataset, config, - "vertical.soil.parameters.theta_s"; + "land.soil.parameters.theta_s"; sel = indices, defaults = 0.6, type = Float, @@ -381,7 +381,7 @@ function SbmSoilParameters(dataset, config, vegetation_parameter_set, indices, d theta_r = ncread( dataset, config, - "vertical.soil.parameters.theta_r"; + "land.soil.parameters.theta_r"; sel = indices, defaults = 0.01, type = Float, @@ -390,7 +390,7 @@ function SbmSoilParameters(dataset, config, vegetation_parameter_set, indices, d ncread( dataset, config, - "vertical.soil.parameters.kv_0"; + "land.soil.parameters.kv_0"; sel = indices, defaults = 3000.0, type = Float, @@ -398,7 +398,7 @@ function SbmSoilParameters(dataset, config, vegetation_parameter_set, indices, d f = ncread( dataset, config, - "vertical.soil.parameters.f"; + "land.soil.parameters.f"; sel = indices, defaults = 0.001, type = Float, @@ -406,7 +406,7 @@ function SbmSoilParameters(dataset, config, vegetation_parameter_set, indices, d hb = ncread( dataset, config, - "vertical.soil.parameters.hb"; + "land.soil.parameters.hb"; sel = indices, defaults = -10.0, type = Float, @@ -414,7 +414,7 @@ function SbmSoilParameters(dataset, config, vegetation_parameter_set, indices, d h1 = ncread( dataset, config, - "vertical.soil.parameters.h1"; + "land.soil.parameters.h1"; sel = indices, defaults = 0.0, type = Float, @@ -422,7 +422,7 @@ function SbmSoilParameters(dataset, config, vegetation_parameter_set, indices, d h2 = ncread( dataset, config, - "vertical.soil.parameters.h2"; + "land.soil.parameters.h2"; sel = indices, defaults = -100.0, type = Float, @@ -430,7 +430,7 @@ function SbmSoilParameters(dataset, config, vegetation_parameter_set, indices, d h3_high = ncread( dataset, config, - "vertical.soil.parameters.h3_high"; + "land.soil.parameters.h3_high"; sel = indices, defaults = -400.0, type = Float, @@ -438,7 +438,7 @@ function SbmSoilParameters(dataset, config, vegetation_parameter_set, indices, d h3_low = ncread( dataset, config, - "vertical.soil.parameters.h3_low"; + "land.soil.parameters.h3_low"; sel = indices, defaults = -1000.0, type = Float, @@ -446,7 +446,7 @@ function SbmSoilParameters(dataset, config, vegetation_parameter_set, indices, d h4 = ncread( dataset, config, - "vertical.soil.parameters.h4"; + "land.soil.parameters.h4"; sel = indices, defaults = -15849.0, type = Float, @@ -454,7 +454,7 @@ function SbmSoilParameters(dataset, config, vegetation_parameter_set, indices, d alpha_h1 = ncread( dataset, config, - "vertical.soil.parameters.alpha_h1"; + "land.soil.parameters.alpha_h1"; sel = indices, defaults = 1.0, type = Float, @@ -462,7 +462,7 @@ function SbmSoilParameters(dataset, config, vegetation_parameter_set, indices, d soilthickness = ncread( dataset, config, - "vertical.soil.parameters.soilthickness"; + "land.soil.parameters.soilthickness"; sel = indices, defaults = 2000.0, type = Float, @@ -471,7 +471,7 @@ function SbmSoilParameters(dataset, config, vegetation_parameter_set, indices, d ncread( dataset, config, - "vertical.soil.parameters.infiltcappath"; + "land.soil.parameters.infiltcappath"; sel = indices, defaults = 10.0, type = Float, @@ -480,7 +480,7 @@ function SbmSoilParameters(dataset, config, vegetation_parameter_set, indices, d ncread( dataset, config, - "vertical.soil.parameters.infiltcapsoil"; + "land.soil.parameters.infiltcapsoil"; sel = indices, defaults = 100.0, type = Float, @@ -489,7 +489,7 @@ function SbmSoilParameters(dataset, config, vegetation_parameter_set, indices, d ncread( dataset, config, - "vertical.soil.parameters.maxleakage"; + "land.soil.parameters.maxleakage"; sel = indices, defaults = 0.0, type = Float, @@ -498,28 +498,28 @@ function SbmSoilParameters(dataset, config, vegetation_parameter_set, indices, d c = ncread( dataset, config, - "vertical.soil.parameters.c"; + "land.soil.parameters.c"; sel = indices, defaults = 10.0, type = Float, dimname = :layer, ) if size(c, 1) != maxlayers - parname = param(config.input.vertical, "c") + parname = param(config.input.land, "c") size1 = size(c, 1) error("$parname needs a layer dimension of size $maxlayers, but is $size1") end kvfrac = ncread( dataset, config, - "vertical.soil.parameters.kvfrac"; + "land.soil.parameters.kvfrac"; sel = indices, defaults = 1.0, type = Float, dimname = :layer, ) if size(kvfrac, 1) != maxlayers - parname = param(config.input, "vertical.soil.parameters.kvfrac") + parname = param(config.input, "land.soil.parameters.kvfrac") size1 = size(kvfrac, 1) error("$parname needs a layer dimension of size $maxlayers, but is $size1") end @@ -527,7 +527,7 @@ function SbmSoilParameters(dataset, config, vegetation_parameter_set, indices, d pathfrac = ncread( dataset, config, - "vertical.soil.parameters.pathfrac"; + "land.soil.parameters.pathfrac"; sel = indices, defaults = 0.01, type = Float, @@ -537,7 +537,7 @@ function SbmSoilParameters(dataset, config, vegetation_parameter_set, indices, d rootdistpar = ncread( dataset, config, - "vertical.soil.parameters.rootdistpar"; + "land.soil.parameters.rootdistpar"; sel = indices, defaults = -500.0, type = Float, @@ -545,7 +545,7 @@ function SbmSoilParameters(dataset, config, vegetation_parameter_set, indices, d cap_hmax = ncread( dataset, config, - "vertical.soil.parameters.cap_hmax"; + "land.soil.parameters.cap_hmax"; sel = indices, defaults = 2000.0, type = Float, @@ -553,7 +553,7 @@ function SbmSoilParameters(dataset, config, vegetation_parameter_set, indices, d cap_n = ncread( dataset, config, - "vertical.soil.parameters.cap_n"; + "land.soil.parameters.cap_n"; sel = indices, defaults = 2.0, type = Float, @@ -565,12 +565,12 @@ function SbmSoilParameters(dataset, config, vegetation_parameter_set, indices, d if length(config_thicknesslayers) > 0 # root fraction read from dataset file, in case of multiple soil layers and TOML file - # includes "vertical.rootfraction" - if haskey(config.input.vertical.soil.parameters, "rootfraction") + # includes "land.rootfraction" + if haskey(config.input.land.soil.parameters, "rootfraction") rootfraction = ncread( dataset, config, - "vertical.soil.parameters.rootfraction"; + "land.soil.parameters.rootfraction"; sel = indices, optional = false, type = Float, diff --git a/src/states.jl b/src/states.jl index cc25adf5a..2b1d0efa2 100644 --- a/src/states.jl +++ b/src/states.jl @@ -207,19 +207,19 @@ function extract_required_states(config::Config) required_states = () # Add snow, glacier, interception and sbm soil states to dict required_states = - add_to_required_states(required_states, (:vertical, :snow, :variables), snow_states) + add_to_required_states(required_states, (:land, :snow, :variables), snow_states) required_states = add_to_required_states( required_states, - (:vertical, :glacier, :variables), + (:land, :glacier, :variables), glacier_states, ) required_states = add_to_required_states( required_states, - (:vertical, :interception, :variables), + (:land, :interception, :variables), interception_states, ) required_states = - add_to_required_states(required_states, (:vertical, :soil, :variables), soil_states) + add_to_required_states(required_states, (:land, :soil, :variables), soil_states) # Add subsurface states to dict if model_type == "sbm_gwf" key_entry = (:lateral, :subsurface, :flow, :aquifer, :variables) @@ -265,7 +265,7 @@ function extract_required_states(config::Config) # Add paddy states to dict required_states = add_to_required_states( required_states, - (:vertical, :demand, :paddy, :variables), + (:land, :demand, :paddy, :variables), paddy_states, ) return required_states diff --git a/src/surfacewater/runoff.jl b/src/surfacewater/runoff.jl index b53e55e5b..c19731407 100644 --- a/src/surfacewater/runoff.jl +++ b/src/surfacewater/runoff.jl @@ -39,7 +39,7 @@ function OpenWaterRunoffParameters(dataset, config, indices, riverfrac) waterfrac = ncread( dataset, config, - "vertical.runoff.parameters.waterfrac"; + "land.runoff.parameters.waterfrac"; sel = indices, defaults = 0.0, type = Float, diff --git a/src/utils.jl b/src/utils.jl index d14323362..5e6f7aea0 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -176,7 +176,7 @@ function set_states!(instate_path, model; type = nothing, dimname = nothing) end A = read_standardized(ds, ncname, dimensions) A = permutedims(A[sel, :]) - # note that this array is allowed to have missings, since not every vertical + # note that this array is allowed to have missings, since not every land # column is `maxlayers` layers deep if dimname == :layer A = replace!(A, missing => NaN) diff --git a/src/vegetation/canopy.jl b/src/vegetation/canopy.jl index 2ab44e7ce..d5aa489e8 100644 --- a/src/vegetation/canopy.jl +++ b/src/vegetation/canopy.jl @@ -43,7 +43,7 @@ function GashInterceptionModel(dataset, config, indices, vegetation_parameter_se e_r = ncread( dataset, config, - "vertical.interception.parameters.e_r"; + "land.interception.parameters.e_r"; sel = indices, defaults = 0.1, type = Float, diff --git a/test/bmi.jl b/test/bmi.jl index df56fcc42..13c419e23 100644 --- a/test/bmi.jl +++ b/test/bmi.jl @@ -20,8 +20,8 @@ tomlpath = joinpath(@__DIR__, "sbm_config.toml") @test BMI.get_input_item_count(model) == 202 @test BMI.get_output_item_count(model) == 202 to_check = [ - "vertical.soil.parameters.nlayers", - "vertical.soil.parameters.theta_r", + "land.soil.parameters.nlayers", + "land.soil.parameters.theta_r", "lateral.river.variables.q", "lateral.river.boundary_conditions.reservoir.variables.outflow", ] @@ -32,7 +32,7 @@ tomlpath = joinpath(@__DIR__, "sbm_config.toml") end @testset "variable information functions" begin - @test BMI.get_var_grid(model, "vertical.soil.parameters.theta_s") == 6 + @test BMI.get_var_grid(model, "land.soil.parameters.theta_s") == 6 @test BMI.get_var_grid(model, "lateral.river.variables.h") == 3 @test BMI.get_var_grid( model, @@ -46,7 +46,7 @@ tomlpath = joinpath(@__DIR__, "sbm_config.toml") model, "lateral.river.boundary_conditions.reservoir.boundary_conditions.inflow", ) == "$Float" - @test BMI.get_var_units(model, "vertical.soil.parameters.theta_s") == "-" + @test BMI.get_var_units(model, "land.soil.parameters.theta_s") == "-" @test BMI.get_var_itemsize(model, "lateral.subsurface.variables.ssf") == sizeof(Float) @test BMI.get_var_nbytes(model, "lateral.river.variables.q") == @@ -61,22 +61,22 @@ tomlpath = joinpath(@__DIR__, "sbm_config.toml") @testset "update and get and set functions" begin @test BMI.get_current_time(model) == 86400.0 - @test_throws ErrorException BMI.get_value_ptr(model, "vertical.") - dest = zeros(Float, size(model.vertical.soil.variables.zi)) - BMI.get_value(model, "vertical.soil.variables.zi", dest) + @test_throws ErrorException BMI.get_value_ptr(model, "land.") + dest = zeros(Float, size(model.land.soil.variables.zi)) + BMI.get_value(model, "land.soil.variables.zi", dest) @test mean(dest) ≈ 276.1625022866973 @test BMI.get_value_at_indices( model, - "vertical.soil.variables.vwc[1]", + "land.soil.variables.vwc[1]", zeros(Float, 3), [1, 2, 3], - ) ≈ getindex.(model.vertical.soil.variables.vwc, 1)[1:3] + ) ≈ getindex.(model.land.soil.variables.vwc, 1)[1:3] BMI.set_value_at_indices( model, - "vertical.soil.variables.vwc[2]", + "land.soil.variables.vwc[2]", [1, 2, 3], [0.10, 0.15, 0.20], - ) ≈ getindex.(model.vertical.soil.variables.vwc, 2)[1:3] + ) ≈ getindex.(model.land.soil.variables.vwc, 2)[1:3] @test BMI.get_value_at_indices( model, "lateral.river.variables.q", @@ -85,20 +85,20 @@ tomlpath = joinpath(@__DIR__, "sbm_config.toml") ) ≈ [0.6525631197206111, 7.493760826794606, 0.02319714614721354] BMI.set_value( model, - "vertical.soil.variables.zi", - fill(300.0, length(model.vertical.soil.variables.zi)), + "land.soil.variables.zi", + fill(300.0, length(model.land.soil.variables.zi)), ) @test mean( BMI.get_value( model, - "vertical.soil.variables.zi", - zeros(Float, size(model.vertical.soil.variables.zi)), + "land.soil.variables.zi", + zeros(Float, size(model.land.soil.variables.zi)), ), ) == 300.0 - BMI.set_value_at_indices(model, "vertical.soil.variables.zi", [1], [250.0]) + BMI.set_value_at_indices(model, "land.soil.variables.zi", [1], [250.0]) @test BMI.get_value_at_indices( model, - "vertical.soil.variables.zi", + "land.soil.variables.zi", zeros(Float, 2), [1, 2], ) == [250.0, 300.0] @@ -173,7 +173,7 @@ tomlpath = joinpath(@__DIR__, "sbm_config.toml") BMI.update(model; run = "sbm_until_recharge") @testset "recharge part of SBM" begin - sbm = model.vertical + sbm = model.land @test sbm.interception.variables.interception_rate[1] ≈ 0.32734913737568716f0 @test sbm.soil.variables.ustorelayerdepth[1][1] ≈ 0.0f0 @test sbm.snow.variables.snow_storage[1] ≈ 3.4847899611762876f0 @@ -196,7 +196,7 @@ tomlpath = joinpath(@__DIR__, "sbm_config.toml") BMI.update(model; run = "sbm_after_subsurfaceflow") @testset "SBM after subsurface flow" begin - sbm = model.vertical + sbm = model.land sub = model.lateral.subsurface @test sbm.interception.variables.interception_rate[1] ≈ 0.32734913737568716f0 @test sbm.soil.variables.ustorelayerdepth[1][1] ≈ 0.0f0 @@ -215,10 +215,10 @@ end @testset "BMI extension functions" begin model = BMI.initialize(Wflow.Model, tomlpath) @test Wflow.get_start_unix_time(model) == 9.466848e8 - satwaterdepth = mean(model.vertical.soil.variables.satwaterdepth) + satwaterdepth = mean(model.land.soil.variables.satwaterdepth) model.config.model.reinit = false Wflow.load_state(model) - @test satwaterdepth ≠ mean(model.vertical.soil.variables.satwaterdepth) + @test satwaterdepth ≠ mean(model.land.soil.variables.satwaterdepth) @test_logs ( :info, "Write output states to netCDF file `$(model.writer.state_nc_path)`.", diff --git a/test/io.jl b/test/io.jl index 744d952f2..8f7d57d22 100644 --- a/test/io.jl +++ b/test/io.jl @@ -21,26 +21,26 @@ config = Wflow.Config(tomlpath) @test config.endtime === DateTime(2000, 2) @test config.output.path == "output_moselle.nc" @test config.output isa Wflow.Config - @test collect(keys(config.output)) == ["lateral", "vertical", "path"] + @test collect(keys(config.output)) == ["land", "lateral", "path"] # theta_s can also be provided under the alias theta_s @test Wflow.get_alias( - config.input.vertical.soil.parameters, + config.input.land.soil.parameters, "theta_s", "theta_s", nothing, ) == "thetaS" - val = pop!(config.input.vertical.soil.parameters, "theta_s") - config.input.vertical.soil.parameters["theta_s"] = val + val = pop!(config.input.land.soil.parameters, "theta_s") + config.input.land.soil.parameters["theta_s"] = val @test Wflow.get_alias( - config.input.vertical.soil.parameters, + config.input.land.soil.parameters, "theta_s", "theta_s", nothing, ) == "thetaS" # modifiers can also be applied - kvconf = Wflow.get_alias(config.input.vertical.soil.parameters, "kv_0", "kv_0", nothing) + kvconf = Wflow.get_alias(config.input.land.soil.parameters, "kv_0", "kv_0", nothing) @test kvconf isa Wflow.Config ncname, modifier = Wflow.ncvar_name_modifier(kvconf; config = config) @test ncname === "KsatVer" @@ -197,7 +197,7 @@ model = Wflow.initialize_sbm_model(config) Wflow.advance!(model.clock) Wflow.load_dynamic_input!(model) -(; vertical, clock, reader, writer) = model +(; land, clock, reader, writer) = model @testset "output and state names" begin ncdims = ("lon", "lat", "layer", "time") @@ -217,15 +217,14 @@ end model, "lateral.river.boundary_conditions.reservoir.variables.volume", )[1] ≈ 3.2807224993363418e7 - @test Wflow.param(model, "vertical.soil.variables.satwaterdepth")[9115] ≈ - 477.13548089422125 - @test Wflow.param(model, "vertical.snow.variables.snow_storage")[5] ≈ 11.019233179897599 - @test Wflow.param(model, "vertical.soil.variables.tsoil")[5] ≈ 0.21814478119608938 - @test Wflow.param(model, "vertical.soil.variables.ustorelayerdepth")[50063][1] ≈ + @test Wflow.param(model, "land.soil.variables.satwaterdepth")[9115] ≈ 477.13548089422125 + @test Wflow.param(model, "land.snow.variables.snow_storage")[5] ≈ 11.019233179897599 + @test Wflow.param(model, "land.soil.variables.tsoil")[5] ≈ 0.21814478119608938 + @test Wflow.param(model, "land.soil.variables.ustorelayerdepth")[50063][1] ≈ 9.969116007201725 - @test Wflow.param(model, "vertical.snow.variables.snow_water")[5] ≈ 0.0 - @test Wflow.param(model, "vertical.interception.variables.canopy_storage")[50063] ≈ 0.0 - @test Wflow.param(model, "vertical.soil.variables.zi")[50063] ≈ 296.8028609104624 + @test Wflow.param(model, "land.snow.variables.snow_water")[5] ≈ 0.0 + @test Wflow.param(model, "land.interception.variables.canopy_storage")[50063] ≈ 0.0 + @test Wflow.param(model, "land.soil.variables.zi")[50063] ≈ 296.8028609104624 @test Wflow.param(model, "lateral.subsurface.variables.ssf")[10606] ≈ 39.972334552895816 @test Wflow.param(model, "lateral.river.variables.q")[149] ≈ 53.48673634956338 @test Wflow.param(model, "lateral.river.variables.h")[149] ≈ 1.167635369628945 @@ -258,23 +257,23 @@ end end @testset "initial parameter values" begin - (; vertical) = model - @test vertical.snow.parameters.cfmax[1] ≈ 3.7565300464630127 - @test vertical.soil.parameters.soilthickness[1] ≈ 2000.0 - @test vertical.atmospheric_forcing.precipitation[49951] ≈ 2.2100000381469727 - @test vertical.soil.parameters.c[1] ≈ + (; land) = model + @test land.snow.parameters.cfmax[1] ≈ 3.7565300464630127 + @test land.soil.parameters.soilthickness[1] ≈ 2000.0 + @test land.atmospheric_forcing.precipitation[49951] ≈ 2.2100000381469727 + @test land.soil.parameters.c[1] ≈ [9.152995289601465, 8.919674421902961, 8.70537452585209, 8.690681062890977] end -config.input.vertical.snow.parameters.cfmax = Dict("value" => 2.0) -config.input.vertical.soil.parameters.soilthickness = Dict( +config.input.land.snow.parameters.cfmax = Dict("value" => 2.0) +config.input.land.soil.parameters.soilthickness = Dict( "scale" => 3.0, "offset" => 100.0, "netcdf" => Dict("variable" => Dict("name" => "SoilThickness")), ) -config.input.vertical.atmospheric_forcing.precipitation = +config.input.land.atmospheric_forcing.precipitation = Dict("scale" => 1.5, "netcdf" => Dict("variable" => Dict("name" => "precip"))) -config.input.vertical.soil.parameters.c = Dict( +config.input.land.soil.parameters.c = Dict( "scale" => [2.0, 3.0], "offset" => [0.0, 0.0], "layer" => [1, 3], @@ -286,11 +285,11 @@ Wflow.advance!(model.clock) Wflow.load_dynamic_input!(model) @testset "changed parameter values" begin - (; vertical) = model - @test vertical.snow.parameters.cfmax[1] == 2.0 - @test vertical.soil.parameters.soilthickness[1] ≈ 2000.0 * 3.0 + 100.0 - @test vertical.atmospheric_forcing.precipitation[49951] ≈ 1.5 * 2.2100000381469727 - @test vertical.soil.parameters.c[1] ≈ [ + (; land) = model + @test land.snow.parameters.cfmax[1] == 2.0 + @test land.soil.parameters.soilthickness[1] ≈ 2000.0 * 3.0 + 100.0 + @test land.atmospheric_forcing.precipitation[49951] ≈ 1.5 * 2.2100000381469727 + @test land.soil.parameters.c[1] ≈ [ 2.0 * 9.152995289601465, 8.919674421902961, 3.0 * 8.70537452585209, @@ -453,9 +452,9 @@ end # Extracting required states and test if some are covered (not all are tested!) required_states = Wflow.extract_required_states(config) - @test (:vertical, :soil, :variables, :satwaterdepth) in required_states - @test (:vertical, :soil, :variables, :ustorelayerdepth) in required_states - @test (:vertical, :interception, :variables, :canopy_storage) in required_states + @test (:land, :soil, :variables, :satwaterdepth) in required_states + @test (:land, :soil, :variables, :ustorelayerdepth) in required_states + @test (:land, :interception, :variables, :canopy_storage) in required_states @test (:lateral, :subsurface, :variables, :ssf) in required_states @test (:lateral, :river, :variables, :q) in required_states @test (:lateral, :river, :variables, :h_av) in required_states @@ -466,27 +465,27 @@ end ) # Adding an unused state the see if the right warning message is thrown - config.state.vertical.soil.variables.additional_state = "additional_state" + config.state.land.soil.variables.additional_state = "additional_state" @test_logs ( :warn, string( - "State variable `(:vertical, :soil, :variables, :additional_state)` provided, but is not used in ", + "State variable `(:land, :soil, :variables, :additional_state)` provided, but is not used in ", "model setup, skipping.", ), ) Wflow.check_states(config) # Removing the unused and required state, to test the exception being thrown - delete!(config.state.vertical.soil["variables"], "additional_state") - delete!(config.state.vertical.snow["variables"], "snow_storage") + delete!(config.state.land.soil["variables"], "additional_state") + delete!(config.state.land.snow["variables"], "snow_storage") @test_throws ArgumentError Wflow.check_states(config) # Extracting required states for model type sbm_gwf and test if some are covered tomlpath = joinpath(@__DIR__, "sbm_gwf_config.toml") config = Wflow.Config(tomlpath) required_states = Wflow.extract_required_states(config) - @test (:vertical, :soil, :variables, :satwaterdepth) in required_states - @test (:vertical, :soil, :variables, :ustorelayerdepth) in required_states - @test (:vertical, :interception, :variables, :canopy_storage) in required_states + @test (:land, :soil, :variables, :satwaterdepth) in required_states + @test (:land, :soil, :variables, :ustorelayerdepth) in required_states + @test (:land, :interception, :variables, :canopy_storage) in required_states @test (:lateral, :subsurface, :flow, :aquifer, :variables, :head) in required_states @test (:lateral, :river, :variables, :q) in required_states @test (:lateral, :river, :variables, :h_av) in required_states diff --git a/test/run_sbm.jl b/test/run_sbm.jl index 282c5bc2d..01af31fbe 100644 --- a/test/run_sbm.jl +++ b/test/run_sbm.jl @@ -69,8 +69,8 @@ end end @testset "first timestep" begin - sbm = model.vertical.soil - snow = model.vertical.snow + sbm = model.land.soil + snow = model.land.snow @test snow.parameters.tt[50063] ≈ 0.0f0 @test model.clock.iteration == 1 @@ -91,8 +91,8 @@ end Wflow.run_timestep!(model) @testset "second timestep" begin - sbm = model.vertical.soil - snow = model.vertical.snow + sbm = model.land.soil + snow = model.land.snow @test sbm.parameters.theta_s[50063] ≈ 0.48755401372909546f0 @test sbm.parameters.theta_r[50063] ≈ 0.15943120419979095f0 @test mean(sbm.variables.net_runoff) ≈ 0.23734052031823816f0 @@ -140,9 +140,9 @@ end end # set these variables for comparison in "changed dynamic parameters" -precip = copy(model.vertical.atmospheric_forcing.precipitation) -evap = copy(model.vertical.atmospheric_forcing.potential_evaporation) -lai = copy(model.vertical.vegetation_parameter_set.leaf_area_index) +precip = copy(model.land.atmospheric_forcing.precipitation) +evap = copy(model.land.atmospheric_forcing.potential_evaporation) +lai = copy(model.land.vegetation_parameter_set.leaf_area_index) res_evap = copy(model.lateral.river.boundary_conditions.reservoir.boundary_conditions.evaporation) @@ -178,14 +178,14 @@ end tomlpath = joinpath(@__DIR__, "sbm_config.toml") config = Wflow.Config(tomlpath) -config.input.vertical.atmospheric_forcing.precipitation = +config.input.land.atmospheric_forcing.precipitation = Dict("scale" => 2.0, "netcdf" => Dict("variable" => Dict("name" => "precip"))) -config.input.vertical.atmospheric_forcing.potential_evaporation = Dict( +config.input.land.atmospheric_forcing.potential_evaporation = Dict( "scale" => 3.0, "offset" => 1.50, "netcdf" => Dict("variable" => Dict("name" => "pet")), ) -config.input.vertical.vegetation_parameter_set.leaf_area_index = +config.input.land.vegetation_parameter_set.leaf_area_index = Dict("scale" => 1.6, "netcdf" => Dict("variable" => Dict("name" => "LAI"))) model = Wflow.initialize_sbm_model(config) @@ -194,11 +194,10 @@ Wflow.run_timestep!(model) @testset "changed dynamic parameters" begin res = model.lateral.river.boundary_conditions.reservoir - vertical = model.vertical - @test vertical.atmospheric_forcing.precipitation[2] / precip[2] ≈ 2.0f0 - @test (vertical.atmospheric_forcing.potential_evaporation[100] - 1.50) / evap[100] ≈ - 3.0f0 - @test vertical.vegetation_parameter_set.leaf_area_index[100] / lai[100] ≈ 1.6f0 + land = model.land + @test land.atmospheric_forcing.precipitation[2] / precip[2] ≈ 2.0f0 + @test (land.atmospheric_forcing.potential_evaporation[100] - 1.50) / evap[100] ≈ 3.0f0 + @test land.vegetation_parameter_set.leaf_area_index[100] / lai[100] ≈ 1.6f0 @test (res.boundary_conditions.evaporation[2] - 1.50) / res_evap[2] ≈ 3.0000012203408635f0 end @@ -208,7 +207,7 @@ tomlpath = joinpath(@__DIR__, "sbm_config.toml") config = Wflow.Config(tomlpath) config.input.cyclic = [ - "vertical.vegetation_parameter_set.leaf_area_index", + "land.vegetation_parameter_set.leaf_area_index", "lateral.river.boundary_conditions.inflow", ] Dict(config.input.lateral.river)["boundary_conditions"] = Dict("inflow" => "inflow") @@ -224,13 +223,13 @@ end # test fixed forcing (precipitation = 2.5) config = Wflow.Config(tomlpath) -config.input.vertical.atmospheric_forcing.precipitation = Dict("value" => 2.5) +config.input.land.atmospheric_forcing.precipitation = Dict("value" => 2.5) model = Wflow.initialize_sbm_model(config) Wflow.load_fixed_forcing!(model) @testset "fixed precipitation forcing (initialize)" begin - @test maximum(model.vertical.atmospheric_forcing.precipitation) ≈ 2.5 - @test minimum(model.vertical.atmospheric_forcing.precipitation) ≈ 0.0 + @test maximum(model.land.atmospheric_forcing.precipitation) ≈ 2.5 + @test minimum(model.land.atmospheric_forcing.precipitation) ≈ 0.0 @test all( isapprox.( model.lateral.river.boundary_conditions.reservoir.boundary_conditions.precipitation, @@ -242,8 +241,8 @@ end Wflow.run_timestep!(model) @testset "fixed precipitation forcing (first timestep)" begin - @test maximum(model.vertical.atmospheric_forcing.precipitation) ≈ 2.5 - @test minimum(model.vertical.atmospheric_forcing.precipitation) ≈ 0.0 + @test maximum(model.land.atmospheric_forcing.precipitation) ≈ 2.5 + @test minimum(model.land.atmospheric_forcing.precipitation) ≈ 0.0 @test all( isapprox.( model.lateral.river.boundary_conditions.reservoir.boundary_conditions.precipitation, @@ -458,13 +457,13 @@ Wflow.close_files(model; delete_output = false) i = 100 tomlpath = joinpath(@__DIR__, "sbm_config.toml") config = Wflow.Config(tomlpath) - config.input.vertical.soil.parameters.kv = "kv" - config.input.vertical.soil.parameters.z_exp = Dict("value" => 400.0) - config.input.vertical.soil.parameters.z_layered = Dict("value" => 400.0) + config.input.land.soil.parameters.kv = "kv" + config.input.land.soil.parameters.z_exp = Dict("value" => 400.0) + config.input.land.soil.parameters.z_layered = Dict("value" => 400.0) @testset "exponential profile" begin model = Wflow.initialize_sbm_model(config) - (; soil) = model.vertical + (; soil) = model.land (; kv_profile) = soil.parameters (; subsurface) = model.lateral z = soil.variables.zi[i] @@ -476,9 +475,9 @@ Wflow.close_files(model; delete_output = false) end @testset "exponential constant profile" begin - config.input.vertical.ksat_profile = "exponential_constant" + config.input.land.ksat_profile = "exponential_constant" model = Wflow.initialize_sbm_model(config) - (; soil) = model.vertical + (; soil) = model.land (; kv_profile) = soil.parameters (; subsurface) = model.lateral z = soil.variables.zi[i] @@ -497,9 +496,9 @@ Wflow.close_files(model; delete_output = false) end @testset "layered profile" begin - config.input.vertical.ksat_profile = "layered" + config.input.land.ksat_profile = "layered" model = Wflow.initialize_sbm_model(config) - (; soil) = model.vertical + (; soil) = model.land (; kv_profile) = soil.parameters (; subsurface) = model.lateral z = soil.variables.zi[i] @@ -513,9 +512,9 @@ Wflow.close_files(model; delete_output = false) end @testset "layered exponential profile" begin - config.input.vertical.ksat_profile = "layered_exponential" + config.input.land.ksat_profile = "layered_exponential" model = Wflow.initialize_sbm_model(config) - (; soil) = model.vertical + (; soil) = model.land (; kv_profile) = soil.parameters (; subsurface) = model.lateral z = soil.variables.zi[i] diff --git a/test/run_sbm_gwf.jl b/test/run_sbm_gwf.jl index 81038ed5a..a686bc8c5 100644 --- a/test/run_sbm_gwf.jl +++ b/test/run_sbm_gwf.jl @@ -18,7 +18,7 @@ flush(model.writer.csv_io) # ensure the buffer is written fully to disk end @testset "first timestep" begin - sbm = model.vertical + sbm = model.land @test model.clock.iteration == 1 @test sbm.soil.parameters.theta_s[1] ≈ 0.44999998807907104f0 @@ -31,7 +31,7 @@ end Wflow.run_timestep!(model) @testset "second timestep" begin - sbm = model.vertical + sbm = model.land @test sbm.soil.parameters.theta_s[1] ≈ 0.44999998807907104f0 @test sbm.soil.variables.runoff[1] == 0.0 @test sbm.soil.variables.soilevap[1] == 0.0 @@ -150,7 +150,7 @@ Wflow.run_timestep!(model) Wflow.run_timestep!(model) @testset "second timestep warm start" begin - sbm = model.vertical + sbm = model.land @test sbm.soil.variables.runoff[1] == 0.0 @test sbm.soil.variables.soilevap[1] ≈ 0.2889306511074693f0 @test sbm.soil.variables.transpiration[1] ≈ 0.8370726722706481f0 diff --git a/test/run_sbm_gwf_piave.jl b/test/run_sbm_gwf_piave.jl index 28e31a415..46e1ac73a 100644 --- a/test/run_sbm_gwf_piave.jl +++ b/test/run_sbm_gwf_piave.jl @@ -3,9 +3,9 @@ config = Wflow.Config(tomlpath) model = Wflow.initialize_sbm_gwf_model(config) Wflow.run_timestep!(model) -(; paddy, nonpaddy, industry, livestock, domestic) = model.vertical.demand +(; paddy, nonpaddy, industry, livestock, domestic) = model.land.demand (; total_alloc, irri_alloc, nonirri_alloc, surfacewater_alloc, act_groundwater_abst) = - model.vertical.allocation.variables + model.land.allocation.variables @testset "piave water demand and allocation first timestep" begin sum_total_alloc = sum(total_alloc) @test sum(irri_alloc) + sum(nonirri_alloc) ≈ sum_total_alloc @@ -35,9 +35,9 @@ Wflow.run_timestep!(model) end Wflow.run_timestep!(model) -(; paddy, nonpaddy, industry, livestock, domestic) = model.vertical.demand +(; paddy, nonpaddy, industry, livestock, domestic) = model.land.demand (; total_alloc, irri_alloc, nonirri_alloc, surfacewater_alloc, act_groundwater_abst) = - model.vertical.allocation.variables + model.land.allocation.variables @testset "piave water demand and allocation second timestep" begin sum_total_alloc = sum(total_alloc) diff --git a/test/run_sbm_piave.jl b/test/run_sbm_piave.jl index ac666bd0a..b10368456 100644 --- a/test/run_sbm_piave.jl +++ b/test/run_sbm_piave.jl @@ -104,8 +104,8 @@ tomlpath = joinpath(@__DIR__, "sbm_piave_demand_config.toml") config = Wflow.Config(tomlpath) model = Wflow.initialize_sbm_model(config) Wflow.run_timestep!(model) -sbm = model.vertical -(; paddy, nonpaddy, industry, livestock, domestic) = model.vertical.demand +sbm = model.land +(; paddy, nonpaddy, industry, livestock, domestic) = model.land.demand (; total_alloc, irri_alloc, nonirri_alloc, surfacewater_alloc, act_groundwater_abst) = sbm.allocation.variables @@ -138,8 +138,8 @@ sbm = model.vertical end Wflow.run_timestep!(model) -sbm = model.vertical -(; paddy, nonpaddy, industry, livestock, domestic) = model.vertical.demand +sbm = model.land +(; paddy, nonpaddy, industry, livestock, domestic) = model.land.demand (; total_alloc, irri_alloc, nonirri_alloc, surfacewater_alloc, act_groundwater_abst) = sbm.allocation.variables @testset "piave water demand and allocation second timestep" begin diff --git a/test/run_sediment.jl b/test/run_sediment.jl index 603642e23..149be425a 100644 --- a/test/run_sediment.jl +++ b/test/run_sediment.jl @@ -8,8 +8,8 @@ model = Wflow.initialize_sediment_model(config) Wflow.run_timestep!(model) -@testset "first timestep sediment model (vertical)" begin - eros = model.vertical +@testset "first timestep sediment model (land part)" begin + eros = model.land @test eros.atmospheric_forcing.precipitation[1] ≈ 4.086122035980225f0 @test eros.hydrological_forcing.q_land[1] ≈ 0.0f0 @@ -27,8 +27,8 @@ end # run the second timestep Wflow.run_timestep!(model) -@testset "second timestep sediment model (vertical)" begin - eros = model.vertical +@testset "second timestep sediment model (land part)" begin + eros = model.land @test mean(eros.soil_erosion.variables.amount) ≈ 0.07765800489746684f0 @test mean(eros.soil_erosion.variables.clay) ≈ 0.002287480354866626f0 @@ -89,8 +89,8 @@ model = Wflow.initialize_sediment_model(config) Wflow.run_timestep!(model) -@testset "first timestep sediment model eurosem (vertical)" begin - eros = model.vertical +@testset "first timestep sediment model eurosem (land part)" begin + eros = model.land @test eros.atmospheric_forcing.precipitation[1] ≈ 4.086122035980225f0 @test eros.hydrological_forcing.interception[1] ≈ 0.6329902410507202f0 @@ -138,7 +138,7 @@ Wflow.run_timestep!(model) Wflow.run_timestep!(model) @testset "second timestep sediment model govers" begin - eros = model.vertical + eros = model.land land = model.lateral.land @test mean(eros.soil_erosion.variables.amount) ≈ 0.0776983847440198f0 @@ -164,7 +164,7 @@ Wflow.run_timestep!(model) Wflow.run_timestep!(model) @testset "second timestep sediment model yalin" begin - eros = model.vertical + eros = model.land land = model.lateral.land @test mean(eros.soil_erosion.variables.amount) ≈ 0.0776983847440198f0 diff --git a/test/sbm_config.toml b/test/sbm_config.toml index 9e805a61f..36ffb73e0 100644 --- a/test/sbm_config.toml +++ b/test/sbm_config.toml @@ -19,15 +19,15 @@ path_output = "outstates-moselle.nc" # if listed, the variable must be present in the NetCDF or error # if not listed, the variable can get a default value if it has one -[state.vertical.interception.variables] +[state.land.interception.variables] canopy_storage = "canopystorage" -[state.vertical.soil.variables] +[state.land.soil.variables] satwaterdepth = "satwaterdepth" tsoil = "tsoil" ustorelayerdepth = "ustorelayerdepth" -[state.vertical.snow.variables] +[state.land.snow.variables] snow_storage = "snow" snow_water = "snowwater" @@ -60,32 +60,32 @@ subcatchment = "wflow_subcatch" # specify the internal IDs of the parameters which vary over time # the external name mapping needs to be below together with the other mappings forcing = [ - "vertical.atmospheric_forcing.precipitation", - "vertical.atmospheric_forcing.temperature", - "vertical.atmospheric_forcing.potential_evaporation", + "land.atmospheric_forcing.precipitation", + "land.atmospheric_forcing.temperature", + "land.atmospheric_forcing.potential_evaporation", ] -cyclic = ["vertical.vegetation_parameter_set.leaf_area_index"] +cyclic = ["land.vegetation_parameter_set.leaf_area_index"] -[input.vertical.vegetation_parameter_set] +[input.land.vegetation_parameter_set] leaf_area_index = "LAI" kext = "Kext" storage_specific_leaf = "Sl" storage_wood = "Swood" rootingdepth = "RootingDepth" -[input.vertical.runoff.parameters] +[input.land.runoff.parameters] waterfrac = "WaterFrac" -[input.vertical.interception.parameters] +[input.land.interception.parameters] e_r = "EoverR" -[input.vertical.atmospheric_forcing] +[input.land.atmospheric_forcing] potential_evaporation = "pet" precipitation = "precip" temperature = "temp" -[input.vertical.soil.parameters] +[input.land.soil.parameters] c = "c" cf_soil = "cf_soil" f = "f" @@ -99,13 +99,13 @@ pathfrac = "PathFrac" rootdistpar = "rootdistpar" soilthickness = "SoilThickness" -[input.vertical.snow.parameters] +[input.land.snow.parameters] tt = "TT" tti = "TTI" ttm = "TTM" cfmax = "Cfmax" -[input.vertical.soil.parameters.kv_0] +[input.land.soil.parameters.kv_0] netcdf.variable.name = "KsatVer" scale = 1.0 offset = 0.0 @@ -149,15 +149,15 @@ min_streamorder_land = 5 [output] path = "output_moselle.nc" -[output.vertical.interception.variables] +[output.land.interception.variables] canopy_storage = "canopystorage" -[output.vertical.soil.variables] +[output.land.soil.variables] satwaterdepth = "satwaterdepth" tsoil = "tsoil" ustorelayerdepth = "ustorelayerdepth" -[output.vertical.snow.variables] +[output.land.snow.variables] snow_storage = "snow" snow_water = "snowwater" @@ -188,14 +188,14 @@ coordinate.x = 6.255 coordinate.y = 50.012 name = "temp_coord" location = "temp_bycoord" -parameter = "vertical.atmospheric_forcing.temperature" +parameter = "land.atmospheric_forcing.temperature" [[netcdf.variable]] location = "temp_byindex" name = "temp_index" index.x = 100 index.y = 264 -parameter = "vertical.atmospheric_forcing.temperature" +parameter = "land.atmospheric_forcing.temperature" [csv] path = "output_moselle.csv" @@ -214,20 +214,20 @@ parameter = "lateral.river.boundary_conditions.reservoir.variables.volume" coordinate.x = 6.255 coordinate.y = 50.012 header = "temp_bycoord" -parameter = "vertical.atmospheric_forcing.temperature" +parameter = "land.atmospheric_forcing.temperature" [[csv.column]] coordinate.x = 6.255 coordinate.y = 50.012 header = "vwc_layer2_bycoord" -parameter = "vertical.soil.variables.vwc" +parameter = "land.soil.variables.vwc" layer = 2 [[csv.column]] header = "temp_byindex" index.x = 100 index.y = 264 -parameter = "vertical.atmospheric_forcing.temperature" +parameter = "land.atmospheric_forcing.temperature" [[csv.column]] header = "Q" @@ -237,24 +237,24 @@ parameter = "lateral.river.variables.q" [[csv.column]] header = "recharge" map = "subcatchment" -parameter = "vertical.soil.variables.recharge" +parameter = "land.soil.variables.recharge" reducer = "mean" [API] components = [ - "vertical.atmospheric_forcing", - "vertical.vegetation_parameter_set", - "vertical.runoff.boundary_conditions", - "vertical.runoff.variables", - "vertical.runoff.parameters", - "vertical.soil.boundary_conditions", - "vertical.soil.variables", - "vertical.soil.parameters", - "vertical.interception.variables", - "vertical.interception.parameters", - "vertical.snow.boundary_conditions", - "vertical.snow.variables", - "vertical.snow.parameters", + "land.atmospheric_forcing", + "land.vegetation_parameter_set", + "land.runoff.boundary_conditions", + "land.runoff.variables", + "land.runoff.parameters", + "land.soil.boundary_conditions", + "land.soil.variables", + "land.soil.parameters", + "land.interception.variables", + "land.interception.parameters", + "land.snow.boundary_conditions", + "land.snow.variables", + "land.snow.parameters", "lateral.subsurface.boundary_conditions", "lateral.subsurface.variables", "lateral.subsurface.parameters", diff --git a/test/sbm_gw.toml b/test/sbm_gw.toml index fe5a00757..ceed4c9d3 100644 --- a/test/sbm_gw.toml +++ b/test/sbm_gw.toml @@ -18,15 +18,15 @@ path_output = "outstates-moselle.nc" # if listed, the variable must be present in the NetCDF or error # if not listed, the variable can get a default value if it has one -[state.vertical.interception.variables] +[state.land.interception.variables] canopy_storage = "canopystorage" -[state.vertical.soil.variables] +[state.land.soil.variables] satwaterdepth = "satwaterdepth" tsoil = "tsoil" ustorelayerdepth = "ustorelayerdepth" -[state.vertical.snow.variables] +[state.land.snow.variables] snow_storage = "snow" snow_water = "snowwater" @@ -56,29 +56,29 @@ subcatchment = "wflow_subcatch" # specify the internal IDs of the parameters which vary over time # the external name mapping needs to be below together with the other mappings forcing = [ - "vertical.atmospheric_forcing.precipitation", - "vertical.atmospheric_forcing.temperature", - "vertical.atmospheric_forcing.potential_evaporation", + "land.atmospheric_forcing.precipitation", + "land.atmospheric_forcing.temperature", + "land.atmospheric_forcing.potential_evaporation", ] -cyclic = ["vertical.vegetation_parameter_set.leaf_area_index"] +cyclic = ["land.vegetation_parameter_set.leaf_area_index"] -[input.vertical.atmospheric_forcing] +[input.land.atmospheric_forcing] potential_evaporation = "pet" precipitation = "precip" temperature = "temp" -[input.vertical.vegetation_parameter_set] +[input.land.vegetation_parameter_set] leaf_area_index = "LAI" kext = "Kext" storage_specific_leaf = "Sl" storage_wood = "Swood" rootingdepth = "RootingDepth" -[input.vertical.runoff.parameters] +[input.land.runoff.parameters] waterfrac = "WaterFrac" -[input.vertical.soil.parameters] +[input.land.soil.parameters] c = "c" cf_soil = "cf_soil" cfmax = "Cfmax" @@ -95,7 +95,7 @@ soilthickness = "SoilThickness" theta_r = "thetaR" theta_s = "thetaS" -[input.vertical.snow.parameters] +[input.land.snow.parameters] tt = "TT" tti = "TTI" ttm = "TTM" @@ -132,15 +132,15 @@ type = "sbm" [output] path = "output_moselle.nc" -[output.vertical.interception.variables] +[output.land.interception.variables] canopy_storage = "canopystorage" -[output.vertical.soil.variables] +[output.land.soil.variables] satwaterdepth = "satwaterdepth" tsoil = "tsoil" ustorelayerdepth = "ustorelayerdepth" -[output.vertical.snow.variables] +[output.land.snow.variables] snow_storage = "snow" snow_water = "snowwater" @@ -168,14 +168,14 @@ coordinate.x = 6.255 coordinate.y = 50.012 name = "temp_coord" location = "temp_bycoord" -parameter = "vertical.atmospheric_forcing.temperature" +parameter = "land.atmospheric_forcing.temperature" [[netcdf.variable]] location = "temp_byindex" name = "temp_index" index.x = 100 index.y = 264 -parameter = "vertical.atmospheric_forcing.temperature" +parameter = "land.atmospheric_forcing.temperature" [csv] path = "output_moselle.csv" @@ -194,13 +194,13 @@ parameter = "lateral.river.boundary_conditions.reservoir.variables.volume" coordinate.x = 6.255 coordinate.y = 50.012 header = "temp_bycoord" -parameter = "vertical.atmospheric_forcing.temperature" +parameter = "land.atmospheric_forcing.temperature" [[csv.column]] header = "temp_byindex" index.x = 100 index.y = 264 -parameter = "vertical.atmospheric_forcing.temperature" +parameter = "land.atmospheric_forcing.temperature" [[csv.column]] header = "Q" @@ -210,13 +210,13 @@ parameter = "lateral.river.variables.q" [[csv.column]] header = "recharge" map = "subcatchment" -parameter = "vertical.soil.variables.recharge" +parameter = "land.soil.variables.recharge" reducer = "mean" [API] components = [ - "vertical.variables", - "vertical.parameters", + "land.variables", + "land.parameters", "lateral.subsurface.variables", "lateral.subsurface.parameters", "lateral.land.variables", diff --git a/test/sbm_gwf_config.toml b/test/sbm_gwf_config.toml index c917b409f..403f504e4 100644 --- a/test/sbm_gwf_config.toml +++ b/test/sbm_gwf_config.toml @@ -18,10 +18,10 @@ path_output = "outstates-example-sbm-gwf.nc" # if listed, the variable must be present in the NetCDF or error # if not listed, the variable can get a default value if it has one -[state.vertical.interception.variables] +[state.land.interception.variables] canopy_storage = "canopystorage" -[state.vertical.soil.variables] +[state.land.soil.variables] satwaterdepth = "satwaterdepth" ustorelayerdepth = "ustorelayerdepth" @@ -51,23 +51,23 @@ altitude = "wflow_dem" # specify the internal IDs of the parameters which vary over time # the external name mapping needs to be below together with the other mappings forcing = [ - "vertical.atmospheric_forcing.precipitation", - "vertical.atmospheric_forcing.potential_evaporation", + "land.atmospheric_forcing.precipitation", + "land.atmospheric_forcing.potential_evaporation", ] -[input.vertical.vegetation_parameter_set] +[input.land.vegetation_parameter_set] rootingdepth = "rootingdepth" canopygapfraction = "canopygapfraction" cmax = "cmax" -[input.vertical.interception.parameters] +[input.land.interception.parameters] e_r = "EoverR" -[input.vertical.atmospheric_forcing] +[input.land.atmospheric_forcing] potential_evaporation = "PET" precipitation = "P" -[input.vertical.soil.parameters] +[input.land.soil.parameters] infiltcapsoil = "InfiltCapSoil" kv_0 = "kv" pathfrac = "PathFrac" @@ -109,14 +109,14 @@ type = "sbm_gwf" [output] path = "output_example-sbm-gwf.nc" -[output.vertical.interception.variables] +[output.land.interception.variables] canopy_storage = "canopystorage" -[output.vertical.soil.variables] +[output.land.soil.variables] satwaterdepth = "satwaterdepth" ustorelayerdepth = "ustorelayerdepth" -[output.vertical.soil.parameters] +[output.land.soil.parameters] soilthickness = "soilthickness" [output.lateral.river.variables] diff --git a/test/sbm_gwf_piave_demand_config.toml b/test/sbm_gwf_piave_demand_config.toml index a2a0688ec..b4e5f5802 100644 --- a/test/sbm_gwf_piave_demand_config.toml +++ b/test/sbm_gwf_piave_demand_config.toml @@ -22,20 +22,20 @@ gauges = "wflow_gauges" gauges_grdc = "wflow_gauges_grdc" forcing = [ - "vertical.atmospheric_forcing.precipitation", - "vertical.atmospheric_forcing.temperature", - "vertical.atmospheric_forcing.potential_evaporation", + "land.atmospheric_forcing.precipitation", + "land.atmospheric_forcing.temperature", + "land.atmospheric_forcing.potential_evaporation", ] cyclic = [ - "vertical.vegetation_parameter_set.leaf_area_index", - "vertical.demand.domestic.demand.demand_gross", - "vertical.demand.domestic.demand.demand_net", - "vertical.demand.industry.demand.demand_gross", - "vertical.demand.industry.demand.demand_net", - "vertical.demand.livestock.demand.demand_gross", - "vertical.demand.livestock.demand.demand_net", - "vertical.demand.paddy.parameters.irrigation_trigger", - "vertical.demand.nonpaddy.parameters.irrigation_trigger", + "land.vegetation_parameter_set.leaf_area_index", + "land.demand.domestic.demand.demand_gross", + "land.demand.domestic.demand.demand_net", + "land.demand.industry.demand.demand_gross", + "land.demand.industry.demand.demand_net", + "land.demand.livestock.demand.demand_gross", + "land.demand.livestock.demand.demand_net", + "land.demand.paddy.parameters.irrigation_trigger", + "land.demand.nonpaddy.parameters.irrigation_trigger", ] [model] @@ -53,37 +53,37 @@ kw_land_tstep = 3600 thicknesslayers = [ 50, 100, 50, 200, 800,] river_routing = "kinematic-wave" -[state.vertical.interception.variables] +[state.land.interception.variables] canopy_storage = "canopystorage" -[state.vertical.soil.variables] +[state.land.soil.variables] satwaterdepth = "satwaterdepth" tsoil = "tsoil" ustorelayerdepth = "ustorelayerdepth" -[state.vertical.snow.variables] +[state.land.snow.variables] snow_storage = "snow" snow_water = "snowwater" -[state.vertical.glacier.variables] +[state.land.glacier.variables] glacier_store = "glacierstore" -[state.vertical.demand.paddy.variables] +[state.land.demand.paddy.variables] h = "h_paddy" [state.lateral.subsurface.flow.aquifer.variables] head = "head" -[input.vertical.glacier.parameters] +[input.land.glacier.parameters] glacier_frac = "wflow_glacierfrac" g_cfmax = "G_Cfmax" g_ttm = "G_TT" g_sifrac = "G_SIfrac" -[input.vertical.glacier.variables] +[input.land.glacier.variables] glacier_store = "wflow_glacierstore" -[input.vertical.vegetation_parameter_set] +[input.land.vegetation_parameter_set] leaf_area_index = "LAI" kext = "Kext" storage_specific_leaf = "Sl" @@ -91,18 +91,18 @@ storage_wood = "Swood" rootingdepth = "RootingDepth" kc = "crop_factor" -[input.vertical.interception.parameters] +[input.land.interception.parameters] e_r = "EoverR" -[input.vertical.atmospheric_forcing] +[input.land.atmospheric_forcing] potential_evaporation = "pet" precipitation = "precip" temperature = "temp" -[input.vertical.runoff.parameters] +[input.land.runoff.parameters] waterfrac = "WaterFrac" -[input.vertical.soil.parameters] +[input.land.soil.parameters] alpha_h1 = "alpha_h1" c = "c" cf_soil = "cf_soil" @@ -123,7 +123,7 @@ soilthickness = "SoilThickness_gw" kv_0 = "KsatVer" kvfrac = "kvfrac" -[input.vertical.snow.parameters] +[input.land.snow.parameters] tt = "TT" tti = "TTI" ttm = "TTM" @@ -149,27 +149,27 @@ q = "q_land" h = "h_land" h_av = "h_av_land" -[input.vertical.allocation.parameters] +[input.land.allocation.parameters] areas = "allocation_areas" frac_sw_used = "SurfaceWaterFrac" -[input.vertical.demand.domestic.demand] +[input.land.demand.domestic.demand] demand_gross = "dom_gross" demand_net = "dom_net" -[input.vertical.demand.industry.demand] +[input.land.demand.industry.demand] demand_gross = "ind_gross" demand_net = "ind_net" -[input.vertical.demand.livestock.demand] +[input.land.demand.livestock.demand] demand_gross = "lsk_gross" demand_net = "lsk_net" -[input.vertical.demand.paddy.parameters] +[input.land.demand.paddy.parameters] irrigation_areas = "paddy_irrigation_areas" irrigation_trigger = "irrigation_trigger" -[input.vertical.demand.nonpaddy.parameters] +[input.land.demand.nonpaddy.parameters] irrigation_areas = "nonpaddy_irrigation_areas" irrigation_trigger = "irrigation_trigger" @@ -200,7 +200,7 @@ path = "output-piave-gwf.nc" [output.lateral.river.variables] q_av = "q_river" -[output.vertical.soil.variables] +[output.land.soil.variables] zi = "zi" [output.lateral.subsurface.flow.aquifer.variables] diff --git a/test/sbm_piave_config.toml b/test/sbm_piave_config.toml index 026ab9b7a..d0e73526e 100644 --- a/test/sbm_piave_config.toml +++ b/test/sbm_piave_config.toml @@ -21,12 +21,12 @@ gauges = "wflow_gauges" gauges_grdc = "wflow_gauges_grdc" forcing = [ - "vertical.atmospheric_forcing.precipitation", - "vertical.atmospheric_forcing.temperature", - "vertical.atmospheric_forcing.potential_evaporation", + "land.atmospheric_forcing.precipitation", + "land.atmospheric_forcing.temperature", + "land.atmospheric_forcing.potential_evaporation", ] -cyclic = ["vertical.vegetation_parameter_set.leaf_area_index"] +cyclic = ["land.vegetation_parameter_set.leaf_area_index"] [model] type = "sbm" @@ -42,31 +42,31 @@ kw_land_tstep = 3600 thicknesslayers = [ 50, 100, 50, 200, 800,] river_routing = "kinematic-wave" -[state.vertical.interception.variables] +[state.land.interception.variables] canopy_storage = "canopystorage" -[state.vertical.soil.variables] +[state.land.soil.variables] satwaterdepth = "satwaterdepth" tsoil = "tsoil" ustorelayerdepth = "ustorelayerdepth" -[state.vertical.snow.variables] +[state.land.snow.variables] snow_storage = "snow" snow_water = "snowwater" -[state.vertical.glacier.variables] +[state.land.glacier.variables] glacier_store = "glacierstore" -[input.vertical.glacier.parameters] +[input.land.glacier.parameters] glacier_frac = "wflow_glacierfrac" g_cfmax = "G_Cfmax" g_ttm = "G_TT" g_sifrac = "G_SIfrac" -[input.vertical.glacier.variables] +[input.land.glacier.variables] glacier_store = "wflow_glacierstore" -[input.vertical.vegetation_parameter_set] +[input.land.vegetation_parameter_set] leaf_area_index = "LAI" kext = "Kext" storage_specific_leaf = "Sl" @@ -74,18 +74,18 @@ storage_wood = "Swood" rootingdepth = "RootingDepth" kc = "crop_factor" -[input.vertical.interception.parameters] +[input.land.interception.parameters] e_r = "EoverR" -[input.vertical.atmospheric_forcing] +[input.land.atmospheric_forcing] potential_evaporation = "pet" precipitation = "precip" temperature = "temp" -[input.vertical.runoff.parameters] +[input.land.runoff.parameters] waterfrac = "WaterFrac" -[input.vertical.soil.parameters] +[input.land.soil.parameters] alpha_h1 = "alpha_h1" c = "c" cf_soil = "cf_soil" @@ -105,7 +105,7 @@ rootdistpar = "rootdistpar" soilthickness = "SoilThickness" kv_0 = "KsatVer" -[input.vertical.snow.parameters] +[input.land.snow.parameters] tt = "TT" tti = "TTI" ttm = "TTM" diff --git a/test/sbm_piave_demand_config.toml b/test/sbm_piave_demand_config.toml index ffc012efb..10bc50bcb 100644 --- a/test/sbm_piave_demand_config.toml +++ b/test/sbm_piave_demand_config.toml @@ -21,20 +21,20 @@ gauges = "wflow_gauges" gauges_grdc = "wflow_gauges_grdc" forcing = [ - "vertical.atmospheric_forcing.precipitation", - "vertical.atmospheric_forcing.temperature", - "vertical.atmospheric_forcing.potential_evaporation", + "land.atmospheric_forcing.precipitation", + "land.atmospheric_forcing.temperature", + "land.atmospheric_forcing.potential_evaporation", ] cyclic = [ - "vertical.vegetation_parameter_set.leaf_area_index", - "vertical.demand.domestic.demand.demand_gross", - "vertical.demand.domestic.demand.demand_net", - "vertical.demand.industry.demand.demand_gross", - "vertical.demand.industry.demand.demand_net", - "vertical.demand.livestock.demand.demand_gross", - "vertical.demand.livestock.demand.demand_net", - "vertical.demand.paddy.parameters.irrigation_trigger", - "vertical.demand.nonpaddy.parameters.irrigation_trigger", + "land.vegetation_parameter_set.leaf_area_index", + "land.demand.domestic.demand.demand_gross", + "land.demand.domestic.demand.demand_net", + "land.demand.industry.demand.demand_gross", + "land.demand.industry.demand.demand_net", + "land.demand.livestock.demand.demand_gross", + "land.demand.livestock.demand.demand_net", + "land.demand.paddy.parameters.irrigation_trigger", + "land.demand.nonpaddy.parameters.irrigation_trigger", ] [model] @@ -51,34 +51,34 @@ kw_land_tstep = 3600 thicknesslayers = [ 50, 100, 50, 200, 800,] river_routing = "kinematic-wave" -[state.vertical.interception.variables] +[state.land.interception.variables] canopy_storage = "canopystorage" -[state.vertical.soil.variables] +[state.land.soil.variables] satwaterdepth = "satwaterdepth" tsoil = "tsoil" ustorelayerdepth = "ustorelayerdepth" -[state.vertical.snow.variables] +[state.land.snow.variables] snow_storage = "snow" snow_water = "snowwater" -[state.vertical.glacier.variables] +[state.land.glacier.variables] glacier_store = "glacierstore" -[state.vertical.demand.paddy.variables] +[state.land.demand.paddy.variables] h = "h_paddy" -[input.vertical.glacier.parameters] +[input.land.glacier.parameters] glacier_frac = "wflow_glacierfrac" g_cfmax = "G_Cfmax" g_ttm = "G_TT" g_sifrac = "G_SIfrac" -[input.vertical.glacier.variables] +[input.land.glacier.variables] glacier_store = "wflow_glacierstore" -[input.vertical.vegetation_parameter_set] +[input.land.vegetation_parameter_set] leaf_area_index = "LAI" kext = "Kext" storage_specific_leaf = "Sl" @@ -86,18 +86,18 @@ storage_wood = "Swood" rootingdepth = "RootingDepth" kc = "crop_factor" -[input.vertical.interception.parameters] +[input.land.interception.parameters] e_r = "EoverR" -[input.vertical.atmospheric_forcing] +[input.land.atmospheric_forcing] potential_evaporation = "pet" precipitation = "precip" temperature = "temp" -[input.vertical.runoff.parameters] +[input.land.runoff.parameters] waterfrac = "WaterFrac" -[input.vertical.soil.parameters] +[input.land.soil.parameters] alpha_h1 = "alpha_h1" c = "c" cf_soil = "cf_soil" @@ -118,7 +118,7 @@ soilthickness = "SoilThickness" kv_0 = "KsatVer" kvfrac = "kvfrac" -[input.vertical.snow.parameters] +[input.land.snow.parameters] tt = "TT" tti = "TTI" ttm = "TTM" @@ -144,27 +144,27 @@ q = "q_land" h = "h_land" h_av = "h_av_land" -[input.vertical.allocation.parameters] +[input.land.allocation.parameters] areas = "allocation_areas" frac_sw_used = "SurfaceWaterFrac" -[input.vertical.demand.domestic.demand] +[input.land.demand.domestic.demand] demand_gross = "dom_gross" demand_net = "dom_net" -[input.vertical.demand.industry.demand] +[input.land.demand.industry.demand] demand_gross = "ind_gross" demand_net = "ind_net" -[input.vertical.demand.livestock.demand] +[input.land.demand.livestock.demand] demand_gross = "lsk_gross" demand_net = "lsk_net" -[input.vertical.demand.paddy.parameters] +[input.land.demand.paddy.parameters] irrigation_areas = "paddy_irrigation_areas" irrigation_trigger = "irrigation_trigger" -[input.vertical.demand.nonpaddy.parameters] +[input.land.demand.nonpaddy.parameters] irrigation_areas = "nonpaddy_irrigation_areas" irrigation_trigger = "irrigation_trigger" @@ -188,7 +188,7 @@ path = "output-piave-demand.nc" [output.lateral.river.variables] q_av = "q_river" -[output.vertical.soil.variables] +[output.land.soil.variables] zi = "zi" [csv] @@ -208,10 +208,10 @@ parameter = "lateral.river.variables.q_av" coordinate.x = 12.7243 coordinate.y = 45.5851 header = "paddy_h_bycoord" -parameter = "vertical.demand.paddy.variables.h" +parameter = "land.demand.paddy.variables.h" [[csv.column]] coordinate.x = 12.7243 coordinate.y = 45.5851 header = "irri_bycoord" -parameter = "vertical.allocation.variables.irri_alloc" \ No newline at end of file +parameter = "land.allocation.variables.irri_alloc" \ No newline at end of file diff --git a/test/sbm_simple.toml b/test/sbm_simple.toml index d2a6f10cd..4ec3ab8d8 100644 --- a/test/sbm_simple.toml +++ b/test/sbm_simple.toml @@ -20,32 +20,32 @@ subcatchment = "wflow_subcatch" # specify the internal IDs of the parameters which vary over time # the external name mapping needs to be below together with the other mappings forcing = [ - "vertical.atmospheric_forcing.precipitation", - "vertical.atmospheric_forcing.temperature", - "vertical.atmospheric_forcing.potential_evaporation", + "land.atmospheric_forcing.precipitation", + "land.atmospheric_forcing.temperature", + "land.atmospheric_forcing.potential_evaporation", ] -cyclic = ["vertical.vegetation_parameter_set.leaf_area_index"] +cyclic = ["land.vegetation_parameter_set.leaf_area_index"] -[input.vertical.vegetation_parameter_set] +[input.land.vegetation_parameter_set] leaf_area_index = "LAI" kext = "Kext" storage_specific_leaf = "Sl" storage_wood = "Swood" rootingdepth = "RootingDepth" -[input.vertical.interception.parameters] +[input.land.interception.parameters] e_r = "EoverR" -[input.vertical.atmospheric_forcing] +[input.land.atmospheric_forcing] potential_evaporation = "pet" precipitation = "precip" temperature = "temp" -[input.vertical.runoff.parameters] +[input.land.runoff.parameters] waterfrac = "WaterFrac" -[input.vertical.soil.parameters] +[input.land.soil.parameters] c = "c" cf_soil = "cf_soil" f = "f" @@ -59,7 +59,7 @@ rootdistpar = "rootdistpar" soilthickness = "SoilThickness" kv_0 = "KsatVer" -[input.vertical.snow.parameters] +[input.land.snow.parameters] tt = "TT" tti = "TTI" ttm = "TTM" @@ -103,5 +103,5 @@ parameter = "lateral.river.variables.q" [[csv.column]] header = "recharge" -parameter = "vertical.soil.variables.recharge" +parameter = "land.soil.variables.recharge" reducer = "mean" diff --git a/test/sbm_swf_config.toml b/test/sbm_swf_config.toml index 0ebbbf872..af24ac21f 100644 --- a/test/sbm_swf_config.toml +++ b/test/sbm_swf_config.toml @@ -14,15 +14,15 @@ dir_output = "data/output" # if listed, the variable must be present in the NetCDF or error # if not listed, the variable can get a default value if it has one -[state.vertical.interception.variables] +[state.land.interception.variables] canopy_storage = "canopystorage" -[state.vertical.soil.variables] +[state.land.soil.variables] satwaterdepth = "satwaterdepth" tsoil = "tsoil" ustorelayerdepth = "ustorelayerdepth" -[state.vertical.snow.variables] +[state.land.snow.variables] snow_storage = "snow" snow_water = "snowwater" @@ -56,32 +56,32 @@ subcatchment = "wflow_subcatch" # specify the internal IDs of the parameters which vary over time # the external name mapping needs to be below together with the other mappings forcing = [ - "vertical.atmospheric_forcing.precipitation", - "vertical.atmospheric_forcing.temperature", - "vertical.atmospheric_forcing.potential_evaporation", + "land.atmospheric_forcing.precipitation", + "land.atmospheric_forcing.temperature", + "land.atmospheric_forcing.potential_evaporation", ] -cyclic = ["vertical.vegetation_parameter_set.leaf_area_index"] +cyclic = ["land.vegetation_parameter_set.leaf_area_index"] -[input.vertical.vegetation_parameter_set] +[input.land.vegetation_parameter_set] leaf_area_index = "LAI" kext = "Kext" storage_specific_leaf = "Sl" storage_wood = "Swood" rootingdepth = "RootingDepth" -[input.vertical.interception.parameters] +[input.land.interception.parameters] e_r = "EoverR" -[input.vertical.atmospheric_forcing] +[input.land.atmospheric_forcing] potential_evaporation = "pet" precipitation = "precip" temperature = "temp" -[input.vertical.runoff.parameters] +[input.land.runoff.parameters] waterfrac = "WaterFrac" -[input.vertical.soil.parameters] +[input.land.soil.parameters] c = "c" cf_soil = "cf_soil" f = "f" @@ -95,7 +95,7 @@ rootdistpar = "rootdistpar" soilthickness = "SoilThickness" kv_0 = "KsatVer" -[input.vertical.snow.parameters] +[input.land.snow.parameters] tt = "TT" tti = "TTI" ttm = "TTM" @@ -141,15 +141,15 @@ type = "sbm" [output] path = "output_moselle_swf.nc" -[output.vertical.interception.variables] +[output.land.interception.variables] canopy_storage = "canopystorage" -[output.vertical.soil.variables] +[output.land.soil.variables] satwaterdepth = "satwaterdepth" tsoil = "tsoil" ustorelayerdepth = "ustorelayerdepth" -[output.vertical.snow.variables] +[output.land.snow.variables] snow_storage = "snow" snow_water = "snowwater" diff --git a/test/sediment_config.toml b/test/sediment_config.toml index 6839ee4af..86f001dc2 100644 --- a/test/sediment_config.toml +++ b/test/sediment_config.toml @@ -53,26 +53,26 @@ lake_areas = "wflow_lakeareas" # specify the internal IDs of the parameters which vary over time # the external name mapping needs to be below together with the other mappings forcing = [ - "vertical.atmospheric_forcing.precipitation", - "vertical.hydrological_forcing.waterlevel_land", + "land.atmospheric_forcing.precipitation", + "land.hydrological_forcing.waterlevel_land", "lateral.land.hydrological_forcing.waterlevel_land", - "vertical.hydrological_forcing.q_land", + "land.hydrological_forcing.q_land", "lateral.land.hydrological_forcing.q_land", "lateral.river.hydrological_forcing.waterlevel_river", "lateral.river.hydrological_forcing.q_river", ] -[input.vertical.atmospheric_forcing] +[input.land.atmospheric_forcing] precipitation = "P" -[input.vertical.hydrological_forcing] +[input.land.hydrological_forcing] waterlevel_land = "levKinL" q_land = "runL" -[input.vertical.land_parameter_set] +[input.land.land_parameter_set] slope = "Slope" -[input.vertical.rainfall_erosion.parameters] +[input.land.rainfall_erosion.parameters] soil_detachability = "soil_detachability" eurosem_exponent = "eros_spl_EUROSEM" canopygapfraction = "CanopyGapFraction" @@ -80,12 +80,12 @@ usle_k = "usle_k" usle_c = "USLE_C" pathfrac = "PathFrac" -[input.vertical.overland_flow_erosion.parameters] +[input.land.overland_flow_erosion.parameters] usle_k = "usle_k" usle_c = "USLE_C" answers_k = "eros_ov" -[input.vertical.soil_erosion.parameters] +[input.land.soil_erosion.parameters] clay_fraction = "fclay_soil" silt_fraction = "fsilt_soil" sand_fraction = "fsand_soil" @@ -170,13 +170,13 @@ type = "sediment" [output] path = "output-moselle-sed.nc" -[output.vertical.rainfall_erosion.variables] +[output.land.rainfall_erosion.variables] amount = "rainfall_erosion" -[output.vertical.overland_flow_erosion.variables] +[output.land.overland_flow_erosion.variables] amount = "overland_flow_erosion" -[output.vertical.soil_erosion.variables] +[output.land.soil_erosion.variables] amount = "soilloss" clay = "erosclay" @@ -217,31 +217,31 @@ path = "output-moselle-sediment.csv" coordinate.x = 6.931 coordinate.y = 48.085 header = "SL" -parameter = "vertical.soil_erosion.variables.amount" +parameter = "land.soil_erosion.variables.amount" [[csv.column]] coordinate.x = 6.931 coordinate.y = 48.085 header = "SSPL" -parameter = "vertical.rainfall_erosion.variables.amount" +parameter = "land.rainfall_erosion.variables.amount" [[csv.column]] coordinate.x = 6.931 coordinate.y = 48.085 header = "SOV" -parameter = "vertical.overland_flow_erosion.variables.amount" +parameter = "land.overland_flow_erosion.variables.amount" [[csv.column]] coordinate.x = 6.931 coordinate.y = 48.085 header = "P" -parameter = "vertical.atmospheric_forcing.precipitation" +parameter = "land.atmospheric_forcing.precipitation" [[csv.column]] coordinate.x = 6.931 coordinate.y = 48.085 header = "ql" -parameter = "vertical.hydrological_forcing.q_land" +parameter = "land.hydrological_forcing.q_land" # [[csv.column]] # coordinate.x = 6.931 diff --git a/test/sediment_eurosem_engelund_config.toml b/test/sediment_eurosem_engelund_config.toml index 6c9fb3be8..dad06f090 100644 --- a/test/sediment_eurosem_engelund_config.toml +++ b/test/sediment_eurosem_engelund_config.toml @@ -53,28 +53,28 @@ lake_areas = "wflow_lakeareas" # specify the internal IDs of the parameters which vary over time # the external name mapping needs to be below together with the other mappings forcing = [ - "vertical.atmospheric_forcing.precipitation", - "vertical.hydrological_forcing.interception", - "vertical.hydrological_forcing.waterlevel_land", + "land.atmospheric_forcing.precipitation", + "land.hydrological_forcing.interception", + "land.hydrological_forcing.waterlevel_land", "lateral.land.hydrological_forcing.waterlevel_land", - "vertical.hydrological_forcing.q_land", + "land.hydrological_forcing.q_land", "lateral.land.hydrological_forcing.q_land", "lateral.river.hydrological_forcing.waterlevel_river", "lateral.river.hydrological_forcing.q_river", ] -[input.vertical.atmospheric_forcing] +[input.land.atmospheric_forcing] precipitation = "P" -[input.vertical.hydrological_forcing] +[input.land.hydrological_forcing] waterlevel_land = "levKinL" q_land = "runL" interception = "int" -[input.vertical.land_parameter_set] +[input.land.land_parameter_set] slope = "Slope" -[input.vertical.rainfall_erosion.parameters] +[input.land.rainfall_erosion.parameters] soil_detachability = "soil_detachability" eurosem_exponent = "eros_spl_EUROSEM" canopyheight = "CanopyHeight" @@ -82,12 +82,12 @@ usle_k = "usle_k" usle_c = "USLE_C" pathfrac = "PathFrac" -[input.vertical.overland_flow_erosion.parameters] +[input.land.overland_flow_erosion.parameters] usle_k = "usle_k" usle_c = "USLE_C" answers_k = "eros_ov" -[input.vertical.soil_erosion.parameters] +[input.land.soil_erosion.parameters] clay_fraction = "fclay_soil" silt_fraction = "fsilt_soil" sand_fraction = "fsand_soil"