# georgu/shyfemcm-ismar architecture

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

- Interactive diagram: https://gitdiagram.com/georgu/shyfemcm-ismar
- Repository: https://github.com/georgu/shyfemcm-ismar

## Overview

SHYFEM is a finite-element community model for 2D/3D hydrodynamics in complex coastal and inland waters, with documented mass-conserving treatment of drying flats. The supplied tree is a partial source snapshot: it exposes grid and mesh tools, plotting backends, ecological components, and GOTM configuration, but not the current model’s runtime or simulation driver. The visible workflow is grid editing or cleanup, with mesh cleanup writing a standard grid file; plotting and model integrations are separate branches. Edges are limited to relationships shown in excerpts or the source index.

Main entry points: [`src/tools/mesh/exgrd.c`](https://github.com/georgu/shyfemcm-ismar/blob/main/src/tools/mesh/exgrd.c) (Mesh cleanup), [`src/tools/grid/gridma1.c`](https://github.com/georgu/shyfemcm-ismar/blob/main/src/tools/grid/gridma1.c) (Grid editor), [`src/external/gotm/cppdefs.h`](https://github.com/georgu/shyfemcm-ismar/blob/main/src/external/gotm/cppdefs.h) (GOTM configuration), [`src/tools/grid`](https://github.com/georgu/shyfemcm-ismar/tree/main/src/tools/grid) (Grid framework)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_grid["Grid and mesh tools"]
  node_grid_editor["Grid editor<br/>[gridma1.c]"]
  node_grid_support["Grid framework"]
  node_grid_graphics["Grid graphics<br/>[graph.c]"]
  node_mesh_cleanup["Mesh cleanup<br/>[exgrd.c]"]
  node_mesh_framework["Mesh framework"]
end

subgraph group_plots["Plotting"]
  node_postscript["PostScript plotting<br/>[psgraph.c]"]
  node_hcbs_plotting["HCBS plotting<br/>[xgraph.c]"]
  node_color_tables["Ocean color tables"]
  node_seawifs_colors["SeaWiFS colors<br/>[colortb.c]"]
end

subgraph group_model["Model components"]
  node_aquabc["AquaBC component<br/>[aquabc_II_aout.h]"]
  node_weutro["WEUTRO component<br/>[weutro.h]"]
  node_obsolete_bfm["Obsolete BFM"]
  node_gotm_config["GOTM configuration<br/>[cppdefs.h]"]
  node_gotm_release["GOTM version<br/>[version.h]"]
end

subgraph group_formats["File utilities"]
  node_unformatted_io["Unformatted I/O<br/>[unformatted.c]"]
  node_mesh_file["Standard grid file"]
end

node_grid_editor -->|"uses declarations"| node_grid_support
node_mesh_cleanup -->|"uses mesh APIs"| node_mesh_framework
node_mesh_cleanup -->|"writes grid"| node_mesh_file
node_gotm_config -->|"includes version"| node_gotm_release

click node_grid_editor "https://github.com/georgu/shyfemcm-ismar/blob/main/src/tools/grid/gridma1.c"
click node_grid_support "https://github.com/georgu/shyfemcm-ismar/tree/main/src/tools/grid"
click node_grid_graphics "https://github.com/georgu/shyfemcm-ismar/blob/main/src/tools/grid/graph.c"
click node_mesh_cleanup "https://github.com/georgu/shyfemcm-ismar/blob/main/src/tools/mesh/exgrd.c"
click node_mesh_framework "https://github.com/georgu/shyfemcm-ismar/tree/main/src/tools/mesh"
click node_postscript "https://github.com/georgu/shyfemcm-ismar/blob/main/src/tools/postscript/psgraph.c"
click node_hcbs_plotting "https://github.com/georgu/shyfemcm-ismar/blob/main/src/tools/hcbs/xgraph.c"
click node_color_tables "https://github.com/georgu/shyfemcm-ismar/tree/main/src/tools/shyplot/color/oceanlib"
click node_seawifs_colors "https://github.com/georgu/shyfemcm-ismar/blob/main/src/tools/shyplot/color/seawifs/colortb.c"
click node_aquabc "https://github.com/georgu/shyfemcm-ismar/blob/main/src/contrib/ecological/aquabc/aquabc_II_aout.h"
click node_weutro "https://github.com/georgu/shyfemcm-ismar/blob/main/src/contrib/ecological/weutro/weutro.h"
click node_obsolete_bfm "https://github.com/georgu/shyfemcm-ismar/tree/main/src/obsolete/femersem/src/BFM"
click node_gotm_config "https://github.com/georgu/shyfemcm-ismar/blob/main/src/external/gotm/cppdefs.h"
click node_gotm_release "https://github.com/georgu/shyfemcm-ismar/blob/main/src/external/gotm/version.h"
click node_unformatted_io "https://github.com/georgu/shyfemcm-ismar/blob/main/src/tools/femutil/unform/unformatted.c"

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_grid_editor,node_grid_support,node_grid_graphics,node_mesh_cleanup,node_mesh_framework toneBlue
class node_postscript,node_hcbs_plotting,node_color_tables,node_seawifs_colors toneAmber
class node_aquabc,node_weutro,node_obsolete_bfm,node_gotm_config,node_gotm_release toneMint
class node_unformatted_io,node_mesh_file toneRose
```

## Components

### Grid and mesh tools

- [Grid editor](https://github.com/georgu/shyfemcm-ismar/blob/main/src/tools/grid/gridma1.c): `src/tools/grid/gridma1.c`
- [Grid framework](https://github.com/georgu/shyfemcm-ismar/tree/main/src/tools/grid): `src/tools/grid`
- [Grid graphics](https://github.com/georgu/shyfemcm-ismar/blob/main/src/tools/grid/graph.c): `src/tools/grid/graph.c`
- [Mesh cleanup](https://github.com/georgu/shyfemcm-ismar/blob/main/src/tools/mesh/exgrd.c): `src/tools/mesh/exgrd.c`
- [Mesh framework](https://github.com/georgu/shyfemcm-ismar/tree/main/src/tools/mesh): `src/tools/mesh`

### Plotting

- [PostScript plotting](https://github.com/georgu/shyfemcm-ismar/blob/main/src/tools/postscript/psgraph.c): `src/tools/postscript/psgraph.c`
- [HCBS plotting](https://github.com/georgu/shyfemcm-ismar/blob/main/src/tools/hcbs/xgraph.c): `src/tools/hcbs/xgraph.c`
- [Ocean color tables](https://github.com/georgu/shyfemcm-ismar/tree/main/src/tools/shyplot/color/oceanlib): `src/tools/shyplot/color/oceanlib`
- [SeaWiFS colors](https://github.com/georgu/shyfemcm-ismar/blob/main/src/tools/shyplot/color/seawifs/colortb.c): `src/tools/shyplot/color/seawifs/colortb.c`

### Model components

- [AquaBC component](https://github.com/georgu/shyfemcm-ismar/blob/main/src/contrib/ecological/aquabc/aquabc_II_aout.h): `src/contrib/ecological/aquabc/aquabc_II_aout.h`
- [WEUTRO component](https://github.com/georgu/shyfemcm-ismar/blob/main/src/contrib/ecological/weutro/weutro.h): `src/contrib/ecological/weutro/weutro.h`
- [Obsolete BFM](https://github.com/georgu/shyfemcm-ismar/tree/main/src/obsolete/femersem/src/BFM): `src/obsolete/femersem/src/BFM`
- [GOTM configuration](https://github.com/georgu/shyfemcm-ismar/blob/main/src/external/gotm/cppdefs.h): `src/external/gotm/cppdefs.h`
- [GOTM version](https://github.com/georgu/shyfemcm-ismar/blob/main/src/external/gotm/version.h): `src/external/gotm/version.h`

### File utilities

- [Unformatted I/O](https://github.com/georgu/shyfemcm-ismar/blob/main/src/tools/femutil/unform/unformatted.c): `src/tools/femutil/unform/unformatted.c`
- **Standard grid file**

## Connections

- Grid editor → Grid framework: uses declarations (evidence: `src/tools/grid/gridma1.c`)
- Mesh cleanup → Mesh framework: uses mesh APIs (evidence: `src/tools/mesh/exgrd.c`)
- Mesh cleanup → Standard grid file: writes grid (evidence: `src/tools/mesh/exgrd.c`)
- GOTM configuration → GOTM version: includes version (evidence: `src/external/gotm/cppdefs.h`)
