
Read gridded soil hydraulic properties from HWSD onto WHEP's grid.
Source:R/soil_ph.R
read_soil_hydraulic.RdReads the HWSD (Harmonized World Soil Database) soil map unit attribute
table and raster, resolves each map unit's dominant USDA texture class,
looks up that class's volumetric field capacity, wilting point and porosity
from soil_hydraulic_by_texture (via the hwsd_texture_usda code
crosswalk), and aggregates each property to WHEP's 0.5-degree grid by
averaging the native HWSD cells inside each 0.5-degree block. These are the
per-cell soil hydraulic drivers the ICBM soil-carbon moisture modifier
consumes. Soil texture is a static HWSD property: the result has no year
column. Cropping to data$cell_polity follows the same regional-crop path
as read_soil_ph(); missing cells are gap-filled from the nearest
available neighbour when a target grid is supplied.
Usage
read_soil_hydraulic(hwsd_dir = NULL, data = list(), example = FALSE)Arguments
- hwsd_dir
Path to the directory holding
hwsd_data.csvandhwsd.bil. Defaults toSys.getenv("WHEP_HWSD_DIR").- data
Optional named list of pre-loaded inputs:
cell_polity(lon,lat, at minimum), used both to crop the HWSD raster and as the gap-filling target grid.- example
If
TRUE, return a small fixture instead of reading data. Defaults toFALSE.