Source/Sink & External Fluxes ========================================== ``Source/Sink`` loads and ``External Fluxes`` are optional entries defined in the :doc:`Master configuration <4_1_1Master>` under ``OPENWQ_INPUT``. They use a similar data structure. The differences are highlighted in each section below. Each sink/source or external flux is defined in an individual JSON file, and you can add as many files as desired. There are five ways to provide source/sink data: 1. **JSON** -- inline time series in the JSON file 2. **CSV/ASCII** -- time series in an external CSV file 3. **Copernicus LULC (static coefficients)** -- land-use-based loading using Copernicus satellite data and static export coefficients 4. **Copernicus LULC (dynamic coefficients)** -- extends Method 3 with precipitation and temperature scaling (SWAT-inspired) 5. **ML Model** -- XGBoost or Random Forest trained on monitoring data (EPA XGBest-inspired) Common Structure ~~~~~~~~~~~~~~~~ All source/sink and external flux JSON files share the following top-level structure. **Key 1**: ``METADATA`` +---------------+--------------------------------------------------+ | ``COMMENT`` | Comments or relevant information about the data | +---------------+--------------------------------------------------+ | ``SOURCE`` | Additional information or additional comments | +---------------+--------------------------------------------------+ **Key 2**: ``(i#)`` (numbered entries in sequential order) Each numbered entry defines one loading or flux: +--------------------------------------+-------------------------------------------------------------------------------------------------------------------------+ | ``DATA_FORMAT`` | Data format: ``"JSON"``, ``"ASCII"``, or ``"HDF5"`` (EWF only) | +--------------------------------------+-------------------------------------------------------------------------------------------------------------------------+ | ``UNITS`` | Units of input, e.g., ``"mg/l"``, ``"kg"`` | +--------------------------------------+-------------------------------------------------------------------------------------------------------------------------+ | ``CHEMICAL_NAME`` | Chemical species name (as defined in :doc:`Modules <4_1_3Modules>` biogeochemistry config) | +--------------------------------------+-------------------------------------------------------------------------------------------------------------------------+ | ``COMPARTMENT_NAME`` | Compartment name (*Sink/Source only*) | +--------------------------------------+-------------------------------------------------------------------------------------------------------------------------+ | ``EXTERNAL_INPUTFLUX_NAME`` | External water source name (*External Fluxes only*) | +--------------------------------------+-------------------------------------------------------------------------------------------------------------------------+ | ``TYPE`` | ``"source"`` or ``"sink"`` (*Sink/Source only*) | +--------------------------------------+-------------------------------------------------------------------------------------------------------------------------+ Method 1: JSON (inline data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Set ``DATA_FORMAT`` to ``"JSON"``. The ``DATA`` block contains the time series directly in the JSON file. Each entry is a numbered row with the format: ``"(i#)"``: ``[YYYY, MM, DD, HH, MIN, SEC, ix, iy, iz, load, load_type, time_units]`` +---------------------+-------------------------------------------------------------------------+ | ```` | Input year: ``(i#)`` or ``"all"`` | +---------------------+-------------------------------------------------------------------------+ | ```` | Input month: ``(i#)`` or ``"all"`` | +---------------------+-------------------------------------------------------------------------+ | ``
`` | Input day: ``(i#)`` or ``"all"`` | +---------------------+-------------------------------------------------------------------------+ | ```` | Input hour: ``(i#)`` or ``"all"`` | +---------------------+-------------------------------------------------------------------------+ | ```` | Input minute: ``(i#)`` or ``"all"`` | +---------------------+-------------------------------------------------------------------------+ | ```` | Input second: ``(i#)`` or ``"all"`` | +---------------------+-------------------------------------------------------------------------+ | ```` | Spatial ix index: ``(i#)``, ``"all"``, or ``"cell_id"`` (see below) | +---------------------+-------------------------------------------------------------------------+ | ```` | Spatial iy index: ``(i#)`` or ``"all"`` | +---------------------+-------------------------------------------------------------------------+ | ```` | Spatial iz index: ``(i#)`` or ``"all"`` | +---------------------+-------------------------------------------------------------------------+ | ```` | Load value (float) | +---------------------+-------------------------------------------------------------------------+ | ```` | ``"discrete"`` or ``"continuous"`` (*Sink/Source only*) | +---------------------+-------------------------------------------------------------------------+ | ``