BrianBGrant / DNDCv.CAN

This is our development version of DNDCv.CAN. The model is under ongoing development. Please report issues.
9 stars 4 forks source link

custom soil data #9

Closed RamiALBASHA closed 9 months ago

RamiALBASHA commented 9 months ago

Hi Brian, I would like to use custom soil data instead of selecting one of the 14 classes provided. I know that users can modify some inputs from the GUI but I wonder whether the "water tension", "beta" and "tetas" variable values would then change accordingly. I'm asking this question because I have created a script that calculates the hydrodynamic properties of soils based on their texture (using the rosetta pedo-transfer package) and I would like to automatically write custom soil data to the .dnd files for testing a large number of soil texture scenarios.

Could you kindely:

Thanks for your help.

Rami

BrianBGrant commented 9 months ago

Hi Rami,

You can create a heterogenous soil profile by creating a soil.spf file to link to in the dnd file that characterizes the soil up to 2m using the Graphics User Interface version of the model. The issue is that this file does not let you specify the parameters you are asking about. The model does not use water retention curves for calculating soil water flux so these parameters must be tied to older legacy code exploring this approach. I've looked through the code and while these parameters are read in by the input functions they are not utilized anywhere in the model presently. Within the current model framework you are limited to using Field Capacity, Wilting point, Ksat and porosity for defining soil hydrological characteristics. This probably isn't the answer you were hoping for however we did test implementing a Richards approach previously (Smith et al., 2020) in DNDC and didn't find it resulted in improved soil moisture status (and it significantly increased the input burden on the user).

RamiALBASHA commented 9 months ago

Hi Brian, Thanks for taking the time to explore the code and answer my question. The bucket type approach is indeed best suited to daily simulations and I'm rather relieved that the three parameters "water tension", "beta" and "tetas" are read but not used.

The other part of my question was not about using custom soil profiles (I will likely be using uniform profiles), but custom soil types (e.g. replacing the 14 soil types provided by any soil texture with used-defined texture (%sand, %silt, %clay) values). I have seen that the model expects to read only one of the soil library profiles (goining from 'soil_0' to 'soil_14') and produces a bug if a new id is provided to "__Soil_texture_ID" in the .dnd file.

Example, the following error message appears when I change the soil ID to a value other than the sequence [0, 14]: image image

I will give a try to create new soil data and implement them into the Soil_parameters.txt file and let you know if that works.

Best

RamiALBASHA commented 9 months ago

Hi Brian, I have done a few tests, and my understanding is the following:

All the files within the Library/Lib_soil directory are read but not used. I have even made the model run with empty soil data (in soil_1 file for example). What matters to the model is just to have an ID value for __Soil_texture_ID that, once concatenated with the string "soil_", refers to one of the soil library files under Library/. The model does not seem to use data from Soil_parameters.txt neither.

This means that the model only reads soil property data from the .dnd file under the "Soil_data" section which is good news. When running from console, the user should only pay attention to the value of __Soil_texture_ID and set it to any value between 0 and 14.

BrianBGrant commented 9 months ago

Hi Rami,

Have you considered using the heterogeneous soil profile to define unique soils (these can be referenced in the dnd file). That way you can leave the library soils alone.

(see interface in GUI) image

(see file structure) image

(see reference in dnd file) image

Best,

Brian

RamiALBASHA commented 9 months ago

Greate, thanks for the tip. Best, Rami