Skip to content

Unable to create custom soil profile #185

@Andermutu

Description

@Andermutu

I'm trying to create a custom soil using aquacrop==3.0.9 :

import os
os.environ['DEVELOPMENT'] = 'DEVELOPMENT'
from aquacrop import Soil 

thickeness = 0.1
local_soil = Soil('custom',dz=[thickeness]*12,cn=46,rew=7)

for comp in range(local_soil.nComp):

    local_soil.add_layer_from_texture(thickness=thickeness, Sand=10, Clay=35, OrgMat=2.5,penetrability=100)

print(local_soil.profile)

The expected output of local_soil.profile is:

    Comp  Layer   dz  dzsum  zBot  z_top  zMid  th_dry  th_wp  th_fc   th_s   Ksat  penetrability   tau
0      0    1.0  0.1    0.1   0.1    0.0  0.05  0.1075  0.215  0.382  0.511  136.4          100.0  0.48
1      1    2.0  0.1    0.2   0.2    0.1  0.15  0.1075  0.215  0.382  0.511  136.4          100.0  0.48
2      2    3.0  0.1    0.3   0.3    0.2  0.25  0.1075  0.215  0.382  0.511  136.4          100.0  0.48
3      3    4.0  0.1    0.4   0.4    0.3  0.35  0.1075  0.215  0.382  0.511  136.4          100.0  0.48
4      4    5.0  0.1    0.5   0.5    0.4  0.45  0.1075  0.215  0.382  0.511  136.4          100.0  0.48
5      5    6.0  0.1    0.6   0.6    0.5  0.55  0.1075  0.215  0.382  0.511  136.4          100.0  0.48
6      6    7.0  0.1    0.7   0.7    0.6  0.65  0.1075  0.215  0.382  0.511  136.4          100.0  0.48
7      7    8.0  0.1    0.8   0.8    0.7  0.75  0.1075  0.215  0.382  0.511  136.4          100.0  0.48
8      8    9.0  0.1    0.9   0.9    0.8  0.85  0.1075  0.215  0.382  0.511  136.4          100.0  0.48
9      9   10.0  0.1    1.0   1.0    0.9  0.95  0.1075  0.215  0.382  0.511  136.4          100.0  0.48
10    10   11.0  0.1    1.1   1.1    1.0  1.05  0.1075  0.215  0.382  0.511  136.4          100.0  0.48
11    11   12.0  0.1    1.2   1.2    1.1  1.15  0.1075  0.215  0.382  0.511  136.4          100.0  0.48

But I get:

    Comp  Layer   dz  dzsum  zBot  z_top  zMid  th_dry  th_wp  th_fc   th_s   Ksat  penetrability   tau
0      0    1.0  0.1    0.1   0.1    0.0  0.05  0.1075  0.215  0.382  0.511  136.4          100.0  0.48
1      1    2.0  0.1    0.2   0.2    0.1  0.15  0.1075  0.215  0.382  0.511  136.4          100.0  0.48
2      2    3.0  0.1    0.3   0.3    0.2  0.25  0.1075  0.215  0.382  0.511  136.4          100.0  0.48
3      3    4.0  0.1    0.4   0.4    0.3  0.35  0.1075  0.215  0.382  0.511  136.4          100.0  0.48
4      4    5.0  0.1    0.5   0.5    0.4  0.45  0.1075  0.215  0.382  0.511  136.4          100.0  0.48
5      5    6.0  0.1    0.6   0.6    0.5  0.55  0.1075  0.215  0.382  0.511  136.4          100.0  0.48
6      6    7.0  0.1    0.7   0.7    0.6  0.65  0.1075  0.215  0.382  0.511  136.4          100.0  0.48
7      7    NaN  0.1    0.8   0.8    0.7  0.75     NaN    NaN    NaN    NaN    NaN            NaN   NaN
8      8    NaN  0.1    0.9   0.9    0.8  0.85     NaN    NaN    NaN    NaN    NaN            NaN   NaN
9      9    NaN  0.1    1.0   1.0    0.9  0.95     NaN    NaN    NaN    NaN    NaN            NaN   NaN
10    10    NaN  0.1    1.1   1.1    1.0  1.05     NaN    NaN    NaN    NaN    NaN            NaN   NaN
11    11    NaN  0.1    1.2   1.2    1.1  1.15     NaN    NaN    NaN    NaN    NaN            NaN   NaN

If I manually create a soil with local_soil = Soil('custom',dz=[0.1]*12,cn=46,rew=7) I'm able to add layers with local_soil.add_layer_from_texture(thickness=0.1, Sand=10, Clay=35, OrgMat=2.5,penetrability=100) but again until layer 7, no more. If I try to add a layer increasing the thickness from 0.1 to 0.1000000001 I can configure all the soil profile. So, is this behaviour normal? Am I misunderstanding how to configure a custom soil profile?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions