i'm trying to solve an equation using gfortran but i keep getting error

Posted by sameon on Stack Overflow See other posts from Stack Overflow or by sameon
Published on 2010-06-13T15:01:31Z Indexed on 2010/06/13 15:42 UTC
Read the original article Hit count: 309

Filed under:

i'm using the below program but i keep getting error.What is wrong with my progam?

  real x
  complex y
  real m1,H0,Ms,P1,P2,P3,w0,wm,wh
  complex w1,w2,o1,o2
  integer i,n
  real pi
  n=4000000000  
  pi=4*atan(1.0)
  m1=4*pi*1e-7
  H0=39.79e3
  Ms=1400e3
  P1=0.7*0.12
  P2=0.3*0.12
  P3=P1-P2
  w0=m1*(1.76e11)*H0
  wm=m1*(1.76e11)*Ms
  wh=w0-P3*wm
  im=cmplx(0,1)
  w1=wm/2+wh-im*0.06*2*pi*x
  w2=wm/2-wh-im*0.06*2*pi*x
  o1=x**2-x*(2*wh-(P3*wm)/2)-w1*w2+(wm/2)*(P1*w2+P2*w1)
  o2=x**2+x*(2*wh-(P3*wm)/2)-w1*w2+(wm/2)*(P1*w2+P2*w1)

  do i=0,n
     x=i
     y=1+wm*(P1*w1*((w2)**2-x**2))/(o1*o2)
 &        +wm*(P2*w2*((w1)**2-x**2))/(o1*o2)
 &        -wm*((wm/2)*((P1*w2+P2*w1)**2)))/(o1*o2)
 &        +wm*((wm/2)*((P3*x)**2))/(o1*o2)
     write(10,*)x,y
  enddo
  return
  end

© Stack Overflow or respective owner

Related posts about gfortran