Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28489 Discussions

Use another Fortran project in my new project

Karim_M_
Beginner
337 Views

I have different Fortran projects. If I want to use some of these projects in my new project, I have to change that projects in the format of modules, subroutines, functions or dll files and include them as part of my new project which is time consuming. Please let me know if there is any possibility to put all these projects in a solution file and call a project when I need it.

If there is such a possibility, please let me know if it is also possible to send data from one project to another project.

For example, I have a project that open a file and read a matrix in that file and invert it. I want to use this project in my new project without changing it to the module, subroutine, function or dll file. If there is possibility to use that project in my new project, please also let me know if it is possible to send the matrix directly to the project which invert it instead of writing the matrix in a file. 

0 Kudos
1 Reply
Steve_Lionel
Honored Contributor III
337 Views

Projects are just parts of a program (or the whole program). I gather that your existing projects are each standalone programs, and that explains why you have to make changes if you want to combine them.  A solution can contain many projects, but only one of them can have a main program to produce an executable. All the others need to be library projects that are then linked into the main program project.

It is possible to share data across separate programs, but that is an advanced topic and still requires rewriting the code. It is probably best if you modify the code that "uses" the data to be a module with procedures that you then call.

0 Kudos
Reply