diff --git a/docs/src/ptf-catalog/sources/dijkerman1988.md b/docs/src/ptf-catalog/sources/dijkerman1988.md new file mode 100644 index 0000000..1cca832 --- /dev/null +++ b/docs/src/ptf-catalog/sources/dijkerman1988.md @@ -0,0 +1,101 @@ +--- +# @generated by ptfkit-codegen; DO NOT EDIT. + +title: PTF source dijkerman1988 +nav-title: dijkerman1988 +--- + +# Dijkerman (1988), texture-based gravimetric water retention for Sierra Leone soils. + +## Source + +Dijkerman, J. C. (1988). An Ustult-Aquult-Tropept catena in Sierra Leone, West Africa, II. Land qualities and land evaluation. Geoderma, 42, 29-49. + +[DOI: 10.1016/0016-7061(88)90021-3](https://doi.org/10.1016/0016-7061(88)90021-3) + +## Scope + +**Territory:** Sierra Leone, West Africa + +**Dataset:** 166 soil samples from 42 soil profiles reported by Odell et al. (1974). Samples with organic carbon greater than 4% were excluded from the regressions. + +## Functions + +### `calc_ptf_dijkerman1988` + +Estimate gravimetric water contents at 15 bar and one-third bar from texture. + +**Status:** `ready-for-implementation` + +**Prediction target:** Gravimetric water contents at 15 bar and one-third bar. + +#### Inputs + +| Name | Type | Unit | Domain | Description | +| --- | --- | --- | --- | --- | +| `clay` | `number` | % | 1.3 <= clay <= 66.6 | Clay content by mass. The supplied research notes report this observed calibration range from a reconstruction of Odell et al. (1974), Appendix B. | +| `sand` | `number` | % | 0.5 <= sand <= 96.4 | Sand content by mass. The supplied research notes report this observed calibration range from a reconstruction of Odell et al. (1974), Appendix B. | + +#### Outputs + +| Name | Unit | Domain | Description | +| --- | --- | --- | --- | +| `water_content_15_bar` | % | — | Gravimetric moisture content at 15 bar, in weight percentage. | +| `water_content_one_third_bar` | % | — | Gravimetric moisture content at one-third bar, in weight percentage. | + +!!! note + + Sand, silt, and clay percentages must sum to 100; sand plus clay must not exceed 100. + +!!! note + + The regression dataset excludes samples containing more than 4% organic carbon. + +!!! note + + These are two point predictions, not a continuous retention curve. + +!!! warning + + The paper describes these relationships as rough guides. + +!!! warning + + One-third-bar moisture content may underestimate field capacity and available moisture in these soils. + +!!! warning + + The observed marginal calibration ranges do not establish validity for every joint texture combination. + +### `calc_ptf_dijkerman1988_available_water` + +Estimate the gravimetric available moisture between one-third bar and 15 bar. + +**Status:** `ready-for-implementation` + +**Prediction target:** Gravimetric available moisture between one-third bar and 15 bar. + +#### Inputs + +| Name | Type | Unit | Domain | Description | +| --- | --- | --- | --- | --- | +| `clay` | `number` | % | 1.3 <= clay <= 66.6 | Clay content by mass. The supplied research notes report this observed calibration range from a reconstruction of Odell et al. (1974), Appendix B. | +| `silt` | `number` | % | 0 <= silt <= 100; 0.5 <= 100 - clay - silt <= 96.4 | Silt content by mass; sand, silt, and clay sum to 100%. No separate observed silt calibration range is supplied. | + +#### Outputs + +| Name | Unit | Domain | Description | +| --- | --- | --- | --- | +| `available_water` | % | — | Difference in gravimetric moisture contents, in weight percentage points. | + +!!! note + + This estimates a gravimetric difference, not profile water storage or a volumetric fraction. + +!!! note + + Use soil material with organic carbon at most 4% and physically consistent texture percentages. + +!!! warning + + Available moisture estimated using one-third bar may be somewhat low according to the paper. diff --git a/docs/src/ptf-catalog/sources/index.md b/docs/src/ptf-catalog/sources/index.md index e1cc90d..75ac4b6 100644 --- a/docs/src/ptf-catalog/sources/index.md +++ b/docs/src/ptf-catalog/sources/index.md @@ -17,6 +17,7 @@ Each page describes the source, scope, inputs, outputs, status, and limitations | [Clapp and Hornberger (1978) representative soil hydraulic parameters by texture.](./clapp1978.md) | United States | 1 | | [Cosby et al. (1984), United States.](./cosby1984.md) | United States | 1 | | [Dharumarajan et al. (2019) hydraulic PTFs for the Karnataka Plateau.](./dharumarajan2019.md) | Karnataka Plateau, India | 5 | +| [Dijkerman (1988), texture-based gravimetric water retention for Sierra Leone soils.](./dijkerman1988.md) | Sierra Leone, West Africa | 2 | | [Ferrer Julià et al. (2004), saturated-conductivity PTFs for Spanish soils.](./ferrerjulia2004.md) | Spanish mainland on the Iberian Peninsula | 41 | | [Point water-retention regressions for tropical Sri Lankan soils.](./gunarathna2019.md) | Tropical Sri Lanka. | 11 | | [Hodnett & Tomasella (2002), tropical-soil regressions for four van Genuchten parameters.](./hodnett2002.md) | Tropical soils between approximately 25 degrees N and 25 degrees S. | 1 | diff --git a/docs/src/reference/c/functions.md b/docs/src/reference/c/functions.md index a7e2b99..a41875f 100644 --- a/docs/src/reference/c/functions.md +++ b/docs/src/reference/c/functions.md @@ -34,6 +34,8 @@ title: C function index | [`calc_ptf_dharumarajan2019_nkp_clay`](headers/dharumarajan2019.md#function-calc_ptf_dharumarajan2019_nkp_clay) | Estimate Northern Karnataka field capacity and wilting point from clay. | [``](headers/dharumarajan2019.md) | | [`calc_ptf_dharumarajan2019_skp`](headers/dharumarajan2019.md#function-calc_ptf_dharumarajan2019_skp) | Estimate field capacity and wilting point for Southern Karnataka soils. | [``](headers/dharumarajan2019.md) | | [`calc_ptf_dharumarajan2019_skp_clay`](headers/dharumarajan2019.md#function-calc_ptf_dharumarajan2019_skp_clay) | Estimate Southern Karnataka field capacity and wilting point from clay. | [``](headers/dharumarajan2019.md) | +| [`calc_ptf_dijkerman1988`](headers/dijkerman1988.md#function-calc_ptf_dijkerman1988) | Estimate gravimetric water contents at 15 bar and one-third bar from texture. | [``](headers/dijkerman1988.md) | +| [`calc_ptf_dijkerman1988_available_water`](headers/dijkerman1988.md#function-calc_ptf_dijkerman1988_available_water) | Estimate the gravimetric available moisture between one-third bar and 15 bar. | [``](headers/dijkerman1988.md) | | [`calc_ptf_ferrerjulia2004_calcaric_fluvisol_sand`](headers/ferrerjulia2004.md#function-calc_ptf_ferrerjulia2004_calcaric_fluvisol_sand) | Estimate saturated conductivity for Calcaric Fluvisol from sand content. | [``](headers/ferrerjulia2004.md) | | [`calc_ptf_ferrerjulia2004_calcaric_fluvisol_texture_organic_matter`](headers/ferrerjulia2004.md#function-calc_ptf_ferrerjulia2004_calcaric_fluvisol_texture_organic_matter) | Estimate saturated conductivity for Calcaric Fluvisol from texture and organic matter. | [``](headers/ferrerjulia2004.md) | | [`calc_ptf_ferrerjulia2004_calcaric_regosol_sand`](headers/ferrerjulia2004.md#function-calc_ptf_ferrerjulia2004_calcaric_regosol_sand) | Estimate saturated conductivity for Calcaric Regosol from sand content. | [``](headers/ferrerjulia2004.md) | diff --git a/docs/src/reference/c/headers/dijkerman1988.md b/docs/src/reference/c/headers/dijkerman1988.md new file mode 100644 index 0000000..e926e34 --- /dev/null +++ b/docs/src/reference/c/headers/dijkerman1988.md @@ -0,0 +1,117 @@ +--- +title: "dijkerman1988.h" +--- + + + +# `` + +```c +#include +``` + +Dijkerman (1988), texture-based gravimetric water retention for Sierra Leone soils. + +## Source + +Dijkerman, J. C. (1988). An Ustult-Aquult-Tropept catena in Sierra Leone, West Africa, II. Land qualities and land evaluation. Geoderma, 42, 29-49. + +[DOI: 10.1016/0016-7061(88)90021-3](https://doi.org/10.1016/0016-7061(88)90021-3) + +## Scope + +**Territory:** Sierra Leone, West Africa + +**Dataset:** 166 soil samples from 42 soil profiles reported by Odell et al. (1974). Samples with organic carbon greater than 4% were excluded from the regressions. + +[PTF catalog page](../../../ptf-catalog/sources/dijkerman1988.md) + +## `dijkerman1988_water_content` + +```c +typedef struct { + double water_content_15_bar; + double water_content_one_third_bar; + } dijkerman1988_water_content; +``` + +| Field | Description | +| --- | --- | +| `water_content_15_bar` | Gravimetric moisture content at 15 bar, in weight percentage. (%) | +| `water_content_one_third_bar` | Gravimetric moisture content at one-third bar, in weight percentage. (%) | + +## Functions + +### `calc_ptf_dijkerman1988` {#function-calc_ptf_dijkerman1988} + +Estimate gravimetric water contents at 15 bar and one-third bar from texture. + +```c +static inline dijkerman1988_water_content calc_ptf_dijkerman1988(double clay, double sand); +``` + +#### Parameters + +| Name | Direction | Description | +| --- | --- | --- | +| `clay` | in | Clay content by mass. The supplied research notes report this observed calibration range from a reconstruction of Odell et al. (1974), Appendix B. (%) | +| `sand` | in | Sand content by mass. The supplied research notes report this observed calibration range from a reconstruction of Odell et al. (1974), Appendix B. (%) | + +#### Returns + +A `dijkerman1988_water_content` value. + +!!! note + + Sand, silt, and clay percentages must sum to 100; sand plus clay must not exceed 100. + +!!! note + + The regression dataset excludes samples containing more than 4% organic carbon. + +!!! note + + These are two point predictions, not a continuous retention curve. + +!!! warning + + The paper describes these relationships as rough guides. + +!!! warning + + One-third-bar moisture content may underestimate field capacity and available moisture in these soils. + +!!! warning + + The observed marginal calibration ranges do not establish validity for every joint texture combination. + +### `calc_ptf_dijkerman1988_available_water` {#function-calc_ptf_dijkerman1988_available_water} + +Estimate the gravimetric available moisture between one-third bar and 15 bar. + +```c +static inline double calc_ptf_dijkerman1988_available_water(double clay, double silt); +``` + +#### Parameters + +| Name | Direction | Description | +| --- | --- | --- | +| `clay` | in | Clay content by mass. The supplied research notes report this observed calibration range from a reconstruction of Odell et al. (1974), Appendix B. (%) | +| `silt` | in | Silt content by mass; sand, silt, and clay sum to 100%. No separate observed silt calibration range is supplied. (%) | + +#### Returns + +Difference in gravimetric moisture contents, in weight percentage points. (%) + +!!! note + + This estimates a gravimetric difference, not profile water storage or a volumetric fraction. + +!!! note + + Use soil material with organic carbon at most 4% and physically consistent texture percentages. + +!!! warning + + Available moisture estimated using one-third bar may be somewhat low according to the paper. diff --git a/docs/src/reference/c/headers/ptfkit.md b/docs/src/reference/c/headers/ptfkit.md index 6e3412e..a537858 100644 --- a/docs/src/reference/c/headers/ptfkit.md +++ b/docs/src/reference/c/headers/ptfkit.md @@ -21,6 +21,7 @@ This umbrella header aggregates every public ptfkit source header. Include an in - [``](clapp1978.md) — Clapp and Hornberger (1978) representative soil hydraulic parameters by texture. - [``](cosby1984.md) — Cosby et al. (1984), United States. - [``](dharumarajan2019.md) — Dharumarajan et al. (2019) hydraulic PTFs for the Karnataka Plateau. +- [``](dijkerman1988.md) — Dijkerman (1988), texture-based gravimetric water retention for Sierra Leone soils. - [``](ferrerjulia2004.md) — Ferrer Julià et al. (2004), saturated-conductivity PTFs for Spanish soils. - [``](gunarathna2019.md) — Point water-retention regressions for tropical Sri Lankan soils. - [``](hodnett2002.md) — Hodnett & Tomasella (2002), tropical-soil regressions for four van Genuchten parameters. diff --git a/docs/src/reference/c/index.md b/docs/src/reference/c/index.md index df3c833..6eabe45 100644 --- a/docs/src/reference/c/index.md +++ b/docs/src/reference/c/index.md @@ -18,6 +18,7 @@ ptfkit's C API is organized around installed headers. - [``](headers/clapp1978.md) — Clapp and Hornberger (1978) representative soil hydraulic parameters by texture. - [``](headers/cosby1984.md) — Cosby et al. (1984), United States. - [``](headers/dharumarajan2019.md) — Dharumarajan et al. (2019) hydraulic PTFs for the Karnataka Plateau. +- [``](headers/dijkerman1988.md) — Dijkerman (1988), texture-based gravimetric water retention for Sierra Leone soils. - [``](headers/ferrerjulia2004.md) — Ferrer Julià et al. (2004), saturated-conductivity PTFs for Spanish soils. - [``](headers/gunarathna2019.md) — Point water-retention regressions for tropical Sri Lankan soils. - [``](headers/hodnett2002.md) — Hodnett & Tomasella (2002), tropical-soil regressions for four van Genuchten parameters. diff --git a/docs/src/reference/cpp/functions.md b/docs/src/reference/cpp/functions.md index ce6dcf5..8d075fa 100644 --- a/docs/src/reference/cpp/functions.md +++ b/docs/src/reference/cpp/functions.md @@ -34,6 +34,8 @@ title: C++ function index | [`ptfkit::dharumarajan2019::calc_ptf_dharumarajan2019_nkp_clay`](modules/dharumarajan2019.md#function-calc_ptf_dharumarajan2019_nkp_clay) | Estimate Northern Karnataka field capacity and wilting point from clay. | [`ptfkit.dharumarajan2019`](modules/dharumarajan2019.md) | | [`ptfkit::dharumarajan2019::calc_ptf_dharumarajan2019_skp`](modules/dharumarajan2019.md#function-calc_ptf_dharumarajan2019_skp) | Estimate field capacity and wilting point for Southern Karnataka soils. | [`ptfkit.dharumarajan2019`](modules/dharumarajan2019.md) | | [`ptfkit::dharumarajan2019::calc_ptf_dharumarajan2019_skp_clay`](modules/dharumarajan2019.md#function-calc_ptf_dharumarajan2019_skp_clay) | Estimate Southern Karnataka field capacity and wilting point from clay. | [`ptfkit.dharumarajan2019`](modules/dharumarajan2019.md) | +| [`ptfkit::dijkerman1988::calc_ptf_dijkerman1988`](modules/dijkerman1988.md#function-calc_ptf_dijkerman1988) | Estimate gravimetric water contents at 15 bar and one-third bar from texture. | [`ptfkit.dijkerman1988`](modules/dijkerman1988.md) | +| [`ptfkit::dijkerman1988::calc_ptf_dijkerman1988_available_water`](modules/dijkerman1988.md#function-calc_ptf_dijkerman1988_available_water) | Estimate the gravimetric available moisture between one-third bar and 15 bar. | [`ptfkit.dijkerman1988`](modules/dijkerman1988.md) | | [`ptfkit::ferrerjulia2004::calc_ptf_ferrerjulia2004_calcaric_fluvisol_sand`](modules/ferrerjulia2004.md#function-calc_ptf_ferrerjulia2004_calcaric_fluvisol_sand) | Estimate saturated conductivity for Calcaric Fluvisol from sand content. | [`ptfkit.ferrerjulia2004`](modules/ferrerjulia2004.md) | | [`ptfkit::ferrerjulia2004::calc_ptf_ferrerjulia2004_calcaric_fluvisol_texture_organic_matter`](modules/ferrerjulia2004.md#function-calc_ptf_ferrerjulia2004_calcaric_fluvisol_texture_organic_matter) | Estimate saturated conductivity for Calcaric Fluvisol from texture and organic matter. | [`ptfkit.ferrerjulia2004`](modules/ferrerjulia2004.md) | | [`ptfkit::ferrerjulia2004::calc_ptf_ferrerjulia2004_calcaric_regosol_sand`](modules/ferrerjulia2004.md#function-calc_ptf_ferrerjulia2004_calcaric_regosol_sand) | Estimate saturated conductivity for Calcaric Regosol from sand content. | [`ptfkit.ferrerjulia2004`](modules/ferrerjulia2004.md) | diff --git a/docs/src/reference/cpp/index.md b/docs/src/reference/cpp/index.md index 966a7c1..1b87130 100644 --- a/docs/src/reference/cpp/index.md +++ b/docs/src/reference/cpp/index.md @@ -18,6 +18,7 @@ ptfkit's C++ API is organized around C++23 modules. - [`ptfkit.clapp1978`](modules/clapp1978.md) — Clapp and Hornberger (1978) representative soil hydraulic parameters by texture. - [`ptfkit.cosby1984`](modules/cosby1984.md) — Cosby et al. (1984), United States. - [`ptfkit.dharumarajan2019`](modules/dharumarajan2019.md) — Dharumarajan et al. (2019) hydraulic PTFs for the Karnataka Plateau. +- [`ptfkit.dijkerman1988`](modules/dijkerman1988.md) — Dijkerman (1988), texture-based gravimetric water retention for Sierra Leone soils. - [`ptfkit.ferrerjulia2004`](modules/ferrerjulia2004.md) — Ferrer Julià et al. (2004), saturated-conductivity PTFs for Spanish soils. - [`ptfkit.gunarathna2019`](modules/gunarathna2019.md) — Point water-retention regressions for tropical Sri Lankan soils. - [`ptfkit.hodnett2002`](modules/hodnett2002.md) — Hodnett & Tomasella (2002), tropical-soil regressions for four van Genuchten parameters. diff --git a/docs/src/reference/cpp/modules/dijkerman1988.md b/docs/src/reference/cpp/modules/dijkerman1988.md new file mode 100644 index 0000000..7dae145 --- /dev/null +++ b/docs/src/reference/cpp/modules/dijkerman1988.md @@ -0,0 +1,122 @@ +--- +# @generated by ptfkit-codegen; DO NOT EDIT. + +title: C++ module ptfkit.dijkerman1988 +nav-title: ptfkit.dijkerman1988 +--- + +# `ptfkit.dijkerman1988` + +```cpp +import ptfkit.dijkerman1988; +``` + +**Exported namespace:** `ptfkit::dijkerman1988` + +Dijkerman (1988), texture-based gravimetric water retention for Sierra Leone soils. + +## Source + +Dijkerman, J. C. (1988). An Ustult-Aquult-Tropept catena in Sierra Leone, West Africa, II. Land qualities and land evaluation. Geoderma, 42, 29-49. + +[DOI: 10.1016/0016-7061(88)90021-3](https://doi.org/10.1016/0016-7061(88)90021-3) + +## Scope + +**Territory:** Sierra Leone, West Africa + +**Dataset:** 166 soil samples from 42 soil profiles reported by Odell et al. (1974). Samples with organic carbon greater than 4% were excluded from the regressions. + +[PTF catalog page](../../../ptf-catalog/sources/dijkerman1988.md) + +## `Dijkerman1988WaterContent` + +```cpp +struct Dijkerman1988WaterContent { + double water_content_15_bar; + double water_content_one_third_bar; +}; +``` + +| Field | Description | +| --- | --- | +| `water_content_15_bar` | Gravimetric moisture content at 15 bar, in weight percentage. (%) | +| `water_content_one_third_bar` | Gravimetric moisture content at one-third bar, in weight percentage. (%) | + +## Functions + +### `calc_ptf_dijkerman1988` {#function-calc_ptf_dijkerman1988} + +Estimate gravimetric water contents at 15 bar and one-third bar from texture. + +```cpp +[[nodiscard]] +inline Dijkerman1988WaterContent calc_ptf_dijkerman1988(double clay, double sand) +``` + +#### Parameters + +| Name | Description | +| --- | --- | +| `clay` | Clay content by mass. The supplied research notes report this observed calibration range from a reconstruction of Odell et al. (1974), Appendix B. (%) | +| `sand` | Sand content by mass. The supplied research notes report this observed calibration range from a reconstruction of Odell et al. (1974), Appendix B. (%) | + +#### Returns + +A `Dijkerman1988WaterContent` value. + +!!! note + + Sand, silt, and clay percentages must sum to 100; sand plus clay must not exceed 100. + +!!! note + + The regression dataset excludes samples containing more than 4% organic carbon. + +!!! note + + These are two point predictions, not a continuous retention curve. + +!!! warning + + The paper describes these relationships as rough guides. + +!!! warning + + One-third-bar moisture content may underestimate field capacity and available moisture in these soils. + +!!! warning + + The observed marginal calibration ranges do not establish validity for every joint texture combination. + +### `calc_ptf_dijkerman1988_available_water` {#function-calc_ptf_dijkerman1988_available_water} + +Estimate the gravimetric available moisture between one-third bar and 15 bar. + +```cpp +[[nodiscard]] +inline double calc_ptf_dijkerman1988_available_water(double clay, double silt) +``` + +#### Parameters + +| Name | Description | +| --- | --- | +| `clay` | Clay content by mass. The supplied research notes report this observed calibration range from a reconstruction of Odell et al. (1974), Appendix B. (%) | +| `silt` | Silt content by mass; sand, silt, and clay sum to 100%. No separate observed silt calibration range is supplied. (%) | + +#### Returns + +Difference in gravimetric moisture contents, in weight percentage points. (%) + +!!! note + + This estimates a gravimetric difference, not profile water storage or a volumetric fraction. + +!!! note + + Use soil material with organic carbon at most 4% and physically consistent texture percentages. + +!!! warning + + Available moisture estimated using one-third bar may be somewhat low according to the paper. diff --git a/docs/src/reference/cpp/modules/ptfkit.md b/docs/src/reference/cpp/modules/ptfkit.md index 6db4a9a..ba4a58c 100644 --- a/docs/src/reference/cpp/modules/ptfkit.md +++ b/docs/src/reference/cpp/modules/ptfkit.md @@ -22,6 +22,7 @@ This umbrella module re-exports every public ptfkit source module. Import an ind - [`ptfkit.clapp1978`](clapp1978.md) — Clapp and Hornberger (1978) representative soil hydraulic parameters by texture. - [`ptfkit.cosby1984`](cosby1984.md) — Cosby et al. (1984), United States. - [`ptfkit.dharumarajan2019`](dharumarajan2019.md) — Dharumarajan et al. (2019) hydraulic PTFs for the Karnataka Plateau. +- [`ptfkit.dijkerman1988`](dijkerman1988.md) — Dijkerman (1988), texture-based gravimetric water retention for Sierra Leone soils. - [`ptfkit.ferrerjulia2004`](ferrerjulia2004.md) — Ferrer Julià et al. (2004), saturated-conductivity PTFs for Spanish soils. - [`ptfkit.gunarathna2019`](gunarathna2019.md) — Point water-retention regressions for tropical Sri Lankan soils. - [`ptfkit.hodnett2002`](hodnett2002.md) — Hodnett & Tomasella (2002), tropical-soil regressions for four van Genuchten parameters. diff --git a/docs/src/reference/python/dijkerman1988.md b/docs/src/reference/python/dijkerman1988.md new file mode 100644 index 0000000..ba8ae6e --- /dev/null +++ b/docs/src/reference/python/dijkerman1988.md @@ -0,0 +1,8 @@ +--- +# @generated by ptfkit-codegen; DO NOT EDIT. + +title: Python module ptfkit.dijkerman1988 +nav-title: ptfkit.dijkerman1988 +--- + +::: ptfkit.dijkerman1988 diff --git a/docs/src/reference/python/index.md b/docs/src/reference/python/index.md index 75f5340..0869ee4 100644 --- a/docs/src/reference/python/index.md +++ b/docs/src/reference/python/index.md @@ -17,6 +17,7 @@ ptfkit's Python API is organized around public source modules. - [`ptfkit.clapp1978`](clapp1978.md) — Clapp and Hornberger (1978) representative soil hydraulic parameters by texture. - [`ptfkit.cosby1984`](cosby1984.md) — Cosby et al. (1984), United States. - [`ptfkit.dharumarajan2019`](dharumarajan2019.md) — Dharumarajan et al. (2019) hydraulic PTFs for the Karnataka Plateau. +- [`ptfkit.dijkerman1988`](dijkerman1988.md) — Dijkerman (1988), texture-based gravimetric water retention for Sierra Leone soils. - [`ptfkit.ferrerjulia2004`](ferrerjulia2004.md) — Ferrer Julià et al. (2004), saturated-conductivity PTFs for Spanish soils. - [`ptfkit.gunarathna2019`](gunarathna2019.md) — Point water-retention regressions for tropical Sri Lankan soils. - [`ptfkit.hodnett2002`](hodnett2002.md) — Hodnett & Tomasella (2002), tropical-soil regressions for four van Genuchten parameters. diff --git a/specs/functions/dijkerman1988.yaml b/specs/functions/dijkerman1988.yaml new file mode 100644 index 0000000..0f8b64b --- /dev/null +++ b/specs/functions/dijkerman1988.yaml @@ -0,0 +1,236 @@ +source: + summary: Dijkerman (1988), texture-based gravimetric water retention for Sierra Leone soils. + citation_apa: >- + Dijkerman, J. C. (1988). An Ustult-Aquult-Tropept catena in Sierra Leone, + West Africa, II. Land qualities and land evaluation. Geoderma, 42, 29-49. + doi: + identifier: 10.1016/0016-7061(88)90021-3 + url: https://doi.org/10.1016/0016-7061(88)90021-3 +scope: + territory: Sierra Leone, West Africa + dataset: >- + 166 soil samples from 42 soil profiles reported by Odell et al. (1974). + Samples with organic carbon greater than 4% were excluded from the regressions. +$defs: + Sand: + name: sand + symbol: x_2 + unit: '%' + domain: 0.5 <= sand <= 96.4 + description: >- + Sand content by mass. The supplied research notes report this observed + calibration range from a reconstruction of Odell et al. (1974), Appendix B. + Clay: + name: clay + symbol: x_1 + unit: '%' + domain: 1.3 <= clay <= 66.6 + description: >- + Clay content by mass. The supplied research notes report this observed + calibration range from a reconstruction of Odell et al. (1974), Appendix B. +functions: + - name: calc_ptf_dijkerman1988 + status: ready-for-implementation + public_api: + name: calc_ptf_dijkerman1988 + result_class: Dijkerman1988WaterContent + summary: Estimate gravimetric water contents at 15 bar and one-third bar from texture. + scope: + prediction_target: Gravimetric water contents at 15 bar and one-third bar. + models: + h_theta: null + k_h: null + inputs: + - $ref: '#/$defs/Clay' + - $ref: '#/$defs/Sand' + outputs: + type: record + name: Dijkerman1988WaterContent + fields: + - name: water_content_15_bar + quantity: gravimetric_water_content + symbol: y_1 + unit: mass_percent + reported_unit: '%' + domain: null + description: Gravimetric moisture content at 15 bar, in weight percentage. + - name: water_content_one_third_bar + quantity: gravimetric_water_content + symbol: y_2 + unit: mass_percent + reported_unit: '%' + domain: null + description: Gravimetric moisture content at one-third bar, in weight percentage. + verification_cases: + - id: veeneklaas_table_2_2_a + kind: published + inputs: {clay: 5.0, sand: 92.5} + expected: {water_content_15_bar: 2.7, water_content_one_third_bar: 4.6} + source_location: Veeneklaas et al. (1991), Table 2.2, row A, PDF page index 15; transcribed in supplied research notes. + notes: Published g/kg outputs divided by 10 to obtain mass percent. + - id: veeneklaas_table_2_2_b + kind: published + inputs: {clay: 12.5, sand: 77.5} + expected: {water_content_15_bar: 5.6, water_content_one_third_bar: 9.8} + source_location: Veeneklaas et al. (1991), Table 2.2, row B, PDF page index 15; transcribed in supplied research notes. + notes: Published g/kg outputs divided by 10 to obtain mass percent. + - id: veeneklaas_table_2_2_c + kind: published + inputs: {clay: 10.0, sand: 60.0} + expected: {water_content_15_bar: 4.6, water_content_one_third_bar: 16.0} + source_location: Veeneklaas et al. (1991), Table 2.2, row C, PDF page index 15; transcribed in supplied research notes. + notes: Published g/kg outputs divided by 10 to obtain mass percent. + - id: veeneklaas_table_2_2_d + kind: published + inputs: {clay: 27.5, sand: 62.5} + expected: {water_content_15_bar: 11.5, water_content_one_third_bar: 15.1} + source_location: Veeneklaas et al. (1991), Table 2.2, row D, PDF page index 15; transcribed in supplied research notes. + notes: Published g/kg outputs divided by 10 to obtain mass percent. + - id: veeneklaas_table_2_2_e + kind: published + inputs: {clay: 42.5, sand: 10.0} + expected: {water_content_15_bar: 17.3, water_content_one_third_bar: 33.5} + source_location: Veeneklaas et al. (1991), Table 2.2, row E, PDF page index 15; transcribed in supplied research notes. + notes: Published g/kg outputs divided by 10 to obtain mass percent. + - id: veeneklaas_table_2_2_f + kind: published + inputs: {clay: 32.5, sand: 32.5} + expected: {water_content_15_bar: 13.4, water_content_one_third_bar: 25.6} + source_location: Veeneklaas et al. (1991), Table 2.2, row F, PDF page index 15; transcribed in supplied research notes. + notes: Published g/kg outputs divided by 10 to obtain mass percent. + - id: veeneklaas_table_2_2_g + kind: published + inputs: {clay: 17.5, sand: 38.5} + expected: {water_content_15_bar: 7.6, water_content_one_third_bar: 23.5} + source_location: Veeneklaas et al. (1991), Table 2.2, row G, PDF page index 15; transcribed in supplied research notes. + notes: Published g/kg outputs divided by 10 to obtain mass percent. + edge_cases: [] + documentation: + notes: + - Sand, silt, and clay percentages must sum to 100; sand plus clay must not exceed 100. + - The regression dataset excludes samples containing more than 4% organic carbon. + - These are two point predictions, not a continuous retention curve. + warnings: + - The paper describes these relationships as rough guides. + - One-third-bar moisture content may underestimate field capacity and available moisture in these soils. + - The observed marginal calibration ranges do not establish validity for every joint texture combination. + implementation: + variables: + - name: water_content_15_bar + expr: 0.74 + 0.39 * clay + - name: water_content_one_third_bar + expr: 36.97 - 0.35 * sand + - name: calc_ptf_dijkerman1988_available_water + status: ready-for-implementation + public_api: + name: calc_ptf_dijkerman1988_available_water + result_class: null + summary: Estimate the gravimetric available moisture between one-third bar and 15 bar. + scope: + prediction_target: Gravimetric available moisture between one-third bar and 15 bar. + models: + h_theta: null + k_h: null + inputs: + - $ref: '#/$defs/Clay' + - name: silt + symbol: silt + unit: '%' + domain: 0 <= silt <= 100; 0.5 <= 100 - clay - silt <= 96.4 + description: >- + Silt content by mass; sand, silt, and clay sum to 100%. + No separate observed silt calibration range is supplied. + outputs: + type: scalar + name: available_water + quantity: gravimetric_water_content + symbol: y_2 - y_1 + unit: mass_percent + reported_unit: '%' + domain: null + description: Difference in gravimetric moisture contents, in weight percentage points. + verification_cases: + - id: veeneklaas_c_texture_calculated + kind: calculated + inputs: {clay: 10.0, silt: 30.0} + expected: {available_water: 11.33} + rationale: >- + Use the complete texture of Veeneklaas et al. (1991), Table 2.2, + row C, as transcribed in the supplied notes: sand 60%, clay 10%, + and the remaining 30% silt. This lies inside the reported calibration + envelope and gives positive, ordered moisture contents. Reference + arithmetic from the paper's combined equation gives + 1.23 - 0.04 * 10 + 0.35 * 30 = 11.33. This is a calculated value, + not a published difference of the rounded table outputs. + edge_cases: [] + documentation: + notes: + - This estimates a gravimetric difference, not profile water storage or a volumetric fraction. + - Use soil material with organic carbon at most 4% and physically consistent texture percentages. + warnings: + - Available moisture estimated using one-third bar may be somewhat low according to the paper. + implementation: + variables: + - name: available_water + expr: 1.23 - 0.04 * clay + 0.35 * silt +scientific_notes: | + ## Supported models + + The Soil moisture availability section and Figures 2 and 3 give the two + regressions. The same section explicitly publishes their combined + clay-and-silt equation for available moisture. The explained variation is + 92% for 15-bar moisture and 88% for one-third-bar moisture; these are model + performance statistics, not implementation tolerances. + + ## Review decisions + + The supplied Markdown contains the article plus earlier research notes. + Evidence attributed to those notes has been preserved as such; the cited + PDF scans, OCR files, and review scripts were not rerun during extraction. + The article explicitly states that the answer is in weight percentage. + This takes precedence over the embedded image descriptions' erroneous + volumetric labels. Figure 3's illustrative point list also disagrees with + its equation; those approximate image-description points are not published + verification pairs. The prose and figure equation agree on the coefficients. + Pressure labels retain the article's bar notation; no bar-to-atmosphere or + pressure-to-head conversion is introduced. + + The supplied notes transcribe seven complete numerical rows from Veeneklaas, + F. R., Cisse, S., Gosseye, P. A., van Duivenbooden, N., & van Keulen, H. + (1991), Competing for Limited Resources: The Case of the Fifth Region of + Mali, Report 4: Development Scenarios (CABO-DLO/ESPR; ISBN 90-73384-13-3). + Its equations on PDF page index 12 use the same coefficients, with g/kg + outputs; Table 2.2 on PDF page index 15 supplies the verification values. + The report does not name Dijkerman and is used only for numerical evidence, + not attribution or calibration applicability. The table's one-g/kg + rounding is covered by the existing mass-percent registry tolerance; + no function-level override is introduced. + + The notes report reconstruction of Odell et al. (1974), Appendix B: + 44 profile tables contain 186 laboratory rows; removal of two Rokupr + profiles without moisture measurements leaves 42 profiles and 181 rows. + Seven incomplete rows and eight complete rows with organic carbon above + 4% are excluded, leaving 166 rows. Reported observed extrema are sand + 0.5% (S28666) to 96.4% (S28668), and clay 1.3% (S28668 and S28669) to + 66.6% (S29124). These marginal bounds are not general physical limits or + a guarantee of predictive validity. No complete boundary predictor rows + are supplied here, so marginal extrema are not combined into cases. + + ## Documented limitations + + The paper recommends bulk density, horizon thickness, rooting depth, and + adjustments for material larger than 2 mm when estimating profile storage. + No additional profile-storage function is extracted from this discussion. + Table VII contains profile-level storage results rather than complete + input-output examples for the retained texture regressions. + + Tables V and X concern effective rooting depth and waterlogging duration; + they are land-evaluation relationships outside the retained moisture PTFs. + Table X provides ranges and missing entries, not a scalar hydraulic lookup. + Fertility classifications and growing-season calculations are also outside + the retained PTF scope. + + ## Blockers + + None for the retained gravimetric moisture equations. Human review is + required before the separate generation workflow. diff --git a/targets/ptfkit-native/cpp/dijkerman1988.cppm b/targets/ptfkit-native/cpp/dijkerman1988.cppm new file mode 100644 index 0000000..d147eec --- /dev/null +++ b/targets/ptfkit-native/cpp/dijkerman1988.cppm @@ -0,0 +1,86 @@ +/* @generated by ptfkit-codegen; DO NOT EDIT. */ + +export module ptfkit.dijkerman1988; + +/** + * @brief Dijkerman (1988), texture-based gravimetric water retention for Sierra Leone soils. + * + * @details Source publication: + * Dijkerman, J. C. (1988). An Ustult-Aquult-Tropept catena in Sierra Leone, West Africa, II. + * Land qualities and land evaluation. Geoderma, 42, 29-49. + * @see https://doi.org/10.1016/0016-7061(88)90021-3 DOI: 10.1016/0016-7061(88)90021-3 + * + * @remark Geographic scope: + * Sierra Leone, West Africa + * + * @remark Calibration dataset: + * 166 soil samples from 42 soil profiles reported by Odell et al. (1974). Samples with organic + * carbon greater than 4% were excluded from the regressions. + */ + +export namespace ptfkit::dijkerman1988 { + +struct Dijkerman1988WaterContent { + /** + * @brief Gravimetric moisture content at 15 bar, in weight percentage. (%) + */ + double water_content_15_bar; + /** + * @brief Gravimetric moisture content at one-third bar, in weight percentage. (%) + */ + double water_content_one_third_bar; +}; + +/** + * @brief Estimate gravimetric water contents at 15 bar and one-third bar from texture. + * @param clay Clay content by mass. The supplied research notes report this observed + * calibration range from a reconstruction of Odell et al. (1974), Appendix B. (%) + * @param sand Sand content by mass. The supplied research notes report this observed + * calibration range from a reconstruction of Odell et al. (1974), Appendix B. (%) + * @return A result with the following fields: + * - `water_content_15_bar` — Gravimetric moisture content at 15 bar, in weight percentage. + * (%) + * - `water_content_one_third_bar` — Gravimetric moisture content at one-third bar, in weight + * percentage. (%) + * + * @details Prediction target: + * Gravimetric water contents at 15 bar and one-third bar. + * @note Sand, silt, and clay percentages must sum to 100; sand plus clay must not exceed 100. + * @note The regression dataset excludes samples containing more than 4% organic carbon. + * @note These are two point predictions, not a continuous retention curve. + * @warning The paper describes these relationships as rough guides. + * @warning One-third-bar moisture content may underestimate field capacity and available + * moisture in these soils. + * @warning The observed marginal calibration ranges do not establish validity for every joint + * texture combination. + */ +[[nodiscard]] +inline Dijkerman1988WaterContent calc_ptf_dijkerman1988(double clay, double sand) { + const double water_content_15_bar = 0.74 + 0.39 * clay; + const double water_content_one_third_bar = 36.97 - 0.35 * sand; + return Dijkerman1988WaterContent{water_content_15_bar, water_content_one_third_bar}; +} + +/** + * @brief Estimate the gravimetric available moisture between one-third bar and 15 bar. + * @param clay Clay content by mass. The supplied research notes report this observed + * calibration range from a reconstruction of Odell et al. (1974), Appendix B. (%) + * @param silt Silt content by mass; sand, silt, and clay sum to 100%. No separate observed + * silt calibration range is supplied. (%) + * @return Difference in gravimetric moisture contents, in weight percentage points. (%) + * + * @details Prediction target: + * Gravimetric available moisture between one-third bar and 15 bar. + * @note This estimates a gravimetric difference, not profile water storage or a volumetric + * fraction. + * @note Use soil material with organic carbon at most 4% and physically consistent texture + * percentages. + * @warning Available moisture estimated using one-third bar may be somewhat low according to + * the paper. + */ +[[nodiscard]] +inline double calc_ptf_dijkerman1988_available_water(double clay, double silt) { + return 1.23 - 0.04 * clay + 0.35 * silt; +} + +} // namespace ptfkit::dijkerman1988 diff --git a/targets/ptfkit-native/cpp/ptfkit.cppm b/targets/ptfkit-native/cpp/ptfkit.cppm index c39a37e..12a9d86 100644 --- a/targets/ptfkit-native/cpp/ptfkit.cppm +++ b/targets/ptfkit-native/cpp/ptfkit.cppm @@ -9,6 +9,7 @@ export import ptfkit.chakraborty2011; export import ptfkit.clapp1978; export import ptfkit.cosby1984; export import ptfkit.dharumarajan2019; +export import ptfkit.dijkerman1988; export import ptfkit.ferrerjulia2004; export import ptfkit.gunarathna2019; export import ptfkit.hodnett2002; diff --git a/targets/ptfkit-native/include/ptfkit/dijkerman1988.h b/targets/ptfkit-native/include/ptfkit/dijkerman1988.h new file mode 100644 index 0000000..8f1b259 --- /dev/null +++ b/targets/ptfkit-native/include/ptfkit/dijkerman1988.h @@ -0,0 +1,84 @@ +/* @generated by ptfkit-codegen; DO NOT EDIT. */ + +#ifndef PTFKIT_DIJKERMAN1988_H +#define PTFKIT_DIJKERMAN1988_H + +/** + * @brief Dijkerman (1988), texture-based gravimetric water retention for Sierra Leone soils. + * + * @details Source publication: + * Dijkerman, J. C. (1988). An Ustult-Aquult-Tropept catena in Sierra Leone, West Africa, II. + * Land qualities and land evaluation. Geoderma, 42, 29-49. + * @see https://doi.org/10.1016/0016-7061(88)90021-3 DOI: 10.1016/0016-7061(88)90021-3 + * + * @remark Geographic scope: + * Sierra Leone, West Africa + * + * @remark Calibration dataset: + * 166 soil samples from 42 soil profiles reported by Odell et al. (1974). Samples with organic + * carbon greater than 4% were excluded from the regressions. + */ + +typedef struct { + /** + * @brief Gravimetric moisture content at 15 bar, in weight percentage. (%) + */ + double water_content_15_bar; + /** + * @brief Gravimetric moisture content at one-third bar, in weight percentage. (%) + */ + double water_content_one_third_bar; +} dijkerman1988_water_content; + +/** + * @brief Estimate gravimetric water contents at 15 bar and one-third bar from texture. + * @param clay Clay content by mass. The supplied research notes report this observed + * calibration range from a reconstruction of Odell et al. (1974), Appendix B. (%) + * @param sand Sand content by mass. The supplied research notes report this observed + * calibration range from a reconstruction of Odell et al. (1974), Appendix B. (%) + * @return A result with the following fields: + * - `water_content_15_bar` — Gravimetric moisture content at 15 bar, in weight percentage. + * (%) + * - `water_content_one_third_bar` — Gravimetric moisture content at one-third bar, in weight + * percentage. (%) + * + * @details Prediction target: + * Gravimetric water contents at 15 bar and one-third bar. + * @note Sand, silt, and clay percentages must sum to 100; sand plus clay must not exceed 100. + * @note The regression dataset excludes samples containing more than 4% organic carbon. + * @note These are two point predictions, not a continuous retention curve. + * @warning The paper describes these relationships as rough guides. + * @warning One-third-bar moisture content may underestimate field capacity and available + * moisture in these soils. + * @warning The observed marginal calibration ranges do not establish validity for every joint + * texture combination. + */ +static inline dijkerman1988_water_content calc_ptf_dijkerman1988(double clay, double sand) { + const double water_content_15_bar = 0.74 + 0.39 * clay; + const double water_content_one_third_bar = 36.97 - 0.35 * sand; + dijkerman1988_water_content result = {water_content_15_bar, water_content_one_third_bar}; + return result; +} + +/** + * @brief Estimate the gravimetric available moisture between one-third bar and 15 bar. + * @param clay Clay content by mass. The supplied research notes report this observed + * calibration range from a reconstruction of Odell et al. (1974), Appendix B. (%) + * @param silt Silt content by mass; sand, silt, and clay sum to 100%. No separate observed + * silt calibration range is supplied. (%) + * @return Difference in gravimetric moisture contents, in weight percentage points. (%) + * + * @details Prediction target: + * Gravimetric available moisture between one-third bar and 15 bar. + * @note This estimates a gravimetric difference, not profile water storage or a volumetric + * fraction. + * @note Use soil material with organic carbon at most 4% and physically consistent texture + * percentages. + * @warning Available moisture estimated using one-third bar may be somewhat low according to + * the paper. + */ +static inline double calc_ptf_dijkerman1988_available_water(double clay, double silt) { + return 1.23 - 0.04 * clay + 0.35 * silt; +} + +#endif diff --git a/targets/ptfkit-native/include/ptfkit/ptfkit.h b/targets/ptfkit-native/include/ptfkit/ptfkit.h index 8c046b5..fae7ac7 100644 --- a/targets/ptfkit-native/include/ptfkit/ptfkit.h +++ b/targets/ptfkit-native/include/ptfkit/ptfkit.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/targets/ptfkit-native/tests/c/dijkerman1988.c b/targets/ptfkit-native/tests/c/dijkerman1988.c new file mode 100644 index 0000000..e4b15e5 --- /dev/null +++ b/targets/ptfkit-native/tests/c/dijkerman1988.c @@ -0,0 +1,67 @@ +/* @generated by ptfkit-codegen; DO NOT EDIT. */ + +#include +#include "support/close_enough.h" + +int main() { + { + const dijkerman1988_water_content result = calc_ptf_dijkerman1988(5.0, 92.5); + assert_close(result.water_content_15_bar, 2.7, 0.1, 0.0, "gravimetric_water_content", + "mass_percent", "registry", "veeneklaas_table_2_2_a"); + assert_close(result.water_content_one_third_bar, 4.6, 0.1, 0.0, "gravimetric_water_content", + "mass_percent", "registry", "veeneklaas_table_2_2_a"); + } + { + const dijkerman1988_water_content result = calc_ptf_dijkerman1988(12.5, 77.5); + assert_close(result.water_content_15_bar, 5.6, 0.1, 0.0, "gravimetric_water_content", + "mass_percent", "registry", "veeneklaas_table_2_2_b"); + assert_close(result.water_content_one_third_bar, 9.8, 0.1, 0.0, "gravimetric_water_content", + "mass_percent", "registry", "veeneklaas_table_2_2_b"); + } + { + const dijkerman1988_water_content result = calc_ptf_dijkerman1988(10.0, 60.0); + assert_close(result.water_content_15_bar, 4.6, 0.1, 0.0, "gravimetric_water_content", + "mass_percent", "registry", "veeneklaas_table_2_2_c"); + assert_close(result.water_content_one_third_bar, 16.0, 0.1, 0.0, + "gravimetric_water_content", "mass_percent", "registry", + "veeneklaas_table_2_2_c"); + } + { + const dijkerman1988_water_content result = calc_ptf_dijkerman1988(27.5, 62.5); + assert_close(result.water_content_15_bar, 11.5, 0.1, 0.0, "gravimetric_water_content", + "mass_percent", "registry", "veeneklaas_table_2_2_d"); + assert_close(result.water_content_one_third_bar, 15.1, 0.1, 0.0, + "gravimetric_water_content", "mass_percent", "registry", + "veeneklaas_table_2_2_d"); + } + { + const dijkerman1988_water_content result = calc_ptf_dijkerman1988(42.5, 10.0); + assert_close(result.water_content_15_bar, 17.3, 0.1, 0.0, "gravimetric_water_content", + "mass_percent", "registry", "veeneklaas_table_2_2_e"); + assert_close(result.water_content_one_third_bar, 33.5, 0.1, 0.0, + "gravimetric_water_content", "mass_percent", "registry", + "veeneklaas_table_2_2_e"); + } + { + const dijkerman1988_water_content result = calc_ptf_dijkerman1988(32.5, 32.5); + assert_close(result.water_content_15_bar, 13.4, 0.1, 0.0, "gravimetric_water_content", + "mass_percent", "registry", "veeneklaas_table_2_2_f"); + assert_close(result.water_content_one_third_bar, 25.6, 0.1, 0.0, + "gravimetric_water_content", "mass_percent", "registry", + "veeneklaas_table_2_2_f"); + } + { + const dijkerman1988_water_content result = calc_ptf_dijkerman1988(17.5, 38.5); + assert_close(result.water_content_15_bar, 7.6, 0.1, 0.0, "gravimetric_water_content", + "mass_percent", "registry", "veeneklaas_table_2_2_g"); + assert_close(result.water_content_one_third_bar, 23.5, 0.1, 0.0, + "gravimetric_water_content", "mass_percent", "registry", + "veeneklaas_table_2_2_g"); + } + { + const double result = calc_ptf_dijkerman1988_available_water(10.0, 30.0); + assert_close(result, 11.33, 0.1, 0.0, "gravimetric_water_content", "mass_percent", + "registry", "veeneklaas_c_texture_calculated"); + } + return 0; +} diff --git a/targets/ptfkit-native/tests/cpp/dijkerman1988.cpp b/targets/ptfkit-native/tests/cpp/dijkerman1988.cpp new file mode 100644 index 0000000..03d5af0 --- /dev/null +++ b/targets/ptfkit-native/tests/cpp/dijkerman1988.cpp @@ -0,0 +1,88 @@ +/* @generated by ptfkit-codegen; DO NOT EDIT. */ + +#ifdef IMPORT_UMBRELLA +import ptfkit; +#else +import ptfkit.dijkerman1988; +#endif + +#include "support/close_enough.h" +#include + +int main() { + { + const auto result = ptfkit::dijkerman1988::calc_ptf_dijkerman1988(5.0, 92.5); + static_assert(std::is_same_v, + ptfkit::dijkerman1988::Dijkerman1988WaterContent>); + assert_close(result.water_content_15_bar, 2.7, 0.1, 0.0, "gravimetric_water_content", + "mass_percent", "registry", "veeneklaas_table_2_2_a"); + assert_close(result.water_content_one_third_bar, 4.6, 0.1, 0.0, "gravimetric_water_content", + "mass_percent", "registry", "veeneklaas_table_2_2_a"); + } + { + const auto result = ptfkit::dijkerman1988::calc_ptf_dijkerman1988(12.5, 77.5); + static_assert(std::is_same_v, + ptfkit::dijkerman1988::Dijkerman1988WaterContent>); + assert_close(result.water_content_15_bar, 5.6, 0.1, 0.0, "gravimetric_water_content", + "mass_percent", "registry", "veeneklaas_table_2_2_b"); + assert_close(result.water_content_one_third_bar, 9.8, 0.1, 0.0, "gravimetric_water_content", + "mass_percent", "registry", "veeneklaas_table_2_2_b"); + } + { + const auto result = ptfkit::dijkerman1988::calc_ptf_dijkerman1988(10.0, 60.0); + static_assert(std::is_same_v, + ptfkit::dijkerman1988::Dijkerman1988WaterContent>); + assert_close(result.water_content_15_bar, 4.6, 0.1, 0.0, "gravimetric_water_content", + "mass_percent", "registry", "veeneklaas_table_2_2_c"); + assert_close(result.water_content_one_third_bar, 16.0, 0.1, 0.0, + "gravimetric_water_content", "mass_percent", "registry", + "veeneklaas_table_2_2_c"); + } + { + const auto result = ptfkit::dijkerman1988::calc_ptf_dijkerman1988(27.5, 62.5); + static_assert(std::is_same_v, + ptfkit::dijkerman1988::Dijkerman1988WaterContent>); + assert_close(result.water_content_15_bar, 11.5, 0.1, 0.0, "gravimetric_water_content", + "mass_percent", "registry", "veeneklaas_table_2_2_d"); + assert_close(result.water_content_one_third_bar, 15.1, 0.1, 0.0, + "gravimetric_water_content", "mass_percent", "registry", + "veeneklaas_table_2_2_d"); + } + { + const auto result = ptfkit::dijkerman1988::calc_ptf_dijkerman1988(42.5, 10.0); + static_assert(std::is_same_v, + ptfkit::dijkerman1988::Dijkerman1988WaterContent>); + assert_close(result.water_content_15_bar, 17.3, 0.1, 0.0, "gravimetric_water_content", + "mass_percent", "registry", "veeneklaas_table_2_2_e"); + assert_close(result.water_content_one_third_bar, 33.5, 0.1, 0.0, + "gravimetric_water_content", "mass_percent", "registry", + "veeneklaas_table_2_2_e"); + } + { + const auto result = ptfkit::dijkerman1988::calc_ptf_dijkerman1988(32.5, 32.5); + static_assert(std::is_same_v, + ptfkit::dijkerman1988::Dijkerman1988WaterContent>); + assert_close(result.water_content_15_bar, 13.4, 0.1, 0.0, "gravimetric_water_content", + "mass_percent", "registry", "veeneklaas_table_2_2_f"); + assert_close(result.water_content_one_third_bar, 25.6, 0.1, 0.0, + "gravimetric_water_content", "mass_percent", "registry", + "veeneklaas_table_2_2_f"); + } + { + const auto result = ptfkit::dijkerman1988::calc_ptf_dijkerman1988(17.5, 38.5); + static_assert(std::is_same_v, + ptfkit::dijkerman1988::Dijkerman1988WaterContent>); + assert_close(result.water_content_15_bar, 7.6, 0.1, 0.0, "gravimetric_water_content", + "mass_percent", "registry", "veeneklaas_table_2_2_g"); + assert_close(result.water_content_one_third_bar, 23.5, 0.1, 0.0, + "gravimetric_water_content", "mass_percent", "registry", + "veeneklaas_table_2_2_g"); + } + { + const auto result = + ptfkit::dijkerman1988::calc_ptf_dijkerman1988_available_water(10.0, 30.0); + assert_close(result, 11.33, 0.1, 0.0, "gravimetric_water_content", "mass_percent", + "registry", "veeneklaas_c_texture_calculated"); + } + return 0; +} diff --git a/targets/ptfkit-py/src/ptfkit/_ptfkit.pyi b/targets/ptfkit-py/src/ptfkit/_ptfkit.pyi index 88b1215..12999b1 100644 --- a/targets/ptfkit-py/src/ptfkit/_ptfkit.pyi +++ b/targets/ptfkit-py/src/ptfkit/_ptfkit.pyi @@ -28,6 +28,8 @@ calc_ptf_dharumarajan2019_nkp: ufunc calc_ptf_dharumarajan2019_nkp_clay: ufunc calc_ptf_dharumarajan2019_skp: ufunc calc_ptf_dharumarajan2019_skp_clay: ufunc +calc_ptf_dijkerman1988: ufunc +calc_ptf_dijkerman1988_available_water: ufunc calc_ptf_ferrerjulia2004_calcaric_fluvisol_sand: ufunc calc_ptf_ferrerjulia2004_calcaric_fluvisol_texture_organic_matter: ufunc calc_ptf_ferrerjulia2004_calcaric_regosol_sand: ufunc diff --git a/targets/ptfkit-py/src/ptfkit/dijkerman1988.c b/targets/ptfkit-py/src/ptfkit/dijkerman1988.c new file mode 100644 index 0000000..95ff968 --- /dev/null +++ b/targets/ptfkit-py/src/ptfkit/dijkerman1988.c @@ -0,0 +1,113 @@ +/* @generated by ptfkit-codegen; DO NOT EDIT. */ +#include +#include "ufunc.h" + +static const int calc_ptf_dijkerman1988_types[] = {NPY_DOUBLE, NPY_DOUBLE, NPY_DOUBLE, NPY_DOUBLE}; +static int calc_ptf_dijkerman1988_contiguous_loop(PyArrayMethod_Context *context, char *const *data, + const npy_intp *dimensions, + const npy_intp *strides, + NpyAuxData *transferdata) { + (void)context; + (void)strides; + (void)transferdata; + const double *in_clay = (const double *)data[0]; + const double *in_sand = (const double *)data[1]; + double *out_water_content_15_bar = (double *)data[2]; + double *out_water_content_one_third_bar = (double *)data[3]; + for (npy_intp index = 0; index < dimensions[0]; index++) { + const double clay = in_clay[index]; + const double sand = in_sand[index]; + const dijkerman1988_water_content ptfkit_result = calc_ptf_dijkerman1988(clay, sand); + out_water_content_15_bar[index] = ptfkit_result.water_content_15_bar; + out_water_content_one_third_bar[index] = ptfkit_result.water_content_one_third_bar; + } + return 0; +} + +static int calc_ptf_dijkerman1988_strided_loop(PyArrayMethod_Context *context, char *const *data, + const npy_intp *dimensions, const npy_intp *strides, + NpyAuxData *transferdata) { + (void)context; + (void)transferdata; + for (npy_intp index = 0; index < dimensions[0]; index++) { + const double clay = *(const double *)(data[0] + index * strides[0]); + const double sand = *(const double *)(data[1] + index * strides[1]); + const dijkerman1988_water_content ptfkit_result = calc_ptf_dijkerman1988(clay, sand); + *(double *)(data[2] + index * strides[2]) = ptfkit_result.water_content_15_bar; + *(double *)(data[3] + index * strides[3]) = ptfkit_result.water_content_one_third_bar; + } + return 0; +} +static PyType_Slot calc_ptf_dijkerman1988_slots[] = { + {NPY_METH_strided_loop, calc_ptf_dijkerman1988_strided_loop}, + {NPY_METH_contiguous_loop, calc_ptf_dijkerman1988_contiguous_loop}, + {0, NULL}, +}; +static PyArrayMethod_Spec calc_ptf_dijkerman1988_spec = { + .name = "calc_ptf_dijkerman1988", + .nin = 2, + .nout = 2, + .casting = NPY_SAME_KIND_CASTING, + .slots = calc_ptf_dijkerman1988_slots, +}; + +static const int calc_ptf_dijkerman1988_available_water_types[] = {NPY_DOUBLE, NPY_DOUBLE, + NPY_DOUBLE}; +static int calc_ptf_dijkerman1988_available_water_contiguous_loop(PyArrayMethod_Context *context, + char *const *data, + const npy_intp *dimensions, + const npy_intp *strides, + NpyAuxData *transferdata) { + (void)context; + (void)strides; + (void)transferdata; + const double *in_clay = (const double *)data[0]; + const double *in_silt = (const double *)data[1]; + double *out_available_water = (double *)data[2]; + for (npy_intp index = 0; index < dimensions[0]; index++) { + const double clay = in_clay[index]; + const double silt = in_silt[index]; + const double ptfkit_result = calc_ptf_dijkerman1988_available_water(clay, silt); + out_available_water[index] = ptfkit_result; + } + return 0; +} + +static int calc_ptf_dijkerman1988_available_water_strided_loop(PyArrayMethod_Context *context, + char *const *data, + const npy_intp *dimensions, + const npy_intp *strides, + NpyAuxData *transferdata) { + (void)context; + (void)transferdata; + for (npy_intp index = 0; index < dimensions[0]; index++) { + const double clay = *(const double *)(data[0] + index * strides[0]); + const double silt = *(const double *)(data[1] + index * strides[1]); + const double ptfkit_result = calc_ptf_dijkerman1988_available_water(clay, silt); + *(double *)(data[2] + index * strides[2]) = ptfkit_result; + } + return 0; +} +static PyType_Slot calc_ptf_dijkerman1988_available_water_slots[] = { + {NPY_METH_strided_loop, calc_ptf_dijkerman1988_available_water_strided_loop}, + {NPY_METH_contiguous_loop, calc_ptf_dijkerman1988_available_water_contiguous_loop}, + {0, NULL}, +}; +static PyArrayMethod_Spec calc_ptf_dijkerman1988_available_water_spec = { + .name = "calc_ptf_dijkerman1988_available_water", + .nin = 2, + .nout = 1, + .casting = NPY_SAME_KIND_CASTING, + .slots = calc_ptf_dijkerman1988_available_water_slots, +}; + +int ptfkit_register_dijkerman1988(PyObject *module) { + if (ptfkit_add_ufunc(module, "calc_ptf_dijkerman1988", calc_ptf_dijkerman1988_types, 2, 2, + &calc_ptf_dijkerman1988_spec) < 0) + return -1; + if (ptfkit_add_ufunc(module, "calc_ptf_dijkerman1988_available_water", + calc_ptf_dijkerman1988_available_water_types, 2, 1, + &calc_ptf_dijkerman1988_available_water_spec) < 0) + return -1; + return 0; +} diff --git a/targets/ptfkit-py/src/ptfkit/dijkerman1988.py b/targets/ptfkit-py/src/ptfkit/dijkerman1988.py new file mode 100644 index 0000000..777062c --- /dev/null +++ b/targets/ptfkit-py/src/ptfkit/dijkerman1988.py @@ -0,0 +1,164 @@ +# @generated by ptfkit-codegen; DO NOT EDIT. + +# ruff: noqa: I001 + +r"""Dijkerman (1988), texture-based gravimetric water retention for Sierra Leone soils. + +Reference: + Dijkerman, J. C. (1988). An Ustult-Aquult-Tropept catena in Sierra Leone, West Africa, II. Land + qualities and land evaluation. Geoderma, 42, 29-49. + [DOI: 10.1016/0016-7061(88)90021-3](https://doi.org/10.1016/0016-7061(88)90021-3) + +Territory + +: Sierra Leone, West Africa + +Dataset + +: 166 soil samples from 42 soil profiles reported by Odell et al. (1974). Samples with organic + carbon greater than 4% were excluded from the regressions. + +""" + +from __future__ import annotations + +from typing import TYPE_CHECKING, Generic, NamedTuple, TypeVar, overload + +from ptfkit._dispatch import call as _call +from ptfkit._ptfkit import ( + calc_ptf_dijkerman1988 as _calc_ptf_dijkerman1988, + calc_ptf_dijkerman1988_available_water as _calc_ptf_dijkerman1988_available_water, +) + + +if TYPE_CHECKING: + from numpy import floating + from numpy.typing import ArrayLike, NDArray + +T = TypeVar('T') + + +class Dijkerman1988WaterContent(NamedTuple, Generic[T]): + """Results returned by the matching PTF. + + Attributes: + water_content_15_bar: Gravimetric moisture content at 15 bar, in weight percentage. (%) + water_content_one_third_bar: Gravimetric moisture content at one-third bar, in weight + percentage. (%) + + """ + + water_content_15_bar: T + water_content_one_third_bar: T + + +__all__ = [ + 'Dijkerman1988WaterContent', + 'calc_ptf_dijkerman1988', + 'calc_ptf_dijkerman1988_available_water', +] + + +@overload +def calc_ptf_dijkerman1988(*, clay: float, sand: float) -> Dijkerman1988WaterContent[floating]: ... + + +@overload +def calc_ptf_dijkerman1988( + *, + clay: ArrayLike, + sand: ArrayLike, + out: Dijkerman1988WaterContent[NDArray[floating]] | None = None, +) -> Dijkerman1988WaterContent[NDArray[floating]]: ... + + +def calc_ptf_dijkerman1988( + *, + clay: float | ArrayLike, + sand: float | ArrayLike, + out: Dijkerman1988WaterContent[NDArray[floating]] | None = None, +) -> Dijkerman1988WaterContent[floating] | Dijkerman1988WaterContent[NDArray[floating]]: + """Estimate gravimetric water contents at 15 bar and one-third bar from texture. + + Arguments: + clay: Clay content by mass. The supplied research notes report this observed calibration + range from a reconstruction of Odell et al. (1974), Appendix B. (%) + sand: Sand content by mass. The supplied research notes report this observed calibration + range from a reconstruction of Odell et al. (1974), Appendix B. (%) + out: Optional output arrays for in-place calculation. + + Returns: + Dijkerman1988WaterContent: Results grouped by result attributes. + + Notes: + Prediction target: Gravimetric water contents at 15 bar and one-third bar. + Sand, silt, and clay percentages must sum to 100; sand plus clay must not exceed 100. + The regression dataset excludes samples containing more than 4% organic carbon. + These are two point predictions, not a continuous retention curve. + + Warning: + The paper describes these relationships as rough guides. + One-third-bar moisture content may underestimate field capacity and available moisture in + these soils. + The observed marginal calibration ranges do not establish validity for every joint texture + combination. + + """ + values = _call( + _calc_ptf_dijkerman1988, + clay, + sand, + out=out, + ) + + return Dijkerman1988WaterContent(*values) + + +@overload +def calc_ptf_dijkerman1988_available_water(*, clay: float, silt: float) -> floating: ... + + +@overload +def calc_ptf_dijkerman1988_available_water( + *, + clay: ArrayLike, + silt: ArrayLike, + out: NDArray[floating] | None = None, +) -> NDArray[floating]: ... + + +def calc_ptf_dijkerman1988_available_water( + *, + clay: float | ArrayLike, + silt: float | ArrayLike, + out: NDArray[floating] | None = None, +) -> floating | NDArray[floating]: + """Estimate the gravimetric available moisture between one-third bar and 15 bar. + + Arguments: + clay: Clay content by mass. The supplied research notes report this observed calibration + range from a reconstruction of Odell et al. (1974), Appendix B. (%) + silt: Silt content by mass; sand, silt, and clay sum to 100%. No separate observed silt + calibration range is supplied. (%) + out: Optional output arrays for in-place calculation. + + Returns: + available_water: Difference in gravimetric moisture contents, in weight percentage points. + (%) + + Notes: + Prediction target: Gravimetric available moisture between one-third bar and 15 bar. + This estimates a gravimetric difference, not profile water storage or a volumetric fraction. + Use soil material with organic carbon at most 4% and physically consistent texture + percentages. + + Warning: + Available moisture estimated using one-third bar may be somewhat low according to the paper. + + """ + return _call( + _calc_ptf_dijkerman1988_available_water, + clay, + silt, + out=out, + ) diff --git a/targets/ptfkit-py/src/ptfkit/ptfkit.c b/targets/ptfkit-py/src/ptfkit/ptfkit.c index 8fb800d..c5e7698 100644 --- a/targets/ptfkit-py/src/ptfkit/ptfkit.c +++ b/targets/ptfkit-py/src/ptfkit/ptfkit.c @@ -13,6 +13,7 @@ #include "clapp1978.c" #include "cosby1984.c" #include "dharumarajan2019.c" +#include "dijkerman1988.c" #include "ferrerjulia2004.c" #include "gunarathna2019.c" #include "hodnett2002.c" @@ -68,6 +69,10 @@ PyMODINIT_FUNC PyInit__ptfkit(void) { Py_DECREF(module); return NULL; } + if (ptfkit_register_dijkerman1988(module) < 0) { + Py_DECREF(module); + return NULL; + } if (ptfkit_register_ferrerjulia2004(module) < 0) { Py_DECREF(module); return NULL; diff --git a/targets/ptfkit-py/tests/test_dijkerman1988.py b/targets/ptfkit-py/tests/test_dijkerman1988.py new file mode 100644 index 0000000..639356c --- /dev/null +++ b/targets/ptfkit-py/tests/test_dijkerman1988.py @@ -0,0 +1,188 @@ +# @generated by ptfkit-codegen; DO NOT EDIT. +from __future__ import annotations + +import pytest + +from _helpers import assert_close, prepare_vector_case +from ptfkit.dijkerman1988 import ( + Dijkerman1988WaterContent, + calc_ptf_dijkerman1988, + calc_ptf_dijkerman1988_available_water, +) + + +CASES_CALC_PTF_DIJKERMAN1988 = [ + ( + {'clay': 5.0, 'sand': 92.5}, + {'water_content_15_bar': 2.7, 'water_content_one_third_bar': 4.6}, + ), + ( + {'clay': 12.5, 'sand': 77.5}, + {'water_content_15_bar': 5.6, 'water_content_one_third_bar': 9.8}, + ), + ( + {'clay': 10.0, 'sand': 60.0}, + {'water_content_15_bar': 4.6, 'water_content_one_third_bar': 16.0}, + ), + ( + {'clay': 27.5, 'sand': 62.5}, + {'water_content_15_bar': 11.5, 'water_content_one_third_bar': 15.1}, + ), + ( + {'clay': 42.5, 'sand': 10.0}, + {'water_content_15_bar': 17.3, 'water_content_one_third_bar': 33.5}, + ), + ( + {'clay': 32.5, 'sand': 32.5}, + {'water_content_15_bar': 13.4, 'water_content_one_third_bar': 25.6}, + ), + ( + {'clay': 17.5, 'sand': 38.5}, + {'water_content_15_bar': 7.6, 'water_content_one_third_bar': 23.5}, + ), +] +CASES_CALC_PTF_DIJKERMAN1988_IDS = [ + 'veeneklaas_table_2_2_a', + 'veeneklaas_table_2_2_b', + 'veeneklaas_table_2_2_c', + 'veeneklaas_table_2_2_d', + 'veeneklaas_table_2_2_e', + 'veeneklaas_table_2_2_f', + 'veeneklaas_table_2_2_g', +] + + +@pytest.mark.parametrize( + ('inputs', 'expected'), CASES_CALC_PTF_DIJKERMAN1988, ids=CASES_CALC_PTF_DIJKERMAN1988_IDS +) +def test_calc_ptf_dijkerman1988_verification(inputs: dict[str, float], expected: dict[str, float]): + result = calc_ptf_dijkerman1988(**inputs) + + assert_close( + result.water_content_15_bar, + expected['water_content_15_bar'], + absolute=0.1, + relative=0.0, + quantity='gravimetric_water_content', + unit='mass_percent', + source='registry', + ) + assert_close( + result.water_content_one_third_bar, + expected['water_content_one_third_bar'], + absolute=0.1, + relative=0.0, + quantity='gravimetric_water_content', + unit='mass_percent', + source='registry', + ) + + +def test_calc_ptf_dijkerman1988_array(): + inputs, expected, _out = prepare_vector_case( + CASES_CALC_PTF_DIJKERMAN1988, Dijkerman1988WaterContent + ) + result = calc_ptf_dijkerman1988(**inputs, out=None) + assert_close( + result.water_content_15_bar[0], + expected['water_content_15_bar'], + absolute=0.1, + relative=0.0, + quantity='gravimetric_water_content', + unit='mass_percent', + source='registry', + ) + assert_close( + result.water_content_one_third_bar[0], + expected['water_content_one_third_bar'], + absolute=0.1, + relative=0.0, + quantity='gravimetric_water_content', + unit='mass_percent', + source='registry', + ) + + +def test_calc_ptf_dijkerman1988_out(): + inputs, expected, out = prepare_vector_case( + CASES_CALC_PTF_DIJKERMAN1988, Dijkerman1988WaterContent + ) + result = calc_ptf_dijkerman1988(**inputs, out=out) + for actual, expected_out in zip(result, out, strict=True): + assert actual is expected_out + assert_close( + result.water_content_15_bar[0], + expected['water_content_15_bar'], + absolute=0.1, + relative=0.0, + quantity='gravimetric_water_content', + unit='mass_percent', + source='registry', + ) + assert_close( + result.water_content_one_third_bar[0], + expected['water_content_one_third_bar'], + absolute=0.1, + relative=0.0, + quantity='gravimetric_water_content', + unit='mass_percent', + source='registry', + ) + + +CASES_CALC_PTF_DIJKERMAN1988_AVAILABLE_WATER = [ + ({'clay': 10.0, 'silt': 30.0}, {'available_water': 11.33}), +] +CASES_CALC_PTF_DIJKERMAN1988_AVAILABLE_WATER_IDS = [ + 'veeneklaas_c_texture_calculated', +] + + +@pytest.mark.parametrize( + ('inputs', 'expected'), + CASES_CALC_PTF_DIJKERMAN1988_AVAILABLE_WATER, + ids=CASES_CALC_PTF_DIJKERMAN1988_AVAILABLE_WATER_IDS, +) +def test_calc_ptf_dijkerman1988_available_water_verification( + inputs: dict[str, float], expected: dict[str, float] +): + result = calc_ptf_dijkerman1988_available_water(**inputs) + + assert_close( + result, + expected['available_water'], + absolute=0.1, + relative=0.0, + quantity='gravimetric_water_content', + unit='mass_percent', + source='registry', + ) + + +def test_calc_ptf_dijkerman1988_available_water_array(): + inputs, expected, _out = prepare_vector_case(CASES_CALC_PTF_DIJKERMAN1988_AVAILABLE_WATER) + result = calc_ptf_dijkerman1988_available_water(**inputs, out=None) + assert_close( + result[0], + expected['available_water'], + absolute=0.1, + relative=0.0, + quantity='gravimetric_water_content', + unit='mass_percent', + source='registry', + ) + + +def test_calc_ptf_dijkerman1988_available_water_out(): + inputs, expected, out = prepare_vector_case(CASES_CALC_PTF_DIJKERMAN1988_AVAILABLE_WATER) + result = calc_ptf_dijkerman1988_available_water(**inputs, out=out) + assert result is out + assert_close( + result[0], + expected['available_water'], + absolute=0.1, + relative=0.0, + quantity='gravimetric_water_content', + unit='mass_percent', + source='registry', + ) diff --git a/targets/ptfkit-rs/src/dijkerman1988.rs b/targets/ptfkit-rs/src/dijkerman1988.rs new file mode 100644 index 0000000..f695103 --- /dev/null +++ b/targets/ptfkit-rs/src/dijkerman1988.rs @@ -0,0 +1,269 @@ +// @generated by ptfkit-codegen; DO NOT EDIT. + +#![doc = r"Dijkerman (1988), texture-based gravimetric water retention for Sierra Leone soils. + +# Reference + +Dijkerman, J. C. (1988). An Ustult-Aquult-Tropept catena in Sierra Leone, West Africa, II. Land +qualities and land evaluation. Geoderma, 42, 29-49. +DOI: 10.1016/0016-7061(88)90021-3 (https://doi.org/10.1016/0016-7061(88)90021-3) + +# Territory + +Sierra Leone, West Africa + +# Dataset + +166 soil samples from 42 soil profiles reported by Odell et al. (1974). Samples with organic +carbon greater than 4% were excluded from the regressions."] + +#[doc = r"Results returned by `calc_ptf_dijkerman1988`."] +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct Dijkerman1988WaterContent { + #[doc = r"Gravimetric moisture content at 15 bar, in weight percentage. (%)"] + pub water_content_15_bar: f64, + #[doc = r"Gravimetric moisture content at one-third bar, in weight percentage. (%)"] + pub water_content_one_third_bar: f64, +} +#[doc = r"Estimate gravimetric water contents at 15 bar and one-third bar from texture. + +# Arguments + + * clay: Clay content by mass. The supplied research notes report this observed calibration + range from a reconstruction of Odell et al. (1974), Appendix B. (%) + * sand: Sand content by mass. The supplied research notes report this observed calibration + range from a reconstruction of Odell et al. (1974), Appendix B. (%) + +# Returns + +A [`Dijkerman1988WaterContent`]. + +# Notes + +Prediction target: Gravimetric water contents at 15 bar and one-third bar. +Sand, silt, and clay percentages must sum to 100; sand plus clay must not exceed 100. +The regression dataset excludes samples containing more than 4% organic carbon. +These are two point predictions, not a continuous retention curve. + +# Warnings + +The paper describes these relationships as rough guides. +One-third-bar moisture content may underestimate field capacity and available moisture in these +soils. +The observed marginal calibration ranges do not establish validity for every joint texture +combination."] +#[cfg_attr(feature = "inline", inline)] +#[must_use] +pub fn calc_ptf_dijkerman1988(clay: f64, sand: f64) -> Dijkerman1988WaterContent { + let water_content_15_bar = 0.74f64 + 0.39f64 * clay; + let water_content_one_third_bar = 36.97f64 - 0.35f64 * sand; + Dijkerman1988WaterContent { + water_content_15_bar, + water_content_one_third_bar, + } +} +#[cfg(test)] +mod calc_ptf_dijkerman1988_tests { + use super::*; + use crate::test_support::assert_close; + #[test] + fn veeneklaas_table_2_2_a() { + let result = calc_ptf_dijkerman1988(5f64, 92.5f64); + assert_close( + result.water_content_15_bar, + 2.7f64, + 0.1f64, + 0f64, + "gravimetric_water_content", + "mass_percent", + "registry", + ); + assert_close( + result.water_content_one_third_bar, + 4.6f64, + 0.1f64, + 0f64, + "gravimetric_water_content", + "mass_percent", + "registry", + ); + } + #[test] + fn veeneklaas_table_2_2_b() { + let result = calc_ptf_dijkerman1988(12.5f64, 77.5f64); + assert_close( + result.water_content_15_bar, + 5.6f64, + 0.1f64, + 0f64, + "gravimetric_water_content", + "mass_percent", + "registry", + ); + assert_close( + result.water_content_one_third_bar, + 9.8f64, + 0.1f64, + 0f64, + "gravimetric_water_content", + "mass_percent", + "registry", + ); + } + #[test] + fn veeneklaas_table_2_2_c() { + let result = calc_ptf_dijkerman1988(10f64, 60f64); + assert_close( + result.water_content_15_bar, + 4.6f64, + 0.1f64, + 0f64, + "gravimetric_water_content", + "mass_percent", + "registry", + ); + assert_close( + result.water_content_one_third_bar, + 16f64, + 0.1f64, + 0f64, + "gravimetric_water_content", + "mass_percent", + "registry", + ); + } + #[test] + fn veeneklaas_table_2_2_d() { + let result = calc_ptf_dijkerman1988(27.5f64, 62.5f64); + assert_close( + result.water_content_15_bar, + 11.5f64, + 0.1f64, + 0f64, + "gravimetric_water_content", + "mass_percent", + "registry", + ); + assert_close( + result.water_content_one_third_bar, + 15.1f64, + 0.1f64, + 0f64, + "gravimetric_water_content", + "mass_percent", + "registry", + ); + } + #[test] + fn veeneklaas_table_2_2_e() { + let result = calc_ptf_dijkerman1988(42.5f64, 10f64); + assert_close( + result.water_content_15_bar, + 17.3f64, + 0.1f64, + 0f64, + "gravimetric_water_content", + "mass_percent", + "registry", + ); + assert_close( + result.water_content_one_third_bar, + 33.5f64, + 0.1f64, + 0f64, + "gravimetric_water_content", + "mass_percent", + "registry", + ); + } + #[test] + fn veeneklaas_table_2_2_f() { + let result = calc_ptf_dijkerman1988(32.5f64, 32.5f64); + assert_close( + result.water_content_15_bar, + 13.4f64, + 0.1f64, + 0f64, + "gravimetric_water_content", + "mass_percent", + "registry", + ); + assert_close( + result.water_content_one_third_bar, + 25.6f64, + 0.1f64, + 0f64, + "gravimetric_water_content", + "mass_percent", + "registry", + ); + } + #[test] + fn veeneklaas_table_2_2_g() { + let result = calc_ptf_dijkerman1988(17.5f64, 38.5f64); + assert_close( + result.water_content_15_bar, + 7.6f64, + 0.1f64, + 0f64, + "gravimetric_water_content", + "mass_percent", + "registry", + ); + assert_close( + result.water_content_one_third_bar, + 23.5f64, + 0.1f64, + 0f64, + "gravimetric_water_content", + "mass_percent", + "registry", + ); + } +} +#[doc = r"Estimate the gravimetric available moisture between one-third bar and 15 bar. + +# Arguments + + * clay: Clay content by mass. The supplied research notes report this observed calibration + range from a reconstruction of Odell et al. (1974), Appendix B. (%) + * silt: Silt content by mass; sand, silt, and clay sum to 100%. No separate observed silt + calibration range is supplied. (%) + +# Returns + + * available_water: Difference in gravimetric moisture contents, in weight percentage points. + (%) + +# Notes + +Prediction target: Gravimetric available moisture between one-third bar and 15 bar. +This estimates a gravimetric difference, not profile water storage or a volumetric fraction. +Use soil material with organic carbon at most 4% and physically consistent texture percentages. + +# Warnings + +Available moisture estimated using one-third bar may be somewhat low according to the paper."] +#[cfg_attr(feature = "inline", inline)] +#[must_use] +pub fn calc_ptf_dijkerman1988_available_water(clay: f64, silt: f64) -> f64 { + 1.23f64 - 0.04f64 * clay + 0.35f64 * silt +} +#[cfg(test)] +mod calc_ptf_dijkerman1988_available_water_tests { + use super::*; + use crate::test_support::assert_close; + #[test] + fn veeneklaas_c_texture_calculated() { + let result = calc_ptf_dijkerman1988_available_water(10f64, 30f64); + assert_close( + result, + 11.33f64, + 0.1f64, + 0f64, + "gravimetric_water_content", + "mass_percent", + "registry", + ); + } +}