converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 2

Liste des GroupesRevenir à cl fortran 
Sujet : converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 2
De : lynnmcguire5 (at) *nospam* gmail.com (Lynn McGuire)
Groupes : comp.lang.fortran comp.lang.c++
Date : 08. Apr 2025, 21:06:06
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vt3vje$2uq60$4@dont-email.me>
User-Agent : Mozilla Thunderbird
On 11/23/2022 5:36 PM, Tran Quoc Viet wrote:
 > On Saturday, November 19, 2022 at 1:01:25 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++. With all that code,
 >> we produce four Win32 EXEs and three Win32 DLLs. My goal is to add four
 >> Win64 EXEs and three Win64 DLLs to the product with the same
 >> capabilities as the Win32 versions (console, windowed, Excel callable,
 >> Excel embeddable). Plus support for Unicode named files and Unicode
 >> file paths.
 >>
 >> I am using a customized version of f2c at the moment to automate 80% of
 >> the conversion from F77 to C++. I have added support for logical*8,
 >> changed the output file from *.c to *.cpp, added an include for the
 >> Fable fem.hpp template library, removed the trailing underscores from
 >> the subroutine and common block names, removed the ftnlen arguments from
 >> the character arguments, converted all F77 comments to the // instead of
 >> the /* */, and a few other items. If desired, I am willing to post a
 >> copy of my modified f2c on my website with the source code.
 >> https://netlib.org/f2c/
 >> https://en.wikipedia.org/wiki/F2c
 >>
 >> f2c does not get me totally there. The Fortran character strings were
 >> poorly handled so they will probably needed fixing for proper sizing and
 >> alignment. The f2c i/o code is crap so I take the original F77 i/o code
 >> and translate it by hand. The arrays in the argument list are still
 >> based at an index of one so I convert those to base index of zero by
 >> hand. All of the local and common block arrays were converted to a base
 >> index of zero by f2c. I add the new *.cpp file to my Visual Studio
 >> project. I then add the new function prototypes to my prototypes.h file
 >> and I add any new common block structures to my commons.h file. I then
 >> compile and fix until I get a clean compile.
 >>
 >> I have converted over 29,000 lines of F77 code to C++ now. Almost a
 >> hundred subroutines and several dozen common blocks. Most are compiling
 >> cleanly in Visual C++ 2015. My testing is working well with the
 >> problems being in the character string area. I am still aiming for
 >> Christmas for completing the small data analysis program in my
 >> calculation engine. It is somewhere around 150,000 lines of F77 code.
 >> Tough to tell since it shares so much code with my big calculation
 >> engine which is around 600,000 lines of F77 code and 50,000 lines of
 >> C++. They share about 75,000 lines of F77 and C++ code.
 >>
 >> Thanks,
 >> Lynn
 > Thank you for sharing your experience on that tough work. For years I  > had also paid lots of effort to convert all F77 codes to modern Fortran and I stopped that job because I found its nonsense. Is that how we are removing Fortran from its world?
 > I am having problems mixing C++ and Fortran code in Visual Studio so I
 > am trying to move to all C++. I suspect if I was all Fortran then my
 > life would be easier.
 > Lynn
I am back on this project again.  I have converted over 100,000 lines of the F77 code to C++ now and am debugging character string issues.
I tried GFortran and GCC with Simply Fortran for a long while but the debugging is simply horrible.  And I was rewriting too much of the C++ code from F77 to F2003+.
Lynn

Date Sujet#  Auteur
8 Apr 25 * converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 234Lynn McGuire
9 Apr 25 +* Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 24Sam
9 Apr 25 i`* Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 23Lynn McGuire
10 Apr 25 i `* Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 22Michael S
10 Apr 25 i  `- Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 21Lynn McGuire
9 Apr 25 +* Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 22Chris M. Thomasson
9 Apr 25 i`- Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 21Lynn McGuire
9 Apr 25 +* Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 225Lawrence D'Oliveiro
9 Apr 25 i`* Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 224Lynn McGuire
10 Apr 25 i +* Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 26Lawrence D'Oliveiro
10 Apr 25 i i`* Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 25Lynn McGuire
10 Apr 25 i i `* Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 24Lawrence D'Oliveiro
10 Apr 25 i i  `* Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 23Lynn McGuire
11 Apr 25 i i   `* Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 22Thomas Koenig
11 Apr 25 i i    `- Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 21Lawrence D'Oliveiro
11 Apr 25 i `* Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 217Bonita Montero
11 Apr 25 i  `* Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 216Steven G. Kargl
11 Apr 25 i   +* Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 22James Kuyper
11 Apr 25 i   i`- Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 21Steven G. Kargl
11 Apr 25 i   +- Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 21Lynn McGuire
11 Apr 25 i   `* Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 212Lynn McGuire
13 Apr 25 i    `* Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 211Lynn McGuire
14 Apr 25 i     `* Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 210Lawrence D'Oliveiro
15 Apr 25 i      `* Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 29Lynn McGuire
16 Apr 25 i       `* Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 28Lawrence D'Oliveiro
16 Apr 25 i        `* Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 27Lynn McGuire
16 Apr 25 i         +* Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 25Lawrence D'Oliveiro
16 Apr 25 i         i+* Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 23Steven G. Kargl
17 Apr 25 i         ii`* Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 22R Daneel Olivaw
17 Apr 25 i         ii `- Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 21Steven G. Kargl
16 Apr 25 i         i`- Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 21Lynn McGuire
16 Apr 25 i         `- Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 21Lynn McGuire
22 Apr05:53 `* Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 22David Duffy
22 Apr06:14  `- Re: converting a 700,000+ line Fortran 77 plus 50,000+ line C++ program to C++, part 21Lynn McGuire

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal