********>Bugfix for ew_fft.f in AMBER 5.0 sander Author: Mike Crowley Date: 11 Feb 98 Programs: sander Severity: pretty bad for some parallel In most parallel compilations, the unfixed ew_fft.f will include calls to both the serial 3Dfft and the parallel 3D-FFT. THis may go undetected, but will usually cause error messages, incorrect results and program crash. *** ew_fft.f_50withbug Fri Sep 19 10:37:38 1997 --- ew_fft.f Thu Feb 12 12:14:59 1998 *************** *** 108,113 **** --- 108,114 ---- nfftdim3 = nfft3 n = nfft3/2 if ( nfft3 .eq. 2*n )nfftdim3 = nfft3+1 + #ifndef MPI #ifdef FUJFFT nfftable = 0 nffwork = 2*nfftmax *************** *** 132,138 **** sizfftab = nfftable sizffwrk = nffwork #endif ! #ifdef MPI nt0=numtasks numtasks=num_recip # ifdef CRAY_1DFFT --- 133,145 ---- sizfftab = nfftable sizffwrk = nffwork #endif ! #ifdef PUBFFT ! nfftable = 4*nfftmax + 15 ! nffwork = nfftmax ! sizfftab = 3*nfftable ! sizffwrk = 2*nfftmax ! #endif ! #else /* MPI */ nt0=numtasks numtasks=num_recip # ifdef CRAY_1DFFT *************** *** 185,196 **** #endif numtasks=nt0 #endif /* MPI */ - #ifdef PUBFFT - nfftable = 4*nfftmax + 15 - nffwork = nfftmax - sizfftab = 3*nfftable - sizffwrk = 2*nfftmax - #endif return end --- 192,197 ---- *************** *** 393,398 **** --- 394,400 ---- isign = 1 + #ifndef MPI #ifdef SGIFFT call ZFFT3D(isign,nfft1,nfft2,nfft3,array, $ nfftdim1,nfftdim2,fftable) *************** *** 411,417 **** $ nfftdim1,nfftdim2,fftable,nfftable,ffwork,nffwork) #endif ! #ifdef MPI scale = 1.d0 c scale = 1./float(nfft1*nfft2*nfft3) call fft3d_zxy(isign,nfft1,nfft2,nfft3,scale,array, --- 413,419 ---- $ nfftdim1,nfftdim2,fftable,nfftable,ffwork,nffwork) #endif ! #else /* MPI */ scale = 1.d0 c scale = 1./float(nfft1*nfft2*nfft3) call fft3d_zxy(isign,nfft1,nfft2,nfft3,scale,array, *************** *** 452,461 **** c nothing happens here for FUJFFT... #endif ! #ifdef SGIFFT call ZFFT3DI(nfft1,nfft2,nfft3,fftable) ! #endif ! #ifdef CRAYFFT isign = 0 inc1 = 1 inc2 = NFFTDIM1 --- 454,464 ---- c nothing happens here for FUJFFT... #endif ! #ifndef MPI ! # ifdef SGIFFT call ZFFT3DI(nfft1,nfft2,nfft3,fftable) ! # endif ! # ifdef CRAYFFT isign = 0 inc1 = 1 inc2 = NFFTDIM1 *************** *** 464,475 **** call CFFT3D(isign,nfft1,nfft2,nfft3,scale,array, $ inc1,inc2,inc3,array,inc1,inc2,inc3,fftable,nfftable, $ ffwork,nffwork) ! #endif ! #ifdef PUBFFT call pubz3di(nfft1,nfft2,nfft3,fftable,nfftable) ! #endif ! #ifdef MPI isign = 0 scale = 1.d0 --- 467,478 ---- call CFFT3D(isign,nfft1,nfft2,nfft3,scale,array, $ inc1,inc2,inc3,array,inc1,inc2,inc3,fftable,nfftable, $ ffwork,nffwork) ! # endif ! # ifdef PUBFFT call pubz3di(nfft1,nfft2,nfft3,fftable,nfftable) ! # endif ! #else /* MPI */ isign = 0 scale = 1.d0 *************** *** 1405,1411 **** # endif ! #endif #ifdef PUBFFT --- 1408,1414 ---- # endif ! #endif /* MPI */ #ifdef PUBFFT