Closed OlabodePhebe closed 10 months ago
Hi!
Thanks for your question. Your error message indicates that the Date that could not be read is written as "1/1/2019".
The dates in the input CSV meteoiso.csv
and meteoveg.csv
must be encoded as YYYY-MM-DD, as stated in the documentation: https://fabern.github.io/LWFBrook90.jl/stable/user-guide/#Input-data
Please check again the two input files meteoiso.csv
and meteoveg.csv
and reply again here if it is still not working.
Maybe try to open the CSV with a normal text editor, instead of Microsoft Excel. In the text editor you see clearly the actual content of your CSV, whereas Excel usually messes up date formatting...
Thank you very much Fabern. It was helpful and the problem has been solved.
The other problem I have is with the #setup and simulation run
When I use the code,
I get this error
when I use the code
loadSPAC(input_path, input_prefix; simulate_isotopes = true,
I get this error
I tried to increase the alpha_perMeter in my dataset but it didn't work. so I tried to use this code
soil_horizons = (; alpha_per_m = [12.00007,12.000085,12.0001]))
I still have the same Maxlters error.
I follow the Example-01 (autogenerated) · LWFBrook90.jl 3
I would appreciate your help, thank you.
Great to hear that you could solve your input data.
Regarding your second problem it is not clear to me what you do differently in the first code where you define model
compared to the second where you define model_modified
. The code seems to do exactly the same, so it remains a mystery why you get different output in the form of different Error messages.
Can you provide the full code of your script? Including the inputs. Best would be to reduce it to the minimum to reproduce the problem. Can you do this in a new issue with a title that represents the new question? That way I can mark this thread as solved and people can find the new issue with an updated title...
The error regarding MaxIters
simply means that the simulation takes more time step to solve that some fixed threshold. This threshold can be increased if the simulation really needs so much steps to solve. You could also test to run the simulation only for a short period of time e.g. a month to see if the output you get makes sense. This can be done with simulate!(simulation; tspan = (1,30))
. If all seems correct you can indeed increase the number of maxiters by doing: simulate!(simulation, maxiters = 3e5)
.
However, more frequently the error regarding MaxIters
points to an underlying problem when specifying the simulation... e.g. wrong units in the input. See my reply here. In that thread (where you posted your question as well) another used misspecified the parameter alpha_perMeter
. However, this does not mean that the alpha parameter is the cause in your problem, too. Without the full specification of your problem it is impossible to tell what's going on.
Thank you very much for your help Fabern, I have been able to solve the problem and now have outputs. I have a few questions 1) what does XYL in the aboveground simulation result mean? 2) what parameter controls soil water distribution in the different soil horizons? My results show all the soil water in horizon 2 leaving 1 and 3 empty. 3)XYLEM has the largest water assigned to it in my check plot despite having very low root density in my input data.
I want to know what controls the water distribution, I changed a lot of parameters since I am working with a lysimetric station and not a forest b Data-NEW_θ_depths_daily.csv ut the outputs are not relatable.
You can check the attachment for an example of my results.
Thank you very much.
Hi,
Great that you're making progress!
1) XYL in the aboveground refers to a a storage volume of water that is assumed to be in the tree (xylem). This is a fixed volume and is defined by the parameter "VXYLEM_mm". It is not really relevant for the water balance. (The parameter was introduced to improve the fit of isotope signatures measured in Xylem water.)
2) The distribution of water depends on the soil properties: The Mualem-van Genuchten parameters provide you the link between soil matric potential (ψ) and soil moisture (θ) and also describe the hydraulic conductivity of the soil for different soil moistures. Do you have good first estimates for these parameters from measurements or from your soil types? I notice that your simulated soil matric potential (ψ) is extremely low in the top soil layer. Usually the model simulates removal of water by plants only down to 1500 kPa (= parameter PSICR), so something else is removing the water very efficiently (evaporation or vertical drainage). Evaporation from dry soils will be regulated by how much water can be transported to the surface (RSSA and RSSB). Drainage is regulated by the hydraulic conductivity.
It might be good to focus on the first weeks of your simulation as it seems that most water leaves the domain then and no new water arrives. All incoming rain water might be intercepted by the canopy and nothing reaches the soil. You could try to remove the effect of the vegetation by setting LAI=0, and MXRTLN=0. And also deactivate evaporation by setting RSSA=0. Then you see during the first weeks if your rainfall events rewet the soil layers and by how much. Once you have something that appears reasonable in terms of both θ and ψ, you could try to switch on evaporation and then vegetation effects (i.e. transpiration and canopy interception).
Best regards, Fabian
Hello Fabern,
Your explanations are going to be very helpful. Thank you very much
Hi Fabian,
Good day, I am sorry to bother you, but I have a couple more questions about the model.
using Plots, Measures; gr(); pl1 = plotamounts(simulation, :above_and_belowground, :showRWUcentroid) pl2 = plotisotopes(simulation, :d18O, (d18O = :auto, d2H = :auto), :showRWUcentroid) pl3 = plotforcingandstates(simulation)
I have been trying to export the results displayed in pl1 especially the "GWAT," into CSV data, but I cannot. I am also trying to extract evapotranspiration information from the model, but I can't identify what represents evaporation/evapotranspiration. I know it was calculated using the solar radiation data, but I am trying to generate water balance and would appreciate any tips on extracting the evaporation calculated by the model.
Thank you very much. Best Regards, Phebe
Hi Phebe,
Please have a look at the documentation of function get_amounts()
(previously to v0.9.8 it was called get_aboveground()
this should give you the amounts of the scalar state variables. From the documentation: "get_amounts() Returns a DataFrame with amounts of the inputs and state variables: PREC, GWAT, INTS, INTR, SNOW, SNOWLQ in mm and CC in MJm2."
For evaporation and transpiration: use the function get_water_partitioning()
. This will give you ETa as the sum of actual transpiration rate, and soil evaporation and evaporation from canopy-intercepted water or snow. All individual fluxes are also available in that DataFrame
.
Both of these functions are mentioned in the example script: https://fabern.github.io/LWFBrook90.jl/stable/generated/example-script-01/
Documentation is accessible for your version with ?get_water_partitioning
, or for the current version under https://fabern.github.io/LWFBrook90.jl/stable/function-docs/.
Hope that helps.
Hello Fabian,
Thank you for constantly helping out. I was able to extract the input and state variables, but I could not extract ETa using the function get_water_partitioning().
I keep getting the ERROR: UndefVarError: get_water_partitioning
not defined or the data frame returns empty.
I don´t know if this has to do with the version I am using (Julia v1.75.2), because get_amounts() did not work for me, but get_aboveground() worked.
Thank you.
What version of LWFBrook90.jl
are you using?
You need to have v 0.9.8 to use get_water_partitioning()
and get_amounts()
. Could you update it to v 0.9.8? Note that this would require at least Julia 1.8.
Alternatively you could define your own function that reproduces get_water_partitioning() with an older version, by getting inspiration from its implementation in the current version starting here: https://github.com/fabern/LWFBrook90.jl/blob/87c056758b96749c77d9006545dad387ae2e1c18/src/func_postprocess.jl#L1302
Okay Fabian. Thank you very much
Hello, I am trying to use the LWFBrook90.jl for hydrological analysis and, I keep encountering an error with the LoadSPAC command.
model1 = loadSPAC(input_path, inputh_prefix; simulate_isotopes = false) model1 = loadSPAC(input_path, inputh_prefix; simulate_isotopes = true)
while running any of those codes I get this error message
ERROR: thread = 1 error parsing DateTime around row = 1, col = 1: “1/1/2019,”, error=INVALID: OK | DELIMITED | INVALID_DELIMITER
I checked my dataset and it was arranged exactly as the demo, I tried to change the format but still didn't work. Please help.