Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsDiscussion Forum → FORTRAN Question
FORTRAN Question
2007-04-04, 11:51 AM #1
For a class project I'm updating an old FORTRAN (77?) program. I've tried several free compilers available online, and I have no problem compiling the base program. The issue comes when the execution reaches this block of code:

Code:
DIMENSION NUMB(10)

...

  200 FORMAT(/'  Enter N Number of Compounds and Compound Indexes' 
     */ 8X,'(N,N1,N2,...)')
      READ(*,201) N,(NUMB(I),I=1,N)
  201 FORMAT(17I10)


The input that is expected is something along the lines of 2,6,9 [enter]. The program will give an input error, the exact message depends on compiler, and then the program exits. I know this is the correct syntax because I have a compiled exe to test against.

Any ideas on how to fix this issue? I'd like to keep the input style the same since my professor is set in his ways and doesn't like change that much.

Thanks
Yet Another Massassi Map | Sadly I Have a Blog Too
2007-04-04, 2:10 PM #2
oh god not fortran, the poor mans code.
Code:
if(getThingFlags(source) & 0x8){
  do her}
elseif(getThingFlags(source) & 0x4){
  do other babe}
else{
  do a dude}
2007-04-04, 5:38 PM #3
Holy ****! When the hell did universities start teaching Fortran again? :confused:

Originally posted by Aaron:
...I know this is the correct syntax because I have a compiled exe to test against....

What guarantee do you have that the source you are hacking on is the same source that your exe was compiled from?

Perhaps if you explained this project a little further...
And when the moment is right, I'm gonna fly a kite.
2007-04-04, 5:58 PM #4
PURDUE still teaches FORTRAN, albeit only for a couple of weeks in introductory programming. :P

I can't help you, it's been so long I've forgotten all but everything in FORTRAN and PASCAL. :(
-=I'm the wang of this here site, and it's HUGE! So just imagine how big I am.=-
1337Yectiwan
The OSC Empire
10 of 14 -- 27 Lives On
2007-04-04, 6:21 PM #5
This is a FORTRAN program from the late 80s or early 90s that models a batch rectifying column (we're all mature here, lets keep it that way), and I'm modifying to work for a batch stripping column.

The particular step I've show you asks for the number of components (2) and the indices of two chemicals methanol (6) and ethanol (9) in a data file. The issue appears to be with the ',' in the input. There are many points throughout the program that ask for parameter1,parameter2 and I want to know how to change the code so that it works.

When compiled with FNT95:

Code:
  Enter N Number of Compounds and Compound Indexes
        (N,N1,N2,...)
2,6,9
At line 20 of file c:\apbeffp.for (Unit 5)
Traceback: not available, compile with -ftrace=frame or -ftrace=full
Fortran runtime error: Bad value during integer read


When compiled with Open Watcom

Code:
  Enter N Number of Compounds and Compound Indexes
        (N,N1,N2,...)
2,6,9
*ERR* IO-07 bad character in input field
Yet Another Massassi Map | Sadly I Have a Blog Too
2007-04-04, 6:24 PM #6
Tried compiling with G77?
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2007-04-04, 6:54 PM #7
Excellent, G77 worked, thanks.
Yet Another Massassi Map | Sadly I Have a Blog Too
2007-04-04, 8:09 PM #8
Emon is so smrt. :neckbeard:
-=I'm the wang of this here site, and it's HUGE! So just imagine how big I am.=-
1337Yectiwan
The OSC Empire
10 of 14 -- 27 Lives On
2007-04-04, 9:40 PM #9
I'm no neckbeard!!
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2007-04-04, 9:43 PM #10
??? Die Fortran, DIE!

↑ Up to the top!