Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fortan runtime error

Status
Not open for further replies.

DMayson

MIS
Dec 19, 2010
5
AU
Hi all I'm doing a 3 month research placement at my uni and I need to use a Fortran 77 program written in GERMAN 30 years ago. I'm trying ot fix a problem, the program runs but when it's done a batch of calculations instead of starting the next data file batch it shows
?FORTRAN Runtime Error:
?BLOCK= only valid for unformatted sequential files
?OPEN(UNIT=5,.....
C:\Users\new user\...etc

I don't really have the time on this program to completely learn Fortran so any help would be great.

I've tried debugging but I haven't had too much success
Thanks
Dylan
 
At a guess, your program writes data to a file then closes it and reopens it to do something else.

Could you post the code for the open statement?

If you are using g77 or gfortran, use the -g compile option for debugging symbols.
 
Translated code where the OPEN error occurs.
I'm not sure what or where the BLOCK error occurs..???

Any assistance welcomed!
Thanks Dylan.

SUBROUTINE UMGRUP3
! Regrouping of 'Steuerkurven1'; output to 'cams'
REAL PHI (1000), PHI1 (1000), AE1 (1000), AE2 (1000)
CHARACTER * 72 TEXTWEG
OPEN (5, FILE = 'Steuerkurven1')
READ (5, *) TEXTWEG
I = 1
DO
READ (5, *, END = 10), PHI (I), AE1 (I), AE2 (I)
I = I +1
CYCLE
10 II = I-1
EXIT
ENDDO
CLOSE (5)
DO I = 1, II
PHI (I) = PHI (I) +360.
IF (PHI (I). GT. 720th) PHI (I) = PHI (I) -720.
PHI1 (I) = PHI (I)
ENDDO
CALL SORT2 (II, PHI, AE1)
DO I = 1, II
PHI (I) = PHI1 (I)
ENDDO
CALL SORT2 (II, PHI, AE2)
OPEN (5, FILE = 'cams', STATUS = 'UNKNOWN')
WRITE (5.111)
111 FORMAT ('PHI', 2X, 'AE1/AKS', 2X, 'AE2/AKS')
DO I = 1, II
WRITE (5, '(E12.6, 3X, E12.6, 3X, E12.6) ') PHI (I), AE1 (I), AE2 (I)
ENDDO
CLOSE (5)
OPEN (5, FILE = 'Steuerkurven1', DISPOSE = 'DELETE')
CLOSE (5)
RETURN
END
 
There are 5 BLOCK data sets in the program, this is one (translated from the german) as an example.

Thanks Dylan.

BLOCK DATA STODAT
! Material data for the JANAF Thermo-Chemical Tables
! All thermodynamic variables are the basic units
! M, KG, S, K, or in KMol coherent derived units
! used
REAL MOLM
CHARACTER NAM * 4, * 4 NAME
COMMON / STOFF1 / TREF (30) HREF (30), SREF (30), HBS
COMMON / STOFF2 / COEFC (30.8), COEFH (30.9), COEF (30,9)
COMMON / STOFF3 / NSTO, NGRUP IST (9.30), NS (9), MOLM (30)
COMMON / STOFF5 / NAM (30), NAME (30)
! 24 substances / 9 material groups with 6, 7, 11, 10, 11, 9, 8, 18, 12 species
DATA NSTO, NGRUP, NS (1), NS (2), NS (3), NS (4), NS (5), NS (6), NS (7)
& NS (8), NS (9) /
& 24, 9, 6, 7, 11, 10, 11, 9, 8, 18, 12 /

! Group 1:
! Mixture of moist air and residual gas or schematic
! Combustion gas / O2, N2, H2O, CO2, H2, CO /
DATA IS (1,1), IS (1,2) IS (1,3), IS (1,4) IS (1,5), IS (1.6) /
& 1,2,3,4,5,6 /

! Group 2:
! Mixture of moist air, fuel and residual gas, O2, N2, H2O,
! CO2, H2, CO, FUEL (default: IKRA = 1)
DATA IS (2,1), IS (2,2), IS (2,3), IS (2.4), IS (2.5), IST (2.6)
& IS (2,7) /
1,2,3,4,5,6,14 & /

! Group 3:
! Dissociated combustion gas / O2, N2, H2O, CO2, H2, CO, NO, OH, O, H, N /
DATA IS (3,1) IS (3,2), IS (3.3), IS (3,4), IS (3.5), IS (3.6)
& IS (3,7), IS (3.8), IS (3.9), IS (3.10), IS (3.11) /
& 1,2,3,4,5,6,7,8,9,10,11 /

! Group 4:
! Reactive fresh gas with generalized species Y1, Y2, Y3
! Mixture of moist air, fuel and residual gas, O2, N2, H2O,
! CO2, H2, CO, FUEL (default: IKRA = 1), Y1, Y2, Y3
DATA IS (4,1), IS (4.2), IS (4.3), IS (4,4), IS (4.5), IS (4.6)
& IS (4,7), IS (4.8), IS (4.9), IS (4.10) /
& 1,2,3,4,5,6,14,20,20,20 /

! Group 5:
! Reactive = fresh gas with generalized species Y1 = X, P Y2, Y3 = I, Y 4 = Y
! According to AC 5-step mechanism
! Mixture of moist air, fuel and residual gas, O2, N2, H2O,
! CO2, H2, CO, FUEL (default: IKRA = 1)
! IKLOPF = 31 => Super gasoline
! IKLOPF = 32 => Normal gasoline
! IKLOPF = 33 => i-octane
! IKLOPF = 34 => n-heptane
DATA IS (5,1), IS (5,2), IS (5.3), IS (5.4), IS (5.5), IS (5.6)
& IS (5,7), IS (5.8), IS (5.9), IST (5:10), IS (5.11) /
& 1,2,3,4,5,6,14,21,22,23,24 /

! Group 6:
! Reactive fresh gas with generalized species Y1, Y2
! Mixture of moist air, fuel and residual gas, O2, N2, H2O,
! CO2, H2, CO, FUEL (default: IKRA = 1), Y1, Y2
DATA IS (6,1), IS (6.2), IS (6.3), IS (6.4), IST (6.5), IS (6.6)
& IS (6.7), IST (6.8) IS (6,9) /
& 1,2,3,4,5,6,14,20,20 /

! Group 7:
! Reactive fresh gas with generalized species Y1
! Mixture of moist air, fuel and residual gas, O2, N2, H2O,
! CO2, H2, CO, FUEL (default: IKRA = 1), Y1
DATA IS (7.1), IST (7.2) IS (7.3), IST (7.4) IS (7.5), IST (7.6)
& IS (7.7), IS (7.8) /
& 1,2,3,4,5,6,14,20 /

! Group 8:
! Reactive fresh gas with generalized species Y1
! Mixture of moist air, fuel and residual gas, O2, N2, H2O,
! CO2, H2, CO, FUEL (default: IKRA = 1), Y1
DATA IS (8,1), IS (8.2), IS (8.3), IST (8.4), (8,5), IS (8.6)
& IS (8.7), IST (8.8), IS (8.9), IS (8.10), IS (8.11), IS (8.12)
& IS (8.13), IS (8.14), IS (8.15), IS (8.16), IS (8.17), IS (8.18) /
& 1,2,3,4,5,6,14,20,20,20,20,20,20,20,20,20,20,20 /

! Group 9:
! Dissociated combustion gas + fuel / O2, N2, H2O, CO2, H2, CO, NO, OH, O, H, N,
! FUEL (default: IKRA = 1) /
DATA IS (9,1), IS (9.2), IS (9.3), IS (9.4), IS (9.5), IS (9.6)
& IS (9.7), IS (9.8), IS (9.9), IS (9.10), IS (9,11), IS (9.12) /
1,2,3,4,5,6,7,8,9,10,11,14 & /

DATA NAM (1), MOLM (1), TREF (1), HREF (1), SREF (1) / 'O2', 32.000,
& 1800.00, 0.604113E 08, 0.264877E 06 /
DATA COEFC (1.1), COEFC (1.2), COEFC (1.3), COEFC (1.4), COEFC (1.5)
& COEFC (1.6), COEFC (1.7), COEFC (1.8) /
& 29144.714, -6.9934525, .039082237, -. 44419586E-4, 2.3778324E-8,
&-6.5170704E-12 8.5651955E-16-3.9976736E-20 /

DATA NAM (2), MOLM (2), TREF (2), HREF (2), SREF (2) / 'N2', 28 016,
& 1800.00, 0.576899E 08, 0.248361E 06 /
DATA COEFC (2.1), COEFC (2.2), COEFC (2.3), COEFC (2.4), COEFC (2.5)
& COEFC (2.6), COEFC (2.7), COEFC (2.8) /
& 30822.244, -14.305845, .035684725, -. 28461635E-4, 1.0603679E-8,
&-1.6980689E-12 2.2315948E-17 1.5511485E-20 /

DATA NAM (3), MOLM (3), TREF (3), HREF (3), SREF (3) / 'H2O', 18 016,
& 1800.00,-0.166517E 09 0.259435E 06 /
DATA COEFC (3.1), COEFC (3.2), COEFC (3.3), COEFC (3.4), COEFC (3.5)
& COEFC (3.6), COEFC (3.7), COEFC (3.8) /
& 32974.526,0.41256461, .0038240883, .15080271 e-4-1.6314188E-8,
& 6.3467123E-12,-1.0695831E-15 6.3525692E-20 /

DATA NAM (4), MOLM (4), TREF (4), HREF (4), SREF (4) / 'CO2', 44 011,
& 1800.00,-0.304548E 09 0.303086E 06 /
DATA COEFC (4.1), COEFC (4.2), COEFC (4.3), COEFC (4.4), COEFC (4.5)
& COEFC (4.6), COEFC (4.7), COEFC (4.8) /
& 19263.242,78.780796, -. 07393926, .4246215 E-4,-1.4988464E-8,
& 3.0712939E-12,-3.1570701E-16 1.0763632E-20 /

DATA NAM (5), MOLM (5), TREF (5), HREF (5), SREF (5) / 'H2', 2016,
& 1800.00, 0.546545E 08, 0.184847E 06 /
DATA COEFC (5.1), COEFC (5.2), COEFC (5.3), COEFC (5.4), COEFC (5.5)
& COEFC (5.6), COEFC (5.7), COEFC (5.8) /
& 23620.204,29.38444, -. 059 283 377, .60292015 e-4-3.1242813E-8,
& 8.5012123E-12,-1.1318636E-15 5.5347491E-20 /

DATA NAM (6), MOLM (6), TREF (6), HREF (6), SREF (6) / 'CO', 28 011,
& 1800.00, 0.55651E-08, 0.254968E 06 /
DATA COEFC (6.1), COEFC (6.2), COEFC (6.3), COEFC (6.4), COEFC (6.5)
& COEFC (6.6), COEFC (6.7), COEFC (6.8) /
& 30781.297, -15.076948, .041008646, -. 35705534E-4, 1.4953561E-8,
&-3.0156627E-12 2.1667549E-16 4.6884484E-21 /

DATA NAM (7), MOLM (7), TREF (7), HREF (7), SREF (7) / 'NO', 30 008,
& 1800.00, 0.149624E 09, 0.269357E 06 /
DATA COEFC (7.1), COEFC (7.2), COEFC (7.3), COEFC (7.4) COEFC (7.5)
& COEFC (7.6), COEFC (7.7), COEFC (7.8) /
& 33470.089, -26.872294, .066960923, -. 62751736E-4, 2.9679477E-8,
&-7.3155604E-12 8.4806665E-16-3.125441E-20 /

DATA NAM (8), MOLM (8), TREF (8), HREF (8), SREF (8) / 'OH', 17 008,
& 1800.00, 0.94546E 08, 0.238870E 06 /
DATA COEFC (8.1), COEFC (8.2), COEFC (8.3), COEFC (8.4), COEFC (8.5)
& COEFC (8.6), COEFC (8.7), COEFC (8.8) /
& 32818.803, -15.218837, .022119016, -. 11485286E-4, 2.6886736E-9,
&-1.9543649E-13,-2.2341229E-17 3.0266983E-21 /

DATA NAM (9), MOLM (9), TREF (9), HREF (9), SREF (9) / 'O', 16.000,
& 1800.00, 0.285276E 09, 0.199082E 06 /
DATA COEFC (9.1), COEFC (9.2), COEFC (9.3), COEFC (9.4), COEFC (9.5)
& COEFC (9.6), COEFC (9.7), COEFC (9.8) /
& 25083.03, -16.535077, .026765571, -. 2248645E-4, 1.0438106E-8,
&-2.6515738E-12 3.3537215E-16-1.5517898E-20 /

DATA NAM (10), MOLM (10), TREF (10) HREF (10), SREF (10) / 'H', 1,008,
& 1800.00, 0.253611E 09, 0.152085E 06 /
DATA COEFC (10.1), COEFC (10.2), COEFC (10.3), COEFC (10.4), COEFC (10.5)
& COEFC (10.6), COEFC (10.7), COEFC (10.8) /
& 20802.12, -0.016016936, .41983884 e-4-5.2109412E-8 3.4469193E-11,
&-1.2491439E-14 2.3405732E-18-1.7733325E-22 /

DATA NAM (11), MOLM (11), TREF (11) HREF (11), SREF (11) / 'N', 14 008,
& 1800.00, 0.508537E 09, 0.190696E 06 /
DATA COEFC (11.1), COEFC (11.2), COEFC (11.3), COEFC (11.4), COEFC (11.5)
& COEFC (11.6), COEFC (11.7), COEFC (11.8) /
& 20797.488, .018710873, -. 42612487E-4, 3.4847786E-8-1.0298145E-12,
&-1.2567147E-14 5.6891172E-18-6.5954395E-22 /

DATA NAM (12), MOLM (12), TREF (12) HREF (12), SREF (12) / 'SO2', 64 063,
& 1800.00,-0.204249E 09 0.339009E 06 /
DATA COEFC (12.1), COEFC (12.2), COEFC (12.3), COEFC (12.4), COEFC (12.5)
& COEFC (12.6), COEFC (12.7), COEFC (12.8) /
& 25703.378,60.351144, -. 042220499,8.2268506 E-6, 5.1505254E-9,
&-3.3055214E-12 7.0517983E-16-5.3678364E-20 /

DATA NAM (13), MOLM (13), TREF (13) HREF (13), SREF (13) / 'NO2', 46 008,
& 1800.00, 0.122204E 09, 0.325972E 06 /
DATA COEFC (13.1), COEFC (13.2), COEFC (13.3), COEFC (13.4), COEFC (13.5)
& COEFC (13.6), COEFC (13.7), COEFC (13.8) /
& 27195.397,33.868294, .0096281381, -. 37342035E-4, 2.5989138E-8,
&-8.309019E-12, 1.2669599E-15-7.2921748E-20 /
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top