No/incorrect volume control (nn_fwb/=0) with AGRIF zooms
Context
Global volume control with embedded zooms. (See this ticket on the former forge for a discussion about this issue)
Analysis
Using nn_fwb/=0
enables the control of the global (ice+ocean) mass that usually drifts away because of incorrect emp budget. This works fine without any zoom but, as it is, is totally incorrect with a child grid. There's actually no stop to prevent the user to activate nn_fwb/=0
with AGRIF. As it is, the flux correction routine is called on each grid, setting the integral of emp
fluxes to zero over each sub-domain, which is not correcting the budget over the whole grid hierarchy.
Fix
We discuss here the basic case nn_fwb=1
which sets the freshwater budget to 0 at each time step (hence, in a closed domain, the volume remains constant).
Because of the sequential time marching of the mesh refinement procedure, having such a global volume control with zooms can be particularly complicated. Freshwater budgets are indeed known at each parent grid step after having integrated the complete grid hierarchy. This prevents from correcting freshwater fluxes in advance, as it is currently done, say at the beginning of a full cycle. I describe below the possible ways to implement this.
-
A first way, is to have a corrective stage of the volume at the end of each time sequence (the subtle difference being here that corrective fluxes are not entering the sub-stepped barotropic equations this time). This nevertheless implies correcting a great number of variables and it does not fit at all with the actual procedure.
-
A much simpler alternative, is to consider that the domain averaged freshwater budget of each zooms must follow the parent grid corrected budget locally. This is less elegant, since it requires an estimate of the freshwater budget over the parent grid under the overlapping zone, but is straightforward. The other inconvenient is that it prevents from eventually suppressing the grid overlapping zone from the computational domain of the parent grid. One can imagine that, with exchanges at the barotropic time step, this may be soon possible.
-
The last possibility, that I have finally chosen, is to compute the corrective flux one time step in the past, from the global water volume change. This just requires designing a function that navigate along the grid hierarchy and sum up the volume. The inconvenient is that the 1 step lag in the correction does not lead to an exact volume conservation, but the drift should be acceptable.