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...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

locations on each processor.MODULE INVFFTscr1(1:N x ,1:N D pencil ) = 0FOR i=1:N p Dscr1(ipg(1,i),mapxy(ipg(2,i),ipg(3,i))) = rhog(i)scr1(img(1,i),mapxy(img(2,i),img(3,i))) = CONJG[rhog(i)]ENDCALL ParallelFFT3D("INV",scr1,scr2)n(1:N p x,1:N y ,1:N z ) = REAL[scr2(1:N p x,1:N y ,1:N z )]MODULE FWFFTscr2(1:N p x,1:N y ,1:N z ) = n(1:N p x,1:N y ,1:N z )CALL ParallelFFT3D("FW",scr1,scr2)FOR i=1:N p Drhog(i) = scr1(ipg(1,i),mapxy(ipg(2,i),ipg(3,i)))ENDDue to the mapping of the y <strong>and</strong> z direction in Fourier space onto a single dimension,input <strong>and</strong> output array of the parallel Fourier transform do have different shapes.MODULE Densityrho(1:Nx,1:N p y ,1:N z ) = 0FOR i=1:N b ,2scr1(1:N x ,1:Npencil PW ) = 0FOR j=1:N p PWscr1(ipg(1,i),mapxy(ipg(2,i),ipg(3,i))) = && c(j,i) + I * c(j,i+1)scr1(img(1,i),mapxy(img(2,i),img(3,i))) = && CONJG[c(j,i) + I * c(j,i+1)]ENDCALL ParallelFFT3D("INV",scr1,scr2)rho(1:Nx,1:N p y ,1:N z ) = rho(1:Nx,1:N p y ,1:N z ) + && REAL[scr2(1:Nx,1:N p y ,1:N z )]**2 + && IMAG[scr2(1:Nx,1:N p y ,1:N z )]**2ENDMODULE VPSIFOR i=1:N b ,2scr1(1:N x ,1:Npencil PW ) = 0FOR j=1:N p PWscr1(ipg(1,i),mapxy(ipg(2,i),ipg(3,i))) = && c(j,i) + I * c(j,i+1)scr1(img(1,i),mapxy(img(2,i),img(3,i))) = && CONJG[c(j,i) + I * c(j,i+1)]88

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

Saved successfully!

Ooh no, something went wrong!