CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Main CFD Forum (
-   -   Fortran- linking object file with for. files (

mazdak January 4, 2013 16:50

Fortran- linking object file with for. files
Hi Dears
I have an object file and 3 .for files.
The Object file is a solver.
How can i link those 3 files with the object file in Intel Visual FORTRAN?

DoHander January 4, 2013 16:59

1. The compiled file (obj) was generated by Intel Visual Fortran from a Fortran (for) source file ?

2. Any chance to access the source for the solver ?

3. Do you know what is in the solver file ? I mean the subroutines and functions declarations etc ...

You could try to do this in a Terminal, something like:

ifort file1.for file2.for file3.for solver.obj

mazdak January 4, 2013 17:22

1- i dont know
2- no
3- it solves u, v, k, e, p equations. as a matter of fact it is for 2-d turbulent channel flow.

i can not understand what you mean by last line that you have written.

DoHander January 4, 2013 17:55

Say that you have 3 Fortran source files (ending in .for) named here file1.for, file2.for, file3.for and an obj file named solver.obj. In order to link the above 4 files into one executable (I'm assuming here that one of your .for files is the main program) you could use Intel Visual Fortran from the command line. The Fortran compiler is named "ifort".

Compiling and linking the above 4 files can be, theoretically, done with this command:

ifort file1.for file2.for file3.for solver.obj

where, obviously, you will substitute your real file names for file1.for etc ...

mazdak January 4, 2013 18:18

error #5082: Syntax error, found IDENTIFIER 'FILE1' when expecting one of: ( % : . = =>

i dealt with above error. where should i put those 4 files, in which directory.

All times are GMT -4. The time now is 23:11.