Hi there.
Thank you for your question and thanks @visr for solving the programming aspect of the problem.
Indeed you can pass options into simulate!()
and they will be passed through to the call to solve()
from DifferentialEquations.jl
. The package LWFBrook90.jl
basically works as a wrapper around DifferentialEquations.jl
. The possibility to change the default options can be needed for some more “difficult” simulations. Some ranges of the soil parameters can make the problem much harder to solve.
However, as @visr pointed out correctly: That many iterations are not always expected. The issue you see is probably rather linked with your model specifications. I noticed some very small \alpha values in your input parameters. Have you double-checked the units of all the Mualem-van Genuchten parameters (in your soil_horizons.csv
)?
Note that the parameter \alpha (alpha
) is expected in units of m-1. The example simulation DAV-2020
uses \alpha values on the order of 20 m-1. Puhlmann and von Wilpert (2012)* report mean values for different forest soil types for alpha ranging from 0.030 to 0.181 hPa-1, i.e. from 0.30 to 1.8 kPa-1 or from 2.9 to 17.6 m-1 (with 9.81 kPa/m).
If I modify the \alpha in your simulations the solution works. It will be best to correct your input data in soil_horizons.csv
. Alternatively, the code below overwrites the loaded values with remakeSPAC()
.
Let me know if that helps.
using LWFBrook90
# Read in input data
input_path = "."; input_prefix = "real-full";
model = loadSPAC(input_path, input_prefix; simulate_isotopes = false);
# Setup and run simulation
simulation = setup(model)
# simulate!(simulation)
# would run for ~40 hours and gives maxiters warning
simulation2 = remakeSPAC(model,
soil_horizons = (; alpha_per_m = [12.00007,12.000085,12.0001]))
simulate!(simulation2) # works
using Plots, Measures; gr();
plotforcingandstates(simulation2)
plotamounts(simulation2)
plotisotopes(simulation2)
* Puhlmann, H. and Wilpert, K. von: Pedotransfer functions for water retention and unsaturated hydraulic conductivity of forest soils, J. Plant Nutr. Soil Sci., 175, 221–235, https://doi.org/10.1002/jpln.201100139, 2012.