How to convert FORTRAN files (.F) of before 1990s to MATLAB files ?

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

The current Fortran Standard still supports fixed-form as well as free-form source so any current supported compiler can be used.
Your suggestion is valuable for me, it would be an immense value addition if you could please provide any compilers' links (or) names, so that I and people who will see this section would be benefitted.
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.
@dpb I agree with your words, I would check with GFortran. Thank you for such information
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.

Sign in to comment.

 Accepted Answer

You can try f2matlab from the File Exchange.
Although it apparently only converts F90 files, the documentation there states that there are also utilities that conver older Fortran formats (e.g. F77) to F90.

1 Comment

Wow! This is very helpful, thanks for sharing, but the conversion from 77 to 90 is still bothering in thhe explanations, not very clear.

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!