I completely agree and support the suggestion of Alex.
It seems that with the FTN95 .NET compiler option Fortran has become one of several .NET languages which communicate through the Common Intermediated Language. Recent own tests show that it is possible to call within Visual Studio a Fortran program (project) as dll from another project written in another .NET language, in my case C#. This is similar to call a C# project from a Visual Basic project which for instance organizes the GUI.
For doing this, the Fortran main program should best be condensed to a subroutine, say “Subroutine DriverProgramxy”. This subroutine is just called as method from the C# project (“ DRIVERPROGRAMXY(); ”). That is all. Any single subroutine could be called in a similar way. Does this .NET multilingual approach not seem to be extremely promising? It could help keeping older Fortran programs alive with a very reasonable effort.
The Fortran project which I used for testing is of small to medium size but of rather high complexity, i.e. all “interesting” Fortran features are included. As Fortran program it has been tested successfully also with other Fortran compilers.
The good message is -as mentioned above- that calling the Fortran program from a C# program finally worked. The less good message is that during the analyses I experienced numerous problems, for example:
For Plato 4.83 only 8 of the compiler options work; Checkmate x64 fails. For Visual Studio Community 2015 with the Ftn95 plug-in Checkmate .NET fails.
The result for producing dlls is even more problematic:
Plato 4.83 does not produce any of the win32 dlls (error message is “Cannot create DLL: nothing to export”). However, the .NET and win64 dlls are produced which indicates that for these options the defaults are set correctly. The .NET Release dll has been used for testing.
For Visual Studio Community 2015 with the Ftn95 plug-in the Fortran dlls cannot be created. The error message is either again “Cannot create DLL: nothing to export” or an *.pdb file is created instead of the dll file set in the project property window. Here my knowledge is simply insufficient and as user I would need more detailed information.
It is relatively unclear what additional libraries must be added as reference. I have referenced ftn95lib.dll. However, there are two further libraries (ftn95lib.mdl and ftn95lib1.mdl), which are not accepted by Visual Studio to be included as reference. I have simply copied both into the directories Debug and Release of the C# project.
In summary: The multilingual .NET approach seems to be promising, but the Ftn95 plug-in for Visual Studio needs further attention and documentation. A revised plug-in for Visual Studio Community 2017 could be an important contribution for using the many older Fortran programs in a modern environment.
Klaus