How to convert FORTRAN files (.F) of before 1990s to MATLAB files ?
Show older comments
I have files which were developed before the era of .f90 (file format of FORTRAN after 1990). I want to compile them in MATLAB. I am looking if anyway this is possible to do in MATLAB.
5 Comments
dpb
on 15 Aug 2021
The current Fortran Standard still supports fixed-form as well as free-form source so any current supported compiler can be used.
Sambit Supriya Dash
on 27 Aug 2021
dpb
on 27 Aug 2021
https://www.mathworks.com/support/requirements/supported-compilers.html is the official Mathworks link -- all they actually support is the Intel Fortan compiler; whether it is still possible to build a mex file with GFortran or another vendor's Fortran compiler I do not know--at one time, it was trivial, but that's been a number of years ago.
Unfortunately, TMW has essentially abandoned Fortran and has done little or nothing to keep up; I gave it up quite a number of years ago when I retired from the "real" consuting gig and no longer had a pressing need. I had attempted to continue to use the previous compiler that I had used after it was dropped from official support and that experiment was not successful While one could compile and link to the standard libraries, it appeared that they had poisoned the generated .mex files with a specific release/version number such that the MATLAB interpreter wouldn't even try to load them. All in all, very disappointing and rude and the impression I was left with was that they were doing everything they could to keep from continuing to support Fortran at all.
Good luck; depending upon your circumstances, there may be a path towards the Intel compiler that is cost-free if the usage is not commercial--otherwise, it's pretty pricey. Whether it's possible to use GFortran or not I don't know; clearly it should be; they support the C/C++ compiler for which GFortran is just the front end so obviously the object code generated would be fine if they haven't continued the thing I ran into that the system just wouldn't run the generated mex code.
Sambit Supriya Dash
on 29 Aug 2021
dpb
on 29 Aug 2021
Good luck -- and let us know how it goes, good or bad.
And, complain vociferously to TMW about their lack of support to the scientific computing community.
Accepted Answer
More Answers (0)
Categories
Find more on Fortran with MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!