# rothamsted-models/rothc_code architecture

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

- Interactive diagram: https://gitdiagram.com/rothamsted-models/rothc_code
- Repository: https://github.com/rothamsted-models/rothc_code

## Overview

RothC is a Fortran model for monthly turnover of organic carbon in non-waterlogged topsoil, including temperature, moisture and plant-cover effects, carbon pools and radiocarbon. The documented standalone workflow is: Shell.for reads RothC_input.dat, calls the RothC subroutine, and creates monthly and yearly result files. RothC.for can also be called by another program. Source excerpts were not provided, so the relationships shown are limited to those documented in the README.

Main entry points: [`Shell.for`](https://github.com/rothamsted-models/rothc_code/blob/main/Shell.for) (Example driver), [`RothC_input.dat`](https://github.com/rothamsted-models/rothc_code/blob/main/RothC_input.dat) (Climate and carbon data), [`RothC.for`](https://github.com/rothamsted-models/rothc_code/blob/main/RothC.for) (Carbon turnover model), [`month_results.out`](https://github.com/rothamsted-models/rothc_code/blob/main/month_results.out) (Monthly results)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Model inputs"]
  node_input["Climate and carbon data<br/>[RothC_input.dat]"]
end

subgraph group_runtime["Model runtime"]
  node_shell["Example driver<br/>[Shell.for]"]
  node_rothc["Carbon turnover model<br/>[RothC.for]"]
end

subgraph group_results["Model results"]
  node_monthly["Monthly results<br/>[month_results.out]"]
  node_yearly["Yearly results<br/>[year_results.out]"]
end

node_user(("Model user"))

node_user -->|"provides inputs"| node_input
node_shell -->|"reads"| node_input
node_shell -->|"calls"| node_rothc
node_shell -->|"creates"| node_monthly
node_shell -->|"creates"| node_yearly

click node_input "https://github.com/rothamsted-models/rothc_code/blob/main/RothC_input.dat"
click node_shell "https://github.com/rothamsted-models/rothc_code/blob/main/Shell.for"
click node_rothc "https://github.com/rothamsted-models/rothc_code/blob/main/RothC.for"
click node_monthly "https://github.com/rothamsted-models/rothc_code/blob/main/month_results.out"
click node_yearly "https://github.com/rothamsted-models/rothc_code/blob/main/year_results.out"

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_input,node_user toneBlue
class node_shell,node_rothc toneAmber
class node_monthly,node_yearly toneMint
```

## Components

### Model inputs

- [Climate and carbon data](https://github.com/rothamsted-models/rothc_code/blob/main/RothC_input.dat): `RothC_input.dat`

### Model runtime

- [Example driver](https://github.com/rothamsted-models/rothc_code/blob/main/Shell.for): `Shell.for`
- [Carbon turnover model](https://github.com/rothamsted-models/rothc_code/blob/main/RothC.for): `RothC.for`

### Model results

- [Monthly results](https://github.com/rothamsted-models/rothc_code/blob/main/month_results.out): `month_results.out`
- [Yearly results](https://github.com/rothamsted-models/rothc_code/blob/main/year_results.out): `year_results.out`

### Other components

- **Model user**

## Connections

- Model user → Climate and carbon data: provides inputs (evidence: `README.md`)
- Example driver → Climate and carbon data: reads (evidence: `README.md`)
- Example driver → Carbon turnover model: calls (evidence: `README.md`)
- Example driver → Monthly results: creates (evidence: `README.md`)
- Example driver → Yearly results: creates (evidence: `README.md`)
