Superconducting Toolkit
リビジョン | e4be32914c7d23b7d13105100e309f5c6a7e884b (tree) |
---|---|
日時 | 2020-11-05 15:16:08 |
作者 | Mitsuaki Kawamura <kawamitsuaki@gmai...> |
コミッター | Mitsuaki Kawamura |
Merge remote-tracking branch 'remotes/qe-gitlab/develop' into develop
@@ -19,7 +19,7 @@ if(${qe_BINARY_DIR} STREQUAL ${qe_SOURCE_DIR}) | ||
19 | 19 | endif() |
20 | 20 | |
21 | 21 | # CMake < v3.18 cannot discover the ARM Performance Library |
22 | -if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") | |
22 | +if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*|arm64.*|ARM64.*)") | |
23 | 23 | if(CMAKE_VERSION VERSION_LESS 3.18.0) |
24 | 24 | message("-- CMake versions less then 3.18 cannot automatically discover the ARM Performance Library!") |
25 | 25 | endif() |
@@ -197,7 +197,36 @@ add_library(QE::LAPACK ALIAS qe_lapack) | ||
197 | 197 | qe_install_targets(qe_lapack) |
198 | 198 | ####################################################################### |
199 | 199 | if(NOT QE_LAPACK_INTERNAL) |
200 | - find_package(LAPACK) | |
200 | + if(NOT BLA_VENDOR) | |
201 | + if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64.*") | |
202 | + message(STATUS "Trying to find LAPACK from Intel MKL") | |
203 | + if(QE_ENABLE_OPENMP) | |
204 | + SET(BLA_VENDOR Intel10_64lp) | |
205 | + else() | |
206 | + SET(BLA_VENDOR Intel10_64lp_seq) | |
207 | + endif() | |
208 | + find_package(LAPACK) | |
209 | + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*") | |
210 | + message(STATUS "Trying to find LAPACK from Intel MKL - 32bit") | |
211 | + SET(BLA_VENDOR Intel10_32) | |
212 | + find_package(LAPACK) | |
213 | + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*|arm64.*|ARM64.*)") | |
214 | + message(STATUS "Trying to find LAPACK from ARM Performance Library") | |
215 | + if(QE_ENABLE_OPENMP) | |
216 | + SET(BLA_VENDOR Arm_mp) | |
217 | + else() | |
218 | + SET(BLA_VENDOR Arm) | |
219 | + endif() | |
220 | + find_package(LAPACK) | |
221 | + endif() | |
222 | + if(NOT LAPACK_FOUND) | |
223 | + message(STATUS "Trying to find alternative LAPACK libraries") | |
224 | + SET(BLA_VENDOR All) | |
225 | + find_package(LAPACK) | |
226 | + endif() | |
227 | + else() | |
228 | + find_package(LAPACK) | |
229 | + endif() | |
201 | 230 | if(LAPACK_FOUND) |
202 | 231 | list(APPEND _lapack_libs |
203 | 232 | ${BLAS_LIBRARIES} |
@@ -1099,7 +1099,9 @@ that runs on different machines, compile it on the oldest machine you have | ||
1099 | 1099 | |
1100 | 1100 | \paragraph{Linux PCs with gfortran} |
1101 | 1101 | |
1102 | -You need at least gfortran v.4.4 or later to properly compile \qe. | |
1102 | +Gfortran v.4.8.5, still often found on CentOS machines, no longer compiles | |
1103 | +\qe\ v.6.6 or later, due to a gfortran bug. You need at least gfortran v.4.9.X. | |
1104 | + | |
1103 | 1105 | |
1104 | 1106 | "There is a known incompatibility problem between different calling |
1105 | 1107 | convention for Fortran functions that return complex values [...] |
@@ -85,7 +85,8 @@ input_description -distribution {Quantum Espresso} -package PWscf -program hp.x | ||
85 | 85 | info { |
86 | 86 | If .true. determines the number of perturbations |
87 | 87 | (i.e. which atoms will be perturbed) and exits smoothly |
88 | - without performing any calculation. | |
88 | + without performing any calculation. For DFT+U+V, it also | |
89 | + determines the indices of inter-site couples. | |
89 | 90 | } |
90 | 91 | } |
91 | 92 |
@@ -214,10 +214,10 @@ PROGRAM hp_main | ||
214 | 214 | ! |
215 | 215 | ! Calculation of Hubbard U (serial post-processing) |
216 | 216 | ! |
217 | - IF (ionode) CALL hp_postproc() | |
218 | - ! | |
219 | 217 | 103 CONTINUE |
220 | 218 | ! |
219 | + IF (ionode) CALL hp_postproc() | |
220 | + ! | |
221 | 221 | ! Deallocate some arrays |
222 | 222 | ! |
223 | 223 | CALL hp_dealloc_2() |
@@ -26,7 +26,8 @@ SUBROUTINE hp_postproc | ||
26 | 26 | skip_type, equiv_type, skip_atom, & |
27 | 27 | tmp_dir_save, find_atpert, magn, & |
28 | 28 | nath_pert, ityp_new, ntyp_new, atm_new, & |
29 | - num_neigh, lmin, rmax, nq1, nq2, nq3 | |
29 | + num_neigh, lmin, rmax, nq1, nq2, nq3, & | |
30 | + determine_num_pert_only | |
30 | 31 | ! |
31 | 32 | IMPLICIT NONE |
32 | 33 | ! |
@@ -60,16 +61,26 @@ SUBROUTINE hp_postproc | ||
60 | 61 | ! |
61 | 62 | CHARACTER(len=256) :: filenameU |
62 | 63 | INTEGER, EXTERNAL :: find_free_unit |
64 | + LOGICAL :: determine_indices_only | |
63 | 65 | ! |
64 | 66 | CALL start_clock('hp_postproc') |
65 | 67 | ! |
66 | - WRITE( stdout, '(/5x,"Post-processing calculation of Hubbard parameters ...",/)') | |
68 | + IF (lda_plus_u_kind==2 .AND. determine_num_pert_only) THEN | |
69 | + ! DFT+U+V: determine indices of couples for Hubbard V, without computing U and V. | |
70 | + ! This is useful when DFT+U+V is used for large supercells. So one can determine | |
71 | + ! indices for a supercell and use V computed for a primitive cell. | |
72 | + determine_indices_only = .true. | |
73 | + WRITE( stdout, '(/5x,"Determination of the indices of inter-site couples ...",/)') | |
74 | + ELSE | |
75 | + determine_indices_only = .false. | |
76 | + WRITE( stdout, '(/5x,"Post-processing calculation of Hubbard parameters ...",/)') | |
77 | + ENDIF | |
67 | 78 | ! |
68 | 79 | ! Allocate various arrays |
69 | 80 | CALL alloc_pp() |
70 | 81 | ! |
71 | 82 | ! Read chi0 and chi from file |
72 | - CALL read_chi() | |
83 | + If (.NOT.determine_indices_only) CALL read_chi() | |
73 | 84 | ! |
74 | 85 | ! If we merge types of atoms (e.g. Ni_up and Ni_down) |
75 | 86 | ! then we have to keep track of their total magnetization |
@@ -85,6 +96,11 @@ SUBROUTINE hp_postproc | ||
85 | 96 | ! between virtual atoms |
86 | 97 | CALL atomic_dist() |
87 | 98 | ! |
99 | + IF (determine_indices_only) THEN | |
100 | + CALL write_intersite(.false.) | |
101 | + GO TO 15 | |
102 | + ENDIF | |
103 | + ! | |
88 | 104 | ! Average similar elements in chi0 and chi |
89 | 105 | CALL average_similar_elements(chi0) |
90 | 106 | CALL average_similar_elements(chi) |
@@ -104,6 +120,8 @@ SUBROUTINE hp_postproc | ||
104 | 120 | ! Calculate Hubbard parameters and write them to file |
105 | 121 | CALL calculate_Hubbard_parameters() |
106 | 122 | ! |
123 | +15 CONTINUE | |
124 | + ! | |
107 | 125 | ! Deallocate various arrays |
108 | 126 | CALL dealloc_pp() |
109 | 127 | ! |
@@ -145,6 +163,11 @@ SUBROUTINE alloc_pp | ||
145 | 163 | ALLOCATE ( inv_chi0bg(nath_scbg, nath_scbg) ) |
146 | 164 | ALLOCATE ( Hubbard_matrix(nath_scbg, nath_scbg) ) |
147 | 165 | ! |
166 | + ! Find and open unit to write info | |
167 | + iunitU = find_free_unit() | |
168 | + filenameU = trim(prefix) // ".Hubbard_parameters.dat" | |
169 | + OPEN(iunitU, file = filenameU, form = 'formatted', status = 'unknown') | |
170 | + ! | |
148 | 171 | RETURN |
149 | 172 | ! |
150 | 173 | END SUBROUTINE alloc_pp |
@@ -172,6 +195,8 @@ SUBROUTINE dealloc_pp | ||
172 | 195 | DEALLOCATE (inv_chi0bg) |
173 | 196 | DEALLOCATE (Hubbard_matrix) |
174 | 197 | ! |
198 | + CLOSE(iunitU) | |
199 | + ! | |
175 | 200 | RETURN |
176 | 201 | ! |
177 | 202 | END SUBROUTINE dealloc_pp |
@@ -670,11 +695,6 @@ SUBROUTINE calculate_Hubbard_parameters() | ||
670 | 695 | IMPLICIT NONE |
671 | 696 | INTEGER :: nt1, nt2 |
672 | 697 | ! |
673 | - ! Find and open unit to write info | |
674 | - iunitU = find_free_unit() | |
675 | - filenameU = trim(prefix) // ".Hubbard_parameters.dat" | |
676 | - OPEN(iunitU, file = filenameU, form = 'formatted', status = 'unknown') | |
677 | - ! | |
678 | 698 | ! Calculate the matrix of Hubbard parametres: CHI0^{-1} - CHI^{-1} |
679 | 699 | ! |
680 | 700 | DO na = 1, nath_scbg |
@@ -708,7 +728,7 @@ SUBROUTINE calculate_Hubbard_parameters() | ||
708 | 728 | ! |
709 | 729 | ! Write Hubbard V (i.e. off-diagonal elements of the Hubbard matrix) |
710 | 730 | ! |
711 | - IF ( lda_plus_u_kind.EQ.2 ) CALL write_Hubbard_V() | |
731 | + IF ( lda_plus_u_kind.EQ.2 ) CALL write_intersite(.true.) | |
712 | 732 | ! |
713 | 733 | ! Write the information about the response matrices chi0 and chi, |
714 | 734 | ! about their inverse matrices, and about the entire matrix of |
@@ -764,13 +784,13 @@ SUBROUTINE calculate_Hubbard_parameters() | ||
764 | 784 | ! |
765 | 785 | ENDIF |
766 | 786 | ! |
767 | - CLOSE(iunitU) | |
787 | + !CLOSE(iunitU) | |
768 | 788 | ! |
769 | 789 | RETURN |
770 | 790 | ! |
771 | 791 | END SUBROUTINE calculate_Hubbard_parameters |
772 | 792 | |
773 | -SUBROUTINE write_Hubbard_V() | |
793 | +SUBROUTINE write_intersite (lflag) | |
774 | 794 | ! |
775 | 795 | USE parameters, ONLY : sc_size |
776 | 796 | ! |
@@ -783,18 +803,30 @@ SUBROUTINE write_Hubbard_V() | ||
783 | 803 | INTEGER :: ne, nc_min, ipol, tempunit, counter |
784 | 804 | CHARACTER(len=80) :: tempfile |
785 | 805 | REAL(DP) :: auxdist |
806 | + LOGICAL :: lflag ! if .true. then write V to file | |
807 | + ! if .false. then do not write V to file | |
786 | 808 | ! |
787 | 809 | ! Find and open unit to write Hubbard_V parameters |
788 | 810 | tempunit = find_free_unit() |
789 | 811 | tempfile = TRIM("parameters.out") |
790 | 812 | OPEN(tempunit, file = tempfile, form = 'formatted', status = 'unknown') |
791 | 813 | ! |
792 | - WRITE(iunitU,'(/27x,"Hubbard V parameters:")') | |
793 | - WRITE(iunitU,'(22x,"(adapted for a supercell",1x,i1,"x",i1,"x",i1,")",/)') 2*sc_size+1, 2*sc_size+1, 2*sc_size+1 | |
794 | - WRITE(iunitU,*) ' Atom 1 ', ' Atom 2 ', ' Distance (Bohr) ', ' Hubbard V (eV)' | |
795 | - WRITE(iunitU,*) | |
796 | - ! | |
797 | - WRITE(tempunit,*) '# Atom 1 ', ' Atom 2 ', ' Hubbard V (eV)' | |
814 | + IF (lflag) THEN | |
815 | + WRITE(iunitU,'(/27x,"Hubbard V parameters:")') | |
816 | + ELSE | |
817 | + WRITE(iunitU,'(/17x,"Indices and distances for inter-site couples:")') | |
818 | + ENDIF | |
819 | + WRITE(iunitU,'(22x,"(adapted for a supercell",1x,i1,"x",i1,"x",i1,")",/)') & | |
820 | + 2*sc_size+1, 2*sc_size+1, 2*sc_size+1 | |
821 | + IF (lflag) THEN | |
822 | + WRITE(iunitU,*) ' Atom 1 ', ' Atom 2 ', ' Distance (Bohr) ', ' Hubbard V (eV)' | |
823 | + WRITE(iunitU,*) | |
824 | + WRITE(tempunit,*) '# Atom 1 ', ' Atom 2 ', ' Hubbard V (eV)' | |
825 | + ELSE | |
826 | + WRITE(iunitU,*) ' Atom 1 ', ' Atom 2 ', ' Distance (Bohr) ' | |
827 | + WRITE(iunitU,*) | |
828 | + WRITE(tempunit,*) '# Atom 1 ', ' Atom 2 ' | |
829 | + ENDIF | |
798 | 830 | ! |
799 | 831 | ALLOCATE(dist(nath_sc)) |
800 | 832 | ALLOCATE(distord(nath_sc)) |
@@ -890,14 +922,28 @@ SUBROUTINE write_Hubbard_V() | ||
890 | 922 | DO nb = 1, nath_sc |
891 | 923 | IF ( auxindex(na,indexord(nb)) > 0 ) THEN |
892 | 924 | counter = counter + 1 |
893 | - WRITE(iunitU,'(11x,i3,x,a4,x,i5,x,a4,2x,f12.6,4x,f10.4)') & | |
894 | - na, atm_new(ityp_sc(na)), auxindex(na,indexord(nb)), atm_new(typeord(nb)), & | |
895 | - dist_sc(na,indexord(nb)), Hubbard_matrix(na,indexord(nb)) | |
896 | - IF ( nb.LE.(num_neigh+1) .AND. & | |
897 | - dist_sc(na,indexord(nb)).LE.rmax .AND. & | |
898 | - Hubbard_l(ityp(na)).GE.lmin ) THEN | |
899 | - WRITE(tempunit,'(3x,i3,4x,i5,3x,f10.4)') & | |
900 | - na, auxindex(na,indexord(nb)), Hubbard_matrix(na,indexord(nb)) | |
925 | + IF (lflag) THEN | |
926 | + ! Print couples and Hubbard V | |
927 | + WRITE(iunitU,'(11x,i3,x,a4,x,i5,x,a4,2x,f12.6,4x,f10.4)') & | |
928 | + na, atm_new(ityp_sc(na)), auxindex(na,indexord(nb)), atm_new(typeord(nb)), & | |
929 | + dist_sc(na,indexord(nb)), Hubbard_matrix(na,indexord(nb)) | |
930 | + IF ( nb.LE.(num_neigh+1) .AND. & | |
931 | + dist_sc(na,indexord(nb)).LE.rmax .AND. & | |
932 | + Hubbard_l(ityp(na)).GE.lmin ) THEN | |
933 | + WRITE(tempunit,'(3x,i3,4x,i5,3x,f10.4)') & | |
934 | + na, auxindex(na,indexord(nb)), Hubbard_matrix(na,indexord(nb)) | |
935 | + ENDIF | |
936 | + ELSE | |
937 | + ! Print couples only | |
938 | + WRITE(iunitU,'(11x,i3,x,a4,x,i5,x,a4,2x,f12.6)') & | |
939 | + na, atm_new(ityp_sc(na)), auxindex(na,indexord(nb)), atm_new(typeord(nb)), & | |
940 | + dist_sc(na,indexord(nb)) | |
941 | + IF ( nb.LE.(num_neigh+1) .AND. & | |
942 | + dist_sc(na,indexord(nb)).LE.rmax .AND. & | |
943 | + Hubbard_l(ityp(na)).GE.lmin ) THEN | |
944 | + WRITE(tempunit,'(3x,i3,4x,i5)') & | |
945 | + na, auxindex(na,indexord(nb)) | |
946 | + ENDIF | |
901 | 947 | ENDIF |
902 | 948 | ENDIF |
903 | 949 | ENDDO |
@@ -919,6 +965,6 @@ SUBROUTINE write_Hubbard_V() | ||
919 | 965 | ! |
920 | 966 | RETURN |
921 | 967 | ! |
922 | -END SUBROUTINE write_Hubbard_V | |
968 | +END SUBROUTINE write_intersite | |
923 | 969 | |
924 | 970 | END SUBROUTINE hp_postproc |
@@ -85,16 +85,7 @@ SUBROUTINE laxlib_rdiaghg( n, m, h, s, ldh, e, v, me_bgrp, root_bgrp, intra_bgrp | ||
85 | 85 | end do |
86 | 86 | !$omp end parallel do |
87 | 87 | ! |
88 | -#if defined (__ESSL) | |
89 | - ! | |
90 | - ! ... there is a name conflict between essl and lapack ... | |
91 | - ! | |
92 | - CALL DSYGV( 1, v, ldh, s, ldh, e, v, ldh, n, work, lwork ) | |
93 | - ! | |
94 | - info = 0 | |
95 | -#else | |
96 | 88 | CALL DSYGV( 1, 'V', 'U', n, v, ldh, s, ldh, e, work, lwork, info ) |
97 | -#endif | |
98 | 89 | ! |
99 | 90 | ELSE |
100 | 91 | ! |
@@ -425,7 +425,7 @@ PROGRAM pw2wannier90 | ||
425 | 425 | IF(write_mmn ) CALL print_clock( 'compute_mmn' ) |
426 | 426 | IF(write_unk ) CALL print_clock( 'write_unk' ) |
427 | 427 | IF(write_unkg ) CALL print_clock( 'write_parity' ) |
428 | - !! not sure if this should be called also in 'library' mode or not !! | |
428 | + ! not sure if this should be called also in 'library' mode or not !! | |
429 | 429 | CALL environment_end ( 'PW2WANNIER' ) |
430 | 430 | IF ( ionode ) WRITE( stdout, * ) |
431 | 431 | CALL stop_pp |
@@ -2148,72 +2148,7 @@ SUBROUTINE compute_mmn | ||
2148 | 2148 | ! |
2149 | 2149 | Mkb(:,:) = (0.0d0,0.0d0) |
2150 | 2150 | ! |
2151 | - IF (any_uspp) THEN | |
2152 | - ijkb0 = 0 | |
2153 | - DO nt = 1, ntyp | |
2154 | - IF ( upf(nt)%tvanp ) THEN | |
2155 | - DO na = 1, nat | |
2156 | - ! | |
2157 | - arg = dot_product( dxk(:,ind), tau(:,na) ) * tpi | |
2158 | - phase1 = cmplx( cos(arg), -sin(arg) ,kind=DP) | |
2159 | - ! | |
2160 | - IF ( ityp(na) == nt ) THEN | |
2161 | - DO jh = 1, nh(nt) | |
2162 | - jkb = ijkb0 + jh | |
2163 | - DO ih = 1, nh(nt) | |
2164 | - ikb = ijkb0 + ih | |
2165 | - ! | |
2166 | - DO m = 1,nbnd | |
2167 | - IF (excluded_band(m)) CYCLE | |
2168 | - IF (gamma_only) THEN | |
2169 | - DO n=1,m ! Mkb(m,n) is symmetric in m and n for gamma_only case | |
2170 | - IF (excluded_band(n)) CYCLE | |
2171 | - Mkb(m,n) = Mkb(m,n) + & | |
2172 | - phase1 * qb(ih,jh,nt,ind) * & | |
2173 | - becp%r(ikb,m) * rbecp2(jkb,n) | |
2174 | - ENDDO | |
2175 | - else if (noncolin) then | |
2176 | - DO n=1,nbnd | |
2177 | - IF (excluded_band(n)) CYCLE | |
2178 | - if (lspinorb) then | |
2179 | - Mkb(m,n) = Mkb(m,n) + & | |
2180 | - phase1 * ( & | |
2181 | - qq_so(ih,jh,1,nt) * conjg( becp%nc(ikb, 1, m) ) * becp2_nc(jkb, 1, n) & | |
2182 | - + qq_so(ih,jh,2,nt) * conjg( becp%nc(ikb, 1, m) ) * becp2_nc(jkb, 2, n) & | |
2183 | - + qq_so(ih,jh,3,nt) * conjg( becp%nc(ikb, 2, m) ) * becp2_nc(jkb, 1, n) & | |
2184 | - + qq_so(ih,jh,4,nt) * conjg( becp%nc(ikb, 2, m) ) * becp2_nc(jkb, 2, n) & | |
2185 | - ) | |
2186 | - else | |
2187 | - Mkb(m,n) = Mkb(m,n) + & | |
2188 | - phase1 * qb(ih,jh,nt,ind) * & | |
2189 | - (conjg( becp%nc(ikb, 1, m) ) * becp2_nc(jkb, 1, n) & | |
2190 | - + conjg( becp%nc(ikb, 2, m) ) * becp2_nc(jkb, 2, n) ) | |
2191 | - endif | |
2192 | - ENDDO | |
2193 | - ELSE | |
2194 | - DO n=1,nbnd | |
2195 | - IF (excluded_band(n)) CYCLE | |
2196 | - Mkb(m,n) = Mkb(m,n) + & | |
2197 | - phase1 * qb(ih,jh,nt,ind) * & | |
2198 | - conjg( becp%k(ikb,m) ) * becp2(jkb,n) | |
2199 | - ENDDO | |
2200 | - ENDIF | |
2201 | - ENDDO ! m | |
2202 | - ENDDO !ih | |
2203 | - ENDDO !jh | |
2204 | - ijkb0 = ijkb0 + nh(nt) | |
2205 | - ENDIF !ityp | |
2206 | - ENDDO !nat | |
2207 | - ELSE !tvanp | |
2208 | - DO na = 1, nat | |
2209 | - IF ( ityp(na) == nt ) ijkb0 = ijkb0 + nh(nt) | |
2210 | - ENDDO | |
2211 | - ENDIF !tvanp | |
2212 | - ENDDO !ntyp | |
2213 | - ENDIF ! any_uspp | |
2214 | - ! | |
2215 | - ! | |
2216 | -! loops on bands | |
2151 | + ! loops on bands | |
2217 | 2152 | ! |
2218 | 2153 | IF (wan_mode=='standalone') THEN |
2219 | 2154 | IF (ionode) WRITE (iun_mmn,'(7i5)') ik, ikp, (g_kpb(ipol,ik,ib), ipol=1,3) |
@@ -2228,7 +2163,7 @@ SUBROUTINE compute_mmn | ||
2228 | 2163 | istart=(ipol-1)*npwx+1 |
2229 | 2164 | iend=istart+npw-1 |
2230 | 2165 | psic_nc(dffts%nl (igk_k(1:npw,ik) ),ipol ) = evc(istart:iend, m) |
2231 | - IF (.not.zerophase(ik,ib)) THEN | |
2166 | + IF (.not.zerophase(ik,ib)) THEN | |
2232 | 2167 | CALL invfft ('Wave', psic_nc(:,ipol), dffts) |
2233 | 2168 | psic_nc(1:dffts%nnr,ipol) = psic_nc(1:dffts%nnr,ipol) * & |
2234 | 2169 | phase(1:dffts%nnr) |
@@ -2260,7 +2195,6 @@ SUBROUTINE compute_mmn | ||
2260 | 2195 | IF (excluded_band(n)) CYCLE |
2261 | 2196 | mmn = zdotc (npwq, aux,1,evcq(1,n),1) & |
2262 | 2197 | + conjg(zdotc(npwq,aux2,1,evcq(1,n),1)) |
2263 | - CALL mp_sum(mmn, intra_pool_comm) | |
2264 | 2198 | Mkb(m,n) = mmn + Mkb(m,n) |
2265 | 2199 | IF (m/=n) Mkb(n,m) = Mkb(m,n) ! fill other half of matrix by symmetry |
2266 | 2200 | ENDDO |
@@ -2273,19 +2207,88 @@ SUBROUTINE compute_mmn | ||
2273 | 2207 | mmn = mmn + zdotc (npwq, aux_nc(1,1),1,evcq(1,n),1) & |
2274 | 2208 | + zdotc (npwq, aux_nc(1,2),1,evcq(npwx+1,n),1) |
2275 | 2209 | ! end do |
2276 | - CALL mp_sum(mmn, intra_pool_comm) | |
2277 | 2210 | Mkb(m,n) = mmn + Mkb(m,n) |
2278 | 2211 | ENDDO |
2279 | 2212 | ELSE |
2280 | 2213 | DO n=1,nbnd |
2281 | 2214 | IF (excluded_band(n)) CYCLE |
2282 | 2215 | mmn = zdotc (npwq, aux,1,evcq(1,n),1) |
2283 | - CALL mp_sum(mmn, intra_pool_comm) | |
2284 | 2216 | Mkb(m,n) = mmn + Mkb(m,n) |
2285 | 2217 | ENDDO |
2286 | 2218 | ENDIF |
2287 | 2219 | ENDDO ! m |
2288 | - | |
2220 | + ! | |
2221 | + ! updating of the elements of the matrix Mkb | |
2222 | + ! | |
2223 | + DO n=1,nbnd | |
2224 | + IF (excluded_band(n)) CYCLE | |
2225 | + CALL mp_sum(Mkb(:,n), intra_pool_comm) | |
2226 | + ENDDO | |
2227 | + ! | |
2228 | + IF (any_uspp) THEN | |
2229 | + ijkb0 = 0 | |
2230 | + DO nt = 1, ntyp | |
2231 | + IF ( upf(nt)%tvanp ) THEN | |
2232 | + DO na = 1, nat | |
2233 | + ! | |
2234 | + arg = dot_product( dxk(:,ind), tau(:,na) ) * tpi | |
2235 | + phase1 = cmplx( cos(arg), -sin(arg) ,kind=DP) | |
2236 | + ! | |
2237 | + IF ( ityp(na) == nt ) THEN | |
2238 | + DO jh = 1, nh(nt) | |
2239 | + jkb = ijkb0 + jh | |
2240 | + DO ih = 1, nh(nt) | |
2241 | + ikb = ijkb0 + ih | |
2242 | + ! | |
2243 | + DO m = 1,nbnd | |
2244 | + IF (excluded_band(m)) CYCLE | |
2245 | + IF (gamma_only) THEN | |
2246 | + DO n=1,m ! Mkb(m,n) is symmetric in m and n for gamma_only case | |
2247 | + IF (excluded_band(n)) CYCLE | |
2248 | + Mkb(m,n) = Mkb(m,n) + & | |
2249 | + phase1 * qb(ih,jh,nt,ind) * & | |
2250 | + becp%r(ikb,m) * rbecp2(jkb,n) | |
2251 | + ENDDO | |
2252 | + else if (noncolin) then | |
2253 | + DO n=1,nbnd | |
2254 | + IF (excluded_band(n)) CYCLE | |
2255 | + if (lspinorb) then | |
2256 | + Mkb(m,n) = Mkb(m,n) + & | |
2257 | + phase1 * ( & | |
2258 | + qq_so(ih,jh,1,nt) * conjg( becp%nc(ikb, 1, m) ) * becp2_nc(jkb, 1, n) & | |
2259 | + + qq_so(ih,jh,2,nt) * conjg( becp%nc(ikb, 1, m) ) * becp2_nc(jkb, 2, n) & | |
2260 | + + qq_so(ih,jh,3,nt) * conjg( becp%nc(ikb, 2, m) ) * becp2_nc(jkb, 1, n) & | |
2261 | + + qq_so(ih,jh,4,nt) * conjg( becp%nc(ikb, 2, m) ) * becp2_nc(jkb, 2, n) & | |
2262 | + ) | |
2263 | + else | |
2264 | + Mkb(m,n) = Mkb(m,n) + & | |
2265 | + phase1 * qb(ih,jh,nt,ind) * & | |
2266 | + (conjg( becp%nc(ikb, 1, m) ) * becp2_nc(jkb, 1, n) & | |
2267 | + + conjg( becp%nc(ikb, 2, m) ) * becp2_nc(jkb, 2, n) ) | |
2268 | + endif | |
2269 | + ENDDO | |
2270 | + ELSE | |
2271 | + DO n=1,nbnd | |
2272 | + IF (excluded_band(n)) CYCLE | |
2273 | + Mkb(m,n) = Mkb(m,n) + & | |
2274 | + phase1 * qb(ih,jh,nt,ind) * & | |
2275 | + conjg( becp%k(ikb,m) ) * becp2(jkb,n) | |
2276 | + ENDDO | |
2277 | + ENDIF | |
2278 | + ENDDO ! m | |
2279 | + ENDDO !ih | |
2280 | + ENDDO !jh | |
2281 | + ijkb0 = ijkb0 + nh(nt) | |
2282 | + ENDIF !ityp | |
2283 | + ENDDO !nat | |
2284 | + ELSE !tvanp | |
2285 | + DO na = 1, nat | |
2286 | + IF ( ityp(na) == nt ) ijkb0 = ijkb0 + nh(nt) | |
2287 | + ENDDO | |
2288 | + ENDIF !tvanp | |
2289 | + ENDDO !ntyp | |
2290 | + ENDIF ! any_uspp | |
2291 | + ! | |
2289 | 2292 | ibnd_n = 0 |
2290 | 2293 | DO n=1,nbnd |
2291 | 2294 | IF (excluded_band(n)) CYCLE |
@@ -2303,7 +2306,7 @@ SUBROUTINE compute_mmn | ||
2303 | 2306 | ENDIF |
2304 | 2307 | ENDDO |
2305 | 2308 | ENDDO |
2306 | - | |
2309 | + ! | |
2307 | 2310 | ENDDO !ib |
2308 | 2311 | ENDDO !ik |
2309 | 2312 |
@@ -415,6 +415,10 @@ SUBROUTINE memory_report() | ||
415 | 415 | IF ( totram .ge. GB ) WRITE( stdout, 1012 ) totram/GB, ' GB' |
416 | 416 | END IF |
417 | 417 | ! |
418 | + ! check: more bands than plane waves? not good | |
419 | + ! | |
420 | + IF ( npwx_g < nbndx ) CALL errore('memory_report','more bands than PWs!',1) | |
421 | + ! | |
418 | 422 | 1010 format (/5x,'Estimated static dynamical RAM per process > ', F10.2, A3) |
419 | 423 | 1011 format (/5x,'Estimated max dynamical RAM per process > ', F10.2, A3) |
420 | 424 | 1012 format (/5x,'Estimated total dynamical RAM > ', F10.2, A3) |
@@ -2365,8 +2365,8 @@ $as_echo "${arch}" >&6; } | ||
2365 | 2365 | # Add all needed -D options to try_dflags |
2366 | 2366 | try_dflags="" |
2367 | 2367 | |
2368 | -# "-I../include" is required by IOTK ... | |
2369 | -try_iflags="-I\$(TOPDIR)/include -I\$(TOPDIR)/FoX/finclude -I\$(TOPDIR)/S3DE/iotk/include/" | |
2368 | +# Add needed include directories | |
2369 | +try_iflags="-I\$(TOPDIR)/include -I\$(TOPDIR)/FoX/finclude" | |
2370 | 2370 | |
2371 | 2371 | # Checking archiver... |
2372 | 2372 |
@@ -26,8 +26,8 @@ X_AC_QE_ARCH() | ||
26 | 26 | # Add all needed -D options to try_dflags |
27 | 27 | try_dflags="" |
28 | 28 | |
29 | -# "-I../include" is required by IOTK ... | |
30 | -try_iflags="-I\$(TOPDIR)/include -I\$(TOPDIR)/FoX/finclude -I\$(TOPDIR)/S3DE/iotk/include/" | |
29 | +# Add needed include directories | |
30 | +try_iflags="-I\$(TOPDIR)/include -I\$(TOPDIR)/FoX/finclude " | |
31 | 31 | |
32 | 32 | # Checking archiver... |
33 | 33 | X_AC_QE_AR() |
@@ -133,8 +133,6 @@ BLAS_LIBS = @blas_libs@ | ||
133 | 133 | # If you have nothing better, use the local copy |
134 | 134 | # LAPACK_LIBS_SWITCH = internal |
135 | 135 | # LAPACK_LIBS = $(TOPDIR)/LAPACK/liblapack.a |
136 | -# For IBM machines with essl (-D__ESSL): load essl BEFORE lapack ! | |
137 | -# remember that LAPACK_LIBS precedes BLAS_LIBS in loading order | |
138 | 136 | |
139 | 137 | LAPACK_LIBS = @lapack_libs@ |
140 | 138 | LAPACK_LIBS_SWITCH = @lapack_libs_switch@ |
@@ -26,8 +26,8 @@ LOADOPTS = @ldflags@ | ||
26 | 26 | # Comment out the following line to include deprecated routines to the |
27 | 27 | # LAPACK library. |
28 | 28 | # |
29 | -MAKEDEPRECATED = Yes | |
30 | -BUILD_DEPRECATED = Yes | |
29 | +# MAKEDEPRECATED = Yes | |
30 | +# BUILD_DEPRECATED = Yes | |
31 | 31 | # |
32 | 32 | # Timer for the SECOND and DSECND routines |
33 | 33 | # |