-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Diag_mediator: Fix non-standard axis support
When a diagnostic is registered, its axis group is compared to a standard set of groups along the model grid. If it matches one of them, the diagnostic is associated with this axis group. When it does not match any of the axes, the intention was to retain the pointer to the input axis group. However, there was a bug where the axis group was pointed to the input stack value within the function, rather than the original axis group. This caused the diagnostic to be associated with an axis group which was largely nonsense. This patch fixes this bug by allocating the new axis group inside the function to heap, and then copying the contents of the input axis group to the new allocated group. This ensures a permanent reference to the new axis group. It also probably creates a minor memory leak, but we can sort that out as part of the overall memory cleanup PR (currently in preparation). There was literally only one instance of a new axis, namely the use of angles axes in the internal tide diagnostics. This patch fixes any runs which use these diagnostics.
- Loading branch information
1 parent
17e7e43
commit 3a99fb5
Showing
1 changed file
with
33 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters