9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-08-30 04:33:41 +02:00

Moved allocations from declaration.

This commit is contained in:
vijay gopal chilkuri 2021-03-12 13:15:08 +01:00
parent 6486c89583
commit 49e5d57c40

View File

@ -867,49 +867,57 @@ subroutine calculate_sigma_vector_cfg_nst_naive_store(psi_out, psi_in, n_st, sze
! 2. CSF to DET back transcormation ! 2. CSF to DET back transcormation
! returns : psi_coef_out_det : ! returns : psi_coef_out_det :
END_DOC END_DOC
integer,intent(in) :: sze, istart,iend, istep, ishift, n_st integer,intent(in) :: sze, istart,iend, istep, ishift, n_st
real*8,intent(in):: psi_in(sze,n_st) real*8,intent(in) :: psi_in(sze,n_st)
real*8,intent(out):: psi_out(sze,n_st) real*8,intent(out) :: psi_out(sze,n_st)
integer(bit_kind) :: Icfg(N_INT,2) integer(bit_kind) :: Icfg(N_INT,2)
integer :: i,j,k,l,p,q,noccp,noccq, ii, jj, m, n, idxI, kk, nocck,orbk integer :: i,j,k,l,p,q,noccp,noccq, ii, jj, m, n, idxI, kk, nocck,orbk
integer(bit_kind) :: alphas_Icfg(N_INT,2,max(sze,100)) integer(bit_kind),dimension(:,:,:),allocatable :: alphas_Icfg
integer(bit_kind) :: singlesI(N_INT,2,max(sze,100)) integer(bit_kind),dimension(:,:,:),allocatable :: singlesI
integer(bit_kind) :: connectedI_alpha(N_INT,2,max(sze,100)) integer(bit_kind),dimension(:,:,:),allocatable :: connectedI_alpha
integer :: idxs_singlesI(max(sze,100)) integer,dimension(:),allocatable :: idxs_singlesI
integer :: idxs_connectedI_alpha(max(sze,100)) integer,dimension(:),allocatable :: idxs_connectedI_alpha
integer(bit_kind) :: psi_configuration_out(N_INT,2,max(sze,100)) integer,dimension(:,:),allocatable :: excitationIds_single
real*8 :: psi_coef_out(n_CSF) integer,dimension(:),allocatable :: excitationTypes_single
logical :: psi_coef_out_init(n_CSF) integer,dimension(:,:),allocatable :: excitationIds
integer :: excitationIds_single(2,max(sze,100)) integer,dimension(:),allocatable :: excitationTypes
integer :: excitationTypes_single(max(sze,100)) real*8,dimension(:),allocatable :: diagfactors
integer :: excitationIds(2,max(sze,100)) integer :: nholes
integer :: excitationTypes(max(sze,100)) integer :: nvmos
real*8 :: diagfactors(max(sze,100)) integer :: listvmos(mo_num)
integer :: nholes integer :: vmotype(mo_num) ! 1 -> VMO 2 -> SOMO
integer :: nvmos integer :: listholes(mo_num)
integer :: listvmos(mo_num) integer :: holetype(mo_num) ! 1-> SOMO 2->DOMO
integer :: vmotype(mo_num) ! 1 -> VMO 2 -> SOMO integer :: Nalphas_Icfg, nconnectedI, rowsikpq, colsikpq, nsinglesI
integer :: listholes(mo_num) integer :: extype,NSOMOalpha,NSOMOI,NSOMOJ,pmodel,qmodel
integer :: holetype(mo_num) ! 1-> SOMO 2->DOMO integer :: getNSOMO
integer :: Nalphas_Icfg, nconnectedI, rowsikpq, colsikpq, nsinglesI integer :: totcolsTKI
integer :: extype,NSOMOalpha,NSOMOI,NSOMOJ,pmodel,qmodel integer :: rowsTKI
integer :: getNSOMO integer :: noccpp
integer :: totcolsTKI integer :: istart_cfg, iend_cfg
integer :: rowsTKI integer*8 :: MS, Isomo, Idomo, Jsomo, Jdomo, Ialpha, Ibeta
integer :: noccpp integer :: moi, moj, mok, mol, starti, endi, startj, endj, cnti, cntj, cntk
integer :: istart_cfg, iend_cfg real*8 :: norm_coef_cfg, fac2eints
integer*8 :: MS, Isomo, Idomo, Jsomo, Jdomo, Ialpha, Ibeta real*8 :: norm_coef_det
integer :: moi, moj, mok, mol, starti, endi, startj, endj, cnti, cntj, cntk real*8 :: meCC1, meCC2, diagfac
real*8 :: norm_coef_cfg, fac2eints
real*8 :: norm_coef_det
real*8 :: meCC1, meCC2, diagfac
real*8,dimension(:,:,:),allocatable :: TKI real*8,dimension(:,:,:),allocatable :: TKI
real*8,dimension(:,:),allocatable :: GIJpqrs real*8,dimension(:,:),allocatable :: GIJpqrs
real*8,dimension(:,:,:),allocatable :: TKIGIJ real*8,dimension(:,:,:),allocatable :: TKIGIJ
real*8, external :: mo_two_e_integral real*8, external :: mo_two_e_integral
real*8, external :: get_two_e_integral real*8, external :: get_two_e_integral
real*8 :: diag_energies(n_CSF) real*8 :: diag_energies(n_CSF)
!PROVIDE mo_two_e_integrals_in_map mo_integrals_map big_array_exchange_integrals
! allocate
allocate(alphas_Icfg(N_INT,2,max(sze,100)))
allocate(singlesI(N_INT,2,max(sze,100)))
allocate(connectedI_alpha(N_INT,2,max(sze,100)))
allocate(idxs_singlesI(max(sze,100)))
allocate(idxs_connectedI_alpha(max(sze,100)))
allocate(excitationIds_single(2,max(sze,100)))
allocate(excitationTypes_single(max(sze,100)))
allocate(excitationIds(2,max(sze,100)))
allocate(excitationTypes(max(sze,100)))
allocate(diagfactors(max(sze,100)))
!print *," sze = ",sze !print *," sze = ",sze
call calculate_preconditioner_cfg(diag_energies) call calculate_preconditioner_cfg(diag_energies)
@ -918,7 +926,6 @@ subroutine calculate_sigma_vector_cfg_nst_naive_store(psi_out, psi_in, n_st, sze
norm_coef_cfg=0.d0 norm_coef_cfg=0.d0
psi_out=0.d0 psi_out=0.d0
psi_coef_out_init = .False.
istart_cfg = psi_csf_to_config_data(istart) istart_cfg = psi_csf_to_config_data(istart)
iend_cfg = psi_csf_to_config_data(iend) iend_cfg = psi_csf_to_config_data(iend)
@ -1026,7 +1033,6 @@ subroutine calculate_sigma_vector_cfg_nst_naive_store(psi_out, psi_in, n_st, sze
cntj += 1 cntj += 1
meCC1 = AIJpqContainer(NSOMOI,NSOMOJ,extype,pmodel,qmodel,cnti,cntj) meCC1 = AIJpqContainer(NSOMOI,NSOMOJ,extype,pmodel,qmodel,cnti,cntj)
psi_out(jj,kk) += meCC1 * psi_in(ii,kk) * h_core_ri(p,q) psi_out(jj,kk) += meCC1 * psi_in(ii,kk) * h_core_ri(p,q)
psi_coef_out_init(jj) = .True.
enddo enddo
enddo enddo
enddo enddo
@ -1185,7 +1191,6 @@ subroutine calculate_sigma_vector_cfg_nst_naive_store(psi_out, psi_in, n_st, sze
do m = 1,colsikpq do m = 1,colsikpq
do l = 1,rowsTKI do l = 1,rowsTKI
psi_out(idxs_connectedI_alpha(j)+m-1,kk) += AIJpqContainer(NSOMOalpha,NSOMOI,extype,pmodel,qmodel,l,m) * TKIGIJ(l,kk,j) psi_out(idxs_connectedI_alpha(j)+m-1,kk) += AIJpqContainer(NSOMOalpha,NSOMOI,extype,pmodel,qmodel,l,m) * TKIGIJ(l,kk,j)
psi_coef_out_init(idxs_connectedI_alpha(j)+m-1) = .True.
enddo enddo
enddo enddo
enddo enddo
@ -1229,49 +1234,58 @@ subroutine calculate_sigma_vector_cfg_nst(psi_out, psi_in, n_st, sze, istart, ie
! 2. CSF to DET back transcormation ! 2. CSF to DET back transcormation
! returns : psi_coef_out_det : ! returns : psi_coef_out_det :
END_DOC END_DOC
integer,intent(in) :: sze, istart,iend, istep, ishift, n_st integer,intent(in) :: sze, istart,iend, istep, ishift, n_st
real*8,intent(in):: psi_in(sze,n_st) real*8,intent(in) :: psi_in(sze,n_st)
real*8,intent(out):: psi_out(sze,n_st) real*8,intent(out) :: psi_out(sze,n_st)
integer(bit_kind) :: Icfg(N_INT,2) integer(bit_kind) :: Icfg(N_INT,2)
integer :: i,j,k,l,p,q,noccp,noccq, ii, jj, m, n, idxI, kk, nocck,orbk integer :: i,j,k,l,p,q,noccp,noccq, ii, jj, m, n, idxI, kk, nocck,orbk
integer(bit_kind) :: alphas_Icfg(N_INT,2,max(sze,100)) integer(bit_kind),dimension(:,:,:),allocatable :: alphas_Icfg
integer(bit_kind) :: singlesI(N_INT,2,max(sze,100)) integer(bit_kind),dimension(:,:,:),allocatable :: singlesI
integer(bit_kind) :: connectedI_alpha(N_INT,2,max(sze,100)) integer(bit_kind),dimension(:,:,:),allocatable :: connectedI_alpha
integer :: idxs_singlesI(max(sze,100)) integer,dimension(:),allocatable :: idxs_singlesI
integer :: idxs_connectedI_alpha(max(sze,100)) integer,dimension(:),allocatable :: idxs_connectedI_alpha
integer(bit_kind) :: psi_configuration_out(N_INT,2,max(sze,100)) integer,dimension(:,:),allocatable :: excitationIds_single
real*8 :: psi_coef_out(n_CSF) integer,dimension(:),allocatable :: excitationTypes_single
logical :: psi_coef_out_init(n_CSF) integer,dimension(:,:),allocatable :: excitationIds
integer :: excitationIds_single(2,max(sze,100)) integer,dimension(:),allocatable :: excitationTypes
integer :: excitationTypes_single(max(sze,100)) real*8,dimension(:),allocatable :: diagfactors
integer :: excitationIds(2,max(sze,100)) integer :: nholes
integer :: excitationTypes(max(sze,100)) integer :: nvmos
real*8 :: diagfactors(max(sze,100)) integer :: listvmos(mo_num)
integer :: nholes integer :: vmotype(mo_num) ! 1 -> VMO 2 -> SOMO
integer :: nvmos integer :: listholes(mo_num)
integer :: listvmos(mo_num) integer :: holetype(mo_num) ! 1-> SOMO 2->DOMO
integer :: vmotype(mo_num) ! 1 -> VMO 2 -> SOMO integer :: Nalphas_Icfg, nconnectedI, rowsikpq, colsikpq, nsinglesI
integer :: listholes(mo_num) integer :: extype,NSOMOalpha,NSOMOI,NSOMOJ,pmodel,qmodel
integer :: holetype(mo_num) ! 1-> SOMO 2->DOMO integer :: getNSOMO
integer :: Nalphas_Icfg, nconnectedI, rowsikpq, colsikpq, nsinglesI integer :: totcolsTKI
integer :: extype,NSOMOalpha,NSOMOI,NSOMOJ,pmodel,qmodel integer :: rowsTKI
integer :: getNSOMO integer :: noccpp
integer :: totcolsTKI integer :: istart_cfg, iend_cfg
integer :: rowsTKI integer*8 :: MS, Isomo, Idomo, Jsomo, Jdomo, Ialpha, Ibeta
integer :: noccpp integer :: moi, moj, mok, mol, starti, endi, startj, endj, cnti, cntj, cntk
integer :: istart_cfg, iend_cfg real*8 :: norm_coef_cfg, fac2eints
integer*8 :: MS, Isomo, Idomo, Jsomo, Jdomo, Ialpha, Ibeta real*8 :: norm_coef_det
integer :: moi, moj, mok, mol, starti, endi, startj, endj, cnti, cntj, cntk real*8 :: meCC1, meCC2, diagfac
real*8 :: norm_coef_cfg, fac2eints
real*8 :: norm_coef_det
real*8 :: meCC1, meCC2, diagfac
real*8,dimension(:,:,:),allocatable :: TKI real*8,dimension(:,:,:),allocatable :: TKI
real*8,dimension(:,:),allocatable :: GIJpqrs real*8,dimension(:,:),allocatable :: GIJpqrs
real*8,dimension(:,:,:),allocatable :: TKIGIJ real*8,dimension(:,:,:),allocatable :: TKIGIJ
real*8, external :: mo_two_e_integral real*8, external :: mo_two_e_integral
real*8, external :: get_two_e_integral real*8, external :: get_two_e_integral
real*8 :: diag_energies(n_CSF) real*8 :: diag_energies(n_CSF)
!PROVIDE mo_two_e_integrals_in_map mo_integrals_map big_array_exchange_integrals
! allocate
allocate(alphas_Icfg(N_INT,2,max(sze,100)))
allocate(singlesI(N_INT,2,max(sze,100)))
allocate(connectedI_alpha(N_INT,2,max(sze,100)))
allocate(idxs_singlesI(max(sze,100)))
allocate(idxs_connectedI_alpha(max(sze,100)))
allocate(excitationIds_single(2,max(sze,100)))
allocate(excitationTypes_single(max(sze,100)))
allocate(excitationIds(2,max(sze,100)))
allocate(excitationTypes(max(sze,100)))
allocate(diagfactors(max(sze,100)))
!print *," sze = ",sze !print *," sze = ",sze
call calculate_preconditioner_cfg(diag_energies) call calculate_preconditioner_cfg(diag_energies)
@ -1280,7 +1294,6 @@ subroutine calculate_sigma_vector_cfg_nst(psi_out, psi_in, n_st, sze, istart, ie
norm_coef_cfg=0.d0 norm_coef_cfg=0.d0
psi_out=0.d0 psi_out=0.d0
psi_coef_out_init = .False.
istart_cfg = psi_csf_to_config_data(istart) istart_cfg = psi_csf_to_config_data(istart)
iend_cfg = psi_csf_to_config_data(iend) iend_cfg = psi_csf_to_config_data(iend)
@ -1388,7 +1401,6 @@ subroutine calculate_sigma_vector_cfg_nst(psi_out, psi_in, n_st, sze, istart, ie
cntj += 1 cntj += 1
meCC1 = AIJpqContainer(NSOMOI,NSOMOJ,extype,pmodel,qmodel,cnti,cntj) meCC1 = AIJpqContainer(NSOMOI,NSOMOJ,extype,pmodel,qmodel,cnti,cntj)
psi_out(jj,kk) += meCC1 * psi_in(ii,kk) * h_core_ri(p,q) psi_out(jj,kk) += meCC1 * psi_in(ii,kk) * h_core_ri(p,q)
psi_coef_out_init(jj) = .True.
enddo enddo
enddo enddo
enddo enddo
@ -1527,7 +1539,6 @@ subroutine calculate_sigma_vector_cfg_nst(psi_out, psi_in, n_st, sze, istart, ie
do m = 1,colsikpq do m = 1,colsikpq
do l = 1,rowsTKI do l = 1,rowsTKI
psi_out(idxs_connectedI_alpha(j)+m-1,kk) += AIJpqContainer(NSOMOalpha,NSOMOI,extype,pmodel,qmodel,l,m) * TKIGIJ(l,kk,j) psi_out(idxs_connectedI_alpha(j)+m-1,kk) += AIJpqContainer(NSOMOalpha,NSOMOI,extype,pmodel,qmodel,l,m) * TKIGIJ(l,kk,j)
psi_coef_out_init(idxs_connectedI_alpha(j)+m-1) = .True.
enddo enddo
enddo enddo
enddo enddo