# reedmaxwell/ecoslim architecture

> Architecture diagram of the GitHub repository reedmaxwell/ecoslim, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/reedmaxwell/ecoslim
- Repository: https://github.com/reedmaxwell/ecoslim

## Overview

EcoSLIM is a Fortran Lagrangian particle-tracking application used with ParFlow-CLM to simulate water-parcel movement and diagnose age, travel times, source-water composition, and flowpaths. The documented workflow is: a user supplies slimin.txt and ParFlow output files, runs EcoSLIM, and obtains particle-tracking results. The graph separates core tracking from optional inputs and analyses. Source excerpts were not provided, so internal calls among Fortran modules cannot be verified; documented relationships cite the README, and helper-module roles are inferred only from filenames.

Main entry points: [`EcoSLIM.f90`](https://github.com/reedmaxwell/ecoslim/blob/master/EcoSLIM.f90) (Particle tracking), [`vtk_write.f90`](https://github.com/reedmaxwell/ecoslim/blob/master/vtk_write.f90) (VTK output), [`Examples/Hillslope_Simulations/paper_cases/SLIM_ER_hillslope_20y_shrub/slimin.txt`](https://github.com/reedmaxwell/ecoslim/blob/master/Examples/Hillslope_Simulations/paper_cases/SLIM_ER_hillslope_20y_shrub/slimin.txt) (Run settings), [`pfb_read.f90`](https://github.com/reedmaxwell/ecoslim/blob/master/pfb_read.f90) (PFB reading)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_run["Simulation"]
  node_ecoslim["Particle tracking<br/>[EcoSLIM.f90]"]
  node_random["Random sampling<br/>[ran1.f90]"]
  node_rng["Random generators<br/>[rng.f90]"]
  node_et["ET particle exchange<br/>[EcoSLIM.f90]"]
end

subgraph group_inputs["Inputs"]
  node_driver["Run settings<br/>[slimin.txt]"]
  node_parflow[("ParFlow outputs")]
  node_pfb["PFB reading<br/>[pfb_read.f90]"]
end

subgraph group_analysis["Analysis"]
  node_clm["Rain-snow distinction<br/>[EcoSLIM.f90]"]
  node_indicators["Indicator summaries<br/>[EcoSLIM.f90]"]
end

subgraph group_output["Outputs"]
  node_vtk["VTK output<br/>[vtk_write.f90]"]
  node_vtkpoints["VTK points"]
  node_results["Simulation results"]
end

node_user(("Model user"))

node_user -->|"runs"| node_ecoslim
node_driver -->|"configures"| node_ecoslim
node_parflow -->|"provides fields"| node_ecoslim
node_parflow -->|"stored as PFB"| node_pfb
node_ecoslim -->|"handles ET"| node_et
node_ecoslim -->|"distinguishes inputs"| node_clm
node_ecoslim -->|"summarizes by unit"| node_indicators
node_ecoslim -.->|"writes VTK"| node_vtk
node_ecoslim -->|"produces"| node_results
node_vtk -.->|"uses"| node_vtkpoints

click node_driver "https://github.com/reedmaxwell/ecoslim/blob/master/Examples/Hillslope_Simulations/paper_cases/SLIM_ER_hillslope_20y_shrub/slimin.txt"
click node_ecoslim "https://github.com/reedmaxwell/ecoslim/blob/master/EcoSLIM.f90"
click node_pfb "https://github.com/reedmaxwell/ecoslim/blob/master/pfb_read.f90"
click node_random "https://github.com/reedmaxwell/ecoslim/blob/master/ran1.f90"
click node_rng "https://github.com/reedmaxwell/ecoslim/blob/master/rng.f90"
click node_et "https://github.com/reedmaxwell/ecoslim/blob/master/EcoSLIM.f90"
click node_clm "https://github.com/reedmaxwell/ecoslim/blob/master/EcoSLIM.f90"
click node_indicators "https://github.com/reedmaxwell/ecoslim/blob/master/EcoSLIM.f90"
click node_vtk "https://github.com/reedmaxwell/ecoslim/blob/master/vtk_write.f90"
click node_vtkpoints "https://github.com/reedmaxwell/ecoslim/blob/master/vtk_write_points.f90"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ecoslim,node_random,node_rng,node_et,node_user toneBlue
class node_driver,node_parflow,node_pfb toneAmber
class node_clm,node_indicators toneMint
class node_vtk,node_vtkpoints,node_results toneRose
```

## Components

### Simulation

- [Particle tracking](https://github.com/reedmaxwell/ecoslim/blob/master/EcoSLIM.f90): `EcoSLIM.f90`
- [Random sampling](https://github.com/reedmaxwell/ecoslim/blob/master/ran1.f90): `ran1.f90`
- [Random generators](https://github.com/reedmaxwell/ecoslim/blob/master/rng.f90): `rng.f90`
- [ET particle exchange](https://github.com/reedmaxwell/ecoslim/blob/master/EcoSLIM.f90): `EcoSLIM.f90`

### Inputs

- [Run settings](https://github.com/reedmaxwell/ecoslim/blob/master/Examples/Hillslope_Simulations/paper_cases/SLIM_ER_hillslope_20y_shrub/slimin.txt): `Examples/Hillslope_Simulations/paper_cases/SLIM_ER_hillslope_20y_shrub/slimin.txt`
- **ParFlow outputs**
- [PFB reading](https://github.com/reedmaxwell/ecoslim/blob/master/pfb_read.f90): `pfb_read.f90`

### Analysis

- [Rain-snow distinction](https://github.com/reedmaxwell/ecoslim/blob/master/EcoSLIM.f90): `EcoSLIM.f90`
- [Indicator summaries](https://github.com/reedmaxwell/ecoslim/blob/master/EcoSLIM.f90): `EcoSLIM.f90`

### Outputs

- [VTK output](https://github.com/reedmaxwell/ecoslim/blob/master/vtk_write.f90): `vtk_write.f90`
- [VTK points](https://github.com/reedmaxwell/ecoslim/blob/master/vtk_write_points.f90): `vtk_write_points.f90`
- **Simulation results**

### Other components

- **Model user**

## Connections

- Model user → Particle tracking: runs (evidence: `README.md`)
- Run settings → Particle tracking: configures (evidence: `README.md`)
- ParFlow outputs → Particle tracking: provides fields (evidence: `README.md`)
- ParFlow outputs → PFB reading: stored as PFB (evidence: `README.md`)
- Particle tracking → ET particle exchange: handles ET (evidence: `README.md`)
- Particle tracking → Rain-snow distinction: distinguishes inputs (evidence: `README.md`)
- Particle tracking → Indicator summaries: summarizes by unit (evidence: `README.md`)
- Particle tracking → VTK output: writes VTK (evidence: `README.md`)
- Particle tracking → Simulation results: produces (evidence: `README.md`)
- VTK output → VTK points: uses
