2.[Instrument and link your model against Melissa-DA](#2.-Instrument-and-link-a-model-against-Melissa-DA)(or use one of the example models to
start)
3.[Configure your assimilator by writing a new assimilator or writing a new
pdaf-wrapper library to be preloaded at runtime](#3.-Configure-the-Assimilation-Update-Phase)(or use one of the existing assimilators
3.[Configure your assimilator by writing a new assimilator or writing a new pdaf-wrapper library to be preloaded at runtime](#3.-Configure-the-Assimilation-Update-Phase)(or use one of the existing assimilators
for the beginning)
4. Launch your simulation from within a simple python script:
```python
...
...
@@ -122,7 +121,7 @@ make install
source build/install/bin/melissa_da_set_env.sh
```
Alternatively add this line to your .bashrc so it is sourced after each login.
Alternatively add this line to your `.bashrc` so it is sourced after each login.
-**Congratulations!** you just installed Melissa-DA
...
...
@@ -161,7 +160,7 @@ Checkpoints are stored in hdf5 file format. This allows using them also directly
To permit load balancing through online state migration (the way how Melissa-DA works), the model must be transformed into a runner. Thus the model must expose all its state (the full state theoretically necessary for a model restart, containing the assimilated part of the state vector, but not necessarily containing the part of the state vector that is the same on all members and constant over time) at the right place where Melissa-DA will intercept and change all this state to the state according to the ensemble member it wants to propagate next.
A simple model pseudocode:
A simple model pseudo-code:
```python
x=Model_Init()
...
...
@@ -182,9 +181,11 @@ while melissa_expose(x) != 0:
Model_Finalize(x)
```
### Melissa-API
### Melissa-DA API
The Melissa-API exports functions to model code written in C/C++ and Fortran so far.
The Melissa-DA API exports functions to model code written in C/C++ and Fortran so far.
Please build and read the documentation (`cmake -DBUILD_DOCUMENTATION=ON; make doc`, open `doc/html/index.html` then) that
contains more information on the Melissa-DA API.
To instrument your model simply the following 2 functions must be inserted in your model code to transform it into a *runner* that can take work from the *melissa_server*.
...
...
@@ -219,7 +220,7 @@ The Fortran API is quite similar. For more detail have a look into [api/melissa_
There are also different other API functions considering index maps (to map multiple variables in the assimilated or hidden state) or to expose multiple chunks of data stored on different places in the memory. As they are not vital for simple study runs and their API is not completely fixed yet they are only documented in the source code ([api/melissa_da_api.h](api/melissa_da_api.h)).
### Linking against the Melissa-DA-API
### Linking against the Melissa-DAAPI
If you are using CMake it is as simple as
```cmake
...
...
@@ -291,6 +292,9 @@ For an example and to learn how to tell the melissa_server in which python modul
Alternative ways are inheriting [server/Assimilator.h](server/Assimilator.h) to define a new assimilation update step in C++.
Please build and read the documentation (`cmake -DBUILD_DOCUMENTATION=ON; make doc`, open `doc/html/index.html` then) that
contains more information on the Melissa-DA Assimilator API.
Another approach permitting [PDAF](http://pdaf.awi.de/) based DA is to use the `LD_PRELOAD` functionality to inject a bunch of user defined functions for analysis, postprocessing, observation loading ... (see [http://pdaf.awi.de/trac/wiki/ImplementationGuide](http://pdaf.awi.de/trac/wiki/ImplementationGuide) and the [`pdaf-wrapper`](pdaf-wrapper) and [`examples/simulation2-pdaf`](examples/simulation2-pdaf) folders)
## Using spack for development:
...
...
@@ -346,6 +350,8 @@ Copies of the licenses can be found in the folder [`licenses`](licenses).
## More in depth documentation
For more in depth documentation we refer to [doc/implementation.md](doc/implementation.md) and to [this](https://hal.archives-ouvertes.fr/hal-03017033v2).
You can also build and read the code doc (`cmake -DBUILD_DOCUMENTATION=ON; make doc`, open `doc/html/index.html` then) that
contains some more information.
## Comparison with Melissa-SA: a distant branch of Melissa-SA...
This is a rather distant branch of Melissa (https://melissa-sa.github.io/) for data assimilation: