Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
12 Views

Use another Fortran project in my new project

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
Highlighted
Black Belt Retired Employee
12 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