integer function ov_space_ind(a, i) implicit none integer, intent(in) :: i, a ov_space_ind = (i - 1) * (nBasis - NEl) + a - NEl end function ov_space_ind