Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to compile and run as batch?

Status
Not open for further replies.

ESPcomposites

Aerospace
Jul 27, 2010
692
I am pretty clueless with Fortran, but would like to convert the following fortran code into a batch mode input


- What compiler should I use? G95 seems like a good choice.

- How do I convert it so that it accepts a batch file as input rather than command line?

- What type of modifications to source code need to done to get it to up to par (i.e. fixed format to free format, etc.)

Are there any good manuals on this kind of thing? Thanks for any help.

Brian
 
Replies continue below

Recommended for you

What kind of batch mode? A simple file read would get you the inputs from the file.

TTFN

FAQ731-376
 
Brian,

I hope you don’t mind me saying so, but this source code requires the attention of an experienced fortan user, not a novice. From a quick scan, I can see that it is old, very old, written in fortran IV or earlier, using Hollerith data and mixing integers with Hollerith data. This has not been part of the standard since before fortran 77, although many current compilers still allow it for the sake of backwards compatibility.

But more seriously there is a severe problem with the code, the GOTO statement on line 128 points to label 240 which is inside the DO 280 and DO 270 loops with the GOTO statement being outside both of these DO loops. This is illegal, because the DO loop counters will not have been given a value when the program flow reaches their CONTINUE statements.

Silverfrost FTN95 correctly refuses to compile the code with this error whilst gfortran does compile the code as it stands but issues a warning message about this problem.

I suggest that you find an experienced fortran programmer to help you.



 
Johnhors,

Thanks for the advice. I am aware of this potential problem with the loop, but "heard" that it would still properly run regardless of this. Either way, this is probably out of my domain and I will need to get someone else involved.

Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor