1
0
mirror of https://gitlab.com/scemama/qp_plugins_scemama.git synced 2024-11-12 17:13:40 +01:00

Compare commits

..

2 Commits

Author SHA1 Message Date
0ea3df3502 Improving trexio export 2021-05-06 19:58:30 +02:00
1df54bc2fe Added electron group 2021-05-06 10:40:36 +02:00
3 changed files with 283 additions and 36 deletions

View File

@ -1,2 +1,6 @@
ezfio_files
hartree_fock
determinants
mo_one_e_ints
mo_two_e_ints
ao_two_e_ints
ao_one_e_ints

View File

@ -21,7 +21,11 @@ program export_trexio
stop -1
endif
! Nuclei
! ------------------------------------------------------------------------------
! Nuclei
! ------
rc = trexio_write_nucleus_num(f, nucl_num)
call check_success(rc)
@ -32,13 +36,16 @@ program export_trexio
call check_success(rc)
! Electrons
! rc = trexio_write_electron_up_num(f, elec_alpha_num)
! call check_success(rc)
rc = trexio_write_electron_up_num(f, elec_alpha_num)
call check_success(rc)
!
! rc = trexio_write_electron_dn_num(f, elec_beta_num)
! call check_success(rc)
rc = trexio_write_electron_dn_num(f, elec_beta_num)
call check_success(rc)
! Basis
! -----
! Basis
! rc = trexio_write_basis_type(f, 'Gaussian')
! call check_success(rc)
@ -46,6 +53,89 @@ program export_trexio
call check_success(rc)
! Atomic orbitals
! ---------------
rc = trexio_write_ao_num(f, ao_num)
call check_success(rc)
rc = trexio_write_ao_cartesian(f, 1)
call check_success(rc)
! One-e AO integrals
! ------------------
rc = trexio_write_ao_1e_int_overlap(f,ao_overlap)
call check_success(rc)
rc = trexio_write_ao_1e_int_kinetic(f,ao_kinetic_integrals)
call check_success(rc)
rc = trexio_write_ao_1e_int_potential_n_e(f,ao_integrals_n_e)
call check_success(rc)
if (do_pseudo) then
rc = trexio_write_ao_1e_int_ecp_local(f,ao_pseudo_integrals_local)
call check_success(rc)
rc = trexio_write_ao_1e_int_ecp_non_local(f,ao_pseudo_integrals_non_local)
call check_success(rc)
endif
rc = trexio_write_ao_1e_int_core_hamiltonian(f,ao_one_e_integrals)
call check_success(rc)
! Molecular orbitals
! ------------------
! rc = trexio_write_mo_type(f, mo_label)
! call check_success(rc)
rc = trexio_write_mo_num(f, mo_num)
call check_success(rc)
rc = trexio_write_mo_coef(f, mo_coef)
call check_success(rc)
! One-e MO integrals
! ------------------
rc = trexio_write_mo_1e_int_kinetic(f,mo_kinetic_integrals)
call check_success(rc)
rc = trexio_write_mo_1e_int_potential_n_e(f,mo_integrals_n_e)
call check_success(rc)
if (do_pseudo) then
rc = trexio_write_mo_1e_int_ecp_local(f,mo_pseudo_integrals_local)
call check_success(rc)
rc = trexio_write_mo_1e_int_ecp_non_local(f,mo_pseudo_integrals_non_local)
call check_success(rc)
endif
rc = trexio_write_mo_1e_int_core_hamiltonian(f,one_e_dm_mo)
call check_success(rc)
! RDM
! ----
! rc = trexio_write_rdm_one_e(f,one_e_dm_mo)
! call check_success(rc)
!
! rc = trexio_write_rdm_one_e_up(f,one_e_dm_mo_alpha_average)
! call check_success(rc)
!
! rc = trexio_write_rdm_one_e_dn(f,one_e_dm_mo_beta_average)
! call check_success(rc)
! ------------------------------------------------------------------------------
rc = trexio_close(f)
call check_success(rc)
@ -59,7 +149,7 @@ subroutine check_success(rc)
character*(128) :: str
if (rc /= TREXIO_SUCCESS) then
call trexio_string_of_error(rc,str)
print *, str
print *, 'TREXIO Error: ' //trim(str)
stop -1
endif
end

View File

@ -24,6 +24,15 @@ integer(trexio_exit_code), parameter :: TREXIO_INVALID_ID = 9
integer(trexio_exit_code), parameter :: TREXIO_ALLOCATION_FAILED = 10
integer(trexio_exit_code), parameter :: TREXIO_HAS_NOT = 11
integer(trexio_exit_code), parameter :: TREXIO_INVALID_NUM = 12
integer(trexio_exit_code), parameter :: TREXIO_NUM_ALREADY_EXISTS = 13
integer(trexio_exit_code), parameter :: TREXIO_OPEN_ERROR = 14
integer(trexio_exit_code), parameter :: TREXIO_LOCK_ERROR = 15
integer(trexio_exit_code), parameter :: TREXIO_UNLOCK_ERROR = 16
integer(trexio_exit_code), parameter :: TREXIO_FILE_ERROR = 17
integer(trexio_exit_code), parameter :: TREXIO_GROUP_READ_ERROR = 18
integer(trexio_exit_code), parameter :: TREXIO_GROUP_WRITE_ERROR = 19
integer(trexio_exit_code), parameter :: TREXIO_ELEM_READ_ERROR = 20
integer(trexio_exit_code), parameter :: TREXIO_ELEM_WRITE_ERROR = 21
interface
subroutine trexio_string_of_error (error, string) bind(C, name='trexio_string_of_error_f')
@ -188,10 +197,10 @@ interface
end function trexio_has_ao_1e_int_kinetic
end interface
interface
integer function trexio_has_ao_1e_int_potential (trex_file) bind(C)
integer function trexio_has_ao_1e_int_potential_n_e (trex_file) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
end function trexio_has_ao_1e_int_potential
end function trexio_has_ao_1e_int_potential_n_e
end interface
interface
integer function trexio_has_ao_1e_int_ecp_local (trex_file) bind(C)
@ -236,10 +245,10 @@ interface
end function trexio_has_mo_1e_int_kinetic
end interface
interface
integer function trexio_has_mo_1e_int_potential (trex_file) bind(C)
integer function trexio_has_mo_1e_int_potential_n_e (trex_file) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
end function trexio_has_mo_1e_int_potential
end function trexio_has_mo_1e_int_potential_n_e
end interface
interface
integer function trexio_has_mo_1e_int_ecp_local (trex_file) bind(C)
@ -265,6 +274,24 @@ interface
integer(8), intent(in), value :: trex_file
end function trexio_has_mo_2e_int_eri
end interface
interface
integer function trexio_has_electron_up_num (trex_file) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
end function trexio_has_electron_up_num
end interface
interface
integer function trexio_has_electron_dn_num (trex_file) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
end function trexio_has_electron_dn_num
end interface
interface
integer function trexio_has_ao_cartesian (trex_file) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
end function trexio_has_ao_cartesian
end interface
interface
integer function trexio_has_nucleus_num (trex_file) bind(C)
use, intrinsic :: iso_c_binding
@ -469,11 +496,11 @@ interface
end function trexio_read_ao_1e_int_kinetic_32
end interface
interface
integer function trexio_read_ao_1e_int_potential_32 (trex_file, dset) bind(C)
integer function trexio_read_ao_1e_int_potential_n_e_32 (trex_file, dset) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
real(4), intent(out) :: dset(*)
end function trexio_read_ao_1e_int_potential_32
end function trexio_read_ao_1e_int_potential_n_e_32
end interface
interface
integer function trexio_read_ao_1e_int_ecp_local_32 (trex_file, dset) bind(C)
@ -525,11 +552,11 @@ interface
end function trexio_read_mo_1e_int_kinetic_32
end interface
interface
integer function trexio_read_mo_1e_int_potential_32 (trex_file, dset) bind(C)
integer function trexio_read_mo_1e_int_potential_n_e_32 (trex_file, dset) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
real(4), intent(out) :: dset(*)
end function trexio_read_mo_1e_int_potential_32
end function trexio_read_mo_1e_int_potential_n_e_32
end interface
interface
integer function trexio_read_mo_1e_int_ecp_local_32 (trex_file, dset) bind(C)
@ -721,11 +748,11 @@ interface
end function trexio_read_ao_1e_int_kinetic_64
end interface
interface
integer function trexio_read_ao_1e_int_potential_64 (trex_file, dset) bind(C)
integer function trexio_read_ao_1e_int_potential_n_e_64 (trex_file, dset) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
real(8), intent(out) :: dset(*)
end function trexio_read_ao_1e_int_potential_64
end function trexio_read_ao_1e_int_potential_n_e_64
end interface
interface
integer function trexio_read_ao_1e_int_ecp_local_64 (trex_file, dset) bind(C)
@ -777,11 +804,11 @@ interface
end function trexio_read_mo_1e_int_kinetic_64
end interface
interface
integer function trexio_read_mo_1e_int_potential_64 (trex_file, dset) bind(C)
integer function trexio_read_mo_1e_int_potential_n_e_64 (trex_file, dset) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
real(8), intent(out) :: dset(*)
end function trexio_read_mo_1e_int_potential_64
end function trexio_read_mo_1e_int_potential_n_e_64
end interface
interface
integer function trexio_read_mo_1e_int_ecp_local_64 (trex_file, dset) bind(C)
@ -973,11 +1000,11 @@ interface
end function trexio_read_ao_1e_int_kinetic
end interface
interface
integer function trexio_read_ao_1e_int_potential (trex_file, dset) bind(C)
integer function trexio_read_ao_1e_int_potential_n_e (trex_file, dset) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
real(8), intent(out) :: dset(*)
end function trexio_read_ao_1e_int_potential
end function trexio_read_ao_1e_int_potential_n_e
end interface
interface
integer function trexio_read_ao_1e_int_ecp_local (trex_file, dset) bind(C)
@ -1029,11 +1056,11 @@ interface
end function trexio_read_mo_1e_int_kinetic
end interface
interface
integer function trexio_read_mo_1e_int_potential (trex_file, dset) bind(C)
integer function trexio_read_mo_1e_int_potential_n_e (trex_file, dset) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
real(8), intent(out) :: dset(*)
end function trexio_read_mo_1e_int_potential
end function trexio_read_mo_1e_int_potential_n_e
end interface
interface
integer function trexio_read_mo_1e_int_ecp_local (trex_file, dset) bind(C)
@ -1063,6 +1090,27 @@ interface
real(8), intent(out) :: dset(*)
end function trexio_read_mo_2e_int_eri
end interface
interface
integer function trexio_read_electron_up_num_32 (trex_file, num) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
integer(4), intent(out) :: num
end function trexio_read_electron_up_num_32
end interface
interface
integer function trexio_read_electron_dn_num_32 (trex_file, num) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
integer(4), intent(out) :: num
end function trexio_read_electron_dn_num_32
end interface
interface
integer function trexio_read_ao_cartesian_32 (trex_file, num) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
integer(4), intent(out) :: num
end function trexio_read_ao_cartesian_32
end interface
interface
integer function trexio_read_nucleus_num_32 (trex_file, num) bind(C)
use, intrinsic :: iso_c_binding
@ -1112,6 +1160,27 @@ interface
integer(4), intent(out) :: num
end function trexio_read_mo_num_32
end interface
interface
integer function trexio_read_electron_up_num_64 (trex_file, num) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
integer(8), intent(out) :: num
end function trexio_read_electron_up_num_64
end interface
interface
integer function trexio_read_electron_dn_num_64 (trex_file, num) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
integer(8), intent(out) :: num
end function trexio_read_electron_dn_num_64
end interface
interface
integer function trexio_read_ao_cartesian_64 (trex_file, num) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
integer(8), intent(out) :: num
end function trexio_read_ao_cartesian_64
end interface
interface
integer function trexio_read_nucleus_num_64 (trex_file, num) bind(C)
use, intrinsic :: iso_c_binding
@ -1161,6 +1230,27 @@ interface
integer(8), intent(out) :: num
end function trexio_read_mo_num_64
end interface
interface
integer function trexio_read_electron_up_num (trex_file, num) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
integer(4), intent(out) :: num
end function trexio_read_electron_up_num
end interface
interface
integer function trexio_read_electron_dn_num (trex_file, num) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
integer(4), intent(out) :: num
end function trexio_read_electron_dn_num
end interface
interface
integer function trexio_read_ao_cartesian (trex_file, num) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
integer(4), intent(out) :: num
end function trexio_read_ao_cartesian
end interface
interface
integer function trexio_read_nucleus_num (trex_file, num) bind(C)
use, intrinsic :: iso_c_binding
@ -1372,11 +1462,11 @@ interface
end function trexio_write_ao_1e_int_kinetic_32
end interface
interface
integer function trexio_write_ao_1e_int_potential_32 (trex_file, dset) bind(C)
integer function trexio_write_ao_1e_int_potential_n_e_32 (trex_file, dset) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
real(4), intent(in) :: dset(*)
end function trexio_write_ao_1e_int_potential_32
end function trexio_write_ao_1e_int_potential_n_e_32
end interface
interface
integer function trexio_write_ao_1e_int_ecp_local_32 (trex_file, dset) bind(C)
@ -1428,11 +1518,11 @@ interface
end function trexio_write_mo_1e_int_kinetic_32
end interface
interface
integer function trexio_write_mo_1e_int_potential_32 (trex_file, dset) bind(C)
integer function trexio_write_mo_1e_int_potential_n_e_32 (trex_file, dset) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
real(4), intent(in) :: dset(*)
end function trexio_write_mo_1e_int_potential_32
end function trexio_write_mo_1e_int_potential_n_e_32
end interface
interface
integer function trexio_write_mo_1e_int_ecp_local_32 (trex_file, dset) bind(C)
@ -1624,11 +1714,11 @@ interface
end function trexio_write_ao_1e_int_kinetic_64
end interface
interface
integer function trexio_write_ao_1e_int_potential_64 (trex_file, dset) bind(C)
integer function trexio_write_ao_1e_int_potential_n_e_64 (trex_file, dset) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
real(8), intent(in) :: dset(*)
end function trexio_write_ao_1e_int_potential_64
end function trexio_write_ao_1e_int_potential_n_e_64
end interface
interface
integer function trexio_write_ao_1e_int_ecp_local_64 (trex_file, dset) bind(C)
@ -1680,11 +1770,11 @@ interface
end function trexio_write_mo_1e_int_kinetic_64
end interface
interface
integer function trexio_write_mo_1e_int_potential_64 (trex_file, dset) bind(C)
integer function trexio_write_mo_1e_int_potential_n_e_64 (trex_file, dset) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
real(8), intent(in) :: dset(*)
end function trexio_write_mo_1e_int_potential_64
end function trexio_write_mo_1e_int_potential_n_e_64
end interface
interface
integer function trexio_write_mo_1e_int_ecp_local_64 (trex_file, dset) bind(C)
@ -1876,11 +1966,11 @@ interface
end function trexio_write_ao_1e_int_kinetic
end interface
interface
integer function trexio_write_ao_1e_int_potential (trex_file, dset) bind(C)
integer function trexio_write_ao_1e_int_potential_n_e (trex_file, dset) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
real(8), intent(in) :: dset(*)
end function trexio_write_ao_1e_int_potential
end function trexio_write_ao_1e_int_potential_n_e
end interface
interface
integer function trexio_write_ao_1e_int_ecp_local (trex_file, dset) bind(C)
@ -1932,11 +2022,11 @@ interface
end function trexio_write_mo_1e_int_kinetic
end interface
interface
integer function trexio_write_mo_1e_int_potential (trex_file, dset) bind(C)
integer function trexio_write_mo_1e_int_potential_n_e (trex_file, dset) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
real(8), intent(in) :: dset(*)
end function trexio_write_mo_1e_int_potential
end function trexio_write_mo_1e_int_potential_n_e
end interface
interface
integer function trexio_write_mo_1e_int_ecp_local (trex_file, dset) bind(C)
@ -1966,6 +2056,27 @@ interface
real(8), intent(in) :: dset(*)
end function trexio_write_mo_2e_int_eri
end interface
interface
integer function trexio_write_electron_up_num_32 (trex_file, num) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
integer(4), intent(in), value :: num
end function trexio_write_electron_up_num_32
end interface
interface
integer function trexio_write_electron_dn_num_32 (trex_file, num) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
integer(4), intent(in), value :: num
end function trexio_write_electron_dn_num_32
end interface
interface
integer function trexio_write_ao_cartesian_32 (trex_file, num) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
integer(4), intent(in), value :: num
end function trexio_write_ao_cartesian_32
end interface
interface
integer function trexio_write_nucleus_num_32 (trex_file, num) bind(C)
use, intrinsic :: iso_c_binding
@ -2015,6 +2126,27 @@ interface
integer(4), intent(in), value :: num
end function trexio_write_mo_num_32
end interface
interface
integer function trexio_write_electron_up_num_64 (trex_file, num) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
integer(8), intent(in), value :: num
end function trexio_write_electron_up_num_64
end interface
interface
integer function trexio_write_electron_dn_num_64 (trex_file, num) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
integer(8), intent(in), value :: num
end function trexio_write_electron_dn_num_64
end interface
interface
integer function trexio_write_ao_cartesian_64 (trex_file, num) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
integer(8), intent(in), value :: num
end function trexio_write_ao_cartesian_64
end interface
interface
integer function trexio_write_nucleus_num_64 (trex_file, num) bind(C)
use, intrinsic :: iso_c_binding
@ -2064,6 +2196,27 @@ interface
integer(8), intent(in), value :: num
end function trexio_write_mo_num_64
end interface
interface
integer function trexio_write_electron_up_num (trex_file, num) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
integer(4), intent(in), value :: num
end function trexio_write_electron_up_num
end interface
interface
integer function trexio_write_electron_dn_num (trex_file, num) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
integer(4), intent(in), value :: num
end function trexio_write_electron_dn_num
end interface
interface
integer function trexio_write_ao_cartesian (trex_file, num) bind(C)
use, intrinsic :: iso_c_binding
integer(8), intent(in), value :: trex_file
integer(4), intent(in), value :: num
end function trexio_write_ao_cartesian
end interface
interface
integer function trexio_write_nucleus_num (trex_file, num) bind(C)
use, intrinsic :: iso_c_binding