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: compiler pr...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 14 Topic 8216 of 8774
Post > Topic >>

Re: compiler problem

by kargl@[EMAIL PROTECTED] (Steven G. Kargl) May 8, 2008 at 05:38 PM

In article
<c28af821-e279-42f8-8b8c-16204ef43d21@[EMAIL PROTECTED]
>,
	rudra <bnrj.rudra@[EMAIL PROTECTED]
> writes:
> hello friends,
> i was just trying to see the performance of different compiler
> (gfortran and ifort) and there is a problem inthis part of the code:
> "===============Creating Initial Configuration=============="
>  58         write(*,&
>  59         '(1x,"Minimum distance between any two particle is",
> 1x,f6.4)'),rcut    !rcut=1.5
>  60 !-----------------------------------------------
>  61 !          INITIALISE POSITION
>  62 !-----------------------------------------------
>  63 10        do i=1,ntot
>  64              x(i)=boxl*(ran(seed)-0.0)
>  65              y(i)=boxl*(ran(seed)-0.0)
>  66              z(i)=boxl*(ran(seed)-0.0)

Why subtract 0.0?

>  67              call pbc(x,y,z,boxl)
>  68          end do
>  69 !- - - - - - - - - - - - - - - - - - - - - - - -
>  70 !       KEEPING MINIMUM DIST. BETWEEN ANY TWO
>  71 !       ATOM GREATER THEN  RCUT
>  72 !- - - - - - - - - - - - - - - - - - - - - - - -

rcut2 = rcut**2

>  73          do i=1,nap-1
>  74            do j=i+1,nap
>  75             dx=x(i)-x(j)
>  76             dy=y(i)-y(j)
>  77             dz=z(i)-z(j)
>  78
>  79             dist=dsqrt(dx*dx+dy*dy+dz*dz)

Depending on the value of nap, it may be prudent to do

dist2 = dx*dx+dy*dy+dz*d

>  80             tr=tr+1
>  81 !                    write(*,*) tr
>  82             if (dist<rcut)go to 10

if (dist2 < rcut2) goto 10

>  83            end do
>  84         end do
>  85         write(*,'(1x,"Success after",1x,i0,1x,"try")')tr
>  86         call mindist(x,y,z)
>  87         write(*,*) &
>  88
> "==========================================================="
>  89         write(*,*) ""
>  90
>  91 !-----------------------------------------------
>  92 !       INITIAL CONFIGURATION DONE
>  93 !-----------------------------------------------
> while compiling with ifort, its converging after 160k steps, but even
> after waiting for 1000k steps with gfortran, its not
> converging......do you think its problem with ran? can you suggest a
> better way?

What is seed?  What is boxl()?

program a
  integer i, seed
  seed = 0
  do i = 1, 4
     print *, ran(seed)
  end do
  print *
  seed = 1
  do i = 1, 4
     print *, ran(seed)
  end do
  seed = 42
  do i = 1, 4
     print *, ran(seed)
  end do
end program a

RTFM?

-- 
Steve
http://troutmask.apl.wa****ngton.edu/~kargl/
 




 14 Posts in Topic:
compiler problem
rudra <bnrj.rudra@[EMA  2008-05-08 10:20:18 
Re: compiler problem
kargl@[EMAIL PROTECTED]   2008-05-08 17:38:04 
Re: compiler problem
rudra <bnrj.rudra@[EMA  2008-05-10 23:09:46 
Re: compiler problem
Craig Powers <craig.po  2008-05-12 13:57:31 
Re: compiler problem
glen herrmannsfeldt <g  2008-05-12 11:22:51 
Re: compiler problem
"Michael Metcalf&quo  2008-05-12 20:04:21 
Re: compiler problem
glen herrmannsfeldt <g  2008-05-12 13:17:13 
Re: compiler problem
Craig Powers <craig.po  2008-05-12 17:45:30 
Re: compiler problem
lindahl@[EMAIL PROTECTED]  2008-05-12 16:08:25 
Re: compiler problem
"Michael Metcalf&quo  2008-05-12 22:32:25 
Re: compiler problem
kargl@[EMAIL PROTECTED]   2008-05-12 18:09:13 
Re: compiler problem
rudra <bnrj.rudra@[EMA  2008-05-15 21:37:38 
Re: compiler problem
Craig Powers <craig.po  2008-05-16 01:28:35 
Re: compiler problem
Dick Hendrickson <dick  2008-05-16 15:00:55 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Sun Oct 12 23:34:57 CDT 2008.