subroutine xsi_custom use modglobal, only : ib, ie, jb, je, jtot, kb, ke, nsv, ihc use modfields, only : sv0, svm, svprof use decomp_2d, only : zstart integer j, k, n, m do j = jb, je if (j + zstart(2) - 1 == jtot/2) then do k = kb, ke + 1 do n = 1, nsv do m = 1, ihc sv0(ib - m, j-1:j+1, k, n) = 2*svprof(k, n) - sv0(ib - m + 1, j-1:j+1, k, n) svm(ib - m, j-1:j+1, k, n) = 2*svprof(k, n) - svm(ib - m + 1, j-1:j+1, k, n) end do end do end do end if end do end subroutine xsi_custom