Hi,,
I have afortran program for calculating density and when I execute it gives me zero and error.
program density
implicit none
integer :: r,IDm,n,m,i,j
real :: xm,ym,zm,p,p0,k,pi,s,ri,rj,l
real, dimension(1000) :: x,y,z,ID
p0=0.17
k=0.0
L=4.33
pi=3.1415927
do n=1,3000
open(unit=5,file='/home/toshiba/Desktop/urqmd-3.3p2/format1.dat')
read(5,*) l,l,l,l
do m=1,400
read(5,*) xm,ym,zm,IDm
if(xm==400) exit
r=m
x(r)=xm
y(r)=ym
z(r)=zm
ID(r)=IDm
write(*,*) xm, ym, zm, IDm
end do
do i=1,r-1
x(i)=xm
y(i)=ym
z(i)=zm
do j=i+1,r
x(j)=x(i+1)
y(j)=y(i+1)
z(j)=z(i+1)
s=ri-rj
s=sqrt((x(i)-x(j))**2 + (y(i)-y(j))**2 + (z(i)-z(j))**2)
K=K+s
end do
end do
p=(1/394)*(1/(2*pi*L)**1.5)*exp(-(K)**2/(2*L))*p0
write(*,*) p/p0
end do
end program density
can any one help me..
I have afortran program for calculating density and when I execute it gives me zero and error.
program density
implicit none
integer :: r,IDm,n,m,i,j
real :: xm,ym,zm,p,p0,k,pi,s,ri,rj,l
real, dimension(1000) :: x,y,z,ID
p0=0.17
k=0.0
L=4.33
pi=3.1415927
do n=1,3000
open(unit=5,file='/home/toshiba/Desktop/urqmd-3.3p2/format1.dat')
read(5,*) l,l,l,l
do m=1,400
read(5,*) xm,ym,zm,IDm
if(xm==400) exit
r=m
x(r)=xm
y(r)=ym
z(r)=zm
ID(r)=IDm
write(*,*) xm, ym, zm, IDm
end do
do i=1,r-1
x(i)=xm
y(i)=ym
z(i)=zm
do j=i+1,r
x(j)=x(i+1)
y(j)=y(i+1)
z(j)=z(i+1)
s=ri-rj
s=sqrt((x(i)-x(j))**2 + (y(i)-y(j))**2 + (z(i)-z(j))**2)
K=K+s
end do
end do
p=(1/394)*(1/(2*pi*L)**1.5)*exp(-(K)**2/(2*L))*p0
write(*,*) p/p0
end do
end program density
can any one help me..