[gradsusr] Fortran Code

Konstantinos Eleftheratos kelef at geol.uoa.gr
Wed Nov 28 00:46:26 EST 2012


Hi Ali

 

You define your file 'u' as integer which is wrong. It has to be defined as
character.

Integers are numbers, but file names are characters.

 

Something else

In the command,  read(u,*) n , 

You have not defined n and this may cause other error. 

 

Good luck,

Kostas Eleftheratos

 

 

 

 

From: gradsusr-bounces at gradsusr.org [mailto:gradsusr-bounces at gradsusr.org]
On Behalf Of Ali Demir
Sent: Tuesday, November 27, 2012 9:23 PM
To: gradsusr at gradsusr.org
Subject: [gradsusr] Fortran Code

 


 

  _____  

 

Dear All,
I keep on my doctorate program.Grads is one of softwares which will be used
on my studies.
My fortran code to open and  see files extended "dat" is below,but ı cant
open file extented dat,,any idea? 
Thanks for your assistance.

Regards,
Ali Demir KESKİNER         
 
            

program points

integer nmax, u

parameter (nmax=1000, u=20)

real x(nmax), y(nmax), z(nmax)

open (u, FILE='points.dat', STATUS='OLD')

read(u,*) n

if (n.GT.nmax) then

write(*,*) 'Error: n = ', n, 'is larger than nmax =', nmax

goto 9999

end if

do 10 i= 1, n

read(u,100) x(i), y(i), z(i)

10 end do

100 format (3(F10.4))

close (u)

9999 stop

end

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20121128/9614f249/attachment-0003.html 


More information about the gradsusr mailing list