1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Help with Fortran compile error.

  1. Jan 15, 2012 #1
    1. Hello, I'm doing undergraduate research which requires the use of Fortran. I have one particle line of code that is not allowing me to compile the source. I was wonderding if someone can help?

    909 FORMAT(i3,2x,<nvmax>(<nvmax>i1,2x),2x,i4)




    2. Provides the error message:

    ../gensc.f90:289.18: Error: Unexpected element '<' in format string at (1)





    3. I'm not very familiar with the language yet, but I did try breaking up the code into two lines with the use of &&. I've also tried inserting spaces between all the "<" and ">". Any help would be greatly appreciated.
     
    Last edited: Jan 15, 2012
  2. jcsd
  3. Jan 15, 2012 #2

    NascentOxygen

    User Avatar

    Staff: Mentor

    It is conventional to use <num> to indicate that you need to insert your own data value here. You should omit the angle brackets.

    I'm speaking generally, not specifically of Fortran of which I've forgotten much.
     
  4. Jan 16, 2012 #3
    I'm at work now, but I can't believe I didn't see this sooner! Now I'm excited to get home :-).

    Thank you so much!
     
  5. Jan 17, 2012 #4
    That didn't fix the compile error, but after reviewing all the code it appears that the line in question is never called on. I'm going to remove it and see if I can get my desired results.
     
  6. Jan 18, 2012 #5

    NascentOxygen

    User Avatar

    Staff: Mentor

    nvmax looks like both the number of particular data values per line and the number of digits in each of those data values. If stuck, try 25 and see how it goes. It should be obvious if it is not a good choice for printing. I presume it's printing? :smile:

    909 FORMAT(i3,2x,25(251,2x),2x,i4)
     
  7. Jan 18, 2012 #6

    Mark44

    Staff: Mentor

    I would try
    909 FORMAT(i3,2x,25(25i1,2x),2x,i4)

    IOW, there is an 'i' missing in the innermost set of parentheses.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Help with Fortran compile error.
  1. Java compiler error (Replies: 3)

  2. Fortran help (Replies: 16)

Loading...