# uaf-arctic-eco-modeling/dvm-dos-tem architecture

> Architecture diagram of the GitHub repository uaf-arctic-eco-modeling/dvm-dos-tem, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/uaf-arctic-eco-modeling/dvm-dos-tem
- Repository: https://github.com/uaf-arctic-eco-modeling/dvm-dos-tem

## Overview

##### Project Type and Main Components
The project is a process-based bio-geo-chemical ecosystem model focusing on:
- Carbon and Nitrogen dynamics
- Soil thermal dynamics
- High latitude ecosystems simulation

##### Key Architectural Components

a) Core Model Components (from /include and /src directories):
- Vegetation System (Vegetation.h, Vegetation_Bgc.h, Vegetation_Env.h)
- Soil System (Soil_Bgc.h, Soil_Env.h, SoilLayer.h)
- Climate System (Climate.h)
- Fire System (WildFire.h, FireData.h)

b) Data Management:
- Input/Output Handlers
- Data Structures (BgcData, EnvData, ModelData)
- Calibration System (CalController)

c) Numerical Components:
- Integration Systems (Integrator, CrankNicholson)
- Temperature Processing (TemperatureUpdator)
- Richards Equation Solver

##### System Interaction Layers

**[Climate Inputs] → [Model Core] → [Output Processing]**
- ↑               ↑ ↓              ↓
**[Input Data] → [Configuration] → [Calibration]**

##### Implementation Details

- Clear component boundaries
- Proper layering
- Explicit data flow paths
- Version information
- System requirements

##### Special Notes

- Modular nature of the system
- Integration points with external tools
- Calibration workflow
- Configuration points

Remember to include a reference to the documentation system and note that the model can be run both standalone and in a Docker container, which should be reflected in the deployment view of the architecture.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Legend
        L_Input[Input Components]:::input
        L_Process[Processing Components]:::process
        L_Output[Output Components]:::output
        L_Climate[Climate Components]:::climate
        L_Veg[Vegetation Components]:::vegetation
        L_Soil[Soil Components]:::soil
        L_Fire[Fire Components]:::fire
        L_Cal[Calibration Components]:::calibration
    end

    subgraph InputLayer
        Climate[Climate System]:::climate
        Parameters[Parameter Files]:::input
        InputHandler[Input Handler]:::input
    end

    subgraph CoreModel
        direction TB
        subgraph VegetationSystem
            VegMain[Vegetation Core]:::vegetation
            VegBgc[Vegetation Biochemistry]:::vegetation
            VegEnv[Vegetation Environment]:::vegetation
        end

        subgraph SoilSystem
            SoilMain[Soil Core]:::soil
            SoilBgc[Soil Biochemistry]:::soil
            SoilEnv[Soil Environment]:::soil
            SoilLayer[Soil Layering]:::soil
        end

        subgraph FireSystem
            FireMain[Wild Fire]:::fire
            FireData[Fire Data]:::fire
        end

        subgraph NumericalSystem
            Integrator[Integrator]:::process
            CrankNicholson[Crank Nicholson]:::process
            TempUpdator[Temperature Updator]:::process
            Richards[Richards Equation]:::process
        end
    end

    subgraph DataManagement
        ModelData[Model Data]:::process
        BgcData[BGC Data]:::process
        EnvData[Environment Data]:::process
    end

    subgraph OutputSystem
        OutputHandler[Output Handler]:::output
        OutputHolder[Output Holder]:::output
    end

    subgraph CalibrationSystem
        CalController[Calibration Controller]:::calibration
        CalTargets[Calibration Targets]:::calibration
    end

    Runner[Model Runner]:::process

    %% Connections
    Climate --> InputHandler
    Parameters --> InputHandler
    InputHandler --> Runner

    Runner --> VegetationSystem
    Runner --> SoilSystem
    Runner --> FireSystem
    Runner --> NumericalSystem

    VegetationSystem <--> DataManagement
    SoilSystem <--> DataManagement
    FireSystem <--> DataManagement
    NumericalSystem <--> DataManagement

    DataManagement --> OutputSystem
    OutputSystem --> CalibrationSystem
    CalibrationSystem --> Runner

    %% Click Events
    click Climate "https://github.com/uaf-arctic-eco-modeling/dvm-dos-tem/blob/master/include/Climate.h"
    click VegMain "https://github.com/uaf-arctic-eco-modeling/dvm-dos-tem/blob/master/include/Vegetation.h"
    click VegBgc "https://github.com/uaf-arctic-eco-modeling/dvm-dos-tem/blob/master/include/Vegetation_Bgc.h"
    click VegEnv "https://github.com/uaf-arctic-eco-modeling/dvm-dos-tem/blob/master/include/Vegetation_Env.h"
    click SoilMain "https://github.com/uaf-arctic-eco-modeling/dvm-dos-tem/blob/master/include/Soil_Bgc.h"
    click SoilEnv "https://github.com/uaf-arctic-eco-modeling/dvm-dos-tem/blob/master/include/Soil_Env.h"
    click SoilLayer "https://github.com/uaf-arctic-eco-modeling/dvm-dos-tem/blob/master/include/SoilLayer.h"
    click FireMain "https://github.com/uaf-arctic-eco-modeling/dvm-dos-tem/blob/master/include/WildFire.h"
    click FireData "https://github.com/uaf-arctic-eco-modeling/dvm-dos-tem/blob/master/include/FireData.h"
    click ModelData "https://github.com/uaf-arctic-eco-modeling/dvm-dos-tem/blob/master/include/ModelData.h"
    click BgcData "https://github.com/uaf-arctic-eco-modeling/dvm-dos-tem/blob/master/include/BgcData.h"
    click EnvData "https://github.com/uaf-arctic-eco-modeling/dvm-dos-tem/blob/master/include/EnvData.h"
    click CalController "https://github.com/uaf-arctic-eco-modeling/dvm-dos-tem/blob/master/include/CalController.h"
    click Integrator "https://github.com/uaf-arctic-eco-modeling/dvm-dos-tem/blob/master/include/Integrator.h"
    click CrankNicholson "https://github.com/uaf-arctic-eco-modeling/dvm-dos-tem/blob/master/include/CrankNicholson.h"
    click TempUpdator "https://github.com/uaf-arctic-eco-modeling/dvm-dos-tem/blob/master/include/TemperatureUpdator.h"
    click Richards "https://github.com/uaf-arctic-eco-modeling/dvm-dos-tem/blob/master/include/Richards.h"
    click InputHandler "https://github.com/uaf-arctic-eco-modeling/dvm-dos-tem/blob/master/scripts/util/input.py"
    click OutputHandler "https://github.com/uaf-arctic-eco-modeling/dvm-dos-tem/blob/master/scripts/util/output.py"
    click OutputHolder "https://github.com/uaf-arctic-eco-modeling/dvm-dos-tem/blob/master/include/OutputHolder.h"
    click Parameters "https://github.com/uaf-arctic-eco-modeling/dvm-dos-tem/tree/master/parameters"
    click Runner "https://github.com/uaf-arctic-eco-modeling/dvm-dos-tem/blob/master/include/Runner.h"
    click CalibrationSystem "https://github.com/uaf-arctic-eco-modeling/dvm-dos-tem/tree/master/calibration"

    %% Styles
    classDef input fill:#ADD8E6
    classDef process fill:#D3D3D3
    classDef output fill:#90EE90
    classDef climate fill:#9370DB
    classDef vegetation fill:#228B22
    classDef soil fill:#8B4513
    classDef fire fill:#FF4500
    classDef calibration fill:#FFA500
```
