Commit 073b29a3 authored by Matthias Redies's avatar Matthias Redies

make hybrid code more searchable: remove space after alloc

parent b675c636
......@@ -22,27 +22,27 @@ CONTAINS
CALL intgrf_init(atoms%ntype, atoms%jmtd, atoms%jri, atoms%dx, atoms%rmsh, hybdat%gridf)
!Alloc variables
ALLOCATE (hybdat%lmaxc(atoms%ntype), source=0)
ALLOCATE (hybdat%bas1(atoms%jmtd, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype), source=0.0)
ALLOCATE (hybdat%bas2(atoms%jmtd, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype), source=0.0)
ALLOCATE (hybdat%bas1_MT(hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype), source=0.0)
ALLOCATE (hybdat%drbas1_MT(hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype), source=0.0)
allocate(hybdat%lmaxc(atoms%ntype), source=0)
allocate(hybdat%bas1(atoms%jmtd, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype), source=0.0)
allocate(hybdat%bas2(atoms%jmtd, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype), source=0.0)
allocate(hybdat%bas1_MT(hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype), source=0.0)
allocate(hybdat%drbas1_MT(hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype), source=0.0)
! preparations for core states
CALL core_init(dimension, input, atoms, hybdat%lmaxcd, hybdat%maxindxc)
ALLOCATE (hybdat%nindxc(0:hybdat%lmaxcd, atoms%ntype), stat=ok, source=0)
allocate(hybdat%nindxc(0:hybdat%lmaxcd, atoms%ntype), stat=ok, source=0)
IF (ok /= 0) call judft_error('eigen_hf: failure allocation hybdat%nindxc')
ALLOCATE (hybdat%core1(atoms%jmtd, hybdat%maxindxc, 0:hybdat%lmaxcd, atoms%ntype), stat=ok, source=0.0)
allocate(hybdat%core1(atoms%jmtd, hybdat%maxindxc, 0:hybdat%lmaxcd, atoms%ntype), stat=ok, source=0.0)
IF (ok /= 0) call judft_error('eigen_hf: failure allocation core1')
ALLOCATE (hybdat%core2(atoms%jmtd, hybdat%maxindxc, 0:hybdat%lmaxcd, atoms%ntype), stat=ok, source=0.0)
allocate(hybdat%core2(atoms%jmtd, hybdat%maxindxc, 0:hybdat%lmaxcd, atoms%ntype), stat=ok, source=0.0)
IF (ok /= 0) call judft_error('eigen_hf: failure allocation core2')
ALLOCATE (hybdat%eig_c(hybdat%maxindxc, 0:hybdat%lmaxcd, atoms%ntype), stat=ok, source=0.0)
allocate(hybdat%eig_c(hybdat%maxindxc, 0:hybdat%lmaxcd, atoms%ntype), stat=ok, source=0.0)
IF (ok /= 0) call judft_error('eigen_hf: failure allocation hybdat%eig_c')
! pre-calculate gaunt coefficients
hybdat%maxfac = max(2*atoms%lmaxd + hybrid%maxlcutm1 + 1, 2*hybdat%lmaxcd + 2*atoms%lmaxd + 1)
ALLOCATE (hybdat%fac(0:hybdat%maxfac), hybdat%sfac(0:hybdat%maxfac), stat=ok, source=0.0)
allocate(hybdat%fac(0:hybdat%maxfac), hybdat%sfac(0:hybdat%maxfac), stat=ok, source=0.0)
IF (ok /= 0) call judft_error('eigen_hf: failure allocation fac,hybdat%sfac')
hybdat%fac(0) = 1
hybdat%sfac(0) = 1
......
......@@ -68,7 +68,7 @@
& 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'/)
LOGICAL :: l_mism = .true.
ALLOCATE (z(nkpti))
allocate(z(nkpti))
DO ikpt = 1, nkpti
CALL lapw%init(input, noco, kpts, atoms, sym, ikpt, cell, sym%zrfs)
nbasfcn = MERGE(lapw%nv(1) + lapw%nv(2) + 2*atoms%nlotot, lapw%nv(1) + atoms%nlotot, noco%l_noco)
......@@ -107,7 +107,7 @@
END DO
IF (mpi%irank == 0) WRITE (6, '(/A)') ' Overlap <core|basis>'
ALLOCATE (olapcb(hybrid%maxindx), olapcv(maxval(hybrid%nbands), nkpti),&
allocate(olapcb(hybrid%maxindx), olapcv(maxval(hybrid%nbands), nkpti),&
& olapcv_avg(-hybdat%lmaxcd:hybdat%lmaxcd, hybdat%maxindxc, 0:hybdat%lmaxcd, atoms%ntype),&
& olapcv_max(-hybdat%lmaxcd:hybdat%lmaxcd, hybdat%maxindxc, 0:hybdat%lmaxcd, atoms%ntype),&
& olapcv_loc(2, -hybdat%lmaxcd:hybdat%lmaxcd, hybdat%maxindxc, 0:hybdat%lmaxcd, atoms%ntype))
......@@ -186,7 +186,7 @@
END DO
END IF ! mpi%irank == 0
DEALLOCATE (olapcb, olapcv, olapcv_avg, olapcv_max, olapcv_loc)
deallocate(olapcb, olapcv, olapcv_avg, olapcv_max, olapcv_loc)
IF (mpi%irank == 0) WRITE (6, '(/A)') ' Overlap <basis|basis>'
......@@ -221,9 +221,9 @@
IF (mpi%irank == 0) WRITE (6, '(/A)') &
& 'Mismatch of wave functions at the MT-sphere boundaries'
ALLOCATE (carr1(maxval(hybrid%nbands), (atoms%lmaxd + 1)**2))
ALLOCATE (carr2(maxval(hybrid%nbands), (atoms%lmaxd + 1)**2))
ALLOCATE (carr3(maxval(hybrid%nbands), (atoms%lmaxd + 1)**2))
allocate(carr1(maxval(hybrid%nbands), (atoms%lmaxd + 1)**2))
allocate(carr2(maxval(hybrid%nbands), (atoms%lmaxd + 1)**2))
allocate(carr3(maxval(hybrid%nbands), (atoms%lmaxd + 1)**2))
DO ikpt = 1, nkpti
call read_z(z(ikpt), ikpt)
END DO
......
This diff is collapsed.
......@@ -79,7 +79,7 @@ CONTAINS
! read in mt wavefunction coefficients from file cmt
CALL read_cmt(cmt, nk)
ALLOCATE (fprod(atoms%jmtd, 5), larr(5), parr(5))
allocate(fprod(atoms%jmtd, 5), larr(5), parr(5))
! generate ldum(nbands(nk),nbands(nk)), which is true if the corresponding matrix entry is non-zero
ic1 = 0
......@@ -128,14 +128,14 @@ CONTAINS
n = n + 1
M = SIZE(fprod, 2)
IF (n > M) THEN
ALLOCATE (fprod2(atoms%jmtd, M), larr2(M), parr2(M))
allocate(fprod2(atoms%jmtd, M), larr2(M), parr2(M))
fprod2 = fprod; larr2 = larr; parr2 = parr
DEALLOCATE (fprod, larr, parr)
ALLOCATE (fprod(atoms%jmtd, M + 5), larr(M + 5), parr(M + 5))
deallocate(fprod, larr, parr)
allocate(fprod(atoms%jmtd, M + 5), larr(M + 5), parr(M + 5))
fprod(:, :M) = fprod2
larr(:M) = larr2
parr(:M) = parr2
DEALLOCATE (fprod2, larr2, parr2)
deallocate(fprod2, larr2, parr2)
END IF
fprod(:atoms%jri(itype), n) = (hybdat%core1(:atoms%jri(itype), p1, l1, itype)*hybdat%bas1(:atoms%jri(itype), p2, l2, itype) &
+ hybdat%core2(:atoms%jri(itype), p1, l1, itype)*hybdat%bas2(:atoms%jri(itype), p2, l2, itype))/atoms%rmsh(:atoms%jri(itype), itype)
......@@ -146,7 +146,7 @@ CONTAINS
! Evaluate radial integrals (special part of Coulomb matrix : contribution from single MT)
ALLOCATE (integral(n, n), carr(n, hybrid%nbands(nk)), carr2(n, lapw%nv(jsp)), carr3(n, lapw%nv(jsp)))
allocate(integral(n, n), carr(n, hybrid%nbands(nk)), carr2(n, lapw%nv(jsp)), carr3(n, lapw%nv(jsp)))
DO i = 1, n
CALL primitivef(primf1, fprod(:, i)*atoms%rmsh(:, itype)**(l + 1), atoms%rmsh, atoms%dx, atoms%jri, atoms%jmtd, itype, atoms%ntype)
......@@ -190,7 +190,7 @@ CONTAINS
END DO
END DO
DEALLOCATE (integral, carr, carr2, carr3)
deallocate(integral, carr, carr2, carr3)
END DO
END DO
......@@ -292,7 +292,7 @@ CONTAINS
CALL read_cmt(cmt, nk)
ALLOCATE (fprod(atoms%jmtd, 5), larr(5), parr(5))
allocate(fprod(atoms%jmtd, 5), larr(5), parr(5))
exchange = 0
iatom = 0
......@@ -315,14 +315,14 @@ CONTAINS
n = n + 1
M = SIZE(fprod, 2)
IF (n > M) THEN
ALLOCATE (fprod2(atoms%jmtd, M), larr2(M), parr2(M))
allocate(fprod2(atoms%jmtd, M), larr2(M), parr2(M))
fprod2 = fprod; larr2 = larr; parr2 = parr
DEALLOCATE (fprod, larr, parr)
ALLOCATE (fprod(atoms%jmtd, M + 5), larr(M + 5), parr(M + 5))
deallocate(fprod, larr, parr)
allocate(fprod(atoms%jmtd, M + 5), larr(M + 5), parr(M + 5))
fprod(:, :M) = fprod2
larr(:M) = larr2
parr(:M) = parr2
DEALLOCATE (fprod2, larr2, parr2)
deallocate(fprod2, larr2, parr2)
END IF
fprod(:atoms%jri(itype), n) = (hybdat%core1(:atoms%jri(itype), p1, l1, itype)*hybdat%bas1(:atoms%jri(itype), p2, l2, itype) &
+ hybdat%core2(:atoms%jri(itype), p1, l1, itype)*hybdat%bas2(:atoms%jri(itype), p2, l2, itype))/atoms%rmsh(:atoms%jri(itype), itype)
......@@ -333,7 +333,7 @@ CONTAINS
! Evaluate radial integrals (special part of Coulomb matrix : contribution from single MT)
ALLOCATE (integral(n, n), carr(n, hybrid%nbands(nk)), carr2(n, lapw%nv(jsp)), carr3(n, lapw%nv(jsp)))
allocate(integral(n, n), carr(n, hybrid%nbands(nk)), carr2(n, lapw%nv(jsp)), carr3(n, lapw%nv(jsp)))
DO i = 1, n
CALL primitivef(primf1, fprod(:atoms%jri(itype), i)*atoms%rmsh(:atoms%jri(itype), itype)**(l + 1), atoms%rmsh, atoms%dx, atoms%jri, atoms%jmtd, itype, atoms%ntype)
......@@ -376,7 +376,7 @@ CONTAINS
END DO
END DO
DEALLOCATE (integral, carr, carr2, carr3)
deallocate(integral, carr, carr2, carr3)
END DO
END DO
......
......@@ -176,23 +176,23 @@ CONTAINS
WRITE (6, '(A,A,i3,A,f7.2,A)') ' Divide the loop over the occupied hybrid%bands in packages', &
' of the size', psize, ' (cprod=', rdum*psize, 'MB)'
END IF
ALLOCATE (phase_vv(psize, hybrid%nbands(nk)), stat=ok)
allocate(phase_vv(psize, hybrid%nbands(nk)), stat=ok)
IF (ok /= 0) STOP 'exchange_val_hf: error allocation phase'
phase_vv = 0
IF (ok /= 0) STOP 'exchange_val_hf: error allocation phase'
if (mat_ex%l_real) THEN
ALLOCATE (cprod_vv_c(hybrid%maxbasm1, 0, 0), carr3_vv_c(hybrid%maxbasm1, 0, 0))
ALLOCATE (cprod_vv_r(hybrid%maxbasm1, psize, hybrid%nbands(nk)), stat=ok)
allocate(cprod_vv_c(hybrid%maxbasm1, 0, 0), carr3_vv_c(hybrid%maxbasm1, 0, 0))
allocate(cprod_vv_r(hybrid%maxbasm1, psize, hybrid%nbands(nk)), stat=ok)
IF (ok /= 0) STOP 'exchange_val_hf: error allocation cprod'
ALLOCATE (carr3_vv_r(hybrid%maxbasm1, psize, hybrid%nbands(nk)), stat=ok)
allocate(carr3_vv_r(hybrid%maxbasm1, psize, hybrid%nbands(nk)), stat=ok)
IF (ok /= 0) STOP 'exchange_val_hf: error allocation carr3'
cprod_vv_r = 0; carr3_vv_r = 0
ELSE
ALLOCATE (cprod_vv_r(hybrid%maxbasm1, 0, 0), carr3_vv_r(hybrid%maxbasm1, 0, 0))
ALLOCATE (cprod_vv_c(hybrid%maxbasm1, psize, hybrid%nbands(nk)), stat=ok)
allocate(cprod_vv_r(hybrid%maxbasm1, 0, 0), carr3_vv_r(hybrid%maxbasm1, 0, 0))
allocate(cprod_vv_c(hybrid%maxbasm1, psize, hybrid%nbands(nk)), stat=ok)
IF (ok /= 0) STOP 'exchange_val_hf: error allocation cprod'
ALLOCATE (carr3_vv_c(hybrid%maxbasm1, psize, hybrid%nbands(nk)), stat=ok)
allocate(carr3_vv_c(hybrid%maxbasm1, psize, hybrid%nbands(nk)), stat=ok)
IF (ok /= 0) STOP 'exchange_val_hf: error allocation carr3'
cprod_vv_c = 0; carr3_vv_c = 0
END IF
......
......@@ -105,7 +105,7 @@ CONTAINS
! set spherical component of the potential from the previous iteration vr
vr = vr0
! ALLOCATE ( z_out(nbasfcn,neigd,nkpti),stat=ok )
! allocate( z_out(nbasfcn,neigd,nkpti),stat=ok )
! IF ( ok .ne. 0) STOP 'gen_wavf: failure allocation z'
! z_out = 0
! z_out(:,:,:nkpti) = z_in
......@@ -115,7 +115,7 @@ CONTAINS
! bas1 denotes the large component
! bas2 " " small component
ALLOCATE (f(atoms%jmtd, 2, 0:atoms%lmaxd), &
allocate(f(atoms%jmtd, 2, 0:atoms%lmaxd), &
df(atoms%jmtd, 2, 0:atoms%lmaxd), &
source=0.0)
......@@ -154,7 +154,7 @@ CONTAINS
END DO
END IF
END DO
DEALLOCATE (f, df)
deallocate(f, df)
#if CPP_DEBUG
! consistency check
......@@ -170,15 +170,15 @@ CONTAINS
! (acof,bcof,ccof) and APW-basis coefficients
! (a,b,bascofold_lo) at irred. kpoints
ALLOCATE (acof(dimension%neigd, 0:dimension%lmd, atoms%nat), stat=ok)
allocate(acof(dimension%neigd, 0:dimension%lmd, atoms%nat), stat=ok)
IF (ok /= 0) call judft_error('gen_wavf: failure allocation acof')
ALLOCATE (bcof(dimension%neigd, 0:dimension%lmd, atoms%nat), stat=ok)
allocate(bcof(dimension%neigd, 0:dimension%lmd, atoms%nat), stat=ok)
IF (ok /= 0) call judft_error('gen_wavf: failure allocation bcof')
ALLOCATE (ccof(-atoms%llod:atoms%llod, dimension%neigd, atoms%nlod, atoms%nat), stat=ok)
allocate(ccof(-atoms%llod:atoms%llod, dimension%neigd, atoms%nlod, atoms%nat), stat=ok)
IF (ok /= 0) call judft_error('gen_wavf: failure allocation ccof')
ALLOCATE (cmt(dimension%neigd, hybrid%maxlmindx, atoms%nat), stat=ok)
allocate(cmt(dimension%neigd, hybrid%maxlmindx, atoms%nat), stat=ok)
IF (ok /= 0) call judft_error('gen_wavf: Failure allocation cmt')
ALLOCATE (cmthlp(dimension%neigd, hybrid%maxlmindx, atoms%nat), stat=ok)
allocate(cmthlp(dimension%neigd, hybrid%maxlmindx, atoms%nat), stat=ok)
IF (ok /= 0) call judft_error('gen_wavf: failure allocation cmthlp')
DO ikpt0 = 1, nkpti
......@@ -270,8 +270,8 @@ CONTAINS
END DO !ikpt
END DO !ikpt0
DEALLOCATE (acof, bcof, ccof)
DEALLOCATE (cmt, cmthlp)
deallocate(acof, bcof, ccof)
deallocate(cmt, cmthlp)
END SUBROUTINE gen_wavf
END MODULE m_gen_wavf
......@@ -59,11 +59,11 @@ CONTAINS
! Preparations for HF and hybrid functional calculation
CALL timestart("gen_bz and gen_wavf")
ALLOCATE (zmat(kpts%nkptf), stat=ok)
allocate(zmat(kpts%nkptf), stat=ok)
IF (ok /= 0) call judft_error('eigen_hf: failure allocation z_c')
ALLOCATE (eig_irr(DIMENSION%neigd2, kpts%nkpt), stat=ok)
allocate(eig_irr(DIMENSION%neigd2, kpts%nkpt), stat=ok)
IF (ok /= 0) call judft_error('eigen_hf: failure allocation eig_irr')
ALLOCATE (hybdat%kveclo_eig(atoms%nlotot, kpts%nkpt), stat=ok)
allocate(hybdat%kveclo_eig(atoms%nlotot, kpts%nkpt), stat=ok)
IF (ok /= 0) call judft_error('eigen_hf: failure allocation hybdat%kveclo_eig')
eig_irr = 0
hybdat%kveclo_eig = 0
......@@ -163,7 +163,7 @@ CONTAINS
! set up pointer pntgpt
! setup dimension of pntgpt
ALLOCATE (hybdat%pntgptd(3))
allocate(hybdat%pntgptd(3))
hybdat%pntgptd = 0
DO nk = 1, kpts%nkptf
CALL lapw%init(input, noco, kpts, atoms, sym, nk, cell, sym%zrfs)
......@@ -172,7 +172,7 @@ CONTAINS
end do
END DO
ALLOCATE (hybdat%pntgpt(-hybdat%pntgptd(1):hybdat%pntgptd(1), -hybdat%pntgptd(2):hybdat%pntgptd(2), &
allocate(hybdat%pntgpt(-hybdat%pntgptd(1):hybdat%pntgptd(1), -hybdat%pntgptd(2):hybdat%pntgptd(2), &
-hybdat%pntgptd(3):hybdat%pntgptd(3), kpts%nkptf), stat=ok)
IF (ok /= 0) call judft_error('eigen_hf: failure allocation pntgpt')
hybdat%pntgpt = 0
......@@ -183,16 +183,16 @@ CONTAINS
END DO
END DO
ALLOCATE (basprod(atoms%jmtd), stat=ok)
allocate(basprod(atoms%jmtd), stat=ok)
IF (ok /= 0) call judft_error('eigen_hf: failure allocation basprod')
ALLOCATE (hybdat%prodm(hybrid%maxindxm1, hybrid%maxindxp1, 0:hybrid%maxlcutm1, atoms%ntype), stat=ok)
allocate(hybdat%prodm(hybrid%maxindxm1, hybrid%maxindxp1, 0:hybrid%maxlcutm1, atoms%ntype), stat=ok)
IF (ok /= 0) call judft_error('eigen_hf: failure allocation hybdat%prodm')
call hybdat%prod%init(hybrid, atoms)
basprod = 0; hybdat%prodm = 0; hybdat%prod%l1 = 0; hybdat%prod%l2 = 0
hybdat%prod%n1 = 0; hybdat%prod%n2 = 0
ALLOCATE (hybdat%nindxp1(0:hybrid%maxlcutm1, atoms%ntype))
allocate(hybdat%nindxp1(0:hybrid%maxlcutm1, atoms%ntype))
hybdat%nindxp1 = 0
DO itype = 1, atoms%ntype
ng = atoms%jri(itype)
......@@ -228,7 +228,7 @@ CONTAINS
END DO
END DO
END DO
DEALLOCATE (basprod)
deallocate(basprod)
CALL timestop("gen_bz and gen_wavf")
ELSE IF (hybrid%l_hybrid) THEN ! hybrid%l_calhf is false
......
......@@ -1199,7 +1199,7 @@ CONTAINS
potential = -pi_omega2
endwhere
DEALLOCATE (gridf)
deallocate(gridf)
#else
call judft_error("hsefunctional not implemented for PGI")
#endif
......@@ -1373,7 +1373,7 @@ CONTAINS
! allocate arrays in first entry reuse later
IF (first_entry) THEN
ALLOCATE (already_known(nkptf), & ! stores which elements are known
allocate(already_known(nkptf), & ! stores which elements are known
known_potential(maxNoGPts, nkptf), & ! stores the potential for all k-points
known_fourier_trafo(nbasp, maxNoGPts, nkptf)) ! stores the fourier transform of the mixed basis
! initialization
......@@ -1525,7 +1525,7 @@ CONTAINS
potential = -pi_omega2
endwhere
DEALLOCATE (gridf)
deallocate(gridf)
!
! Create pointer which correlate the position in the array with the
......@@ -1695,7 +1695,7 @@ CONTAINS
! Create pointer which correlate the position in the array with the
! appropriate indices of the MT mixed basis function
!
ALLOCATE (ptrType(nbasp), ptrEq(nbasp), ptrL(nbasp), ptrM(nbasp), ptrN(nbasp))
allocate(ptrType(nbasp), ptrEq(nbasp), ptrL(nbasp), ptrM(nbasp), ptrN(nbasp))
nbasp = 0
DO itype = 1, ntype
DO ieq = 1, neq(itype)
......@@ -1740,7 +1740,7 @@ CONTAINS
interstitial = CONJG(interstitial)
! Helper matrix for temporary storage of the attenuated Coulomb matrix
ALLOCATE (coulmat(nbasm(ikpt), nbasm(ikpt)), stat=ok)
allocate(coulmat(nbasm(ikpt), nbasm(ikpt)), stat=ok)
IF (ok /= 0) call juDFT_error( 'hsefunctional: failure at matrix allocation')
coulmat = 0
!
......@@ -1781,11 +1781,11 @@ CONTAINS
#endif
! add the changes to the Coulomb matrix
coulomb(:nbasm(ikpt)*(nbasm(ikpt) + 1)/2, ikpt) = packmat(coulmat) + coulomb(:nbasm(ikpt)*(nbasm(ikpt) + 1)/2, ikpt)
DEALLOCATE (coulmat)
deallocate(coulmat)
END DO
DEALLOCATE (ptrType, ptrEq, ptrL, ptrM, ptrN)
deallocate(ptrType, ptrEq, ptrL, ptrM, ptrN)
END SUBROUTINE change_coulombmatrix
......@@ -2206,7 +2206,7 @@ CONTAINS
READ (777, rec=nk) cmt(:, :, :)
CLOSE (777)
ALLOCATE (fprod(jmtd, 5), larr(5), parr(5))
allocate(fprod(jmtd, 5), larr(5), parr(5))
exchange = 0
iatom = 0
......@@ -2231,14 +2231,14 @@ CONTAINS
n = n + 1
m = SIZE(fprod, 2)
IF (n > m) THEN
ALLOCATE (fprod2(jmtd, m), larr2(m), parr2(m))
allocate(fprod2(jmtd, m), larr2(m), parr2(m))
fprod2 = fprod; larr2 = larr; parr2 = parr
DEALLOCATE (fprod, larr, parr)
ALLOCATE (fprod(jmtd, m + 5), larr(m + 5), parr(m + 5))
deallocate(fprod, larr, parr)
allocate(fprod(jmtd, m + 5), larr(m + 5), parr(m + 5))
fprod(:, :m) = fprod2
larr(:m) = larr2
parr(:m) = parr2
DEALLOCATE (fprod2, larr2, parr2)
deallocate(fprod2, larr2, parr2)
END IF
fprod(:, n) = (core1(:, p1, l1, itype) &
*bas1(:, p2, l2, itype) &
......@@ -2251,7 +2251,7 @@ CONTAINS
! Evaluate radial integrals (special part of Coulomb matrix : contribution from single MT)
ALLOCATE (integral(n, n), carr(n, nbands), &
allocate(integral(n, n), carr(n, nbands), &
carr2(n, nv(jsp)), carr3(n, nv(jsp)))
DO i = 1, n
......@@ -2313,7 +2313,7 @@ CONTAINS
END DO
END DO
DEALLOCATE (integral, carr, carr2, carr3)
deallocate(integral, carr, carr2, carr3)
END DO
END DO
......
......@@ -143,7 +143,7 @@ CONTAINS
IF (nk == 1 .and. jsp == 1 .and. input%imix > 10) CALL system('rm -f broyd*')
! calculate all symmetrie operations, which yield k invariant
ALLOCATE (parent(kpts%nkptf), stat=ok)
allocate(parent(kpts%nkptf), stat=ok)
IF (ok /= 0) STOP 'mhsfock: failure allocation parent'
parent = 0
......@@ -179,7 +179,7 @@ CONTAINS
CALL exchange_cccc(nk, atoms, hybdat, ncstd, sym, kpts, a_ex, mpi, results)
END IF
DEALLOCATE (n_q)
deallocate(n_q)
CALL timestop("core exchange calculation")
CALL timestart("time for performing T^-1*mat_ex*T^-1*")
......
......@@ -37,10 +37,10 @@ CONTAINS
PRINT *, "calculate wigner-matrix"
STOP "WIGNER MATRIX should be available in hybrid part"
!IF (.NOT.oneD%odi%d1) THEN
! ALLOCATE (sym%d_wgn(-atoms%lmaxd:atoms%lmaxd,-atoms%lmaxd:atoms%lmaxd,atoms%lmaxd,sym%nop))
! allocate(sym%d_wgn(-atoms%lmaxd:atoms%lmaxd,-atoms%lmaxd:atoms%lmaxd,atoms%lmaxd,sym%nop))
! CALL d_wigner(sym%nop,sym%mrot,cell%bmat,atoms%lmaxd,sym%d_wgn)
!ELSE
! ALLOCATE (sym%d_wgn(-atoms%lmaxd:atoms%lmaxd,-atoms%lmaxd:atoms%lmaxd,atoms%lmaxd,oneD%ods%nop))
! allocate(sym%d_wgn(-atoms%lmaxd:atoms%lmaxd,-atoms%lmaxd:atoms%lmaxd,atoms%lmaxd,oneD%ods%nop))
! CALL d_wigner(oneD%ods%nop,oneD%ods%mrot,cell%bmat,atoms%lmaxd,sym%d_wgn)
!ENDIF
ENDIF
......
......@@ -81,14 +81,14 @@ CONTAINS
!In first iteration allocate some memory
IF (init_vex) THEN
ALLOCATE (hybrid%ne_eig(kpts%nkpt), hybrid%nbands(kpts%nkpt), hybrid%nobd(kpts%nkptf), source=0)
ALLOCATE (hybrid%nbasm(kpts%nkptf), source=0)
ALLOCATE (hybrid%div_vv(DIMENSION%neigd, kpts%nkpt, input%jspins), source=0.0)
allocate(hybrid%ne_eig(kpts%nkpt), hybrid%nbands(kpts%nkpt), hybrid%nobd(kpts%nkptf), source=0)
allocate(hybrid%nbasm(kpts%nkptf), source=0)
allocate(hybrid%div_vv(DIMENSION%neigd, kpts%nkpt, input%jspins), source=0.0)
init_vex = .FALSE.
END IF
hybrid%l_subvxc = (hybrid%l_subvxc .AND. hybrid%l_addhf)
IF (.NOT. ALLOCATED(results%w_iks)) ALLOCATE (results%w_iks(DIMENSION%neigd2, kpts%nkpt, input%jspins))
IF (.NOT. ALLOCATED(results%w_iks)) allocate(results%w_iks(DIMENSION%neigd2, kpts%nkpt, input%jspins))
IF (hybrid%l_calhf) THEN
iterHF = iterHF + 1
......
......@@ -42,7 +42,7 @@ CONTAINS
REAL, ALLOCATABLE :: eig_cr(:, :, :)
ncstd = maxval(atoms%ncst)
ALLOCATE (nindxcr(0:ncstd, atoms%ntype), stat=ok)
allocate(nindxcr(0:ncstd, atoms%ntype), stat=ok)
! generate relativistic core wave functions( ->core1r,core2r )
CALL calcorewf(dimension, input, jsp, atoms,&
......@@ -114,7 +114,7 @@ CONTAINS
END DO
END DO
DEALLOCATE (nindxcr, core1r, core2r, eig_cr)
deallocate(nindxcr, core1r, core2r, eig_cr)
IF (maxindxc /= maxval(nindxc))&
& STOP 'corewf: counting error nindxc'
......@@ -166,7 +166,7 @@ CONTAINS
c = c_light(1.0)
IF (first) THEN
ALLOCATE (vr0(atoms%jmtd, atoms%ntype, input%jspins))
allocate(vr0(atoms%jmtd, atoms%ntype, input%jspins))
END IF
IF (input%frcor) THEN
......@@ -218,9 +218,9 @@ CONTAINS
END DO
ALLOCATE (core1(atoms%jmtd, 0:maxval(lmaxc), maxval(nindxcr), atoms%ntype))
ALLOCATE (core2(atoms%jmtd, 0:maxval(lmaxc), maxval(nindxcr), atoms%ntype))
ALLOCATE (eig_c(0:maxval(lmaxc), maxval(nindxcr), atoms%ntype))
allocate(core1(atoms%jmtd, 0:maxval(lmaxc), maxval(nindxcr), atoms%ntype))
allocate(core2(atoms%jmtd, 0:maxval(lmaxc), maxval(nindxcr), atoms%ntype))
allocate(eig_c(0:maxval(lmaxc), maxval(nindxcr), atoms%ntype))
core1 = 0; core2 = 0
nindxcr = 0
......
......@@ -144,7 +144,7 @@ CONTAINS
END DO
! calculate lo wavefunction coefficients
ALLOCATE (cmt_lo(dimension%neigd, -atoms%llod:atoms%llod, atoms%nlod, atoms%nat))
allocate(cmt_lo(dimension%neigd, -atoms%llod:atoms%llod, atoms%nlod, atoms%nat))
cmt_lo = 0
iatom = 0
ic = 0
......@@ -221,7 +221,7 @@ CONTAINS
END DO
idum = maxval(lmp_start)
ALLOCATE (cmt_apw(dimension%neigd, idum, atoms%nat))
allocate(cmt_apw(dimension%neigd, idum, atoms%nat))
cmt_apw = 0
DO i = 1, lapw%nv(jsp)
kvec = kpts%bk(:, nk) + lapw%gvec(:, i, jsp)
......@@ -285,9 +285,9 @@ CONTAINS
! construct radial functions (complex) for the first order
! incomplete basis set correction
ALLOCATE (u1(atoms%jmtd, 3, mnobd, (atoms%lmaxd + 1)**2, atoms%nat), stat=ok)!hybrid%nbands
allocate(u1(atoms%jmtd, 3, mnobd, (atoms%lmaxd + 1)**2, atoms%nat), stat=ok)!hybrid%nbands
IF (ok /= 0) STOP 'kp_perturbation: failure allocation u1'
ALLOCATE (u2(atoms%jmtd, 3, mnobd, (atoms%lmaxd + 1)**2, atoms%nat), stat=ok)!hybrid%nbands
allocate(u2(atoms%jmtd, 3, mnobd, (atoms%lmaxd + 1)**2, atoms%nat), stat=ok)!hybrid%nbands
IF (ok /= 0) STOP 'kp_perturbation: failure allocation u2'
u1 = 0; u2 = 0
......
......@@ -110,13 +110,13 @@ CONTAINS
IF (xcpot%is_name("exx")) CALL judft_error("EXX is not implemented in this version", calledby='mixedbasis')
! Deallocate arrays which might have been allocated in a previous run of this subroutine
IF (ALLOCATED(hybrid%ngptm)) DEALLOCATE (hybrid%ngptm)
IF (ALLOCATED(hybrid%ngptm1)) DEALLOCATE (hybrid%ngptm1)
IF (ALLOCATED(hybrid%nindxm1)) DEALLOCATE (hybrid%nindxm1)
IF (ALLOCATED(hybrid%pgptm)) DEALLOCATE (hybrid%pgptm)
IF (ALLOCATED(hybrid%pgptm1)) DEALLOCATE (hybrid%pgptm1)
IF (ALLOCATED(hybrid%gptm)) DEALLOCATE (hybrid%gptm)
IF (ALLOCATED(hybrid%basm1)) DEALLOCATE (hybrid%basm1)
IF (ALLOCATED(hybrid%ngptm)) deallocate(hybrid%ngptm)
IF (ALLOCATED(hybrid%ngptm1)) deallocate(hybrid%ngptm1)
IF (ALLOCATED(hybrid%nindxm1)) deallocate(hybrid%nindxm1)
IF (ALLOCATED(hybrid%pgptm)) deallocate(hybrid%pgptm)
IF (ALLOCATED(hybrid%pgptm1)) deallocate(hybrid%pgptm1)
IF (ALLOCATED(hybrid%gptm)) deallocate(hybrid%gptm)
IF (ALLOCATED(hybrid%basm1)) deallocate(hybrid%basm1)
CALL usdus%init(atoms, input%jspins)
......@@ -131,7 +131,7 @@ CONTAINS
! initialize gridf for radial integration
CALL intgrf_init(atoms%ntype, atoms%jmtd, atoms%jri, atoms%dx, atoms%rmsh, gridf)
ALLOCATE (vr0(atoms%jmtd, atoms%ntype, input%jspins), source=0.0)
allocate(vr0(atoms%jmtd, atoms%ntype, input%jspins), source=0.0)
vr0(:, :, :) = v%mt(:, 0, :, :)
......@@ -139,10 +139,10 @@ CONTAINS
! the spherical part of the potential vr0 and store them in
! bas1 = large component ,bas2 = small component
ALLOCATE ( f(atoms%jmtd, 2, 0:atoms%lmaxd), &
allocate( f(atoms%jmtd, 2, 0:atoms%lmaxd), &
df(atoms%jmtd, 2, 0:atoms%lmaxd), source=0.0)
ALLOCATE (bas1(atoms%jmtd, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype, input%jspins), source=0.0)
ALLOCATE (bas2(atoms%jmtd, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype, input%jspins), source=0.0)
allocate(bas1(atoms%jmtd, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype, input%jspins), source=0.0)
allocate(bas2(atoms%jmtd, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype, input%jspins), source=0.0)
DO itype = 1, atoms%ntype
ng = atoms%jri(itype)
......@@ -171,7 +171,7 @@ CONTAINS
END DO
END DO
DEALLOCATE (f, df)
deallocate(f, df)
! the radial functions are normalized
DO ispin = 1, input%jspins
......@@ -191,7 +191,7 @@ CONTAINS
! construct G-vectors with cutoff smaller than gcutm
gcutm = hybrid%gcutm1
ALLOCATE (hybrid%ngptm(kpts%nkptf))
allocate(hybrid%ngptm(kpts%nkptf))
hybrid%ngptm = 0
i = 0
......@@ -236,8 +236,8 @@ CONTAINS
hybrid%gptmd = i
hybrid%maxgptm = MAXVAL(hybrid%ngptm)
ALLOCATE (hybrid%gptm(3, hybrid%gptmd))
ALLOCATE (hybrid%pgptm(hybrid%maxgptm, kpts%nkptf))