subroutine ys_periodic use modglobal, only : jb, je, jhc, nsv use modfields, only : sv0, svm integer n, m do n = 1, nsv do m = 1, jhc sv0(:, jb - m, :, :) = sv0(:, je + 1 - m, :, :) sv0(:, je + m, :, :) = sv0(:, jb - 1 + m, :, :) svm(:, jb - m, :, :) = svm(:, je + 1 - m, :, :) svm(:, je + m, :, :) = svm(:, jb - 1 + m, :, :) end do end do return end subroutine ys_periodic