Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Fortran > Re: Segmentatio...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 3 Topic 8539 of 8908
Post > Topic >>

Re: Segmentation Fault in calling FFTW

by Rich Townsend <rhdt@[EMAIL PROTECTED] > Jul 23, 2008 at 04:08 PM

fj wrote:
> On 23 juil, 07:51, Fatemeh <fateme.mirj...@[EMAIL PROTECTED]
> wrote:
>> Dear all;
>> I have written a simple program and called FFTW in it.
>> but I envisaged Segmentation Fault after  "CALL dfftw_execute(plan)"
>> Is there anyone who can guide me where have I made a mistake?
>>      ------------------------
>>       program test
>>       implicit none
>>       include "fftw3.f"
>>       integer::u,jatom,nat,h,functn,pp,ind1,ind2,ind3,nx,ny,nz,counter
>>       real::i,j,k,rx,ry,rz,originx,originy,originz,te,tee
>>       real,allocatable::struct(:,:),tau(:,:),r0(:,:)
>>       complex,dimension(100,100,100)::dat,der
>>       INTEGER*8 plan
>>       read(88,*)nat
>>       allocate(struct(nat,6),tau(4,3),r0(nat,3))
>>       do pp=1,4
>>         read(55,*)(tau(pp,h),h=1,3)
>>       end do
>>       originx=tau(3,1)
>>       originy=tau(3,2)
>>       originz=tau(3,3)
>>       do jatom=1,nat
>>       r0(jatom,1)=tau(jatom,1)-originx
>>       r0(jatom,2)=tau(jatom,2)-originy
>>       r0(jatom,3)=tau(jatom,3)-originz
>>       read(666,*)(struct(jatom,h),h=1,6)
>>       end do
>>        nx=100;ny=100;nz=100
>>        counter=1
>>         i=0;j=0;k=0
>>         do ind1=1,nx
>>           i=i+0.1065
>>          do ind2=1,ny
>>           j=j+0.1065
>>           do ind3=1,nz
>>            k=k+0.1065
>>            rx=i-originx
>>            ry=j-originy
>>            rz=k-originz
>>            u=0
>>            do jatom=1,nat
>>            tee=struct(jatom,4) !*0.529177249
>>            te=sqrt((rx-r0(jatom,1))**2+(ry-r0(jatom,2))**2+(rz-
>> r0(jatom,3))**2)
>>            if (te.GT.tee) u=u+1
>>            end do
>>            if (u==3)then
>>            dat(ind1,ind2,ind3)=(1.0,0.0)
>>            else
>>             dat(ind1,ind2,ind3)=(0.0,0.0)
>>            end if
>>            write(36,*)dat(ind1,ind2,ind3)
>>           counter=counter+1
>>         end do
>>         k=0
>>        end do
>>        j=0
>>       end do
>>       CALL
>> dfftw_plan_dft_3d(plan,nx,ny,nz,dat,der,FFTW_BACKWARD,FFTW_ESTIMATE)
>>       print*,"111"
>>       CALL dfftw_execute(plan)
>>       print*,"222"
>>       CALL dfftw_destroy_plan(plan)
>>        print*,"END"
>>       end program test
>> ------------------------------------
>> the program can print  "111" , but it isn't able to print "222".
>>
>> I'm anxiously looking forward your reply and guidelines.
>> with best regards,
>> Fatemeh
> 
> Are you sure that the Real and Complex arrays are simple precision ?
> This is very unusual in scientific codes ! I don't know the FFTW
> library but I suspect the array declarations to be wrong :
> 
> INTEGER, PARAMETER :: dp=SELECTED_REAL_KIND(15,100)
> REAL(dp)   ,... :: ...
> COMPLEX(dp),... :: ...

How about dp=KIND(0.D0)?
 




 3 Posts in Topic:
Segmentation Fault in calling FFTW
Fatemeh <fateme.mirjan  2008-07-22 22:51:02 
Re: Segmentation Fault in calling FFTW
fj <francois.jacq@[EMA  2008-07-23 01:42:03 
Re: Segmentation Fault in calling FFTW
Rich Townsend <rhdt@[E  2008-07-23 16:08:46 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Nov 19 7:28:57 CST 2008.