12.07.2015 Views

Ab initio molecular dynamics: Theory and Implementation

Ab initio molecular dynamics: Theory and Implementation

Ab initio molecular dynamics: Theory and Implementation

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ab = 2 * sdot(2 * N p D ,A(1),1,B(1),1)END IFCALL GlobalSum[ab]MODULE OverlapCALL SGEMM(’T’,’N’,N b ,N b ,2*N p PW ,2,&& ca(1,1),2*N p PW ,cb(1,1),2*N p PW ,0,smat,N b)IF (p == P0) CALL SDER(N b ,N b ,-1,ca(1,1),2*N p PW ,&& cb(1,1),2*N p PW ,smat,N b)CALL GlobalSum[smat]Similarly, the overlap part of the FNL routine has to be changed <strong>and</strong> the loopsrestricted to the local number of plane waves.MODULE FNLFOR i=1:N p ,MIF (MOD(lp(i),2) == 0) THENFOR j=0:M-1pf = -1**(lp(i+j)/2)FOR k=1:N p PWt = pro(k) * pfer = REAL[eigr(k,iat(i+j))]ei = IMAG[eigr(k,iat(i+j))]scr(k,j) = CMPLX[t * er,t * ei]ENDENDELSEFOR j=0:M-1pf = -1**(lp(i+j)/2+1)FOR k=1:N p PWt = pro(k) * pfer = REAL[eigr(k,iat(i+j))]ei = IMAG[eigr(k,iat(i+j))]scr(k,j) = CMPLX[-t * ei,t * er]ENDENDEND IFIF (p == P0) scr(1,0:M-1) = scr(1,0:M-1)/2CALL SGEMM(’T’,’N’,M,N b ,2*N p PW ,2,&& scr(1,0),2*N p PW ,cr(1,1),2*N p PW ,0,fnl(i,1),N p)ENDCALL GlobalSum[fnl]The routines that need the most changes are the once that include Fourier transforms.Due to the complicated break up of the plane waves a new mapping has tobe introduced. The map mapxy ensures that all pencils occupy contiguous memory87

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!