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

Change thickness of soil layers from outside the code #241

Closed
MostafaGomaa93 opened this issue Jul 9, 2024 · 5 comments
Closed

Change thickness of soil layers from outside the code #241

MostafaGomaa93 opened this issue Jul 9, 2024 · 5 comments
Assignees
Labels
code enhancement New feature or request

Comments

@MostafaGomaa93
Copy link
Contributor

MostafaGomaa93 commented Jul 9, 2024

The thickness of the soil layers is calculated in the Dtrmn_Z function. The calculations are fixed (first 1-3 layers with thickness = 1 cm, next 4-14 layers with thickness = 2 cm, ...... and from layer 42-end, thickness is 20 cm).

I was thinking of an option to import the layers' thickness from an external input file (e.g. txt file) instead of hardcoding them in the code. This will allow for some flexibility, which is highly needed when we have a deeper soil profile (e.g. 10 or 20 m), so to increase a bit the layers' thickness (especially for deeper layers) and consequently minimize the running time.

@yijianzeng, what do you think? If agreed, I can discuss further with @SarahAlidoost about the best input option to use (txt, netcdf, whatever) and then we can modify the Dtrmn_Z function. We can keep the Dtrmn_Z function as default and use the external input as an option if the user needs

@Crystal-szj
Copy link
Contributor

Crystal-szj commented Jul 10, 2024

Hi @MostafaGomaa93, Thanks for opening this issue.
@yijianzeng @SarahAlidoost The value of Tot_Depth is involved in the calculation of soil layers thickness, and it is currently hardcoded in STEMMUS-SCOPE with a value of 500 cm. This fixed value may not be suitable for all sites. I think we should improve it as well.

relates #237

@SarahAlidoost
Copy link
Member

lets create a csv file to store the soil layer information and add it to the repository under a new folder"data" (perhaps this can be moved to a zenodo entry).

@yijianzeng
Copy link
Contributor

@MostafaGomaa93 @SarahAlidoost @Crystal-szj This sounds tangible to me. One would like to have a more 'generic'/'flexible' Dtrmn_Z, so the layer thickness as well as the total depth can be defined by the end-user via configure file, or a csv file.

In my opinion, csv file can do, but then it is then again creating additional file, on top of the config file, so question here:
Shall we include all info into one config file?

One principle should be followed. The top layer should be sufficiently fine (e.g., 1mm-5mm, for the top 1cm or so), and then increase the thickness in an exponential manner, which is usually an optimal combination between the number of layers and the need for an accurate numerical solution of STEMMUS.

@SarahAlidoost
Copy link
Member

@MostafaGomaa93 @SarahAlidoost @Crystal-szj This sounds tangible to me. One would like to have a more 'generic'/'flexible' Dtrmn_Z, so the layer thickness as well as the total depth can be defined by the end-user via configure file, or a csv file.

In my opinion, csv file can do, but then it is then again creating additional file, on top of the config file, so question here: Shall we include all info into one config file?

Right, but the current configuration file is a txt file, which does not have the flexibility needed to add structured data. The path to the CSV file can be included in the configuration file. Switching to other formats for example YAML format would allow for better support of these types of data, see my previous comment about adding variables to the config file.

@MostafaGomaa93
Copy link
Contributor Author

MostafaGomaa93 commented Jul 25, 2024

A new branch with a new pull request is pushed to

  • add a new function that reads a new csv for importing soil layers settings. If the new csv does not exist, the default soil layer settings is activated
  • add a new function to check the model run per time step

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants