# shimogarakesh/srividhya architecture

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

- Interactive diagram: https://gitdiagram.com/shimogarakesh/srividhya
- Repository: https://github.com/shimogarakesh/srividhya

## Overview

SRIvidhya is an R decision-support and MRV package for site-adaptive alternate wetting and drying in rice. Its user-facing workflow is to define a locally parameterized stratum and generate a stratum- and crop-specific water-level calendar. The documented decision stages cover root-safe drainage depth, time to target, drainage frequency, and verification, with parameter provenance and evidence tiers kept visible. The README documents these capabilities and the example workflow; source excerpts were not provided, so internal call relationships beyond that documented workflow are omitted.

Main entry points: [`R/strata.R`](https://github.com/shimogarakesh/srividhya/blob/main/R/strata.R) (Stratum Definition), [`R/calendar.R`](https://github.com/shimogarakesh/srividhya/blob/main/R/calendar.R) (Water-Level Calendar), [`R/roots.R`](https://github.com/shimogarakesh/srividhya/blob/main/R/roots.R) (Root Development), [`R/drainage_ceiling.R`](https://github.com/shimogarakesh/srividhya/blob/main/R/drainage_ceiling.R) (Safe Drainage Ceiling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Stratum Inputs"]
  node_stratum["Stratum Definition<br/>[strata.R]"]
  node_validation["Input Validation<br/>[validation.R]"]
end

subgraph group_decisions["AWD Decisions"]
  node_roots["Root Development<br/>[roots.R]"]
  node_ceiling["Safe Drainage Ceiling<br/>[drainage_ceiling.R]"]
  node_percolation["Time to Target<br/>[percolation.R]"]
  node_soc["SOC Frequency<br/>[soc_frequency.R]"]
end

subgraph group_calendar["Calendar Output"]
  node_calendar["Water-Level Calendar<br/>[calendar.R]"]
end

subgraph group_mrv["MRV Support"]
  node_verify["Drainage Verification<br/>[verification.R]"]
  node_instructions["Farmer Instructions"]
end

node_user(("Agronomist"))

node_user -->|"defines"| node_stratum
node_user -->|"generates"| node_calendar
node_stratum -->|"provides inputs"| node_calendar
node_roots -->|"informs depth"| node_ceiling

click node_stratum "https://github.com/shimogarakesh/srividhya/blob/main/R/strata.R"
click node_validation "https://github.com/shimogarakesh/srividhya/blob/main/R/validation.R"
click node_roots "https://github.com/shimogarakesh/srividhya/blob/main/R/roots.R"
click node_ceiling "https://github.com/shimogarakesh/srividhya/blob/main/R/drainage_ceiling.R"
click node_percolation "https://github.com/shimogarakesh/srividhya/blob/main/R/percolation.R"
click node_soc "https://github.com/shimogarakesh/srividhya/blob/main/R/soc_frequency.R"
click node_verify "https://github.com/shimogarakesh/srividhya/blob/main/R/verification.R"
click node_instructions "https://github.com/shimogarakesh/srividhya/blob/main/R/farmer_instruction.R"
click node_calendar "https://github.com/shimogarakesh/srividhya/blob/main/R/calendar.R"

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_stratum,node_validation toneBlue
class node_roots,node_ceiling,node_percolation,node_soc toneAmber
class node_calendar toneMint
class node_verify,node_instructions toneRose
class node_user toneIndigo
```

## Components

### Stratum Inputs

- [Stratum Definition](https://github.com/shimogarakesh/srividhya/blob/main/R/strata.R): `R/strata.R`
- [Input Validation](https://github.com/shimogarakesh/srividhya/blob/main/R/validation.R): `R/validation.R`

### AWD Decisions

- [Root Development](https://github.com/shimogarakesh/srividhya/blob/main/R/roots.R): `R/roots.R`
- [Safe Drainage Ceiling](https://github.com/shimogarakesh/srividhya/blob/main/R/drainage_ceiling.R): `R/drainage_ceiling.R`
- [Time to Target](https://github.com/shimogarakesh/srividhya/blob/main/R/percolation.R): `R/percolation.R`
- [SOC Frequency](https://github.com/shimogarakesh/srividhya/blob/main/R/soc_frequency.R): `R/soc_frequency.R`

### Calendar Output

- [Water-Level Calendar](https://github.com/shimogarakesh/srividhya/blob/main/R/calendar.R): `R/calendar.R`

### MRV Support

- [Drainage Verification](https://github.com/shimogarakesh/srividhya/blob/main/R/verification.R): `R/verification.R`
- [Farmer Instructions](https://github.com/shimogarakesh/srividhya/blob/main/R/farmer_instruction.R): `R/farmer_instruction.R`

### Other components

- **Agronomist**

## Connections

- Agronomist → Stratum Definition: defines (evidence: `README.md`)
- Agronomist → Water-Level Calendar: generates (evidence: `README.md`)
- Stratum Definition → Water-Level Calendar: provides inputs (evidence: `README.md`)
- Root Development → Safe Drainage Ceiling: informs depth (evidence: `README.md`)
