On Wednesday, October 26, 2022 at 9:38:40 AM UTC-7,
rym...@outlook.com wrote:
> On Sunday, October 23, 2022 at 3:16:48 PM UTC-7, Lynn McGuire wrote:
> > We are converting a 700,000+ Fortran 77 lines of code plus 50,000+ C++
> > lines of code engineering software product to C++.
(snip)
> I'm not trying to be a smart ass or a troll and I'm not trying to change your mind.
> I'm wondering why you want to convert all of the F77 to C++ rather than to
> modern Fortran that can call or be called from the existing C++ routines.
I suspect that there are many different reasons, so no easy answer.
> As a side note, I used to work for a group at Oak Ridge National Laboratory
> (ORNL) that developed the SCALE code system that is used for nuclear analysis.
> A lot of effort was spent many years ago converting it from F77 to Fortran 9x.
So, converting Fortran 66 style DO loops to DO/ENDDO, and IF to
IF/THEN/ELSE? Or to array expressions instead of loops?
That can make it a lot more readable, but not so much more.
Does it also now use dynamically allocated memory?
> Now, after addition of a number of computer science trained staff to that group
> over the years from the late 1990s to the present, everything is slowly being
> converted to C++. A number of the SCALE codes are being changed to run on
> massively parallel machines, but there are libraries for both Fortran and C++
> available for such machines. I have my suspicions why they are converting but
> that is irrelevant here.
Well, one reason might be that there are more people interested in
working on the C++ version. That is pretty much independent of the
features and abilities of the languages.
> Is there a reason such as availability of certain libraries or code efficiency that
> you want to convert all your F77 code to C++?
Some of the C++ libraries are likely already translation from Fortran.
> The reason I am interested is that I have some old F77 code that ran on IBM
> mainframes, Unix workstations, and DOS PCs which I want to document and
> revive to run on Windows and Linux now that I am retired and have the time.
gfortran can easily run F77 code on any of those systems.
Last year I had IBM's ECAP running on gfortran. That goes back to
Fortran II days, though was translated to Fortran IV pretty far back.,
There were a few complications in doing it, but not much.
I also had Spice 2g6 running, the last of the Fortran Spice versions.
> I had a C/C++ class in the late 1990s but never used any of it at work. I am
> taking some online self study classes in C/C++ so that I can at least read a
> little of existing codes and use it in my project if I find it useful.
If you aren't already into C or C++, not much reason to do it.
Well, maybe as a reason to learn/improve your C++ skills.
Otherwise, you can slowly convert to newer forms as you feel
like it, and keep the old ones running as they are.