How swap-model/swap works
SWAP is a field-scale soil–water–atmosphere–plant simulator. Its principal workflow is to load and validate simulation configuration and meteorological inputs, run the configured time-stepped model, and write CSV results. The graph preserves the documented water, heat, solute, crop, and drainage domains. Source excerpts were unavailable, so links among runtime modules are limited to the documented configuration pipeline and high-level model workflow; detailed call ownership is not verified.
Main entry points: swap_main.f90 Simulation entry · load_swap_config.f90 Load configuration · validation.f90 Validate settings · readmeteo.f90 Meteorology input
Components 18
Configuration and inputs
- Load configuration
src/io/toml/load_swap_config.f90 - Validate settings
src/validation/validation.f90 - Configure variables
src/io/toml/config_to_variables.f90 - Meteorology input
src/io/readmeteo.f90
Simulation engine
- Simulation entry
src/core/swap_main.f90 - Time control
src/core/timecontrol.f90 - Model state
src/core/variables.f90
Environmental processes
- Atmospheric processes
src/atmosphere - Soil water flow
src/soil - Heat transport
src/heat - Solute transport
src/solute - Crop growth
src/crop - Drainage and runoff
src/drainage - Soil boundaries
src/boundary
Results and diagnostics
- CSV results
src/io/swap_csv_output.f90 - Error collection
src/error/error.f90
Other components
- Model user
- TOML configuration
Connections 17
- Model user → TOML configuration: provides
- TOML configuration → Load configuration: loads
- Load configuration → Validate settings: validates
- Validate settings → Configure variables: finalizes
- Model user → Simulation entry: starts simulation
- Simulation entry → Time control: advances steps
- Meteorology input → Simulation entry: supplies weather
- Simulation entry → Model state: updates state
- Simulation entry → Atmospheric processes: simulates
- Simulation entry → Soil water flow: simulates
- Simulation entry → Heat transport: simulates
- Simulation entry → Solute transport: simulates
- Simulation entry → Crop growth: simulates
- Simulation entry → Drainage and runoff: simulates
- Simulation entry → Soil boundaries: applies boundaries
- Simulation entry → CSV results: writes results
- Simulation entry → Error collection: collects errors