- #1
dibloff
- 10
- 0
Hi Everyone.
I'm trying to compile an old Fortran code (~2000 lines) with GNU Fortran and could not make it work yet. The code is from an old book, and I do not know which Fortran compiler was used to make it work. I’m guessing it’s 77 cause in many places the program uses the “common blocks” subprograms.
Here is the portion of the code:
WRITE(15,992) MODEL,MODFHT,ICOMBM,ISAC
992 FORMAT(6X,1H*,4X,'COMBUSTION MODEL =',I8,13X,1H*/
1 6X,1H*,53X,1H*/
2 6X,1H*,4X,'HEAT TRANSFER MODEL =',I8,13X,1H*/
3 6X,1H*,53X,1H*/
4 6X,1H*,4X,'COMBUSTION DURATION MODEL =',I8,13X,1H*/
5 6X,1H*,53X,1H*/
6 6X,1H*,4X,'SPARK ADVANCE ANGLE (DEG) =',I8,13X,1H*/
7 6X,1H*,53X,1H*)
As you can see the format line continues through 7 more lines, and the GNU compiler does not like the continuation line the way it is. If I put an “&” at the end of each line (except the last one) it’ll not work, if I remove the numbering from column 6 it’ll not work either.
In another section of the code, where I define the common blocks if I use an “&” at the end of the line the continuation will work:
COMMON/THERM/DELTAT(5),HFGF(5),HRPF(5),MOLWTF(5),MOLWTP(5), &
P1,P2,P3,P4,T1,T2,T3,T4,T5,T6,TA,TF,TM,TREF,V1,V2,V3,V4
Even three lines:
COMMON/CPCOEF/ACPF(5),ACPO2,ACPN2,AL(5),AH(5),BCPF(5),BCPO2, &
BCPN2,BVL(5),BL(5),BH(5),CVL(5),CL(5),CH(5),CPA, &
CPFU(5),DL(5),DH(5)
Can you please give me an advice on how to tackle this. Any response is greatly appreciated. Thank you.
I'm trying to compile an old Fortran code (~2000 lines) with GNU Fortran and could not make it work yet. The code is from an old book, and I do not know which Fortran compiler was used to make it work. I’m guessing it’s 77 cause in many places the program uses the “common blocks” subprograms.
Here is the portion of the code:
WRITE(15,992) MODEL,MODFHT,ICOMBM,ISAC
992 FORMAT(6X,1H*,4X,'COMBUSTION MODEL =',I8,13X,1H*/
1 6X,1H*,53X,1H*/
2 6X,1H*,4X,'HEAT TRANSFER MODEL =',I8,13X,1H*/
3 6X,1H*,53X,1H*/
4 6X,1H*,4X,'COMBUSTION DURATION MODEL =',I8,13X,1H*/
5 6X,1H*,53X,1H*/
6 6X,1H*,4X,'SPARK ADVANCE ANGLE (DEG) =',I8,13X,1H*/
7 6X,1H*,53X,1H*)
As you can see the format line continues through 7 more lines, and the GNU compiler does not like the continuation line the way it is. If I put an “&” at the end of each line (except the last one) it’ll not work, if I remove the numbering from column 6 it’ll not work either.
In another section of the code, where I define the common blocks if I use an “&” at the end of the line the continuation will work:
COMMON/THERM/DELTAT(5),HFGF(5),HRPF(5),MOLWTF(5),MOLWTP(5), &
P1,P2,P3,P4,T1,T2,T3,T4,T5,T6,TA,TF,TM,TREF,V1,V2,V3,V4
Even three lines:
COMMON/CPCOEF/ACPF(5),ACPO2,ACPN2,AL(5),AH(5),BCPF(5),BCPO2, &
BCPN2,BVL(5),BL(5),BH(5),CVL(5),CL(5),CH(5),CPA, &
CPFU(5),DL(5),DH(5)
Can you please give me an advice on how to tackle this. Any response is greatly appreciated. Thank you.