Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Unclassifiable Statement error in fortran 90

  1. Feb 18, 2012 #1
    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..
     
  2. jcsd
  3. Feb 18, 2012 #2

    AlephZero

    User Avatar
    Science Advisor
    Homework Helper

    The [ ] should be ( ).

    Also 1exp24 should be 1e24, unless 1exp24 is a F90 "enhancement" over F77 that I don't know about.
     
  4. Feb 19, 2012 #3

    Mark44

    Staff: Mentor

    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.
     
  5. Feb 19, 2012 #4

    AlephZero

    User Avatar
    Science Advisor
    Homework Helper

    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.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook