error when filing halos larger than the inner domain
Context
There is an error when we fill the MPI-subdomains halos with jp_fillcopy
or jp_fillperio
and when their size (e.g. nn_hls
) is larger than the inner domain (Ni_0
or Nj_0
).
Analysis
we have to make sure we don't use values that are outside of the inner domain to fill the halos.
Fix
use modulo and fill the halo from the point located next to the inner domain and going toward the outside of the domain. -> western/southern sides must be filled with do loops having an increment of -1 instead of +1.
See for example how to fill a periodic domain with Ni_0 = 2
and nn_hls = 3
Edited by Sebastien Masson