aboutsummaryrefslogtreecommitdiff
path: root/unix/f2c/f2c.ps
blob: c1446802cbcf289db448e13b7ec5a559237dc2d2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
%!PS
%%Version: 3.3.1
%%DocumentFonts: (atend)
%%Pages: (atend)
%%EndComments
%
% Version 3.3.1 prologue for troff files.
%

/#copies 1 store
/aspectratio 1 def
/formsperpage 1 def
/landscape false def
/linewidth .3 def
/magnification 1 def
/margin 0 def
/orientation 0 def
/resolution 720 def
/rotation 1 def
/xoffset 0 def
/yoffset 0 def

/roundpage true def
/useclippath true def
/pagebbox [0 0 612 792] def

/R  /Times-Roman def
/I  /Times-Italic def
/B  /Times-Bold def
/BI /Times-BoldItalic def
/H  /Helvetica def
/HI /Helvetica-Oblique def
/HB /Helvetica-Bold def
/HX /Helvetica-BoldOblique def
/CW /Courier def
/CO /Courier def
/CI /Courier-Oblique def
/CB /Courier-Bold def
/CX /Courier-BoldOblique def
/PA /Palatino-Roman def
/PI /Palatino-Italic def
/PB /Palatino-Bold def
/PX /Palatino-BoldItalic def
/Hr /Helvetica-Narrow def
/Hi /Helvetica-Narrow-Oblique def
/Hb /Helvetica-Narrow-Bold def
/Hx /Helvetica-Narrow-BoldOblique def
/KR /Bookman-Light def
/KI /Bookman-LightItalic def
/KB /Bookman-Demi def
/KX /Bookman-DemiItalic def
/AR /AvantGarde-Book def
/AI /AvantGarde-BookOblique def
/AB /AvantGarde-Demi def
/AX /AvantGarde-DemiOblique def
/NR /NewCenturySchlbk-Roman def
/NI /NewCenturySchlbk-Italic def
/NB /NewCenturySchlbk-Bold def
/NX /NewCenturySchlbk-BoldItalic def
/ZD /ZapfDingbats def
/ZI /ZapfChancery-MediumItalic def
/S  /S def
/S1 /S1 def
/GR /Symbol def

/inch {72 mul} bind def
/min {2 copy gt {exch} if pop} bind def

/setup {
	counttomark 2 idiv {def} repeat pop

	landscape {/orientation 90 orientation add def} if
	/scaling 72 resolution div def
	linewidth setlinewidth
	1 setlinecap

	pagedimensions
	xcenter ycenter translate
	orientation rotation mul rotate
	width 2 div neg height 2 div translate
	xoffset inch yoffset inch neg translate
	margin 2 div dup neg translate
	magnification dup aspectratio mul scale
	scaling scaling scale

	addmetrics
	0 0 moveto
} def

/pagedimensions {
	useclippath userdict /gotpagebbox known not and {
		/pagebbox [clippath pathbbox newpath] def
		roundpage currentdict /roundpagebbox known and {roundpagebbox} if
	} if
	pagebbox aload pop
	4 -1 roll exch 4 1 roll 4 copy
	landscape {4 2 roll} if
	sub /width exch def
	sub /height exch def
	add 2 div /xcenter exch def
	add 2 div /ycenter exch def
	userdict /gotpagebbox true put
} def

/addmetrics {
	/Symbol /S null Sdefs cf
	/Times-Roman /S1 StandardEncoding dup length array copy S1defs cf
} def

/pagesetup {
	/page exch def
	currentdict /pagedict known currentdict page known and {
		page load pagedict exch get cvx exec
	} if
} def

/decodingdefs [
	{counttomark 2 idiv {y moveto show} repeat}
	{neg /y exch def counttomark 2 idiv {y moveto show} repeat}
	{neg moveto {2 index stringwidth pop sub exch div 0 32 4 -1 roll widthshow} repeat}
	{neg moveto {spacewidth sub 0.0 32 4 -1 roll widthshow} repeat}
	{counttomark 2 idiv {y moveto show} repeat}
	{neg setfunnytext}
] def

/setdecoding {/t decodingdefs 3 -1 roll get bind def} bind def

/w {neg moveto show} bind def
/m {neg dup /y exch def moveto} bind def
/done {/lastpage where {pop lastpage} if} def

/f {
	dup /font exch def findfont exch
	dup /ptsize exch def scaling div dup /size exch def scalefont setfont
	linewidth ptsize mul scaling 10 mul div setlinewidth
	/spacewidth ( ) stringwidth pop def
} bind def

/changefont {
	/fontheight exch def
	/fontslant exch def
	currentfont [
		1 0
		fontheight ptsize div fontslant sin mul fontslant cos div
		fontheight ptsize div
		0 0
	] makefont setfont
} bind def

/sf {f} bind def

/cf {
	dup length 2 idiv
	/entries exch def
	/chtab exch def
	/newencoding exch def
	/newfont exch def

	findfont dup length 1 add dict
	/newdict exch def
	{1 index /FID ne {newdict 3 1 roll put}{pop pop} ifelse} forall

	newencoding type /arraytype eq {newdict /Encoding newencoding put} if

	newdict /Metrics entries dict put
	newdict /Metrics get
	begin
		chtab aload pop
		1 1 entries {pop def} for
		newfont newdict definefont pop
	end
} bind def

%
% A few arrays used to adjust reference points and character widths in some
% of the printer resident fonts. If square roots are too high try changing
% the lines describing /radical and /radicalex to,
%
%	/radical	[0 -75 550 0]
%	/radicalex	[-50 -75 500 0]
%
% Move braceleftbt a bit - default PostScript character is off a bit.
%

/Sdefs [
	/bracketlefttp		[201 500]
	/bracketleftbt		[201 500]
	/bracketrighttp		[-81 380]
	/bracketrightbt		[-83 380]
	/braceleftbt		[203 490]
	/bracketrightex		[220 -125 500 0]
	/radical		[0 0 550 0]
	/radicalex		[-50 0 500 0]
	/parenleftex		[-20 -170 0 0]
	/integral		[100 -50 500 0]
	/infinity		[10 -75 730 0]
] def

/S1defs [
	/underscore		[0 80 500 0]
	/endash			[7 90 650 0]
] def
%
% Tries to round clipping path dimensions, as stored in array pagebbox, so they
% match one of the known sizes in the papersizes array. Lower left coordinates
% are always set to 0.
%

/roundpagebbox {
    7 dict begin
	/papersizes [8.5 inch 11 inch 14 inch 17 inch] def

	/mappapersize {
		/val exch def
		/slop .5 inch def
		/diff slop def
		/j 0 def
		0 1 papersizes length 1 sub {
			/i exch def
			papersizes i get val sub abs
			dup diff le {/diff exch def /j i def} {pop} ifelse
		} for
		diff slop lt {papersizes j get} {val} ifelse
	} def

	pagebbox 0 0 put
	pagebbox 1 0 put
	pagebbox dup 2 get mappapersize 2 exch put
	pagebbox dup 3 get mappapersize 3 exch put
    end
} bind def

%%EndProlog
%%BeginSetup
mark
/landscape false def
/resolution 720 def
setup
2 setdecoding
%%EndSetup
%%Page: 1 1
/saveobj save def
mark
1 pagesetup
10 R f
(AT&T Bell Laboratories)2 993 1 2203 1560 t
(Murray Hill, NJ 07974)3 916 1 2242 1680 t
(Computing Science Technical Report No. 149)5 1848 1 1776 2853 t
12 B f
(A Fortran-to-C Converter)2 1343 1 2028 3147 t
10 I f
(S. I. Feldman)2 538 1 2406 3411 t
10 S f
(*)2944 3361 w
10 I f
(David M. Gay)2 568 1 2416 3531 t
(Mark W. Maimone)2 751 1 2299 3651 t
(\262)3050 3601 w
(N. L. Schryer)2 533 1 2433 3771 t
10 R f
(Last updated March 22, 1995.)4 1198 1 2101 6231 t
(Originally issued May 16, 1990.)4 1294 1 2053 6351 t
10 S f
(*)1440 6831 w
10 R f
(Bell Communications Research, Morristown, NJ 07960)5 2224 1 1490 6881 t
(\262)1440 7011 w
(Carnegie-Mellon University, Pittsburgh, PA 15213)4 2044 1 1490 7061 t
cleartomark
showpage
saveobj restore
%%EndPage: 1 1
%%Page: 1 2
/saveobj save def
mark
2 pagesetup
12 B f
(A Fortran to C Converter)4 1323 1 2218 1220 t
10 R f
(S. I. Feldman)2 539 1 2610 1416 t
10 I f
(Bellcore)2711 1574 w
(Morristown, NJ 07960)2 909 1 2425 1694 t
10 R f
(David M. Gay)2 574 1 2593 1890 t
10 I f
(AT&T Bell Laboratories)2 985 1 2387 2048 t
(Murray Hill, New Jersey 07974)4 1268 1 2246 2168 t
10 R f
(Mark W. Maimone)2 768 1 2496 2364 t
10 I f
(Carnegie-Mellon University)1 1129 1 2315 2522 t
(Pittsburgh, PA 15213)2 870 1 2445 2642 t
10 R f
(N. L. Schryer)2 543 1 2608 2838 t
10 I f
(AT&T Bell Laboratories)2 985 1 2387 2996 t
(Murray Hill, New Jersey 07974)4 1268 1 2246 3116 t
10 R f
(ABSTRACT)2618 3389 w
(We describe)1 500 1 1080 3623 t
10 I f
(f 2c)1 138 1 1610 3623 t
10 R f
( 77 into C or C++.)5 765(, a program that translates Fortran)5 1378 2 1748 3623 t
10 I f
(F 2c)1 163 1 3947 3623 t
10 R f
(lets one port-)2 539 1 4141 3623 t
(ably mix C and Fortran and makes a large body of well-tested Fortran source code avail-)15 3600 1 1080 3743 t
(able to C environments.)3 955 1 1080 3863 t
10 B f
(1. INTRODUCTION)1 900 1 720 4136 t
10 R f
( it is)2 177( Sometimes)1 497( desirable for several reasons.)4 1190( is)1 93( 11])1 149(Automatic conversion of Fortran 77 [1] to C [10,)8 1964 6 970 4302 t
( At)1 150(useful to run a well-tested Fortran program on a machine that has a C compiler but no Fortran compiler.)18 4170 2 720 4422 t
( things are impossible to express in Fortran 77 or)9 2002( Some)1 283( and Fortran.)2 523(other times, it is convenient to mix C)7 1512 4 720 4542 t
( storage management, some character operations, arrays of)7 2396(are harder to express in Fortran than in C \(e.g.)9 1924 2 720 4662 t
( pro-)1 206(functions, heterogeneous data structures, and calls that depend on the operating system\), and some)13 4114 2 720 4782 t
( for carrying)2 502( is a large body of well tested Fortran source code)10 2020( There)1 285(grammers simply prefer C to Fortran.)5 1513 4 720 4902 t
( desirable to exploit some of this Fortran)7 1743(out a wide variety of useful calculations, and it is sometimes)10 2577 2 720 5022 t
( but the details vary)4 796( vendors provide some way of mixing C and Fortran,)9 2147( Many)1 286(source in a C environment.)4 1091 4 720 5142 t
( a)1 87( Fortran to C conversion lets one create)7 1691( Automatic)1 489(from system to system.)3 979 4 720 5262 t
10 I f
(portable)4009 5262 w
10 R f
(C program that)2 641 1 4399 5262 t
(exploits Fortran source code.)3 1159 1 720 5382 t
10 R f
( to C conversion is that it allows such tools as)10 1908(A side bene\256t of automatic Fortran 77)6 1568 2 970 5548 t
10 I f
(cyntax)4479 5548 w
10 R f
(\(1\) and)1 293 1 4747 5548 t
10 I f
(lint)720 5668 w
10 R f
( and portability checks that the)5 1289( to provide Fortran 77 programs with some of the consistency)10 2594(\(1\) [4])1 295 3 862 5668 t
( consistency checks detect errors in calling)6 1851( The)1 228(Pfort Veri\256er [13] provided to Fortran 66 programs.)7 2241 3 720 5788 t
(sequences and are thus a boon to debugging.)7 1780 1 720 5908 t
10 R f
(This paper describes)2 828 1 970 6074 t
10 I f
(f 2c)1 138 1 1828 6074 t
10 R f
(, a Fortran 77 to C converter based on Feldman's original)10 2344 1 1966 6074 t
10 I f
(f)4340 6074 w
10 R f
(77 compiler [6].)2 656 1 4384 6074 t
(We have used)2 571 1 720 6194 t
10 I f
(f 2c)1 138 1 1322 6194 t
10 R f
( large programs and subroutine libraries to C automatically \(i.e., with)10 2816(to convert various)2 733 2 1491 6194 t
(no manual intervention\); these include the)5 1714 1 720 6314 t
8 R f
(PORT3)2465 6314 w
10 R f
(subroutine library \()2 783 1 2742 6314 t
8 R f
(PORT1)3525 6314 w
10 R f
( MINOS)1 353( 8]\),)1 157(is described in [7,)3 728 3 3802 6314 t
( \257oating-point test is of particular interest, as it relies heav-)10 2381( The)1 207([12], and Schryer's \257oating-point test [14].)5 1732 3 720 6434 t
(ily on correct evaluation of parenthesized expressions and is bit-level self-testing.)10 3258 1 720 6554 t
10 R f
( compiled from the C produced)5 1256(As a debugging aid, we sought bit-level compatibility between objects)9 2814 2 970 6720 t
(by)720 6840 w
10 I f
(f 2c)1 138 1 849 6840 t
10 R f
(and objects produced by our local)5 1370 1 1016 6840 t
10 I f
(f)2415 6840 w
10 R f
( we developed)2 582( is, on the VAX where)5 918( That)1 237(77 compiler.)1 509 4 2459 6840 t
10 I f
(f 2c)1 138 1 4733 6840 t
10 R f
(, we)1 169 1 4871 6840 t
( been)1 222(sought to make it impossible to tell by running a Fortran program whether some of its modules had)17 4098 2 720 6960 t
(compiled by)1 500 1 720 7080 t
10 I f
(f 2c)1 138 1 1248 7080 t
10 R f
(or all had been compiled by)5 1122 1 1413 7080 t
10 I f
(f)2562 7080 w
10 R f
( meant that)2 448(77. This)1 355 2 2606 7080 t
10 I f
(f 2c)1 138 1 3436 7080 t
10 R f
(should follow the same calling con-)5 1439 1 3601 7080 t
(ventions as)1 447 1 720 7200 t
10 I f
(f)1192 7200 w
10 R f
(77 [6] and should use)4 860 1 1236 7200 t
10 I f
(f)2121 7200 w
10 R f
(77's support libraries,)2 874 1 2165 7200 t
10 I f
(libF77)3064 7200 w
10 R f
(and)3356 7200 w
10 I f
(libI77)3525 7200 w
10 R f
(.)3764 7200 w
10 R f
(March 22, 1995)2 635 1 2550 7560 t
cleartomark
showpage
saveobj restore
%%EndPage: 1 2
%%Page: 2 3
/saveobj save def
mark
3 pagesetup
10 R f
(- 2 -)2 166 1 2797 480 t
( to make)2 370(Although we have tried)3 976 2 970 840 t
10 I f
(f 2c)1 138 1 2354 840 t
10 R f
('s output reasonably readable, our goal of strict compatibility)8 2548 1 2492 840 t
(with)720 960 w
10 I f
(f)942 960 w
10 R f
( statements, in particular, generally get)5 1645( Input/output)1 564(77 implies some nasty looking conversions.)5 1845 3 986 960 t
( of calls on routines in)5 951(expanded into a series)3 917 2 720 1080 t
10 I f
(libI77)2625 1080 w
10 R f
(,)2864 1080 w
10 I f
(f)2926 1080 w
10 R f
( the C output of)4 676( Thus)1 262(77's I/O library.)2 670 3 2970 1080 t
10 I f
(f 2c)1 138 1 4615 1080 t
10 R f
(would)4790 1080 w
( to maintain as C; it would be much more sensible to maintain the)13 2747(probably be something of a nightmare)5 1573 2 720 1200 t
( commercial vendors, e.g., those listed in)6 1685( Some)1 286( it changed.)2 479(original Fortran, translating it anew each time)6 1870 4 720 1320 t
( perform translations yielding C that one might reasonably maintain directly; these)11 3454(Appendix A, seek to)3 866 2 720 1440 t
(translations generally require some manual intervention.)5 2252 1 720 1560 t
10 R f
( conventions used)2 718( 2 describes the interlanguage)4 1186( Section)1 350(The rest of this paper is organized as follows.)8 1816 4 970 1743 t
(by)720 1863 w
10 I f
(f 2c)1 138 1 848 1863 t
10 R f
(\(and)1014 1863 w
10 I f
(f)1219 1863 w
10 R f
( summarizes some extensions to Fortran 77 that)7 1928(77\). \2473)1 311 2 1263 1863 t
10 I f
(f 2c)1 138 1 3529 1863 t
10 R f
( invocations)1 488(recognizes. Example)1 858 2 3694 1863 t
(of)720 1983 w
10 I f
(f 2c)1 138 1 833 1983 t
10 R f
( illustrates various details of)4 1147( \2475)1 155(appear in \2474.)2 528 3 1001 1983 t
10 I f
(f 2c)1 138 1 2861 1983 t
10 R f
( issues.)1 295('s translations, and \2476 considers portability)5 1746 2 2999 1983 t
(\2477 discusses the generation and use of)6 1555 1 720 2103 t
10 I f
(prototypes)2305 2103 w
10 R f
( and ANSI C compilers)4 954(, which can be used both by C++)7 1351 2 2735 2103 t
(and by)1 279 1 720 2223 t
10 I f
(f 2c)1 138 1 1034 2223 t
10 R f
( describes our experience with an experimental)6 1938( \2478)1 160(to check consistency of calling sequences.)5 1735 3 1207 2223 t
10 I f
(f 2c)1 138 1 720 2343 t
10 R f
(service provided by)2 805 1 892 2343 t
10 I f
(netlib)1731 2343 w
10 R f
( A lists some vendors)4 893( Appendix)1 452([5], and \2479 considers possible extensions.)5 1702 3 1993 2343 t
( B contains a)3 546( Appendix)1 427( Finally,)1 367(who offer conversion of Fortran to C that one might maintain as C.)12 2774 4 720 2463 t
10 I f
(man)4868 2463 w
10 R f
(page telling how to use)4 927 1 720 2583 t
10 I f
(f 2c)1 138 1 1672 2583 t
10 R f
(.)1810 2583 w
10 B f
(2. INTERLANGUAGE CONVENTIONS)2 1765 1 720 2915 t
10 R f
(Much of the material in this section is taken from [6].)10 2139 1 970 3098 t
10 B f
(Names)720 3430 w
10 R f
(An)970 3613 w
10 I f
(f 2c)1 138 1 1122 3613 t
10 R f
( \(until recently called Fortran 8x [2]\) is that long names are)11 2431(extension inspired by Fortran 90)4 1319 2 1290 3613 t
(allowed \()1 380 1 720 3733 t
10 I f
(f 2c)1 138 1 1100 3733 t
10 R f
( To)1 166( 50 characters\), and names may contain underscores.)7 2137(truncates names that are longer than)5 1468 3 1269 3733 t
( and with names that)4 875(avoid con\257ict with the names of library routines)7 2000 2 720 3853 t
10 I f
(f 2c)1 138 1 3632 3853 t
10 R f
(generates, Fortran names may)3 1233 1 3807 3853 t
( lower case \(unless the)4 967( names are forced to)4 876( Fortran)1 361(have one or two underscores appended.)5 1658 4 720 3973 t
10 CW f
(-U)4623 3973 w
10 R f
(option)4784 3973 w
( names of Fortran procedures and common)6 1767(described in Appendix B is in effect\); external names, i.e., the)10 2553 2 720 4093 t
( contain any underscores and have a pair of under-)9 2031(blocks, have a single underscore appended if they do not)9 2289 2 720 4213 t
( named)1 316( Fortran subroutines)2 853( Thus)1 274(scores appended if they do contain underscores.)6 2053 4 720 4333 t
10 CW f
(ABC)4266 4333 w
10 R f
(,)4446 4333 w
10 CW f
(A_B_C)4521 4333 w
10 R f
(, and)1 219 1 4821 4333 t
10 CW f
(A_B_C_)720 4453 w
10 R f
(result in C functions named)4 1105 1 1105 4453 t
10 CW f
(abc_)2235 4453 w
10 R f
(,)2475 4453 w
10 CW f
(a_b_c_ _)1 444 1 2525 4453 t
10 R f
(, and)1 194 1 2969 4453 t
10 CW f
(a_b_c_ _ _)2 528 1 3188 4453 t
10 R f
(.)3716 4453 w
10 B f
(Types)720 4785 w
10 R f
( use types)2 442(The table below shows corresponding Fortran and C declarations; the C declarations)11 3628 2 970 4968 t
(de\256ned in)1 414 1 720 5088 t
10 CW f
(f2c.h)1176 5088 w
10 R f
(, a header \256le upon which)5 1116 1 1476 5088 t
10 I f
(f 2c)1 138 1 2634 5088 t
10 R f
( table also shows the C types)6 1251( The)1 221( rely.)1 221('s translations)1 575 4 2772 5088 t
(de\256ned in the standard version of)5 1334 1 720 5208 t
10 CW f
(f2c.h)2079 5208 w
10 R f
(.)2379 5208 w
10 S f
(_ _______________________________________________________)1 2789 1 1485 5334 t
10 R f
( standard)1 948(Fortran C)1 1059 2 1757 5454 t
10 CW f
(f2c.h)3789 5454 w
10 R f
(integer)1535 5634 w
10 S f
(*)1812 5634 w
10 R f
( int x;)2 234( short)1 660( x;)1 103( shortint)1 742(2 x)1 125 5 1862 5634 t
( int x;)2 234( long)1 667( x;)1 103( integer)1 813(integer x)1 352 5 1535 5754 t
( int x;)2 234( long)1 635( int x;)2 234( long)1 719(logical x)1 347 5 1535 5874 t
( x;)1 103( \257oat)1 795( x;)1 103( real)1 813(real x)1 224 5 1535 5994 t
( x;)1 103( double)1 617( x;)1 103( doublereal)1 571(double precision x)2 738 5 1535 6114 t
( { \257oat r, i; } x;)6 616( struct)1 644( x;)1 103( complex)1 813(complex x)1 419 5 1535 6234 t
( { double r, i; } x;)6 710( struct)1 372( x;)1 103( doublecomplex)1 788(double complex x)2 716 5 1535 6354 t
(character)1535 6474 w
10 S f
(*)1899 6474 w
10 R f
( x[6];)1 219( char)1 650( x[6];)1 219( char)1 520(6 x)1 125 5 1949 6474 t
10 S f
( \347)1 -2789(_ _______________________________________________________)1 2789 2 1485 6494 t
(\347)1485 6434 w
(\347)1485 6334 w
(\347)1485 6234 w
(\347)1485 6134 w
(\347)1485 6034 w
(\347)1485 5934 w
(\347)1485 5834 w
(\347)1485 5734 w
(\347)1485 5634 w
(\347)1485 5534 w
(\347)1485 5434 w
(\347)4274 6494 w
(\347)4274 6434 w
(\347)4274 6334 w
(\347)4274 6234 w
(\347)4274 6134 w
(\347)4274 6034 w
(\347)4274 5934 w
(\347)4274 5834 w
(\347)4274 5734 w
(\347)4274 5634 w
(\347)4274 5534 w
(\347)4274 5434 w
10 R f
(By the rules of Fortran,)4 951 1 720 6720 t
10 CW f
(integer, logical,)1 990 1 1700 6720 t
10 R f
(and)2720 6720 w
10 CW f
(real)2894 6720 w
10 R f
(data occupy the same amount of memory, and)7 1876 1 3164 6720 t
10 CW f
(double precision)1 965 1 720 6840 t
10 R f
(and)1715 6840 w
10 CW f
(complex)1889 6840 w
10 R f
(occupy twice this amount;)3 1064 1 2339 6840 t
10 I f
(f 2c)1 138 1 3432 6840 t
10 R f
(assumes that the types in the C col-)7 1441 1 3599 6840 t
( \(in)1 151(umn above are chosen)3 931 2 720 6960 t
10 CW f
(f2c.h)1842 6960 w
10 R f
( translations of the Fortran)4 1120( The)1 220(\) so that these assumptions are valid.)6 1558 3 2142 6960 t
10 CW f
(equivalence)720 7080 w
10 R f
(and)1408 7080 w
10 CW f
(data)1580 7080 w
10 R f
( some machines, one must modify)5 1376( On)1 174(statements depend on these assumptions.)4 1643 3 1847 7080 t
10 CW f
(f2c.h)720 7200 w
10 R f
( \2476 for examples and further discussion.)6 1600( See)1 194(to make these assumptions hold.)4 1297 3 1045 7200 t
10 R f
(March 22, 1995)2 635 1 2550 7560 t
cleartomark
showpage
saveobj restore
%%EndPage: 2 3
%%Page: 3 4
/saveobj save def
mark
4 pagesetup
10 R f
(- 3 -)2 166 1 2797 480 t
10 B f
(Return Values)1 619 1 720 840 t
10 R f
(A function of type)3 753 1 970 998 t
10 CW f
(integer)1754 998 w
10 R f
(,)2174 998 w
10 CW f
(logical)2230 998 w
10 R f
(, or)1 139 1 2650 998 t
10 CW f
(double precision)1 966 1 2820 998 t
10 R f
(must be declared as a C func-)6 1222 1 3818 998 t
( the)1 148( If)1 117(tion that returns the corresponding type.)5 1603 3 720 1118 t
10 CW f
(-R)2613 1118 w
10 R f
(option is in effect \(see Appendix B\), the same is true of a)12 2282 1 2758 1118 t
(function of type)2 694 1 720 1238 t
10 CW f
(real)1467 1238 w
10 R f
(; otherwise, a)2 591 1 1707 1238 t
10 CW f
(real)2351 1238 w
10 R f
( as a C function that returns)6 1278(function must be declared)3 1118 2 2644 1238 t
10 CW f
(doublereal)720 1358 w
10 R f
(; this hack facilitates our VAX regression testing, as it duplicates the behavior of our local)15 3720 1 1320 1358 t
(Fortran compiler \()2 738 1 720 1478 t
10 I f
(f)1458 1478 w
10 R f
(77\). A)1 283 1 1502 1478 t
10 CW f
(complex)1814 1478 w
10 R f
(or)2263 1478 w
10 CW f
(double complex)1 844 1 2375 1478 t
10 R f
(function is equivalent to a C routine with an)8 1792 1 3248 1478 t
( Thus,)1 275(additional initial argument that points to the place where the return value is to be stored.)15 3518 2 720 1598 t
9 CW f
(complex function f\( . . . \))6 1458 1 1008 1761 t
10 R f
(is equivalent to)2 611 1 720 1944 t
9 CW f
(void f_\(temp, . . .\))4 1080 1 1008 2107 t
(complex)1008 2207 w
9 S f
(*)1440 2207 w
9 CW f
(temp;)1485 2207 w
(. . .)2 270 1 1062 2307 t
10 R f
( equivalent to a C routine with two extra initial arguments: a data address and)14 3110(A character-valued function is)3 1210 2 720 2490 t
( Thus,)1 275(a length.)1 344 2 720 2610 t
9 CW f
(character)1008 2773 w
9 S f
(*)1494 2773 w
9 CW f
(15 function g\( . . . \))6 1188 1 1539 2773 t
10 R f
(is equivalent to)2 611 1 720 2956 t
9 CW f
(g_\(result, length, . . .\))4 1350 1 1008 3119 t
(char)1008 3219 w
9 S f
(*)1278 3219 w
9 CW f
(result;)1323 3219 w
(ftnlen length;)1 756 1 1008 3319 t
(. . .)2 270 1 1062 3419 t
10 R f
(and could be invoked in C by)6 1177 1 720 3602 t
9 CW f
(char chars[15];)1 810 1 1008 3765 t
(. . .)2 270 1 1062 3865 t
(g_\(chars, 15L, . . . \);)5 1242 1 1008 3965 t
10 R f
(Subroutines are invoked as if they were)6 1598 1 720 4148 t
10 CW f
(int)2346 4148 w
10 R f
(-valued functions whose value speci\256es which alternate return)7 2514 1 2526 4148 t
( an)1 125( return arguments \(statement labels\) are not passed to the function, but are used to do)15 3499( Alternate)1 428(to use.)1 268 4 720 4268 t
( entry points with alternate return argu-)6 1617( the subroutine has no)4 905( \(If)1 156(indexed branch in the calling procedure.)5 1642 4 720 4388 t
( statement)1 408( The)1 205(ments, the returned value is unde\256ned.\))5 1578 3 720 4508 t
9 CW f
(call nret\()1 540 1 1008 4671 t
9 S f
(*)1548 4671 w
9 CW f
(1,)1593 4671 w
9 S f
(*)1755 4671 w
9 CW f
(2,)1800 4671 w
9 S f
(*)1962 4671 w
9 CW f
(3\))2007 4671 w
10 R f
(is treated exactly as if it were the Fortran computed)9 2054 1 720 4854 t
10 CW f
(goto)2799 4854 w
9 CW f
( \))1 108( nret\()1 378(goto \(1, 2, 3\),)3 810 3 1008 5017 t
10 B f
(Argument Lists)1 669 1 720 5262 t
10 R f
( addition, for every non-function argument that is of)8 2115( In)1 137( address.)1 353(All Fortran arguments are passed by)5 1465 4 970 5420 t
( string lengths are)3 728( \(The)1 243( length of the value is passed.)6 1209(type character, an argument giving the)5 1565 4 720 5540 t
10 CW f
(ftnlen)4495 5540 w
10 R f
(val-)4885 5540 w
(ues, i.e.,)1 335 1 720 5660 t
10 CW f
(long int)1 485 1 1085 5660 t
10 R f
( of arguments is: extra arguments)5 1364( summary, the order)3 819( In)1 138(quantities passed by value\).)3 1119 4 1600 5660 t
( function, and a)3 621(for complex and character functions, an address for each datum or)10 2649 2 720 5780 t
10 CW f
(ftnlen)4015 5780 w
10 R f
(for each charac-)2 640 1 4400 5780 t
( the call in)3 419( Thus,)1 275(ter argument \(other than character-valued functions\).)5 2110 3 720 5900 t
9 CW f
(external f)1 540 1 1008 6063 t
(character)1008 6163 w
9 S f
(*)1494 6163 w
9 CW f
(7 s)1 162 1 1539 6163 t
(integer b\(3\))1 648 1 1008 6263 t
(. . .)2 270 1 1062 6363 t
(call sam\(f, b\(2\), s\))3 1080 1 1008 6463 t
10 R f
(is equivalent to that in)4 889 1 720 6646 t
9 CW f
(int f\(\);)1 432 1 1008 6809 t
(char s[7];)1 540 1 1008 6909 t
(long int b[3];)2 756 1 1008 7009 t
(. . .)2 270 1 1062 7109 t
(sam_\(f, &b[1], s, 7L\);)3 1188 1 1008 7209 t
10 R f
(March 22, 1995)2 635 1 2550 7560 t
cleartomark
showpage
saveobj restore
%%EndPage: 3 4
%%Page: 4 5
/saveobj save def
mark
5 pagesetup
10 R f
(- 4 -)2 166 1 2797 480 t
( arrays begin at 1 by default.)6 1175(Note that the \256rst element of a C array always has subscript zero, but Fortran)14 3145 2 720 840 t
( whereas C arrays are stored in row-major order,)8 1983(Because Fortran arrays are stored in column-major order,)7 2337 2 720 960 t
10 I f
(f 2c)1 138 1 720 1080 t
10 R f
( arrays into one-dimensional C arrays and issues appropriate sub-)9 2681(translates multi-dimensional Fortran)2 1469 2 890 1080 t
(scripting expressions.)1 866 1 720 1200 t
10 B f
(3. EXTENSIONS TO FORTRAN 77)4 1560 1 720 1460 t
10 R f
(Since it is derived from)4 938 1 970 1622 t
10 I f
(f)1933 1622 w
10 R f
(77,)1977 1622 w
10 I f
(f 2c)1 138 1 2127 1622 t
10 R f
(supports all of the)3 719 1 2290 1622 t
10 I f
(f)3035 1622 w
10 R f
(77 extensions described in [6].)4 1227 1 3079 1622 t
10 I f
(F 2c)1 163 1 4357 1622 t
10 R f
('s extensions)1 520 1 4520 1622 t
(include the following.)2 880 1 720 1742 t
10 S f
(\267)720 1922 w
10 R f
(Type)791 1922 w
10 CW f
(double complex)1 854 1 1035 1922 t
10 R f
(\(alias)1928 1922 w
10 CW f
(complex*16)2183 1922 w
10 R f
(\) is a double-precision version of)5 1387 1 2783 1922 t
10 CW f
(complex)4209 1922 w
10 R f
(. Speci\256c)1 411 1 4629 1922 t
( for)1 148(intrinsic functions)1 733 2 791 2042 t
10 CW f
(double complex)1 847 1 1704 2042 t
10 R f
(have names that start with)4 1071 1 2583 2042 t
10 CW f
(z)3686 2042 w
10 R f
(rather than)1 436 1 3778 2042 t
10 CW f
(c)4246 2042 w
10 R f
( exception to)2 530(. An)1 204 2 4306 2042 t
(this rule is)2 425 1 791 2162 t
10 CW f
(dimag)1245 2162 w
10 R f
( of a)2 187(, which returns the imaginary part)5 1373 2 1545 2162 t
10 CW f
(double complex)1 845 1 3135 2162 t
10 R f
(value;)4010 2162 w
10 CW f
(imag)4284 2162 w
10 R f
(is the corre-)2 486 1 4554 2162 t
( generic intrinsic function)3 1035( The)1 207(sponding generic intrinsic function.)3 1430 3 791 2282 t
10 CW f
(real)3490 2282 w
10 R f
(is extended so that it returns the)6 1283 1 3757 2282 t
(real part of a)3 509 1 791 2402 t
10 CW f
(double complex)1 841 1 1326 2402 t
10 R f
(value as a)2 395 1 2193 2402 t
10 CW f
(double precision)1 961 1 2614 2402 t
10 R f
(value;)3601 2402 w
10 CW f
(dble)3871 2402 w
10 R f
(is the speci\256c intrinsic)3 903 1 4137 2402 t
(function that does this job.)4 1064 1 791 2522 t
10 S f
(\267)720 2702 w
10 R f
(The ``types'' that may appear in an)6 1425 1 791 2702 t
10 CW f
(implicit)2244 2702 w
10 R f
(statement include)1 705 1 2752 2702 t
10 CW f
(undefined)3485 2702 w
10 R f
( vari-)1 217(, which implies that)3 798 2 4025 2702 t
(ables whose names begin with the associated letters must be explicitly declared in a type statement.)15 4032 1 791 2822 t
10 I f
(F 2c)1 163 1 4877 2822 t
10 R f
(also recognizes the Fortran 90 statement)5 1611 1 791 2942 t
9 CW f
(implicit none)1 702 1 1008 3112 t
10 R f
(as equivalent to)2 627 1 791 3302 t
9 CW f
(implicit undefined\(a-z\))1 1242 1 1008 3472 t
10 R f
(The command-line option)2 1038 1 791 3662 t
10 CW f
(-u)1854 3662 w
10 R f
(has the effect of inserting)4 1014 1 1999 3662 t
9 CW f
(implicit none)1 702 1 1008 3832 t
10 R f
(at the beginning of each Fortran procedure.)6 1726 1 791 4022 t
10 S f
(\267)720 4202 w
10 R f
( themselves recursively, i.e., may call themselves either directly or indirectly through)11 3436(Procedures may call)2 813 2 791 4202 t
(a chain of other calls.)4 856 1 791 4322 t
10 S f
(\267)720 4502 w
10 R f
(The keywords)1 579 1 791 4502 t
10 CW f
(static)1406 4502 w
10 R f
(and)1802 4502 w
10 CW f
(automatic)1982 4502 w
10 R f
(act as ``types'' in type and implicit statements; they specify)9 2482 1 2558 4502 t
( of each)2 325( is exactly one copy)4 817( There)1 288(storage classes.)1 621 4 791 4622 t
10 CW f
(static)2872 4622 w
10 R f
(variable, and such variables retain their val-)6 1778 1 3262 4622 t
( of a)2 189( the other hand, each invocation)5 1300( On)1 177(ues between invocations of the procedure in which they appear.)9 2583 4 791 4742 t
(procedure gets new copies of the procedure's)6 1877 1 791 4862 t
10 CW f
(automatic)2705 4862 w
10 R f
(variables.)3282 4862 w
10 CW f
(Automatic)3729 4862 w
10 R f
(variables may not)2 734 1 4306 4862 t
(appear in)1 392 1 791 4982 t
10 CW f
(equivalence)1232 4982 w
10 R f
(,)1892 4982 w
10 CW f
(data)1967 4982 w
10 R f
(,)2207 4982 w
10 CW f
(namelist)2282 4982 w
10 R f
(, or)1 158 1 2762 4982 t
10 CW f
(save)2970 4982 w
10 R f
( command-line option)2 933(statements. The)1 677 2 3260 4982 t
10 CW f
(-a)4920 4982 w
10 R f
(changes the default storage class from)5 1526 1 791 5102 t
10 CW f
(static)2342 5102 w
10 R f
(to)2727 5102 w
10 CW f
(automatic)2830 5102 w
10 R f
(\(for all variables except those that appear)6 1645 1 3395 5102 t
(in)791 5222 w
10 CW f
(common)894 5222 w
10 R f
(,)1254 5222 w
10 CW f
(data)1304 5222 w
10 R f
(,)1544 5222 w
10 CW f
(equivalence)1594 5222 w
10 R f
(,)2254 5222 w
10 CW f
(namelist)2304 5222 w
10 R f
(, or)1 133 1 2784 5222 t
10 CW f
(save)2942 5222 w
10 R f
(statements\).)3207 5222 w
10 S f
(\267)720 5402 w
10 R f
( free-format line, which may extend beyond)6 1784(A tab in the \256rst 6 columns signi\256es that the current line is a)13 2465 2 791 5402 t
( ampersand)1 459( An)1 174(column 72.)1 452 3 791 5522 t
10 CW f
(&)1903 5522 w
10 R f
(in column 1 indicates that the current line is a free-format continuation line.)12 3050 1 1990 5522 t
( have neither an ampersand in column 1 nor a tab in the \256rst 6 columns are treated as Fortran 77)20 3852(Lines that)1 397 2 791 5642 t
( with blanks until they are 72)6 1166( shorter than 72 characters, they are padded on the right)10 2229( if)1 112(\256xed-format lines:)1 742 4 791 5762 t
( taking)1 277( After)1 262(characters long; if longer than 72 characters, the characters beyond column 72 are discarded.)13 3710 3 791 5882 t
( this is the only constraint on)6 1204(continuations into account, statements may be up to 1320 characters long;)10 3045 2 791 6002 t
( the Fortran 77 standard, which allows at most 19)9 1994( limit is implied by)4 767( \(This)1 262(the length of free-format lines.)4 1226 4 791 6122 t
(continuation lines; 1320)2 967 1 791 6242 t
10 S f
(=)1807 6242 w
10 R f
(\( 1)1 91 1 1911 6242 t
10 S f
(+)2042 6242 w
10 R f
(19 \))1 141 1 2137 6242 t
10 S f
(\264)2327 6242 w
10 R f
(66.\))2423 6242 w
10 S f
(\267)720 6422 w
10 R f
(Aside from quoted strings,)3 1066 1 791 6422 t
10 I f
(f 2c)1 138 1 1882 6422 t
10 R f
(ignores case \(unless the)3 945 1 2045 6422 t
10 CW f
(-U)3015 6422 w
10 R f
(option is in effect\).)3 760 1 3160 6422 t
10 S f
(\267)720 6602 w
10 R f
(The statement)1 563 1 791 6602 t
9 CW f
(include 'stuff')1 810 1 1008 6772 t
10 R f
(is replaced by the contents of the \256le)7 1551 1 791 6962 t
10 I f
(stuff)2379 6962 w
10 R f
(. Unless)1 359 1 2560 6962 t
10 I f
(stuff)2956 6962 w
10 R f
( \256le name,)2 445(appears to be an absolute)4 1051 2 3174 6962 t
10 I f
(f 2c)1 138 1 4708 6962 t
10 R f
(\256rst)4884 6962 w
(looks for)1 370 1 791 7082 t
10 I f
(stuff)1198 7082 w
10 R f
( to \256nd)2 308( Failing)1 346(in the directory of the \256le it is currently reading.)9 2033 3 1416 7082 t
10 I f
(stuff)4140 7082 w
10 R f
(there, it looks in)3 683 1 4357 7082 t
(directories speci\256ed by)2 934 1 791 7202 t
10 CW f
(-I)1789 7202 w
10 I f
(dir)1909 7202 w
10 R f
(command-line options; there can be several such options, each specifying)9 2984 1 2056 7202 t
10 R f
(March 22, 1995)2 635 1 2550 7560 t
cleartomark
showpage
saveobj restore
%%EndPage: 4 5
%%Page: 5 6
/saveobj save def
mark
6 pagesetup
10 R f
(- 5 -)2 166 1 2797 480 t
(one directory.)1 558 1 791 840 t
10 CW f
(Include)1403 840 w
10 R f
( command-line option)2 889( The)1 208( depth, currently ten.)3 838(s may be nested to a reasonable)6 1282 4 1823 840 t
10 CW f
(-!I)791 960 w
10 R f
(disables)1020 960 w
10 CW f
(include)1391 960 w
10 R f
(s; this option is used by the)6 1234 1 1811 960 t
10 I f
( 2c)1 110(netlib f)1 305 2 3094 960 t
10 R f
( \(for which)2 493(service described in \2478)3 989 2 3558 960 t
10 CW f
(include)791 1080 w
10 R f
(obviously makes no sense\).)3 1099 1 1236 1080 t
10 S f
(\267)720 1260 w
10 I f
(F)791 1260 w
10 R f
(77 allows binary, octal, and hexadecimal constants to appear in)9 2598 1 860 1260 t
10 CW f
(data)3491 1260 w
10 R f
(statements;)3764 1260 w
10 I f
(f 2c)1 138 1 4247 1260 t
10 R f
(goes somewhat)1 622 1 4418 1260 t
( a decimal integer constant)4 1090(further, allowing such constants to appear anywhere; they are treated just like)11 3159 2 791 1380 t
( hexadecimal constants may assume one of two forms: a)9 2321( octal, and)2 427( Binary,)1 354(having the equivalent value.)3 1147 4 791 1500 t
( quoted string of digits, or a decimal base, followed by a sharp sign)13 2748(letter followed by a)3 797 2 791 1620 t
10 CW f
(#)4366 1620 w
10 R f
(, followed by a)3 614 1 4426 1620 t
( letter is)2 324( The)1 206(string of digits \(not quoted\).)4 1129 3 791 1740 t
10 CW f
(b)2476 1740 w
10 R f
(or)2562 1740 w
10 CW f
(B)2671 1740 w
10 R f
(for binary constants,)2 820 1 2757 1740 t
10 CW f
(o)3603 1740 w
10 R f
(or)3689 1740 w
10 CW f
(O)3798 1740 w
10 R f
(for octal constants, and)3 932 1 3884 1740 t
10 CW f
(x)4843 1740 w
10 R f
(,)4903 1740 w
10 CW f
(X)4955 1740 w
10 R f
(,)5015 1740 w
10 CW f
(z)791 1860 w
10 R f
(, or)1 185 1 851 1860 t
10 CW f
(Z)1113 1860 w
10 R f
( for example,)2 631( Thus,)1 326(for hexadecimal constants.)2 1169 3 1250 1860 t
10 CW f
(z'a7')3452 1860 w
10 R f
(,)3752 1860 w
10 CW f
(16#a7)3853 1860 w
10 R f
(,)4153 1860 w
10 CW f
(o'247')4254 1860 w
10 R f
(,)4614 1860 w
10 CW f
(8#247)4715 1860 w
10 R f
(,)5015 1860 w
10 CW f
(b'10100111')791 1980 w
10 R f
(and)1476 1980 w
10 CW f
(2#10100111)1645 1980 w
10 R f
(are all treated just like the integer)6 1336 1 2270 1980 t
10 CW f
(167)3631 1980 w
10 R f
(.)3811 1980 w
10 S f
(\267)720 2160 w
10 R f
(For compatibility with C, quoted strings may contain the following escapes:)10 3041 1 791 2160 t
10 S f
(_ __________________________________________)1 2129 1 1851 2250 t
10 CW f
(\\0)1901 2370 w
10 R f
(null)2171 2370 w
10 CW f
(\\n)3029 2370 w
10 R f
(newline)3323 2370 w
10 CW f
(\\\\)1901 2490 w
10 R f
(\\)2171 2490 w
10 CW f
(\\r)3029 2490 w
10 R f
(carriage return)1 583 1 3323 2490 t
10 CW f
(\\b)1901 2610 w
10 R f
(backspace)2171 2610 w
10 CW f
(\\t)3029 2610 w
10 R f
(tab)3323 2610 w
10 CW f
(\\f)1901 2730 w
10 R f
(form feed)1 390 1 2171 2730 t
10 CW f
(\\v)3029 2730 w
10 R f
(vertical tab)1 446 1 3323 2730 t
10 CW f
(\\')1972 2910 w
10 R f
(apostrophe \(does not terminate a string\))5 1589 1 2171 2910 t
10 CW f
(\\")1972 3030 w
10 R f
(quotation mark \(does not terminate a string\))6 1759 1 2171 3030 t
10 CW f
(\\)1972 3150 w
10 I f
(x x)1 183 1 2032 3150 t
10 R f
(, where)1 293 1 2215 3150 t
10 I f
(x)2533 3150 w
10 R f
(is any other character)3 855 1 2602 3150 t
10 S f
( \347)1 -2129(_ __________________________________________)1 2129 2 1851 3170 t
(\347)1851 3150 w
(\347)1851 3050 w
(\347)1851 2950 w
(\347)1851 2850 w
(\347)1851 2750 w
(\347)1851 2650 w
(\347)1851 2550 w
(\347)1851 2450 w
(\347)1851 2350 w
(\347)3980 3170 w
(\347)3980 3150 w
(\347)3980 3050 w
(\347)3980 2950 w
(\347)3980 2850 w
(\347)3980 2750 w
(\347)3980 2650 w
(\347)3980 2550 w
(\347)3980 2450 w
(\347)3980 2350 w
10 R f
(The)791 3360 w
10 CW f
(-!bs)971 3360 w
10 R f
(option tells)1 448 1 1236 3360 t
10 I f
(f 2c)1 138 1 1709 3360 t
10 R f
( dou-)1 209( strings may be delimited either by)6 1388( Quoted)1 344(not to recognize these escapes.)4 1227 4 1872 3360 t
(ble quotes \()2 482 1 791 3480 t
10 CW f
(")1298 3480 w
10 R f
(\) or by single quotes \()5 914 1 1383 3480 t
10 S f
(\242)2322 3480 w
10 R f
(\); if a string starts with one kind of quote, the other kind may be)14 2668 1 2372 3480 t
( possible, trans-)2 648( Where)1 324( escape.)1 324(embedded in the string without being repeated or quoted by a backslash)11 2953 4 791 3600 t
(lated strings are null-terminated.)3 1298 1 791 3720 t
10 S f
(\267)720 3900 w
10 R f
(Hollerith strings are treated as character strings.)6 1909 1 791 3900 t
10 S f
(\267)720 4080 w
10 R f
(In)791 4080 w
10 CW f
(equivalence)908 4080 w
10 R f
( given a single subscript, in which)6 1423(statements, a multiply-dimensioned array may be)5 2015 2 1602 4080 t
( subscripts are taken to be 1 \(for backward compatibility with Fortran 66\) and a warning)15 3584(case the missing)2 665 2 791 4200 t
(message is issued.)2 730 1 791 4320 t
10 S f
(\267)720 4500 w
10 R f
( library \()2 355(In a formatted read of non-character variables, the I/O)8 2172 2 791 4500 t
10 I f
(libI77)3318 4500 w
10 R f
(\) allows a \256eld to be terminated by a)8 1483 1 3557 4500 t
(comma.)791 4620 w
10 S f
(\267)720 4800 w
10 R f
(Type)791 4800 w
10 CW f
(real*4)1029 4800 w
10 R f
(is equivalent to)2 627 1 1422 4800 t
10 CW f
(real)2082 4800 w
10 R f
(,)2322 4800 w
10 CW f
(integer*4)2380 4800 w
10 R f
(to)2953 4800 w
10 CW f
(integer)3064 4800 w
10 R f
(,)3484 4800 w
10 CW f
(real*8)3542 4800 w
10 R f
(to)3935 4800 w
10 CW f
(double precision)1 969 1 4046 4800 t
10 R f
(,)5015 4800 w
10 CW f
(complex*8)791 4920 w
10 R f
(to)1356 4920 w
10 CW f
(complex)1459 4920 w
10 R f
(, and, as stated before,)4 889 1 1879 4920 t
10 CW f
(complex*16)2793 4920 w
10 R f
(to)3418 4920 w
10 CW f
(double complex)1 840 1 3521 4920 t
10 R f
(.)4361 4920 w
10 S f
(\267)720 5100 w
10 R f
(The type)1 372 1 791 5100 t
10 CW f
(integer*2)1208 5100 w
10 R f
(designates short integers \(translated to type)5 1828 1 1793 5100 t
10 CW f
(shortint)3666 5100 w
10 R f
( is)1 113(, which by default)3 781 2 4146 5100 t
10 CW f
(short int)1 562 1 791 5220 t
10 R f
( command-line)1 623( The)1 226( of storage.)2 488( integers are expected to occupy half a ``unit'')8 2020(\). Such)1 330 5 1353 5220 t
(options)791 5340 w
10 CW f
(-I2)1120 5340 w
10 R f
(and)1334 5340 w
10 CW f
(-i2)1512 5340 w
10 R f
(turn type)1 367 1 1726 5340 t
10 CW f
(integer)2127 5340 w
10 R f
(into)2581 5340 w
10 CW f
(integer*2)2771 5340 w
10 R f
(; see the)2 345 1 3311 5340 t
10 I f
(man)3690 5340 w
10 R f
(page \(appendix B\) for more)4 1144 1 3896 5340 t
(details.)791 5460 w
10 S f
(\267)720 5640 w
10 R f
(The binary intrinsic functions)3 1224 1 791 5640 t
10 CW f
(and)2053 5640 w
10 R f
(,)2233 5640 w
10 CW f
(or)2296 5640 w
10 R f
(,)2416 5640 w
10 CW f
(xor)2480 5640 w
10 R f
(,)2660 5640 w
10 CW f
(lshift)2724 5640 w
10 R f
(, and)1 208 1 3084 5640 t
10 CW f
(rshift)3331 5640 w
10 R f
(and the unary intrinsic function)4 1310 1 3730 5640 t
10 CW f
(not)791 5760 w
10 R f
(perform bitwise operations on)3 1234 1 1007 5760 t
10 CW f
(integer)2277 5760 w
10 R f
(or)2732 5760 w
10 CW f
(logical)2850 5760 w
10 R f
(operands. For)1 584 1 3305 5760 t
10 CW f
(lshift)3924 5760 w
10 R f
(and)4319 5760 w
10 CW f
(rshift)4498 5760 w
10 R f
(, the)1 182 1 4858 5760 t
(second operand tells how many bits to shift the \256rst operand.)10 2434 1 791 5880 t
10 S f
(\267)720 6060 w
10 I f
(LibF77)791 6060 w
10 R f
(provides two functions for accessing command-line arguments:)6 2655 1 1131 6060 t
10 CW f
(iargc\(dummy\))3831 6060 w
10 R f
(returns the)1 444 1 4596 6060 t
( ignores its argument\);)3 911(number of command-line arguments \(and)4 1674 2 791 6180 t
10 CW f
(getarg\(k,c\))3404 6180 w
10 R f
(sets the character string)3 948 1 4092 6180 t
10 CW f
(c)791 6300 w
10 R f
(to the)1 225 1 876 6300 t
10 I f
(k)1126 6300 w
10 R f
(th command-line argument \(or to blanks if)6 1698 1 1170 6300 t
10 I f
(k)2893 6300 w
10 R f
(is out of range\).)3 632 1 2962 6300 t
10 S f
(\267)720 6480 w
10 R f
(Variable,)791 6480 w
10 CW f
(common)1196 6480 w
10 R f
( the 50th)2 376(, and procedure names may be arbitrarily long, but they are truncated after)12 3108 2 1556 6480 t
( underscores \(in which case their translations will have a pair of)11 2712( names may contain)3 844(character. These)1 693 3 791 6600 t
(underscores appended\).)1 941 1 791 6720 t
10 S f
(\267)720 6900 w
10 R f
(MAIN programs may have arguments, which are ignored.)7 2314 1 791 6900 t
10 S f
(\267)720 7080 w
10 CW f
(Common)791 7080 w
10 R f
(variables may be initialized by a)5 1340 1 1185 7080 t
10 CW f
(data)2559 7080 w
10 R f
(statement in any module, not just in a)7 1563 1 2833 7080 t
10 CW f
(block data)1 610 1 4430 7080 t
10 R f
(subprogram.)791 7200 w
10 R f
(March 22, 1995)2 635 1 2550 7560 t
cleartomark
showpage
saveobj restore
%%EndPage: 5 6
%%Page: 6 7
/saveobj save def
mark
7 pagesetup
10 R f
(- 6 -)2 166 1 2797 480 t
10 S f
(\267)720 900 w
10 R f
(The label may be omitted from a)6 1309 1 791 900 t
10 CW f
(do)2125 900 w
10 R f
(loop if the loop is terminated by an)7 1402 1 2270 900 t
10 CW f
(enddo)3697 900 w
10 R f
(statement.)4022 900 w
10 S f
(\267)720 1080 w
10 R f
(Unnamed Fortran 90)2 832 1 791 1080 t
10 CW f
(do while)1 480 1 1648 1080 t
10 R f
( a loop begins with a statement of the form)9 1712( Such)1 250(loops are allowed.)2 729 3 2153 1080 t
10 CW f
(do)2025 1200 w
10 R f
([)2205 1200 w
10 I f
(label)2238 1200 w
10 R f
(] [)1 91 1 2446 1200 t
10 CW f
(,)2537 1200 w
10 R f
(])2597 1200 w
10 CW f
(while\()2655 1200 w
10 I f
(logical expression)1 730 1 3015 1200 t
10 CW f
(\))3745 1200 w
10 R f
(and ends either after the statement labelled by)7 1832 1 791 1320 t
10 I f
(label)2648 1320 w
10 R f
(or after a matching)3 756 1 2873 1320 t
10 CW f
(enddo)3654 1320 w
10 R f
(.)3954 1320 w
10 S f
(\267)720 1500 w
10 I f
(F 2c)1 163 1 791 1500 t
10 R f
(recognizes the Fortran 90 synonyms)4 1464 1 983 1500 t
10 CW f
(<)2476 1500 w
10 R f
(,)2536 1500 w
10 CW f
(<=)2590 1500 w
10 R f
(,)2710 1500 w
10 CW f
(==)2764 1500 w
10 R f
(,)2884 1500 w
10 CW f
(>=)2938 1500 w
10 R f
(,)3058 1500 w
10 CW f
(>)3112 1500 w
10 R f
(, and)1 199 1 3172 1500 t
10 CW f
(<>)3401 1500 w
10 R f
(for the Fortran comparison operators)4 1489 1 3551 1500 t
10 CW f
(.LT.)791 1620 w
10 R f
(,)1031 1620 w
10 CW f
(.LE.)1081 1620 w
10 R f
(,)1321 1620 w
10 CW f
(.EQ.)1371 1620 w
10 R f
(,)1611 1620 w
10 CW f
(.GE.)1661 1620 w
10 R f
(,)1901 1620 w
10 CW f
(.GT.)1951 1620 w
10 R f
(, and)1 194 1 2191 1620 t
10 CW f
(.NE.)2410 1620 w
10 S f
(\267)720 1800 w
10 CW f
(Namelist)791 1800 w
10 R f
(works as in Fortran 90 [2], with a minor restriction on)10 2256 1 1306 1800 t
10 CW f
(namelist)3598 1800 w
10 R f
( must)1 231(input: subscripts)1 695 2 4114 1800 t
(have the form)2 554 1 791 1920 t
10 I f
(subscript)2240 2040 w
10 R f
([ :)1 86 1 2632 2040 t
10 I f
(subscript)2743 2040 w
10 R f
([ :)1 86 1 3135 2040 t
10 I f
(stride)3246 2040 w
10 R f
(] ])1 91 1 3499 2040 t
(For example, the Fortran)3 993 1 791 2160 t
9 CW f
(integer m\(8\))1 648 1 1008 2345 t
(real x\(10,10\))1 702 1 1008 2445 t
(namelist /xx/ m, x)3 972 1 1008 2545 t
(. . .)2 270 1 1008 2645 t
(read\(*,xx\))1008 2745 w
10 R f
(could read)1 418 1 791 2950 t
9 CW f
( = 9,10/)2 432( m\(7:8\))1 432(&xx x\(1,1\) = 2, x\(1:3,8:10:2\) = 1,2,3,4,5,6)6 2322 3 1008 3135 t
10 R f
(but would elicit error messages on the inputs)7 1790 1 791 3340 t
9 CW f
(&xx x\(:3,8:10:2\) = 1,2,3,4,5,6/)3 1674 1 1008 3525 t
( 1,2,3,4,5,6/)1 702( =)1 162(&xx x\(1:3,8::2\))1 810 3 1008 3625 t
(&xx m\(7:\) = 9,10/)3 918 1 1008 3725 t
10 R f
( with the)2 358( compatibility)1 562( For)1 192(\(which inputs would be legal in Fortran 90\).)7 1786 4 791 3930 t
10 CW f
(namelist)3718 3930 w
10 R f
(variants supplied by)2 813 1 4227 3930 t
(several vendors as Fortran 77 extensions,)5 1672 1 791 4050 t
10 I f
(f 2c)1 138 1 2492 4050 t
10 R f
('s version of)2 507 1 2630 4050 t
10 I f
(libI77)3166 4050 w
10 R f
(permits)3434 4050 w
10 CW f
($)3763 4050 w
10 R f
(to be used instead of)4 837 1 3852 4050 t
10 CW f
(&)4718 4050 w
10 R f
(and)4807 4050 w
10 CW f
(/)4980 4050 w
10 R f
(in)791 4170 w
10 CW f
(namelist)894 4170 w
10 R f
( the Fortran shown above could read)6 1458(input. Thus)1 481 2 1399 4170 t
9 CW f
( = 9,10$end)2 594( m\(7:8\))1 432($xx x\(1,1\) = 2, x\(1:3,8:10:2\) = 1,2,3,4,5,6)6 2322 3 1008 4355 t
10 S f
(\267)720 4620 w
10 R f
(Internal list-directed and namelist I/O are allowed.)6 2015 1 791 4620 t
10 S f
(\267)720 4800 w
10 R f
(In an)1 202 1 791 4800 t
10 CW f
(open)1018 4800 w
10 R f
(statement,)1283 4800 w
10 CW f
(name=)1716 4800 w
10 R f
(is treated as)2 471 1 2041 4800 t
10 CW f
(file=)2537 4800 w
10 R f
(.)2837 4800 w
10 S f
(\267)720 4980 w
10 R f
( start with a)3 469( They)1 255(Fortran 90 inline comments are allowed.)5 1620 3 791 4980 t
10 CW f
(!)3160 4980 w
10 R f
(anywhere but column 6.)3 965 1 3270 4980 t
10 B f
(4. INVOCATION EXAMPLES)2 1342 1 720 5269 t
10 R f
(To convert the Fortran \256les)4 1093 1 970 5440 t
10 CW f
(main.f)2088 5440 w
10 R f
(and)2473 5440 w
10 CW f
(subs.f)2642 5440 w
10 R f
(, one might use the UNIX)5 1032 1 3002 5440 t
10 S f
(\322)4034 5390 w
10 R f
(command:)4138 5440 w
9 CW f
(f2c main.f subs.f)2 918 1 1008 5625 t
10 R f
(This results in translated \256les suf\256xed with)6 1782 1 720 5830 t
10 CW f
(.c)2537 5830 w
10 R f
( the resulting C \256les are)5 1007(, i.e.,)1 207 2 2657 5830 t
10 CW f
(main.c)3907 5830 w
10 R f
(and)4303 5830 w
10 CW f
(subs.c)4483 5830 w
10 R f
(. To)1 197 1 4843 5830 t
( \256les in the current directory, compile the resulting C, and create an executable pro-)14 3379(translate all the Fortran)3 941 2 720 5950 t
(gram named)1 496 1 720 6070 t
10 CW f
(myprog)1241 6070 w
10 R f
(, one might use the following pair of UNIX commands:)9 2220 1 1601 6070 t
9 CW f
(f2c *.f)1 378 1 1008 6255 t
(cc -o myprog *.c -lF77 -lI77 -lm)6 1728 1 1008 6355 t
10 R f
(The above)1 430 1 720 6560 t
10 CW f
(-lF77)1187 6560 w
10 R f
(and)1524 6560 w
10 CW f
(-lI77)1705 6560 w
10 R f
(options assume that the ``standard'' Fortran support libraries)7 2511 1 2042 6560 t
10 I f
(libF77)4591 6560 w
10 R f
(and)4896 6560 w
10 I f
(libI77)720 6680 w
10 R f
(are appropriate for use with)4 1110 1 986 6680 t
10 I f
(f 2c)1 138 1 2123 6680 t
10 R f
( \2476\); if)2 274( some systems this is not the case \(as further discussed in)11 2306(. On)1 199 3 2261 6680 t
(one had installed a combination of the appropriate)7 2117 1 720 6800 t
10 I f
(libF77)2878 6800 w
10 R f
(and)3186 6800 w
10 I f
(libI77)3371 6800 w
10 R f
( the)1 164(in the appropriate place, then)4 1225 2 3651 6800 t
(above example might become)3 1195 1 720 6920 t
9 CW f
(f2c *.f)1 378 1 1008 7105 t
(cc -o myprog *.c -lf2c -lm)5 1404 1 1008 7205 t
10 R f
(March 22, 1995)2 635 1 2550 7560 t
cleartomark
showpage
saveobj restore
%%EndPage: 6 7
%%Page: 7 8
/saveobj save def
mark
8 pagesetup
10 R f
(- 7 -)2 166 1 2797 480 t
(Sometimes it is desirable to use)5 1269 1 720 840 t
10 I f
(f 2c)1 138 1 2015 840 t
10 R f
('s)2153 840 w
10 CW f
(-R)2251 840 w
10 R f
(option, which tells)2 744 1 2397 840 t
10 I f
(f 2c)1 138 1 3167 840 t
10 R f
( all \257oating-point operations to)4 1247(not to force)2 462 2 3331 840 t
( might argue that)3 731( \(One)1 266(be done in double precision.)4 1197 3 720 960 t
10 CW f
(-R)2956 960 w
10 R f
( \256nd the current)3 683(should be the default, but we)5 1239 2 3118 960 t
(arrangement more convenient for testing)4 1624 1 720 1080 t
10 I f
(f 2c)1 138 1 2369 1080 t
10 R f
(.\) With)1 308 1 2507 1080 t
10 CW f
(-R)2840 1080 w
10 R f
(speci\256ed, the previous example becomes)4 1633 1 2985 1080 t
9 CW f
(f2c -R *.f)2 540 1 1008 1245 t
(cc -o myprog *.c -lf2c -lm)5 1404 1 1008 1345 t
10 R f
( is easily done by)4 706( This)1 230(Sometimes it is desirable to translate several Fortran source \256les into a single C \256le.)14 3384 3 720 1530 t
(using)720 1650 w
10 I f
(f 2c)1 138 1 962 1650 t
10 R f
(as a \256lter:)2 394 1 1125 1650 t
9 CW f
(cat *.f | f2c >mystuff.c)4 1296 1 1008 1815 t
10 R f
(The)720 2000 w
10 CW f
(-A)904 2000 w
10 R f
(option lets)1 424 1 1053 2000 t
10 I f
(f 2c)1 138 1 1506 2000 t
10 R f
( C when)2 343(use ANSI C constructs [3], which yields more readable)8 2236 2 1673 2000 t
10 CW f
(character)4282 2000 w
10 R f
(vari-)4852 2000 w
( both)1 203( With)1 250(ables are initialized.)2 801 3 720 2120 t
10 CW f
(-A)1999 2120 w
10 R f
(and)2144 2120 w
10 CW f
(-R)2313 2120 w
10 R f
(speci\256ed, the last example becomes)4 1428 1 2458 2120 t
9 CW f
(cat *.f | f2c -A -R >mystuff.c)6 1620 1 1008 2285 t
10 R f
(For use with C++ [15], one would specify)7 1677 1 720 2470 t
10 CW f
(-C++)2422 2470 w
10 R f
(rather than)1 429 1 2687 2470 t
10 CW f
(-A)3141 2470 w
10 R f
(; the last example would then become)6 1509 1 3261 2470 t
9 CW f
(cat *.f | f2c -C++ -R >mystuff.c)6 1728 1 1008 2635 t
10 R f
(The)720 2820 w
10 CW f
(-C++)900 2820 w
10 R f
( of character strings and)4 962(option gives ANSI-style headers and old-style C formatting)7 2384 2 1165 2820 t
10 CW f
(float)4537 2820 w
10 R f
(con-)4863 2820 w
(stants \(since some C++ compilers reject the ANSI versions of these constructs\).)11 3185 1 720 2940 t
10 R f
(With ANSI C, one can use)5 1075 1 720 3099 t
10 I f
(prototypes)1822 3099 w
10 R f
( the calling sequences of procedures,)5 1483(, i.e., a special syntax describing)5 1305 2 2252 3099 t
( make using prototypes convenient, the)5 1595( To)1 167( errors in argument passing.)4 1136(to help catch)2 524 4 720 3219 t
10 CW f
(-P)4173 3219 w
10 R f
(option causes)1 547 1 4324 3219 t
10 I f
(f 2c)1 138 1 4902 3219 t
10 R f
(to create a)2 431 1 720 3339 t
10 I f
(\256le)1187 3339 w
10 CW f
(.P)1309 3339 w
10 R f
( in each input)3 577(of prototypes for the procedures de\256ned)5 1654 2 1465 3339 t
10 I f
(\256le)3733 3339 w
10 CW f
(.f)3855 3339 w
10 R f
(\(or)4012 3339 w
10 I f
(\256le)4165 3339 w
10 CW f
(.F)4287 3339 w
10 R f
(, i.e., the suf\256x)3 633 1 4407 3339 t
(``)720 3459 w
10 CW f
(.f)786 3459 w
10 R f
('' or ``)2 271 1 906 3459 t
10 CW f
(.F)1177 3459 w
10 R f
('' is replaced by ``)4 748 1 1297 3459 t
10 CW f
(.P)2045 3459 w
10 R f
( into a header \256le)4 701( could concatenate all relevant prototype \256les)6 1831(''\). One)1 343 3 2165 3459 t
(and arrange for the header to be)6 1279 1 720 3579 t
10 CW f
(#include)2026 3579 w
10 R f
( could convert all the Fortran)5 1177( One)1 219( compiled.)1 425(d with each C \256le)4 713 4 2506 3579 t
(\256les in the current directory to ANSI C and get corresponding prototype \256les by issuing the command)16 4074 1 720 3699 t
9 CW f
(f2c -P -A *.f)3 702 1 1008 3864 t
10 R f
( an argument; thus to specify)5 1177(Several command options may be combined if none but perhaps the last takes)12 3143 2 720 4049 t
10 CW f
(-R)720 4169 w
10 R f
(and get C++ prototypes for all the \256les in the current directory, one could say either)15 3340 1 865 4169 t
9 CW f
(f2c -C++ -P -R *.f)4 972 1 1008 4334 t
10 R f
(or)720 4519 w
9 CW f
(f2c -C++PR *.f)2 756 1 1008 4684 t
10 R f
(or)720 4869 w
9 CW f
(f2c -RPC++ *.f)2 756 1 1008 5034 t
10 R f
(\320 options can come in any order.)6 1356 1 720 5219 t
10 R f
( data, the)2 369(For numeric variables initialized by character)5 1825 2 720 5378 t
10 CW f
(-W)2942 5378 w
10 R f
( num-)1 264(option speci\256es the \(machine-dependent!\))3 1686 2 3090 5378 t
( option takes a numeric argument, as in)7 1577( This)1 229( discussed in \2476.)3 664(ber of characters per word and is further)7 1616 4 720 5498 t
10 CW f
(-W8)4832 5498 w
10 R f
(;)5012 5498 w
(such an option must be listed either separately or at the end of a string of other options, as in)19 3690 1 720 5618 t
9 CW f
(f2c -C++RPW8 *.f)2 864 1 1008 5783 t
10 B f
(5. TRANSLATION DETAILS)2 1299 1 720 6034 t
10 I f
(F 2c)1 163 1 970 6193 t
10 R f
(is based on the ancient)4 960 1 1172 6193 t
10 I f
(f)2171 6193 w
10 R f
( compiler produced a C parse-tree,)5 1449( That)1 247(77 Fortran compiler of [6].)4 1129 3 2215 6193 t
( compiler has)2 550( The)1 211( converted into input for the second pass of the portable C compiler \(PCC\) [9].)14 3227(which it)1 332 4 720 6313 t
( it provided us)3 578( Thus,)1 276( of many current Fortran compilers.)5 1430(been used for many years and is the direct ancestor)9 2036 4 720 6433 t
( converter)1 401( The)1 205( base of Fortran knowledge and a nearly complete C representation.)10 2702(with a solid)2 469 4 720 6553 t
10 I f
(f 2c)1 138 1 4522 6553 t
10 R f
(is a copy)2 355 1 4685 6553 t
(of the)1 241 1 720 6673 t
10 I f
(f)997 6673 w
10 R f
( program being)2 634(77 Fortran compiler which has been altered to print out a C representation of the)14 3365 2 1041 6673 t
( program)1 371(converted. The)1 631 2 720 6793 t
10 I f
(f 2c)1 138 1 1755 6793 t
10 R f
(is a)1 144 1 1926 6793 t
10 I f
(horror)2103 6793 w
10 R f
( are only)2 363( Users)1 284( and hacked unmercifully.)3 1063(, based on ancient code)4 960 4 2370 6793 t
(supposed to look at its C output, not at its appalling inner workings.)12 2712 1 720 6913 t
10 R f
(Here are some examples that illustrate)5 1552 1 970 7072 t
10 I f
(f 2c)1 138 1 2552 7072 t
10 R f
( short but)2 390( starters, it is helpful to see a)7 1178( For)1 194('s translations.)1 588 4 2690 7072 t
(complete example:)1 757 1 720 7192 t
10 I f
(f 2c)1 138 1 1502 7192 t
10 R f
(turns the Fortran inner product routine)5 1534 1 1665 7192 t
10 R f
(March 22, 1995)2 635 1 2550 7560 t
cleartomark
showpage
saveobj restore
%%EndPage: 7 8
%%Page: 8 9
/saveobj save def
mark
9 pagesetup
10 R f
(- 8 -)2 166 1 2797 480 t
9 CW f
(FUNCTION DOT\(N,X,Y\))1 1026 1 1332 820 t
(INTEGER N)1 486 1 1332 920 t
(REAL X\(N\),Y\(N\))1 756 1 1332 1020 t
(DOT = 0)2 378 1 1332 1120 t
(DO 10 I = 1, N)5 756 1 1332 1220 t
( = DOT + X\(I\)*Y\(I\))4 972(10 DOT)1 486 2 1116 1320 t
(END)1332 1420 w
10 R f
(into)720 1622 w
9 CW f
(/* dot.f -- translated by f2c \(version 19950314\).)7 2646 1 1008 1804 t
(You must link the resulting object file with the libraries:)9 3186 1 1170 1904 t
( that order\))2 648( \(in)1 324(-lf2c -lm)1 486 3 1440 2004 t
(*/)1008 2104 w
(#include "f2c.h")1 864 1 1008 2304 t
(doublereal dot_\(n, x, y\))3 1296 1 1008 2504 t
(integer *n;)1 594 1 1008 2604 t
(real *x, *y;)2 648 1 1008 2704 t
({)1008 2804 w
(/* System generated locals */)4 1566 1 1224 2904 t
(integer i__1;)1 702 1 1224 3004 t
(real ret_val;)1 702 1 1224 3104 t
(/* Local variables */)3 1134 1 1224 3304 t
(static integer i;)2 918 1 1224 3404 t
(/* Parameter adjustments */)3 1458 1 1224 3604 t
(--y;)1224 3704 w
(--x;)1224 3804 w
(/* Function Body */)3 1026 1 1224 4004 t
(ret_val = \(float\)0.;)2 1080 1 1224 4104 t
(i__1 = *n;)2 540 1 1224 4204 t
(for \(i = 1; i <= i__1; ++i\) {)8 1566 1 1224 4304 t
(/* L10: */)2 540 1 1008 4404 t
(ret_val += x[i] * y[i];)4 1242 1 1440 4504 t
(})1224 4604 w
(return ret_val;)1 810 1 1224 4704 t
(} /* dot_ */)3 648 1 1008 4804 t
10 R f
( by f2c'' comment and a)5 1048(The translated C always starts with a ``translated)7 2040 2 720 5106 t
10 CW f
(#include)3847 5106 w
10 R f
(of)4366 5106 w
10 CW f
(f2c.h)4488 5106 w
10 R f
(.)4788 5106 w
10 I f
(F 2c)1 163 1 4877 5106 t
10 R f
( an underscore to the external name)6 1418(forces the variable and procedure names to lower-case and appends)9 2697 2 720 5226 t
10 CW f
(dot)4860 5226 w
10 R f
( parameter adjustments ``)3 1041( The)1 213(\(to avoid possible con\257icts with library names\).)6 1955 3 720 5346 t
10 CW f
(--x)3929 5346 w
10 R f
('' and ``)2 342 1 4109 5346 t
10 CW f
(--y)4451 5346 w
10 R f
('' account)1 409 1 4631 5346 t
( labels are retained in comments for orienteering purposes.)8 2342( Unused)1 356(for the fact that C arrays start at index 0.)9 1622 3 720 5466 t
( into references to the local variable)6 1483(Within a function, Fortran references to the function name are turned)10 2837 2 720 5586 t
10 CW f
(ret_val)720 5706 w
10 R f
( the)1 150( Unless)1 325(, which holds the value to be returned.)7 1549 3 1140 5706 t
10 CW f
(-R)3192 5706 w
10 R f
(option is speci\256ed,)2 757 1 3339 5706 t
10 I f
(f 2c)1 138 1 4123 5706 t
10 R f
(converts the return)2 752 1 4288 5706 t
(type of)1 291 1 720 5826 t
10 CW f
(real)1047 5826 w
10 R f
(function values to)2 740 1 1324 5826 t
10 CW f
(doublereal)2101 5826 w
10 R f
( using the C ``op='' operators leads to greater)8 1920(. Because)1 419 2 2701 5826 t
(ef\256ciency on some machines,)3 1199 1 720 5946 t
10 I f
(f 2c)1 138 1 1950 5946 t
10 R f
(looks for opportunities to use these operators, as in the line ``)11 2502 1 2118 5946 t
10 CW f
(ret_val)4620 5946 w
(+= ...)1 360 1 720 6066 t
10 R f
('' above.)1 379 1 1080 6066 t
10 I f
(F 2c)1 163 1 970 6235 t
10 R f
( of evaluation)2 567(generally dispenses with super\257uous parentheses: ANSI C speci\256es a clear order)10 3307 2 1166 6235 t
(for \257oating-point expressions, and)3 1401 1 720 6355 t
10 I f
(f 2c)1 138 1 2156 6355 t
10 R f
(uses the ANSI C rules to decide when parentheses are required to)11 2712 1 2328 6355 t
( compilers are free to violate parenthe-)6 1605( Non-ANSI)1 497(faithfully translate a parenthesized Fortran expression.)5 2218 3 720 6475 t
(ses; by default,)2 614 1 720 6595 t
10 I f
(f 2c)1 138 1 1365 6595 t
10 R f
( to foil pernicious non-)4 936(does not attempt to break an expression into several statements)9 2570 2 1534 6595 t
( for example, the Fortran)4 995( Thus,)1 275(ANSI C compilers.)2 769 3 720 6715 t
9 CW f
(x = a*\(b*c\))2 594 1 1278 6897 t
(y = \(a*b\)*c)2 594 1 1278 6997 t
10 R f
(becomes)720 7199 w
10 R f
(March 22, 1995)2 635 1 2550 7560 t
cleartomark
showpage
saveobj restore
%%EndPage: 8 9
%%Page: 9 10
/saveobj save def
mark
10 pagesetup
10 R f
(- 9 -)2 166 1 2797 480 t
9 CW f
(x = a * \(b * c\);)6 864 1 1224 820 t
(y = a * b * c;)6 756 1 1224 920 t
10 R f
(The)720 1100 w
10 CW f
(-kr)912 1100 w
10 R f
(and)1129 1100 w
10 CW f
(-krd)1310 1100 w
10 R f
(options cause)1 554 1 1587 1100 t
10 I f
(f 2c)1 138 1 2179 1100 t
10 R f
(to use temporary variables to force correct evaluation order with)9 2685 1 2355 1100 t
(non-ANSI C compilers.)2 952 1 720 1220 t
10 R f
(Fortran I/O is complicated; like)4 1296 1 970 1376 t
10 I f
(f)2301 1376 w
10 R f
(77,)2345 1376 w
10 I f
(f 2c)1 138 1 2505 1376 t
10 R f
(converts a Fortran I/O statement into calls on the Fortran)9 2362 1 2678 1376 t
(I/O library)1 426 1 720 1496 t
10 I f
(libI77)1173 1496 w
10 R f
( Fortran)1 321(. For)1 216 2 1412 1496 t
10 CW f
(read)1976 1496 w
10 R f
(s and)1 210 1 2216 1496 t
10 CW f
(write)2453 1496 w
10 R f
( to)1 104(s, there is generally one call to start the statement, one)10 2183 2 2753 1496 t
( the Fortran declarations)3 973( Given)1 294(end it, and one for each item read or written.)9 1776 3 720 1616 t
9 CW f
(integer count\(10\))1 918 1 1332 1776 t
(real val\(10\))1 648 1 1332 1876 t
10 R f
(the Fortran)1 441 1 720 2056 t
9 CW f
(read\(*,*\) count, val)2 1080 1 1332 2216 t
10 R f
(is turned into some header lines:)5 1296 1 720 2396 t
9 CW f
( = 3;)2 270( _3)1 130(static integer c_)2 918 3 1008 2556 t
( = 10;)2 324( _10)1 184(static integer c_)2 918 3 1008 2656 t
( = 4;)2 270( _4)1 130(static integer c_)2 918 3 1008 2756 t
(. . .)2 270 1 1008 2856 t
(/* Builtin functions */)3 1242 1 1224 2956 t
(integer s_rsle\(\), do_lio\(\), e_rsle\(\);)3 1998 1 1224 3056 t
(. . .)2 270 1 1008 3156 t
(/* Fortran I/O blocks */)4 1296 1 1224 3256 t
( = { 0, 5, 0, 0, 0 };)8 1134( _1)1 130(static cilist io_)2 918 3 1224 3356 t
10 R f
(and the executable lines)3 956 1 720 3536 t
9 CW f
(s_rsle\(&io_ _1\);)1 832 1 1008 3696 t
( \(char *\)&count[0], \(ftnlen\)sizeof\(integer\)\);)3 2430( _10,)1 238( &c_)1 216(do_lio\(&c_ _3,)1 724 4 1008 3796 t
( \(char *\)&val[0], \(ftnlen\)sizeof\(real\)\);)3 2160( _10,)1 238( &c_)1 216(do_lio\(&c_ _4,)1 724 4 1008 3896 t
(e_rsle\(\);)1008 3996 w
10 R f
(Implicit Fortran do-loops, e.g.)3 1205 1 720 4176 t
9 CW f
(read\(*,*\) \(count\(i\), val\(i\), i = 1, 10\))6 2106 1 1332 4336 t
10 R f
(get turned into explicit C loops:)5 1270 1 720 4516 t
9 CW f
(s_rsle\(&io_ _4\);)1 832 1 1008 4676 t
(for \(i = 1; i <= 10; ++i\) {)8 1458 1 1008 4776 t
( \(char *\)&count[i - 1], \(ftnlen\)sizeof\(integer\)\);)5 2646( _1,)1 184( &c_)1 216(do_lio\(&c_ _3,)1 724 4 1224 4876 t
( \(char *\)&val[i - 1], \(ftnlen\)sizeof\(real\)\);)5 2376( _1,)1 184( &c_)1 216(do_lio\(&c_ _4,)1 724 4 1224 4976 t
(})1008 5076 w
(e_rsle\(\);)1008 5176 w
10 R f
(The Fortran)1 478 1 720 5356 t
10 CW f
(end=)1227 5356 w
10 R f
(and)1496 5356 w
10 CW f
(err=)1669 5356 w
10 R f
( as they require tests to be)6 1067(speci\256ers make the resulting C even less readable,)7 2035 2 1938 5356 t
( example,)1 388(inserted. For)1 530 2 720 5476 t
9 CW f
(read\(*,*,err=10\) count, val)2 1458 1 1332 5636 t
(10 continue)1 702 1 1062 5736 t
10 R f
(becomes)720 5916 w
10 R f
(March 22, 1995)2 635 1 2550 7560 t
cleartomark
showpage
saveobj restore
%%EndPage: 9 10
%%Page: 10 11
/saveobj save def
mark
11 pagesetup
10 R f
(- 10 -)2 216 1 2772 480 t
9 CW f
( _1\);)1 238( = s_rsle\(&io_)2 756(i_ _1)1 238 3 1224 820 t
( != 0\) {)3 432( _1)1 130(if \(i_)1 324 3 1224 920 t
(goto L10;)1 486 1 1440 1020 t
(})1224 1120 w
( \(char *\)&count[0], \(ftnlen\)sizeof\(integer\)\);)3 2430( _10,)1 238( &c_)1 216( _3,)1 184( = do_lio\(&c_)2 702(i_ _1)1 238 6 1224 1220 t
( != 0\) {)3 432( _1)1 130(if \(i_)1 324 3 1224 1320 t
(goto L10;)1 486 1 1440 1420 t
(})1224 1520 w
( \(char *\)&val[0], \(ftnlen\)sizeof\(real\)\);)3 2160( _10,)1 238( &c_)1 216( _4,)1 184( = do_lio\(&c_)2 702(i_ _1)1 238 6 1224 1620 t
( != 0\) {)3 432( _1)1 130(if \(i_)1 324 3 1224 1720 t
(goto L10;)1 486 1 1440 1820 t
(})1224 1920 w
( = e_rsle\(\);)2 648(i_ _1)1 238 2 1224 2020 t
(L10:)1008 2120 w
(;)1224 2220 w
10 R f
(A Fortran routine containing)3 1146 1 970 2400 t
10 I f
(n)2141 2400 w
10 CW f
(entry)2216 2400 w
10 R f
(statements is turned into)3 975 1 2541 2400 t
10 I f
(n)3542 2400 w
10 S f
(+)3632 2400 w
10 R f
(2 C functions, a big one contain-)6 1313 1 3727 2400 t
(ing the translation of everything but the)6 1630 1 720 2520 t
10 CW f
(entry)2383 2520 w
10 R f
(statements, and)1 624 1 2716 2520 t
10 I f
(n)3373 2520 w
10 S f
(+)3463 2520 w
10 R f
(1 little ones that invoke the big one.)7 1482 1 3558 2520 t
( to the big one to tell it where to begin; the big one starts with a)16 2676(Each little one passes a different integer)6 1644 2 720 2640 t
( instance, the Fortran)3 843( For)1 189(switch that branches to the code for the appropriate entry.)9 2300 3 720 2760 t
9 CW f
(function sine\(x\))1 864 1 1332 2920 t
(data pi/3.14159265358979324/)1 1512 1 1332 3020 t
(sine = sin\(x\))2 702 1 1332 3120 t
(return)1332 3220 w
(entry cosneg\(y\))1 810 1 1332 3320 t
(cosneg = cos\(y+pi\))2 972 1 1332 3420 t
(return)1332 3520 w
(end)1332 3620 w
10 R f
(is turned into the big procedure)5 1251 1 720 3800 t
9 CW f
( x, y\))2 324( _,)1 130(doublereal sine_0_\(n_)1 1134 3 1008 3960 t
( _;)1 130(int n_)1 324 2 1008 4060 t
(real *x, *y;)2 648 1 1008 4160 t
({)1008 4260 w
(/* Initialized data */)3 1188 1 1224 4360 t
(static real pi = \(float\)3.14159265358979324;)4 2376 1 1224 4560 t
(/* System generated locals */)4 1566 1 1224 4760 t
(real ret_val;)1 702 1 1224 4860 t
(/* Builtin functions */)3 1242 1 1224 5060 t
(double sin\(\), cos\(\);)2 1080 1 1224 5160 t
( {)1 108(switch\(n_ _\))1 616 2 1224 5360 t
(case 1: goto L_cosneg;)3 1188 1 1440 5460 t
(})1440 5560 w
(ret_val = sin\(*x\);)2 972 1 1224 5760 t
(return ret_val;)1 810 1 1224 5860 t
(L_cosneg:)1008 6060 w
(ret_val = cos\(*y + pi\);)4 1242 1 1224 6160 t
(return ret_val;)1 810 1 1224 6260 t
(} /* sine_ */)3 702 1 1008 6360 t
10 R f
(and the little invoking procedures)4 1343 1 720 6540 t
10 R f
(March 22, 1995)2 635 1 2550 7560 t
cleartomark
showpage
saveobj restore
%%EndPage: 10 11
%%Page: 11 12
/saveobj save def
mark
12 pagesetup
10 R f
(- 11 -)2 216 1 2772 480 t
9 CW f
(doublereal sine_\(x\))1 1026 1 1008 820 t
(real *x;)1 432 1 1008 920 t
({)1008 1020 w
(return sine_0_\(0, x, \(real *\)0\);)4 1728 1 1224 1120 t
(})1224 1220 w
(doublereal cosneg_\(y\))1 1134 1 1008 1420 t
(real *y;)1 432 1 1008 1520 t
({)1008 1620 w
(return sine_0_\(1, \(real *\)0, y\);)4 1728 1 1224 1720 t
(})1224 1820 w
10 R f
(Fortran)720 2002 w
10 CW f
(common)1039 2002 w
10 R f
(regions are turned into C)4 993 1 1424 2002 t
10 CW f
(struct)2442 2002 w
10 R f
( example, the Fortran declarations)4 1361(s. For)1 253 2 2802 2002 t
9 CW f
(common /named/ c, d, r, i, m)6 1512 1 1332 2164 t
(complex c\(10\))1 702 1 1332 2264 t
(double precision d\(10\))2 1188 1 1332 2364 t
(real r\(10\))1 540 1 1332 2464 t
(integer i\(10\))1 702 1 1332 2564 t
(logical m\(10\))1 702 1 1332 2664 t
(if \(m\(i\(2\)\)\) d\(3\) = d\(4\)/d\(5\))4 1566 1 1332 2864 t
10 R f
(result in)1 325 1 720 3046 t
9 CW f
(struct {)1 432 1 1008 3208 t
(complex c[10];)1 756 1 1224 3308 t
(doublereal d[10];)1 918 1 1224 3408 t
(real r[10];)1 594 1 1224 3508 t
(integer i[10];)1 756 1 1224 3608 t
(logical m[10];)1 756 1 1224 3708 t
(} named_;)1 486 1 1008 3808 t
(#define named_1 named_)2 1188 1 1008 4008 t
(. . .)2 270 1 1008 4108 t
(if \(named_1.m[named_1.i[1] - 1]\) {)4 1836 1 1224 4308 t
(named_1.d[2] = named_1.d[3] / named_1.d[4];)4 2322 1 1440 4408 t
(})1440 4508 w
10 R f
(Under the)1 396 1 720 4690 t
10 CW f
(-p)1141 4690 w
10 R f
(option, the above)2 691 1 1286 4690 t
10 CW f
(if)2002 4690 w
10 R f
(statement becomes more readable:)3 1377 1 2147 4690 t
9 CW f
(. . .)2 270 1 1008 4852 t
(#define c \(named_1.c\))2 1134 1 1008 4952 t
(#define d \(named_1.d\))2 1134 1 1008 5052 t
(#define r \(named_1.r\))2 1134 1 1008 5152 t
(#define i \(named_1.i\))2 1134 1 1008 5252 t
(#define m \(named_1.m\))2 1134 1 1008 5352 t
(. . .)2 270 1 1008 5452 t
(if \(m[i[1] - 1]\) {)4 972 1 1224 5552 t
(d[2] = d[3] / d[4];)4 1026 1 1440 5652 t
10 R f
(If the above)2 476 1 720 5834 t
10 CW f
(common)1221 5834 w
10 R f
(block were involved in a)4 987 1 1606 5834 t
10 CW f
(block data)1 600 1 2618 5834 t
10 R f
(subprogram, e.g.)1 671 1 3243 5834 t
9 CW f
(block data)1 540 1 1332 5996 t
(common /named/ c, d, r, i, l, m)7 1674 1 1332 6096 t
(complex c\(10\))1 702 1 1332 6196 t
(double precision d\(10\))2 1188 1 1332 6296 t
(real r\(10\))1 540 1 1332 6396 t
(integer i\(10\))1 702 1 1332 6496 t
(logical m\(10\))1 702 1 1332 6596 t
(data c\(1\)/\(1.0,0e0\)/, d\(2\)/2d0/, r\(3\)/3e0/, i\(4\)/4/,)4 2808 1 1332 6696 t
(* m\(5\)/.false./)1 1026 1 1278 6796 t
(end)1332 6896 w
10 R f
(then the)1 345 1 720 7078 t
10 CW f
(struct)1116 7078 w
10 R f
(would begin ``)2 640 1 1527 7078 t
10 CW f
(struct named_1_ {)2 1072 1 2167 7078 t
10 R f
('', and)1 287 1 3239 7078 t
10 I f
(f 2c)1 138 1 3578 7078 t
10 R f
(would issue a more elaborate)4 1272 1 3768 7078 t
10 CW f
(#define)720 7198 w
10 R f
(:)1140 7198 w
10 R f
(March 22, 1995)2 635 1 2550 7560 t
cleartomark
showpage
saveobj restore
%%EndPage: 11 12
%%Page: 12 13
/saveobj save def
mark
13 pagesetup
10 R f
(- 12 -)2 216 1 2772 480 t
9 CW f
(#define named_1 \(*\(struct named_1_ *\) &named_\))5 2484 1 1008 820 t
(/* Initialized data */)3 1188 1 1008 1020 t
(struct {)1 432 1 1008 1220 t
(complex e_1;)1 648 1 1224 1320 t
(doublereal fill_2[10];)1 1188 1 1224 1420 t
(doublereal e_3;)1 810 1 1224 1520 t
(doublereal fill_4[9];)1 1134 1 1224 1620 t
(real e_5;)1 486 1 1224 1720 t
(integer fill_6[10];)1 1026 1 1224 1820 t
(integer e_7;)1 648 1 1224 1920 t
(integer fill_8[11];)1 1026 1 1224 2020 t
(logical e_9;)1 648 1 1224 2120 t
(integer fill_10[5];)1 1026 1 1224 2220 t
(} named_ = { \(float\)1., \(float\)0., {0}, 2., {0}, \(float\)3., {0}, 4,)11 3618 1 1224 2320 t
( };)1 162({0}, FALSE_)1 648 2 1656 2420 t
10 R f
(In this example,)2 655 1 720 2600 t
10 I f
(f 2c)1 138 1 1407 2600 t
10 R f
( initialization rules to supply zeros to the)7 1686(relies on C's structure)3 900 2 1577 2600 t
10 CW f
(fill_)4231 2600 w
10 I f
(n)4531 2600 w
10 R f
(arrays that)1 426 1 4614 2600 t
(take up the space for which no)6 1261 1 720 2720 t
10 CW f
(data)2013 2720 w
10 R f
( logical constants)2 706( \(The)1 244(values were given.)2 757 3 2284 2720 t
10 CW f
(TRUE_)4022 2720 w
10 R f
(and)4353 2720 w
10 CW f
(FALSE_)4528 2720 w
10 R f
(are)4919 2720 w
(de\256ned in)1 397 1 720 2840 t
10 CW f
(f2c.h)1142 2840 w
10 R f
(.\))1442 2840 w
10 R f
( example,)1 390( For)1 191( of multiple-character strings generally result in function calls.)8 2509(Character manipulations)1 980 4 970 2996 t
(the Fortran)1 441 1 720 3116 t
9 CW f
(character*\(*\) function cat\(a,b\))2 1674 1 1332 3276 t
(character*\(*\) a, b)2 972 1 1332 3376 t
(cat = a // b)4 648 1 1332 3476 t
(end)1332 3576 w
10 R f
(yields)720 3756 w
9 CW f
(. . .)2 270 1 1008 3916 t
( = 2;)2 270( _2)1 130(static integer c_)2 918 3 1008 4016 t
(/* Character */ int cat_\(ret_val, ret_val_len, a, b, a_len, b_len\))9 3564 1 1008 4216 t
(char *ret_val;)1 756 1 1008 4316 t
(ftnlen ret_val_len;)1 1026 1 1008 4416 t
(char *a, *b;)2 648 1 1008 4516 t
(ftnlen a_len;)1 702 1 1008 4616 t
(ftnlen b_len;)1 702 1 1008 4716 t
({)1008 4816 w
(/* System generated locals */)4 1566 1 1224 5016 t
( _1[2];)1 346(address a_)1 540 2 1224 5116 t
( _1[2];)1 346(integer i_)1 540 2 1224 5216 t
(/* Builtin functions */)3 1242 1 1224 5416 t
(/* Subroutine */ int s_cat\(\);)4 1566 1 1224 5516 t
(/* Writing concatenation */)3 1458 1 1008 5716 t
( = a;)2 270( _1[0])1 292( = a_len, a_)3 648(i_ _1[0])1 400 4 1224 5816 t
( = b;)2 270( _1[1])1 292( = b_len, a_)3 648(i_ _1[1])1 400 4 1224 5916 t
( ret_val_len\);)1 756( _2,)1 184( &c_)1 216( _1,)1 184( i_)1 162( _1,)1 184(s_cat\(ret_val, a_)1 918 7 1224 6016 t
(} /* cat_ */)3 648 1 1008 6116 t
10 R f
( \()1 64(Note how the return-value length)4 1345 2 720 6296 t
10 CW f
(ret_val_len)2129 6296 w
10 R f
(\) and parameter lengths \()4 1021 1 2789 6296 t
10 CW f
(a_len)3810 6296 w
10 R f
(and)4141 6296 w
10 CW f
(b_len)4316 6296 w
10 R f
(\) are used.)2 424 1 4616 6296 t
( example, the body of the Fortran)6 1334( For)1 189(Single character operations are generally done in-line.)6 2158 3 720 6416 t
10 R f
(March 22, 1995)2 635 1 2550 7560 t
cleartomark
showpage
saveobj restore
%%EndPage: 12 13
%%Page: 13 14
/saveobj save def
mark
14 pagesetup
10 R f
(- 13 -)2 216 1 2772 480 t
9 CW f
(character*1 function lastnb\(x,n\))2 1728 1 1332 820 t
(character*1 x\(n\))1 864 1 1332 920 t
(lastnb = ' ')3 648 1 1332 1020 t
(do 10 i = n, 1, -1)6 972 1 1332 1120 t
(if \(x\(i\) .ne. ' '\) then)5 1242 1 1494 1220 t
(lastnb = x\(i\))2 702 1 1656 1320 t
(return)1656 1420 w
(end if)1 324 1 1656 1520 t
(10 continue)1 864 1 1062 1620 t
(end)1332 1720 w
10 R f
(becomes)720 1970 w
9 CW f
(*ret_val = ' ';)3 810 1 1224 2200 t
(for \(i = *n; i >= 1; --i\) {)8 1458 1 1224 2300 t
(if \(x[i] != ' '\) {)5 972 1 1440 2400 t
(*ret_val = x[i];)2 864 1 1656 2500 t
(return ;)1 432 1 1656 2600 t
(})1440 2700 w
(/* L10: */)2 540 1 1008 2800 t
(})1224 2900 w
10 I f
(F 2c)1 163 1 970 3150 t
10 R f
(uses)1159 3150 w
10 CW f
(struct)1357 3150 w
10 R f
(s and)1 209 1 1717 3150 t
10 CW f
(#define)1952 3150 w
10 R f
(s to translate)2 507 1 2372 3150 t
10 CW f
(equivalence)2905 3150 w
10 R f
( complicated example show-)3 1151( a)1 70(s. For)1 254 3 3565 3150 t
(ing the interaction of)3 880 1 720 3270 t
10 CW f
(data)1640 3270 w
10 R f
(with)1920 3270 w
10 CW f
(common)2138 3270 w
10 R f
(,)2498 3270 w
10 CW f
(equivalence)2563 3270 w
10 R f
( good measure, Hollerith notation,)4 1427(, and, for)2 390 2 3223 3270 t
(consider the Fortran)2 804 1 720 3390 t
9 CW f
(common /cmname/ c)2 918 1 1332 3620 t
(complex c\(10\))1 702 1 1332 3720 t
(double precision d\(10\))2 1188 1 1332 3820 t
(real r\(10\))1 540 1 1332 3920 t
(integer i\(10\))1 702 1 1332 4020 t
(logical m\(10\))1 702 1 1332 4120 t
(equivalence \(c\(1\),d\(1\),r\(1\),i\(1\),m\(1\)\))1 2052 1 1332 4220 t
(data c\(1\)/\(1.,0.\)/)1 972 1 1332 4320 t
(data d\(2\)/2d0/, r\(5\)/3e0/, i\(6\)/4/, m\(7\)/.true./)4 2592 1 1332 4420 t
(call sam\(c,d\(1\),r\(2\),i\(3\),m\(4\),14hsome hollerith,14\))2 2808 1 1332 4520 t
(end)1332 4620 w
10 R f
(The resulting C is)3 714 1 720 4870 t
9 CW f
(. . .)2 270 1 1008 5100 t
(struct cmname_1_ {)2 972 1 1008 5200 t
(complex c[10];)1 756 1 1224 5300 t
(};)1008 5400 w
(#define cmname_1 \(*\(struct cmname_1_ *\) &cmname_\))5 2646 1 1008 5600 t
(/* Initialized data */)3 1188 1 1008 5800 t
(struct {)1 432 1 1008 6000 t
(complex e_1;)1 648 1 1224 6100 t
(doublereal e_2;)1 810 1 1224 6200 t
(real e_3;)1 486 1 1224 6300 t
(integer e_4;)1 648 1 1224 6400 t
(logical e_5;)1 648 1 1224 6500 t
(integer fill_6[13];)1 1026 1 1224 6600 t
(} cmname_ = { \(float\)1., \(float\)0., 2., \(float\)3., 4, TRUE_ };)10 3348 1 1224 6700 t
(/* Table of constant values */)5 1620 1 1008 7000 t
( = 14;)2 324( _14)1 184(static integer c_)2 918 3 1008 7200 t
10 R f
(March 22, 1995)2 635 1 2550 7560 t
cleartomark
showpage
saveobj restore
%%EndPage: 13 14
%%Page: 14 15
/saveobj save def
mark
15 pagesetup
10 R f
(- 14 -)2 216 1 2772 480 t
9 CW f
( _\(\))1 184(/* Main program */ MAIN_)4 1296 2 1008 820 t
({)1008 920 w
(/* Local variables */)3 1134 1 1224 1120 t
(#define d \(\(doublereal *\)&cmname_1\))3 1890 1 1008 1320 t
(#define i \(\(integer *\)&cmname_1\))3 1728 1 1008 1420 t
(#define l \(\(logical *\)&cmname_1\))3 1728 1 1008 1520 t
(#define r \(\(real *\)&cmname_1\))3 1566 1 1008 1620 t
(extern /* Subroutine */ int sam_\(\);)5 1890 1 1224 1720 t
( 14L\);)1 324( _14,)1 238(sam_\(cmname_1.c, d, &r[1], &i[2], &m[3], "some hollerith", &c_)7 3348 3 1224 1920 t
( */)1 162( _)1 76(} /* MAIN_)2 540 3 1008 2020 t
(#undef r)1 432 1 1008 2220 t
(#undef l)1 432 1 1008 2320 t
(#undef i)1 432 1 1008 2420 t
(#undef d)1 432 1 1008 2520 t
10 R f
(As this example shows,)3 965 1 720 2715 t
10 I f
(f 2c)1 138 1 1717 2715 t
10 R f
( function named)2 665(turns a Fortran MAIN program into a C)7 1633 2 1887 2715 t
10 CW f
(MAIN_ _)1 384 1 4218 2715 t
10 R f
( not)1 161(. Why)1 277 2 4602 2715 t
10 CW f
(main)720 2835 w
10 R f
(? Well,)1 319 1 960 2835 t
10 I f
(libF77)1310 2835 w
10 R f
( for \256les to be closed automatically when the)8 1832(contains a C main routine that arranges)6 1600 2 1608 2835 t
( to be printed if a \257oating-point exception occurs, and)9 2183(Fortran program stops, arranges for an error message)7 2137 2 720 2955 t
(arranges for the command-line argument accessing functions)6 2463 1 720 3075 t
10 CW f
(iargc)3213 3075 w
10 R f
(and)3542 3075 w
10 CW f
(getarg)3715 3075 w
10 R f
( This)1 232(to work properly.)2 704 2 4104 3075 t
(C main routine invokes)3 936 1 720 3195 t
10 CW f
(MAIN_ _)1 384 1 1681 3195 t
10 R f
(.)2065 3195 w
10 B f
( ISSUES)1 371(6. PORTABILITY)1 826 2 720 3465 t
10 R f
(Three portability issues are relevant to)5 1543 1 970 3630 t
10 I f
(f 2c)1 138 1 2540 3630 t
10 R f
( libraries \()2 416(: the portability of the support)5 1207 2 2678 3630 t
10 I f
(libF77)4301 3630 w
10 R f
(and)4596 3630 w
10 I f
(libI77)4768 3630 w
10 R f
(\))5007 3630 w
(upon which the translated C programs rely, that of the converter)10 2559 1 720 3750 t
10 I f
(f 2c)1 138 1 3304 3750 t
10 R f
(itself, and that of the C it produces.)7 1407 1 3467 3750 t
10 R f
( vendors \(e.g., Sun and MIPS\) have changed the calling conventions)10 2812(Regarding the \256rst issue, some)4 1258 2 970 3915 t
(for their)1 330 1 720 4035 t
10 I f
(libI77)1081 4035 w
10 R f
( MIPS\) have changed the)4 1029( vendors \(e.g.,)2 580( Other)1 283(from the original conventions \(those of [6]\).)6 1797 4 1351 4035 t
10 I f
(libF77)720 4155 w
10 R f
(calling conventions \(e.g., for)3 1154 1 1014 4155 t
10 CW f
(complex)2196 4155 w
10 R f
( having libraries)2 655( Thus,)1 278(-valued functions\).)1 757 3 2616 4155 t
10 I f
(libF77)4334 4155 w
10 R f
(and)4629 4155 w
10 I f
(libI77)4801 4155 w
10 R f
(or otherwise having library routines with the names that)8 2260 1 720 4275 t
10 I f
(f 2c)1 138 1 3008 4275 t
10 R f
( using a machine)3 680( When)1 290( insuf\256cient.)1 502(expects is)1 394 4 3174 4275 t
(whose vendor provides but has gratuitously changed)6 2133 1 720 4395 t
10 I f
(libF77)2884 4395 w
10 R f
(or)3182 4395 w
10 I f
(libI77)3296 4395 w
10 R f
( objects com-)2 552(, one cannot safely mix)4 953 2 3535 4395 t
(piled from the C produced by)5 1224 1 720 4515 t
10 I f
(f 2c)1 138 1 1978 4515 t
10 R f
(with objects compiled by the vendor's Fortran compiler, and one must)10 2891 1 2149 4515 t
(use the correct libraries with programs translated by)7 2104 1 720 4635 t
10 I f
(f 2c)1 138 1 2853 4635 t
10 R f
( is to)2 205( such a case, the recommended procedure)6 1682(. In)1 162 3 2991 4635 t
(obtain source for the libraries \(e.g. from)6 1602 1 720 4755 t
10 I f
(netlib)2348 4755 w
10 R f
( them into a single library, say)6 1213(\320 see \2478\), combine)3 807 2 2610 4755 t
10 CW f
(libf2c)4655 4755 w
10 R f
(,)5015 4755 w
( a UNIX system, for example, one)6 1429( On)1 182(and install the library where it they can be conveniently accessed.)10 2709 3 720 4875 t
(might install)1 504 1 720 4995 t
10 CW f
(libf2c)1249 4995 w
10 R f
(in)1634 4995 w
10 CW f
(/usr/lib/libf2c.a)1737 4995 w
10 R f
(; then one could issue the command)6 1432 1 2757 4995 t
9 CW f
(cc *.c -lf2c -lm)3 864 1 1008 5170 t
10 R f
(to compile and link a program translated by)7 1745 1 720 5365 t
10 I f
(f 2c)1 138 1 2490 5365 t
10 R f
(.)2628 5365 w
10 R f
( IBM, MIPS,)2 549(The converter itself is reasonably portable and has run successfully on Apollo, Cray,)12 3521 2 970 5530 t
( However,)1 448( UNIX operating system.)3 1028(SGI, Sun and DEC VAX equipment, all running some version of the)11 2844 3 720 5650 t
( be portable due to subtle storage management issues in Fortran)10 2581(we shall see that the C it produces may not)9 1739 2 720 5770 t
( any case, the C output of)6 1036(77. In)1 261 2 720 5890 t
10 I f
(f 2c)1 138 1 2045 5890 t
10 R f
( least if the)3 447(will run \256ne, at)3 620 2 2211 5890 t
10 CW f
(-W)3305 5890 w
10 I f
(n)3425 5890 w
10 R f
(option \(see Appendix B\) is used to set)7 1538 1 3502 5890 t
(the number of characters per word correctly, and if C)9 2121 1 720 6010 t
10 CW f
(double)2866 6010 w
10 R f
(values may fall on an odd-word boundary.)6 1694 1 3251 6010 t
10 R f
(The Fortran 77 standard says that)5 1474 1 970 6175 t
10 CW f
(Complex)2497 6175 w
10 R f
(and)2970 6175 w
10 CW f
(Double Precision)1 989 1 3168 6175 t
10 R f
(objects occupy two)2 829 1 4211 6175 t
( may be necessary to edit the)6 1177( It)1 116(``units'' of space while other non-character data types occupy one ``unit.'')10 3027 3 720 6295 t
(header \256le)1 430 1 720 6415 t
10 CW f
(f2c.h)1187 6415 w
10 R f
( the Cray, for example,)4 972( On)1 185(to make these assumptions hold, if possible.)6 1839 3 1524 6415 t
10 CW f
(float)4558 6415 w
10 R f
(and)4896 6415 w
10 CW f
(double)720 6535 w
10 R f
( C types, and Fortran double precision, if available, would correspond to the C type)14 3416(are the same)2 512 2 1112 6535 t
10 CW f
(long double)1 660 1 720 6655 t
10 R f
( this case, changing the de\256nition of)6 1446(. In)1 158 2 1380 6655 t
10 CW f
(doublereal)3009 6655 w
10 R f
(in)3634 6655 w
10 CW f
(f2c.h)3737 6655 w
10 R f
(from)4062 6655 w
9 CW f
(typedef double doublereal;)2 1404 1 1008 6830 t
10 R f
(to)720 7025 w
9 CW f
(typedef long double doublereal;)3 1674 1 1008 7200 t
10 R f
(March 22, 1995)2 635 1 2550 7560 t
cleartomark
showpage
saveobj restore
%%EndPage: 14 15
%%Page: 15 16
/saveobj save def
mark
16 pagesetup
10 R f
(- 15 -)2 216 1 2772 480 t
( the Think C compiler on the Macintosh, on the other hand, this line would need)15 3251( For)1 192(would be appropriate.)2 877 3 720 840 t
(to become)1 413 1 720 960 t
9 CW f
(typedef short double doublereal;)3 1728 1 1008 1135 t
10 R f
( prede\256nes symbols that could clash with translated Fortran variable names, then)11 3306(If your C compiler)3 764 2 970 1330 t
( appropriate)1 480(you should also add)3 803 2 720 1450 t
10 CW f
(#undef)2029 1450 w
10 R f
(lines to)1 293 1 2415 1450 t
10 CW f
(f2c.h)2734 1450 w
10 R f
( current default)2 611(. The)1 231 2 3034 1450 t
10 CW f
(f2c.h)3902 1450 w
10 R f
(provides the follow-)2 812 1 4228 1450 t
(ing)720 1570 w
10 CW f
(#undef)873 1570 w
10 R f
(lines for the following symbols:)4 1278 1 1258 1570 t
10 CW f
( u370 u3b5)2 780( sun2)1 510( sgi)1 330(cray mc68020)1 990 4 1575 1765 t
( unix)1 450( sun3 u3b)2 720(gcos mips sparc)2 1440 3 1575 1885 t
( u3b2 vax)2 720( sun sun4)2 960(mc68010 pdp11)1 870 3 1575 2005 t
10 R f
(As an extension to the Fortran 77 Standard,)7 1786 1 970 2200 t
10 I f
(f 2c)1 138 1 2788 2200 t
10 R f
( variables to be initialized with)5 1275(allows noncharacter)1 807 2 2958 2200 t
( extension is inherently nonportable, as the number of characters storable per ``unit'')12 3492( This)1 238(character data.)1 590 3 720 2320 t
( 32 bit machines are the most plentiful,)7 1560( Since)1 272(varies from machine to machine.)4 1311 3 720 2440 t
10 I f
(f 2c)1 138 1 3888 2440 t
10 R f
( per)1 153(assumes 4 characters)2 836 2 4051 2440 t
(Fortran ``unit'', but this assumption can be overridden by the)9 2573 1 720 2560 t
10 CW f
(-W)3332 2560 w
10 I f
(n)3452 2560 w
10 R f
( example,)1 401( For)1 202(command-line option.)1 896 3 3541 2560 t
10 CW f
(-W8)720 2680 w
10 R f
( An)1 177( Cray computers, since Crays store 8 characters per word.)9 2347(is appropriate for C that is to be run on)9 1587 3 929 2680 t
( Fortran)1 319( the)1 172(example is helpful here:)3 962 3 720 2800 t
9 CW f
(data i/'abcd'/)1 756 1 1332 2975 t
(j = i)2 270 1 1332 3075 t
(end)1332 3175 w
10 R f
(turns into)1 381 1 720 3370 t
9 CW f
(/* Initialized data */)3 1188 1 1224 3545 t
(static struct {)2 810 1 1224 3745 t
(char e_1[4];)1 648 1 1440 3845 t
(} equiv_3 = { {'a', 'b', 'c', 'd'} };)8 1998 1 1440 3945 t
(#define i \(*\(integer *\)&equiv_3\))3 1728 1 1008 4145 t
(static integer j;)2 918 1 1224 4345 t
(j = i;)2 324 1 1224 4545 t
(. . .)2 270 1 1008 4645 t
(#undef i)1 432 1 1008 4745 t
10 R f
(\(Some use of)2 533 1 720 4940 t
10 CW f
(i)1281 4940 w
10 R f
(, e.g. ``)2 291 1 1341 4940 t
10 CW f
(j = i)2 306 1 1632 4940 t
10 R f
('', is necessary or)3 712 1 1938 4940 t
10 I f
(f 2c)1 138 1 2678 4940 t
10 R f
(will see that)2 489 1 2844 4940 t
10 CW f
(i)3361 4940 w
10 R f
( If)1 120( and will not initialize it.\))5 1037(is not used)2 434 3 3449 4940 t
( Cray and the string were)5 1086(the target machine were a)4 1092 2 720 5060 t
10 CW f
('abcdefgh')2939 5060 w
10 R f
(or)3580 5060 w
10 CW f
("abcdefhg")3704 5060 w
10 R f
(, then the Fortran)3 736 1 4304 5060 t
(would run \256ne, but the C produced by)7 1577 1 720 5180 t
10 I f
(f 2c)1 138 1 2330 5180 t
10 R f
(would only store)2 688 1 2501 5180 t
10 CW f
("abcd")3222 5180 w
10 R f
( the default number of)4 923(in i, 4 being)3 502 2 3615 5180 t
( The)1 205(characters per word.)2 810 2 720 5300 t
10 I f
(f 2c)1 138 1 1760 5300 t
10 R f
(command-line option)1 858 1 1923 5300 t
10 CW f
(-W8)2806 5300 w
10 R f
(gives the correct initialization for a Cray.)6 1644 1 3011 5300 t
10 R f
( the option)2 438( Using)1 294(The initialization above is clumsy, using 4 separate characters.)8 2533 3 970 5465 t
10 CW f
(-A)4265 5465 w
10 R f
(, for ANSI, pro-)3 655 1 4385 5465 t
(duces)720 5585 w
9 CW f
(. . .)2 270 1 1008 5760 t
(} equiv_3 = { "abcd" };)5 1242 1 1440 5860 t
(. . .)2 270 1 1008 5960 t
10 R f
(See Appendix B.)2 680 1 720 6155 t
10 R f
( examples explain why the Fortran 77 standard excludes Hollerith data statements: the)12 3637(The above)1 433 2 970 6320 t
( \(For-)1 261( not speci\256ed and hence such code is not portable even in Fortran.)12 2709(number of characters per word is)5 1350 3 720 6440 t
( that Fortran)2 508( Note)1 251(tran that conservatively assumes only 1 or 2 characters per word is portable but messy.)14 3561 3 720 6560 t
(77 forbids the mixing, via)4 1056 1 720 6680 t
10 CW f
(common)1806 6680 w
10 R f
(,)2166 6680 w
10 CW f
(data)2221 6680 w
10 R f
(, or)1 138 1 2461 6680 t
10 CW f
(equivalence)2629 6680 w
10 R f
( Like)1 237( noncharacter types.)2 808(, of character and)3 706 3 3289 6680 t
(many Fortran compilers,)2 987 1 720 6800 t
10 I f
(f 2c)1 138 1 1733 6800 t
10 R f
(permits such nonportable mixing; initialization of numeric variables with Hol-)9 3143 1 1897 6800 t
(lerith data is one example of this mixing.\))7 1671 1 720 6920 t
10 R f
(Some Fortran 66 programs pass Hollerith strings to)7 2052 1 970 7085 t
10 CW f
(integer)3047 7085 w
10 R f
(variables.)3492 7085 w
10 I f
(F 2c)1 163 1 3927 7085 t
10 R f
( string)1 254(treats a Hollerith)2 671 2 4115 7085 t
( systems if the character string winds up being)8 1869(as a character string, but this may lead to bus errors on some)12 2451 2 720 7205 t
10 R f
(March 22, 1995)2 635 1 2550 7560 t
cleartomark
showpage
saveobj restore
%%EndPage: 15 16
%%Page: 16 17
/saveobj save def
mark
17 pagesetup
10 R f
(- 16 -)2 216 1 2772 480 t
( The)1 212(improperly aligned.)1 795 2 720 840 t
10 CW f
(-h)1759 840 w
10 R f
(option instructs)1 627 1 1911 840 t
10 I f
(f 2c)1 138 1 2570 840 t
10 R f
( character variables and constants the same)6 1765(to try to give)3 535 2 2740 840 t
(alignment as)1 508 1 720 960 t
10 CW f
(integer)1253 960 w
10 R f
(s. Under)1 363 1 1673 960 t
10 CW f
(-h)2061 960 w
10 R f
( Fortran)1 319( the)1 172(, for example,)2 554 3 2181 960 t
9 CW f
(call foo\("a string"\))2 1080 1 1332 1120 t
(call goo\(8ha string\))2 1080 1 1332 1220 t
10 R f
(is translated to)2 583 1 720 1400 t
9 CW f
(static struct { integer fill; char val[8+1]; char fill2[3]; } c_b1_st = { 0,)13 4104 1 1008 1560 t
("a string" };)2 702 1 1440 1660 t
(#define c_b1 c_b1_st.val)2 1296 1 1008 1760 t
(. . .)2 270 1 1008 1860 t
(foo_\(c_b1, 8L\);)1 810 1 1224 1960 t
(goo_\(c_b1, 8L\);)1 810 1 1224 2060 t
(. . .)2 270 1 1008 2160 t
10 R f
(Some systems require that C values of type)7 1736 1 970 2340 t
10 CW f
(double)2732 2340 w
10 R f
( Fortran)1 346( double-word boundary.)2 966(be aligned on a)3 610 3 3118 2340 t
10 CW f
(common)720 2460 w
10 R f
(and)1117 2460 w
10 CW f
(equivalence)1298 2460 w
10 R f
( require some C)3 668(statements may)1 631 2 1995 2460 t
10 CW f
(double)3330 2460 w
10 R f
(values to be aligned on an odd-)6 1314 1 3726 2460 t
( if nec-)2 294( systems where double-word alignment is required, C compilers pad structures,)10 3212( On)1 177(word boundary.)1 637 4 720 2580 t
( validity of)2 441( such padding has no effect on the)7 1375( Often)1 279(essary, to arrange for the right alignment.)6 1664 4 720 2700 t
10 I f
(f 2c)1 138 1 4505 2700 t
10 R f
('s transla-)1 397 1 4643 2700 t
( using)1 243(tion, but)1 334 2 720 2820 t
10 CW f
(common)1323 2820 w
10 R f
(or)1709 2820 w
10 CW f
(equivalence)1818 2820 w
10 R f
(, it is easy to contrive examples in which the translated C works)12 2562 1 2478 2820 t
(incorrectly.)720 2940 w
10 I f
(F 2c)1 163 1 1233 2940 t
10 R f
( may cause trouble, but, like)5 1154(issues a warning message when double-word alignment)6 2260 2 1427 2940 t
10 I f
(f)4871 2940 w
10 R f
(77,)4915 2940 w
(it makes no attempt to circumvent this trouble; the run-time costs of circumvention would be substantial.)15 4192 1 720 3060 t
10 R f
(Long decimal strings in)3 950 1 970 3216 t
10 CW f
(data)1946 3216 w
10 R f
( expressions involving)2 904( However,)1 442( C unaltered.)2 517(statements are passed to)3 965 4 2212 3216 t
( a VAX 8550, the Fortran)5 1026( On)1 172(long decimal strings are rounded in a machine-dependent manner.)8 2636 3 720 3336 t
9 CW f
(x=1.2**10)1332 3496 w
(end)1332 3596 w
10 R f
(yields the C)2 478 1 720 3776 t
9 CW f
(static real x;)2 756 1 1224 3936 t
(x = \(float\)6.1917364224000008;)2 1620 1 1224 4136 t
10 R f
( external scope, such as the)5 1156(ANSI C compilers require that all but one instance of any entity with)12 2914 2 970 4316 t
10 CW f
(struct)720 4436 w
10 R f
(s into which)2 497 1 1080 4436 t
10 I f
(f 2c)1 138 1 1605 4436 t
10 R f
(translates)1771 4436 w
10 CW f
(common)2176 4436 w
10 R f
(, be declared)2 512 1 2536 4436 t
10 CW f
(extern)3076 4436 w
10 R f
(and that exactly one declaration should)5 1576 1 3464 4436 t
(de\256ne the entity, i.e., should not be declared)7 1830 1 720 4556 t
10 CW f
(extern)2584 4556 w
10 R f
( restriction.)1 465( older C compilers have no such)6 1341(. Most)1 290 3 2944 4556 t
( with ANSI usage, the)4 905(To be compatible)2 711 2 720 4676 t
10 I f
(f 2c)1 138 1 2366 4676 t
10 R f
(command-line option)1 863 1 2534 4676 t
10 CW f
(-ec)3427 4676 w
10 R f
(causes the)1 412 1 3637 4676 t
10 CW f
(struct)4079 4676 w
10 R f
(corresponding)4469 4676 w
(to an uninitialized)2 734 1 720 4796 t
10 CW f
(common)1485 4796 w
10 R f
(region to be declared)3 857 1 1876 4796 t
10 CW f
(extern)2764 4796 w
10 R f
(and makes a)2 505 1 3155 4796 t
10 CW f
(union)3691 4796 w
10 R f
( declara-)1 352(of all successive)2 666 2 4022 4796 t
(tions of that)2 498 1 720 4916 t
10 CW f
(common)1288 4916 w
10 R f
(region into a de\256ning declaration placed in a \256le with the name)11 2637 1 1683 4916 t
10 CW f
(cname_com.c)4355 4916 w
10 R f
(,)5015 4916 w
(where)720 5036 w
10 CW f
(cname)988 5036 w
10 R f
(is the name of the)4 710 1 1313 5036 t
10 CW f
(common)2048 5036 w
10 R f
( example, the Fortran)3 854(region. For)1 469 2 2433 5036 t
9 CW f
(common /cmname/ c)2 918 1 1332 5196 t
(complex c\(10\))1 702 1 1332 5296 t
(c\(1\)=cmplx\(1.,0.\))1332 5396 w
(call sam\(c\))1 594 1 1332 5496 t
(end)1332 5596 w
(subroutine sam\(c\))1 918 1 1332 5696 t
(complex c)1 486 1 1332 5796 t
(common /cmname/ca)1 918 1 1332 5896 t
(complex ca\(10\))1 756 1 1332 5996 t
(ca\(2\) = cmplx\(1e0,2e0\))2 1188 1 1332 6096 t
(return)1332 6196 w
(end)1332 6296 w
10 R f
(when converted by)2 759 1 720 6476 t
10 CW f
(f2c -ec)1 420 1 1504 6476 t
10 R f
(produces)1949 6476 w
10 R f
(March 22, 1995)2 635 1 2550 7560 t
cleartomark
showpage
saveobj restore
%%EndPage: 16 17
%%Page: 17 18
/saveobj save def
mark
18 pagesetup
10 R f
(- 17 -)2 216 1 2772 480 t
9 CW f
(/* Common Block Declarations */)4 1674 1 1008 820 t
(union {)1 378 1 1008 1020 t
(struct {)1 432 1 1224 1120 t
(complex c[10];)1 756 1 1440 1220 t
(} _1;)1 270 1 1224 1320 t
(struct {)1 432 1 1224 1420 t
(complex ca[10];)1 810 1 1440 1520 t
(} _2;)1 270 1 1224 1620 t
(} cmname_;)1 540 1 1008 1720 t
(#define cmname_1 \(cmname_._1\))2 1566 1 1008 1920 t
(#define cmname_2 \(cmname_._2\))2 1566 1 1008 2020 t
( _\(\))1 184(/* Main program */ MAIN_)4 1296 2 1008 2220 t
({)1008 2320 w
(extern /* Subroutine */ int sam_\(\);)5 1890 1 1224 2520 t
(cmname_1.c[0].r = \(float\)1., cmname_1.c[0].i = \(float\)0.;)5 3078 1 1224 2720 t
(sam_\(cmname_1.c\);)1224 2820 w
( */)1 162( _)1 76(} /* MAIN_)2 540 3 1008 2920 t
(/* Subroutine */ int sam_\(c\))4 1512 1 1008 3120 t
(complex *c;)1 594 1 1008 3220 t
({)1008 3320 w
(cmname_2.ca[1].r = \(float\)1., cmname_2.ca[1].i = \(float\)2.;)5 3186 1 1224 3420 t
(return 0;)1 486 1 1224 3520 t
(} /* sam_ */)3 648 1 1008 3620 t
10 R f
(as well as the \256le)4 688 1 720 3814 t
10 CW f
(cmname_com.c)1433 3814 w
10 R f
(:)2153 3814 w
9 CW f
(#include "f2c.h")1 864 1 1008 3988 t
(union {)1 378 1 1008 4088 t
(struct {)1 432 1 1224 4188 t
(complex c[10];)1 756 1 1440 4288 t
(} _1;)1 270 1 1224 4388 t
(struct {)1 432 1 1224 4488 t
(complex ca[10];)1 810 1 1440 4588 t
(} _2;)1 270 1 1224 4688 t
(} cmname_;)1 540 1 1008 4788 t
10 R f
(The \256les)1 352 1 720 4982 t
10 CW f
(*_com.c)1102 4982 w
10 R f
(may be compiled into a library against which one can load to satisfy overly fastidious)14 3488 1 1552 4982 t
(ANSI C compilers.)2 769 1 720 5102 t
10 R f
(The rules of Fortran 77 apparently permit a situation in which)10 2539 1 970 5267 t
10 I f
(f 2c)1 138 1 3541 5267 t
10 R f
(declares a function to be of type)6 1328 1 3712 5267 t
10 CW f
(int)720 5387 w
10 R f
( that example,)2 563( In)1 134(, then de\256nes it to be of another type, as illustrated by the \256rst example in \2477.)16 3105 3 900 5387 t
10 I f
(f 2c)1 138 1 4727 5387 t
10 R f
(dis-)4890 5387 w
(covers too late that)3 757 1 720 5507 t
10 CW f
(f)1502 5507 w
10 R f
( than a warning)3 621( some C compilers, this causes nothing worse)7 1821( With)1 250(is not a subroutine.)3 761 4 1587 5507 t
( unforgiving C compilers, one can usu-)6 1580( With)1 254(message; with others, it causes the compilation to be aborted.)9 2486 3 720 5627 t
( e.g., with the)3 574(ally avoid trouble by splitting the Fortran source into one \256le per procedure,)12 3146 2 720 5747 t
10 I f
(fsplit)4475 5747 w
10 R f
(\(1\) com-)1 356 1 4684 5747 t
( solution is to use prototypes, as discussed in \2477.)9 1942( Another)1 377(mand, and converting each procedure separately.)5 1952 3 720 5867 t
10 R f
( consistent prototype declarations across separate compilations,)6 2544(With an ANSI C system that enforced)6 1526 2 970 6032 t
( translate the main program correctly in the last example just by looking at the)14 3264(it would be impossible to)4 1056 2 720 6152 t
( do enforce the consistency of prototype declarations across separate)9 2770( C++ compilers)2 629( Recent)1 330(main program.)1 591 4 720 6272 t
( sequences into the translated names of functions, except for func-)10 2731(compilations, e.g., by encoding calling)4 1589 2 720 6392 t
(tions that are declared)3 902 1 720 6512 t
10 CW f
(extern "C")1 608 1 1655 6512 t
10 R f
(and compiled separately.)2 1013 1 2297 6512 t
10 I f
(F 2c)1 163 1 3369 6512 t
10 R f
(allows one to use this escape hatch:)6 1474 1 3566 6512 t
(under)720 6632 w
10 CW f
(-C++)972 6632 w
10 R f
(,)1212 6632 w
10 I f
(f 2c)1 138 1 1262 6632 t
10 R f
(inserts)1425 6632 w
9 CW f
( _cplusplus)1 562(#ifdef _)1 432 2 1008 6806 t
(extern "C" {)2 648 1 1008 6906 t
(#endif)1008 7006 w
10 R f
(at the beginning of its C++ output and places)8 1800 1 720 7200 t
10 R f
(March 22, 1995)2 635 1 2550 7560 t
cleartomark
showpage
saveobj restore
%%EndPage: 17 18
%%Page: 18 19
/saveobj save def
mark
19 pagesetup
10 R f
(- 18 -)2 216 1 2772 480 t
9 CW f
( _cplusplus)1 562(#ifdef _)1 432 2 1008 820 t
(})1440 920 w
(#endif)1008 1020 w
10 R f
( The)1 207(at the end of its C++ output.)6 1138 2 720 1223 t
10 CW f
( _cplusplus)1 624(#ifdef _)1 482 2 2092 1223 t
10 R f
( compil-)1 339(lines are for the bene\256t of older C++)7 1476 2 3225 1223 t
(ers that do not recognize)4 981 1 720 1343 t
10 CW f
(extern "C")1 600 1 1726 1343 t
10 R f
(.)2326 1343 w
10 B f
(7. PROTOTYPES)1 779 1 720 1629 t
10 R f
(In ANSI C and C++, a)5 935 1 970 1799 t
10 I f
(prototype)1937 1799 w
10 R f
( can save)2 381( Prototypes)1 486(describes the calling sequence of a function.)6 1813 3 2360 1799 t
( The)1 215( calling sequences.)2 771(debugging time by helping catch errors in)6 1736 3 720 1919 t
10 CW f
(-P)3477 1919 w
10 R f
(option instructs)1 630 1 3632 1919 t
10 I f
(f 2c)1 138 1 4297 1919 t
10 R f
(to emit proto-)2 570 1 4470 1919 t
( all the functions de\256ned in the C it produces; speci\256cally,)10 2409(types for)1 359 2 720 2039 t
10 I f
(f 2c)1 138 1 3521 2039 t
10 R f
(creates a)1 353 1 3692 2039 t
10 I f
(\256le)4078 2039 w
10 CW f
(.P)4200 2039 w
10 R f
(of prototypes for)2 687 1 4353 2039 t
(each input)1 417 1 720 2159 t
10 I f
(\256le)1166 2159 w
10 CW f
(.f)1288 2159 w
10 R f
(or)1437 2159 w
10 I f
(\256le)1549 2159 w
10 CW f
(.F)1671 2159 w
10 R f
( can then arrange for relevant prototype \256les to be seen by the C compiler.)14 3005(. One)1 244 2 1791 2159 t
(For instance, if)2 634 1 720 2279 t
10 I f
(f 2c)1 138 1 1395 2279 t
10 R f
('s header \256le)2 547 1 1533 2279 t
10 CW f
(f2c.h)2122 2279 w
10 R f
(is installed as)2 573 1 2464 2279 t
10 CW f
(/usr/include/f2c.h)3079 2279 w
10 R f
(, one could issue the)4 881 1 4159 2279 t
(UNIX command)1 668 1 720 2399 t
9 CW f
(cat /usr/include/f2c.h *.P >f2c.h)3 1782 1 1008 2582 t
10 R f
(to create a local copy of)5 1020 1 720 2785 t
10 CW f
(f2c.h)1778 2785 w
10 R f
(that has in it all the prototypes in)7 1405 1 2116 2785 t
10 CW f
(*.P)3559 2785 w
10 R f
( produced by)2 549( the C)2 265(. Since)1 310 3 3739 2785 t
10 I f
(f 2c)1 138 1 4902 2785 t
10 R f
(always speci\256es)1 646 1 720 2905 t
9 CW f
(#include "f2c.h")1 864 1 1008 3088 t
10 R f
(\(rather than)1 465 1 720 3291 t
10 CW f
(#include <f2c.h>)1 963 1 1213 3291 t
10 R f
( the current directory for)4 996(\), the C compiler will look \256rst in)7 1366 2 2176 3291 t
10 CW f
(f2c.h)4567 3291 w
10 R f
(and)4896 3291 w
(thus will \256nd the local copy that contains the prototypes.)9 2266 1 720 3411 t
10 I f
(F 2c)1 163 1 970 3581 t
10 R f
( to)1 104(can also read the prototype \256les it writes; one simply speci\256es them as arguments)13 3255 2 1158 3581 t
10 I f
(f 2c)1 138 1 4543 3581 t
10 R f
( fact,)1 200(. In)1 159 2 4681 3581 t
10 I f
(f 2c)1 138 1 720 3701 t
10 R f
( multiple Fortran \256les are handled indepen-)6 1779(reads all prototype \256les before any Fortran \256les; although)8 2369 2 892 3701 t
(dently, any prototype \256le arguments apply to all of them.)9 2396 1 720 3821 t
10 I f
(F 2c)1 163 1 3179 3821 t
10 R f
( Fortran)1 333(has more detailed knowledge of)4 1327 2 3380 3821 t
( it conveys in the C it puts out; for example,)10 1758(types than)1 409 2 720 3941 t
10 CW f
(logical)2912 3941 w
10 R f
(and)3357 3941 w
10 CW f
(integer)3526 3941 w
10 R f
(are different Fortran types,)3 1069 1 3971 3941 t
( Moreover,)1 470(but are mapped to the same C type.)7 1423 2 720 4061 t
10 CW f
(character)2640 4061 w
10 R f
(,)3180 4061 w
10 CW f
(complex)3232 4061 w
10 R f
(, and)1 196 1 3652 4061 t
10 CW f
(double complex)1 843 1 3875 4061 t
10 R f
(Fortran)4746 4061 w
( translated to)2 540(functions are all)2 669 2 720 4181 t
10 CW f
(VOID)1966 4181 w
10 R f
(C functions, and, unless the)4 1153 1 2243 4181 t
10 CW f
(-R)3433 4181 w
10 R f
(option is speci\256ed, both)3 992 1 3590 4181 t
10 CW f
(real)4619 4181 w
10 R f
(and)4896 4181 w
10 CW f
(double precision)1 987 1 720 4301 t
10 R f
(Fortran functions are translated to)4 1461 1 1759 4301 t
10 CW f
(doublereal)3272 4301 w
10 R f
( Because)1 409(C functions.)1 516 2 3924 4301 t
10 I f
(f 2c)1 138 1 4902 4301 t
10 R f
( ANSI C)2 362(denotes all these types differently in its prototype \256les, it can catch errors that are invisible to an)17 3958 2 720 4421 t
(\(or C++\) compiler.)2 758 1 720 4541 t
10 R f
(The following table shows the types that)6 1621 1 970 4711 t
10 I f
(f 2c)1 138 1 2616 4711 t
10 R f
(uses for procedure arguments:)3 1205 1 2779 4711 t
10 S f
(_ _________________________________________________)1 2491 1 1634 4814 t
10 CW f
(C_fp complex)1 810 1 1684 4934 t
(D_fp doublereal)1 990 1 1684 5054 t
(E_fp real)1 630 1 1684 5174 t
10 R f
(under)2339 5174 w
10 CW f
(-!R)2591 5174 w
10 R f
(\(the default\))1 490 1 2796 5174 t
10 CW f
(H_fp character)1 930 1 1684 5294 t
(I_fp integer)1 810 1 1684 5414 t
10 R f
(or)2519 5414 w
10 CW f
(integer*4)2627 5414 w
(J_fp integer*2)1 930 1 1684 5534 t
(K_fp shortlogical)1 1110 1 1684 5654 t
10 R f
(\()2819 5654 w
10 CW f
(logical)2852 5654 w
10 R f
(under)3297 5654 w
10 CW f
(-i2)3549 5654 w
10 R f
(or)3754 5654 w
10 CW f
(-I2)3862 5654 w
10 R f
(\))4042 5654 w
10 CW f
(L_fp logical)1 810 1 1684 5774 t
(R_fp real)1 630 1 1684 5894 t
10 R f
(under)2339 5894 w
10 CW f
(-R)2591 5894 w
(S_fp subroutine)1 990 1 1684 6014 t
(U_fp)1684 6134 w
10 R f
(untyped)2074 6134 w
10 CW f
(external)2421 6134 w
(Z_fp doublecomplex)1 1170 1 1684 6254 t
10 S f
( \347)1 -2491(_ _________________________________________________)1 2491 2 1634 6274 t
(\347)1634 6214 w
(\347)1634 6114 w
(\347)1634 6014 w
(\347)1634 5914 w
(\347)1634 5814 w
(\347)1634 5714 w
(\347)1634 5614 w
(\347)1634 5514 w
(\347)1634 5414 w
(\347)1634 5314 w
(\347)1634 5214 w
(\347)1634 5114 w
(\347)1634 5014 w
(\347)1634 4914 w
(\347)4125 6274 w
(\347)4125 6214 w
(\347)4125 6114 w
(\347)4125 6014 w
(\347)4125 5914 w
(\347)4125 5814 w
(\347)4125 5714 w
(\347)4125 5614 w
(\347)4125 5514 w
(\347)4125 5414 w
(\347)4125 5314 w
(\347)4125 5214 w
(\347)4125 5114 w
(\347)4125 5014 w
(\347)4125 4914 w
10 R f
(These types are de\256ned in)4 1086 1 720 6477 t
10 CW f
(f2c.h)1842 6477 w
10 R f
( and, under)2 470(; they appear in prototypes)4 1109 2 2142 6477 t
10 CW f
(-A)3758 6477 w
10 R f
(or)3915 6477 w
10 CW f
(-C++)4035 6477 w
10 R f
(, in the C that)4 590 1 4275 6477 t
10 I f
(f 2c)1 138 1 4902 6477 t
10 R f
( also use special)3 664(writes. Prototypes)1 753 2 720 6597 t
10 CW f
(void)2167 6597 w
10 R f
(types to denote the return values of)6 1433 1 2437 6597 t
10 CW f
(complex)3900 6597 w
10 R f
(,)4320 6597 w
10 CW f
(double com-)1 665 1 4375 6597 t
(plex)720 6717 w
10 R f
(, and)1 194 1 960 6717 t
10 CW f
(character)1179 6717 w
10 R f
(functions:)1744 6717 w
10 S f
(_ _________________________)1 1270 1 2245 6820 t
10 CW f
(C_f complex)1 750 1 2295 6940 t
(H_f character)1 870 1 2295 7060 t
( complex)1 480(Z_f double)1 690 2 2295 7180 t
10 S f
( \347)1 -1270(_ _________________________)1 1270 2 2245 7200 t
(\347)2245 7120 w
(\347)2245 7020 w
(\347)2245 6920 w
(\347)3515 7200 w
(\347)3515 7120 w
(\347)3515 7020 w
(\347)3515 6920 w
10 R f
(March 22, 1995)2 635 1 2550 7560 t
cleartomark
showpage
saveobj restore
%%EndPage: 18 19
%%Page: 19 20
/saveobj save def
mark
20 pagesetup
10 R f
(- 19 -)2 216 1 2772 480 t
10 I f
(F 2c)1 163 1 970 840 t
10 R f
(also writes special comments in prototype \256les giving the length of each)11 2955 1 1164 840 t
10 CW f
(common)4150 840 w
10 R f
(block; when)1 498 1 4542 840 t
( arguments,)1 472(given prototype \256les as)3 951 2 720 960 t
10 I f
(f 2c)1 138 1 2174 960 t
10 R f
(reads these special comments so it can issue a warning message if)11 2697 1 2343 960 t
(its Fortran input speci\256es a different length for some)8 2103 1 720 1080 t
10 CW f
(common)2848 1080 w
10 R f
(block.)3233 1080 w
10 R f
( speci\256es different lengths for a)5 1341(Sometimes people write otherwise valid Fortran 77 that)7 2328 2 970 1243 t
10 CW f
(common)4680 1243 w
10 R f
( and converted to C, the loader could end up giving too little)12 2436( such Fortran is split into several \256les)7 1518(block. If)1 366 3 720 1363 t
(space to the)2 499 1 720 1483 t
10 CW f
(common)1258 1483 w
10 R f
( the confusion this could cause by running)7 1795( can avoid)2 438( One)1 230(block in question.)2 742 4 1657 1483 t
10 I f
(f 2c)1 138 1 4902 1483 t
10 R f
(twice, \256rst with)2 647 1 720 1603 t
10 CW f
(-P!c)1402 1603 w
10 R f
(, then with the resulting prototypes as additional arguments; the prototypes let)11 3225 1 1642 1603 t
10 I f
(f 2c)1 138 1 4902 1603 t
10 R f
(determine \(and convey to all of its output C \256les\) the true length needed for each)15 3225 1 720 1723 t
10 CW f
(common)3970 1723 w
10 R f
(block.)4355 1723 w
10 R f
( a procedure to be)4 762(One complication with prototypes comes from Fortran subprograms that declare)9 3308 2 970 1886 t
10 CW f
(external)720 2006 w
10 R f
( specify a type for it and only pass it as a parameter to another procedure.)15 2986(but do not explicitly)3 824 2 1230 2006 t
(\(If the subprogram also invokes the)5 1417 1 720 2126 t
10 CW f
(external)2162 2126 w
10 R f
(procedure, then)1 620 1 2667 2126 t
10 I f
(f 2c)1 138 1 3312 2126 t
10 R f
(can tell whether the procedure is a sub-)7 1565 1 3475 2126 t
( it)1 81( If)1 116(routine or a function; in the latter case, Fortran's implicit typing rules specify a type for the procedure.\))17 4123 3 720 2246 t
(can do no better, then)4 866 1 720 2366 t
10 I f
(f 2c)1 138 1 1612 2366 t
10 R f
(assumes that untyped)2 857 1 1776 2366 t
10 CW f
(external)2660 2366 w
10 R f
(procedures are subroutines \(and hence become)5 1873 1 3167 2366 t
10 CW f
(int)720 2486 w
10 R f
( can cause the generated C to have multiple and inconsistent declarations)11 2947( This)1 232(-valued functions in C\).)3 961 3 900 2486 t
( example,)1 388( For)1 189(for some procedures.)2 839 3 720 2606 t
9 CW f
(external f)1 540 1 1440 2778 t
(call foo\(f\))1 594 1 1440 2878 t
(end)1440 2978 w
(function f\(x\))1 702 1 1440 3078 t
(double precision f, x)3 1134 1 1440 3178 t
(f = x)2 270 1 1440 3278 t
(end)1440 3378 w
10 R f
(results in)1 364 1 720 3570 t
10 CW f
(MAIN_ _)1 384 1 1109 3570 t
10 R f
(declaring)1518 3570 w
9 CW f
(extern /* Subroutine */ int f_\(\);)5 1782 1 1224 3742 t
10 R f
( the subsequent de\256nition of)4 1181(and in)1 258 2 720 3934 t
10 CW f
(doublereal f_\(x\))1 972 1 2196 3934 t
10 R f
( inconsistencies are)2 800( Such)1 262(in the same C \256le.)4 773 3 3205 3934 t
(grounds for some C compilers to abort compilation.)7 2071 1 720 4054 t
10 I f
(F 2c)1 163 1 970 4217 t
10 R f
('s type inferences only apply sequentially to the procedures in a \256le, because)12 3195 1 1133 4217 t
10 I f
(f 2c)1 138 1 4364 4217 t
10 R f
(writes C for)2 501 1 4539 4217 t
( procedure)1 426( as just illustrated, if)4 830( Thus,)1 279(each procedure before reading the next one.)6 1770 4 720 4337 t
10 CW f
(xyz)4053 4337 w
10 R f
(comes after)1 465 1 4261 4337 t
10 CW f
(abc)4754 4337 w
10 R f
(in)4962 4337 w
(a Fortran input \256le, then)4 997 1 720 4457 t
10 I f
(f 2c)1 138 1 1749 4457 t
10 R f
(cannot use information it gains when it sees the de\256nition of)10 2485 1 1919 4457 t
10 CW f
(xyz)4436 4457 w
10 R f
(to deduce)1 392 1 4648 4457 t
(types for)1 353 1 720 4577 t
10 CW f
(external)1099 4577 w
10 R f
(procedures passed as arguments to)4 1384 1 1605 4577 t
10 CW f
(xyz)3015 4577 w
10 R f
(by)3221 4577 w
10 CW f
(abc)3347 4577 w
10 R f
( using the)2 389(. By)1 193 2 3527 4577 t
10 CW f
(-P)4134 4577 w
10 R f
(option and running)2 761 1 4279 4577 t
10 I f
(f 2c)1 138 1 720 4697 t
10 R f
( instance, if \256le)3 661( For)1 204(several times, one can get around this de\256ciency.)7 2065 3 898 4697 t
10 CW f
(zap.f)3868 4697 w
10 R f
(contains the Fortran)2 831 1 4209 4697 t
(shown above, then the commands)4 1351 1 720 4817 t
9 CW f
(f2c -P!c zap.f)2 756 1 1440 4989 t
(f2c -A zap.[fP])2 810 1 1440 5089 t
10 R f
(result in a \256le)3 547 1 720 5281 t
10 CW f
(zap.c)1292 5281 w
10 R f
(in which)1 347 1 1617 5281 t
10 CW f
(MAIN_ _)1 384 1 1989 5281 t
10 R f
(correctly types)1 590 1 2398 5281 t
10 CW f
(f_)3013 5281 w
10 R f
(and)3158 5281 w
10 CW f
(foo_)3327 5281 w
10 R f
(as)3592 5281 w
9 CW f
(extern doublereal f_\(\);)2 1242 1 1224 5453 t
(extern /* Subroutine */ int foo_\(D_fp\);)5 2106 1 1224 5553 t
10 R f
(rather than)1 429 1 720 5745 t
9 CW f
(extern /* Subroutine */ int f_\(\);)5 1782 1 1224 5917 t
(extern /* Subroutine */ int foo_\(U_fp\);)5 2106 1 1224 6017 t
10 R f
(The \256rst invocation of)3 891 1 720 6209 t
10 I f
(f 2c)1 138 1 1636 6209 t
10 R f
(results in a \256le)3 586 1 1799 6209 t
10 CW f
(zap.P)2410 6209 w
10 R f
(containing)2735 6209 w
9 CW f
(extern doublereal f_\(doublereal *x\);)3 1944 1 1008 6381 t
(/*:ref: foo_ 10 1 200 */)5 1296 1 1008 6481 t
10 R f
(The second invocation of)3 1012 1 720 6673 t
10 I f
(f 2c)1 138 1 1757 6673 t
10 R f
(is able to type)3 558 1 1920 6673 t
10 CW f
(f_)2503 6673 w
10 R f
(and)2648 6673 w
10 CW f
(foo_)2817 6673 w
10 R f
(correctly because of the \256rst line in)6 1408 1 3082 6673 t
10 CW f
(zap.P)4515 6673 w
10 R f
(.)4815 6673 w
10 R f
(The second line in)3 735 1 970 6836 t
10 CW f
(zap.P)1730 6836 w
10 R f
( comment that records the incomplete type information that)8 2383(is a special)2 438 2 2055 6836 t
10 I f
(f 2c)1 138 1 4902 6836 t
10 R f
(has about)1 381 1 720 6956 t
10 CW f
(foo_)1126 6956 w
10 R f
(.)1366 6956 w
10 I f
(F 2c)1 163 1 1441 6956 t
10 R f
(puts one such special comment in the prototype \256le for each Fortran procedure that is)14 3411 1 1629 6956 t
( it reads prototype \256les,)4 957( When)1 292(referenced but not de\256ned in the Fortran \256le.)7 1819 3 720 7076 t
10 I f
(f 2c)1 138 1 3817 7076 t
10 R f
(deciphers these comments)2 1056 1 3984 7076 t
( untyped external pro-)3 887( it learns more about)4 829( As)1 163(and uses them to check the consistency of calling sequences.)9 2441 4 720 7196 t
10 R f
(March 22, 1995)2 635 1 2550 7560 t
cleartomark
showpage
saveobj restore
%%EndPage: 19 20
%%Page: 20 21
/saveobj save def
mark
21 pagesetup
10 R f
(- 20 -)2 216 1 2772 480 t
(cedures,)720 840 w
10 I f
(f 2c)1 138 1 1088 840 t
10 R f
(updates the information it has on them; the)7 1811 1 1265 840 t
10 CW f
(:ref:)3116 840 w
10 R f
(comments it writes in a prototype \256le)6 1584 1 3456 840 t
(re\257ect)720 960 w
10 I f
(f 2c)1 138 1 994 960 t
10 R f
('s latest knowledge.)2 796 1 1132 960 t
10 R f
(Ordinarily)970 1124 w
10 I f
(f 2c)1 138 1 1416 1124 t
10 R f
(tries to infer the type of an untyped)7 1441 1 1584 1124 t
10 CW f
(external)3055 1124 w
10 R f
(procedure from its use as arguments)5 1474 1 3566 1124 t
( example, if)2 474( For)1 189(to procedures of known argument types.)5 1608 3 720 1244 t
10 CW f
(f.f)3016 1244 w
10 R f
(contains just)1 503 1 3221 1244 t
9 CW f
(external f)1 540 1 1440 1418 t
(call foo\(f\))1 594 1 1440 1518 t
(end)1440 1618 w
10 R f
(and if)1 230 1 720 1812 t
10 CW f
(foo.P)975 1812 w
10 R f
(contains)1300 1812 w
9 CW f
(extern int foo_\(D_fp\);)2 1188 1 1008 1986 t
10 R f
(then)720 2180 w
9 CW f
(f2c -A f.f foo.P)3 864 1 1008 2354 t
10 R f
(results in the declaration)3 979 1 720 2548 t
9 CW f
(extern doublereal f_\(\);)2 1242 1 1224 2722 t
10 R f
( can lead to erroneous error messages or to incorrect typ-)10 2281(Under unusual circumstances, such type inferences)5 2039 2 720 2916 t
( is an example:)3 602(ing. Here)1 396 2 720 3036 t
9 CW f
(subroutine zoo)1 756 1 1440 3210 t
(external f)1 540 1 1440 3310 t
(double precision f)2 972 1 1440 3410 t
(external g)1 540 1 1440 3510 t
(call zap\(1,f\))1 702 1 1440 3610 t
(call zap\(2,g\))1 702 1 1440 3710 t
(end)1440 3810 w
(subroutine goo)1 756 1 1440 3910 t
(call g)1 324 1 1440 4010 t
(end)1440 4110 w
10 I f
(F 2c)1 163 1 720 4304 t
10 R f
( a double precision function, then discovers that it must be a subroutine and issues a)15 3412(\256rst infers g to be)4 717 2 911 4304 t
(warning message about inconsistent declarations for)5 2148 1 720 4424 t
10 CW f
(g)2905 4424 w
10 R f
( example is legal Fortran 77;)5 1206(. This)1 265 2 2965 4424 t
10 CW f
(zap)4472 4424 w
10 R f
(could be)1 352 1 4688 4424 t
(de\256ned, for instance, by)3 962 1 720 4544 t
9 CW f
(subroutine zap\(n,f\))1 1026 1 1440 4718 t
(external f)1 540 1 1440 4818 t
(if \(n .le. 1\) call zap1\(f\))5 1404 1 1440 4918 t
(if \(n .ge. 2\) call zap2\(f\))5 1404 1 1440 5018 t
(end)1440 5118 w
10 R f
(In such a case one can specify the)7 1362 1 720 5312 t
10 CW f
(-!it)2109 5312 w
10 R f
(option to instruct)2 688 1 2376 5312 t
10 I f
(f 2c)1 138 1 3091 5312 t
10 R f
( of otherwise untypable)3 949(not to infer the types)4 835 2 3256 5312 t
10 CW f
(external)720 5432 w
10 R f
( is another \(some-)3 736( Here)1 249( as arguments to known procedures.)5 1466(procedures from their appearance)3 1357 4 1232 5432 t
(what far-fetched\) example where)3 1319 1 720 5552 t
10 CW f
(-!it)2064 5552 w
10 R f
(is useful:)1 364 1 2329 5552 t
9 CW f
(subroutine grok\(f,g,h\))1 1188 1 1440 5726 t
(external f, g, h)3 864 1 1440 5826 t
(logical g)1 486 1 1440 5926 t
(call foo\(1,g\))1 702 1 1440 6026 t
(call foo\(2,f\))1 702 1 1440 6126 t
(call zit\(1,f\))1 702 1 1440 6226 t
(call zit\(2,h\))1 702 1 1440 6326 t
(call zot\(f\(3\)\))1 756 1 1440 6426 t
(end)1440 6526 w
10 R f
(Without)720 6720 w
10 CW f
(-!it)1076 6720 w
10 R f
(,)1316 6720 w
10 I f
(f 2c)1 138 1 1369 6720 t
10 R f
(\256rst infers)1 411 1 1535 6720 t
10 CW f
(f_)1974 6720 w
10 R f
(to be a)2 274 1 2123 6720 t
10 CW f
(logical)2426 6720 w
10 R f
(function, then discovers that Fortran's implicit typing)6 2165 1 2875 6720 t
( a)1 92(rules require it to be)4 900 2 720 6840 t
10 CW f
(real)1760 6840 w
10 R f
(function.)2048 6840 w
10 I f
(F 2c)1 163 1 2479 6840 t
10 R f
(issues the warning message ``)4 1284 1 2690 6840 t
10 CW f
(fixing wrong type)2 1066 1 3974 6840 t
(inferred for f)2 842 1 720 6960 t
10 R f
('', which should serve as a warning that)7 1598 1 1562 6960 t
10 I f
(f 2c)1 138 1 3186 6960 t
10 R f
(may have made some incorrect type infer-)6 1690 1 3350 6960 t
( Indeed,)1 350(ences in the mean time.)4 956 2 720 7080 t
10 I f
(f 2c)1 138 1 2055 7080 t
10 R f
(ends up typing)2 597 1 2222 7080 t
10 CW f
(h_)2848 7080 w
10 R f
(as a)1 156 1 2997 7080 t
10 CW f
(logical)3182 7080 w
10 R f
(function; with)1 567 1 3631 7080 t
10 CW f
(-!it)4226 7080 w
10 R f
(speci\256ed,)4494 7080 w
10 I f
(f 2c)1 138 1 4902 7080 t
10 R f
(types)720 7200 w
10 CW f
(h_)958 7200 w
10 R f
(as an)1 204 1 1105 7200 t
10 CW f
(external)1336 7200 w
10 R f
(procedure unknown type, i.e., a)4 1266 1 1843 7200 t
10 CW f
(U_fp)3137 7200 w
10 R f
(, which to the C compiler appears to be a)9 1663 1 3377 7200 t
10 R f
(March 22, 1995)2 635 1 2550 7560 t
cleartomark
showpage
saveobj restore
%%EndPage: 20 21
%%Page: 21 22
/saveobj save def
mark
22 pagesetup
10 R f
(- 21 -)2 216 1 2772 480 t
( with)1 205(subroutine. \(Even)1 737 2 720 840 t
10 CW f
(-!it)1689 840 w
10 R f
(speci\256ed,)1956 840 w
10 I f
(f 2c)1 138 1 2363 840 t
10 R f
( sequences)1 430(issues a warning message about inconsistent calling)6 2082 2 2528 840 t
(for)720 960 w
10 CW f
(foo)861 960 w
10 R f
(.\))1041 960 w
10 R f
(Because)970 1120 w
10 I f
(f 2c)1 138 1 1345 1120 t
10 R f
( \256les, it is easy to write a crude)8 1392(writes its latest knowledge of types into prototype)7 2122 2 1526 1120 t
(\(Bourne\) shell script that will glean the maximum possible type information:)10 3071 1 720 1240 t
9 CW f
(>f.p)1008 1407 w
(until)1008 1507 w
(f2c -Pit f.p f.f)3 864 1 1440 1607 t
(cmp -s f.p f.P)3 756 1 1440 1707 t
(do)1008 1807 w
(mv f.P f.p)2 540 1 1440 1907 t
(done)1440 2007 w
10 R f
(In such scripts, use of the)5 1080 1 720 2194 t
10 CW f
(-Ps)1838 2194 w
10 R f
(option can save an iteration;)4 1178 1 2056 2194 t
10 CW f
(-Ps)3273 2194 w
10 R f
(implies)3492 2194 w
10 CW f
(-P)3826 2194 w
10 R f
(and instructs)1 522 1 3985 2194 t
10 I f
(f 2c)1 138 1 4546 2194 t
10 R f
(to issue)1 317 1 4723 2194 t
( the following script is more)5 1130( Thus)1 250( if another iteration might change a declaration or prototype.)9 2412(return code 4)2 528 4 720 2314 t
(ef\256cient:)720 2434 w
9 CW f
(while :; do)2 594 1 1008 2601 t
(f2c -Ps f.[fP])2 756 1 1440 2701 t
(case $? in 4\) ;; *\) break;; esac)7 1728 1 1440 2801 t
(done)1440 2901 w
10 R f
( depends on the call graph of the procedures in)9 1910(The number of iterations)3 1002 2 720 3088 t
10 CW f
(f.f)3662 3088 w
10 R f
(and on their order of appear-)5 1168 1 3872 3088 t
(ance in)1 292 1 720 3208 t
10 CW f
(f.f)1044 3208 w
10 R f
( them into topological order \(so that if)7 1566(. Sorting)1 377 2 1224 3208 t
10 CW f
(abc)3198 3208 w
10 R f
(calls)3409 3208 w
10 CW f
(def)3623 3208 w
10 R f
(, then)1 228 1 3803 3208 t
10 CW f
(abc)4062 3208 w
10 R f
(precedes)4273 3208 w
10 CW f
(def)4652 3208 w
10 R f
(\) and)1 208 1 4832 3208 t
( example,)1 389( For)1 190( alternating between the two orders is probably a good heuristic.)10 2575(reverse topological order and)3 1166 4 720 3328 t
( type the)2 350(we were able to completely)4 1113 2 720 3448 t
8 R f
(PORT3)2211 3448 w
10 R f
(subroutine library in two passes by \256rst processing it in reverse)10 2555 1 2485 3448 t
( one can devise situations where arbitrarily many)7 2023( Unfortunately,)1 644( in forward order.)3 730(topological order, then)2 923 4 720 3568 t
( is slightly annoying, since with appropriate data structures \(in an extensively)11 3168( This)1 236(iterations are required.)2 916 3 720 3688 t
(reorganized version of)2 897 1 720 3808 t
10 I f
(f 2c)1 138 1 1642 3808 t
10 R f
(\), one could do this calculation in linear time.)8 1815 1 1780 3808 t
10 B f
(8. EXPERIENCE WITH)2 1065 1 720 4061 t
10 BI f
(netlib)1810 4061 w
10 R f
( the)1 150(With the help of Eric Grosse, we arranged for)8 1841 2 970 4221 t
10 I f
(netlib)2989 4221 w
10 R f
([5] server)1 387 1 3245 4221 t
10 CW f
(netlib@research.att.com)3660 4221 w
10 R f
( executing the UNIX)3 876( By)1 181(to provide an experimental Fortran-to-C translation service by electronic mail.)9 3263 3 720 4341 t
(command)720 4461 w
10 CW f
(\(echo execute f2c; cat foo.f\) | mail netlib@research.att.com)7 3600 1 1080 4641 t
10 R f
(one submits the Fortran in)4 1054 1 720 4821 t
10 CW f
(foo.f)1800 4821 w
10 R f
(to)2126 4821 w
10 I f
(netlib)2230 4821 w
10 R f
('s)2458 4821 w
10 I f
(f 2c)1 138 1 2556 4821 t
10 R f
(service;)2721 4821 w
10 I f
(netlib)3058 4821 w
10 R f
(replies with the C and diagnostic messages)6 1727 1 3313 4821 t
(produced by)1 498 1 720 4941 t
10 I f
(f 2c)1 138 1 1245 4941 t
10 R f
(from)1410 4941 w
10 CW f
(foo.f)1631 4941 w
10 R f
(. \(The)1 265 1 1931 4941 t
10 CW f
(include)2223 4941 w
10 R f
( context,)1 345(mechanism described in \2473 makes no sense in this)8 2025 2 2670 4941 t
( start using this service, one would generally execute)8 2110( To)1 161(so it is disabled.\))3 678 3 720 5061 t
10 CW f
(echo 'send index from f2c' | mail netlib@research.att.com)7 3420 1 1170 5241 t
10 R f
( the returned C, it is necessary to get a copy)10 1784( compiling)1 434( Before)1 324(to check on the current status of the service.)8 1778 4 720 5421 t
(of)720 5541 w
10 CW f
(f2c.h)828 5541 w
10 R f
(:)1128 5541 w
10 CW f
(echo 'send f2c.h from f2c' | mail netlib@research.att.com)7 3420 1 1170 5721 t
10 R f
( the versions of)3 640(Most likely it would also be necessary to obtain source for)10 2416 2 720 5901 t
10 I f
(libF77)3810 5901 w
10 R f
(and)4111 5901 w
10 I f
(libI77)4289 5901 w
10 R f
(assumed by)1 478 1 4562 5901 t
10 I f
(f 2c)1 138 1 720 6021 t
10 R f
(:)858 6021 w
10 CW f
(echo 'send libf77 libi77 from f2c' | mail netlib@research.att.com)8 3900 1 930 6201 t
10 R f
(For testing purposes, we retain the original Fortran submitted to)9 2581 1 970 6361 t
10 I f
(netlib)3579 6361 w
10 R f
('s ``)1 167 1 3807 6361 t
10 CW f
(execute f2c)1 664 1 3974 6361 t
10 R f
('' service.)1 402 1 4638 6361 t
(Observing)720 6481 w
10 I f
(f 2c)1 138 1 1162 6481 t
10 R f
( of submitted Fortran helped us \256nd many obscure bugs and)10 2398('s behavior on over 400,000 lines)5 1342 2 1300 6481 t
( a)1 70( example,)1 388( For)1 189(led us to make some of the extensions described in \2473.)10 2178 4 720 6601 t
10 CW f
(block data)1 601 1 3571 6601 t
10 R f
(subprogram initializ-)1 842 1 4198 6601 t
( appear in any)3 568(ing a variable that does not)5 1094 2 720 6721 t
10 CW f
(common)2409 6721 w
10 R f
(blocks now elicits a warning message \(rather than caus-)8 2244 1 2796 6721 t
(ing)720 6841 w
10 I f
(f 2c)1 138 1 873 6841 t
10 R f
( example is that)3 630( Another)1 377(to drop core\).)2 540 3 1036 6841 t
10 I f
(f 2c)1 138 1 2609 6841 t
10 R f
(now gives the warning message ``)5 1366 1 2773 6841 t
10 CW f
(Statement order)1 901 1 4139 6841 t
(error: declaration after DATA)3 1761 1 720 6961 t
10 R f
( a)1 75('' and declines to produce any C if a declaration comes after)11 2484 2 2481 6961 t
10 CW f
(data)720 7081 w
10 R f
(statement \(for reasons discussed in \2479\);)5 1623 1 994 7081 t
10 I f
(f 2c)1 138 1 2651 7081 t
10 R f
( and then)2 386(formerly gave a more obscure error message)6 1831 2 2823 7081 t
(produced invalid C.)2 791 1 720 7201 t
10 R f
(March 22, 1995)2 635 1 2550 7560 t
cleartomark
showpage
saveobj restore
%%EndPage: 21 22
%%Page: 22 23
/saveobj save def
mark
23 pagesetup
10 R f
(- 22 -)2 216 1 2772 480 t
(Now that)1 380 1 970 840 t
10 I f
(netlib)1386 840 w
10 R f
(offers source for)2 680 1 1650 840 t
10 I f
(f 2c)1 138 1 2366 840 t
10 R f
(itself \(as explained in the)4 1052 1 2541 840 t
10 CW f
(index)3630 840 w
10 R f
(\256le mentioned above\), we)3 1073 1 3967 840 t
(expect to curtail)2 655 1 720 960 t
10 I f
(netlib)1406 960 w
10 R f
('s ``)1 169 1 1634 960 t
10 CW f
(execute f2c)1 666 1 1803 960 t
10 R f
('' service, perhaps limiting it to employees of AT&T and Bell-)10 2571 1 2469 960 t
(core; to learn the current state of affairs, request the current)10 2367 1 720 1080 t
10 CW f
(index)3112 1080 w
10 R f
(\256le.)3437 1080 w
10 B f
(9. POSSIBLE EXTENSIONS)2 1262 1 720 1322 t
10 R f
(Currently)970 1479 w
10 I f
(f 2c)1 138 1 1384 1479 t
10 R f
( would be nice if constant expressions were simply)8 2092( It)1 118( expressions.)1 523(simpli\256es constant)1 754 4 1553 1479 t
(passed through, and if Fortran)4 1221 1 720 1599 t
10 CW f
(parameter)1971 1599 w
10 R f
( as)1 112(s were translated)2 680 2 2511 1599 t
10 CW f
(#define)3332 1599 w
10 R f
( several things)2 585(s. Unfortunately,)1 703 2 3752 1599 t
( worst is that)3 535( Perhaps)1 373( this nearly impossible to do in full generality.)8 1903(conspire to make)2 694 4 720 1719 t
10 CW f
(parameter)4257 1719 w
10 R f
(s may)1 243 1 4797 1719 t
(be assigned)1 473 1 720 1839 t
10 CW f
(complex)1228 1839 w
10 R f
(or)1683 1839 w
10 CW f
(doublecomplex)1801 1839 w
10 R f
(expressions that might, for example, involve complex divi-)7 2425 1 2615 1839 t
(sion and exponentiation to a large integer power.)7 2022 1 720 1959 t
10 CW f
(Parameter)2802 1959 w
10 R f
(s may appear in)3 659 1 3342 1959 t
10 CW f
(data)4037 1959 w
10 R f
(statements, which)1 727 1 4313 1959 t
(may initialize)1 554 1 720 2079 t
10 CW f
(common)1306 2079 w
10 R f
( to have)2 328( Arranging)1 466( be moved near the beginning of the C output.)9 1891(variables and so)2 657 4 1698 2079 t
(the right)1 353 1 720 2199 t
10 CW f
(#define)1115 2199 w
10 R f
( Of)1 173( in this worst case, be a nightmare.)7 1510(s in effect for the data initialization would,)7 1822 3 1535 2199 t
( and)1 176(course, one could arrange to handle ``easy'' cases with unsimpli\256ed constant expressions)11 3653 2 720 2319 t
10 CW f
(#define)4581 2319 w
10 R f
(s)5001 2319 w
(for parameters.)1 603 1 720 2439 t
10 R f
( Proto-)1 311( alternate return speci\256ers.)3 1091(Prototypes and the argument consistency checks currently ignore)7 2668 3 970 2596 t
(types could be adorned with special comments indicating where alternate return speci\256ers are supposed to)14 4320 1 720 2716 t
( alternate return)2 633( Since)1 273( really matters.)2 598(come, or at least telling the number of such speci\256ers, which is all that)13 2816 4 720 2836 t
( we have so far refrained from this exer-)8 1669(speci\256ers are rarely used \(Fortran 90 calls them ``obsolescent''\),)8 2651 2 720 2956 t
(cise.)720 3076 w
10 R f
(Fortran 90 allows)2 717 1 970 3233 t
10 CW f
(data)1718 3233 w
10 R f
( would be nice if)4 695( It)1 117(statements to appear anywhere.)3 1270 3 1989 3233 t
10 I f
(f 2c)1 138 1 4102 3233 t
10 R f
( the same,)2 416(could do)1 353 2 4271 3233 t
(but that would entail major rewriting of)6 1594 1 720 3353 t
10 I f
(f 2c)1 138 1 2341 3353 t
10 R f
(. Presently)1 449 1 2479 3353 t
10 CW f
(data)2955 3353 w
10 R f
( written to a \256le as soon as they are)9 1415(values are)1 403 2 3222 3353 t
( an)1 127( If)1 124(seen; among the information in the \256le is the offset of each value.)12 2705 3 720 3473 t
10 CW f
(equivalence)3709 3473 w
10 R f
(statement could)1 638 1 4402 3473 t
(follow the)1 408 1 720 3593 t
10 CW f
(data)1153 3593 w
10 R f
(statement, then the offsets would be invalidated.)6 1931 1 1418 3593 t
10 R f
(It would be fairly straightforward to extend)6 1754 1 970 3750 t
10 I f
(f 2c)1 138 1 2753 3750 t
10 R f
( new speci\256ers introduced by)4 1190('s I/O to encompass the)4 959 2 2891 3750 t
( that would mean changing)4 1094( Unfortunately,)1 638(Fortran 90.)1 447 3 720 3870 t
10 I f
(libI77)2927 3870 w
10 R f
( would make it incompatible with)5 1357(in ways that)2 489 2 3194 3870 t
10 I f
(f)720 3990 w
10 R f
(77.)764 3990 w
10 R f
( would be nice to translate all of Fortran 90, but some of the Fortran 90 array manipula-)17 3568(Of course, it)2 502 2 970 4147 t
(tions would require new calling conventions and large enough revisions to)10 3014 1 720 4267 t
10 I f
(f 2c)1 138 1 3763 4267 t
10 R f
(that one might be better off)5 1110 1 3930 4267 t
(starting from scratch.)2 851 1 720 4387 t
10 R f
( hacking,)1 381(With suf\256cient)1 611 2 970 4544 t
10 I f
(f 2c)1 138 1 2002 4544 t
10 R f
(could be modi\256ed to recognize Fortran 90 control structures \()9 2595 1 2180 4544 t
10 CW f
(case)4775 4544 w
10 R f
(,)5015 4544 w
10 CW f
(cycle)720 4664 w
10 R f
(,)1020 4664 w
10 CW f
(exit)1077 4664 w
10 R f
(, and named loops\), local arrays of dimensions that depend on arguments and common val-)14 3723 1 1317 4664 t
(ues, and such types as)4 879 1 720 4784 t
10 CW f
(logical*1)1624 4784 w
10 R f
(,)2164 4784 w
10 CW f
(logical*2)2214 4784 w
10 R f
(,)2754 4784 w
10 CW f
(integer*1)2804 4784 w
10 R f
(or)3370 4784 w
10 CW f
(byte)3479 4784 w
10 R f
( our main concern is with)5 1023(. Since)1 298 2 3719 4784 t
( so far refrained from these further)6 1420(making portable Fortran 77 libraries available to the C world, we have)11 2900 2 720 4904 t
( commercial vendors will wish to provide some of these extensions.)10 2711(extensions. Perhaps)1 813 2 720 5024 t
10 B f
(10. REFERENCES)1 823 1 720 5266 t
10 R f
([1])720 5423 w
10 I f
(American National Standard Programming Language FORTRAN,)5 2786 1 970 5423 t
10 R f
(American National Standards)2 1233 1 3807 5423 t
( X3.9-1978.)1 480( ANSI)1 283(Institute, New York, NY, 1978.)4 1265 3 970 5543 t
10 R f
([2])720 5700 w
10 I f
(American National Standard for Information Systems Programming Language Fortran,)8 3648 1 970 5700 t
10 R f
(CBEMA,)4659 5700 w
( S8, Version 112.)3 697(1989. Draft)1 485 2 970 5820 t
10 R f
([3])720 5977 w
10 I f
(American National Standard for Information Systems \320 Programming Language \320 C,)10 3638 1 970 5977 t
10 R f
(American)4647 5977 w
( X3.159-1989.)1 580( ANSI)1 283(National Standards Institute, New York, NY, 1990.)6 2053 3 970 6097 t
10 R f
([4])720 6254 w
10 I f
( Manual,)1 368(UNIX Time Sharing System Programmer's)4 1739 2 970 6254 t
10 R f
( Edition,)1 352( Tenth)1 290(AT&T Bell Laboratories, 1990.)3 1289 3 3109 6254 t
(Volume 1.)1 422 1 970 6374 t
10 R f
( of Mathematical Software by Electronic Mail,'')6 1950( J. Dongarra and E. Grosse, ``Distribution)6 1684([5] J.)1 314 3 720 6531 t
10 I f
(Commu-)4696 6531 w
(nications of the ACM)3 853 1 970 6651 t
10 B f
(30)1848 6651 w
10 R f
(#5 \(May 1987\), pp. 403\261407.)4 1174 1 1973 6651 t
10 R f
( P. J. Weinberger, ``A Portable Fortran 77 Compiler,'' in)9 2286( I. Feldman and)3 627([6] S.)1 331 3 720 6808 t
10 I f
(Unix Programmer's Man-)2 1050 1 3990 6808 t
(ual, Volume II)2 574 1 970 6928 t
10 R f
(, Holt, Rinehart and Winston \(1983\).)5 1471 1 1544 6928 t
10 R f
( A. Fox, A. D. Hall, and N. L. Schryer, ``Algorithm 528: Framework for a Portable Library,'')16 3751([7] P.)1 331 2 720 7085 t
10 I f
(ACM)4829 7085 w
(Trans. Math. Software)2 901 1 970 7205 t
10 B f
(4)1896 7205 w
10 R f
(\(June 1978\), pp. 177\261188.)3 1049 1 1971 7205 t
10 R f
(March 22, 1995)2 635 1 2550 7560 t
cleartomark
showpage
saveobj restore
%%EndPage: 22 23
%%Page: 23 24
/saveobj save def
mark
24 pagesetup
10 R f
(- 23 -)2 216 1 2772 480 t
( D. Hall, and N. L. Schryer, ``The)7 1478( A. Fox, A.)3 501([8] P.)1 331 3 720 840 t
8 R f
(PORT)3073 840 w
10 R f
(Mathematical Subroutine Library,'')2 1464 1 3322 840 t
10 I f
(ACM)4829 840 w
(Trans. Math. Software)2 901 1 970 960 t
10 B f
(4)1896 960 w
10 R f
(\(June 1978\), pp. 104\261126.)3 1049 1 1971 960 t
10 R f
( in)1 114( C. Johnson, ``A Portable Compiler: Theory and Practice,'' pp. 97\261104)10 2941([9] S.)1 331 3 720 1116 t
10 I f
(Conference Record of)2 898 1 4142 1116 t
( Languages)1 469(the Fifth Annual ACM Symposium on Principles of Programming)8 2670 2 970 1236 t
10 R f
(, Association for Com-)3 931 1 4109 1236 t
(puting Machinery \(1978\).)2 1029 1 970 1356 t
10 R f
( W. Kernighan and D. M. Ritchie,)6 1359([10] B.)1 342 2 720 1512 t
10 I f
(The C Programming Language,)3 1278 1 2446 1512 t
10 R f
(Prentice-Hall, 1978.)1 807 1 3749 1512 t
10 R f
( D. M. Ritchie,)3 633( W. Kernighan and)3 789([11] B.)1 342 3 720 1668 t
10 I f
(The C Programming Language,)3 1311 1 2520 1668 t
10 R f
( Second)1 355(Prentice-Hall, 1988.)1 818 2 3867 1668 t
(Edition)970 1788 w
10 R f
( M. A. Saunders, ``MINOS 5.1 User's Guide,'' Technical Report SOL 83-20R)11 3282( A. Murtagh and)3 696([12] B.)1 342 3 720 1944 t
( CA.)1 189( Stanford,)1 419( Optimization Laboratory, Stanford University,)4 1887(\(1987\), Systems)1 675 4 970 2064 t
10 R f
( G. Ryder, ``The PFORT Veri\256er,'')5 1425([13] B.)1 342 2 720 2220 t
10 I f
(Software Practice and Experience)3 1367 1 2512 2220 t
10 B f
(4)3904 2220 w
10 R f
(\(1974\), pp. 359\261377.)2 841 1 3979 2220 t
10 R f
( Test of a Computer's Floating-point Arithmetic Unit,'' in)8 2388( L. Schryer, ``A)3 655([14] N.)1 347 3 720 2376 t
10 I f
(Sources and Develop-)2 897 1 4143 2376 t
(ment of Mathematical Software)3 1258 1 970 2496 t
10 R f
(, ed. W. Cowell, Prentice-Hall \(1981\).)5 1525 1 2228 2496 t
10 R f
( Stroustrup,)1 467([15] B.)1 342 2 720 2652 t
10 I f
(The C++ Programming Language,)3 1414 1 1554 2652 t
10 R f
(Addison-Wesley, 1986.)1 946 1 2993 2652 t
10 B f
(Appendix A: Commercial Fortran-to-C Vendors)4 2069 1 720 2892 t
10 R f
( following vendors offer Fortran to C conversion ser-)8 2132(At the time of this writing, we are aware that the)10 1938 2 970 3048 t
( include them in updated ver-)5 1193( vendors are invited to inform us of their existence, so we may)12 2553(vice. Omitted)1 574 3 720 3168 t
(sions of this appendix.)3 900 1 720 3288 t
(Cobalt Blue)1 481 1 2520 3528 t
(875 Old Roswell Road)3 914 1 2520 3648 t
(Suite D400)1 453 1 2520 3768 t
(Roswell, GA 30076)2 797 1 2520 3888 t
(\(404\) 518\2611116; FAX \(404\) 640\2611182)4 1560 1 2520 4008 t
(PROMULA Development Corporation)2 1560 1 2520 4368 t
(Columbus, OH)1 606 1 2520 4488 t
(\(614\) 263\2615454)1 641 1 2520 4608 t
(Rapitech Systems)1 714 1 2520 4968 t
(Of\256ce Center at Montebello)3 1123 1 2520 5088 t
(400 Rella Blvd.)2 631 1 2520 5208 t
(Suffern, NY 10901)2 768 1 2520 5328 t
(\(914\) 368\2613000)1 641 1 2520 5448 t
10 R f
(March 22, 1995)2 635 1 2550 7560 t
cleartomark
showpage
saveobj restore
%%EndPage: 23 24
%%Page: 1 25
/saveobj save def
mark
25 pagesetup
9 B f
( \( 1 \))3 126( F2C)1 1621( \))1 37( B)1 83( Appendix)1 382( \()1 68( System V)2 386( UNIX)1 1686(F2C \( 1 \))3 291 9 540 480 t
(NAME)540 960 w
10 R f
(f2c \261 Convert Fortran 77 to C or C++)8 1500 1 900 1080 t
9 B f
(SYNOPSIS)540 1248 w
10 B f
(f 2c)1 135 1 900 1368 t
10 R f
([)1060 1368 w
10 I f
(option ...)1 356 1 1118 1368 t
10 R f
(])1499 1368 w
10 I f
(\256le ...)1 222 1 1557 1368 t
9 B f
(DESCRIPTION)540 1536 w
10 I f
(F2c)900 1656 w
10 R f
(converts Fortran 77 source code in)5 1413 1 1086 1656 t
10 I f
(\256les)2530 1656 w
10 R f
( in)1 110(with names ending)2 767 2 2722 1656 t
10 CW f
(.f)3631 1656 w
10 R f
(or)3783 1656 w
10 CW f
(.F)3898 1656 w
10 R f
(to C \(or C++\) source \256les in)6 1170 1 4050 1656 t
(the current directory, with)3 1069 1 900 1776 t
10 CW f
(.c)2003 1776 w
10 R f
(substituted for the \256nal)3 949 1 2156 1776 t
10 CW f
(.f)3138 1776 w
10 R f
(or)3291 1776 w
10 CW f
(.F)3407 1776 w
10 R f
( no Fortran \256les are named,)5 1138(. If)1 149 2 3527 1776 t
10 I f
(f 2c)1 130 1 4847 1776 t
10 R f
(reads)5010 1776 w
(Fortran from standard input and writes C on standard output.)9 2458 1 900 1896 t
10 I f
(File)3411 1896 w
10 R f
(names that end with)3 814 1 3601 1896 t
10 CW f
(.p)4444 1896 w
10 R f
(or)4593 1896 w
10 CW f
(.P)4705 1896 w
10 R f
(are taken)1 366 1 4854 1896 t
(to be prototype \256les, as produced by option)7 1732 1 900 2016 t
10 CW f
(-P)2657 2016 w
10 R f
(, and are read \256rst.)4 742 1 2777 2016 t
(The following options have the same meaning as in)8 2059 1 900 2184 t
10 I f
(f 77)1 136 1 2984 2184 t
10 R f
(\(1\).)3128 2184 w
10 B f
(-C)900 2352 w
10 R f
(Compile code to check that subscripts are within declared array bounds.)10 2875 1 1260 2352 t
10 B f
(-I2)900 2520 w
10 R f
(Render INTEGER and LOGICAL as short, INTEGER)6 2224 1 1260 2520 t
10 S f
(*)3484 2520 w
10 R f
( the default)2 465( Assume)1 380(4 as long int.)3 541 3 3534 2520 t
10 I f
(libF77)4953 2520 w
10 R f
(and)1260 2640 w
10 I f
(libI77)1442 2640 w
10 R f
( only INTEGER)2 681(: allow)1 313 2 1681 2640 t
10 S f
(*)2675 2640 w
10 R f
( Option)1 340(4 \(and no LOGICAL\) variables in INQUIREs.)6 1938 2 2725 2640 t
10 CW f
(-I4)5040 2640 w
10 R f
(con\256rms the default rendering of INTEGER as long int.)8 2233 1 1260 2760 t
10 B f
(-I)900 2928 w
10 I f
(dir)972 2928 w
10 R f
( in directo-)2 452(Look for a non-absolute include \256le \256rst in the directory of the current input \256le, then)15 3508 2 1260 2928 t
(ries speci\256ed by)2 661 1 1260 3048 t
10 CW f
(-I)1952 3048 w
10 R f
( Options)1 372( option\).)1 344(options \(one directory per)3 1052 3 2103 3048 t
10 CW f
(-I2)3936 3048 w
10 R f
(and)4146 3048 w
10 CW f
(-I4)4320 3048 w
10 R f
(have precedence,)1 690 1 4530 3048 t
(so, e.g., a directory named)4 1053 1 1260 3168 t
10 CW f
(2)2338 3168 w
10 R f
(should be speci\256ed by)3 891 1 2423 3168 t
10 CW f
(-I./2)3339 3168 w
10 R f
(.)3664 3168 w
10 B f
(-onetrip)900 3336 w
10 R f
( 77 DO loops are not per-)6 1050( \(Fortran)1 382( that are performed at least once if reached.)8 1764(Compile DO loops)2 764 4 1260 3456 t
(formed at all if the upper limit is smaller than the lower limit.\))12 2490 1 1260 3576 t
10 B f
(-U)900 3744 w
10 R f
( keywords must be in)4 855( Fortran)1 344(Honor the case of variable and external names.)7 1872 3 1260 3744 t
10 I f
(lower)4356 3744 w
10 R f
(case.)4609 3744 w
10 B f
(-u)900 3912 w
10 R f
(Make the default type of a variable `unde\256ned' rather than using the default Fortran rules.)14 3589 1 1260 3912 t
10 B f
(-w)900 4080 w
10 R f
(Suppress all warning messages, or, if the option is)8 2004 1 1260 4080 t
10 CW f
(-w66)3289 4080 w
10 R f
(, just Fortran 66 compatibility warnings.)5 1614 1 3529 4080 t
(The following options are peculiar to)5 1484 1 900 4248 t
10 I f
(f 2c)1 130 1 2409 4248 t
10 R f
(.)2547 4248 w
10 B f
(-A)900 4416 w
10 R f
(Produce)1260 4416 w
9 R f
(ANSI)1610 4416 w
10 R f
( is old-style C.)3 584(C. Default)1 441 2 1845 4416 t
10 B f
(-a)900 4584 w
10 R f
( appear in a)3 489(Make local variables automatic rather than static unless they)8 2476 2 1260 4584 t
9 R f
(DATA, EQUIVALENCE,)1 963 1 4257 4584 t
(NAMELIST,)1260 4704 w
10 R f
(or)1763 4704 w
9 R f
(SAVE)1869 4704 w
10 R f
(statement.)2129 4704 w
10 B f
(-C++)900 4872 w
10 R f
(Output C++ code.)2 720 1 1260 4872 t
10 B f
(-c)900 5040 w
10 R f
(Include original Fortran source as comments.)5 1808 1 1260 5040 t
10 B f
(-cd)900 5208 w
10 R f
( com-)1 238(Do not recognize cdabs, cdcos, cdexp, cdlog, cdsin, and cdsqrt as synonyms for the double)14 3722 2 1260 5208 t
(plex intrinsics zabs, zcos, zexp, zlog, zsin, and zsqrt, respectively.)9 2634 1 1260 5328 t
10 B f
(-d)900 5496 w
10 I f
(dir)989 5496 w
10 R f
(Write)1260 5496 w
10 CW f
(.c)1512 5496 w
10 R f
(\256les in directory)2 655 1 1657 5496 t
10 I f
(dir)2337 5496 w
10 R f
(instead of the current directory.)4 1255 1 2479 5496 t
10 B f
(-E)900 5664 w
10 R f
(Declare uninitialized)1 834 1 1260 5664 t
9 R f
(COMMON)2117 5664 w
10 R f
(to be)1 197 1 2557 5664 t
10 B f
(Extern)2779 5664 w
10 R f
(\(overridably de\256ned in)2 915 1 3098 5664 t
10 CW f
(f2c.h)4038 5664 w
10 R f
(as)4363 5664 w
10 B f
(extern\).)4471 5664 w
(-ec)900 5832 w
10 R f
(Place uninitialized)1 780 1 1260 5832 t
9 R f
(COMMON)2102 5832 w
10 R f
(blocks in separate \256les:)3 1052 1 2581 5832 t
10 B f
(COMMON /ABC/)1 819 1 3697 5832 t
10 R f
(appears in \256le)2 640 1 4580 5832 t
10 B f
(abc)1260 5952 w
10 S f
(_)1410 5952 w
10 B f
(com.c)1460 5952 w
10 R f
(. Option)1 359 1 1706 5952 t
10 CW f
(-e1c)2096 5952 w
10 R f
(bundles the separate \256les into the output \256le, with comments that give)11 2854 1 2366 5952 t
(an unbundling)1 575 1 1260 6072 t
10 I f
(sed)1860 6072 w
10 R f
(\(1\) script.)1 388 1 2001 6072 t
10 B f
(-ext)900 6240 w
10 R f
(Complain about)1 642 1 1260 6240 t
10 I f
(f 77)1 136 1 1927 6240 t
10 R f
(\(1\) extensions.)1 588 1 2071 6240 t
10 B f
(-f)900 6408 w
10 R f
( 72 and do not pad \256xed-format lines shorter)8 1861(Assume free-format input: accept text after column)6 2099 2 1260 6408 t
(than 72 characters with blanks.)4 1239 1 1260 6528 t
10 B f
(-72)900 6696 w
10 R f
(Treat text appearing after column 72 as an error.)8 1930 1 1260 6696 t
10 B f
(-g)900 6864 w
10 R f
(Include original Fortran line numbers in)5 1601 1 1260 6864 t
10 CW f
(#line)2886 6864 w
10 R f
(lines.)3211 6864 w
10 B f
(-h)900 7032 w
10 R f
( strings on word \(or, if the option)7 1334(Emulate Fortran 66's treatment of Hollerith: try to align character)9 2626 2 1260 7032 t
(is)1260 7152 w
10 CW f
(-hd)1352 7152 w
10 R f
(, on double-word\) boundaries.)3 1206 1 1532 7152 t
( 24)1 125( Page)1 3997(May 12, 1996)2 558 3 540 7680 t
cleartomark
showpage
saveobj restore
%%EndPage: 1 25
%%Page: 25 26
/saveobj save def
mark
26 pagesetup
9 B f
( \( 1 \))3 126( F2C)1 1621( \))1 37( B)1 83( Appendix)1 382( \()1 68( System V)2 386( UNIX)1 1686(F2C \( 1 \))3 291 9 540 480 t
10 B f
(-i2)900 960 w
10 R f
(Similar to)1 407 1 1260 960 t
10 B f
(-I2)1701 960 w
10 R f
( assume a modi\256ed)3 799(, but)1 187 2 1823 960 t
10 I f
(libF77)2844 960 w
10 R f
(and)3146 960 w
10 I f
(libI77)3325 960 w
10 R f
(\(compiled with)1 618 1 3599 960 t
10 B f
(-Df 2c)1 240 1 4252 960 t
10 S f
(_)4492 960 w
10 B f
(i2)4542 960 w
10 R f
(\), so)1 182 1 4620 960 t
9 R f
(INTEGER)4835 960 w
10 R f
(and)1260 1080 w
9 R f
(LOGICAL)1427 1080 w
10 R f
(variables may be assigned by)4 1170 1 1847 1080 t
9 R f
(INQUIRE)3040 1080 w
10 R f
(and array lengths are stored in short ints.)7 1625 1 3435 1080 t
10 B f
(-i90)900 1248 w
10 R f
( iand, ibclr, ibits, ibset, ieor, ior,)6 1319(Do not recognize the Fortran 90 bit-manipulation intrinsics btest,)8 2641 2 1260 1248 t
(ishft, and ishftc.)2 644 1 1260 1368 t
10 B f
(-kr)900 1536 w
10 R f
( where K&R \(\256rst edition\) paren-)5 1389(Use temporary values to enforce Fortran expression evaluation)7 2571 2 1260 1536 t
( the option is)3 562( If)1 130(thesization rules allow rearrangement.)3 1566 3 1260 1656 t
10 CW f
(-krd)3557 1656 w
10 R f
(, use double precision temporaries)4 1423 1 3797 1656 t
(even for single-precision operands.)3 1402 1 1260 1776 t
10 B f
(-P)900 1944 w
10 R f
(Write a)1 310 1 1260 1944 t
10 I f
(\256le)1609 1944 w
10 B f
(.P)1739 1944 w
10 R f
(of ANSI \(or C++\) prototypes for de\256nitions in each input)9 2422 1 1864 1944 t
10 I f
(\256le)4325 1944 w
10 B f
(.f)4455 1944 w
10 R f
(or)4553 1944 w
10 I f
(\256le)4676 1944 w
10 B f
(.F)4806 1944 w
10 I f
(.)4892 1944 w
10 R f
(When)4982 1944 w
( Option)1 332( from standard input, write prototypes at the beginning of standard output.)11 3005(reading Fortran)1 623 3 1260 2064 t
10 B f
(-Ps)1260 2184 w
10 R f
(implies)1418 2184 w
10 B f
(-P)1738 2184 w
10 R f
(and gives exit status 4 if rerunning)6 1382 1 1857 2184 t
10 I f
(f 2c)1 130 1 3264 2184 t
10 R f
(may change prototypes or declarations.)4 1566 1 3419 2184 t
10 B f
(-p)900 2352 w
10 R f
(Supply preprocessor de\256nitions to make common-block members look like local variables.)10 3638 1 1260 2352 t
10 B f
(-R)900 2520 w
10 R f
(Do not promote)2 633 1 1260 2520 t
9 R f
(REAL)1916 2520 w
10 R f
(functions and operations to)3 1085 1 2176 2520 t
9 R f
(DOUBLE PRECISION.)1 877 1 3284 2520 t
10 R f
(Option)4212 2520 w
10 CW f
(-!R)4516 2520 w
10 R f
(con\256rms the)1 498 1 4722 2520 t
(default, which imitates)2 913 1 1260 2640 t
10 I f
(f 77)1 136 1 2198 2640 t
10 R f
(.)2342 2640 w
10 B f
(-r)900 2808 w
10 R f
(Cast values of REAL functions \(including intrinsics\) to REAL.)8 2524 1 1260 2808 t
10 B f
(-r8)900 2976 w
10 R f
(Promote)1260 2976 w
9 R f
(REAL)1622 2976 w
10 R f
(to)1882 2976 w
9 R f
(DOUBLE PRECISION, COMPLEX)2 1329 1 1983 2976 t
10 R f
(to)3337 2976 w
9 R f
(DOUBLE COMPLEX.)1 841 1 3438 2976 t
10 B f
(-s)900 3144 w
10 R f
( by option)2 406( Suppressed)1 505(Preserve multidimensional subscripts.)2 1519 3 1260 3144 t
10 CW f
(-C)3715 3144 w
10 R f
(.)3860 3144 w
10 B f
(-T)900 3312 w
10 I f
(dir)1000 3312 w
10 R f
(Put temporary \256les in directory)4 1249 1 1260 3312 t
10 I f
(dir.)2534 3312 w
10 B f
(-w8)900 3480 w
10 R f
(Suppress warnings when)2 993 1 1260 3480 t
9 R f
(COMMON)2276 3480 w
10 R f
(or)2716 3480 w
9 R f
(EQUIVALENCE)2822 3480 w
10 R f
(forces odd-word alignment of doubles.)4 1550 1 3482 3480 t
10 B f
(-W)900 3648 w
10 I f
(n)1033 3648 w
10 R f
(Assume)1260 3648 w
10 I f
(n)1607 3648 w
10 R f
(characters/word \(default 4\) when initializing numeric variables with character data.)9 3324 1 1682 3648 t
10 B f
(-z)900 3816 w
10 R f
(Do not implicitly recognize)3 1102 1 1260 3816 t
9 R f
(DOUBLE COMPLEX.)1 841 1 2385 3816 t
10 B f
(-!bs)900 3984 w
10 R f
(Do not recognize)2 687 1 1260 3984 t
10 I f
(b)1972 3984 w
10 R f
(ack)2022 3984 w
10 I f
(s)2160 3984 w
10 R f
(lash escapes \(\\", \\', \\0, \\\\, \\b, \\f, \\n, \\r, \\t, \\v\) in character strings.)14 2516 1 2199 3984 t
10 B f
(-!c)900 4152 w
10 R f
(Inhibit C output, but produce)4 1164 1 1260 4152 t
10 B f
(-P)2449 4152 w
10 R f
(output.)2568 4152 w
10 B f
(-!I)900 4320 w
10 R f
(Reject)1260 4320 w
10 B f
(include)1540 4320 w
10 R f
(statements.)1877 4320 w
10 B f
(-!i8)900 4488 w
10 R f
(Disallow)1260 4488 w
9 R f
(INTEGER)1644 4488 w
9 S f
(*)2029 4488 w
9 R f
(8.)2074 4488 w
10 B f
(-!it)900 4656 w
10 R f
(Don't infer types of untyped)4 1149 1 1260 4656 t
9 R f
(EXTERNAL)2435 4656 w
10 R f
(procedures from use as parameters to previously de\256ned)7 2281 1 2939 4656 t
(or prototyped procedures.)2 1028 1 1260 4776 t
10 B f
(-!P)900 4944 w
10 R f
(Do not attempt to infer)4 916 1 1260 4944 t
9 R f
(ANSI)2199 4944 w
10 R f
(or C++ prototypes from usage.)4 1230 1 2434 4944 t
(The resulting C invokes the support routines of)7 1927 1 900 5112 t
10 I f
(f 77)1 136 1 2858 5112 t
10 R f
( be loaded by)3 556(; object code should)3 820 2 3002 5112 t
10 I f
(f 77)1 136 1 4410 5112 t
10 R f
(or with)1 293 1 4578 5112 t
10 I f
(ld)4903 5112 w
10 R f
(\(1\) or)1 231 1 4989 5112 t
10 I f
(cc)900 5232 w
10 R f
(\(1\) options)1 436 1 996 5232 t
10 B f
(-lF77 -lI77 -lm)2 616 1 1457 5232 t
10 R f
( conventions are those of)4 998(. Calling)1 370 2 2073 5232 t
10 I f
(f77)3466 5232 w
10 R f
(: see the reference below.)4 1015 1 3602 5232 t
9 B f
(FILES)540 5400 w
10 I f
(\256le)900 5520 w
10 B f
(.[fF])1030 5520 w
10 R f
(input \256le)1 359 1 2160 5520 t
10 S f
(*)900 5688 w
10 B f
(.c)950 5688 w
10 R f
(output \256le)1 409 1 2160 5688 t
10 CW f
(/usr/include/f2c.h)900 5856 w
10 R f
(header \256le)1 418 1 2160 5856 t
10 CW f
(/usr/lib/libF77.a)900 6024 w
10 R f
(intrinsic function library)2 977 1 2160 6024 t
10 CW f
(/usr/lib/libI77.a)900 6192 w
10 R f
(Fortran I/O library)2 743 1 2160 6192 t
10 CW f
(/lib/libc.a)900 6360 w
10 R f
(C library, see section 3)4 918 1 2160 6360 t
9 B f
(SEE ALSO)1 438 1 540 6528 t
10 R f
(S. I. Feldman and P. J. Weinberger, `A Portable Fortran 77 Compiler',)11 3091 1 900 6648 t
10 I f
( Sharing System)2 696(UNIX Time)1 483 2 4041 6648 t
(Programmer's Manual)1 924 1 900 6768 t
10 R f
(, Tenth Edition, Volume 2, AT&T Bell Laboratories, 1990.)8 2368 1 1824 6768 t
9 B f
(DIAGNOSTICS)540 6936 w
10 R f
(The diagnostics produced by)3 1151 1 900 7056 t
10 I f
(f 2c)1 130 1 2076 7056 t
10 R f
(are intended to be self-explanatory.)4 1410 1 2231 7056 t
( 12, 1996)2 375( May)1 3986(Page 25)1 319 3 540 7680 t
cleartomark
showpage
saveobj restore
%%EndPage: 25 26
%%Page: 26 27
/saveobj save def
mark
27 pagesetup
9 B f
( \( 1 \))3 126( F2C)1 1621( \))1 37( B)1 83( Appendix)1 382( \()1 68( System V)2 386( UNIX)1 1686(F2C \( 1 \))3 291 9 540 480 t
(BUGS)540 960 w
10 R f
( machine running)2 721(Floating-point constant expressions are simpli\256ed in the \257oating-point arithmetic of the)10 3599 2 900 1080 t
10 I f
(f 2c)1 130 1 900 1200 t
10 R f
(, so they are typically accurate to at most 16 or 17 decimal places.)13 2631 1 1038 1200 t
(Untypable)900 1320 w
9 R f
(EXTERNAL)1339 1320 w
10 R f
(functions are declared)2 880 1 1839 1320 t
10 B f
(int)2744 1320 w
10 R f
(.)2861 1320 w
( 26)1 125( Page)1 3997(May 12, 1996)2 558 3 540 7680 t
cleartomark
showpage
saveobj restore
%%EndPage: 26 27
%%Trailer
done
%%Pages: 27
%%DocumentFonts: Times-Italic Times-Roman Symbol Times-BoldItalic Courier Times-Bold