Unclassifiable Statement error in fortran 90

  • Context: Fortran 
  • Thread starter Thread starter Sandbox.WeC
  • Start date Start date
  • Tags Tags
    Error Fortran
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
3 replies · 15K views
Sandbox.WeC
Messages
5
Reaction score
0
I'm writing this program for an assignment and I have run into a roadblock. I thought it was a pretty simple program, but I think my lack of experience with fortran is working against me.. Here is the bare code:

Program Readfile
implicit none
real(kind=8)::x,y,z,u,v
integer::n

OPEN(unit=12,file="file1.data")
OPEN(unit=13,file="file2.data")

read(12,*)
read(12,*)

DO n=1,38,1
read(12,*)x,y
z = LOG10[x]
u = LOG10[y]
v = LOG10[(x*x*x*y)/(1exp24)]
write(13,*)x,y,z,u,v
END DO

close(12)
close(13)
END PROGRAM

It is a simple concept. All it has to do is open file1 to get 2 values, then write in file2 those values, and a couple functions of them. The read(12,*) lines are used to skip the first two lines in file one, because they are junk. I am doing n=1,38 because there are 38 lines the program must do this to. The problem arises with the z= , u= , and v= statements. When I compile using the command gfortran file.f90 -o file.o it comes back and gives me Unclassifiable statement errors for all 3. What is my problem? Sorry if it is really obvious..
 
Physics news on Phys.org
In addition to what AlephZero said, your first two READ statements are probably causing problems. These statements require one or more variables for the value(s) read to be stored in. I haven't written any fortran code for about 15 years, but I think this is correct.

Does your compiler give the line number of the unclassifiable statement? That would be helpful information.
 
Mark44 said:
In addition to what AlephZero said, your first two READ
statements are probably causing problems. These statements require one or more variables for the value(s) read to be stored in.

I think those are OK. They will read and ignore the first two lines of the file, assuming that's what the OP wants to do.