subroutine xm_periodic use modglobal, only : ib, ie, ih use modfields, only : u0, um, v0, vm, w0, wm, e120, e12m use modsubgriddata, only : loneeqn, lsmagorinsky use modmpi, only : excis integer n, m do m = 1, ih u0(ib - m, :, :) = u0(ie + 1 - m, :, :) u0(ie + m, :, :) = u0(ib - 1 + m, :, :) v0(ib - m, :, :) = v0(ie + 1 - m, :, :) v0(ie + m, :, :) = v0(ib - 1 + m, :, :) w0(ib - m, :, :) = w0(ie + 1 - m, :, :) w0(ie + m, :, :) = w0(ib - 1 + m, :, :) um(ib - m, :, :) = um(ie + 1 - m, :, :) um(ie + m, :, :) = um(ib - 1 + m, :, :) vm(ib - m, :, :) = vm(ie + 1 - m, :, :) vm(ie + m, :, :) = vm(ib - 1 + m, :, :) wm(ib - m, :, :) = wm(ie + 1 - m, :, :) wm(ie + m, :, :) = wm(ib - 1 + m, :, :) end do if (loneeqn) then e120(ib - m, :, :) = e120(ie + 1 - m, :, :) e120(ie + m, :, :) = e120(ib - 1 + m, :, :) e12m(ib - m, :, :) = e12m(ie + 1 - m, :, :) e12m(ie + m, :, :) = e12m(ib - 1 + m, :, :) end if return end subroutine xm_periodic