# ufs-community/ufs-srweather-app architecture

> Architecture diagram of the GitHub repository ufs-community/ufs-srweather-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ufs-community/ufs-srweather-app
- Repository: https://github.com/ufs-community/ufs-srweather-app

## Overview

##### Main Components

a) Core System Components:
- Workflow Management System (visible in the /ush and /jobs directories)
- Model Components (indicated by the FV3 references and configuration files)
- Pre/Post Processing Systems (shown in the /scripts directory)
- Testing Framework (evident in /tests directory)
- External Dependencies Management (shown in /manage_externals)

b) Data Flow Components:
- Input Data Processing
- Model Execution
- Output Processing
- Verification Systems

**┌─────────────────────────────────────────────────────┐**
- UFS SRW Application                 │
- ┬──────────┬───────────┬──────────────────┤
- Workflow │  Model   │ Pre/Post  │    Testing &     │
- Manager  │  Core    │ Processing│   Verification   │
- ┴──────────┴───────────┴──────────────────┘

**┌─────────────┐    ┌──────────┐    ┌──────────────┐**
- Input Data ├───►│   Model  ├───►│ Output Data  │
- Processing  │    │  Engine  │    │ Processing   │
- ┘    └──────────┘    └──────────────┘
- ▲                 ▲                 ▲

**┌─────────────────────────────────────────────────┐**
- Workflow Management                 │
- ┘

##### Key Elements to Highlight

a) Configuration Management:
- Relationship between config files (parm/, etc/)
- External dependency management
- Machine-specific configurations

b) Processing Pipeline:
- Grid generation
- Initial/boundary conditions
- Forecast execution
- Post-processing
- Verification

##### Connection Types

Use different line styles to represent:

##### Supporting Information

- Component types
- Connection types
- Version information
- External dependencies

##### The flexibility to run on different computing platforms

This system design should be created using a professional diagramming tool that supports:
- Nested components
- Multiple connection types
- Clear labeling
- Export to high-resolution formats

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph UFS_SRW["UFS Short-Range Weather Application"]
        subgraph WF["Workflow Management"]
            WFM["Workflow Manager"]:::workflow
            WFC["Workflow Config"]:::config
            XML["FV3LAM Workflow XML"]:::config
        end

        subgraph MC["Model Core"]
            ME["Model Engine"]:::model
            MC_Config["Model Configuration"]:::config
            FT["Field Tables"]:::config
            INM["Input Namelist"]:::config
        end

        subgraph PP["Pre/Post Processing"]
            Pre["Input Processing"]:::process
            Post["Post Processing"]:::process
            Prd["Product Generation"]:::process
            MetP["MetPlus Config"]:::config
            NCL["NCL Scripts"]:::process
        end

        subgraph TV["Testing & Verification"]
            WE2E["End-to-End Tests"]:::test
            PyTest["Python Tests"]:::test
            CI["CI/CD Scripts"]:::test
        end

        subgraph EM["External Management"]
            Ext["External Dependencies"]:::external
            ExtCfg["Externals Config"]:::config
            CheckExt["Checkout Scripts"]:::external
        end

        subgraph DP["Data Pipeline"]
            ICS["Initial Conditions"]:::process
            LBCS["Boundary Conditions"]:::process
            FCST["Forecast Execution"]:::process
        end
    end

    %% Relationships
    WFM --> ME
    WFC --> WFM
    XML --> WFM
    MC_Config --> ME
    FT --> ME
    INM --> ME
    
    Pre --> ICS
    ICS --> ME
    LBCS --> ME
    ME --> FCST
    FCST --> Post
    Post --> Prd
    MetP --> Post
    NCL --> Post

    WE2E --> ME
    PyTest --> WFM
    CI --> TV

    Ext --> ME
    ExtCfg --> Ext
    CheckExt --> Ext

    %% Click Events
    click WFM "https://github.com/ufs-community/ufs-srweather-app/blob/develop//ush/generate_FV3LAM_wflow.py"
    click XML "https://github.com/ufs-community/ufs-srweather-app/blob/develop//parm/FV3LAM_wflow.xml"
    click WFC "https://github.com/ufs-community/ufs-srweather-app/tree/develop//parm/wflow"
    click MC_Config "https://github.com/ufs-community/ufs-srweather-app/tree/develop//parm/model_configure"
    click FT "https://github.com/ufs-community/ufs-srweather-app/tree/develop//parm/field_table"
    click INM "https://github.com/ufs-community/ufs-srweather-app/blob/develop//parm/input.nml.FV3"
    click Post "https://github.com/ufs-community/ufs-srweather-app/blob/develop//scripts/exregional_run_post.sh"
    click Prd "https://github.com/ufs-community/ufs-srweather-app/blob/develop//scripts/exregional_run_prdgen.sh"
    click MetP "https://github.com/ufs-community/ufs-srweather-app/tree/develop//parm/metplus"
    click NCL "https://github.com/ufs-community/ufs-srweather-app/tree/develop//ush/NCL"
    click WE2E "https://github.com/ufs-community/ufs-srweather-app/tree/develop//tests/WE2E"
    click PyTest "https://github.com/ufs-community/ufs-srweather-app/tree/develop//tests/test_python"
    click CI "https://github.com/ufs-community/ufs-srweather-app/blob/develop//.cicd/scripts/srw_test.sh"
    click Ext "https://github.com/ufs-community/ufs-srweather-app/tree/develop//manage_externals"
    click ExtCfg "https://github.com/ufs-community/ufs-srweather-app/blob/develop//Externals.cfg"
    click CheckExt "https://github.com/ufs-community/ufs-srweather-app/tree/develop//manage_externals/checkout_externals"
    click ICS "https://github.com/ufs-community/ufs-srweather-app/blob/develop//scripts/exregional_make_ics.sh"
    click LBCS "https://github.com/ufs-community/ufs-srweather-app/blob/develop//scripts/exregional_make_lbcs.sh"
    click FCST "https://github.com/ufs-community/ufs-srweather-app/blob/develop//scripts/exregional_run_fcst.sh"

    %% Styles
    classDef workflow fill:#f96,stroke:#333
    classDef model fill:#69f,stroke:#333
    classDef process fill:#9c6,stroke:#333
    classDef config fill:#ff9,stroke:#333
    classDef test fill:#c9f,stroke:#333
    classDef external fill:#999,stroke:#333

    %% Legend
    subgraph Legend
        L1["Workflow Component"]:::workflow
        L2["Model Component"]:::model
        L3["Processing Component"]:::process
        L4["Configuration"]:::config
        L5["Testing Component"]:::test
        L6["External Component"]:::external
    end
```
