Author Image

FINAM – Python model coupling framework

About FINAM

A lightweight model coupling framework in Python

FINAM is a lighweight, easy to use model coupling framework. Written in Python, it can be used to link models written in virtually any language.

We put particular focus on ease of use. We want to make linking existing models easy, with as few programming work as possible.

FINAM is open source software under the LGPL3 license.


Features

1
Written in Python, for any language

Use the power and convenience of Python to wrap you models, write adapters, and set up model linkage.

Benefit from Python as glue code to couple models from different programming languages. Exchange any data between models in any language!

(
    cpp_model.outputs["precip"]
    >> RegridLinear()
    >> LinearTime()
    >> fortran_model.inputs["precip"]
)

Flexible, component-based model coupling

A component-based coupling approach warrants high modularity and independence of linked components.

Models are wrapped into a unified interface, and communicate through adapters.

2

3
Minimal, unified component interface

Wrapping existing models is easy!

Write Python bindings for initialization and step functionality, and implement the straight-forward FINAM interface.

A fully functional component can have less than 50 lines of code!

class MyComponent(TimeComponent):
    def __init__(self, ...)
    def initialize(self)
    def connect(self)
    def validate(self)
    def update(self)
    def finalize(self)

Minimal-effort adapters

Adapters are used for data transformations between components. Examples are regridding, CRS transformations or temporal interpolation.

FINAM’s adapter interface is simple and easy to implement.

class ScaleAdapter(Adapter):
    def __init__(self, scale):
        super().__init__()
        self.scale = scale
    def _get_data(self, time):
        d = self.pull_data(time)
        return d * self.scale
4

5
Bi-directional and circular coupling
FINAM’s scheduling algorithm allows for bi-directional and circular coupling setups, as well as fully flexible and even varying model time steps.

Spatio-temporal data types

For structured and unstructured spatio-temporal data, FINAM uses numpy arrays. All data has physical units, using pint.

Metadata is used for automatic consistency checks, and follows the CF Conventions.

6

Projects

FINAM core
FINAM core

The FINAM core framework and basic tools

FINAM documentation
FINAM documentation

FINAM’s extensive documentation with user and developer guide

FINAM NetCDF I/O
FINAM NetCDF I/O

NetCDF file I/O components for FINAM

FINAM graphs
FINAM graphs

A tool for visualizing FINAM model linkage setups

FINAM plot
FINAM plot

Live visualization components for spatial data

FINAM regrid
FINAM regrid

Advanced regridding adapter for FINAM, using ESMPy

Publications

Coming soon...