subroutine deallocate_spin_measurements()
! deallocate the spin occupation measurement vectors
character(*), parameter :: this_routine = "deallocate_spin_measurements"
if (allocated(spin_up_occ)) deallocate(spin_up_occ)
if (allocated(spin_down_occ)) deallocate(spin_down_occ)
if (allocated(spin_diff)) deallocate(spin_diff)
if (allocated(double_occ_vec)) deallocate(double_occ_vec)
if (allocated(inst_spin_diff)) deallocate(inst_spin_diff)
if (allocated(all_inst_spin_diff)) deallocate(all_inst_spin_diff)
if (allocated(inst_spatial_doub_occ)) deallocate(inst_spatial_doub_occ)
if (allocated(all_inst_spatial_doub_occ)) deallocate(all_inst_spatial_doub_occ)
if (allocated(sum_double_occ_vec)) deallocate(sum_double_occ_vec)
end subroutine deallocate_spin_measurements