Add new feature ‘custom diagnostics’ to Fluid2D#7
Conversation
Custom diagnostics allow to store any information that can be extracted from the model state in the diagnostics file. With this, we can provide a high frequency output of a diagnostics we are interested in without creating a huge history file. This may make the diagnostics file more useful for a wider range of Fluid2D users. An example is provided where custom diagnostics are used to measure the drift of a vortex that he experiences due to the beta-effect on a rotating planet. Note: the experiment only works correctly with the fixed QG model (see pull request "Fix QG model")
|
Possibly unexpected results in multi-core runs When the example experiment is run on multi-cores, the position of the vortex is not calculated correctly, because the core 0 that is responsible for writing diagnostics only sees one part of the domain. Before this pull request is merged, one should pose the question of how to handle multi-core runs. |
|
Comments on the multi-core situation The way custom diagnostics are implemented in this pull request works when Fluid2D is run on a single core, which is already a gain. In a multi-core setting, however, the example does not create the expected output for the reason stated above. I see three options to handle this situation:
I prefer option 1, but it is up to the reviewer to decide. |
Custom diagnostics allow to store any information that can be extracted
from the model state in the diagnostics file. With this, we can provide
a high frequency output of a diagnostics we are interested in without
creating a huge history file. This may make the diagnostics file more
useful for a wider range of Fluid2D users.
An example is provided where custom diagnostics are used to measure the
drift of a vortex that he experiences due to the beta-effect on a
rotating planet.
Note: the experiment only works correctly with the fixed QG model
(see pull request "Fix QG model")