diff --git a/Project.toml b/Project.toml index d4c613297..a13a6f97a 100644 --- a/Project.toml +++ b/Project.toml @@ -40,6 +40,7 @@ Parameters = "0.12" Polyester = "0.7" ProgressLogging = "0.1" StaticArrays = "0.12, 1.0" +Statistics = "1" TOML = "1.0" TerminalLoggers = "0.1.5" UnPack = "1" diff --git a/docs/src/changelog.md b/docs/src/changelog.md index e8e7de35a..d86c23ee5 100644 --- a/docs/src/changelog.md +++ b/docs/src/changelog.md @@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [unreleased] + +### Fixed +- Documentation: add leakage term to the wflow\_sbm figure, document external input + parameter `ksathorfrac` and fix description of adding external `inflow` to the kinematic + wave. + +### Changed +- For cyclic parameters different cyclic time inputs are supported (only one common cyclic + time (for example daily or monthly) was allowed). + ## v0.7.2 - 2023-09-27 ### Fixed diff --git a/docs/src/images/wflow_sbm_soil.png b/docs/src/images/wflow_sbm_soil.png index 5908e4125..8cea8db3c 100644 Binary files a/docs/src/images/wflow_sbm_soil.png and b/docs/src/images/wflow_sbm_soil.png differ diff --git a/docs/src/model_docs/lateral/kinwave.md b/docs/src/model_docs/lateral/kinwave.md index 7d56c58f3..3e7b92727 100644 --- a/docs/src/model_docs/lateral/kinwave.md +++ b/docs/src/model_docs/lateral/kinwave.md @@ -134,8 +134,8 @@ through a simple explicit scheme. In summary the following limitations apply: ## External inflows External inflows, for example water supply or abstractions, can be added to the kinematic -wave via the `inflow` variable. For this, the user can supply a 2D map of the inflow which -can be static or dynamic (changing every timestep or cyclic is possible). These inflow are +wave via the `inflow` variable. For this, the user can supply a 2D map of the inflow, as a +cyclic parameter or as part of forcing (see also [Input section](@ref)). These inflows are added or abstracted from the upstream inflow `qin` before running the kinematic wave to solve the impact on resulting `q`. In case of a negative inflow (abstractions), a minimum of zero is applied to the upstream flow `qin`. diff --git a/docs/src/model_docs/params_lateral.md b/docs/src/model_docs/params_lateral.md index 05ac8ec91..56cca1277 100644 --- a/docs/src/model_docs/params_lateral.md +++ b/docs/src/model_docs/params_lateral.md @@ -8,11 +8,13 @@ flow, including a description of these parameters, the unit, and default value i applicable. The parameters in bold represent model parameters that can be set through static input data (netCDF), and can be listed in the TOML configuration file under `[input.lateral.river]` to map the internal model parameter to the external netCDF variable. +The input parameter `slope` (listed under `[input.lateral.river]`) is not equal to the +internal model parameter `sl`, and is listed in the Table below between parentheses. | parameter | description | unit | default | |:--------------- | ------------------| ----- | -------- | | `β` | constant in Manning's equation | - | - | -| **`sl`** | slope | m m``^{-1}``| - | +| **`sl`** (`slope`) | slope | m m``^{-1}``| - | | **`n`** | Manning's roughness | s m``^{-\frac{1}{3}}``| 0.036 | | **`dl`** | length | m | - | | `q` | discharge | m``^3`` s``^{-1}``| - | @@ -42,12 +44,14 @@ The Table below shows the parameters (fields) of struct `SurfaceFlowLand` used f flow, including a description of these parameters, the unit, and default value if applicable. The parameters in bold represent model parameters that can be set through static input data (netCDF), and can be listed in the TOML configuration file under -`[input.lateral.land]` to map the internal model parameter to the external netCDF variable. +`[input.lateral.land]` to map the internal model parameter to the external netCDF variable. +The input parameter `slope` (listed under `[input.lateral.land]`) is not equal to the +internal model parameter `sl`, and is listed in the Table below between parentheses. | parameter | description | unit | default | |:--------------- | ------------------| ----- | -------- | | `β` | constant in Manning's equation | - | - | -| **`sl`** | slope | m m``^{-1}``| - | +| **`sl`** (`slope`) | slope | m m``^{-1}``| - | | **`n`** | Manning's roughness | s m``^{-\frac{1}{3}}``| 0.072 | | `dl` | length | m | - | | `q` | discharge | m``^3`` s``^{-1}``| - | @@ -65,7 +69,7 @@ input data (netCDF), and can be listed in the TOML configuration file under | `alpha_term` | term used in computation of ``\alpha`` | - | - | | `α` | constant in momentum equation ``A = \alpha Q^{\beta}`` | s``^{\frac{3}{5}}`` m``^{\frac{1}{5}}`` | - | | `cel` | celerity of kinematic wave | m s``^{-1}`` | - | -| `to_river` | part of overland flow that flows to the river | m s``^3`` | - | +| `to_river` | part of overland flow that flows to the river | m``^3`` s``^{-1}`` | - | | `kinwave_it` | boolean for kinematic wave iterations | - | false | ### [Reservoirs](@id reservoir_params) @@ -120,6 +124,10 @@ areas = "wflow_lakeareas" locs = "wflow_lakelocs" ``` +The input parameter `linkedlakelocs` (listed under `[input.lateral.river.lake]`) is not +equal to the internal model parameter `lowerlake_ind`, and is listed in the Table below +between parentheses. + | parameter | description | unit | default | |:---------------| --------------- | ---------------------- | ----- | | **`area`** | area| m``^2`` | - | @@ -141,19 +149,44 @@ locs = "wflow_lakelocs" | `precipitation` | average precipitation for lake area | mm Δt⁻¹ | - | | `evaporation` | average precipitation for lake area | mm Δt⁻¹ | - | -### Lateral subsurface flow +### [Lateral subsurface flow](@id params_ssf) The Table below shows the parameters (fields) of struct `LateralSSF`, including a -description of these parameters, the unit, and default value if applicable. +description of these parameters, the unit, and default value if applicable. The parameters +in bold represent model parameters that can be set through static input data (netCDF). The +soil related parameters `f`, `soilthickness`, `θₛ` and `θᵣ` are derived from the vertical +`SBM` concept (including unit conversion for `f` and `soilthickness`), and can be listed in +the TOML configuration file under `[input.vertical]`, to map the internal model parameter to +the external netCDF variable. The internal slope model parameter `βₗ` is set through the +TOML file as follows: + +```toml +[input.lateral.land] +slope = "Slope" +``` + +The parameter `kh₀` is computed by multiplying the vertical hydraulic conductivity at the +soil surface `kv₀` (including unit conversion) of the vertical `SBM` concept with the +external parameter `ksathorfrac` \[-\] (default value of 1.0). The external parameter +`ksathorfrac` can be set as follows through the TOML file: + +```toml +[input.lateral.subsurface] +ksathorfrac = "KsatHorFrac" +``` + +The `ksathorfrac` parameter compensates for anisotropy, small scale `kv₀` measurements (soil +core) that do not represent larger scale hydraulic conductivity, and smaller flow length +scales (hillslope) in reality, not represented by the model resolution. | parameter | description | unit | default | |:---------------| --------------- | ---------------------- | ----- | -| `kh₀` | horizontal hydraulic conductivity at soil surface | m d``^{-1}`` | - | -| `f` | a scaling parameter (controls exponential decline of kh₀) | m``^{-1}`` | - | -| `soilthickness` | soil thickness | m | - | -| `θₛ` | saturated water content (porosity) | - | - | -| `θᵣ` | residual water content | - | - | +| `kh₀` | horizontal hydraulic conductivity at soil surface | m d``^{-1}`` | 3.0 | +| **`f`** | a scaling parameter (controls exponential decline of kh₀) | m``^{-1}`` | 1.0 | +| **`soilthickness`** | soil thickness | m | 2.0 | +| **`θₛ`** | saturated water content (porosity) | - | 0.6 | +| **`θᵣ`** | residual water content | - | 0.01 | | `Δt` | model time step | d | - | -| `βₗ` | slope | - | - | +| **`βₗ`** (`slope`) | slope | m m``^{-1}`` | - | | `dl` | drain length | m | - | | `dw` | drain width | m | - | | `zi` | pseudo-water table depth (top of the saturated zone) | m | - | @@ -187,6 +220,9 @@ floodplain routing, and parameter `q_channel_av` represents average river channe Otherwise parameters `q_av` and `q_channel_av` represent both average river channel discharge (are equal). +The input parameter `n` (listed under `[input.lateral.river]`) is not equal to the internal +model parameter `mannings_n`, and is listed in the Table below between parentheses. + | parameter | description | unit | default | |:--------------- | ------------------| ------- | ------ | | **`mannings_n`** (`n`) | Manning's roughness | s m``^{-\frac{1}{3}}`` | 0.036 | @@ -239,7 +275,9 @@ The Table below shows the parameters (fields) of struct `FloodPlain` (part of st value if applicable. The parameters in bold represent model parameters that can be set through static input data (netCDF), and can be listed in the TOML configuration file under `[input.lateral.river.floodplain]`, to map the internal model parameter to the external -netCDF variable. +netCDF variable. The input parameter `n` (listed under `[input.lateral.river.floodplain]`) +is not equal to the internal model parameter `mannings_n`, and is listed in the Table below +between parentheses. | parameter | description | unit | default | |:--------------- | ------------------| ----- | -------- | @@ -269,7 +307,7 @@ The floodplain profile `FloodPlainProfile` contains the following parameters: | `a` | cumulative floodplain flow area (per flood depth) | m``^2`` | - | | `p` | cumulative floodplain wetted perimeter (per flood depth) | m | - | -The floodplain volumes (per flood depth interval) can be set as follows through the TOML +The floodplain volumes (per flood `depth` interval) can be set as follows through the TOML file: ```toml @@ -277,6 +315,9 @@ file: volume = "floodplain_volume" ``` +The input parameter `flood_depth` (dimension of floodplain `volume`) is not equal to the +internal model parameter `depth`, and is listed in the Table below between parentheses. + ### [Overland flow](@id local-inertial_land_params) The Table below shows the parameters (fields) of struct `ShallowWaterLand`, including a description of these parameters, the unit, and default value if applicable. The parameters @@ -291,6 +332,8 @@ follows in the TOML file: [input.lateral.land] n = "n_land" # mannings roughness ``` +The input parameter `elevation` (listed under `[input.lateral.land]`) is not equal to the +internal model parameter `z`, and is listed in the Table below between parentheses. | parameter | description | unit | default | |:--------------- | ------------------| ----- | -------- | @@ -331,7 +374,7 @@ description of these parameters, the unit, and default value if applicable. Stru |:--------------- | ------------------| ----- | -------| | `k` | horizontal conductivity | m d``^{-1}``s | - | | `storativity` | storativity | m m``^{-1}`` | - | -| `specific_storage` | specific storage | m``^{-1}`` | - } +| `specific_storage` | specific storage | m``^{-1}`` | - | | `top` | top groundwater layers | m | - | | `bottom` | bottom groundwater layers | m | - | | `area` | cell area | m``^2`` | - | @@ -342,12 +385,12 @@ description of these parameters, the unit, and default value if applicable. Stru The Table below shows the parameters (fields) of struct `UnconfinedAquifer`, including a description of these parameters, the unit, and default value if applicable. The parameters in bold represent model parameters that can be set through static input data (netCDF), and -can be listed in the TOML configuration file under `[lateral.subsurface]`, to map the +can be listed in the TOML configuration file under `[input.lateral.subsurface]`, to map the internal model parameter to the external netCDF variable. For some input parameters the -parameter listed under `[lateral.subsurface]` is not equal to the internal model parameter, -these are listed in the Table below between parentheses after the internal model parameter. -The `top` parameter is provided by the external parameter `altitude` as part of the static -input data and set as follows through the TOML file: +parameter listed under `[input.lateral.subsurface]` is not equal to the internal model +parameter, these are listed in the Table below between parentheses after the internal model +parameter. The `top` parameter is provided by the external parameter `altitude` as part of +the static input data and set as follows through the TOML file: ```toml [input] @@ -355,6 +398,9 @@ input data and set as follows through the TOML file: altitude = "wflow_dem" ``` +The input parameter `conductivity` (listed under `[input.lateral.subsurface]`) is not equal +to the internal model parameter `kh₀`, and is listed in the Table below between parentheses. + | parameter | description | unit | default | |:--------------- | ------------------| ----- | -------| | **`kh₀`** (`conductivity`) | horizontal conductivity | m d``^{-1}``s | - | @@ -370,10 +416,10 @@ altitude = "wflow_dem" The Table below shows the parameters (fields) of struct `ConstantHead`, including a description of these parameters, the unit, and default value if applicable. The parameters in bold represent model parameters that can be set through static input data (netCDF), and -can be listed in the TOML configuration file under `[lateral.subsurface]`, to map the -internal model parameter to the external netCDF variable. For some input parameters the -parameter listed under `[lateral.subsurface]` is not equal to the internal model parameter, -these are listed in the Table below between parentheses after the internal model parameter. +can be listed in the TOML configuration file under `[input.lateral.subsurface]`, to map the +internal model parameter to the external netCDF variable. The input parameter +`constant_head` (listed under `[input.lateral.subsurface]`) is not equal to the internal +model parameter `head`, and is listed in the Table below between parentheses. | parameter | description | unit | default | |:--------------- | ------------------| ----- | --------- | @@ -383,13 +429,13 @@ these are listed in the Table below between parentheses after the internal model ### Boundary conditions #### [River](@id gwf_river_params) -The Table below shows the parameters (fields) of struct `River`, including a -description of these parameters, the unit, and default value if applicable. The parameters -in bold represent model parameters that can be set through static input data (netCDF), and -can be listed in the TOML configuration file under `[lateral.subsurface]`, to map the -internal model parameter to the external netCDF variable. For some input parameters the -parameter listed under `[lateral.subsurface]` is not equal to the internal model parameter, -these are listed in the Table below between parentheses after the internal model parameter. +The Table below shows the parameters (fields) of struct `River`, including a description of +these parameters, the unit, and default value if applicable. The parameters in bold +represent model parameters that can be set through static input data (netCDF), and can be +listed in the TOML configuration file under `[input.lateral.subsurface]`, to map the +internal model parameter to the external netCDF variable. The input parameter `river_bottom` +(listed under `[input.lateral.subsurface]`) is not equal to the internal model parameter +`bottom`, and is listed in the Table below between parentheses. | parameter | description | unit | default | |:--------------- | ------------------| ----- | -------| @@ -401,13 +447,14 @@ these are listed in the Table below between parentheses after the internal model | `flux` | exchange flux (river to aquifer) | m``^3`` d``^{-1}`` | - | #### [Drainage](@id gwf_drainage_params) -The Table below shows the parameters (fields) of struct `Drainage`, including a -description of these parameters, the unit, and default value if applicable. The parameters -in bold represent model parameters that can be set through static input data (netCDF), and -can be listed in the TOML configuration file under `[lateral.subsurface]`, to map the +The Table below shows the parameters (fields) of struct `Drainage`, including a description +of these parameters, the unit, and default value if applicable. The parameters in bold +represent model parameters that can be set through static input data (netCDF), and can be +listed in the TOML configuration file under `[input.lateral.subsurface]`, to map the internal model parameter to the external netCDF variable. For some input parameters the -parameter listed under `[lateral.subsurface]` is not equal to the internal model parameter, -these are listed in the Table below between parentheses after the internal model parameter. +parameter listed under `[input.lateral.subsurface]` is not equal to the internal model +parameter, these are listed in the Table below between parentheses after the internal model +parameter. | parameter | description | unit | default | |:--------------- | ------------------| ----- | -------| @@ -417,8 +464,8 @@ these are listed in the Table below between parentheses after the internal model | `flux` | exchange flux (drains to aquifer) | m``^3`` day``^{-1}`` | - | #### [Recharge](@id gwf_recharge_params) -The Table below shows the parameters (fields) of struct `Recharge`, including a -description of these parameters, the unit, and default value if applicable. +The Table below shows the parameters (fields) of struct `Recharge`, including a description +of these parameters, the unit, and default value if applicable. | parameter | description | unit | default | |:--------------- | ------------------| ----- | ---- | diff --git a/docs/src/user_guide/model-setup.md b/docs/src/user_guide/model-setup.md index cebf1ed47..3d67194bb 100644 --- a/docs/src/user_guide/model-setup.md +++ b/docs/src/user_guide/model-setup.md @@ -56,8 +56,8 @@ the SBM + Kinematic wave model includes the lateral component [Subsurface flow routing](@ref) and parameters that are part of this component are described in the [Lateral subsurface flow](@ref) section of Model parameters. Input parameters for this component of the SBM + Kinematic wave model are derived from the SBM vertical concept and the land slope. -One external parameter `ksathorfrac` is used to calculate the horizontal hydraulic -conductivity at the soil surface `kh₀`. +One external parameter [`ksathorfrac`](@ref params_ssf) is used to calculate the horizontal +hydraulic conductivity at the soil surface `kh₀`. There is also the option to use the local inertial model as part of the `sbm` model type: + for river flow, see also [SBM + Local inertial river](@ref) model. diff --git a/docs/src/user_guide/step2_settings_file.md b/docs/src/user_guide/step2_settings_file.md index 52e35ca79..705233f7b 100644 --- a/docs/src/user_guide/step2_settings_file.md +++ b/docs/src/user_guide/step2_settings_file.md @@ -113,10 +113,13 @@ The `input` section of the TOML file contains information about the input forcin parameters files (netCDF format). Forcing is applied to the vertical component of the model, and needs to be mapped to the external netCDF variable name. `forcing` lists the internal model forcing parameters, and these are mapped to the external netCDF variables listed under -the section `[input.vertical]`. It is possible to provide cyclic parameters to the model. In -the example below this is done for the internal `vertical.leaf_area_index` model parameter, -that is linked to the external netCDF variable "LAI" variable. If a model parameter is not -mapped, a default value will be used if available. +the section `[input.vertical]`. It is possible to provide cyclic parameters to the model +(minimum time step of 1 day). In the example below this is done for the internal +`vertical.leaf_area_index` model parameter, that is linked to the external netCDF variable +"LAI" variable. Cyclic time inputs of parameters can be different (for example daily and +monthly). The `time` dimension name of these cylic input parameters in the model parameter +netCDF file should start with "time". If a model parameter is not mapped, a default value +will be used if available. ```toml [input] diff --git a/src/io.jl b/src/io.jl index 8d5d20182..2c08821f8 100644 --- a/src/io.jl +++ b/src/io.jl @@ -338,13 +338,14 @@ function update_cyclic!(model) month_day = monthday(clock.time - clock.Δt) is_first_timestep = clock.iteration == 1 - if is_first_timestep || (month_day in cyclic_times) - # time for an update of the cyclic forcing - i = findlast(t -> monthday_passed(month_day, t), cyclic_times) - isnothing(i) && error("Could not find applicable cyclic timestep for $month_day") - # load from NetCDF into the model according to the mapping - for (par, ncvar) in cyclic_parameters + for (par, ncvar) in cyclic_parameters + if is_first_timestep || (month_day in cyclic_times[par]) + # time for an update of the cyclic forcing + i = findlast(t -> monthday_passed(month_day, t), cyclic_times[par]) + isnothing(i) && + error("Could not find applicable cyclic timestep for $month_day") + # load from NetCDF into the model according to the mapping data = get_at(cyclic_dataset, ncvar.name, i) param_vector = param(model, par) sel = active_indices(network, par) @@ -623,7 +624,7 @@ struct NCReader{T} dataset::CFDataset dataset_times::Vector{T} cyclic_dataset::Union{NCDataset,Nothing} - cyclic_times::Vector{Tuple{Int,Int}} + cyclic_times::Dict{Tuple{Symbol,Vararg{Symbol}},Vector{Tuple{Int,Int}}} forcing_parameters::Dict{Tuple{Symbol,Vararg{Symbol}},NamedTuple} cyclic_parameters::Dict{Tuple{Symbol,Vararg{Symbol}},NamedTuple} end @@ -638,7 +639,7 @@ struct Writer state_dataset::Union{NCDataset,Nothing} # dataset with model states (NetCDF) state_parameters::Dict{String,Any} # mapping of NetCDF variable names to model states (arrays) state_nc_path::Union{String,Nothing} # path NetCDF file with states - dataset_scalar::Union{NCDataset,Nothing} # dataset(NetCDF) for scalar data + dataset_scalar::Union{NCDataset,Nothing} # dataset (NetCDF) for scalar data nc_scalar::Vector # model parameter (arrays) and associated reducer function for NetCDF scalar output ncvars_dims::Vector # model parameter (String) and associated NetCDF variable, location dimension and location name for scalar data nc_scalar_path::Union{String,Nothing} # path NetCDF file (scalar data) @@ -693,17 +694,6 @@ function prepare_reader(config) # check for cyclic parameters do_cyclic = haskey(config.input, "cyclic") - # TODO:include leaf_area_index climatology in update() vertical SBM model - # we currently assume the same dimension ordering as the forcing - if do_cyclic == true - cyclic_dataset = NCDataset(cyclic_path) - cyclic_nc_times = collect(cyclic_dataset["time"]) - cyclic_times = timecycles(cyclic_nc_times) - else - cyclic_dataset = nothing - cyclic_times = Tuple{Int,Int}[] - end - # create map from internal location to NetCDF variable name for forcing parameters forcing_parameters = Dict{Tuple{Symbol,Vararg{Symbol}},NamedTuple}() for par in config.input.forcing @@ -715,19 +705,30 @@ function prepare_reader(config) @info "Set `$par` using NetCDF variable `$ncname` as forcing parameter." end - # create map from internal location to NetCDF variable name for cyclic parameters + # create map from internal location to NetCDF variable name for cyclic parameters and + # store cyclic times for each internal location (duplicate cyclic times are possible + # this way, however it seems not worth to keep track of unique cyclic times for now + # (memory usage)) if do_cyclic == true + cyclic_dataset = NCDataset(cyclic_path) cyclic_parameters = Dict{Tuple{Symbol,Vararg{Symbol}},NamedTuple}() + cyclic_times = Dict{Tuple{Symbol,Vararg{Symbol}},Vector{Tuple{Int,Int}}}() for par in config.input.cyclic fields = symbols(par) ncname, mod = ncvar_name_modifier(param(config.input, fields)) + i = findfirst(x -> startswith(x, "time"), dimnames(cyclic_dataset[ncname])) + dimname = dimnames(cyclic_dataset[ncname])[i] + cyclic_nc_times = collect(cyclic_dataset[dimname]) + cyclic_times[fields] = timecycles(cyclic_nc_times) cyclic_parameters[fields] = (name = ncname, scale = mod.scale, offset = mod.offset) - @info "Set `$par` using NetCDF variable `$ncname` as cyclic parameter." + @info "Set `$par` using NetCDF variable `$ncname` as cyclic parameter, with `$(length(cyclic_nc_times))` timesteps." end else cyclic_parameters = Dict{Tuple{Symbol,Vararg{Symbol}},NamedTuple}() + cyclic_dataset = nothing + cyclic_times = Dict{Tuple{Symbol,Vararg{Symbol}},Vector{Tuple{Int,Int}}}() end # check if there is overlap @@ -979,7 +980,7 @@ function prepare_writer( # data, but only if config.netcdf.variable has been set. if haskey(config, "netcdf") && haskey(config.netcdf, "variable") nc_scalar_path = output_path(config, config.netcdf.path) - @info "Create an output NetCDF file `$nc_state_path` for scalar data." + @info "Create an output NetCDF file `$nc_scalar_path` for scalar data." # get NetCDF info for scalar data (variable name, locationset (dim) and # location ids) ncvars_dims = nc_variables_dims(config.netcdf.variable, nc_static, config) @@ -1144,7 +1145,7 @@ Given a vector of times, return a tuple of (month, day) for each time entry, to cyclic time series that repeats every year. By using `monthday` rather than `dayofyear`, leap year offsets are avoided. -It can generate such a series from eiher TimeTypes given that the year is constant, or +It can generate such a series from either TimeTypes given that the year is constant, or it will interpret integers as either months or days of year if possible. """ function timecycles(times) @@ -1154,8 +1155,14 @@ function timecycles(times) if !all(==(year1), year.(times)) error("unsupported cyclic timeseries") end - # returns a (month, day) tuple for each date - return monthday.(times) + # sub-daily time steps are not allowed + min_tstep = Second(minimum(diff(times))) + if min_tstep < Second(Day(1)) + error("unsupported cyclic timeseries") + else + # returns a (month, day) tuple for each date + return monthday.(times) + end elseif eltype(times) <: Integer if length(times) == 12 months = Date(2000, 1, 1):Month(1):Date(2000, 12, 31) @@ -1432,6 +1439,8 @@ function internal_dim_name(name::Symbol) return :y elseif name in (:time, :layer, :flood_depth, :classes) return name + elseif startswith(string(name), "time") + return :time else error("Unknown dimension $name") end diff --git a/src/reservoir_lake.jl b/src/reservoir_lake.jl index 303c98d14..d599573ee 100644 --- a/src/reservoir_lake.jl +++ b/src/reservoir_lake.jl @@ -376,14 +376,16 @@ function initialize_lake(config, nc, inds_riv, nriv, pits, Δt) if lake_storfunc[i] == 2 csv_path = joinpath(path, "lake_sh_$lakeloc.csv") @info( - "read a storage curve from CSV file $csv_path, for lake location $lakeloc" + "Read a storage curve from CSV file `$csv_path`, for lake location `$lakeloc`" ) sh[i] = read_sh_csv(csv_path) end if lake_outflowfunc[i] == 1 csv_path = joinpath(path, "lake_hq_$lakeloc.csv") - @info("read a rating curve from CSV file $csv_path, for lake location $lakeloc") + @info( + "Read a rating curve from CSV file `$csv_path`, for lake location `$lakeloc`" + ) hq[i] = read_hq_csv(csv_path) end diff --git a/test/runtests.jl b/test/runtests.jl index cfeb0f6e5..23a6ab4a1 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -37,7 +37,7 @@ end staticmaps_rhine_path = testdata(v"0.1", "staticmaps.nc", "staticmaps-rhine.nc") staticmaps_moselle_path = - testdata(v"0.2.8", "staticmaps-moselle.nc", "staticmaps-moselle.nc") + testdata(v"0.2.9", "staticmaps-moselle.nc", "staticmaps-moselle.nc") staticmaps_lahn_path = testdata(v"0.2.1", "staticmaps-lahn.nc", "staticmaps-lahn.nc") staticmaps_meuse_path = testdata(v"0.2.8", "staticmaps_flex_meuse.nc", "staticmaps_flex_meuse.nc")