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
|
@ignore
Copyright (C) 2005
Free Software Foundation, Inc.
This is part of the GFORTRAN manual.
For copying conditions, see the file gfortran.texi.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``GNU General Public License'' and ``Funding
Free Software'', the Front-Cover texts being (a) (see below), and with
the Back-Cover Texts being (b) (see below). A copy of the license is
included in the gfdl(7) man page.
Some basic guidelines for editing this document:
(1) The intrinsic procedures are to be listed in alphabetical order.
(2) The generic name is to be use.
(3) The specific names are included in the function index and in a
table at the end of the node (See ABS entry).
(4) Try to maintain the same style for each entry.
@end ignore
@node Intrinsic Procedures
@chapter Intrinsic Procedures
@cindex Intrinsic Procedures
This portion of the document is incomplete and undergoing massive expansion
and editing. All contributions and corrections are strongly encouraged.
@menu
* Introduction: Introduction
* @code{ABORT}: ABORT, Abort the program
* @code{ABS}: ABS, Absolute value
* @code{ACHAR}: ACHAR, Character in @acronym{ASCII} collating sequence
* @code{ACOS}: ACOS, Arc cosine function
* @code{ADJUSTL}: ADJUSTL, Left adjust a string
* @code{ADJUSTR}: ADJUSTR, Right adjust a string
* @code{AIMAG}: AIMAG, Imaginary part of complex number
* @code{AINT}: AINT, Truncate to a whole number
* @code{ALL}: ALL, Determine if all values are true
* @code{ALLOCATED}: ALLOCATED, Status of allocatable entity
* @code{ANINT}: ANINT, Nearest whole number
* @code{ANY}: ANY, Determine if any values are true
* @code{ASIN}: ASIN, Arcsine function
* @code{ASSOCIATED}: ASSOCIATED, Status of a pointer or pointer/target pair
* @code{ATAN}: ATAN, Arctangent function
* @code{ATAN2}: ATAN2, Arctangent function
* @code{BESJ0}: BESJ0, Bessel function of the first kind of order 0
* @code{BESJ1}: BESJ1, Bessel function of the first kind of order 1
* @code{BESJN}: BESJN, Bessel function of the first kind
* @code{BESY0}: BESY0, Bessel function of the second kind of order 0
* @code{BESY1}: BESY1, Bessel function of the second kind of order 1
* @code{BESYN}: BESYN, Bessel function of the second kind
* @code{BIT_SIZE}: BIT_SIZE, Bit size inquiry function
* @code{BTEST}: BTEST, Bit test function
* @code{CEILING}: CEILING, Integer ceiling function
* @code{CHAR}: CHAR, Character conversion function
* @code{CMPLX}: CMPLX, Complex conversion function
* @code{COMMAND_ARGUMENT_COUNT}: COMMAND_ARGUMENT_COUNT, Command line argument count
* @code{CONJG}: CONJG, Complex conjugate function
* @code{COS}: COS, Cosine function
* @code{COSH}: COSH, Hyperbolic cosine function
* @code{COUNT}: COUNT, Count occurrences of .TRUE. in an array
* @code{CPU_TIME}: CPU_TIME, CPU time subroutine
* @code{CSHIFT}: CSHIFT, Circular array shift function
* @code{DATE_AND_TIME}: DATE_AND_TIME, Date and time subroutine
* @code{DBLE}: DBLE, Double precision conversion function
* @code{DCMPLX}: DCMPLX, Double complex conversion function
* @code{DFLOAT}: DFLOAT, Double precision conversion function
* @code{DIGITS}: DIGITS, Significant digits function
* @code{DIM}: DIM, Dim function
* @code{DOT_PRODUCT}: DOT_PRODUCT, Dot product function
* @code{DPROD}: DPROD, Double product function
* @code{DREAL}: DREAL, Double real part function
* @code{DTIME}: DTIME, Execution time subroutine (or function)
* @code{EOSHIFT}: EOSHIFT, End-off shift function
* @code{EPSILON}: EPSILON, Epsilon function
* @code{ERF}: ERF, Error function
* @code{ERFC}: ERFC, Complementary error function
* @code{ETIME}: ETIME, Execution time subroutine (or function)
* @code{EXIT}: EXIT, Exit the program with status.
* @code{EXP}: EXP, Exponential function
* @code{EXPONENT}: EXPONENT, Exponent function
* @code{FLOOR}: FLOOR, Integer floor function
* @code{FNUM}: FNUM, File number function
* @code{LOC}: LOC, Returns the address of a variable
* @code{LOG}: LOG, Logarithm function
* @code{LOG10}: LOG10, Base 10 logarithm function
* @code{REAL}: REAL, Convert to real type
* @code{SQRT}: SQRT, Square-root function
* @code{SIN}: SIN, Sine function
* @code{SINH}: SINH, Hyperbolic sine function
* @code{TAN}: TAN, Tangent function
* @code{TANH}: TANH, Hyperbolic tangent function
@end menu
@node Introduction
@section Introduction to intrinsic procedures
Gfortran provides a rich set of intrinsic procedures that includes all
the intrinsic procedures required by the Fortran 95 standard, a set of
intrinsic procedures for backwards compatibility with Gnu Fortran 77
(i.e., @command{g77}), and a small selection of intrinsic procedures
from the Fortran 2003 standard. Any description here, which conflicts with a
description in either the Fortran 95 standard or the Fortran 2003 standard,
is unintentional and the standard(s) should be considered authoritative.
The enumeration of the @code{KIND} type parameter is processor defined in
the Fortran 95 standard. Gfortran defines the default integer type and
default real type by @code{INTEGER(KIND=4)} and @code{REAL(KIND=4)},
respectively. The standard mandates that both data types shall have
another kind, which have more precision. On typical target architectures
supported by @command{gfortran}, this kind type parameter is @code{KIND=8}.
Hence, @code{REAL(KIND=8)} and @code{DOUBLE PRECISION} are equivalent.
In the description of generic intrinsic procedures, the kind type parameter
will be specified by @code{KIND=*}, and in the description of specific
names for an intrinsic procedure the kind type parameter will be explicitly
given (e.g., @code{REAL(KIND=4)} or @code{REAL(KIND=8)}). Finally, for
brevity the optional @code{KIND=} syntax will be omitted.
Many of the intrinsics procedures take one or more optional arguments.
This document follows the convention used in the Fortran 95 standard,
and denotes such arguments by square brackets.
@command{Gfortran} offers the @option{-std=f95} and @option{-std=gnu} options,
which can be used to restrict the set of intrinsic procedures to a
given standard. By default, @command{gfortran} sets the @option{-std=gnu}
option, and so all intrinsic procedures described here are accepted. There
is one caveat. For a select group of intrinsic procedures, @command{g77}
implemented both a function and a subroutine. Both classes
have been implemented in @command{gfortran} for backwards compatibility
with @command{g77}. It is noted here that these functions and subroutines
cannot be intermixed in a given subprogram. In the descriptions that follow,
the applicable option(s) is noted.
@node ABORT
@section @code{ABORT} --- Abort the program
@findex @code{ABORT}
@cindex abort
@table @asis
@item @emph{Description}:
@code{ABORT} causes immediate termination of the program. On operating
systems that support a core dump, @code{ABORT} will produce a core dump,
which is suitable for debugging purposes.
@item @emph{Option}:
gnu
@item @emph{Class}:
non-elemental subroutine
@item @emph{Syntax}:
@code{CALL ABORT}
@item @emph{Return value}:
Does not return.
@item @emph{Example}:
@smallexample
program test_abort
integer :: i = 1, j = 2
if (i /= j) call abort
end program test_abort
@end smallexample
@end table
@node ABS
@section @code{ABS} --- Absolute value
@findex @code{ABS} intrinsic
@findex @code{CABS} intrinsic
@findex @code{DABS} intrinsic
@findex @code{IABS} intrinsic
@findex @code{ZABS} intrinsic
@findex @code{CDABS} intrinsic
@cindex absolute value
@table @asis
@item @emph{Description}:
@code{ABS(X)} computes the absolute value of @code{X}.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{X = ABS(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type of the argument shall be an @code{INTEGER(*)},
@code{REAL(*)}, or @code{COMPLEX(*)}.
@end multitable
@item @emph{Return value}:
The return value is of the same type and
kind as the argument except the return value is @code{REAL(*)} for a
@code{COMPLEX(*)} argument.
@item @emph{Example}:
@smallexample
program test_abs
integer :: i = -1
real :: x = -1.e0
complex :: z = (-1.e0,0.e0)
i = abs(i)
x = abs(x)
x = abs(z)
end program test_abs
@end smallexample
@item @emph{Specific names}:
@multitable @columnfractions .24 .24 .24 .24
@item Name @tab Argument @tab Return type @tab Option
@item @code{CABS(Z)} @tab @code{COMPLEX(4) Z} @tab @code{REAL(4)} @tab f95, gnu
@item @code{DABS(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
@item @code{IABS(I)} @tab @code{INTEGER(4) I} @tab @code{INTEGER(4)} @tab f95, gnu
@item @code{ZABS(Z)} @tab @code{COMPLEX(8) Z} @tab @code{COMPLEX(8)} @tab gnu
@item @code{CDABS(Z)} @tab @code{COMPLEX(8) Z} @tab @code{COMPLEX(8)} @tab gnu
@end multitable
@end table
@node ACHAR
@section @code{ACHAR} --- Character in @acronym{ASCII} collating sequence
@findex @code{ACHAR} intrinsic
@cindex @acronym{ASCII} collating sequence
@table @asis
@item @emph{Description}:
@code{ACHAR(I)} returns the character located at position @code{I}
in the @acronym{ASCII} collating sequence.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{C = ACHAR(I)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{I} @tab The type shall be @code{INTEGER(*)}.
@end multitable
@item @emph{Return value}:
The return value is of type @code{CHARACTER} with a length of one. The
kind type parameter is the same as @code{KIND('A')}.
@item @emph{Example}:
@smallexample
program test_achar
character c
c = achar(32)
end program test_achar
@end smallexample
@end table
@node ACOS
@section @code{ACOS} --- Arc cosine function
@findex @code{ACOS} intrinsic
@findex @code{DACOS} intrinsic
@cindex arc cosine
@table @asis
@item @emph{Description}:
@code{ACOS(X)} computes the arc cosine of @var{X}.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{X = ACOS(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type shall be @code{REAL(*)} with a magnitude that is
less than one.
@end multitable
@item @emph{Return value}:
The return value is of type @code{REAL(*)} and it lies in the
range @math{ 0 \leq \arccos (x) \leq \pi}. The kind type
parameter is the same as @var{X}.
@item @emph{Example}:
@smallexample
program test_acos
real(8) :: x = 0.866_8
x = achar(x)
end program test_acos
@end smallexample
@item @emph{Specific names}:
@multitable @columnfractions .24 .24 .24 .24
@item Name @tab Argument @tab Return type @tab Option
@item @code{DACOS(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
@end multitable
@end table
@node ADJUSTL
@section @code{ADJUSTL} --- Left adjust a string
@findex @code{ADJUSTL} intrinsic
@cindex adjust string
@table @asis
@item @emph{Description}:
@code{ADJUSTL(STR)} will left adjust a string by removing leading spaces.
Spaces are inserted at the end of the string as needed.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{STR = ADJUSTL(STR)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{STR} @tab The type shall be @code{CHARACTER}.
@end multitable
@item @emph{Return value}:
The return value is of type @code{CHARACTER} where leading spaces
are removed and the same number of spaces are inserted on the end
of @var{STR}.
@item @emph{Example}:
@smallexample
program test_adjustl
character(len=20) :: str = ' gfortran'
str = adjustl(str)
print *, str
end program test_adjustl
@end smallexample
@end table
@node ADJUSTR
@section @code{ADJUSTR} --- Right adjust a string
@findex @code{ADJUSTR} intrinsic
@cindex adjust string
@table @asis
@item @emph{Description}:
@code{ADJUSTR(STR)} will right adjust a string by removing trailing spaces.
Spaces are inserted at the start of the string as needed.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{STR = ADJUSTR(STR)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{STR} @tab The type shall be @code{CHARACTER}.
@end multitable
@item @emph{Return value}:
The return value is of type @code{CHARACTER} where trailing spaces
are removed and the same number of spaces are inserted at the start
of @var{STR}.
@item @emph{Example}:
@smallexample
program test_adjustr
character(len=20) :: str = 'gfortran'
str = adjustr(str)
print *, str
end program test_adjustr
@end smallexample
@end table
@node AIMAG
@section @code{AIMAG} --- Imaginary part of complex number
@findex @code{AIMAG} intrinsic
@findex @code{DIMAG} intrinsic
@findex @code{IMAG} intrinsic
@findex @code{IMAGPART} intrinsic
@cindex Imaginary part
@table @asis
@item @emph{Description}:
@code{AIMAG(Z)} yields the imaginary part of complex argument @code{Z}.
The @code{IMAG(Z)} and @code{IMAGPART(Z)} intrinsic functions are provided
for compatibility with @command{g77}, and their use in new code is
strongly discouraged.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{X = AIMAG(Z)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{Z} @tab The type of the argument shall be @code{COMPLEX(*)}.
@end multitable
@item @emph{Return value}:
The return value is of type real with the
kind type parameter of the argument.
@item @emph{Example}:
@smallexample
program test_aimag
complex(4) z4
complex(8) z8
z4 = cmplx(1.e0_4, 0.e0_4)
z8 = cmplx(0.e0_8, 1.e0_8)
print *, aimag(z4), dimag(z8)
end program test_aimag
@end smallexample
@item @emph{Specific names}:
@multitable @columnfractions .24 .24 .24 .24
@item Name @tab Argument @tab Return type @tab Option
@item @code{DIMAG(Z)} @tab @code{COMPLEX(8) Z} @tab @code{REAL(8)} @tab f95, gnu
@item @code{IMAG(Z)} @tab @code{COMPLEX(*) Z} @tab @code{REAL(*)} @tab gnu
@item @code{IMAGPART(Z)} @tab @code{COMPLEX(*) Z} @tab @code{REAL(*)} @tab gnu
@end multitable
@end table
@node AINT
@section @code{AINT} --- Imaginary part of complex number
@findex @code{AINT} intrinsic
@findex @code{DINT} intrinsic
@cindex whole number
@table @asis
@item @emph{Description}:
@code{AINT(X [, KIND])} truncates its argument to a whole number.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{X = AINT(X)}
@code{X = AINT(X, KIND)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type of the argument shall be @code{REAL(*)}.
@item @var{KIND} @tab (Optional) @var{KIND} shall be a scalar integer
initialization expression.
@end multitable
@item @emph{Return value}:
The return value is of type real with the kind type parameter of the
argument if the optional @var{KIND} is absent; otherwise, the kind
type parameter will be given by @var{KIND}. If the magnitude of
@var{X} is less than one, then @code{AINT(X)} returns zero. If the
magnitude is equal to or greater than one, then it returns the largest
whole number that does not exceed its magnitude. The sign is the same
as the sign of @var{X}.
@item @emph{Example}:
@smallexample
program test_aint
real(4) x4
real(8) x8
x4 = 1.234E0_4
x8 = 4.321_8
print *, aint(x4), dint(x8)
x8 = aint(x4,8)
end program test_aint
@end smallexample
@item @emph{Specific names}:
@multitable @columnfractions .24 .24 .24 .24
@item Name @tab Argument @tab Return type @tab Option
@item @code{DINT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
@end multitable
@end table
@node ALL
@section @code{ALL} --- All values in @var{MASK} along @var{DIM} are true
@findex @code{ALL} intrinsic
@cindex true values
@table @asis
@item @emph{Description}:
@code{ALL(MASK [, DIM])} determines if all the values are true in @var{MASK}
in the array along dimension @var{DIM}.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
transformational function
@item @emph{Syntax}:
@code{L = ALL(MASK)}
@code{L = ALL(MASK, DIM)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{MASK} @tab The type of the argument shall be @code{LOGICAL(*)} and
it shall not be scalar.
@item @var{DIM} @tab (Optional) @var{DIM} shall be a scalar integer
with a value that lies between one and the rank of @var{MASK}.
@end multitable
@item @emph{Return value}:
@code{ALL(MASK)} returns a scalar value of type @code{LOGICAL(*)} where
the kind type parameter is the same as the kind type parameter of
@var{MASK}. If @var{DIM} is present, then @code{ALL(MASK, DIM)} returns
an array with the rank of @var{MASK} minus 1. The shape is determined from
the shape of @var{MASK} where the @var{DIM} dimension is elided.
@table @asis
@item (A)
@code{ALL(MASK)} is true if all elements of @var{MASK} are true.
It also is true if @var{MASK} has zero size; otherwise, it is false.
@item (B)
If the rank of @var{MASK} is one, then @code{ALL(MASK,DIM)} is equivalent
to @code{ALL(MASK)}. If the rank is greater than one, then @code{ALL(MASK,DIM)}
is determined by applying @code{ALL} to the array sections.
@end table
@item @emph{Example}:
@smallexample
program test_all
logical l
l = all((/.true., .true., .true./))
print *, l
call section
contains
subroutine section
integer a(2,3), b(2,3)
a = 1
b = 1
b(2,2) = 2
print *, all(a .eq. b, 1)
print *, all(a .eq. b, 2)
end subroutine section
end program test_all
@end smallexample
@end table
@node ALLOCATED
@section @code{ALLOCATED} --- Status of an allocatable entity
@findex @code{ALLOCATED} intrinsic
@cindex allocation status
@table @asis
@item @emph{Description}:
@code{ALLOCATED(X)} checks the status of whether @var{X} is allocated.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
inquiry function
@item @emph{Syntax}:
@code{L = ALLOCATED(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The argument shall be an @code{ALLOCATABLE} array.
@end multitable
@item @emph{Return value}:
The return value is a scalar @code{LOGICAL} with the default logical
kind type parameter. If @var{X} is allocated, @code{ALLOCATED(X)}
is @code{.TRUE.}; otherwise, it returns the @code{.TRUE.}
@item @emph{Example}:
@smallexample
program test_allocated
integer :: i = 4
real(4), allocatable :: x(:)
if (allocated(x) .eqv. .false.) allocate(x(i)
end program test_allocated
@end smallexample
@end table
@node ANINT
@section @code{ANINT} --- Imaginary part of complex number
@findex @code{ANINT} intrinsic
@findex @code{DNINT} intrinsic
@cindex whole number
@table @asis
@item @emph{Description}:
@code{ANINT(X [, KIND])} rounds its argument to the nearest whole number.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{X = ANINT(X)}
@code{X = ANINT(X, KIND)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type of the argument shall be @code{REAL(*)}.
@item @var{KIND} @tab (Optional) @var{KIND} shall be a scalar integer
initialization expression.
@end multitable
@item @emph{Return value}:
The return value is of type real with the kind type parameter of the
argument if the optional @var{KIND} is absent; otherwise, the kind
type parameter will be given by @var{KIND}. If @var{X} is greater than
zero, then @code{ANINT(X)} returns @code{AINT(X+0.5)}. If @var{X} is
less than or equal to zero, then return @code{AINT(X-0.5)}.
@item @emph{Example}:
@smallexample
program test_anint
real(4) x4
real(8) x8
x4 = 1.234E0_4
x8 = 4.321_8
print *, anint(x4), dnint(x8)
x8 = anint(x4,8)
end program test_anint
@end smallexample
@item @emph{Specific names}:
@multitable @columnfractions .24 .24 .24 .24
@item Name @tab Argument @tab Return type @tab Option
@item @code{DNINT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
@end multitable
@end table
@node ANY
@section @code{ANY} --- Any value in @var{MASK} along @var{DIM} is true
@findex @code{ANY} intrinsic
@cindex true values
@table @asis
@item @emph{Description}:
@code{ANY(MASK [, DIM])} determines if any of the values in the logical array
@var{MASK} along dimension @var{DIM} are @code{.TRUE.}.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
transformational function
@item @emph{Syntax}:
@code{L = ANY(MASK)}
@code{L = ANY(MASK, DIM)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{MASK} @tab The type of the argument shall be @code{LOGICAL(*)} and
it shall not be scalar.
@item @var{DIM} @tab (Optional) @var{DIM} shall be a scalar integer
with a value that lies between one and the rank of @var{MASK}.
@end multitable
@item @emph{Return value}:
@code{ANY(MASK)} returns a scalar value of type @code{LOGICAL(*)} where
the kind type parameter is the same as the kind type parameter of
@var{MASK}. If @var{DIM} is present, then @code{ANY(MASK, DIM)} returns
an array with the rank of @var{MASK} minus 1. The shape is determined from
the shape of @var{MASK} where the @var{DIM} dimension is elided.
@table @asis
@item (A)
@code{ANY(MASK)} is true if any element of @var{MASK} is true;
otherwise, it is false. It also is false if @var{MASK} has zero size.
@item (B)
If the rank of @var{MASK} is one, then @code{ANY(MASK,DIM)} is equivalent
to @code{ANY(MASK)}. If the rank is greater than one, then @code{ANY(MASK,DIM)}
is determined by applying @code{ANY} to the array sections.
@end table
@item @emph{Example}:
@smallexample
program test_any
logical l
l = any((/.true., .true., .true./))
print *, l
call section
contains
subroutine section
integer a(2,3), b(2,3)
a = 1
b = 1
b(2,2) = 2
print *, any(a .eq. b, 1)
print *, any(a .eq. b, 2)
end subroutine section
end program test_any
@end smallexample
@end table
@node ASIN
@section @code{ASIN} --- Arcsine function
@findex @code{ASIN} intrinsic
@findex @code{DASIN} intrinsic
@cindex arcsine
@table @asis
@item @emph{Description}:
@code{ASIN(X)} computes the arcsine of its @var{X}.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{X = ASIN(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type shall be @code{REAL(*)}, and a magnitude that is
less than one.
@end multitable
@item @emph{Return value}:
The return value is of type @code{REAL(*)} and it lies in the
range @math{-\pi / 2 \leq \arccos (x) \leq \pi / 2}. The kind type
parameter is the same as @var{X}.
@item @emph{Example}:
@smallexample
program test_asin
real(8) :: x = 0.866_8
x = asin(x)
end program test_asin
@end smallexample
@item @emph{Specific names}:
@multitable @columnfractions .24 .24 .24 .24
@item Name @tab Argument @tab Return type @tab Option
@item @code{DASIN(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
@end multitable
@end table
@node ASSOCIATED
@section @code{ASSOCIATED} --- Status of a pointer or pointer/target pair
@findex @code{ASSOCIATED} intrinsic
@cindex pointer status
@table @asis
@item @emph{Description}:
@code{ASSOCIATED(PTR [, TGT])} determines the status of the pointer @var{PTR}
or if @var{PTR} is associated with the target @var{TGT}.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
inquiry function
@item @emph{Syntax}:
@code{L = ASSOCIATED(PTR)}
@code{L = ASSOCIATED(PTR [, TGT])}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{PTR} @tab @var{PTR} shall have the @code{POINTER} attribute and
it can be of any type.
@item @var{TGT} @tab (Optional) @var{TGT} shall be a @code{POINTER} or
a @code{TARGET}. It must have the same type, kind type parameter, and
array rank as @var{PTR}.
@end multitable
The status of neither @var{PTR} nor @var{TGT} can be undefined.
@item @emph{Return value}:
@code{ASSOCIATED(PTR)} returns a scalar value of type @code{LOGICAL(4)}.
There are several cases:
@table @asis
@item (A) If the optional @var{TGT} is not present, then @code{ASSOCIATED(PTR)}
is true if @var{PTR} is associated with a target; otherwise, it returns false.
@item (B) If @var{TGT} is present and a scalar target, the result is true if
@var{TGT}
is not a 0 sized storage sequence and the target associated with @var{PTR}
occupies the same storage units. If @var{PTR} is disassociated, then the
result is false.
@item (C) If @var{TGT} is present and an array target, the result is true if
@var{TGT} and @var{PTR} have the same shape, are not 0 sized arrays, are
arrays whose elements are not 0 sized storage sequences, and @var{TGT} and
@var{PTR} occupy the same storage units in array element order.
As in case(B), the result is false, if @var{PTR} is disassociated.
@item (D) If @var{TGT} is present and an scalar pointer, the result is true if
target associated with @var{PTR} and the target associated with @var{TGT}
are not 0 sized storage sequences and occupy the same storage units.
The result is false, if either @var{TGT} or @var{PTR} is disassociated.
@item (E) If @var{TGT} is present and an array pointer, the result is true if
target associated with @var{PTR} and the target associated with @var{TGT}
have the same shape, are not 0 sized arrays, are arrays whose elements are
not 0 sized storage sequences, and @var{TGT} and @var{PTR} occupy the same
storage units in array element order.
The result is false, if either @var{TGT} or @var{PTR} is disassociated.
@end table
@item @emph{Example}:
@smallexample
program test_associated
implicit none
real, target :: tgt(2) = (/1., 2./)
real, pointer :: ptr(:)
ptr => tgt
if (associated(ptr) .eqv. .false.) call abort
if (associated(ptr,tgt) .eqv. .false.) call abort
end program test_associated
@end smallexample
@end table
@node ATAN
@section @code{ATAN} --- Arctangent function
@findex @code{ATAN} intrinsic
@findex @code{DATAN} intrinsic
@cindex arctangent
@table @asis
@item @emph{Description}:
@code{ATAN(X)} computes the arctangent of @var{X}.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{X = ATAN(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type shall be @code{REAL(*)}.
@end multitable
@item @emph{Return value}:
The return value is of type @code{REAL(*)} and it lies in the
range @math{ - \pi / 2 \leq \arcsin (x) \leq \pi / 2}.
@item @emph{Example}:
@smallexample
program test_atan
real(8) :: x = 2.866_8
x = atan(x)
end program test_atan
@end smallexample
@item @emph{Specific names}:
@multitable @columnfractions .24 .24 .24 .24
@item Name @tab Argument @tab Return type @tab Option
@item @code{DATAN(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
@end multitable
@end table
@node ATAN2
@section @code{ATAN2} --- Arctangent function
@findex @code{ATAN2} intrinsic
@findex @code{DATAN2} intrinsic
@cindex arctangent
@table @asis
@item @emph{Description}:
@code{ATAN2(Y,X)} computes the arctangent of the complex number @math{X + i Y}.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{X = ATAN2(Y,X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{Y} @tab The type shall be @code{REAL(*)}.
@item @var{X} @tab The type and kind type parameter shall be the same as @var{Y}.
If @var{Y} is zero, then @var{X} must be nonzero.
@end multitable
@item @emph{Return value}:
The return value has the same type and kind type parameter as @var{Y}.
It is the principle value of the complex number @math{X + i Y}. If
@var{X} is nonzero, then it lies in the range @math{-\pi \le \arccos (x) \leq \pi}.
The sign is positive if @var{Y} is positive. If @var{Y} is zero, then
the return value is zero if @var{X} is positive and @math{\pi} if @var{X}
is negative. Finally, if @var{X} is zero, then the magnitude of the result
is @math{\pi/2}.
@item @emph{Example}:
@smallexample
program test_atan2
real(4) :: x = 1.e0_4, y = 0.5e0_4
x = atan2(y,x)
end program test_atan2
@end smallexample
@item @emph{Specific names}:
@multitable @columnfractions .24 .24 .24 .24
@item Name @tab Argument @tab Return type @tab Option
@item @code{DATAN2(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
@end multitable
@end table
@node BESJ0
@section @code{BESJ0} --- Bessel function of the first kind of order 0
@findex @code{BESJ0} intrinsic
@findex @code{DBESJ0} intrinsic
@cindex Bessel
@table @asis
@item @emph{Description}:
@code{BESJ0(X)} computes the Bessel function of the first kind of order 0
of @var{X}.
@item @emph{Option}:
gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{X = BESJ0(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
@end multitable
@item @emph{Return value}:
The return value is of type @code{REAL(*)} and it lies in the
range @math{ - 0.4027... \leq Bessel (0,x) \leq 1}.
@item @emph{Example}:
@smallexample
program test_besj0
real(8) :: x = 0.0_8
x = besj0(x)
end program test_besj0
@end smallexample
@item @emph{Specific names}:
@multitable @columnfractions .24 .24 .24 .24
@item Name @tab Argument @tab Return type @tab Option
@item @code{DBESJ0(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab gnu
@end multitable
@end table
@node BESJ1
@section @code{BESJ1} --- Bessel function of the first kind of order 1
@findex @code{BESJ1} intrinsic
@findex @code{DBESJ1} intrinsic
@cindex Bessel
@table @asis
@item @emph{Description}:
@code{BESJ1(X)} computes the Bessel function of the first kind of order 1
of @var{X}.
@item @emph{Option}:
gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{X = BESJ1(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
@end multitable
@item @emph{Return value}:
The return value is of type @code{REAL(*)} and it lies in the
range @math{ - 0.5818... \leq Bessel (0,x) \leq 0.5818 }.
@item @emph{Example}:
@smallexample
program test_besj1
real(8) :: x = 1.0_8
x = besj1(x)
end program test_besj1
@end smallexample
@item @emph{Specific names}:
@multitable @columnfractions .24 .24 .24 .24
@item Name @tab Argument @tab Return type @tab Option
@item @code{DBESJ1(X)}@tab @code{REAL(8) X} @tab @code{REAL(8)} @tab gnu
@end multitable
@end table
@node BESJN
@section @code{BESJN} --- Bessel function of the first kind
@findex @code{BESJN} intrinsic
@findex @code{DBESJN} intrinsic
@cindex Bessel
@table @asis
@item @emph{Description}:
@code{BESJN(N, X)} computes the Bessel function of the first kind of order
@var{N} of @var{X}.
@item @emph{Option}:
gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{Y = BESJN(N, X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{N} @tab The type shall be @code{INTEGER(*)}, and it shall be scalar.
@item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
@end multitable
@item @emph{Return value}:
The return value is a scalar of type @code{REAL(*)}.
@item @emph{Example}:
@smallexample
program test_besjn
real(8) :: x = 1.0_8
x = besjn(5,x)
end program test_besjn
@end smallexample
@item @emph{Specific names}:
@multitable @columnfractions .24 .24 .24 .24
@item Name @tab Argument @tab Return type @tab Option
@item @code{DBESJN(X)} @tab @code{INTEGER(*) N} @tab @code{REAL(8)} @tab gnu
@item @tab @code{REAL(8) X} @tab @tab
@end multitable
@end table
@node BESY0
@section @code{BESY0} --- Bessel function of the second kind of order 0
@findex @code{BESY0} intrinsic
@findex @code{DBESY0} intrinsic
@cindex Bessel
@table @asis
@item @emph{Description}:
@code{BESY0(X)} computes the Bessel function of the second kind of order 0
of @var{X}.
@item @emph{Option}:
gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{X = BESY0(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
@end multitable
@item @emph{Return value}:
The return value is a scalar of type @code{REAL(*)}.
@item @emph{Example}:
@smallexample
program test_besy0
real(8) :: x = 0.0_8
x = besy0(x)
end program test_besy0
@end smallexample
@item @emph{Specific names}:
@multitable @columnfractions .24 .24 .24 .24
@item Name @tab Argument @tab Return type @tab Option
@item @code{DBESY0(X)}@tab @code{REAL(8) X} @tab @code{REAL(8)} @tab gnu
@end multitable
@end table
@node BESY1
@section @code{BESY1} --- Bessel function of the second kind of order 1
@findex @code{BESY1} intrinsic
@findex @code{DBESY1} intrinsic
@cindex Bessel
@table @asis
@item @emph{Description}:
@code{BESY1(X)} computes the Bessel function of the second kind of order 1
of @var{X}.
@item @emph{Option}:
gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{X = BESY1(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
@end multitable
@item @emph{Return value}:
The return value is a scalar of type @code{REAL(*)}.
@item @emph{Example}:
@smallexample
program test_besy1
real(8) :: x = 1.0_8
x = besy1(x)
end program test_besy1
@end smallexample
@item @emph{Specific names}:
@multitable @columnfractions .24 .24 .24 .24
@item Name @tab Argument @tab Return type @tab Option
@item @code{DBESY1(X)}@tab @code{REAL(8) X} @tab @code{REAL(8)} @tab gnu
@end multitable
@end table
@node BESYN
@section @code{BESYN} --- Bessel function of the second kind
@findex @code{BESYN} intrinsic
@findex @code{DBESYN} intrinsic
@cindex Bessel
@table @asis
@item @emph{Description}:
@code{BESYN(N, X)} computes the Bessel function of the second kind of order
@var{N} of @var{X}.
@item @emph{Option}:
gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{Y = BESYN(N, X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{N} @tab The type shall be @code{INTEGER(*)}, and it shall be scalar.
@item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
@end multitable
@item @emph{Return value}:
The return value is a scalar of type @code{REAL(*)}.
@item @emph{Example}:
@smallexample
program test_besyn
real(8) :: x = 1.0_8
x = besyn(5,x)
end program test_besyn
@end smallexample
@item @emph{Specific names}:
@multitable @columnfractions .24 .24 .24 .24
@item Name @tab Argument @tab Return type @tab Option
@item @code{DBESYN(N,X)} @tab @code{INTEGER(*) N} @tab @code{REAL(8)} @tab gnu
@item @tab @code{REAL(8) X} @tab @tab
@end multitable
@end table
@node BIT_SIZE
@section @code{BIT_SIZE} --- Bit size inquiry function
@findex @code{BIT_SIZE} intrinsic
@cindex bit_size
@table @asis
@item @emph{Description}:
@code{BIT_SIZE(I)} returns the number of bits (integer precision plus sign bit)
represented by the type of @var{I}.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{I = BIT_SIZE(I)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{I} @tab The type shall be @code{INTEGER(*)}.
@end multitable
@item @emph{Return value}:
The return value is of type @code{INTEGER(*)}
@item @emph{Example}:
@smallexample
program test_bit_size
integer :: i = 123
integer :: size
size = bit_size(i)
print *, size
end program test_bit_size
@end smallexample
@end table
@node BTEST
@section @code{BTEST} --- Bit test function
@findex @code{BTEST} intrinsic
@cindex BTEST
@table @asis
@item @emph{Description}:
@code{BTEST(I,POS)} returns logical @code{.TRUE.} if the bit at @var{POS}
in @var{I} is set.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{I = BTEST(I,POS)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{I} @tab The type shall be @code{INTEGER(*)}.
@item @var{POS} @tab The type shall be @code{INTEGER(*)}.
@end multitable
@item @emph{Return value}:
The return value is of type @code{LOGICAL}
@item @emph{Example}:
@smallexample
program test_btest
integer :: i = 32768 + 1024 + 64
integer :: pos
logical :: bool
do pos=0,16
bool = btest(i, pos)
print *, pos, bool
end do
end program test_btest
@end smallexample
@end table
@node CEILING
@section @code{CEILING} --- Integer ceiling function
@findex @code{CEILING} intrinsic
@cindex CEILING
@table @asis
@item @emph{Description}:
@code{CEILING(X)} returns the least integer greater than or equal to @var{X}.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{I = CEILING(X[,KIND])}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type shall be @code{REAL(*)}.
@item @var{KIND} @tab Optional scaler integer initialization expression.
@end multitable
@item @emph{Return value}:
The return value is of type @code{INTEGER(KIND)}
@item @emph{Example}:
@smallexample
program test_ceiling
real :: x = 63.29
real :: y = -63.59
print *, ceiling(x) ! returns 64
print *, ceiling(y) ! returns -63
end program test_ceiling
@end smallexample
@end table
@node CHAR
@section @code{CHAR} --- Character conversion function
@findex @code{CHAR} intrinsic
@cindex CHAR
@table @asis
@item @emph{Description}:
@code{CHAR(I,[KIND])} returns the character represented by the integer @var{I}.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{C = CHAR(I[,KIND])}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{I} @tab The type shall be @code{INTEGER(*)}.
@item @var{KIND} @tab Optional scaler integer initialization expression.
@end multitable
@item @emph{Return value}:
The return value is of type @code{CHARACTER(1)}
@item @emph{Example}:
@smallexample
program test_char
integer :: i = 74
character(1) :: c
c = char(i)
print *, i, c ! returns 'J'
end program test_char
@end smallexample
@end table
@node CMPLX
@section @code{CMPLX} --- Complex conversion function
@findex @code{CMPLX} intrinsic
@cindex CMPLX
@table @asis
@item @emph{Description}:
@code{CMPLX(X,[Y,KIND])} returns a complex number where @var{X} is converted to
the real component. If @var{Y} is present it is converted to the imaginary
component. If @var{Y} is not present then the imaginary component is set to
0.0. If @var{X} is complex then @var{Y} must not be present.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{C = CMPLX(X[,Y,KIND])}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type may be @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}.
@item @var{Y} @tab Optional, allowed if @var{X} is not @code{COMPLEX(*)}. May be @code{INTEGER(*)} or @code{REAL(*)}.
@item @var{KIND} @tab Optional scaler integer initialization expression.
@end multitable
@item @emph{Return value}:
The return value is of type @code{COMPLEX(*)}
@item @emph{Example}:
@smallexample
program test_cmplx
integer :: i = 42
real :: x = 3.14
complex :: z
z = cmplx(i, x)
print *, z, cmplx(x)
end program test_cmplx
@end smallexample
@end table
@node COMMAND_ARGUMENT_COUNT
@section @code{COMMAND_ARGUMENT_COUNT} --- Argument count function
@findex @code{COMMAND_ARGUMENT_COUNT} intrinsic
@cindex command argument count
@table @asis
@item @emph{Description}:
@code{COMMAND_ARGUMENT_COUNT()} returns the number of arguments passed on the
command line when the containing program was invoked.
@item @emph{Option}:
f2003, gnu
@item @emph{Class}:
non-elemental function
@item @emph{Syntax}:
@code{I = COMMAND_ARGUMENT_COUNT()}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item None
@end multitable
@item @emph{Return value}:
The return value is of type @code{INTEGER(4)}
@item @emph{Example}:
@smallexample
program test_command_argument_count
integer :: count
count = command_argument_count()
print *, count
end program test_command_argument_count
@end smallexample
@end table
@node CONJG
@section @code{CONJG} --- Complex conjugate function
@findex @code{CONJG} intrinsic
@findex @code{DCONJG} intrinsic
@cindex complex conjugate
@table @asis
@item @emph{Description}:
@code{CONJG(Z)} returns the conjugate of @var{Z}. If @var{Z} is @code{(x, y)}
then the result is @code{(x, -y)}
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{Z = CONJG(Z)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{Z} @tab The type shall be @code{COMPLEX(*)}.
@end multitable
@item @emph{Return value}:
The return value is of type @code{COMPLEX(*)}.
@item @emph{Example}:
@smallexample
program test_conjg
complex :: z = (2.0, 3.0)
complex(8) :: dz = (2.71_8, -3.14_8)
z= conjg(z)
print *, z
dz = dconjg(dz)
print *, dz
end program test_conjg
@end smallexample
@item @emph{Specific names}:
@multitable @columnfractions .24 .24 .24 .24
@item Name @tab Argument @tab Return type @tab Option
@item @code{DCONJG(Z)} @tab @code{COMPLEX(8) Z} @tab @code{COMPLEX(8)} @tab gnu
@end multitable
@end table
@node COS
@section @code{COS} --- Cosine function
@findex @code{COS} intrinsic
@findex @code{DCOS} intrinsic
@findex @code{ZCOS} intrinsic
@findex @code{CDCOS} intrinsic
@cindex cosine
@table @asis
@item @emph{Description}:
@code{COS(X)} computes the cosine of @var{X}.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{X = COS(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type shall be @code{REAL(*)} or
@code{COMPLEX(*)}.
@end multitable
@item @emph{Return value}:
The return value has the same type and kind as @var{X}.
@item @emph{Example}:
@smallexample
program test_cos
real :: x = 0.0
x = cos(x)
end program test_cos
@end smallexample
@item @emph{Specific names}:
@multitable @columnfractions .24 .24 .24 .24
@item Name @tab Argument @tab Return type @tab Option
@item @code{DCOS(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
@item @code{CCOS(X)}@tab @code{COMPLEX(4) X}@tab @code{COMPLEX(4)}@tab f95, gnu
@item @code{ZCOS(X)}@tab @code{COMPLEX(8) X}@tab @code{COMPLEX(8)}@tab f95, gnu
@item @code{CDCOS(X)}@tab @code{COMPLEX(8) X}@tab @code{COMPLEX(8)}@tab f95, gnu
@end multitable
@end table
@node COSH
@section @code{COSH} --- Hyperbolic cosine function
@findex @code{COSH} intrinsic
@findex @code{DCOSH} intrinsic
@cindex hyperbolic cosine
@table @asis
@item @emph{Description}:
@code{COSH(X)} computes the hyperbolic cosine of @var{X}.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{X = COSH(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type shall be @code{REAL(*)}.
@end multitable
@item @emph{Return value}:
The return value is of type @code{REAL(*)} and it is positive
(@math{ \cosh (x) \geq 0 }.
@item @emph{Example}:
@smallexample
program test_cosh
real(8) :: x = 1.0_8
x = cosh(x)
end program test_cosh
@end smallexample
@item @emph{Specific names}:
@multitable @columnfractions .24 .24 .24 .24
@item Name @tab Argument @tab Return type @tab Option
@item @code{DCOSH(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
@end multitable
@end table
@node COUNT
@section @code{COUNT} --- Count function
@findex @code{COUNT} intrinsic
@cindex count
@table @asis
@item @emph{Description}:
@code{COUNT(MASK[,DIM])} counts the number of @code{.TRUE.} elements of
@var{MASK} along the dimension of @var{DIM}. If @var{DIM} is omitted it is
taken to be @code{1}. @var{DIM} is a scaler of type @code{INTEGER} in the
range of @math{1 /leq DIM /leq n)} where @math{n} is the rank of @var{MASK}.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
transformational function
@item @emph{Syntax}:
@code{I = COUNT(MASK[,DIM])}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{MASK} @tab The type shall be @code{LOGICAL}.
@item @var{DIM} @tab The type shall be @code{INTEGER}.
@end multitable
@item @emph{Return value}:
The return value is of type @code{INTEGER} with rank equal to that of
@var{MASK}.
@item @emph{Example}:
@smallexample
program test_count
integer, dimension(2,3) :: a, b
logical, dimension(2,3) :: mask
a = reshape( (/ 1, 2, 3, 4, 5, 6 /), (/ 2, 3 /))
b = reshape( (/ 0, 7, 3, 4, 5, 8 /), (/ 2, 3 /))
print '(3i3)', a(1,:)
print '(3i3)', a(2,:)
print *
print '(3i3)', b(1,:)
print '(3i3)', b(2,:)
print *
mask = a.ne.b
print '(3l3)', mask(1,:)
print '(3l3)', mask(2,:)
print *
print '(3i3)', count(mask)
print *
print '(3i3)', count(mask, 1)
print *
print '(3i3)', count(mask, 2)
end program test_count
@end smallexample
@end table
@node CPU_TIME
@section @code{CPU_TIME} --- CPU elapsed time in seconds
@findex @code{CPU_TIME} intrinsic
@cindex CPU_TIME
@table @asis
@item @emph{Description}:
Returns a @code{REAL} value representing the elapsed CPU time in seconds. This
is useful for testing segments of code to determine execution time.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
subroutine
@item @emph{Syntax}:
@code{CPU_TIME(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type shall be @code{REAL} with intent out.
@end multitable
@item @emph{Return value}:
None
@item @emph{Example}:
@smallexample
program test_cpu_time
real :: start, finish
call cpu_time(start)
! put code to test here
call cpu_time(finish)
print '("Time = ",f6.3," seconds.")',finish-start
end program test_cpu_time
@end smallexample
@end table
@node CSHIFT
@section @code{CSHIFT} --- Circular shift function
@findex @code{CSHIFT} intrinsic
@cindex cshift intrinsic
@table @asis
@item @emph{Description}:
@code{CSHIFT(ARRAY, SHIFT[,DIM])} performs a circular shift on elements of
@var{ARRAY} along the dimension of @var{DIM}. If @var{DIM} is omitted it is
taken to be @code{1}. @var{DIM} is a scaler of type @code{INTEGER} in the
range of @math{1 /leq DIM /leq n)} where @math{n} is the rank of @var{ARRAY}.
If the rank of @var{ARRAY} is one, then all elements of @var{ARRAY} are shifted
by @var{SHIFT} places. If rank is greater than one, then all complete rank one
sections of @var{ARRAY} along the given dimension are shifted. Elements
shifted out one end of each rank one section are shifted back in the other end.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
transformational function
@item @emph{Syntax}:
@code{A = CSHIFT(A, SHIFT[,DIM])}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{ARRAY} @tab May be any type, not scaler.
@item @var{SHIFT} @tab The type shall be @code{INTEGER}.
@item @var{DIM} @tab The type shall be @code{INTEGER}.
@end multitable
@item @emph{Return value}:
Returns an array of same type and rank as the @var{ARRAY} argument.
@item @emph{Example}:
@smallexample
program test_cshift
integer, dimension(3,3) :: a
a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /))
print '(3i3)', a(1,:)
print '(3i3)', a(2,:)
print '(3i3)', a(3,:)
a = cshift(a, SHIFT=(/1, 2, -1/), DIM=2)
print *
print '(3i3)', a(1,:)
print '(3i3)', a(2,:)
print '(3i3)', a(3,:)
end program test_cshift
@end smallexample
@end table
@node DATE_AND_TIME
@section @code{DATE_AND_TIME} --- Date and time subroutine
@findex @code{DATE_AND_TIME} intrinsic
@cindex DATE_AND_TIME
@table @asis
@item @emph{Description}:
@code{DATE_AND_TIME(DATE, TIME, ZONE, VALUES)} gets the corresponding date and
time information from the real-time system clock. @var{DATE} is
@code{INTENT(OUT)} and has form ccyymmdd. @var{TIME} is @code{INTENT(OUT)} and
has form hhmmss.sss. @var{ZONE} is @code{INTENT(OUT)} and has form (+-)hhmm,
representing the difference with respect to Coordinated Universal Time (UTC).
Unavailable time and date parameters return blanks.
@var{VALUES} is @code{INTENT(OUT)} and provides the following:
@multitable @columnfractions .15 .30 .60
@item @tab @code{VALUE(1)}: @tab The year
@item @tab @code{VALUE(2)}: @tab The month
@item @tab @code{VALUE(3)}: @tab The day of the month
@item @tab @code{VAlUE(4)}: @tab Time difference with UTC in minutes
@item @tab @code{VALUE(5)}: @tab The hour of the day
@item @tab @code{VALUE(6)}: @tab The minutes of the hour
@item @tab @code{VALUE(7)}: @tab The seconds of the minute
@item @tab @code{VALUE(8)}: @tab The milliseconds of the second
@end multitable
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
subroutine
@item @emph{Syntax}:
@code{CALL DATE_AND_TIME([DATE, TIME, ZONE, VALUES])}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{DATE} @tab (Optional) The type shall be @code{CHARACTER(8)} or larger.
@item @var{TIME} @tab (Optional) The type shall be @code{CHARACTER(10)} or larger.
@item @var{ZONE} @tab (Optional) The type shall be @code{CHARACTER(5)} or larger.
@item @var{VALUES}@tab (Optional) The type shall be @code{INTEGER(8)}.
@end multitable
@item @emph{Return value}:
None
@item @emph{Example}:
@smallexample
program test_time_and_date
character(8) :: date
character(10) :: time
character(5) :: zone
integer,dimension(8) :: values
! using keyword arguments
call date_and_time(date,time,zone,values)
call date_and_time(DATE=date,ZONE=zone)
call date_and_time(TIME=time)
call date_and_time(VALUES=values)
print '(a,2x,a,2x,a)', date, time, zone
print '(8i5))', values
end program test_time_and_date
@end smallexample
@end table
@node DBLE
@section @code{DBLE} --- Double conversion function
@findex @code{DBLE} intrinsic
@cindex double conversion
@table @asis
@item @emph{Description}:
@code{DBLE(X)} Converts @var{X} to double precision real type.
@code{DFLOAT} is an alias for @code{DBLE}
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{X = DBLE(X)}
@code{X = DFLOAT(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type shall be @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}.
@end multitable
@item @emph{Return value}:
The return value is of type double precision real.
@item @emph{Example}:
@smallexample
program test_dble
real :: x = 2.18
integer :: i = 5
complex :: z = (2.3,1.14)
print *, dble(x), dble(i), dfloat(z)
end program test_dble
@end smallexample
@end table
@node DCMPLX
@section @code{DCMPLX} --- Double complex conversion function
@findex @code{DCMPLX} intrinsic
@cindex DCMPLX
@table @asis
@item @emph{Description}:
@code{DCMPLX(X [,Y])} returns a double complex number where @var{X} is
converted to the real component. If @var{Y} is present it is converted to the
imaginary component. If @var{Y} is not present then the imaginary component is
set to 0.0. If @var{X} is complex then @var{Y} must not be present.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{C = DCMPLX(X)}
@code{C = DCMPLX(X,Y)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type may be @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}.
@item @var{Y} @tab Optional if @var{X} is not @code{COMPLEX(*)}. May be @code{INTEGER(*)} or @code{REAL(*)}.
@end multitable
@item @emph{Return value}:
The return value is of type @code{COMPLEX(8)}
@item @emph{Example}:
@smallexample
program test_dcmplx
integer :: i = 42
real :: x = 3.14
complex :: z
z = cmplx(i, x)
print *, dcmplx(i)
print *, dcmplx(x)
print *, dcmplx(z)
print *, dcmplx(x,i)
end program test_dcmplx
@end smallexample
@end table
@node DFLOAT
@section @code{DFLOAT} --- Double conversion function
@findex @code{DFLOAT} intrinsic
@cindex double float conversion
@table @asis
@item @emph{Description}:
@code{DFLOAT(X)} Converts @var{X} to double precision real type.
@code{DFLOAT} is an alias for @code{DBLE}. See @code{DBLE}.
@end table
@node DIGITS
@section @code{DIGITS} --- Significant digits function
@findex @code{DIGITS} intrinsic
@cindex digits, significant
@table @asis
@item @emph{Description}:
@code{DIGITS(X)} returns the number of significant digits of the internal model
representation of @var{X}. For example, on a system using a 32-bit
floating point representation, a default real number would likely return 24.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
inquiry function
@item @emph{Syntax}:
@code{C = DIGITS(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type may be @code{INTEGER(*)} or @code{REAL(*)}.
@end multitable
@item @emph{Return value}:
The return value is of type @code{INTEGER}.
@item @emph{Example}:
@smallexample
program test_digits
integer :: i = 12345
real :: x = 3.143
real(8) :: y = 2.33
print *, digits(i)
print *, digits(x)
print *, digits(y)
end program test_digits
@end smallexample
@end table
@node DIM
@section @code{DIM} --- Dim function
@findex @code{DIM} intrinsic
@findex @code{IDIM} intrinsic
@findex @code{DDIM} intrinsic
@cindex dim
@table @asis
@item @emph{Description}:
@code{DIM(X,Y)} returns the difference @code{X-Y} if the result is positive;
otherwise returns zero.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{X = DIM(X,Y)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type shall be @code{INTEGER(*)} or @code{REAL(*)}
@item @var{Y} @tab The type shall be the same type and kind as @var{X}.
@end multitable
@item @emph{Return value}:
The return value is of type @code{INTEGER(*)} or @code{REAL(*)}.
@item @emph{Example}:
@smallexample
program test_dim
integer :: i
real(8) :: x
i = dim(4, 15)
x = dim(4.345_8, 2.111_8)
print *, i
print *, x
end program test_dim
@end smallexample
@item @emph{Specific names}:
@multitable @columnfractions .24 .24 .24 .24
@item Name @tab Argument @tab Return type @tab Option
@item @code{IDIM(X,Y)} @tab @code{INTEGER(4) X,Y} @tab @code{INTEGER(4)} @tab gnu
@item @code{DDIM(X,Y)} @tab @code{REAL(8) X,Y} @tab @code{REAL(8)} @tab gnu
@end multitable
@end table
@node DOT_PRODUCT
@section @code{DOT_PRODUCT} --- Dot product function
@findex @code{DOT_PRODUCT} intrinsic
@cindex Dot product
@table @asis
@item @emph{Description}:
@code{DOT_PRODUCT(X,Y)} computes the dot product multiplication of two vectors
@var{X} and @var{Y}. The two vectors may be either numeric or logical
and must be arrays of rank one and of equal size. If the vectors are
@code{INTEGER(*)} or @code{REAL(*)}, the result is @code{SUM(X*Y)}. If the
vectors are @code{COMPLEX(*)}, the result is @code{SUM(CONJG(X)*Y)}. If the
vectors are @code{LOGICAL}, the result is @code{ANY(X.AND.Y)}.
@item @emph{Option}:
f95
@item @emph{Class}:
transformational function
@item @emph{Syntax}:
@code{S = DOT_PRODUCT(X,Y)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type shall be numeric or @code{LOGICAL}, rank 1.
@item @var{Y} @tab The type shall be numeric or @code{LOGICAL}, rank 1.
@end multitable
@item @emph{Return value}:
If the arguments are numeric, the return value is a scaler of numeric type,
@code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}. If the arguments are
@code{LOGICAL}, the return value is @code{.TRUE.} or @code{.FALSE.}.
@item @emph{Example}:
@smallexample
program test_dot_prod
integer, dimension(3) :: a, b
a = (/ 1, 2, 3 /)
b = (/ 4, 5, 6 /)
print '(3i3)', a
print *
print '(3i3)', b
print *
print *, dot_product(a,b)
end program test_dot_prod
@end smallexample
@end table
@node DPROD
@section @code{DPROD} --- Double product function
@findex @code{DPROD} intrinsic
@cindex Double product
@table @asis
@item @emph{Description}:
@code{DPROD(X,Y)} returns the product @code{X*Y}.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{D = DPROD(X,Y)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type shall be @code{REAL}.
@item @var{Y} @tab The type shall be @code{REAL}.
@end multitable
@item @emph{Return value}:
The return value is of type @code{REAL(8)}.
@item @emph{Example}:
@smallexample
program test_dprod
integer :: i
real :: x = 5.2
real :: y = 2.3
real(8) :: d
d = dprod(x,y)
print *, d
end program test_dprod
@end smallexample
@end table
@node DREAL
@section @code{DREAL} --- Double real part function
@findex @code{DREAL} intrinsic
@cindex Double real part
@table @asis
@item @emph{Description}:
@code{DREAL(Z)} returns the real part of complex variable @var{Z}.
@item @emph{Option}:
gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{D = DREAL(Z)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{Z} @tab The type shall be @code{COMPLEX(8)}.
@end multitable
@item @emph{Return value}:
The return value is of type @code{REAL(8)}.
@item @emph{Example}:
@smallexample
program test_dreal
complex(8) :: z = (1.3_8,7.2_8)
print *, dreal(z)
end program test_dreal
@end smallexample
@end table
@node DTIME
@section @code{DTIME} --- Execution time subroutine (or function)
@findex @code{DTIME} intrinsic
@cindex dtime subroutine
@table @asis
@item @emph{Description}:
@code{DTIME(TARRAY, RESULT)} initially returns the number of seconds of runtime
since the start of the process's execution in @var{RESULT}. @var{TARRAY}
returns the user and system components of this time in @code{TARRAY(1)} and
@code{TARRAY(2)} respectively. @var{RESULT} is equal to @code{TARRAY(1) +
TARRAY(2)}.
Subsequent invocations of @code{DTIME} return values accumulated since the
previous invocation.
On some systems, the underlying timings are represented using types with
sufficiently small limits that overflows (wraparounds) are possible, such as
32-bit types. Therefore, the values returned by this intrinsic might be, or
become, negative, or numerically less than previous values, during a single
run of the compiled program.
If @code{DTIME} is invoked as a function, it can not be invoked as a
subroutine, and vice versa.
@var{TARRAY} and @var{RESULT} are @code{INTENT(OUT)} and provide the following:
@multitable @columnfractions .15 .30 .60
@item @tab @code{TARRAY(1)}: @tab User time in seconds.
@item @tab @code{TARRAY(2)}: @tab System time in seconds.
@item @tab @code{RESULT}: @tab Run time since start in seconds.
@end multitable
@item @emph{Option}:
gnu
@item @emph{Class}:
subroutine
@item @emph{Syntax}:
@multitable @columnfractions .80
@item @code{CALL DTIME(TARRAY, RESULT)}.
@item @code{RESULT = DTIME(TARRAY)}, (not recommended).
@end multitable
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{TARRAY}@tab The type shall be @code{REAL, DIMENSION(2)}.
@item @var{RESULT}@tab The type shall be @code{REAL}.
@end multitable
@item @emph{Return value}:
Elapsed time in seconds since the start of program execution.
@item @emph{Example}:
@smallexample
program test_dtime
integer(8) :: i, j
real, dimension(2) :: tarray
real :: result
call dtime(tarray, result)
print *, result
print *, tarray(1)
print *, tarray(2)
do i=1,100000000 ! Just a delay
j = i * i - i
end do
call dtime(tarray, result)
print *, result
print *, tarray(1)
print *, tarray(2)
end program test_dtime
@end smallexample
@end table
@node EOSHIFT
@section @code{EOSHIFT} --- End-off shift function
@findex @code{EOSHIFT} intrinsic
@cindex eoshift intrinsic
@table @asis
@item @emph{Description}:
@code{EOSHIFT(ARRAY, SHIFT[,BOUNDARY, DIM])} performs an end-off shift on
elements of @var{ARRAY} along the dimension of @var{DIM}. If @var{DIM} is
omitted it is taken to be @code{1}. @var{DIM} is a scaler of type
@code{INTEGER} in the range of @math{1 /leq DIM /leq n)} where @math{n} is the
rank of @var{ARRAY}. If the rank of @var{ARRAY} is one, then all elements of
@var{ARRAY} are shifted by @var{SHIFT} places. If rank is greater than one,
then all complete rank one sections of @var{ARRAY} along the given dimension are
shifted. Elements shifted out one end of each rank one section are dropped. If
@var{BOUNDARY} is present then the corresponding value of from @var{BOUNDARY}
is copied back in the other end. If @var{BOUNDARY} is not present then the
following are copied in depending on the type of @var{ARRAY}.
@multitable @columnfractions .15 .80
@item @emph{Array Type} @tab @emph{Boundary Value}
@item Numeric @tab 0 of the type and kind of @var{ARRAY}.
@item Logical @tab @code{.FALSE.}.
@item Character(@var{len}) @tab @var{len} blanks.
@end multitable
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
transformational function
@item @emph{Syntax}:
@code{A = EOSHIFT(A, SHIFT[,BOUNDARY, DIM])}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{ARRAY} @tab May be any type, not scaler.
@item @var{SHIFT} @tab The type shall be @code{INTEGER}.
@item @var{BOUNDARY} @tab Same type as @var{ARRAY}.
@item @var{DIM} @tab The type shall be @code{INTEGER}.
@end multitable
@item @emph{Return value}:
Returns an array of same type and rank as the @var{ARRAY} argument.
@item @emph{Example}:
@smallexample
program test_eoshift
integer, dimension(3,3) :: a
a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /))
print '(3i3)', a(1,:)
print '(3i3)', a(2,:)
print '(3i3)', a(3,:)
a = EOSHIFT(a, SHIFT=(/1, 2, 1/), BOUNDARY=-5, DIM=2)
print *
print '(3i3)', a(1,:)
print '(3i3)', a(2,:)
print '(3i3)', a(3,:)
end program test_eoshift
@end smallexample
@end table
@node EPSILON
@section @code{EPSILON} --- Epsilon function
@findex @code{EPSILON} intrinsic
@cindex epsilon, significant
@table @asis
@item @emph{Description}:
@code{EPSILON(X)} returns a nearly negligible number relative to @code{1}.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
inquiry function
@item @emph{Syntax}:
@code{C = EPSILON(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type shall be @code{REAL(*)}.
@end multitable
@item @emph{Return value}:
The return value is of same type as the argument.
@item @emph{Example}:
@smallexample
program test_epsilon
real :: x = 3.143
real(8) :: y = 2.33
print *, EPSILON(x)
print *, EPSILON(y)
end program test_epsilon
@end smallexample
@end table
@node ERF
@section @code{ERF} --- Error function
@findex @code{ERF} intrinsic
@cindex error function
@table @asis
@item @emph{Description}:
@code{ERF(X)} computes the error function of @var{X}.
@item @emph{Option}:
gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{X = ERF(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
@end multitable
@item @emph{Return value}:
The return value is a scalar of type @code{REAL(*)} and it is positive
(@math{ - 1 \leq erf (x) \leq 1 }.
@item @emph{Example}:
@smallexample
program test_erf
real(8) :: x = 0.17_8
x = erf(x)
end program test_erf
@end smallexample
@item @emph{Specific names}:
@multitable @columnfractions .24 .24 .24 .24
@item Name @tab Argument @tab Return type @tab Option
@item @code{DERF(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab gnu
@end multitable
@end table
@node ERFC
@section @code{ERFC} --- Error function
@findex @code{ERFC} intrinsic
@cindex error function
@table @asis
@item @emph{Description}:
@code{ERFC(X)} computes the complementary error function of @var{X}.
@item @emph{Option}:
gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{X = ERFC(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
@end multitable
@item @emph{Return value}:
The return value is a scalar of type @code{REAL(*)} and it is positive
(@math{ 0 \leq erfc (x) \leq 2 }.
@item @emph{Example}:
@smallexample
program test_erfc
real(8) :: x = 0.17_8
x = erfc(x)
end program test_erfc
@end smallexample
@item @emph{Specific names}:
@multitable @columnfractions .24 .24 .24 .24
@item Name @tab Argument @tab Return type @tab Option
@item @code{DERFC(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab gnu
@end multitable
@end table
@node ETIME
@section @code{ETIME} --- Execution time subroutine (or function)
@findex @code{ETIME} intrinsic
@cindex ETIME subroutine
@table @asis
@item @emph{Description}:
@code{ETIME(TARRAY, RESULT)} returns the number of seconds of runtime
since the start of the process's execution in @var{RESULT}. @var{TARRAY}
returns the user and system components of this time in @code{TARRAY(1)} and
@code{TARRAY(2)} respectively. @var{RESULT} is equal to @code{TARRAY(1) + TARRAY(2)}.
On some systems, the underlying timings are represented using types with
sufficiently small limits that overflows (wraparounds) are possible, such as
32-bit types. Therefore, the values returned by this intrinsic might be, or
become, negative, or numerically less than previous values, during a single
run of the compiled program.
If @code{ETIME} is invoked as a function, it can not be invoked as a
subroutine, and vice versa.
@var{TARRAY} and @var{RESULT} are @code{INTENT(OUT)} and provide the following:
@multitable @columnfractions .15 .30 .60
@item @tab @code{TARRAY(1)}: @tab User time in seconds.
@item @tab @code{TARRAY(2)}: @tab System time in seconds.
@item @tab @code{RESULT}: @tab Run time since start in seconds.
@end multitable
@item @emph{Option}:
gnu
@item @emph{Class}:
subroutine
@item @emph{Syntax}:
@multitable @columnfractions .8
@item @code{CALL ETIME(TARRAY, RESULT)}.
@item @code{RESULT = ETIME(TARRAY)}, (not recommended).
@end multitable
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{TARRAY}@tab The type shall be @code{REAL, DIMENSION(2)}.
@item @var{RESULT}@tab The type shall be @code{REAL}.
@end multitable
@item @emph{Return value}:
Elapsed time in seconds since the start of program execution.
@item @emph{Example}:
@smallexample
program test_etime
integer(8) :: i, j
real, dimension(2) :: tarray
real :: result
call ETIME(tarray, result)
print *, result
print *, tarray(1)
print *, tarray(2)
do i=1,100000000 ! Just a delay
j = i * i - i
end do
call ETIME(tarray, result)
print *, result
print *, tarray(1)
print *, tarray(2)
end program test_etime
@end smallexample
@end table
@node EXIT
@section @code{EXIT} --- Exit the program with status.
@findex @code{EXIT}
@cindex exit
@table @asis
@item @emph{Description}:
@code{EXIT} causes immediate termination of the program with status. If status
is omitted it returns the canonical @emph{success} for the system. All Fortran
I/O units are closed.
@item @emph{Option}:
gnu
@item @emph{Class}:
non-elemental subroutine
@item @emph{Syntax}:
@code{CALL EXIT([STATUS])}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{STATUS} @tab The type of the argument shall be @code{INTEGER(*)}.
@end multitable
@item @emph{Return value}:
@code{STATUS} is passed to the parent process on exit.
@item @emph{Example}:
@smallexample
program test_exit
integer :: STATUS = 0
print *, 'This program is going to exit.'
call EXIT(STATUS)
end program test_exit
@end smallexample
@end table
@node EXP
@section @code{EXP} --- Exponential function
@findex @code{EXP} intrinsic
@findex @code{DEXP} intrinsic
@findex @code{ZEXP} intrinsic
@findex @code{CDEXP} intrinsic
@cindex exponential
@table @asis
@item @emph{Description}:
@code{EXP(X)} computes the base @math{e} exponential of @var{X}.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{X = EXP(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type shall be @code{REAL(*)} or
@code{COMPLEX(*)}.
@end multitable
@item @emph{Return value}:
The return value has same type and kind as @var{X}.
@item @emph{Example}:
@smallexample
program test_exp
real :: x = 1.0
x = exp(x)
end program test_exp
@end smallexample
@item @emph{Specific names}:
@multitable @columnfractions .24 .24 .24 .24
@item Name @tab Argument @tab Return type @tab Option
@item @code{DEXP(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
@item @code{CEXP(X)} @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab f95, gnu
@item @code{ZEXP(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
@item @code{CDEXP(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
@end multitable
@end table
@node EXPONENT
@section @code{EXPONENT} --- Exponent function
@findex @code{EXPONENT} intrinsic
@cindex exponent function
@table @asis
@item @emph{Description}:
@code{EXPONENT(X)} returns the value of the exponent part of @var{X}. If @var{X}
is zero the value returned is zero.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{I = EXPONENT(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type shall be @code{REAL(*)}.
@end multitable
@item @emph{Return value}:
The return value is of type default @code{INTEGER}.
@item @emph{Example}:
@smallexample
program test_exponent
real :: x = 1.0
integer :: i
i = exponent(x)
print *, i
print *, exponent(0.0)
end program test_exponent
@end smallexample
@end table
@node FLOOR
@section @code{FLOOR} --- Integer floor function
@findex @code{FLOOR} intrinsic
@cindex floor
@table @asis
@item @emph{Description}:
@code{FLOOR(X)} returns the greatest integer less than or equal to @var{X}.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{I = FLOOR(X[,KIND])}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type shall be @code{REAL(*)}.
@item @var{KIND} @tab Optional scaler integer initialization expression.
@end multitable
@item @emph{Return value}:
The return value is of type @code{INTEGER(KIND)}
@item @emph{Example}:
@smallexample
program test_floor
real :: x = 63.29
real :: y = -63.59
print *, floor(x) ! returns 63
print *, floor(y) ! returns -64
end program test_floor
@end smallexample
@end table
@node FNUM
@section @code{FNUM} --- File number function
@findex @code{FNUM} intrinsic
@cindex fnum
@table @asis
@item @emph{Description}:
@code{FNUM(UNIT)} returns the Posix file descriptor number corresponding to the
open Fortran I/O unit @code{UNIT}.
@item @emph{Option}:
gnu
@item @emph{Class}:
non-elemental function
@item @emph{Syntax}:
@code{I = FNUM(UNIT)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{UNIT} @tab The type shall be @code{INTEGER}.
@end multitable
@item @emph{Return value}:
The return value is of type @code{INTEGER}
@item @emph{Example}:
@smallexample
program test_fnum
integer :: i
open (unit=10, status = "scratch")
i = fnum(10)
print *, i
close (10)
end program test_fnum
@end smallexample
@end table
@node LOC
@section @code{LOC} --- Returns the address of a variable
@findex @code{LOC} intrinsic
@cindex loc
@table @asis
@item @emph{Description}:
@code{LOC(X)} returns the address of @var{X} as an integer.
@item @emph{Option}:
gnu
@item @emph{Class}:
inquiry function
@item @emph{Syntax}:
@code{I = LOC(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab Variable of any type.
@end multitable
@item @emph{Return value}:
The return value is of type @code{INTEGER(n)}, where @code{n} is the
size (in bytes) of a memory address on the target machine.
@item @emph{Example}:
@smallexample
program test_loc
integer :: i
real :: r
i = loc(r)
print *, i
end program test_loc
@end smallexample
@end table
@node LOG
@section @code{LOG} --- Logarithm function
@findex @code{LOG} intrinsic
@findex @code{ALOG} intrinsic
@findex @code{DLOG} intrinsic
@findex @code{CLOG} intrinsic
@findex @code{ZLOG} intrinsic
@findex @code{CDLOG} intrinsic
@cindex logarithm
@table @asis
@item @emph{Description}:
@code{LOG(X)} computes the logarithm of @var{X}.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{X = LOG(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type shall be @code{REAL(*)} or
@code{COMPLEX(*)}.
@end multitable
@item @emph{Return value}:
The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}.
The kind type parameter is the same as @var{X}.
@item @emph{Example}:
@smallexample
program test_log
real(8) :: x = 1.0_8
complex :: z = (1.0, 2.0)
x = log(x)
z = log(z)
end program test_log
@end smallexample
@item @emph{Specific names}:
@multitable @columnfractions .24 .24 .24 .24
@item Name @tab Argument @tab Return type @tab Option
@item @code{ALOG(X)} @tab @code{REAL(4) X} @tab @code{REAL(4)} @tab f95, gnu
@item @code{DLOG(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
@item @code{CLOG(X)} @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab f95, gnu
@item @code{ZLOG(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
@item @code{CDLOG(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
@end multitable
@end table
@node LOG10
@section @code{LOG10} --- Base 10 logarithm function
@findex @code{LOG10} intrinsic
@findex @code{ALOG10} intrinsic
@findex @code{DLOG10} intrinsic
@cindex logarithm
@table @asis
@item @emph{Description}:
@code{LOG10(X)} computes the base 10 logarithm of @var{X}.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{X = LOG10(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type shall be @code{REAL(*)} or
@code{COMPLEX(*)}.
@end multitable
@item @emph{Return value}:
The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}.
The kind type parameter is the same as @var{X}.
@item @emph{Example}:
@smallexample
program test_log10
real(8) :: x = 10.0_8
x = log10(x)
end program test_log10
@end smallexample
@item @emph{Specific names}:
@multitable @columnfractions .24 .24 .24 .24
@item Name @tab Argument @tab Return type @tab Option
@item @code{ALOG10(X)} @tab @code{REAL(4) X} @tab @code{REAL(4)} @tab f95, gnu
@item @code{DLOG10(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
@end multitable
@end table
@node REAL
@section @code{REAL} --- Convert to real type
@findex @code{REAL} intrinsic
@findex @code{REALPART} intrinsic
@cindex true values
@table @asis
@item @emph{Description}:
@code{REAL(X [, KIND])} converts its argument @var{X} to a real type. The
@code{REALPART(X)} function is provided for compatibility with @command{g77},
and its use is strongly discouraged.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
transformational function
@item @emph{Syntax}:
@multitable @columnfractions .30 .80
@item @code{X = REAL(X)}
@item @code{X = REAL(X, KIND)}
@item @code{X = REALPART(Z)}
@end multitable
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab shall be @code{INTEGER(*)}, @code{REAL(*)}, or
@code{COMPLEX(*)}.
@item @var{KIND} @tab (Optional) @var{KIND} shall be a scalar integer.
@end multitable
@item @emph{Return value}:
These functions return the a @code{REAL(*)} variable or array under
the following rules:
@table @asis
@item (A)
@code{REAL(X)} is converted to a default real type if @var{X} is an
integer or real variable.
@item (B)
@code{REAL(X)} is converted to a real type with the kind type parameter
of @var{X} if @var{X} is a complex variable.
@item (C)
@code{REAL(X, KIND)} is converted to a real type with kind type
parameter @var{KIND} if @var{X} is a complex, integer, or real
variable.
@end table
@item @emph{Example}:
@smallexample
program test_real
complex :: x = (1.0, 2.0)
print *, real(x), real(x,8), realpart(x)
end program test_real
@end smallexample
@end table
@node SIN
@section @code{SIN} --- Sine function
@findex @code{SIN} intrinsic
@findex @code{DSIN} intrinsic
@findex @code{ZSIN} intrinsic
@findex @code{CDSIN} intrinsic
@cindex sine
@table @asis
@item @emph{Description}:
@code{SIN(X)} computes the sine of @var{X}.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{X = SIN(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type shall be @code{REAL(*)} or
@code{COMPLEX(*)}.
@end multitable
@item @emph{Return value}:
The return value has same type and king than @var{X}.
@item @emph{Example}:
@smallexample
program test_sin
real :: x = 0.0
x = sin(x)
end program test_sin
@end smallexample
@item @emph{Specific names}:
@multitable @columnfractions .24 .24 .24 .24
@item Name @tab Argument @tab Return type @tab Option
@item @code{DSIN(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
@item @code{CSIN(X)} @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab f95, gnu
@item @code{ZSIN(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
@item @code{CDSIN(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
@end multitable
@end table
@node SINH
@section @code{SINH} --- Hyperbolic sine function
@findex @code{SINH} intrinsic
@findex @code{DSINH} intrinsic
@cindex hyperbolic sine
@table @asis
@item @emph{Description}:
@code{SINH(X)} computes the hyperbolic sine of @var{X}.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{X = SINH(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type shall be @code{REAL(*)}.
@end multitable
@item @emph{Return value}:
The return value is of type @code{REAL(*)}.
@item @emph{Example}:
@smallexample
program test_sinh
real(8) :: x = - 1.0_8
x = sinh(x)
end program test_sinh
@end smallexample
@item @emph{Specific names}:
@multitable @columnfractions .24 .24 .24 .24
@item Name @tab Argument @tab Return type @tab Option
@item @code{DSINH(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
@end multitable
@end table
@node SQRT
@section @code{SQRT} --- Square-root function
@findex @code{SQRT} intrinsic
@findex @code{DSQRT} intrinsic
@findex @code{CSQRT} intrinsic
@findex @code{ZSQRT} intrinsic
@findex @code{CDSQRT} intrinsic
@cindex square-root
@table @asis
@item @emph{Description}:
@code{SQRT(X)} computes the square root of @var{X}.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{X = SQRT(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type shall be @code{REAL(*)} or
@code{COMPLEX(*)}.
@end multitable
@item @emph{Return value}:
The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}.
The kind type parameter is the same as @var{X}.
@item @emph{Example}:
@smallexample
program test_sqrt
real(8) :: x = 2.0_8
complex :: z = (1.0, 2.0)
x = sqrt(x)
z = sqrt(z)
end program test_sqrt
@end smallexample
@item @emph{Specific names}:
@multitable @columnfractions .24 .24 .24 .24
@item Name @tab Argument @tab Return type @tab Option
@item @code{DSQRT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
@item @code{CSQRT(X)} @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab f95, gnu
@item @code{ZSQRT(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
@item @code{CDSQRT(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
@end multitable
@end table
@node TAN
@section @code{TAN} --- Tangent function
@findex @code{TAN} intrinsic
@findex @code{DTAN} intrinsic
@cindex tangent
@table @asis
@item @emph{Description}:
@code{TAN(X)} computes the tangent of @var{X}.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{X = TAN(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type shall be @code{REAL(*)}.
@end multitable
@item @emph{Return value}:
The return value is of type @code{REAL(*)}. The kind type parameter is
the same as @var{X}.
@item @emph{Example}:
@smallexample
program test_tan
real(8) :: x = 0.165_8
x = tan(x)
end program test_tan
@end smallexample
@item @emph{Specific names}:
@multitable @columnfractions .24 .24 .24 .24
@item Name @tab Argument @tab Return type @tab Option
@item @code{DTAN(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
@end multitable
@end table
@node TANH
@section @code{TANH} --- Hyperbolic tangent function
@findex @code{TANH} intrinsic
@findex @code{DTANH} intrinsic
@cindex hyperbolic tangent
@table @asis
@item @emph{Description}:
@code{TANH(X)} computes the hyperbolic tangent of @var{X}.
@item @emph{Option}:
f95, gnu
@item @emph{Class}:
elemental function
@item @emph{Syntax}:
@code{X = TANH(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .80
@item @var{X} @tab The type shall be @code{REAL(*)}.
@end multitable
@item @emph{Return value}:
The return value is of type @code{REAL(*)} and lies in the range
@math{ - 1 \leq tanh(x) \leq 1 }.
@item @emph{Example}:
@smallexample
program test_tanh
real(8) :: x = 2.1_8
x = tanh(x)
end program test_tanh
@end smallexample
@item @emph{Specific names}:
@multitable @columnfractions .24 .24 .24 .24
@item Name @tab Argument @tab Return type @tab Option
@item @code{DTANH(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
@end multitable
@end table
@comment sub flush
@comment
@comment gen fraction
@comment
@comment gen fstat
@comment sub fstat
@comment
@comment sub getarg
@comment
@comment gen getcwd
@comment sub getcwd
@comment
@comment sub getenv
@comment
@comment gen getgid
@comment
@comment gen getpid
@comment
@comment gen getuid
@comment
@comment sub get_command
@comment
@comment sub get_command_argument
@comment
@comment sub get_environment_variable
@comment
@comment gen huge
@comment
@comment gen iachar
@comment
@comment gen iand
@comment
@comment gen iargc
@comment
@comment gen ibclr
@comment
@comment gen ibits
@comment
@comment gen ibset
@comment
@comment gen ichar
@comment
@comment gen ieor
@comment
@comment gen index
@comment
@comment gen int
@comment ifix
@comment idint
@comment
@comment gen ior
@comment
@comment gen irand
@comment
@comment gen ishft
@comment
@comment gen ishftc
@comment
@comment gen kind
@comment
@comment gen lbound
@comment
@comment gen len
@comment
@comment gen len_trim
@comment
@comment gen lge
@comment
@comment gen lgt
@comment
@comment gen lle
@comment
@comment gen llt
@comment
@comment gen logical
@comment
@comment gen matmul
@comment
@comment gen max
@comment max0
@comment amax0
@comment amax1
@comment max1
@comment dmax1
@comment
@comment gen maxexponent
@comment
@comment gen maxloc
@comment
@comment gen maxval
@comment
@comment gen merge
@comment
@comment gen min
@comment min0
@comment amin0
@comment amin1
@comment min1
@comment dmin1
@comment
@comment gen minexponent
@comment
@comment gen minloc
@comment
@comment gen minval
@comment
@comment gen mod
@comment amod
@comment dmod
@comment
@comment gen modulo
@comment
@comment sub mvbits
@comment
@comment gen nearest
@comment
@comment gen nint
@comment idnint
@comment
@comment gen not
@comment
@comment gen null
@comment
@comment gen pack
@comment
@comment gen precision
@comment
@comment gen present
@comment
@comment gen product
@comment
@comment gen radix
@comment
@comment gen rand
@comment ran
@comment
@comment sub random_number
@comment
@comment sub random_seed
@comment
@comment gen range
@comment
@comment gen real
@comment float
@comment sngl
@comment
@comment gen repeat
@comment
@comment gen reshape
@comment
@comment gen rrspacing
@comment
@comment gen scale
@comment
@comment gen scan
@comment
@comment gen second
@comment sub second
@comment
@comment gen selected_int_kind
@comment
@comment gen selected_real_kind
@comment
@comment gen set_exponent
@comment
@comment gen shape
@comment
@comment gen sign
@comment isign
@comment dsign
@comment
@comment gen size
@comment
@comment gen spacing
@comment
@comment gen spread
@comment
@comment sub srand
@comment
@comment gen stat
@comment sub stat
@comment
@comment gen sum
@comment
@comment gen system
@comment sub system
@comment
@comment sub system_clock
@comment
@comment gen tiny
@comment
@comment gen transfer
@comment
@comment gen transpose
@comment
@comment gen trim
@comment
@comment gen ubound
@comment
@comment gen umask
@comment sub umask
@comment
@comment gen unlink
@comment sub unlink
@comment
@comment gen unpack
@comment
@comment gen verify
|