Reproducibility issue in AGRIF update with very small mpp domains
There's a long standing issue of loss of mpp reproducibility with AGRIF, which, fortunately, occurs only when mpp subdomains become very small (<~7). Origin of the problem can be tracked back to the update stage only (i.e. with two-way nesting) with access to zero sized arrays in the AGRIF library.
More precisely, this occurs in /ext/AGRIF/AGRIF_FILES/modupdatebasic.F90
, here and here where first dimension of indchildcopy(:,:)
and indchildaverage(:,:)
is accessed while being null. A simple trick is to encapsulate these loops with something like:
if (np*nc2>0) then ; ...; endif
(np*nc2
being the first dimension of aforementioned arrays) which indeed restores reproducibility.
Confirmation by Laurent D. is needed to know is this is symptomatic of something more dangerous.