Reduce memory and correct bug with qcio

This commit is contained in:
Anthony Scemama 2009-05-18 15:00:54 +02:00
parent 03565ea88b
commit 5069a720a0
30 changed files with 72 additions and 62 deletions

View File

@ -1,7 +1,10 @@
IRPF90 = irpf90 -DMPI #-a -d
IRPF90 = irpf90 -DMPI#-a -d
FC = mpif90
FCFLAGS= -O3 -xT
#FC = gfortran -g -ffree-line-length-none
#FCFLAGS=
SRC=
OBJ=
LIB=-lqcio

View File

@ -3,6 +3,11 @@ program debug
PROVIDE ao_prim_num_max
integer :: i,j
integer :: k
print *, ''
print *, 'Occupation numbers'
do k=1,mo_num
print *, k, mo_occ(k)
enddo
read(*,*) i,j
print *, ''
@ -44,4 +49,5 @@ program debug
print *, 'EPLF grid Npoints :', grid_eplf_x_num, grid_eplf_y_num, grid_eplf_z_num
print *, 'EPLF grid step :', grid_eplf_step(:)
print *, 'EPLF grid origin :', grid_eplf_origin(:)
end

View File

@ -3,7 +3,7 @@ BEGIN_PROVIDER [ real, eplf_gamma ]
BEGIN_DOC
! Value of the gaussian for the EPLF
END_DOC
eplf_gamma = 1000.
eplf_gamma = 10.
END_PROVIDER
BEGIN_PROVIDER [ double precision, ao_eplf_integral_matrix, (ao_num,ao_num) ]
@ -21,7 +21,7 @@ BEGIN_PROVIDER [ double precision, ao_eplf_integral_matrix, (ao_num,ao_num) ]
enddo
END_PROVIDER
BEGIN_PROVIDER [ double precision, mo_eplf_integral_matrix, (mo_occ_num,mo_occ_num) ]
BEGIN_PROVIDER [ double precision, mo_eplf_integral_matrix, (mo_num,mo_num) ]
implicit none
BEGIN_DOC
! Array of all the <chi_i chi_j | exp(-gamma r^2)> for EPLF
@ -29,14 +29,14 @@ BEGIN_PROVIDER [ double precision, mo_eplf_integral_matrix, (mo_occ_num,mo_occ_n
integer :: i, j, k, l
PROVIDE ao_eplf_integral_matrix
PROVIDE mo_coef
do i=1,mo_occ_num
do j=i,mo_occ_num
do i=1,mo_num
do j=i,mo_num
mo_eplf_integral_matrix(j,i) = 0.
enddo
do k=1,ao_num
if (mo_coef(k,i) /= 0.) then
do j=i,mo_occ_num
do j=i,mo_num
do l=1,ao_num
mo_eplf_integral_matrix(j,i) = mo_eplf_integral_matrix(j,i) + &
mo_coef(k,i)*mo_coef(l,j)*ao_eplf_integral_matrix(k,l)
@ -45,7 +45,7 @@ BEGIN_PROVIDER [ double precision, mo_eplf_integral_matrix, (mo_occ_num,mo_occ_n
endif
enddo
do j=i,mo_occ_num
do j=i,mo_num
mo_eplf_integral_matrix(i,j) = mo_eplf_integral_matrix(j,i)
enddo
enddo
@ -111,10 +111,10 @@ BEGIN_PROVIDER [ real, eplf_value ]
ab = eplf_up_dn
aa = min(1.d0,aa)
ab = min(1.d0,ab)
aa = max(1.d-30,aa)
ab = max(1.d-30,ab)
aa = -dlog(aa)/eplf_gamma
ab = -dlog(ab)/eplf_gamma
aa = max(tiny(1.d0),aa)
ab = max(tiny(1.d0),ab)
aa = -(dlog(aa)/eplf_gamma)+tiny(1.d0)
ab = -(dlog(ab)/eplf_gamma)+tiny(1.d0)
aa = dsqrt(aa)
ab = dsqrt(ab)
@ -161,13 +161,15 @@ double precision function ao_eplf_integral_numeric(i,j,gmma,center)
implicit none
integer, intent(in) :: i, j
integer :: p,q,k
double precision :: integral(ao_prim_num_max,ao_prim_num_max)
double precision :: integral
double precision :: ao_eplf_integral_primitive_oneD_numeric
real :: gmma, center(3)
ao_eplf_integral_numeric = 0.
do q=1,ao_prim_num(j)
do p=1,ao_prim_num(i)
integral(p,q) = &
integral = &
ao_eplf_integral_primitive_oneD_numeric( &
ao_expo(p,i), &
nucl_coord(ao_nucl(i),1), &
@ -195,19 +197,7 @@ double precision function ao_eplf_integral_numeric(i,j,gmma,center)
ao_power(j,3), &
gmma, &
center(3))
enddo
enddo
do q=1,ao_prim_num(j)
do p=1,ao_prim_num(i)
integral(p,q) = integral(p,q)*ao_coef(p,i)*ao_coef(q,j)
enddo
enddo
ao_eplf_integral_numeric = 0.
do q=1,ao_prim_num(j)
do p=1,ao_prim_num(i)
ao_eplf_integral_numeric = ao_eplf_integral_numeric + integral(p,q)
ao_eplf_integral_numeric = ao_eplf_integral_numeric + integral*ao_coef(p,i)*ao_coef(q,j)
enddo
enddo
@ -277,7 +267,7 @@ double precision function ao_eplf_integral(i,j,gmma,center)
implicit none
integer, intent(in) :: i, j
integer :: p,q,k
double precision :: integral(ao_prim_num_max,ao_prim_num_max)
double precision :: integral
double precision :: ao_eplf_integral_primitive_oneD
real :: gmma, center(3)
@ -286,10 +276,11 @@ double precision function ao_eplf_integral(i,j,gmma,center)
ASSERT(i<=ao_num)
ASSERT(j<=ao_num)
ao_eplf_integral = 0.
do q=1,ao_prim_num(j)
do p=1,ao_prim_num(i)
integral(p,q) = &
ao_eplf_integral_primitive_oneD( &
integral = &
ao_eplf_integral_primitive_oneD( &
ao_expo(p,i), &
nucl_coord(ao_nucl(i),1), &
ao_power(i,1), &
@ -298,7 +289,7 @@ double precision function ao_eplf_integral(i,j,gmma,center)
ao_power(j,1), &
gmma, &
center(1)) * &
ao_eplf_integral_primitive_oneD( &
ao_eplf_integral_primitive_oneD( &
ao_expo(p,i), &
nucl_coord(ao_nucl(i),2), &
ao_power(i,2), &
@ -307,7 +298,7 @@ double precision function ao_eplf_integral(i,j,gmma,center)
ao_power(j,2), &
gmma, &
center(2)) * &
ao_eplf_integral_primitive_oneD( &
ao_eplf_integral_primitive_oneD( &
ao_expo(p,i), &
nucl_coord(ao_nucl(i),3), &
ao_power(i,3), &
@ -316,19 +307,7 @@ double precision function ao_eplf_integral(i,j,gmma,center)
ao_power(j,3), &
gmma, &
center(3))
enddo
enddo
do q=1,ao_prim_num(j)
do p=1,ao_prim_num(i)
integral(p,q) = integral(p,q)*ao_coef(p,i)*ao_coef(q,j)
enddo
enddo
ao_eplf_integral = 0.
do q=1,ao_prim_num(j)
do p=1,ao_prim_num(i)
ao_eplf_integral = ao_eplf_integral + integral(p,q)
ao_eplf_integral = ao_eplf_integral + integral*ao_coef(p,i)*ao_coef(q,j)
enddo
enddo

View File

@ -28,6 +28,26 @@ BEGIN_PROVIDER [ integer, mo_active_num ]
END_PROVIDER
BEGIN_PROVIDER [ real, mo_occ, (mo_num) ]
implicit none
BEGIN_DOC
! Occupation numbers of molecular orbitals
END_DOC
double precision, allocatable :: buffer(:)
allocate ( buffer(mo_tot_num) )
!$OMP CRITICAL (qcio_critical)
call qcio_get_mo_occupation(buffer)
!$OMP END CRITICAL (qcio_critical)
integer :: i
do i=1,mo_num
mo_occ(i) = buffer(i)
enddo
deallocate(buffer)
END_PROVIDER
BEGIN_PROVIDER [ integer, mo_num ]
implicit none
@ -40,15 +60,6 @@ BEGIN_PROVIDER [ integer, mo_num ]
END_PROVIDER
BEGIN_PROVIDER [ integer, mo_occ_num ]
implicit none
BEGIN_DOC
! Number of occupied molecular orbitals
END_DOC
mo_occ_num = mo_closed_num + mo_active_num
END_PROVIDER
BEGIN_PROVIDER [ real, mo_coef, (ao_num,mo_num) ]
implicit none
@ -57,7 +68,8 @@ BEGIN_PROVIDER [ real, mo_coef, (ao_num,mo_num) ]
END_DOC
integer :: i, j
double precision :: buffer(ao_num,mo_tot_num)
double precision, allocatable :: buffer(:,:)
allocate (buffer(ao_num,mo_tot_num))
!$OMP CRITICAL (qcio_critical)
call qcio_get_mo_matrix(buffer)
@ -67,6 +79,7 @@ BEGIN_PROVIDER [ real, mo_coef, (ao_num,mo_num) ]
mo_coef(i,j) = buffer(i,j)
enddo
enddo
deallocate (buffer)
END_PROVIDER
@ -113,7 +126,11 @@ BEGIN_PROVIDER [ logical, mo_is_closed, (mo_num) ]
! mo_is_active : True if mo(i) is an active orbital
END_DOC
character :: buffer(mo_tot_num)
character, allocatable :: buffer(:)
allocate (buffer(mo_num))
!$OMP CRITICAL (qcio_critical)
call qcio_get_mo_classif(buffer)
!$OMP END CRITICAL
integer :: i
do i=1,mo_num
@ -128,6 +145,7 @@ BEGIN_PROVIDER [ logical, mo_is_closed, (mo_num) ]
mo_is_active(i) = .False.
endif
enddo
deallocate (buffer)
END_PROVIDER
BEGIN_PROVIDER [ integer, mo_tot_num ]

View File

@ -19,7 +19,8 @@ BEGIN_PROVIDER [ real, nucl_charge, (nucl_num) ]
! Nuclear charge
END_DOC
double precision :: buffer(nucl_num)
double precision,allocatable :: buffer(:)
allocate(buffer(nucl_num))
!$OMP CRITICAL (qcio_critical)
call qcio_get_geometry_charge(buffer)
!$OMP END CRITICAL (qcio_critical)
@ -28,6 +29,7 @@ BEGIN_PROVIDER [ real, nucl_charge, (nucl_num) ]
do i=1,nucl_num
nucl_charge(i) = buffer(i)
enddo
deallocate(buffer)
END_PROVIDER
BEGIN_PROVIDER [ real, nucl_coord, (nucl_num,3) ]
@ -36,7 +38,8 @@ BEGIN_PROVIDER [ real, nucl_coord, (nucl_num,3) ]
BEGIN_DOC
! Nuclear coordinates
END_DOC
double precision :: buffer(3,nucl_num)
double precision, allocatable :: buffer(:,:)
allocate (buffer(3,nucl_num))
!$OMP CRITICAL (qcio_critical)
call qcio_get_geometry_coord(buffer)
@ -48,6 +51,7 @@ BEGIN_PROVIDER [ real, nucl_coord, (nucl_num,3) ]
nucl_coord(j,i) = buffer(i,j)
enddo
enddo
deallocate(buffer)
END_PROVIDER

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1 +1 @@
T
F

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1 +1 @@
0.539373520750000E+11
0.549308735950000E+11

Binary file not shown.

View File

@ -1 +1 @@
Langevin
Langevin

View File

@ -1 +1 @@
0.596046447753906E+00
2.000000000000000E-01

Binary file not shown.

View File

@ -1 +1 @@
10
10

Binary file not shown.