Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check if states are covered using statevars() #61

Closed
markhegnauer opened this issue Dec 8, 2020 · 2 comments
Closed

check if states are covered using statevars() #61

markhegnauer opened this issue Dec 8, 2020 · 2 comments
Labels
duplicate This issue or pull request already exists user-experience Improvements to the settings file, logging, error handling, etc.

Comments

@markhegnauer
Copy link
Contributor

When turning of the reservoirs using the option reservoirs=false in the toml file, the following error is thrown. Solved by commenting the reservoir state section, nice to have this automatically taken care of by the code.

ERROR: type Nothing has no field volume
Stacktrace:
[1] getproperty(::Nothing, ::Symbol) at .\Base.jl:33
[2] BottomRF at .\reduce.jl:81 [inlined]
[3] afoldl(::Base.BottomRF{typeof(getproperty)}, ::Nothing, ::Symbol) at .\operators.jl:525
[4] afoldl(::Base.BottomRF{typeof(getproperty)}, ::Wflow.SurfaceFlow{Float64,Nothing,Nothing}, ::Symbol, ::Symbol) at .\operators.jl:526 (repeats 3 times)
[5] _foldl_impl at .\tuple.jl:207 [inlined]
[6] foldl_impl at .\reduce.jl:48 [inlined]
[7] mapfoldl_impl at .\reduce.jl:44 [inlined]
[8] #mapfoldl#204 at .\reduce.jl:160 [inlined]
[9] #foldl#205 at .\reduce.jl:178 [inlined]
[10] param(::NamedTuple{(:vertical, :lateral),Tuple{Wflow.SBM{Float64,4,5},NamedTuple{(:subsurface, :land, :river),Tuple{Wflow.LateralSSF{Float64},Wflow.SurfaceFlow{Float64,Nothing,Nothing},Wflow.SurfaceFlow{Float64,Nothing,Nothing}}}}}, ::NTuple{4,Symbol}) at C:\Users\hegnauer.julia\dev\Wflow\src\io.jl:17
[11] out_map(::Dict{Tuple{Symbol,Vararg{Symbol,N} where N},String}, ::NamedTuple{(:vertical, :lateral),Tuple{Wflow.SBM{Float64,4,5},NamedTuple{(:subsurface, :land, :river),Tuple{Wflow.LateralSSF{Float64},Wflow.SurfaceFlow{Float64,Nothing,Nothing},Wflow.SurfaceFlow{Float64,Nothing,Nothing}}}}}) at C:\Users\hegnauer.julia\dev\Wflow\src\io.jl:578
[12] prepare_writer(::Wflow.Config, ::Wflow.NCReader{Float32}, ::String, ::NamedTuple{(:vertical, :lateral),Tuple{Wflow.SBM{Float64,4,5},NamedTuple{(:subsurface, :land, :river),Tuple{Wflow.LateralSSF{Float64},Wflow.SurfaceFlow{Float64,Nothing,Nothing},Wflow.SurfaceFlow{Float64,Nothing,Nothing}}}}}, ::Dict{Tuple{Symbol,Vararg{Symbol,N} where N},String}, ::NamedTuple{(:land, :river, :reservoir, :lake),Tuple{Array{Int64,2},Array{Int64,2},Nothing,Nothing}}, ::Array{Float64,1}, ::Array{Float64,1}, ::Bool, ::NCDatasets.NCDataset{Nothing}; maxlayers::Int64) at C:\Users\hegnauer.julia\dev\Wflow\src\io.jl:623
[13] initialize_sbm_model(::Wflow.Config) at C:\Users\hegnauer.julia\dev\Wflow\src\sbm_model.jl:209
[14] top-level scope at REPL[9]:1

@verseve
Copy link
Contributor

verseve commented Dec 9, 2020

Yes, states are now completely controlled by the config TOML file. An improvement to work on this is listed as a to do:

check if states are covered using statevars()

This will probably need a good way to get statevars from a complete model, and thus a way to identify the different components automatically.

@visr visr changed the title ERROR: type Nothing has no field volume check if states are covered using statevars() Jan 13, 2021
@JoostBuitink JoostBuitink added the user-experience Improvements to the settings file, logging, error handling, etc. label Oct 31, 2022
@JoostBuitink JoostBuitink moved this to Todo in Wflow Oct 31, 2022
@verseve verseve added the duplicate This issue or pull request already exists label Feb 29, 2024
@verseve
Copy link
Contributor

verseve commented Feb 29, 2024

This issue has been resolved in #293.

@verseve verseve closed this as completed Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists user-experience Improvements to the settings file, logging, error handling, etc.
Projects
No open projects
Status: 🔲 Todo
Development

No branches or pull requests

3 participants