subroutine clear_orb_perm() if (allocated (orbital_permutation)) deallocate(orbital_permutation) end subroutine clear_orb_perm