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 > open file in su...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 5 Topic 8165 of 8551
Post > Topic >>

open file in subroutine

by wangning16934@[EMAIL PROTECTED] Apr 23, 2008 at 01:55 AM

I had already produce an open file with data in the main program, but
I want to use the data in the file in the subroutine. However,it seems
didn't use when I call it. I don't know what's wrong,please help me!
Thank you very much!

subroutine get_trio

 .......

   open(111, file="surf_111_3.dat")
   open(112, file="random.dat")

   do i=1,200
      read (111,*) k, posx(i),
posy(i)
   end do

   read(111,*) a
   do i =1, 25
      write (112,"(25( i3,f6.1,f6.1))") a(i), posx(a(i)), posy(a(i))
   end do

  .......
   do i = 1, n
      do j = i + 1, n
        rxij = posx(a(i)) - posx(a(j))
        if (abs(rxij) .gt. l/2)  then
        rxij = l - abs(rxij)
        end if
        ryij = posy(a(i)) - posy(a(j))
        if (abs(ryij) .gt. l/2)  then
        ryij = l - abs(ryij)
        end if
        disij = sqrt(rxij**2 + ryij**2)
.......
It said that a scalar-valued expression is required in this context.
 




 5 Posts in Topic:
open file in subroutine
wangning16934@[EMAIL PROT  2008-04-23 01:55:22 
Re: open file in subroutine
Klaus Wacker <wacker@[  2008-04-23 09:37:03 
Re: open file in subroutine
Dick Hendrickson <dick  2008-04-23 13:06:09 
Re: open file in subroutine
blitheli <blitheli@[EM  2008-04-23 06:03:35 
Re: open file in subroutine
Terence <tbwright@[EMA  2008-04-23 22:24:42 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Fri Jul 25 16:56:41 CDT 2008.