subroutine ym_periodic use modglobal, only:ib, ie, jb, je, ih, jh, kb, ke, kh, jmax use modfields, only:u0, um, v0, vm, w0, wm, e120, e12m, shear use modsubgriddata, only:loneeqn, lsmagorinsky use modmpi, only:excjs integer n, m do m = 1, ih u0(:, jb - m, :) = u0(:, je + 1 - m, :) u0(:, je + m, :) = u0(:, jb - 1 + m, :) v0(:, jb - m, :) = v0(:, je + 1 - m, :) v0(:, je + m, :) = v0(:, jb - 1 + m, :) w0(:, jb - m, :) = w0(:, je + 1 - m, :) w0(:, je + m, :) = w0(:, jb - 1 + m, :) um(:, jb - m, :) = um(:, je + 1 - m, :) um(:, je + m, :) = um(:, jb - 1 + m, :) vm(:, jb - m, :) = vm(:, je + 1 - m, :) vm(:, je + m, :) = vm(:, jb - 1 + m, :) wm(:, jb - m, :) = wm(:, je + 1 - m, :) wm(:, je + m, :) = wm(:, jb - 1 + m, :) end do if (loneeqn) then e120(:, jb - m, :) = e120(:, je + 1 - m, :) e120(:, je + m, :) = e120(:, jb - 1 + m, :) e12m(:, jb - m, :) = e12m(:, je + 1 - m, :) e12m(:, je + m, :) = e12m(:, jb - 1 + m, :) end if return end subroutine ym_periodic