API Reference - Land
This section of the documentation provides a reference for the API of the nodes.land and nodes.nutrient_pool modules.
Created on Fri May 20 08:58:58 2022.
@author: Barney
GardenSurface
Bases: GrowingSurface
Source code in wsimod/nodes/land.py
2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 |
|
__init__(**kwargs)
A specific surface for gardens that treats the garden as a grass crop, but that can calculate/receive irrigation through functions that are assigned by the parent land node's handlers, which in turn are expected to be triggered by a query from an attached Demand node.
Source code in wsimod/nodes/land.py
2388 2389 2390 2391 2392 2393 |
|
calculate_irrigation_demand(ignore_vqip=None)
A check function (assigned by parent to push check from demand nodes) that calculations irrigation demand (i.e., difference between evaporation and preciptiation).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ignore_vqip
|
any
|
Conventional push checks send an optional VQIP amount, however the intention with this check is to get the irrigation demand |
None
|
Returns:
Name | Type | Description |
---|---|---|
reply |
dict
|
A VQIP amount of irrigation demand (note only 'volume' key is used) |
Source code in wsimod/nodes/land.py
2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 |
|
receive_irrigation_demand(vqip)
A set function (assigned by parent to push set from demand nodes) that assigns irrigation water supply to the surface tank.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vqip
|
dict
|
A VQIP amount of irrigation to receive |
required |
Returns:
Type | Description |
---|---|
dict
|
A VQIP amount of irrigation that was not received (should always be empty) |
Source code in wsimod/nodes/land.py
2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 |
|
GrowingSurface
Bases: PerviousSurface
Source code in wsimod/nodes/land.py
1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 |
|
__init__(rooting_depth=1, ET_depletion_factor=1, crop_factor_stages=[1, 1], crop_factor_stage_dates=[0, 365], sowing_day=1, harvest_day=365, initial_soil_storage=None, **kwargs)
Extensive surface subclass that implements the CatchWat equations (Liu, Dobson & Mijic (2022) Science of the total environment), which in turn are primarily based on FAO document: https://www.fao.org/3/x0490e/x0490e0ehtm#soil%20water%20availability. This surface is a pervious surface that also has things that grow on it. This behaviour includes soil nutrient pools, crop planting/harvest calendars, erosion, crop behaviour.
A key complexity of this surface is the nutrient pool (see wsimod/nodes/ nutrient_pool.py), which is a class that tracks the amount of phosphorus and nitrogen in different states and performs transformations that occur in the phosphorus/nitrogen cycle. It is assumed that the phosphate/nitrate/nitrite/ ammonia amounts in this Surface tank should track the dissolved inorganic pool in the nutrient pool. Meanwhile, the org-phosphorus/org-nitrogen amounts in this tank should track the dissolved organic pool in the nutrient pool. The total amount of pollutants that enter this tank may not be the same as the total amount that leave, because pollutants are transformed between inorganic/ organic and between wet/dry states - these transformations are accounted for in mass balance.
For users to quickly enable/disable these nutrient processes, which are computationally intensive (in current case studies they account for about half of the total runtime), they are only active if 'nitrate' is one of the modelled pollutants. Note that the code will not check if nitrite/phosphate/ org-phosphorus/org-nitrogen/ammonia are also included, but they should be if nitrate is included and otherwise the code will crash with a key error.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rooting_depth
|
float
|
Depth of the soil tank (i.e., how deep do crop roots go). Defaults to 1. |
1
|
ET_depletion_factor
|
float
|
Average fraction of soil that can be depleted from the root zone before moisture stress (reduction in ET) occurs. Defaults to 1. |
1
|
crop_factor_stages
|
list
|
Crop factor is a multiplier on et0, more grown plants have higher transpiration and higher crop factors. This list shows changing crop factor at different times of year in relation to crop_factor_stage_dates. See wsimod/preprocessing/ england_data_formatting.py/format_surfaces for further details on formulating these - since the interpolation used to find crop_factors in between the given values in the list is a bit involved. Defaults to [1,1]. |
[1, 1]
|
crop_factor_stage_dates
|
list
|
Dates associated with crop_factor_stages. Defaults to [0, 365]. |
[0, 365]
|
sowing_day
|
int
|
day of year that crops are sown. Defaults to 1. |
1
|
harvest_day
|
int
|
day of year that crops are harvest. Defaults to 365. |
365
|
initial_soil_storage
|
dict or float
|
Initial mass of solid |
None
|
Key assumptions
- In the soil water module, crop stages and crop coefficients control the evapotranspiration.
- Fertiliser and manure application are the major source of soil nutrients, which are added into soil nutrient pools, including dissovled inorganic, dissolved organic, fast and humus for both nitrogen and phosphorus.
- Nutrient transformation processes in soil are simulated, including fluxes between the soil nutrient pools, denitrification for nitrogen, adsorption/desorption for phosphorus. These processes are affected by temperature and soil moisture.
- Crop uptake of nutrients are simulated based on crop stages, which is different for spring-sown and autumn-sown crops.
- Soil erosion from the growing surface is simulated as one of the major sources of suspended solids in rivers, which is mainly affected by rainfall energy and crop/ground cover. Phosphorus will also be eroded along with the soil particles, in both adsorbed inorganic and humus form.
Input data and parameter requirements
data_input_dict
can contain a variety of pollutant deposition data.srp-fertiliser
describes phosphate.noy-fertiliser
describes nitrogen as nitrates.nhx-fertiliser
describes nitrogen as ammonia.srp/noy/ nhx-manure
can also be used to specify manure application. Units: kg/m2/timestep (data is read at a monthly timestep)- Rooting depth. Units: m
- Evapotranspiration depletion factor. Units: -
- Sowing day, harvest day and crop calendars. Units: day number in Julian calendar
- Crop factor. Units: -
- Initial storage for solid pollutants. Units: kg
Source code in wsimod/nodes/land.py
1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 |
|
adjust_vqip_to_liquid(vqip, deposition, in_)
Function to interoperate between surface tank and nutrient pool. Most depositions are given in terms of ammonia/nitrate/phosphate - they are then aggregated to total N or P to enter the nutrient pools. Depending on the source of deposition these may transform (e.g., some go to dissolved and some to solids) upon entering the nutrient pool. To reflect these transformations in the soil tank, the amounts entering the soil tank are adjusted proportionately.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vqip
|
dict
|
A VQIP amount of pollutants originally intended to enter the soil tank |
required |
deposition
|
dict
|
A dict with nutrients (N and P) as keys, showing the total amount of nutrients entering the nutrient pool |
required |
in_
|
dict
|
A dict with nutrients as keys, showing the updated amount of nutrients that entered the nutrient pool as dissolved pollutants |
required |
Returns:
Name | Type | Description |
---|---|---|
vqip |
dict
|
A VQIP amount of pollutants that have been scaled to account for nutrient pool transformations |
Source code in wsimod/nodes/land.py
1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 |
|
adsorption()
Outflow function that calculates phosphorus adsorption/desorptions and updates soil tank and nutrient pools.
Returns:
Type | Description |
---|---|
tuple
|
A tuple containing a VQIP amount for model inputs and outputs for mass balance checking. |
Source code in wsimod/nodes/land.py
2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 |
|
apply_overrides(overrides=Dict[str, Any])
Override parameters.
Enables a user to override any of the following parameters
Parameters:
Name | Type | Description | Default |
---|---|---|---|
overrides
|
Dict[str, Any]
|
Dict describing which parameters should be overridden (keys) and new values (values). Defaults to {}. |
Dict[str, Any]
|
Source code in wsimod/nodes/land.py
1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 |
|
calc_crop_cover()
Process function that calculates how much crop cover there is, assigns whether crops are sown/harvested, and calculates et0_coefficient based on growth stage of crops.
Returns:
Type | Description |
---|---|
tuple
|
A tuple containing a VQIP amount for model inputs and outputs for mass balance checking. |
Source code in wsimod/nodes/land.py
1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 |
|
calc_crop_uptake()
Process function that calculates how much nutrient crops uptake and updates nutrient pool and surface tank.
Returns:
Type | Description |
---|---|
tuple
|
A tuple containing a VQIP amount for model inputs and outputs for mass balance checking. |
Source code in wsimod/nodes/land.py
1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 |
|
calc_soil_moisture_dependence_factor()
Process function that calculates the soil moisture dependence factor for the nutrient pool (which impacts soil pool transformations).
Returns:
Type | Description |
---|---|
tuple
|
A tuple containing a VQIP amount for model inputs and outputs for mass balance checking. |
Source code in wsimod/nodes/land.py
1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 |
|
calc_temperature_dependence_factor()
Process function that calculates the temperature dependence factor for the nutrient pool (which impacts soil pool transformations).
Returns:
Type | Description |
---|---|
tuple
|
A tuple containing a VQIP amount for model inputs and outputs for mass balance checking. |
Source code in wsimod/nodes/land.py
1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 |
|
calculate_available_water()
Calculate total/readily available water based on capacity/wp. Returns: (float): total available water (float): readily available water
Source code in wsimod/nodes/land.py
1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 |
|
denitrification()
Outflow function that performs denitirication processes, updating nutrient pool and soil tank.
Returns:
Type | Description |
---|---|
tuple
|
A tuple containing a VQIP amount for model inputs and outputs for mass balance checking. |
Source code in wsimod/nodes/land.py
2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 |
|
dry_deposition_to_tank(vqip)
Allocate dry deposition to surface tank, updating nutrient pool accordingly.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vqip
|
dict
|
A VQIP amount of dry deposition to send to tank |
required |
Returns:
Name | Type | Description |
---|---|---|
vqip |
dict
|
A VQIP amount of dry deposition that entered the tank (used for mass balance checking) |
Source code in wsimod/nodes/land.py
2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 |
|
effective_precipitation_flushing()
Remove the nutrients brought out by effective precipitation, which is surface runoff, subsurface runoff, and percolation, from the nutrients pool.
Returns:
Type | Description |
---|---|
tuple
|
A tuple containing a VQIP amount for model inputs and outputs for mass balance checking. |
Source code in wsimod/nodes/land.py
1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 |
|
erosion()
Outflow function that erodes adsorbed/humus phosphorus and sediment and sends onwards to percolation/surface runoff/subsurface runoff.
Returns:
Type | Description |
---|---|
tuple
|
A tuple containing a VQIP amount for model inputs and outputs for mass balance checking. |
Source code in wsimod/nodes/land.py
1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 |
|
fertiliser()
Read, scale and allocate fertiliser, updating the tank.
Returns:
Type | Description |
---|---|
tuple
|
A tuple containing a VQIP amount for model inputs and outputs for mass balance checking. |
Source code in wsimod/nodes/land.py
1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 |
|
infer_sow_harvest_calendar()
Infer basic sow/harvest calendar and indicate autumn-sown. Returns: (list): havest/sow calendar (list): ground cover stages (list): crop cover stages (boolean): indication for autumn-sown crops
Source code in wsimod/nodes/land.py
1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 |
|
manure()
Read, scale and allocate manure, updating the tank.
Returns:
Type | Description |
---|---|
tuple
|
A tuple containing a VQIP amount for model inputs and outputs for mass balance checking. |
Source code in wsimod/nodes/land.py
1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 |
|
pull_storage(vqip)
Pull water from the surface, updating the surface storage VQIP. Nutrient pool pollutants (nitrate/nitrite/ammonia/phosphate/org- phosphorus/ org-nitrogen) are removed in proportion to their amounts in the dissolved nutrient pools, if they are simulated. Other pollutants are removed in proportion to their amount in the surface tank.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vqip
|
dict
|
VQIP amount to be pulled, (only 'volume' key is needed) |
required |
Returns:
Name | Type | Description |
---|---|---|
reply |
dict
|
A VQIP amount successfully pulled from the tank |
Source code in wsimod/nodes/land.py
1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 |
|
quick_interp(x, xp, yp)
A simple version of np.interp to intepolate crop information on the fly.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
int
|
Current time (i.e., day of year) xp (list): Predefined times (i.e., |
required |
list
|
of days of year) yp (list
|
Predefined values associated with xp |
required |
Returns:
Name | Type | Description |
---|---|---|
y |
float
|
Interpolated value for current time |
Source code in wsimod/nodes/land.py
1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 |
|
residue()
Read, scale and allocate residue, updating the tank (NOT CURRENTLY USED BECAUSE NO DATA SOURCES FOR RESIDUE CAN BE IDENTIFIED).
Returns:
Type | Description |
---|---|
tuple
|
A tuple containing a VQIP amount for model inputs and outputs for mass balance checking. |
Source code in wsimod/nodes/land.py
1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 |
|
soil_pool_transformation()
A process function that run transformation functions in the nutrient pool and updates the pollutant concentrations in the surface tank.
Returns:
Type | Description |
---|---|
tuple
|
A tuple containing a VQIP amount for model inputs and outputs for mass balance checking. |
Source code in wsimod/nodes/land.py
1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 |
|
wet_deposition_to_tank(vqip)
Allocate wet deposition to surface tank, updating nutrient pool accordingly.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vqip
|
dict
|
A VQIP amount of dry deposition to send to tank |
required |
Returns:
Name | Type | Description |
---|---|---|
vqip |
dict
|
A VQIP amount of dry deposition that entered the tank (used for mass balance checking) |
Source code in wsimod/nodes/land.py
2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 |
|
ImperviousSurface
Bases: Surface
Source code in wsimod/nodes/land.py
583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 |
|
__init__(pore_depth=0, et0_to_e=1, **kwargs)
A surface to represent impervious surfaces that drain to storm sewers. Runoff is generated by the surface tank overflowing, if a user wants all precipitation to immediately go to runoff then they should reduce 'pore_depth', however generally this is not what happens and a small (a few mm) depth should be assigned to the tank. Also includes urban pollution deposition, though this will only be mobilised if runoff occurs.
Note that the tank does not have a runoff coefficient because it doesn't make sense from an integrated perspective. If a user wants to mimic runoff coefficient-like behaviour, then they should reduce the ImperviousSurface tank size, and increase other surfaces of the parent land node accordingly.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pore_depth
|
float
|
The depth of the tank that must be exceeded to generate runoff. Intended to represent the pores in ashpalt that water accumulates in before flowing. Defaults to 0. |
0
|
et0_to_e
|
float
|
Multiplier applied to the parent's data timeseries of et0 to determine how much evaporation takes place on the ImperviousSurface. Defaults to 1. |
1
|
Source code in wsimod/nodes/land.py
586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 |
|
apply_overrides(overrides=Dict[str, Any])
Override parameters.
Enables a user to override any of the following parameters: eto_to_e, pore_depth.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
overrides
|
Dict[str, Any]
|
Dict describing which parameters should be overridden (keys) and new values (values). Defaults to {}. |
Dict[str, Any]
|
Source code in wsimod/nodes/land.py
622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 |
|
precipitation_evaporation()
Inflow function that is a simple rainfall-evaporation model, updating the.
surface tank. All precipitation that is not evaporated is forced into the tank (even though some of that will later be pushed to sewers) - this enables runoff to mix with the accumulated pollutants in the surface pores.
Returns:
Type | Description |
---|---|
tuple
|
A tuple containing a VQIP amount for model inputs and outputs for mass balance checking. |
Source code in wsimod/nodes/land.py
644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 |
|
push_to_sewers()
Outflow function that distributes ponded water (i.e., surface runoff) to the parent node's attached sewers.
Returns:
Type | Description |
---|---|
tuple
|
A tuple containing a VQIP amount for model inputs and outputs for mass balance checking. |
Source code in wsimod/nodes/land.py
698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 |
|
IrrigationSurface
Bases: GrowingSurface
Source code in wsimod/nodes/land.py
2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 |
|
__init__(irrigation_coefficient=0.1, **kwargs)
A subclass of GrowingSurface that can calculate water demand for the crops that is not met by precipitation and use the parent node to acquire water. When the surface is created by the parent node, the irrigate function below is assigned.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
irrigation_coefficient
|
float
|
proportion area irrigated * proportion of demand met. Defaults to 0.1. |
0.1
|
Source code in wsimod/nodes/land.py
2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 |
|
apply_overrides(overrides=Dict[str, Any])
Override parameters.
Enables a user to override irrigation_coefficient
Parameters:
Name | Type | Description | Default |
---|---|---|---|
overrides
|
Dict[str, Any]
|
Dict describing which parameters should be overridden (keys) and new values (values). Defaults to {}. |
Dict[str, Any]
|
Source code in wsimod/nodes/land.py
2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 |
|
irrigate()
Calculate water demand for crops and call parent node to acquire water, updating surface tank and nutrient pools.
Source code in wsimod/nodes/land.py
2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 |
|
Land
Bases: Node
Source code in wsimod/nodes/land.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 |
|
__init__(name, subsurface_residence_time=5, percolation_residence_time=50, surface_residence_time=1, surfaces=[], data_input_dict={})
An extensive node class that represents land processes (agriculture, soil, subsurface flow, rural runoff, urban drainage, pollution deposition). The expected use is that each distinctive type of land cover (different crop types, gardens, forests, impervious urban drainage, etc.) each have a Surface object, which is a subclass of Tank. The land node will iterate over its surfaces each timestep, which will generally (except in the case of an impervious surface) send water to three common Tanks: surface flow, subsurface flow and percolation. These tanks will then send flows to rivers or groundwater.
(See wsimod/nodes/land.py/Surface and subclasses for currently available surfaces)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
node name. subsurface_residence_time (float, optional): |
required |
percolation_residence_time
|
int
|
Residence time for percolation flow (see nodes.py/ResidenceTank). Defaults to 50. |
50
|
surface_residence_time
|
int
|
Residence time for surface flow (see nodes.py/ResidenceTank). Defaults to 1. |
1
|
surfaces
|
list
|
list of dicts where each dict describes the parameters of each surface in the Land node. Each dict also contains an entry under 'type_' which describes which subclass of surface to use. Defaults to []. |
[]
|
data_input_dict
|
dict
|
Dictionary of data inputs relevant for the node (generally, et0, precipitation and temperature). Keys are tuples where first value is the name of the variable to read from the dict and the second value is the time. Defaults to {}. |
{}
|
Functions intended to call in orchestration
run apply_irrigation (if used)
Key assumptions
- Percolation, surface runoff, and subsurface runoff, can be described with a residence-time method.
- Flows to percolation, surface runoff, and subsurface runoff are
generated by different hydrological response units (subclasses of
land.py/Surface
), but aggregated for a given land node. - Flows to percolation are distributed to
storage.py/Groundwater
nodes while surface/subsurface runoff tonodes.py/Node
orstorage.py/River
nodes. - Input data associated with the land node (precipitation, temperature, evapotranspiartion) are the same for every surface.
- Water received from
sewer.py/Sewer
objects is sent to the firstland.py/ImperviousSurface
in the surfaces list.
Input data and parameter requirements
- Precipitation and evapotranspiration are in the
data_input_dict
at the model timestep. Units: metres/timestep - Temperature in the
data_input_dict
at the model timestep. Units: C - Residence time of surface, subsurface and percolation flows. Units: number of timesteps
Source code in wsimod/nodes/land.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
|
apply_irrigation()
Iterate over any irrigation functions (needs further testing..
maybe).
Source code in wsimod/nodes/land.py
191 192 193 194 195 196 197 |
|
apply_overrides(overrides=Dict[str, Any])
Apply overrides to the Land.
Enables a user to override any parameter of the residence_time and update the residence_tank accordingly.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
overrides
|
Dict[str, Any]
|
Dict describing which parameters should be overridden (keys) and new values (values). Defaults to {}. |
Dict[str, Any]
|
Source code in wsimod/nodes/land.py
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 |
|
end_timestep()
Update mass balance and end timestep of all tanks (and surfaces).
Source code in wsimod/nodes/land.py
265 266 267 268 269 270 271 272 273 274 |
|
get_surface(surface_)
Return a surface from the list of surfaces by the 'surface' entry in the surface. I.e., the name of the surface.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
surface_
|
str
|
Name of the surface |
required |
Returns:
Name | Type | Description |
---|---|---|
surface |
Surface
|
The first surface that matches the name |
Source code in wsimod/nodes/land.py
276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
|
push_set_sewer(vqip)
Receive water from a sewer and send it to the first ImperviousSurface in surfaces.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vqip
|
dict
|
A VQIP amount to be sent to the impervious surface |
required |
Returns:
Name | Type | Description |
---|---|---|
vqip |
dict
|
A VQIP amount of water that was not received |
Source code in wsimod/nodes/land.py
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 |
|
reinit()
Source code in wsimod/nodes/land.py
291 292 293 294 295 296 297 298 299 |
|
run()
Call the run function in all surfaces, update surface/subsurface/ percolation tanks, discharge to rivers/groundwater.
Source code in wsimod/nodes/land.py
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 |
|
PerviousSurface
Bases: Surface
Source code in wsimod/nodes/land.py
723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 |
|
__init__(depth=0.75, total_porosity=0.4, field_capacity=0.3, wilting_point=0.12, infiltration_capacity=0.5, surface_coefficient=0.05, percolation_coefficient=0.75, et0_coefficient=0.5, ihacres_p=10, **kwargs)
A generic pervious surface that represents hydrology with the IHACRES model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
depth
|
float
|
Soil tank (i.e., root) depth. Defaults to 0.75. |
0.75
|
total_porosity
|
float
|
The total porosity IHACRES parameter (i.e., defines the total porouse volume of the soil - the maximum volume of soil pores can contain when saturated). Defaults to 0.4. |
0.4
|
field_capacity
|
float
|
The field capacity IHACRES parameter (i.e., when water content in the soil tank is above this value - flows of any kind can be generated). Defaults to 0.3. |
0.3
|
wilting_point
|
float
|
The wilting point IHACRES parameter (i.e., when water content content in the soil tank is above this value - plants can uptake water and evaporation from the soil tank can occur). Defaults to 0.12. |
0.12
|
infiltration_capacity
|
float
|
Depth of water per day that can enter the soil tank. Non infiltrated water will pond and travel as surface runoff from the parent Land node. Defaults to 0.5. |
0.5
|
surface_coefficient
|
float
|
If flow is generated, the proportion of flow that goes to surface runoff. Defaults to 0.05. |
0.05
|
percolation_coefficient
|
float
|
If flow is generated, then the proportion of water that does not go to surface runoff that goes to percolation (i.e., groundwater) - the remainder goes to subsurface runoff. Defaults to 0.75. |
0.75
|
et0_coefficient
|
float
|
Convert between the parent nodes data timeseries et0 - and potential evaptranspiration per unit area for this surface. Defaults to=0.5, |
0.5
|
ihacres_p
|
float
|
The IHACRES p parameter. Unless it is an ephemeral stream this parameter probably can stay high. Defaults to 10. |
10
|
Key assumptions
- In IHACRES, the maximum infiltration per time step is controlled by an infiltration capacity, beyond which the precipitation will flow directly as surface runoff.
- Evapotranspiration and effective precipitation are calculated based on soil moisture content.
- Effective precipitation is then divided into percolation, surface runoff, and subsurface runoff by multiplying the corresponding coefficient.
- Percolation, surface runoff, and subsurface runoff are sent into the corresponding residence tanks for rounting to downstream.
- The mass of pollutants in soil water tank proportionately leaves the soil water tank into the routing residence tanks. Evapotranspiration can only bring out water, with pollutants left in the soil tank.
Input data and parameter requirements
- Field capacity and wilting point. Units: -, both should in [0-1], with field capacity > wilting point
- Infiltration capacity. Units: m/day
- Surface, percolation coefficient. Units: -, both should in [0-1]
- et0 coefficient. Units: -
- ihacres_p. Units: -
Source code in wsimod/nodes/land.py
726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 |
|
apply_overrides(overrides=Dict[str, Any])
Override parameters.
Enables a user to override any of the following parameters: field_capacity, wilting_point, total_porosity, infiltration_capacity, surface_coefficient, percolation_coefficient, et0_coefficient, ihacres_p, soil_temp_w_prev, soil_temp_w_air, soil_temp_w_deep, soil_temp_deep, and the corresponding parameter values, including field_capacity_m, wilting_point_m, depth, capacity, subsurface_coefficient.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
overrides
|
Dict[str, Any]
|
Dict describing which parameters should be overridden (keys) and new values (values). Defaults to {}. |
Dict[str, Any]
|
Source code in wsimod/nodes/land.py
842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 |
|
calculate_soil_temperature()
Process function that calculates soil temperature based on a weighted.
average. This equation is from Lindstrom, Bishop & Lofvenius (2002), hydrological processes - but it is not clear what the parameters should be.
Returns:
Type | Description |
---|---|
tuple
|
A tuple containing a VQIP amount for model inputs and outputs for mass balance checking. |
Source code in wsimod/nodes/land.py
1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 |
|
get_climate()
Returns:
Source code in wsimod/nodes/land.py
902 903 904 905 906 907 908 909 910 |
|
get_cmd()
Calculate moisture deficit (i.e., the tank excess converted to depth).
Returns:
Type | Description |
---|---|
float
|
current moisture deficit |
Source code in wsimod/nodes/land.py
885 886 887 888 889 890 891 |
|
get_smc()
Calculate moisture content (i.e., the tank volume converted to depth).
Returns:
Type | Description |
---|---|
float
|
soil moisture content |
Source code in wsimod/nodes/land.py
893 894 895 896 897 898 899 900 |
|
ihacres()
Inflow function that runs the IHACRES model equations, updates tanks, and store flows in state variables (which are later sent to the parent land node in the route function).
Returns:
Type | Description |
---|---|
tuple
|
A tuple containing a VQIP amount for model inputs and outputs for mass balance checking. |
Source code in wsimod/nodes/land.py
912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 |
|
route()
An outflow function that sends percolation, subsurface runoff and surface runoff to their respective tanks in the parent land node.
Returns:
Type | Description |
---|---|
tuple
|
A tuple containing a VQIP amount for model inputs and outputs for mass balance checking. |
Source code in wsimod/nodes/land.py
1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 |
|
Surface
Bases: DecayTank
Source code in wsimod/nodes/land.py
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 |
|
__init__(surface='', area=1, depth=1, data_input_dict={}, pollutant_load={}, **kwargs)
A subclass of DecayTank. Each Surface is anticipated to represent a different land cover type of a Land node. Besides functioning as a Tank, Surfaces have three lists of functions (inflows, processes and outflows) where behaviour can be added by appending new functions. We anticipate that customised surfaces should be a subclass of Surface or its subclasses and add functions to these lists. These lists are executed (inflows first, then processes, then outflows) in the run function, which is called by the run function in Land. The lists must return any model inflows or outflows as a VQIP for mass balance checking.
If a user wishes the DecayTank portion to be active, then can provide 'decays', which are passed upwards (see wsimod/core/core.py/DecayObj for documentation)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
surface
|
str
|
String description of the surface type. Doesn't serve a modelling purpose, just used for user reference. Defaults to ''. |
''
|
area
|
float
|
Area of surface. Defaults to 1. depth (float, |
1
|
optional)
|
Depth of tank (this has different physical implications for different subclasses). Defaults to 1. |
required | |
data_input_dict
|
dict
|
Dictionary of data inputs relevant for the surface (generally, deposition). Keys are tuples where first value is the name of the variable to read from the dict and the second value is the time. Note that this input should be specific to the surface, and is not intended to be the same data input as for the land node. Also note that with each surface having its own timeseries of data inputs, this can take up a lot of memory, thus the default behavior is to have this as monthly data where the time variable is a monthyear. Defaults to {}. |
{}
|
pollutant_load
|
dict
|
A dict of different pollutant amounts that are deposited on the surface (units are mass per area per timestep). Defaults to {}. |
{}
|
Key assumptions
- Generic
Surface
that reads data and can apply simple forms of pollution deposition. - Formulated as a
Tank
object. - Ammonia->Nitrite->Nitrate decay takes place if parameters describing this
process are provided in
decays
(seecore.py/DecayObj
for transformation details).
Input data and parameter requirements
data_input_dict
can contain a variety of pollutant deposition data.srp-dry
describes phosphate.noy-dry
describes nitrogen as nitrates.nhx-dry
describes nitrogen as ammonia.srp/noy/ nhx-wet
can also be used to specify wet deposition. Units: kg/m2/timestep (data is read at a monthly timestep)
Source code in wsimod/nodes/land.py
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 |
|
apply_overrides(overrides=Dict[str, Any])
Override parameters.
Enables a user to override any of the following parameters: area and depth (both will update the capacity), pollutant_load (the entire dict does not need to be redefined, only changed values need to be included).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
overrides
|
Dict[str, Any]
|
Dict describing which parameters should be overridden (keys) and new values (values). Defaults to {}. |
Dict[str, Any]
|
Source code in wsimod/nodes/land.py
383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 |
|
atmospheric_deposition()
Inflow function to cause dry atmospheric deposition to occur, updating the surface tank.
Returns:
Type | Description |
---|---|
tuple
|
A tuple containing a VQIP amount for model inputs and outputs for mass balance checking. |
Source code in wsimod/nodes/land.py
527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 |
|
dry_deposition_to_tank(vqip)
Generic function for allocating dry pollution deposition to the surface. Simply sends the pollution into the tank (some subclasses overwrite this behaviour).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vqip
|
dict
|
A VQIP amount of dry deposition to send to tank |
required |
Returns:
Name | Type | Description |
---|---|---|
vqip |
dict
|
A VQIP amount of dry deposition that entered the tank (used for mass balance checking) |
Source code in wsimod/nodes/land.py
472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 |
|
get_data_input(var)
Read data input from parent Land node (i.e., for precipitation/et0/temp).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
var
|
str
|
Name of variable |
required |
Returns:
Type | Description |
---|---|
Data read |
Source code in wsimod/nodes/land.py
450 451 452 453 454 455 456 457 458 459 |
|
get_data_input_surface(var)
Read data input from this surface's data_input_dict.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
var
|
str
|
Name of variable |
required |
Returns:
Type | Description |
---|---|
Data read |
Source code in wsimod/nodes/land.py
461 462 463 464 465 466 467 468 469 470 |
|
precipitation_deposition()
Inflow function to cause wet precipitation deposition to occur, updating the surface tank.
Returns:
Type | Description |
---|---|
tuple
|
A tuple containing a VQIP amount for model inputs and outputs for mass balance checking. |
Source code in wsimod/nodes/land.py
555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 |
|
run()
Call run function (called from Land node).
Source code in wsimod/nodes/land.py
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 |
|
simple_deposition()
Inflow function to cause simple pollution deposition to occur, updating the surface tank.
Returns:
Type | Description |
---|---|
tuple
|
A tuple containing a VQIP amount for model inputs and outputs for mass balance checking. |
Source code in wsimod/nodes/land.py
504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 |
|
wet_deposition_to_tank(vqip)
Generic function for allocating wet pollution deposition to the surface. Simply sends the pollution into the tank (some subclasses overwrite this behaviour).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vqip
|
dict
|
A VQIP amount of wet deposition to send to tank |
required |
Returns:
Name | Type | Description |
---|---|---|
vqip |
dict
|
A VQIP amount of wet deposition that entered the tank (used for mass balance checking) |
Source code in wsimod/nodes/land.py
488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 |
|
VariableAreaSurface
Bases: GrowingSurface
Source code in wsimod/nodes/land.py
2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 |
|
__init__(current_surface_area=0, **kwargs)
Source code in wsimod/nodes/land.py
2442 2443 2444 2445 2446 |
|
get_climate_()
Returns:
Source code in wsimod/nodes/land.py
2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 |
|
Created on Thu May 19 16:42:20 2022.
@author: barna
NutrientPool
Source code in wsimod/nodes/nutrient_pool.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 |
|
__init__(fraction_dry_n_to_dissolved_inorganic=0.9, degrhpar={'N': 7 * 1e-05, 'P': 7 * 1e-06}, dishpar={'N': 7 * 1e-05, 'P': 7 * 1e-06}, minfpar={'N': 0.00013, 'P': 3e-06}, disfpar={'N': 3e-06, 'P': 1e-07}, immobdpar={'N': 0.0056, 'P': 0.2866}, fraction_manure_to_dissolved_inorganic={'N': 0.5, 'P': 0.1}, fraction_residue_to_fast={'N': 0.1, 'P': 0.1})
A class to track nutrient pools in a soil tank, intended to be initialised and called by GrowingSurfaces (see wsimod/nodes/land.py/GrowingSurface) and their subclasses. Contains five pools, which have a storage that tracks the mass of nutrients. Equations and parameters are based on HYPE.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fraction_dry_n_to_dissolved_inorganic
|
float
|
fraction of dry |
0.9
|
optional)
|
reference humus degradation rate (fraction of humus pool to fast |
required | |
pool).
|
Defaults to {'N'
|
7 * 1e-5, 'P' : 7 * 1e-6}. dishpar (dict, |
required |
optional)
|
reference humus dissolution rate (fraction of humus pool to |
required | |
dissolved
|
organic pool). Defaults to {'N'
|
7 * 1e-5, 'P' : 7 * 1e-6}. |
required |
minfpar
|
dict
|
reference fast pool mineralisation rate (fraction |
{'N': 0.00013, 'P': 3e-06}
|
of
|
fast pool to dissolved inorganic pool). Defaults to {'N'
|
0.00013, 'P' : |
required |
0.000003}.
|
disfpar (dict
|
reference fast pool dissolution rate |
required |
(fraction
|
of fast pool to dissolved organic pool). Defaults to {'N'
|
|
required |
0.000003,
|
P
|
0.0000001}. immobdpar (dict, optional): reference |
required |
Defaults
|
to {'N'
|
0.0056, 'P' : 0.2866}. |
required |
fraction_manure_to_dissolved_inorganic
|
dict
|
fraction of |
{'N': 0.5, 'P': 0.1}
|
added
|
to the fast pool. Defaults to {'N'
|
0.5, 'P' : 0.1}. |
required |
fraction_residue_to_fast
|
dict
|
fraction of nutrients from |
{'N': 0.1, 'P': 0.1}
|
{'N'
|
0.1, 'P' : 0.1}. |
required |
Key assumptions
- Four nutrient pools are conceptualised for both nitrogen and phosphorus in soil, which includes humus pool, fast pool, dissolved inorganic pool, and dissolved organic pool. Humus and fast pool represent immobile pool of organic nutrients in the soil with slow and fast turnover, respectively. Dissolved inorganic and organic pool represent nutrients in dissolved phase in soil water (for phosphorus, dissolved organic pool might contain particulate phase). Given that phoshphorus can be adsorbed and attached to soil particles, an adsorbed inorganic pool is created specifically for phosphorus.
- The major sources of nutrients to soil are conceptualised as
- atmospheric deposition:
- dry deposition:
- for nitrogen, inorganic fraction of dry deposition is added to the dissovled inorganic pool, while the rest is added to the fast pool;
- for phosphorus, all is added to adsorbed inorganic pool.
- wet deposition: all is added to the dissolved inorganic pool.
- dry deposition:
- fertilisers: all added to the dissolved inorganic pool.
- manure: the inorganic fraction is added to the dissovled inorganic pool, with the rest added to the fast pool.
- residue: the part with fast turnover is added to the fast pool, with the rest added to the humus pool.
- Nutrient fluxes between these pools are simulated to represent the biochemical processes that can transform the nutrients between different forms. These processes include - degradation of humus pool to fast pool - dissolution of humus pool to dissovled organic pool - mineralisation of fast pool to dissolved inorganic pool - dissolution of fast pool to dissolved organic pool - immobilisation of dissolved inroganic pool to fast pool The rate of these processes are affected by the soil temperature and moisture conditions.
- When soil erosion happens, a portion of both the adsorbed inorganic pool and humus pool for phosphorus will be eroded as well.
Input data and parameter requirements
- fraction_dry_n_to_dissolved_inorganic, fraction_manure_to_dissolved_inorganic, fraction_residue_to_fast. Units: -, all should in [0-1]
- degrhpar, dishpar, minfpar, disfpar, immobdpar. Units: -, all should in [0-1]
Source code in wsimod/nodes/nutrient_pool.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
|
allocate_dry_deposition(deposition)
Assign dry deposition, which is assumed to go to both dissolved inorganic pool and fast pool (nitrogen) and the adsorbed pool (phosphorus).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deposition
|
dict
|
A dict that contains the amount of nutrients entering the nutrient pool via dry deposition |
required |
Returns:
Type | Description |
---|---|
dict
|
A dict describing the amount of nutrients that enter the nutrient pool in a dissolved form (and thus need to be tracked by the soil water tank) |
Source code in wsimod/nodes/nutrient_pool.py
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
|
allocate_fertiliser(fertiliser)
Assign fertiliser, which is assumed to contain dissolved inorganic nutrients and thus updates that pool.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fertiliser
|
dict
|
A dict that contains the amount of nutrients entering the nutrient pool via fertiliser |
required |
Returns:
Name | Type | Description |
---|---|---|
fertiliser |
dict
|
fertiliser above, because no transformations take place (i.e., dissolved inorganic is what is received and goes straight into that pool) |
Source code in wsimod/nodes/nutrient_pool.py
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 |
|
allocate_inorganic_irrigation(irrigation)
Assign inorganic irrigation, which is assumed to contain dissolved inorganic nutrients and thus updates that pool.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
irrigation
|
dict
|
A dict that contains the amount of nutrients entering the nutrient pool via irrigation |
required |
Returns:
Name | Type | Description |
---|---|---|
irrigation |
dict
|
irrigation above, because no transformations take place (i.e., dissolved inorganic is what is received and goes straight into that pool) |
Source code in wsimod/nodes/nutrient_pool.py
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
|
allocate_manure(manure)
Assign manure, which is assumed to go to both dissolved inorganic pool and fast pool.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
manure
|
dict
|
A dict that contains the amount of nutrients entering the nutrient pool via manure |
required |
Returns:
Type | Description |
---|---|
dict
|
A dict describing the amount of nutrients that enter the nutrient pool in a dissolved form (and thus need to be tracked by the soil water tank) |
Source code in wsimod/nodes/nutrient_pool.py
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 |
|
allocate_organic_irrigation(irrigation)
Assign organic irrigation, which is assumed to contain dissolved organic nutrients and thus updates that pool.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
irrigation
|
dict
|
A dict that contains the amount of nutrients entering the nutrient pool via irrigation |
required |
Returns:
Name | Type | Description |
---|---|---|
irrigation |
dict
|
irrigation above, because no transformations take place (i.e., dissolved organic is what is received and goes straight into that pool) |
Source code in wsimod/nodes/nutrient_pool.py
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 |
|
allocate_residue(residue)
Assign residue, which is assumed to go to both humus pool and fast pool.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
residue
|
dict
|
A dict that contains the amount of nutrients entering the nutrient pool via residue |
required |
Returns:
Type | Description |
---|---|
dict
|
A dict describing the amount of nutrients that enter the nutrient pool in a dissolved form (and thus need to be tracked by the soil water tank) - i.e., none because fast and humus pool are both solid |
Source code in wsimod/nodes/nutrient_pool.py
292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 |
|
allocate_wet_deposition(deposition)
Assign wet deposition, which is assumed to contain dissolved inorganic nutrients and thus updates that pool.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deposition
|
dict
|
A dict that contains the amount of nutrients entering the nutrient pool via wet deposition |
required |
Returns:
Name | Type | Description |
---|---|---|
deposition |
dict
|
deposition above, because no transformations take place (i.e., dissolved inorganic is what is received and goes straight into that pool) |
Source code in wsimod/nodes/nutrient_pool.py
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 |
|
apply_overrides(overrides=Dict[str, Any])
Override parameters.
Enables a user to override any of the following parameters: eto_to_e, pore_depth.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
overrides
|
Dict[str, Any]
|
Dict describing which parameters should be overridden (keys) and new values (values). Defaults to {}. |
Dict[str, Any]
|
Source code in wsimod/nodes/nutrient_pool.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 |
|
calculate_fraction_parameters()
Update fractions of nutrients input transformed into other forms in soil based on the input parameters Returns: (dict): fraction of manure to fast pool (dict): fraction of plant residue to humus pool (float): fraction of dry nitrogen deposition to fast pool
Source code in wsimod/nodes/nutrient_pool.py
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
|
erode_P(amount_P)
Update humus and adsorbed inorganic pools to erode some amount. Removed in proportion to amount in both pools.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
amount_P
|
float
|
Amount of phosphorus to be eroded |
required |
Returns:
Type | Description |
---|---|
float): Amount of phosphorus eroded from the humus pool (float
|
Amount of |
phosphorus eroded from the adsorbed inorganic pool |
Source code in wsimod/nodes/nutrient_pool.py
367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 |
|
extract(nutrients)
Remove nutrients from a store.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nutrients
|
dict
|
Dict of nutrients to remove from store |
required |
Returns:
Type | Description |
---|---|
dict
|
amount of nutrients successfully removed |
Source code in wsimod/nodes/nutrient_pool.py
542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 |
|
extract_dissolved(proportion)
Function to extract some amount of nutrients from all dissolved pools.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
proportion
|
float
|
proportion of the dissolved nutrient pools to extract |
required |
Returns:
Type | Description |
---|---|
dict
|
A dict of dicts, where the top level distinguishes between organic and inorganic nutrients, and the bottom level describes how much nutrients (i.e., N and P) have been extracted from those pools |
Source code in wsimod/nodes/nutrient_pool.py
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 |
|
get_empty_nutrient()
An efficient way to get an empty nutrient.
Returns:
Type | Description |
---|---|
dict
|
A dict containing 0 for each nutrient |
Source code in wsimod/nodes/nutrient_pool.py
483 484 485 486 487 488 489 |
|
get_erodable_P()
Return total phosphorus that can be eroded (i.e., humus and adsorbed inorganic pools).
Returns:
Type | Description |
---|---|
float
|
total phosphorus |
Source code in wsimod/nodes/nutrient_pool.py
358 359 360 361 362 363 364 365 |
|
init_empty()
Initialise an empty nutrient to be copied.
Source code in wsimod/nodes/nutrient_pool.py
183 184 185 |
|
init_store()
Initialise an empty store to track nutrients.
Source code in wsimod/nodes/nutrient_pool.py
187 188 189 190 |
|
multiply_nutrients(nutrient, factor)
Multiply nutrients by factors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nutrient
|
dict
|
Dict of nutrients to multiply factor (dict): Dict of |
required |
Returns:
Type | Description |
---|---|
dict
|
Multiplied nutrients |
Source code in wsimod/nodes/nutrient_pool.py
491 492 493 494 495 496 497 498 499 500 501 |
|
receive(nutrients)
Update nutrient store by amounts.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nutrients
|
dict
|
Amount of nutrients to update store by |
required |
Source code in wsimod/nodes/nutrient_pool.py
503 504 505 506 507 508 509 510 511 |
|
soil_pool_transformation()
Function to be called by a GrowingSurface that performs and tracks changes resulting from soil transformation processes.
Returns:
Type | Description |
---|---|
float
|
increase in dissolved inorganic nutrients resulting from transformations (negative value indicates a decrease) |
float
|
increase in dissolved organic nutrients resulting from transformations (negative value indicates a decrease) |
Source code in wsimod/nodes/nutrient_pool.py
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 |
|
subtract_nutrients(n1, n2)
Subtract two nutrients.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n1
|
dict
|
Dict of nutrients to subtract from n2 (dict): Dict of nutrients |
required |
Returns:
Type | Description |
---|---|
dict
|
subtracted nutrients |
Source code in wsimod/nodes/nutrient_pool.py
527 528 529 530 531 532 533 534 535 536 537 538 539 540 |
|
sum_nutrients(n1, n2)
Sum two nutrients.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n1
|
dict
|
Dict of nutrients n2 (dict): Dict of nutrients |
required |
Returns:
Type | Description |
---|---|
dict
|
Summed nutrients |
Source code in wsimod/nodes/nutrient_pool.py
513 514 515 516 517 518 519 520 521 522 523 524 525 |
|
temp_soil_process(parameter, extract_pool, receive_pool)
Temperature function to take a parameter, calculate transformation, and remove nutrients from the extract pool and update the receive pool.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parameter
|
dict
|
A dict containing a parameter for each nutrient for the |
required |
extract_pool
|
NutrientStore
|
The pool to extract from receive_pool |
required |
(NutrientStore)
|
The pool to receive extracted nutrients |
required |
Returns:
Name | Type | Description |
---|---|---|
to_extract |
dict
|
A dict containing the amount extracted of each nutrient |
(for mass balance) |
Source code in wsimod/nodes/nutrient_pool.py
452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 |
|
NutrientStore
Bases: NutrientPool
Source code in wsimod/nodes/nutrient_pool.py
559 560 561 562 563 564 |
|
__init__()
Nutrient store, to be instantiated by a NutrientPool.
Source code in wsimod/nodes/nutrient_pool.py
562 563 564 |
|