From 8705a7d5f7410cb824f8471a262242cc016ec514 Mon Sep 17 00:00:00 2001 From: Emmanuel Giner Date: Fri, 8 Mar 2019 18:12:15 +0100 Subject: [PATCH] added sort_by_fock_energies.irp.f --- ocaml/.gitignore | 8 +++++-- src/tools/NEED | 1 + src/tools/sort_by_fock_energies.irp.f | 32 +++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 src/tools/sort_by_fock_energies.irp.f diff --git a/ocaml/.gitignore b/ocaml/.gitignore index 74e83c02..d883d7fb 100644 --- a/ocaml/.gitignore +++ b/ocaml/.gitignore @@ -9,20 +9,24 @@ Input_ao_two_e_erf_ints.ml Input_ao_two_e_ints.ml Input_auto_generated.ml Input_becke_numerical_grid.ml -Input_champ.ml Input_davidson.ml Input_density_for_dft.ml Input_determinants.ml Input_dft_keywords.ml +Input_dft_mu_of_r.ml Input_dressing.ml +Input_ijkl_ints_in_r3.ml Input_mo_one_e_ints.ml Input_mo_two_e_erf_ints.ml Input_mo_two_e_ints.ml +Input_mu_of_r_ints.ml +Input_mu_of_r.ml Input_nuclei.ml Input_perturbation.ml Input_pseudo.ml +Input_rsdft_ecmd.ml Input_scf_utils.ml -Input_variance.ml +Input_two_body_dm.ml qp_create_ezfio qp_create_ezfio.native qp_edit diff --git a/src/tools/NEED b/src/tools/NEED index 98afd7a1..c07c9109 100644 --- a/src/tools/NEED +++ b/src/tools/NEED @@ -1,3 +1,4 @@ fci mo_two_e_erf_ints aux_quantities +hartree_fock diff --git a/src/tools/sort_by_fock_energies.irp.f b/src/tools/sort_by_fock_energies.irp.f new file mode 100644 index 00000000..89b30780 --- /dev/null +++ b/src/tools/sort_by_fock_energies.irp.f @@ -0,0 +1,32 @@ +program sort_by_fock_energies + BEGIN_DOC +! programs that save the current mos ordered by Diagonal element of the Fock operator. +! +! Warning : the Fock operator, and therefore its matrix elements, depends on the occupancy. + END_DOC + implicit none + integer :: i,j,k + integer, allocatable :: iorder(:) + double precision, allocatable :: fock_energies_tmp(:), new_mo_coef(:,:) + allocate(iorder(mo_num), fock_energies_tmp(mo_num),new_mo_coef(ao_num,mo_num)) + do i = 1, mo_num + fock_energies_tmp(i) = Fock_matrix_diag_mo(i) + print*,'fock_energies_tmp(i) = ',fock_energies_tmp(i) + iorder(i) = i + enddo + print*,'' + print*,'Sorting by Fock energies' + print*,'' + call dsort(fock_energies_tmp,iorder,mo_num) + do i = 1, mo_num + k = iorder(i) + print*,'fock_energies_new(i) = ',fock_energies_tmp(i) + do j = 1, ao_num + new_mo_coef(j,i) = mo_coef(j,k) + enddo + enddo + mo_coef = new_mo_coef + touch mo_coef + call save_mos + +end