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
|
SUBROUTINE POLAR
C.. 6/13/91
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
INCLUDE 'SIZES'
C**********************************************************************
C
C POLAR SETS UP THE CALCULATION OF THE MOLECULAR ELECTRIC RESPONSE
C PROPERTIES BY FFHPOL.
C
C**********************************************************************
CHARACTER*2 ELEMNT
DIMENSION X1(MAXORB,MAXORB), X2(MAXORB,MAXORB), X3(MAXORB,MAXORB)
DIMENSION X4(MAXORB,MAXORB), X5(MAXORB,MAXORB), X6(MAXORB,MAXORB)
DIMENSION X7(MAXORB,MAXORB), X8(MAXORB,MAXORB), X9(MAXORB,MAXORB)
DIMENSION X10(MAXORB,MAXORB),X11(MAXORB,MAXORB),X12(MAXORB,MAXORB)
DIMENSION X13(MAXORB,MAXORB)
COMMON /WORK1/ X1,X2,X3,X4,X5,X6,X7,X8,X9,X10,
1 XDUMY(21*MPACK-10*MAXORB*MAXORB)
COMMON /WORK3/ X11,X12,XDUMY1(4*MPACK-2*MAXORB*MAXORB)
COMMON /SCRACH/ X13, XDUMY2(MAXPAR*MAXPAR-MAXORB*MAXORB)
C..
COMMON /TITLES/ KOMENT,TITLE
COMMON /POLVOL/ POLVOL(107)
COMMON /KEYWRD/ KEYWRD
COMMON /GEOKST/ NATOMS,LABELS(NUMATM),
1 NA(NUMATM),NB(NUMATM),NC(NUMATM)
COMMON /GEOVAR/ NVAR,LOC(2,MAXPAR),IDUMY,XPARAM(MAXPAR)
COMMON /SCFTYP/ EMIN,LIMSCF
COMMON /TIMCOM/ TIME0
COMMON /ELEMTS/ ELEMNT(107)
COMMON /CORE / CORE(107)
COMMON /MOLKST/ NUMAT,NAT(NUMATM),NFIRST(NUMATM),NMIDLE(NUMATM),
1 NLAST(NUMATM), NORBS, NELECS,NALPHA,NBETA,
2 NCLOSE,NOPEN,NDUMY,FRACT
COMMON /GEOSYM/ NDEP, LOCPAR(MAXPAR), IDEPFN(MAXPAR),
1 LOCDEP(MAXPAR)
COMMON /GEOM / GEO(3,NUMATM), COORD(3,NUMATM)
COMMON /LAST / LAST
COMMON /EULER / TVEC(3,3),IDTVEC
COMMON /OMVAL/ OMEGA
COMMON /CHANEL/ IFILES(30)
EQUIVALENCE(IW,IFILES(6)), (IR,IFILES(5))
DIMENSION GRAD(MAXPAR),ROTVEC(3,3), TEMPV(3,3), DATAEV(10)
1,VALUE(40)
CHARACTER KEYWRD*241, TYPE*7, KOMENT*81, TITLE*81
CHARACTER POLKEY*241, LINE*80
LOGICAL LET, LIMSCF
LIMSCF=.FALSE.
TYPE=' MNDO '
LET=(INDEX(KEYWRD,'LET').NE.0)
IF(INDEX(KEYWRD,'MINDO') .NE. 0) TYPE='MINDO/3'
IF(INDEX(KEYWRD,'AM1') .NE. 0) TYPE=' AM1 '
WRITE(6,10)
10 FORMAT('1',20('*'),' TDHF POLARIZABILITIES ',
1 20('*'),//)
CALL GMETRY(GEO,COORD)
C
C ORIENT THE MOLECULE WITH THE MOMENTS OF INERTIA.
C THIS IS DONE TO ENSURE A UNIQUE, REPRODUCEABLE SET OF DIRECTIONS.
C IF LET IS SPECIFIED, THE INPUT ORIENTATION WILL BE USED.
C
IF (.NOT.LET) THEN
MASS = 1
CALL AXIS(COORD,NUMAT,A,B,C,SUMW,MASS,ROTVEC)
WRITE(6,20)
20 FORMAT (/' ROTATION MATRIX FOR ORIENTATION OF MOLECULE:'/)
DO 40 I = 1,3
WRITE(6,30) (ROTVEC(I,J),J=1,3)
30 FORMAT(5X,3F12.6)
40 CONTINUE
C
C ROTATE ATOMS
C
DO 70 I = 1,NUMAT
DO 60 J = 1,3
SUM = 0.0D00
DO 50 K = 1,3
SUM = SUM + COORD(K,I)*ROTVEC(K,J)
50 CONTINUE
GEO(J,I) = SUM
60 CONTINUE
70 CONTINUE
DO 90 I = 1,NUMAT
DO 80 J = 1,3
COORD(J,I) = GEO(J,I)
80 CONTINUE
90 CONTINUE
WRITE(6,'(//10X,''CARTESIAN COORDINATES '',/)')
WRITE(6,'(4X,''NO.'',7X,''ATOM'',9X,''X'',
1 9X,''Y'',9X,''Z'',/)')
L=0
DO 100 I=1,NUMAT
IF(NAT(I).EQ.99.OR.NAT(I).EQ.107) GOTO 100
L=L+1
WRITE(6,'(I6,8X,A2,4X,3F10.4)')
1 L,ELEMNT(NAT(I)),(COORD(J,L),J=1,3)
100 CONTINUE
C
C IF POLYMER, ROTATE TVEC
C (BEWARE: THE POLYMER SECTIONS MAY NOT WORK YET)
C
IF (IDTVEC.GT.0) THEN
DO 130 I = 1,IDTVEC
DO 120 J = 1,3
SUM = 0.0D00
DO 110 K = 1,3
SUM = SUM + TVEC(K,I)*ROTVEC(K,J)
110 CONTINUE
TEMPV(J,I) = SUM
120 CONTINUE
130 CONTINUE
DO 150 I = 1,3
DO 140 J = 1,IDTVEC
TVEC(I,J) = TEMPV(I,J)
140 CONTINUE
150 CONTINUE
WRITE(6,160)((TVEC(J,I),J=1,3),I=1,IDTVEC)
160 FORMAT(/' NEW TRANSLATION VECTOR:'/,
1 ' ',3(3F15.5))
ENDIF
ENDIF
C
LAST=1
NA(1)=99
C
C SET UP THE VARIABLES IN XPARAM AND LOC, THESE ARE IN CARTESIAN
C COORDINATES.
C
NDEP=0
NUMAT=0
SUMX=0.D0
SUMY=0.D0
SUMZ=0.D0
DO 180 I=1,NATOMS
IF((LABELS(I).NE.99).AND.(LABELS(I).NE.107)) THEN
NUMAT=NUMAT+1
LABELS(NUMAT)=LABELS(I)
SUMX=SUMX+COORD(1,NUMAT)
SUMY=SUMY+COORD(2,NUMAT)
SUMZ=SUMZ+COORD(3,NUMAT)
DO 170 J=1,3
170 GEO(J,NUMAT)=COORD(J,NUMAT)
ENDIF
180 CONTINUE
SUMX=SUMX/NUMAT
SUMY=SUMY/NUMAT
SUMZ=SUMZ/NUMAT
SUMMAX=0.D0
ATPOL=0.D0
DO 190 I=1,NUMAT
IF (LABELS(I).NE.107) THEN
ATPOL=ATPOL+POLVOL(LABELS(I))
ENDIF
GEO(1,I)=GEO(1,I)-SUMX
IF(SUMMAX.LT.ABS(GEO(1,I))) SUMMAX=ABS(GEO(1,I))
GEO(2,I)=GEO(2,I)-SUMY
IF(SUMMAX.LT.ABS(GEO(2,I))) SUMMAX=ABS(GEO(2,I))
GEO(3,I)=GEO(3,I)-SUMZ
IF(SUMMAX.LT.ABS(GEO(3,I))) SUMMAX=ABS(GEO(3,I))
190 CONTINUE
C
NVAR=0
NATOMS = NUMAT
CALL COMPFG(GEO, .TRUE., HEAT0, .TRUE., GRAD, .FALSE.)
WRITE(6,200) HEAT0
200 FORMAT(//' ENERGY OF "REORIENTED" SYSTEM WITHOUT FIELD:',
1 F20.10)
C...............................................................
C
C VARIABLES USED FOR TIME-DEPENDENT CALCULATIONS
C
C OMEGA ......... FREQUENCY OF LIGHT (ACTUALLY INPUT AS ENERGY
C IN EV'S.
C IWFLA ......... TYPE OF ALPHA CALCULATION FOR STORING MATRICES
C 0 = STATIC
C 1 = OMEGA
C 2 = 2*OMEGA
C 3 = 3*OMEGA
C IWFLB ......... TYPE OF BETA CALCULATION FOR STORING MATRICES
C 0 = (0,0)
C 1 = (W,W) (SHG)
C 2 = (0,W) (EOPE)
C 3 = (W,-W) (OR)
C
C INPUT NUMBER OF FREQENCIES TO RUN
C
C IBET = 0 NO BETA CALC
C 1 ITERATIVE BETA
C -1 NONITER BETA (SHG)
C -2 NONITER EOPE
C -3 NONITER OR
C
C IGAM = 0 NO GAMMA CALC
C 1 THIRD HARMONIC GENERATION INPUT N,0,1,1
C 2 DC-EFISHG INPUT N,0,1,2
C 3 IDRI N,0,1,3
C 4 OKE N,0,1,4
C 5 DC EFIOR (NOT AVAILABLE)
C
READ(5,'(A)') LINE
CALL NUCHAR(LINE,VALUE,NVALUE)
IWFLB=VALUE(1)
IBET=VALUE(2)
IGAM=VALUE(3)
ATOL=VALUE(4)
MAXITU=VALUE(5)
MAXITA=VALUE(6)
BTOL=VALUE(7)
DO 220 I=1,3
220 DATAEV(I)=(I-1)*0.25D0
NFREQ=3
230 CONTINUE
IF (IGAM.NE.0) THEN
IBET = 1
ENDIF
WRITE(6,240) NFREQ,IWFLB,IBET,IGAM
240 FORMAT(//' NFREQ=',I3,' IWFLB=',I3,' IBET=',I3,' IGAM=',I3)
C
C ATOL IS THE MAXIMUM TOLERANCE IN MAKEUF AND BTOL IS THAT IN BMAKUF
C MAXITU IS THE MAXIMUM ITERATION IN BETAF AND MAXITA IS THE MAXIMUM
C ITERATION IN ALPHAF
C
C# READ(IR,*,END=99,ERR=99) ATOL,MAXITU,MAXITA,BTOL
WRITE(6,250) ATOL,BTOL,MAXITU,MAXITA
250 FORMAT(' ATOL=',D12.5,' BTOL=',D12.5,' MAXITU=',I5,
1 ' MAXITA=',I5)
C
C SET UP DIRECT ACCESS FILE FOR T-D MATRICES
CALL OPENDA(0)
C
C CALCULATE ALPHA AT STATIC VALUES
C
IF ((IWFLB .EQ. 2).OR.(IGAM .EQ. 2).OR.(IGAM.EQ.4).OR.
1 (IBET.LE.-2)) THEN
IWFLA = 0
OMEGA = 0.0D00
CALL ALPHAF(IWFLA,ATOL,MAXITA,X1,X2,X3,X4,X5,X6,X7)
ENDIF
IF (IGAM.EQ.4) THEN
IWFLB=0
CALL BETAF(IWFLB,MAXITU,BTOL,X1,X2,X3,X4,X5,X6,X7,X8,X9,X10,
1 X11,X12,X13)
ENDIF
C
C CALCULATE FREQUENCY DEPENDENT VALUES
C
DO 280 I = 1, NFREQ
C
C READ IN FREQ: ACTUALLY READ IN AS ENERGY IN EV.
C
OMEGA=DATAEV(I)
OMEGAU = OMEGA/27.2113961D+00
IF (OMEGA.LT.1.0D-8) THEN
WAVLEN = 999999.99D0
C# WRITE(6,401) OMEGA
WRITE(6,260)
260 FORMAT(//,' ',65(1H*),/,
1 ' CALCULATION OF STATIC FIELD QUANTITIES',/,
2 ' ',65('*'))
ELSE
WRITE(6,270) OMEGA,OMEGAU,1239.8424D0/OMEGA,
1 8065.541D0*OMEGA
270 FORMAT(//,' ',70(1H*),
1 /' CALCULATION FOR A FREQUENCY OF ',F10.5,' EV =',
2 F14.5,' A.U. '/18X,'WAVELENGTH OF ',F10.2,' NM =',
3 F14.5,' CM(-1)',/,
4 ' ',70('*'))
ENDIF
C
C CALCULATE ALPHA(W)
C
IWFLA = 1
CALL ALPHAF(IWFLA,ATOL,MAXITA,X1,X2,X3,X4,X5,X6,X7)
C
C PERFORM NONITERATIVE BETA CALCULATIONS
C
C OPTICAL RECTIFICATION
IF (IBET.EQ.-3) THEN
CALL NONOR(X1,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12)
ENDIF
C ELECTROPTIC POCKELS EFFECT
IF (IBET.EQ.-2) THEN
CALL NONOPE(X1,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12)
ENDIF
C SECOND HARMONIC GENERATION
IF (IBET.EQ.-1) THEN
IWFLA = 2
OMEGA = OMEGA*2.0D00
CALL ALPHAF(IWFLA,ATOL,MAXITA,X1,X2,X3,X4,X5,X6,X7)
OMEGA = OMEGA/2.0D00
CALL NONBET(X1,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12)
ENDIF
C
C PERFORM ITERATIVE BETA (SHG AND STATIC)CALCULATIONS
C
C IF ((IBET.GT.0) .AND.(IGAM .EQ. 0)) THEN
IF ((IBET.EQ.1) .AND. (IWFLB .LE. 1) .AND. (IGAM .EQ. 0)) THEN
CALL BETAF(IWFLB,MAXITU,BTOL,X1,X2,X3,X4,X5,X6,X7,X8,
1 X9,X10,X11,X12,X13)
C
C PERFORM ITERATIVE BETA (EOPE AND OR) CALCULATIONS
C
ELSEIF ((IBET.EQ.1).AND.(IWFLB.GT.1).AND.(IGAM.EQ.0)) THEN
CALL BEOPOR(IWFLB,MAXITU,BTOL,X1,X2,X3,X4,X5,X6,X7,X8,
1 X9,X10,X11,X12,X13)
ENDIF
C.......................................................................
C CALCULATE GAMMA VALUES
C.......................................................................
IF ((IBET.GT.0).AND.(IGAM .LE. 3).AND.(IGAM.NE.0)) THEN
IWFLB=1
CALL BETAF(IWFLB,MAXITU,BTOL,X1,X2,X3,X4,X5,X6,X7,X8,
1 X9,X10,X11,X12,X13)
ENDIF
C THIRD HARMONIC GENRATION
IF (IGAM.EQ.1) THEN
IWFLA = 3
OMEGA = OMEGA*3.0D00
CALL ALPHAF(IWFLA,ATOL,MAXITA,X1,X2,X3,X4,X5,X6,X7)
OMEGA = OMEGA/3.0D00
CALL NGAMTG(IGAM,X1,X2,X3,X4,X5,X6,X7,X8,X9)
ENDIF
C DC-EFISHG
IF (IGAM.EQ.2) THEN
IWFLA = 2
OMEGA = 2.0D00*OMEGA
CALL ALPHAF(IWFLA,ATOL,MAXITA,X1,X2,X3,X4,X5,X6,X7)
OMEGA = OMEGA/2.0D00
IWFLB = 2
CALL BEOPOR(IWFLB,MAXITU,BTOL,X1,X2,X3,X4,X5,X6,X7,X8,
1 X9,X10,X11,X12,X13)
CALL NGEFIS(IGAM,X1,X2,X3,X4,X5,X6,X7,X8,X9)
ENDIF
C IDRI
IF (IGAM.EQ.3) THEN
IWFLB=3
CALL BEOPOR(IWFLB,MAXITU,BTOL,X1,X2,X3,X4,X5,X6,X7,X8,
1 X9,X10,X11,X12,X13)
CALL NGIDRI(IGAM,X1,X2,X3,X4,X5,X6,X7,X8,X9)
ENDIF
C OKE
IF (IGAM.EQ.4) THEN
IWFLB=2
CALL BEOPOR(IWFLB,MAXITU,BTOL,X1,X2,X3,X4,X5,X6,X7,X8,
1 X9,X10,X11,X12,X13)
CALL NGOKE(IGAM,X1,X2,X3,X4,X5,X6,X7,X8,X9)
ENDIF
280 CONTINUE
C
RETURN
290 WRITE(6,'('' DATA FOR POLAR CALCULATION EITHER'',
1'' MISSING OR FAULTY'')')
RETURN
END
C
C=======================================================================
C
SUBROUTINE TF(UA,GA,UB,GB,T,NORBS,NCLOSE,IWFLB)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
C THIS SUBROUTINE CREATES THE NEW T MATRIX
C
DIMENSION UA(NORBS,NORBS),UB(NORBS,NORBS),
1 T(NORBS,NORBS),GA(NORBS,NORBS),
2 GB(NORBS,NORBS)
C
C ZERO MATRIX INITIALLY
C
CALL ZEROM(T,NORBS)
C
C CALCULATE T (IJ)(W,W)= SUM(GA(IK)(W)*UB(KJ)(W)+
C GB(IK)(W)*UA(KJ)(W)-UA(IK)(W)GB(KJ)(W)-UB(IK)(W)GA(KJ)(W)
C
DO 30 I = 1,NORBS
DO 20 J = 1,NORBS
SUM1=0.0D0
SUM2=0.0D0
DO 10 K = 1,NORBS
C CALCULATE FOR (W,W), (0,W) VALUES
C
SUM1 = SUM1+GA(I,K)*UB(K,J)+GB(I,K)*UA(K,J)
1 -UA(I,K)*GB(K,J)-UB(I,K)*GA(K,J)
SUM2 = SUM2+GA(J,K)*UB(K,I)+GB(J,K)*UA(K,I)
1 -UA(J,K)*GB(K,I)-UB(J,K)*GA(K,I)
10 CONTINUE
T(I,J) = SUM1
T(J,I) = SUM2
20 CONTINUE
30 CONTINUE
C
RETURN
END
SUBROUTINE TRANSF(F,G,C,NORB)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
C THIS SUBROUTINE FORMS THE G MATRIX BY TRANSFORMING F WITH C
C
DIMENSION C(NORB,NORB),F(NORB,NORB),G(NORB,NORB)
C
DO 40 I = 1,NORB
DO 30 J = 1,NORB
C IJ = I*(I-1)/2 + J
TERM2 = 0.0D00
DO 20 K = 1,NORB
TERM = 0.0D00
DO 10 L = 1,NORB
C KI = MAX0(K,L)
C LI = MIN0(K,L)
C KL = KI*(KI-1)/2 + LI
TERM = TERM + F(K,L)*C(L,J)
10 CONTINUE
TERM2 = TERM2 + TERM*C(K,I)
20 CONTINUE
G(I,J) = TERM2
30 CONTINUE
40 CONTINUE
RETURN
END
FUNCTION TRSUB(UL,X,UR,L1,LM,NDIM)
C THIS PROGRAM CALCULATES TRACES OF MATRICES
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
DIMENSION UL(NDIM,NDIM),X(NDIM,NDIM),UR(NDIM,NDIM)
C
SUM = 0.0D00
DO 30 I = 1,L1
DO 20 K = 1,LM
SUML = 0.0D00
DO 10 L = 1,LM
SUML = SUML + X(K,L)*UR(L,I)
10 CONTINUE
SUM = SUM + SUML*UL(I,K)
20 CONTINUE
30 CONTINUE
TRSUB = 2.0D00*SUM
RETURN
END
FUNCTION TRUDGU(UL,X,UR,L1,LM,NDIM)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
DIMENSION UL(NDIM,NDIM),X(NDIM,NDIM),UR(NDIM,NDIM)
C
SUM = 0.0D00
DO 30 I = 1,L1
DO 20 K = 1,LM
SUML = 0.0D00
DO 10 L = 1,LM
SUML = SUML + X(K,L)*UR(L,I)
10 CONTINUE
SUM = SUM + SUML*UL(K,I)
20 CONTINUE
30 CONTINUE
TRUDGU = 2.0D00*SUM
RETURN
END
FUNCTION TRUGDU(UL,X,UR,L1,LM,NDIM)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
DIMENSION UL(NDIM,NDIM),X(NDIM,NDIM),UR(NDIM,NDIM)
C
SUM = 0.0D00
DO 30 I = 1,L1
DO 20 K = 1,LM
SUML = 0.0D00
DO 10 L = 1,LM
SUML = SUML + X(L,K)*UR(L,I)
10 CONTINUE
SUM = SUM + SUML*UL(I,K)
20 CONTINUE
30 CONTINUE
TRUGDU = 2.0D00*SUM
RETURN
END
FUNCTION TRUGUD(UL,X,UR,L1,LM,NDIM)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
DIMENSION UL(NDIM,NDIM),X(NDIM,NDIM),UR(NDIM,NDIM)
C
SUM = 0.0D00
DO 30 I = 1,L1
DO 20 K = 1,LM
SUML = 0.0D00
DO 10 L = 1,LM
SUML = SUML + X(K,L)*UR(I,L)
10 CONTINUE
SUM = SUM + SUML*UL(I,K)
20 CONTINUE
30 CONTINUE
TRUGUD = 2.0D00*SUM
RETURN
END
SUBROUTINE ZEROM(X,M)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
C ZEROM ZEROS THE MATRIX X
C
DIMENSION X(M,M)
DO 20 I = 1,M
DO 10 J = 1,M
X(I,J) = 0.0D00
10 CONTINUE
20 CONTINUE
RETURN
END
SUBROUTINE ALPHAF (IWFLA,ATOL,MAXITA,U,F,G,UOLD,H1,D,DA)
C
C SUBROUTINE FOR THE CALCULATION OF THE FREQUENCY DEPENDENT FIRST-ORDER
C RESPONCE MATRICIES UA AND DENSITIES DA.
C USED TO COMPUTE THE FREQUENCY DEPENDENT POLARIZABILITY AND FOR
C SOLVING THE SECOND-ORDER PROBLEM.
C
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
LOGICAL LAST
INCLUDE 'SIZES'
C
COMMON /MOLKST/ NUMAT,NAT(NUMATM),NFIRST(NUMATM),NMIDLE(NUMATM),
1 NLAST(NUMATM),NORBS,NELECS,NALPHA,NBETA,
2 NCLOSE,NOPEN,NDUMY,FRACT
COMMON /VECTOR/ C(MORB2),EIGS(MAXORB),CA(MORB2),DUMY(MAXORB)
COMMON /WMATRX/ W(N2ELEC*2)
COMMON /GEOM / GEO(3,NUMATM), COORD(3,NUMATM)
COMMON /OMVAL/ OMEGA
COMMON /KEYWRD/ KEYWRD
CHARACTER*241 KEYWRD
COMMON /CHANEL/ IFILES(30)
EQUIVALENCE(IW,IFILES(6))
C
DIMENSION U(MAXORB,MAXORB), F(MAXORB,MAXORB), G(MAXORB,MAXORB)
DIMENSION UOLD(MAXORB,MAXORB), H1(MAXORB,MAXORB),
1 D(MAXORB,MAXORB),DA(MAXORB,MAXORB), ALLALP(3,3)
CHARACTER*1 ALAB
DIMENSION ALAB(3)
SAVE ALAB
DATA ALAB/'X','Y','Z'/
C
NSQR = NORBS*NORBS
ALPAVG = 0.0D00
C COMPUTE OFFSETS FOR U AND G MATRICES
IPOSU = 1 + 6*IWFLA
IPOSG = 4 + 6*IWFLA
WRITE(6,10) OMEGA
10 FORMAT (/,' +++++ ALPHA AT ',1F13.5,' EV.')
C
C CHOOSE A COMPONENT
C X: ID=1 Y: ID=2 Z: ID=3
C
DO 70 ID = 1,3
CMPTIM = SECOND()
LAST = .FALSE.
C
C CALCULATE THE DIPOLE MATRIX.
C
CALL HMUF (H1,ID,COORD,NFIRST,NLAST,NAT,NORBS,NUMAT)
CALL COPYM (H1,F,NORBS)
C
C INITIALIZE UOLD TO ZERO
C
CALL ZEROM (UOLD,NORBS)
C.................................................................
C LOOP STARTS HERE
C.................................................................
ICOUNT = 0
ALPOLD = 0.0D00
20 CONTINUE
ICOUNT = ICOUNT + 1
IF (ICOUNT.GT.MAXITA) LAST = .TRUE.
C
C CREATE G MATRIX.
C
CALL TRANSF (F,G,C,NORBS)
C
C FORM U MATRIX
C
CALL MAKEUF (U,UOLD,G,EIGS,LAST,NORBS,NNORB,NCLOSE,DIFF,ATOL)
C
C FORM NEW DENSITY MATRIX
C
CALL DENSF (U,C,CA,D,DA,NORBS,NCLOSE)
C
C COMPUTE TEST ALPHA TO BE USED FOR A CONVERGENCE TEST
C
ALPHAW = AVAL(H1,D,NORBS)
DELA = DABS(ALPOLD-ALPHAW)
ALPOLD = ALPHAW
C. WRITE(6,1500) ALPHAW
C. 1500 FORMAT (' TEST ALPHA = ',D12.5)
C
C CREATE NEW FOCK MATRIX
C
CALL ZEROM (F,NORBS)
CALL FFREQ2 (F,D,W,NUMAT,NFIRST,NLAST,NORBS)
CALL FFREQ1 (F,D,DA,DA,NORBS)
CALL HPLUSF (F,H1,NORBS)
C..............................................................
IF (.NOT.LAST) GO TO 20
CMPTIM = SECOND() - CMPTIM
WRITE(6,30) ICOUNT,CMPTIM,DIFF,DELA
30 FORMAT (/' CONVERGED IN',I4,' ITERATIONS IN',F10.2,' SECONDS',
1 /' DENSITY CONVERG. TO ',1PD12.5,
2 /' ALPHA CONVERG. TO ',1PD12.5,/)
C
C COMPUTE ALPHA
C
ALPHAW = AVAL(H1,D,NORBS)
ALLALP(ID,ID)=ALPHAW
WRITE(6,40) ALAB(ID),ALAB(ID),ALPHAW
40 FORMAT (' ALPHA(',A1,',',A1,') = ',1PD14.7)
ALPAVG = ALPAVG + ALPHAW
C
C WRITE OUT U AND G FOR FUTURE USE
C
CALL DAWRIT (U,NSQR,IPOSU+ID)
CALL DAWRIT (G,NSQR,IPOSG+ID)
C
C COMPUTE OTHER COMPONENTS
C
DO 60 IC = 1,3
IF (IC.NE.ID) THEN
CALL HMUF (H1,IC,COORD,NFIRST,NLAST,NAT,NORBS,NUMAT)
ALPHAW = AVAL(H1,D,NORBS)
ALLALP(IC,ID)=ALPHAW
WRITE(6,50) ALAB(IC),ALAB(ID),ALPHAW
50 FORMAT (' ALPHA(',A1,',',A1,') = ',1PD14.7)
ENDIF
60 CONTINUE
70 CONTINUE
ALPAVG = ALPAVG/3.0D00
WRITE(6,80) ALPAVG
80 FORMAT (/,' ISOTROPIC AVERAGE ALPHA = ',1F13.5,' A.U.')
C
RETURN
END
FUNCTION AVAL (H,D,NORBS)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C.................................................................
C COMPUTE POLARIZABILITY AS TRACE OF H*D
C.................................................................
DIMENSION H(NORBS,NORBS),D(NORBS,NORBS)
SUM = 0.0D00
DO 20 I = 1,NORBS
DO 10 J = 1,NORBS
SUM = SUM + H(I,J)*D(J,I)
10 CONTINUE
20 CONTINUE
AVAL = -SUM
RETURN
END
SUBROUTINE BDENSF (UA,UB,UAB,C,D,DA,NORBS,NCLOSE,IWFLB)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
COMMON /CHANEL/ IFILES(30)
EQUIVALENCE(IW,IFILES(6))
C
C THIS SUBROUTINE IS USED TO COMPUTE THE FIRST-ORDER DENSITY
C
DIMENSION C(NORBS,NORBS),D(NORBS,NORBS),UA(NORBS,NORBS),
1 UB(NORBS,NORBS),DA(NORBS,NORBS),UAB(NORBS,NORBS)
C
C FORM DENSITY MATRIX
C
C
CALL ZEROM(D,NORBS)
C
C CALCULATE
C
DO 100 I = 1,NORBS
DO 90 J = 1,NORBS
S1 = 0.0D00
S2 = 0.0D00
S3 = 0.0D00
S4 = 0.0D00
DO 20 K = 1,NORBS
DO 10 L = 1,NCLOSE
S1 = S1+C(I,K)*UAB(K,L)*C(J,L)
S2 = S2+C(I,L)*UAB(L,K)*C(J,K)
10 CONTINUE
20 CONTINUE
C
DO 50 K = 1,NCLOSE
DO 40 L= NCLOSE+1,NORBS
DO 30 M = 1,NCLOSE
S3 = S3+C(I,K)*(UA(K,L)*UB(L,M)+UB(K,L)*UA(L,M))*
1C(J,M)
30 CONTINUE
40 CONTINUE
50 CONTINUE
C
DO 80 K = NCLOSE+1,NORBS
DO 70 L = 1,NCLOSE
DO 60 M = NCLOSE+1, NORBS
S4 = S4+C(I,K)*(UA(K,L)*UB(L,M)+UB(K,L)*UA(L,M))*
1C(J,M)
60 CONTINUE
70 CONTINUE
80 CONTINUE
D(I,J) = 2.0D00*(S1-S2+S3-S4)
90 CONTINUE
100 CONTINUE
C WRITE(6,*) 'INITIAL DENSITY MATRIX FINAL FORM'
C CALL MATOUT(D,EIGS,NORBS,NORBS,NORBS)
C
C CREATE DA
C
DO 120 I = 1,NORBS
DO 110 J = 1,NORBS
DA(I,J) = D(I,J)/2.0D00
110 CONTINUE
120 CONTINUE
C
RETURN
END
SUBROUTINE BEOPOR(IWFLB,MAXITU,BTOL,UA,UB,F,GA,GB,T,H1,
1 D,DA,UAB,UOLD1,G,X)
C
C THIS SUBROUTINE CALCULATES ITERATIVE BETA VALUES FOR
C THE ELECTROOPTIC POCKELS EFFECT AND OPTICAL RECTIFICATION
C
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
DOUBLE PRECISION MAXU
LOGICAL LAST
INCLUDE 'SIZES'
C
COMMON /MOLKST/ NUMAT,NAT(NUMATM),NFIRST(NUMATM),NMIDLE(NUMATM),
1 NLAST(NUMATM),NORBS,NELECS,NALPHA,NBETA,
2 NCLOSE,NOPEN,NDUMY,FRACT
COMMON /VECTOR/ C(MORB2),EIGS(MAXORB),CA(MORB2),DUMY(MAXORB)
COMMON /WMATRX/ W(N2ELEC*2)
COMMON /GEOM / GEO(3,NUMATM), COORD(3,NUMATM)
COMMON /OMVAL/ OMEGA
COMMON /CHANEL/ IFILES(30)
EQUIVALENCE(IW,IFILES(6))
C
DIMENSION UA(MAXORB,MAXORB),UB(MAXORB,MAXORB),F(MAXORB,MAXORB),
1 GA(MAXORB,MAXORB),GB(MAXORB,MAXORB),
2 T(MAXORB,MAXORB), H1(MAXORB,MAXORB),
3 D(MAXORB,MAXORB),DA(MAXORB,MAXORB),
4 UAB(MAXORB,MAXORB),UOLD1(MAXORB,MAXORB),
5 G(MAXORB,MAXORB),X(MAXORB,MAXORB)
CHARACTER*1 ALAB
DIMENSION ALAB(3),IDA(9),IDB(9)
SAVE ALAB, IDA, IDB
DATA ALAB/'X','Y','Z'/
DATA IDA /1,1,1,2,2,2,3,3,3/
DATA IDB /1,2,3,1,2,3,1,2,3/
ONE=1.0D00
BETOLD = 0.0D00
MAXSQ = NORBS*NORBS
IF (IWFLB .EQ. 2) THEN
IPOSU = 73
ELSE
IPOSU = 109
ENDIF
IPOSG = IPOSU + 9
IPOSE = IPOSG + 9
IPOSUM = IPOSE + 9
IF (IWFLB .EQ. 0) THEN
WRITE(6,10) OMEGA
10 FORMAT(/,' +++++ BETA (STATIC) AT ',1F15.5 ,' EV.'/)
ELSEIF (IWFLB .EQ. 2) THEN
WRITE(6,20) OMEGA
20 FORMAT(/,' +++++ BETA',
1 ' (ELECTROOPTIC POCKELS EFFECT) AT ',1F15.5 ,' EV.'/)
ELSE
WRITE(6,30) OMEGA
30 FORMAT(/,' +++++ BETA',
1 ' (OPTICAL RECTIFICATION) AT ',1F15.5 ,' EV.'/)
ENDIF
C
C LOOP OVER COMPONENTS
C
BAVX = 0.0D+00
BAVY = 0.0D+00
BAVZ = 0.0D+00
DO 90 ID = 1,9
CMPTIM = SECOND()
IA=IDA(ID)
IB=IDB(ID)
LAST = .FALSE.
C
C CALCULATE THE DIPOLE MATRIX.
C
CALL HMUF(H1,IA,COORD,NFIRST,NLAST,NAT,NORBS,NUMAT)
C
C INITIALIZE ZERO ARRAYS
C
CALL ZEROM(UOLD1,NORBS)
CALL ZEROM(UAB,NORBS)
CALL ZEROM(F,NORBS)
C
C INPUT U AND GA FROM ALPHA CALCULATIONS
C
IF ((IWFLB .EQ. 2) .OR. (IWFLB .EQ. 0)) THEN
C UA CONTAINS UA(0)
JPU = 1 + IA
CALL DAREAD(UA,MAXSQ,JPU)
C GA CONTAINS GA(0)
JPG = 4 + IA
CALL DAREAD(GA,MAXSQ,JPG)
ELSE
C UA CONTAINS UA(W)
JPU = 7 + IA
CALL DAREAD(UA,MAXSQ,JPU)
C GA CONTAINS GA(W)
JPG = 10 + IA
CALL DAREAD(GA,MAXSQ,JPG)
ENDIF
C
C READ VALUES FOR (W,-W) CALCULATION : OR
C
IF (IWFLB .EQ. 3) THEN
C UB CONTAINS UB(-W) = -UB+(W)
JPU = 7 + IB
CALL DAREAD(X,MAXSQ,JPU)
CALL FHPATN(UB,X,NORBS,2,-ONE)
C GB CONTAINS GB(-W) = GB+(W)
JPG = 10 + IB
CALL DAREAD(X,MAXSQ,JPG)
CALL FHPATN(GB,X,NORBS,2,ONE)
C
C READ VALUES FOR (0,W) CALCULATION : OKE
C
ELSEIF (IWFLB .EQ. 0) THEN
C UB CONTAINS UB(0)
JPU = 1 + IB
CALL DAREAD(UB,MAXSQ,JPU)
C GB CONTAINS GB(0)
JPG = 4 + IB
CALL DAREAD(GB,MAXSQ,JPG)
ELSE
C UB CONTAINS UB(W)
JPU = 7 + IB
CALL DAREAD(UB,MAXSQ,JPU)
C GB CONTAINS GB(W)
JPG = 10 + IB
CALL DAREAD(GB,MAXSQ,JPG)
ENDIF
C
C CONSTRUCT T-MATRIX ONE TIME
C
CALL TF(UA,GA,UB,GB,T,NORBS,NCLOSE,IWFLB)
C
C CALCULATE INITIAL DENSITY AND BETA VALUE
C
CALL BDENSF(UA,UB,UAB,C,D,DA,NORBS,NCLOSE,IWFLB)
BETAW = AVAL(H1,D,NORBS)
DELA = DABS(BETOLD-BETAW)
BETOLD = BETAW
C
C INITIALIZE FOCK MATRIX
C
CALL FFREQ2(F,D,W,NUMAT,NFIRST,NLAST,NORBS)
CALL FFREQ1(F,D,DA,DA,NORBS)
CALL ZEROM(DA,NORBS)
CALL HPLUSF(F,DA,NORBS)
C.................................................................
C LOOP STARTS HERE
C.................................................................
ICOUNT = 0
40 CONTINUE
ICOUNT = ICOUNT + 1
IF (ICOUNT .GE. MAXITU) LAST = .TRUE.
C
C CREATE G MATRIX.
C
CALL TRANSF(F,G,C,NORBS)
C
C FORM U MATRIX
C
CALL BMAKUF(UA,UB,UAB,T,UOLD1,G,EIGS,LAST,NORBS,
1 NCLOSE,DIFF,IWFLB,MAXU,BTOL)
C
C FORM NEW DENSITY MATRIX
C
CALL BDENSF(UA,UB,UAB,C,D,DA,NORBS,NCLOSE,IWFLB)
C...
C COMPUTE TEST BETA
C
BETAW = AVAL(H1,D,NORBS)
DELA = DABS(BETOLD-BETAW)
BETOLD = BETAW
C IF (LAST.OR.(ICOUNT.GT.(MAXITU-5))) THEN
C WRITE(6,1500) ICOUNT,DELA,MAXU,DIFF
C 1500 FORMAT(' ',I4,' DELTA BETA = ', D12.5,
C X ' MAXU = ', D12.5, ' UDIFF = ', D12.5)
C ENDIF
C
C CREATE NEW FOCK MATRIX
C
CALL ZEROM(F,NORBS)
CALL FFREQ2(F,D,W,NUMAT,NFIRST,NLAST,NORBS)
CALL FFREQ1(F,D,DA,DA,NORBS)
CALL ZEROM(DA,NORBS)
CALL HPLUSF(F,DA,NORBS)
C..............................................................
IF (.NOT.LAST) GO TO 40
CMPTIM = SECOND() - CMPTIM
WRITE(6,50) ICOUNT,CMPTIM
50 FORMAT(/' CONVERGED IN',I4,' ITERATIONS IN',F10.2,
1 ' SECONDS')
WRITE(6,60) MAXU,DIFF
60 FORMAT(' MAXIMUM UAB ELEMENT =',1F15.5 ,
1 ', MAXIMUM DIFFERENCE =',1F15.5 ,/)
C
C COMPUTE OTHER COMPONENTS
C
DO 80 IC = 1,3
CALL HMUF(H1,IC,COORD,NFIRST,NLAST,NAT,NORBS,NUMAT)
BETAW = AVAL(H1,D,NORBS)
WRITE(6,70) ALAB(IC),ALAB(IA),ALAB(IB),BETAW
70 FORMAT(' BETA(',A1,',',A1,',',A1,') = ',1F15.5 )
C CALCULATES THE AVERAGE VALUE OF BETA
C
IF ((ID .EQ. 1) .AND. (IC .EQ. 1)) THEN
BAVX = BAVX + 3.0D0*BETAW
ELSEIF (((ID.EQ.5).OR.(ID.EQ.9)).AND. (IC .EQ. 1)) THEN
BAVX = BAVX + BETAW
ELSEIF (((ID.EQ.2).OR.(ID .EQ. 4)) .AND. (IC .EQ. 2)) THEN
BAVX = BAVX + BETAW
ELSEIF (((ID.EQ.3).OR.(ID .EQ. 7)) .AND. (IC .EQ. 3)) THEN
BAVX = BAVX + BETAW
ENDIF
C CALCULATES AVERAGE BETA IN Y-DIRECTION
C
IF ((ID .EQ. 5) .AND. (IC .EQ. 2)) THEN
BAVY = BAVY + 3.0D0*BETAW
ELSEIF (((ID.EQ.2).OR.(ID .EQ. 4)) .AND. (IC .EQ. 1)) THEN
BAVY = BAVY + BETAW
ELSEIF (((ID.EQ.1).OR.(ID .EQ. 9)) .AND. (IC .EQ. 2)) THEN
BAVY = BAVY + BETAW
ELSEIF (((ID.EQ.6).OR.(ID .EQ. 8)) .AND. (IC .EQ. 3)) THEN
BAVY = BAVY + BETAW
ENDIF
C CALCULATES AVERAGE BETA IN THE Z-DIRECTION
C
IF ((ID .EQ. 9) .AND. (IC .EQ. 3)) THEN
BAVZ = BAVZ + 3.0D0 * BETAW
ELSEIF (((ID.EQ.3).OR.(ID .EQ. 7)) .AND. (IC .EQ. 1)) THEN
BAVZ = BAVZ + BETAW
ELSEIF (((ID.EQ.6).OR.(ID .EQ. 8)) .AND. (IC .EQ. 2)) THEN
BAVZ = BAVZ + BETAW
ELSEIF (((ID.EQ.1).OR.(ID .EQ. 5)) .AND. (IC .EQ. 3)) THEN
BAVZ = BAVZ + BETAW
ENDIF
80 CONTINUE
C
C CALL SUBROUTINE TO CALCULATE EPSILON AND UMINUS OMEGA,OMEGA
C EPSILON IN H1 AND UMINUS IN DA
CALL EPSAB(H1,EIGS,G,GA,GB,UA,UB,UAB,DA,NORBS,NCLOSE,IWFLB)
CALL DAWRIT(UAB,MAXSQ,IPOSU+ID)
CALL DAWRIT(G,MAXSQ,IPOSG+ID)
CALL DAWRIT(H1,MAXSQ,IPOSE+ID)
CALL DAWRIT(DA,MAXSQ,IPOSUM+ID)
90 CONTINUE
BAVX = BAVX/5.0D+00
BAVY = BAVY/5.0D+00
BAVZ = BAVZ/5.0D+00
BVEC = (BAVX*BAVX+BAVY*BAVY+BAVZ*BAVZ)**0.5D+00
C
WRITE(6,100) OMEGA,BAVX
100 FORMAT(//,' AVERAGE BETAX VALUE AT ',F10.5,' EV = ',
1 1F15.5 )
WRITE(6,110) OMEGA,BAVY
110 FORMAT(' AVERAGE BETAY VALUE AT ',F10.5,' EV = ',
1 1F15.5 )
WRITE(6,120) OMEGA,BAVZ
120 FORMAT(' AVERAGE BETAZ VALUE AT ',F10.5,' EV = ',
1 1F15.5 )
WRITE(6,130) OMEGA,BVEC
130 FORMAT(//,' AVERAGE BETA VALUE AT ',F10.5,' EV = ',
1 1F15.5 ,//)
C
RETURN
END
SUBROUTINE BETAF(IWFLB,MAXITU,BTOL,UA,UB,F,GA,GB,T,H1,D,DA,
1 UAB,UOLD1,G,X)
C
C THIS SUBROUTINE CALCULATES ITERATIVE BETA VALUES FOR SECOND HARMONIC
C GENERATION.
C
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
DOUBLE PRECISION MAXU
LOGICAL LAST
INCLUDE 'SIZES'
C
COMMON /MOLKST/ NUMAT,NAT(NUMATM),NFIRST(NUMATM),NMIDLE(NUMATM),
1 NLAST(NUMATM),NORBS,NELECS,NALPHA,NBETA,
2 NCLOSE,NOPEN,NDUMY,FRACT
COMMON /VECTOR/ C(MORB2),EIGS(MAXORB),CA(MORB2),DUMY(MAXORB)
COMMON /WMATRX/ W(N2ELEC*2)
COMMON /GEOM / GEO(3,NUMATM), COORD(3,NUMATM)
COMMON /OMVAL/ OMEGA
COMMON /KEYWRD/ KEYWRD
COMMON /CHANEL/ IFILES(30)
EQUIVALENCE(IW,IFILES(6))
CHARACTER*241 KEYWRD
C
DIMENSION UA(MAXORB,MAXORB),UB(MAXORB,MAXORB),F(MAXORB,MAXORB),
1 GA(MAXORB,MAXORB),GB(MAXORB,MAXORB),
2 T(MAXORB,MAXORB), H1(MAXORB,MAXORB),
3 D(MAXORB,MAXORB),DA(MAXORB,MAXORB),
4 UAB(MAXORB,MAXORB),UOLD1(MAXORB,MAXORB),
5 G(MAXORB,MAXORB),X(MAXORB,MAXORB)
DIMENSION ALLBET(3,3,3)
CHARACTER*1 ALAB
DIMENSION ALAB(3),IDA(6),IDB(6)
SAVE ALAB, IDA, IDB
DATA ALAB/'X','Y','Z'/
DATA IDA /1,1,1,2,2,3/
DATA IDB /1,2,3,2,3,3/
C
ONE=1.0D00
BETOLD = 0.0D00
MAXSQ = NORBS*NORBS
IPOSU = 25 + 24*IWFLB
IPOSG = IPOSU + 6
IPOSE = IPOSG + 6
IPOSUM = IPOSE + 6
C
IF (IWFLB .EQ. 0) THEN
WRITE(6,10) OMEGA
10 FORMAT(/,' +++++ BETA (STATIC) AT ',1F15.5 ,' EV.'/)
ELSE
WRITE(6,20) OMEGA
20 FORMAT(/,' +++++ BETA',
1 ' (SECOND HARMONIC GENERATION) AT ',1F13.5,' EV.'/)
ENDIF
C
C CHOOSE A COMPONENT
C X: ID=1 Y: ID=2 Z: ID=3
C
BAVX = 0.0D+00
BAVY = 0.0D+00
BAVZ = 0.0D+00
DO 80 ID = 1,6
CMPTIM = SECOND()
IA=IDA(ID)
IB=IDB(ID)
LAST = .FALSE.
C
C CALCULATE THE DIPOLE MATRIX.
C
CALL HMUF(H1,IA,COORD,NFIRST,NLAST,NAT,NORBS,NUMAT)
C
C INITIALIZE ZERO ARRAYS
C
CALL ZEROM(UOLD1,NORBS)
CALL ZEROM(UAB,NORBS)
CALL ZEROM(F,NORBS)
C
C INPUT U AND GA FROM ALPHA CALCULATIONS
C
IF ((IWFLB .EQ. 2) .OR. (IWFLB .EQ. 0)) THEN
JPU = 1 + IA
CALL DAREAD(UA,MAXSQ,JPU)
JPG = 4 + IA
CALL DAREAD(GA,MAXSQ,JPG)
ELSE
JPU = 7 + IA
CALL DAREAD(UA,MAXSQ,JPU)
JPG = 10 + IA
CALL DAREAD(GA,MAXSQ,JPG)
ENDIF
C READ VALUES FOR (W,-W)
IF (IWFLB .EQ. 3) THEN
JPU = 7 + IB
CALL DAREAD(X,MAXSQ,JPU)
CALL FHPATN(UB,X,NORBS,2,-ONE)
JPG = 10 + IB
CALL DAREAD(X,MAXSQ,JPG)
CALL FHPATN(GB,X,NORBS,2,ONE)
C READ VALUES FOR OKE
C
ELSEIF (IWFLB .EQ. 0) THEN
JPU = 1 + IB
CALL DAREAD(UB,MAXSQ,JPU)
JPG = 4 + IB
CALL DAREAD(GB,MAXSQ,JPG)
ELSE
JPU = 7 + IB
CALL DAREAD(UB,MAXSQ,JPU)
JPG = 10 + IB
CALL DAREAD(GB,MAXSQ,JPG)
ENDIF
C
C CONSTRUCT T-MATRIX ONE TIME
C
CALL TF(UA,GA,UB,GB,T,NORBS,NCLOSE,IWFLB)
C
C CALCULATE INITIAL DENSITY AND BETA VALUE
C
CALL BDENSF(UA,UB,UAB,C,D,DA,NORBS,NCLOSE,IWFLB)
BETAW = AVAL(H1,D,NORBS)
DELA = DABS(BETOLD-BETAW)
BETOLD = BETAW
C
C INITIALIZE FOCK MATRIX
C
CALL FFREQ2(F,D,W,NUMAT,NFIRST,NLAST,NORBS)
CALL FFREQ1(F,D,DA,DA,NORBS)
CALL ZEROM(DA,NORBS)
CALL HPLUSF(F,DA,NORBS)
C.................................................................
C LOOP STARTS HERE
C.................................................................
ICOUNT = 0
30 CONTINUE
ICOUNT = ICOUNT + 1
IF (ICOUNT .GE. MAXITU) LAST = .TRUE.
C
C CREATE G MATRIX.
C
CALL TRANSF(F,G,C,NORBS)
C
C FORM U MATRIX
C
CALL BMAKUF(UA,UB,UAB,T,UOLD1,G,EIGS,LAST,NORBS,
1 NCLOSE,DIFF,IWFLB,MAXU,BTOL)
C
C FORM NEW DENSITY MATRIX
C
CALL BDENSF(UA,UB,UAB,C,D,DA,NORBS,NCLOSE,IWFLB)
C...
C COMPUTE TEST BETA
C
BETAW = AVAL(H1,D,NORBS)
DELA = DABS(BETOLD-BETAW)
BETOLD = BETAW
C IF (LAST.OR.(ICOUNT.GT.(MAXITU-5))) THEN
C WRITE(6,1500) ICOUNT,DELA,MAXU,DIFF
C 1500 FORMAT(' ',I4,' DELTA BETA = ', D12.5,
C X ' MAXU = ', D12.5, ' UDIFF = ', D12.5)
C ENDIF
C
C CREATE NEW FOCK MATRIX
C
CALL ZEROM(F,NORBS)
CALL FFREQ2(F,D,W,NUMAT,NFIRST,NLAST,NORBS)
CALL FFREQ1(F,D,DA,DA,NORBS)
CALL ZEROM(DA,NORBS)
CALL HPLUSF(F,DA,NORBS)
C..............................................................
IF (.NOT.LAST) GO TO 30
CMPTIM = SECOND() - CMPTIM
WRITE(6,40) ICOUNT,CMPTIM
40 FORMAT(/' CONVERGED IN',I4,' ITERATIONS IN',F10.2,
1 ' SECONDS')
WRITE(6,50) MAXU,DIFF
50 FORMAT(' MAXIMUM UAB ELEMENT =',1F15.5 ,
1 ', MAXIMUM DIFFERENCE =',1F15.5 ,/)
C
C COMPUTE BETA
C
C CALL HMUF(H1,ID,COORD,NFIRST,NLAST,NAT,NORBS,NUMAT)
C BETAW = AVAL(H1,D,NORBS)
C WRITE(6,2000) ALAB(ID),ALAB(ID),ALAB(ID),BETAW
C2000 FORMAT('BETA(',A1,',',A1,','A1,') = ',D12.5)
C
C COMPUTE OTHER COMPONENTS
C
DO 70 IC = 1,3
CALL HMUF(H1,IC,COORD,NFIRST,NLAST,NAT,NORBS,NUMAT)
BETAW = AVAL(H1,D,NORBS)
ALLBET(IC,IA,IB)=BETAW
WRITE(6,60) ALAB(IC),ALAB(IA),ALAB(IB),BETAW
60 FORMAT(' BETA(',A1,',',A1,',',A1,') = ',1F15.5 )
C
C CALCULATE AVERAGE BETA IN THE X-DIRECTION
C
IF ((ID .EQ. 1) .AND. (IC .EQ. 1)) THEN
BAVX = BAVX + 3.0D0 * BETAW
ELSEIF ((ID .EQ. 2) .AND. (IC .EQ. 2)) THEN
BAVX = BAVX + 2.0D0 * BETAW
ELSEIF ((ID .EQ. 3) .AND. (IC .EQ. 3)) THEN
BAVX = BAVX + 2.0D0 * BETAW
ELSEIF (((ID.EQ.4).OR.(ID .EQ. 6)) .AND. (IC .EQ. 1)) THEN
BAVX = BAVX + BETAW
ENDIF
C CALCULATES AVERAGE BETA IN THE Y-DIRECTION
IF ((ID .EQ. 4) .AND. (IC .EQ. 2)) THEN
BAVY = BAVY + 3.0D0 * BETAW
ELSEIF ((ID .EQ. 2) .AND. (IC .EQ. 1)) THEN
BAVY = BAVY + 2.0D0 * BETAW
ELSEIF ((ID .EQ. 5) .AND. (IC .EQ. 3)) THEN
BAVY = BAVY + 2.0D0 * BETAW
ELSEIF (((ID.EQ.1).OR.(ID .EQ. 6)) .AND. (IC .EQ. 2)) THEN
BAVY = BAVY + BETAW
ENDIF
C CALCULATES AVERAGE BETA IN THE Z-DIRECTION
IF ((ID .EQ. 6) .AND. (IC .EQ. 3)) THEN
BAVZ = BAVZ + 3.0D0 * BETAW
ELSEIF ((ID .EQ. 3) .AND. (IC .EQ. 1)) THEN
BAVZ = BAVZ + 2.0D0 * BETAW
ELSEIF ((ID .EQ. 5) .AND. (IC .EQ. 2)) THEN
BAVZ = BAVZ + 2.0D0 * BETAW
ELSEIF (((ID.EQ.4) .OR. (ID.EQ.1)) .AND. (IC .EQ. 3)) THEN
BAVZ = BAVZ + BETAW
ENDIF
70 CONTINUE
C
C
C CALL SUBROUTINE TO CALCULATE EPSILON AND UMINUS OMEGA,OMEGA
C EPSILON IN H1 AND UMINUS IN DA
CALL EPSAB(H1,EIGS,G,GA,GB,UA,UB,UAB,DA,NORBS,NCLOSE,IWFLB)
CALL DAWRIT(UAB,MAXSQ,IPOSU+ID)
CALL DAWRIT(G,MAXSQ,IPOSG+ID)
CALL DAWRIT(H1,MAXSQ,IPOSE+ID)
CALL DAWRIT(DA,MAXSQ,IPOSUM+ID)
80 CONTINUE
C
BAVX = BAVX/5.0D+00
BAVY = BAVY/5.0D+00
BAVZ = BAVZ/5.0D+00
C CALCULATES AVERAGE BETA
BVEC = (BAVX*BAVX+BAVY*BAVY+BAVZ*BAVZ)**0.5D+00
C
WRITE(6,90) OMEGA,BAVX
90 FORMAT(//,' AVERAGE BETAX(SHG) VALUE AT',F10.5, ' EV = ',
1 1F11.5 )
WRITE(6,100) OMEGA,BAVY
100 FORMAT(' AVERAGE BETAY(SHG) VALUE AT',F10.5, ' EV = ',
1 1F11.5 )
WRITE(6,110) OMEGA,BAVZ
110 FORMAT(' AVERAGE BETAZ(SHG) VALUE AT',F10.5, ' EV = ',
1 1F11.5)
C
WRITE(6,120) OMEGA,BVEC
120 FORMAT(//,' AVERAGE BETA (SHG) VALUE AT',F10.5, ' EV = ',
1 1F11.5 ,//)
RETURN
END
SUBROUTINE BETAL1(U0A,G0A,U1B,G1B,U1C,G1C,NCLOSE,NORBS,TERM)
C
C THIS SUBROUTINE CALCULATES THE TRACE OF UGU MATRICES
C
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
DIMENSION U0A(NORBS,NORBS),U1B(NORBS,NORBS),U1C(NORBS,NORBS),
1 G0A(NORBS,NORBS),G1B(NORBS,NORBS),G1C(NORBS,NORBS)
T1A = TRUGUD(U0A,G1B,U1C,NCLOSE,NORBS,NORBS)
T2A = TRUDGU(U1C,G1B,U0A,NCLOSE,NORBS,NORBS)
T3A = TRUGDU(U1B,G1C,U0A,NCLOSE,NORBS,NORBS)
T4A = TRUGDU(U0A,G1C,U1B,NCLOSE,NORBS,NORBS)
T5A = TRUDGU(U1C,G0A,U1B,NCLOSE,NORBS,NORBS)
T6A = TRUGUD(U1B,G0A,U1C,NCLOSE,NORBS,NORBS)
T1B = TRUGUD(U0A,G1B,U1C,NORBS,NCLOSE,NORBS)
T2B = TRUDGU(U1C,G1B,U0A,NORBS,NCLOSE,NORBS)
T3B = TRUGDU(U1B,G1C,U0A,NORBS,NCLOSE,NORBS)
T4B = TRUGDU(U0A,G1C,U1B,NORBS,NCLOSE,NORBS)
T5B = TRUDGU(U1C,G0A,U1B,NORBS,NCLOSE,NORBS)
T6B = TRUGUD(U1B,G0A,U1C,NORBS,NCLOSE,NORBS)
TERM = T1B-T1A+T2B-T2A+T3A-T3B+T4A-T4B+T5B-T5A+T6B-T6A
RETURN
END
SUBROUTINE BETALL(U2A,G2A,U1B,G1B,U1C,G1C,NCLOSE,NORBS,TERM)
C
C THIS SUBROUTINE CALCULATES TRACE OF UGU MATRICES
C WHEN A,B,C DIRECTIONS ARE DIFFERENT
C
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
DIMENSION U2A(NORBS,NORBS),U1B(NORBS,NORBS),U1C(NORBS,NORBS),
1 G2A(NORBS,NORBS),G1B(NORBS,NORBS),G1C(NORBS,NORBS)
T1A = TRUDGU(U2A,G1B,U1C,NCLOSE,NORBS,NORBS)
T2A = TRUGUD(U1C,G1B,U2A,NCLOSE,NORBS,NORBS)
T3A = TRUGUD(U1B,G1C,U2A,NCLOSE,NORBS,NORBS)
T4A = TRUDGU(U2A,G1C,U1B,NCLOSE,NORBS,NORBS)
T5A = TRUGDU(U1C,G2A,U1B,NCLOSE,NORBS,NORBS)
T6A = TRUGDU(U1B,G2A,U1C,NCLOSE,NORBS,NORBS)
T1B = TRUDGU(U2A,G1B,U1C,NORBS,NCLOSE,NORBS)
T2B = TRUGUD(U1C,G1B,U2A,NORBS,NCLOSE,NORBS)
T3B = TRUGUD(U1B,G1C,U2A,NORBS,NCLOSE,NORBS)
T4B = TRUDGU(U2A,G1C,U1B,NORBS,NCLOSE,NORBS)
T5B = TRUGDU(U1C,G2A,U1B,NORBS,NCLOSE,NORBS)
T6B = TRUGDU(U1B,G2A,U1C,NORBS,NCLOSE,NORBS)
TERM = T1B-T1A+T2B-T2A+T3B-T3A+T4B-T4A+T5A-T5B+T6A-T6B
RETURN
END
SUBROUTINE BETCOM(U1,G1,U2,G2,NCLOSE,NORBS,TERM)
C
C THIS SUBROUTINE CALCULATES TRACE OF UGU MATRICES
C
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
DIMENSION U1(NORBS,NORBS),U2(NORBS,NORBS),
1 G1(NORBS,NORBS),G2(NORBS,NORBS)
T1A = TRUDGU(U2,G1,U1,NCLOSE,NORBS,NORBS)
T2A = TRUGUD(U1,G1,U2,NCLOSE,NORBS,NORBS)
T3A = TRUGDU(U1,G2,U1,NCLOSE,NORBS,NORBS)
T1B = TRUDGU(U2,G1,U1,NORBS,NCLOSE,NORBS)
T2B = TRUGUD(U1,G1,U2,NORBS,NCLOSE,NORBS)
T3B = TRUGDU(U1,G2,U1,NORBS,NCLOSE,NORBS)
TERM = 2.0D0*(T1B-T1A+T2B-T2A+T3A-T3B)
RETURN
END
SUBROUTINE BMAKUF(UA,UB,UAB,T,UOLD1,GAB,EIGS,LAST,NORBS,
1 NCLOSE,DIFF,IWFLB,MAXU,BTOL)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
DOUBLE PRECISION MAXU
LOGICAL LAST
C
C THIS SUBROUTINE CREATES THE NEW TRANSFORMATION MATRIX U
C AND THEN CHECKS FOR CONVERGENCE
C
DIMENSION UA(NORBS,NORBS),UOLD1(NORBS,NORBS),T(NORBS,NORBS),
1 EIGS(NORBS),GAB(NORBS,NORBS),UAB(NORBS,NORBS),
2 UB(NORBS,NORBS)
COMMON /OMVAL/ OMEGA
C
C ZERO MATRIX INITIALLY
C CALL ZEROM(UAB,NORBS)
C
C CREATE DIAGONAL BLOCKS (OCC,OCC) AND (UNOCC,UNOCC)
C
DO 30 I = 1,NORBS
DO 20 J = 1,I
SUM = 0.0D00
IF (I.LE.NCLOSE) THEN
KLL=NCLOSE+1
KUL=NORBS
ELSEIF ((I.GT.NCLOSE).AND.(J.GT.NCLOSE)) THEN
KLL=1
KUL=NCLOSE
ENDIF
DO 10 K =KLL,KUL
SUM = SUM+UA(I,K)*UB(K,J)+UB(I,K)*UA(K,J)
10 CONTINUE
UAB(I,J) = SUM*0.5D00
UAB(J,I) = SUM*0.5D00
20 CONTINUE
30 CONTINUE
C
C CREATE OFF-DIAGONAL BLOCKS
C
DO 80 K = NCLOSE+1,NORBS
DO 70 L = 1,NCLOSE
GO TO (40,50,60), IWFLB
C CALCULATE FOR (W,W) VALUES
C
40 UAB(K,L) = 27.2113961D0*((GAB(K,L)+T(K,L))/
1 ((EIGS(L)-EIGS(K))-2.0D00*OMEGA))
UAB(L,K) = 27.2113961D0*((GAB(L,K)+T(L,K))/
1 ((EIGS(K)-EIGS(L))-2.0D00*OMEGA))
GO TO 70
C CALCULATE FOR (0,W) VALUES
C
50 UAB(K,L) = 27.2113961D0*((GAB(K,L)+T(K,L))/
1 ((EIGS(L)-EIGS(K))-OMEGA))
UAB(L,K) = 27.2113961D0*((GAB(L,K)+T(L,K))/
1 ((EIGS(K)-EIGS(L))-OMEGA))
GO TO 70
C CALCULATE FOR (W,-W) VALUES
C
60 UAB(K,L) = 27.2113961D0*((GAB(K,L)+T(K,L))/
1 (EIGS(L)-EIGS(K)))
UAB(L,K) = 27.2113961D0*((GAB(L,K)+T(L,K))/
1 (EIGS(K)-EIGS(L)))
70 CONTINUE
80 CONTINUE
C
C CHECK FOR CONVERGENCE
C
DIFF = 0.0D00
MAXU = -1000.00D0
DO 100 I = 1,NORBS
DO 90 J = 1,NORBS
UDIF = UAB(I,J)-UOLD1(I,J)
IF (DIFF.LT.ABS(UDIF)) DIFF = ABS(UDIF)
IF (MAXU.LT.UAB(I,J)) MAXU = UAB(I,J)
90 CONTINUE
100 CONTINUE
IF (DIFF.LT.BTOL) THEN
LAST = .TRUE.
ENDIF
C
DO 120 I = 1,NORBS
DO 110 J = 1,NORBS
UOLD1(I,J) = UAB(I,J)
110 CONTINUE
120 CONTINUE
C
RETURN
END
SUBROUTINE COPYM(H,F,M)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
C COPYM COPIES MATRIX H INTO F
C
DIMENSION F(M,M),H(M,M)
DO 20 I = 1,M
DO 10 J = 1,M
F(I,J) = H(I,J)
10 CONTINUE
20 CONTINUE
RETURN
END
SUBROUTINE DAREA1(V,LEN,IDAF,NS)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
DIMENSION V(LEN)
C
C READ A PHYSICAL RECORD FROM THE DAF
C
READ(UNIT=IDAF, REC=NS) V
RETURN
END
SUBROUTINE DAREAD(V,LEN,NREC)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
DIMENSION V(LEN)
C
COMMON /IODAF/ IDAF,IRECLN,IRECST,IFILEN(145),IODA(145)
COMMON /CHANEL/ IFILES(30)
EQUIVALENCE(IW,IFILES(6))
C
C READ A LOGICAL RECORD FROM THE DAF DICTIONARY FILE
C A LOGICAL RECORD MAY SPAN SEVERAL PHYSICAL RECORDS.
C
N = IODA(NREC)
IF(N.EQ.-1) GO TO 20
IS = -IRECLN + 1
NS = N
LENT = LEN
10 CONTINUE
IS = IS + IRECLN
IF = IS + LENT - 1
IF ((IF-IS+1) .GT. IRECLN) IF = IS + IRECLN - 1
NSP = NS
LENW = IF - IS + 1
CALL DAREA1(V(IS),LENW,IDAF,NSP)
LENT = LENT - IRECLN
NS = NS + 1
N = NS
IF (LENT .GE. 1) GO TO 10
RETURN
C
20 CONTINUE
WRITE(6,30) NREC,LEN
STOP
C
30 FORMAT(1X,'*** ERROR ***, ATTEMPT TO READ A DAF RECORD',
1 ' THAT WAS NEVER WRITTEN. NREC,LEN=',I5,I10)
END
SUBROUTINE DAWRIT(V,LEN,NREC)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
LOGICAL NEWREC
C
DIMENSION V(LEN)
C
COMMON /IODAF/ IDAF,IRECLN,IRECST,IFILEN(145),IODA(145)
COMMON /CHANEL/ IFILES(30)
EQUIVALENCE(IW,IFILES(6))
C
C WRITE A LOGICAL RECORD ON THE DAF DICTIONARY FILE
C A LOGICAL RECORD MAY SPAN SEVERAL PHYSICAL RECORDS
C
N = IODA(NREC)
IF (N .GT. 0 .AND. LEN .NE. IFILEN(NREC)) GO TO 30
NEWREC = .FALSE.
IF (N .GT. 0) GO TO 10
IODA(NREC) = IRECST
IFILEN(NREC) = LEN
NEWREC = .TRUE.
IRECST = IRECST + (LEN-1)/IRECLN + 1
N = IODA(NREC)
10 CONTINUE
IST = -IRECLN + 1
NS = N
LENT = LEN
20 CONTINUE
IST = IST + IRECLN
IF = IST + LENT - 1
IF ((IF-IST+1) .GT. IRECLN) IF = IST+IRECLN-1
NSP = NS
LENW = IF - IST + 1
CALL DAWRT1(V(IST),LENW,IDAF,NSP)
LENT = LENT - IRECLN
NS = NS + 1
N = NS
IF (LENT .GE. 1) GO TO 20
IF (NEWREC) WRITE(UNIT=IDAF, REC=1) IRECST,IODA,IFILEN,IS,IPK
C
C THE CRAY/CTSS SYSTEM HAS A BUG IN IT! THIS CALL TO DAWRIT
C DOES NOT ALWAYS SUCCEED IN TRANFERRING DATA TO THE DISK,
C LEAVING THE DATA ONLY IN THE BUFFER. SUBSEQUENT CALLS
C TO DAREAD FOR OTHER LOGICAL RECORDS WILL DESTROY THE
C BUFFER RESIDENT DATA, AND THE DATA WILL BE LOST FOREVER.
C THE FOLLOWING CALL QUARANTEES THE BUFFER IS FLUSHED
C TO DISK. IT SHOULD BE REMOVED IF THIS BUG IS EVER FIXED.
C
*CTS CALL EMPTY(IDAF)
RETURN
C
30 CONTINUE
WRITE(6,40) NREC,LEN,IFILEN(NREC)
STOP
C
40 FORMAT(1X,'DAWRIT HAS REQUESTED A RECORD WITH LENGTH',
1 1X,'DIFFERENT THAN BEFORE - ABORT FORCED.'/
2 1X,'DAF RECORD ',I5,' NEW LENGTH =',I5,' OLD LENGTH =',I5)
END
C*MODULE IOLIB *DECK DAWRT1
SUBROUTINE DAWRT1(V,LEN,IDAF,NS)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
DIMENSION V(LEN)
C
C ----- WRITE A PHYSICAL RECORD ON THE DAF -----
C
WRITE(UNIT=IDAF, REC=NS) V
RETURN
END
SUBROUTINE DENSF(U,C,CA,D,DA,NORBS,NCLOSE)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
C THIS SUBROUTINE IS USED TO COMPUTE THE FIRST-ORDER DENSITY
C FROM CA = C*U
C
DIMENSION C(NORBS,NORBS),CA(NORBS,NORBS),D(NORBS,NORBS)
DIMENSION U(NORBS,NORBS),DA(NORBS,NORBS)
C
C FORM DENSITY MATRIX CA*N*C+ + C*N*CA+
C
DO 40 I = 1,NORBS
DO 30 J = 1,NORBS
SUM = 0.0D00
DO 20 K = 1,NORBS
SK1 = 0.0D00
SK2 = 0.0D00
DO 10 L = 1,NCLOSE
SK1 = SK1 + U(K,L)*C(J,L)
SK2 = SK2 + C(I,L)*U(L,K)
10 CONTINUE
SUM = SUM + C(I,K)*SK1 - SK2*C(J,K)
20 CONTINUE
D(I,J) = 2.0D00*SUM
DA(I,J) = SUM
30 CONTINUE
40 CONTINUE
C
RETURN
END
SUBROUTINE EPSAB(EIGSAB,EIGS,GAB,GA,GB,UA,UB,
1 UAB,UDMS,NORBS,NCLOSE,IWFLB)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
COMMON /OMVAL/ OMEGA
C
C THIS SUBROUTINE CREATES THE NEW EPSILON MATRIX AND UDMS MATRIX
C
DIMENSION EIGS(NORBS),EIGSAB(NORBS,NORBS),
1 GA(NORBS,NORBS),GB(NORBS,NORBS),
2 GAB(NORBS,NORBS),UAB(NORBS,NORBS),
3 UA(NORBS,NORBS),UB(NORBS,NORBS),UDMS(NORBS,NORBS)
C
C ZERO EPSILON OMEGA OMEGA MATRIX INITIALLY
C
CALL ZEROM(EIGSAB,NORBS)
C
C ZERO UAB MINUS OMEGA,OMEGA MATRIX INITIALLY
C
CALL ZEROM(UDMS,NORBS)
C
IF ((IWFLB .EQ. 0) .OR. (IWFLB .EQ. 1)) THEN
OMVAL = 2.0D00 * OMEGA
ELSEIF (IWFLB .EQ. 3) THEN
OMVAL = 0.0D00
ELSEIF (IWFLB .EQ. 2) THEN
OMVAL = OMEGA
ENDIF
DO 30 I = 1,NCLOSE
DO 20 J = 1,NCLOSE
S1=0.0D00
DO 10 K = NCLOSE+1, NORBS
C
C CALCULATION FOR EPSAB
C
S1 = S1+ GA(I,K)*UB(K,J)+GB(I,K)*UA(K,J)
C
10 CONTINUE
EIGSAB(I,J)=GAB(I,J)+S1+UAB(I,J)*(EIGS(I)-
1 EIGS(J) + OMVAL)/27.2113961D00
20 CONTINUE
30 CONTINUE
C
C CALCULATION FOR UMS
C
DO 60 I=1,NORBS
DO 50 J=1,NORBS
S2=0.0D00
DO 40 K= 1,NORBS
S2 = S2 + UA(I,K)*UB(K,J)+UB(I,K)*UA(K,J)
40 CONTINUE
C
UDMS(I,J) = S2-UAB(I,J)
50 CONTINUE
60 CONTINUE
C
RETURN
END
SUBROUTINE FFREQ1(F, PTOT, PA, PB, NDIM)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
INCLUDE 'SIZES'
DIMENSION F(NDIM,NDIM), PTOT(NDIM,NDIM),
1 PA(NDIM,NDIM), PB(NDIM,NDIM)
C *********************************************************************
C
C *** COMPUTE THE REMAINING CONTRIBUTIONS TO THE ONE-CENTRE ELEMENTS.
C
C *********************************************************************
COMMON /MOLKST/ NUMAT,NAT(NUMATM),NFIRST(NUMATM),NMIDLE(NUMATM),
1 NLAST(NUMATM), NORBS, NELECS,NALPHA,NBETA,
2 NCLOSE,NOPEN,NDUMY,FRACT
COMMON /GAUSS / FN1(107),FN2(107)
1 /MOLORB/ USPD(MAXORB),DUMY(MAXORB)
COMMON /TWOELE/ GSS(107),GSP(107),GPP(107),GP2(107),HSP(107)
1 ,GSD(107),GPD(107),GDD(107)
COMMON /KEYWRD/ KEYWRD
CHARACTER*241 KEYWRD
LOGICAL FIRST
SAVE FIRST
DATA FIRST /.TRUE./
IF(FIRST)THEN
FIRST=.FALSE.
ENDIF
DO 60 II=1,NUMAT
IA=NFIRST(II)
IB=NMIDLE(II)
IC=NLAST(II)
NI=NAT(II)
DTPOP=0.D0
DAPOP=0.D0
PTPOP=0.D0
PAPOP=0.D0
GOTO (60,30,20,20,20,10,10,10,10,10)IC-IA+2
10 DTPOP=PTOT(IC,IC)+PTOT(IC-1,IC-1)
1 +PTOT(IC-2,IC-2)+PTOT(IC-3,IC-3)
2 +PTOT(IC-4,IC-4)
DAPOP=PA(IC,IC)+PA(IC-1,IC-1)
1 +PA(IC-2,IC-2)+PA(IC-3,IC-3)
2 +PA(IC-4,IC-4)
20 PTPOP=PTOT(IB,IB)+PTOT(IB-1,IB-1)
1 +PTOT(IB-2,IB-2)
PAPOP=PA(IB,IB)+PA(IB-1,IB-1)
1 +PA(IB-2,IB-2)
30 DBPOP=DTPOP-DAPOP
C
C F(S,S)
C
F(IA,IA) = F(IA,IA) + PB(IA,IA)*GSS(NI) + PTPOP*GSP(NI)
1 - PAPOP*HSP(NI) + DTPOP*GSD(NI)
IF (NI.LT.3) GO TO 60
IPLUS=IA+1
DO 40 J=IPLUS,IB
C
C F(P,P)
C
F(J,J) = F(J,J) + PTOT(IA,IA)*GSP(NI) - PA(IA,IA)*HSP(NI)
1 + PB(J,J)*GPP(NI) + (PTPOP-PTOT(J,J))*GP2(NI)
2 - 0.5D0*(PAPOP-PA(J,J))*(GPP(NI)-GP2(NI))
3 + DTPOP*GPD(NI)
C
C F(S,P)
C
F(IA,J) = F(IA,J) + 2.D0*PTOT(IA,J)*HSP(NI)
1 - PA(IA,J)*(HSP(NI)+GSP(NI))
F(J,IA) = F(J,IA) + 2.D0*PTOT(J,IA)*HSP(NI)
1 - PA(J,IA)*(HSP(NI)+GSP(NI))
40 CONTINUE
C
C F(P,P*)
C
IMINUS=IB-1
DO 50 J=IPLUS,IMINUS
ICC=J+1
DO 50 L=ICC,IB
F(J,L) = F(J,L) + PTOT(J,L)*(GPP(NI)-GP2(NI))
1 - 0.5D0*PA(J,L)*(GPP(NI)+GP2(NI))
F(L,J) = F(L,J) + PTOT(L,J)*(GPP(NI)-GP2(NI))
1 - 0.5D0*PA(L,J)*(GPP(NI)+GP2(NI))
50 CONTINUE
60 CONTINUE
RETURN
END
SUBROUTINE FFREQ2(F,PTOT,W,NUMAT,NFIRST,NLAST,NORBS)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
INCLUDE 'SIZES'
DIMENSION F(NORBS,NORBS), PTOT(NORBS,NORBS),
1 NFIRST(*),
2 NLAST(*), W(*)
C*******************************************************************
C
C TDHF FORMS TWO ELECTRON TWO CENTER REPULSION PART OF THE FOCK
C MATRIX
C ON INPUT PTOT = TOTAL DENSITY MATRIX
C P = ALPHA OR BETA DENSITY MATRIX
C W = TWO ELECTRON INTEGRAL MATRIX
C
C ON OUTPUT F = PARTIAL FOCK MATRIX
C
C********************************************************************
COMMON /KEYWRD/ KEYWRD
CHARACTER*241 KEYWRD
10 KK=0
C
DO 70 II=2,NUMAT
IIM1 = II - 1
IA=NFIRST(II)
IB=NLAST(II)
DO 60 JJ=1,IIM1
JA=NFIRST(JJ)
JB=NLAST(JJ)
DO 50 I=IA,IB
DO 40 J=IA,I
FIJ = 1.0D00
IF (I.EQ.J) FIJ = 0.5D00
DO 30 K=JA,JB
DO 20 L=JA,K
FKL = 1.0D00
IF (K.EQ.L) FKL = 0.5D00
KK=KK+1
A=W(KK)
AINT=A*FKL*FIJ
F(I,J)=F(I,J)+ AINT*(PTOT(K,L)+PTOT(L,K))
F(J,I)=F(J,I)+ AINT*(PTOT(K,L)+PTOT(L,K))
F(K,L)=F(K,L)+ AINT*(PTOT(I,J)+PTOT(J,I))
F(L,K)=F(L,K)+ AINT*(PTOT(I,J)+PTOT(J,I))
AINT=AINT*0.5D00
F(I,L)=F(I,L)-AINT*PTOT(J,K)
F(L,I)=F(L,I)-AINT*PTOT(K,J)
F(K,J)=F(K,J)-AINT*PTOT(L,I)
F(J,K)=F(J,K)-AINT*PTOT(I,L)
F(I,K)=F(I,K)-AINT*PTOT(J,L)
F(K,I)=F(K,I)-AINT*PTOT(L,J)
F(J,L)=F(J,L)-AINT*PTOT(I,K)
F(L,J)=F(L,J)-AINT*PTOT(K,I)
20 CONTINUE
30 CONTINUE
40 CONTINUE
50 CONTINUE
60 CONTINUE
70 CONTINUE
RETURN
END
SUBROUTINE FHPATN(A,B,NORBS,ITW,SIGN)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
C THIS SUBROUTINE CONVERTS THE MATRICES INTO ITS ADJOINTS
C
DIMENSION A(NORBS,NORBS),B(NORBS,NORBS)
GO TO (10,40,40,10) ITW
10 CONTINUE
DO 30 J=1,NORBS
DO 20 I=1,NORBS
A(I,J)=B(I,J)
20 CONTINUE
30 CONTINUE
GO TO 70
40 CONTINUE
DO 60 J=1,NORBS
DO 50 I=1,NORBS
A(I,J)=SIGN*B(J,I)
50 CONTINUE
60 CONTINUE
70 CONTINUE
RETURN
END
SUBROUTINE HMUF(H1,ID,COORD,NFIRST,NLAST,NAT,NORBS,NUMAT)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
C FORM THE DIPOLE MOMENT MATRIX FOR COMPONENT ID
C
COMMON /MULTIP/ DD(107),QQ(107),AM(107),AD(107),AQ(107)
DIMENSION H1(NORBS,NORBS), COORD(3,*)
DIMENSION NFIRST(NUMAT),NLAST(NUMAT),NAT(NUMAT)
C
C ZERO H1 MATRIX
C
CALL ZEROM(H1,NORBS)
C
C FORM DIPOLE MATRIX
C
DO 30 I = 1,NUMAT
IA = NFIRST(I)
IB = NLAST(I)
NI = NAT(I)
DO 20 I1 = IA,IB
DO 10 J1 = IA,I1
H1(I1,J1) = 0.0D00
IO1 = I1 - IA
JO1 = J1 - IA
IF ((ID.EQ.1).AND.((JO1.EQ.0).AND.(IO1.EQ.1))) THEN
H1(I1,J1) = DD(NI)
H1(J1,I1) = DD(NI)
ENDIF
IF ((ID.EQ.2).AND.((JO1.EQ.0).AND.(IO1.EQ.2))) THEN
H1(I1,J1) = DD(NI)
H1(J1,I1) = DD(NI)
ENDIF
IF ((ID.EQ.3).AND.((JO1.EQ.0).AND.(IO1.EQ.3))) THEN
H1(I1,J1) = DD(NI)
H1(J1,I1) = DD(NI)
ENDIF
10 CONTINUE
H1(I1,I1) = 0.0D00
C.. ADDED FOR TRANSLATION OF CENTER FROM ORIGIN
H1(I1,I1) = H1(I1,I1) + 1.8897262D0*COORD(ID,I)
20 CONTINUE
30 CONTINUE
C
RETURN
END
SUBROUTINE HPLUSF(F,H,NORBS)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
C HPLUSF ADDS THE 1 AND 2-ELECTRON PARTS OF THE FOCK MATRIX
C
DIMENSION F(NORBS,NORBS), H(NORBS,NORBS)
DO 20 I=1,NORBS
DO 10 J=1,NORBS
TERM = F(I,J)/27.2113961D00
F(I,J)=H(I,J)+TERM
10 CONTINUE
20 CONTINUE
RETURN
END
SUBROUTINE MAKEUF(U,UOLD,G,EIGS,LAST,NORBS,NNORBS,NCLOSE,
1 DIFF,ATOL)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
LOGICAL LAST
C
C THIS SUBROUTINE CREATES THE NEW TRANSFORMATION MATRIX U
C AND THEN CHECKS FOR CONVERGENCE
C
DIMENSION U(NORBS,NORBS),UOLD(NORBS,NORBS),
1 EIGS(NORBS),G(NORBS,NORBS)
COMMON /OMVAL/ OMEGA
C
C ZERO MATRIX INITIALLY
C
CALL ZEROM(U,NORBS)
C
C CREATE OFF-DIAGONAL BLOCKS
C
DO 20 K = NCLOSE+1,NORBS
DO 10 L = 1,NCLOSE
U(L,K) = 27.2113961D0*G(L,K)/(EIGS(K)-EIGS(L)-OMEGA)
U(K,L) = 27.2113961D0*G(K,L)/(EIGS(L)-EIGS(K)-OMEGA)
10 CONTINUE
20 CONTINUE
C
C CHECK FOR CONVERGENCE
C
DIFF = 0.0D00
DO 40 I = 1,NORBS
DO 30 J = 1,NORBS
UDIF = ABS(U(I,J)-UOLD(I,J))
IF (DIFF.LT.UDIF) DIFF = UDIF
30 CONTINUE
40 CONTINUE
IF (DIFF.LT.ATOL) THEN
LAST = .TRUE.
ENDIF
C
DO 60 I = 1,NORBS
DO 50 J = 1,NORBS
UOLD(I,J) = U(I,J)
50 CONTINUE
60 CONTINUE
C
RETURN
END
SUBROUTINE NGAMTG(IGAM,X,GD3,UD3,G1,U1,GS,USMD,EPS,US)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
INCLUDE 'SIZES'
C.....................................................................
C CALCULATE GAMMA(THG) IN A NONITERATIVE FASHION
C.....................................................................
COMMON /MOLKST/ NUMAT,NAT(NUMATM),NFIRST(NUMATM),NMIDLE(NUMATM),
1 NLAST(NUMATM),NORBS,NELECS,NALPHA,NBETA,NCLOSE,
2 NOPEN,NDUMY,FRACT
COMMON /OMVAL/ OMEGA
COMMON /CHANEL/ IFILES(30)
EQUIVALENCE(IW,IFILES(6))
DIMENSION X(MAXORB,MAXORB),GD3(MAXORB,MAXORB),UD3(MAXORB,MAXORB),
1 G1(MAXORB,MAXORB),U1(MAXORB,MAXORB),GS(MAXORB,MAXORB),
2 USMD(MAXORB,MAXORB),EPS(MAXORB,MAXORB),
3 GAMMA(9),US(MAXORB,MAXORB)
CHARACTER*1 ALAB
DIMENSION ALAB(3),IDA(9),IDB(9),IDC(9),IDD(9),
1 IPAIR(3,3)
SAVE ALAB, IDA, IDB, IDC, IDD, IPAIR
DATA ALAB /'X','Y','Z'/
DATA IDA /1,2,3,1,1,2,2,3,3/
DATA IDB /1,2,3,1,1,2,2,3,3/
DATA IDC /1,2,3,2,3,1,3,1,2/
DATA IDD /1,2,3,2,3,1,3,1,2/
DATA IPAIR /1,2,3,2,4,5,3,5,6/
ONE=1.D0
MSQ = NORBS*NORBS
10 WRITE(6,20) OMEGA
20 FORMAT (//,
1 ' GAMMA (THIRD HARMONIC GENERATION) AT ',F10.5,' EV.'//)
C
C IGAM=1 (THIRD HARMONIC GENERATION)
C
JGARC=22
JUARC=19
JUREC=07
JGREC=10
JG2REC=55
JU2REC=49
JU2MRC=67
JEPREC=61
C
C LOOP BEGINS FOR THE CALCULATION OF GAMMA(ABCD)
C
GAV = 0.0D+00
DO 100 IE=1,9
C
IA=IDA(IE)
IB=IDB(IE)
IC=IDC(IE)
ID=IDD(IE)
ICD=IPAIR(IC,ID)
IBD=IPAIR(IB,ID)
IBC=IPAIR(IB,IC)
C
C READ IN THE FIRST ORDER U3 OMEGA AND G3 OMEGA IN THE DIRECTION A
C
C MAKE GD3 OMEGA MATRIX FROM G3 MATRIX
C
CALL DAREAD(X,MSQ,JGARC+IA)
CALL FHPATN(GD3,X,NORBS,2,ONE)
C
C MAKE UD3 OMEGA MATRIX FROM U3 OMEGA MATRIX
C
CALL DAREAD(X,MSQ,JUARC+IA)
CALL FHPATN(UD3,X,NORBS,2,-ONE)
C
YY=0.0D00
IMOVE=1
30 CONTINUE
C
40 GO TO (50,60,70), IMOVE
C
50 J2=IB
J34=ICD
GO TO 80
60 J2=IC
J34=IBD
GO TO 80
70 J2=ID
J34=IBC
80 CONTINUE
C
C READ IN G1,U1,GS,US,UMS,EPS
C
C GET UB
CALL DAREAD(U1,MSQ,JUREC+J2)
C GET GB
CALL DAREAD(G1,MSQ,JGREC+J2)
C GET GCD
CALL DAREAD(GS,MSQ,JG2REC+J34)
C GET UCD
CALL DAREAD(US,MSQ,JU2REC+J34)
C GET USMD
CALL DAREAD(USMD,MSQ,JU2MRC+J34)
C GET EPCD
CALL DAREAD(EPS,MSQ,JEPREC+J34)
C
C
C FIRST KIND
C
YY = YY+TRSUB(UD3,G1,US,NCLOSE,NORBS,NORBS)
YY = YY-TRSUB(USMD,G1,UD3,NCLOSE,NORBS,NORBS)
YY = YY-TRSUB(UD3,G1,US,NORBS,NCLOSE,NORBS)
YY = YY+TRSUB(USMD,G1,UD3,NORBS,NCLOSE,NORBS)
C
C SECOND KIND
C
YY = YY+TRSUB(UD3,GS,U1,NCLOSE,NORBS,NORBS)
YY = YY+TRSUB(U1,GS,UD3,NCLOSE,NORBS,NORBS)
YY = YY-TRSUB(UD3,EPS,U1,NORBS,NCLOSE,NORBS)
YY = YY-TRSUB(U1,EPS,UD3,NORBS,NCLOSE,NORBS)
C
C THIRD KIND
C
YY = YY+TRSUB(U1,GD3,US,NCLOSE,NORBS,NORBS)
YY = YY-TRSUB(USMD,GD3,U1,NCLOSE,NORBS,NORBS)
YY = YY-TRSUB(U1,GD3,US,NORBS,NCLOSE,NORBS)
YY = YY+TRSUB(USMD,GD3,U1,NORBS,NCLOSE,NORBS)
C
IMOVE=IMOVE+1
IF (IMOVE .LE. 3) GO TO 30
C
GAMMA(IE) = YY
C
C CALCULATE THE AVERAGE GAMMA VALUE
C
GAV = GAV + YY
C
C WRITE GAMMA(ABCD)
C
WRITE(6,90)ALAB(IA),ALAB(IB),ALAB(IC),ALAB(ID),GAMMA(IE)
90 FORMAT(' GAMMA(',A1,',',A1,',',A1,',',A1,') = ',1F13.5)
C
100 CONTINUE
GAVE = GAV/5.0D+00
WRITE(6,110) OMEGA,GAVE
110 FORMAT(//,' AVERAGE GAMMA VALUE AT ',F10.5,' = ',1F13.5,//)
RETURN
END
SUBROUTINE NGEFIS(IGAM,X,GD3,UD3,G1,U1,GS,USMD,EPS,US)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
INCLUDE 'SIZES'
C.....................................................................
C CALCULATE GAMMA(DC-EFISHG) IN A NONITERATIVE FASHION
C.....................................................................
COMMON /MOLKST/ NUMAT,NAT(NUMATM),NFIRST(NUMATM),NMIDLE(NUMATM),
1 NLAST(NUMATM),NORBS,NELECS,NALPHA,NBETA,NCLOSE,
2 NOPEN,NDUMY,FRACT
COMMON /OMVAL/ OMEGA
COMMON /IODAF/IDAF,IRECLN,IRECST,IFILEN(145),IODA(145)
COMMON /CHANEL/ IFILES(30)
EQUIVALENCE(IW,IFILES(6))
DIMENSION X(MAXORB,MAXORB),GD3(MAXORB,MAXORB),UD3(MAXORB,MAXORB),
1 G1(MAXORB,MAXORB),U1(MAXORB,MAXORB),GS(MAXORB,MAXORB),
2 USMD(MAXORB,MAXORB),EPS(MAXORB,MAXORB),
3 GAMMA(15),US(MAXORB,MAXORB)
CHARACTER*1 ALAB
DIMENSION ALAB(3),IDA(15),IDB(15),IDC(15),IDD(15),
1 IP(3,3),IPAIR(3,3)
SAVE ALAB, IDA, IDB, IDC, IDD, IP, IPAIR
DATA ALAB /'X','Y','Z'/
C
DATA IDA /1,2,3,1,1,2,2,3,3,1,1,2,2,3,3/
DATA IDB /1,2,3,2,3,1,3,1,2,1,1,2,2,3,3/
DATA IDC /1,2,3,1,1,2,2,3,3,2,3,1,3,1,2/
DATA IDD /1,2,3,2,3,1,3,1,2,2,3,1,3,1,2/
DATA IP /1,2,3,2,4,5,3,5,6/
DATA IPAIR /1,4,7,2,5,8,3,6,9/
ONE=1.D0
MSQ = NORBS*NORBS
WRITE(6,10) OMEGA
10 FORMAT (//,
1 ' GAMMA (DC-EFISHG) AT ',F10.5,' EV.'//)
C
C GET DATA FROM ALPHA AND ITERATIVE BETA CALCULATIONS
C
C REQUIRED RECORDS FROM POLARIZABILITY CALCULATIONS
C -------------------------------------------------------
C 0 W 2W 3W
C
C -02- -08- -14- -20- -U- MATRIX FOR -X- DIRECTION
C -03- -09- -15- -21- -U- MATRIX FOR -Y- DIRECTION
C -04- -10- -16- -22- -U- MATRIX FOR -Z- DIRECTION
C -05- -11- -17- -23- -G- MATRIX FOR -X- DIRECTION
C -06- -12- -18- -24- -G- MATRIX FOR -Y- DIRECTION
C -07- -13- -19- -25- -G- MATRIX FOR -Z- DIRECTION
C -------------------------------------------------------
C (0,0) (W,W) (0,W) (W,-W)
C
C -26- -50- -74- -110- -U- MATRIX FOR -XX- DIRECTION
C -27- -51- -75- -111- -U- MATRIX FOR -XY- DIRECTION
C -28- -52- -76- -112- -U- MATRIX FOR -XZ- DIRECTION
C -77- -113- -U- MATRIX DOE -YX- DIRECTION
C -29- -53- -78- -114- -U- MATRIX FOR -YY- DIRECTION
C -30- -54- -79- -115- -U- MATRIX FOR -YZ- DIRECTION
C -80- -116- -U- MATRIX FOR -ZX- DIRECTION
C -81- -117- -U- MATRIX FOR -ZY- DIRECTION
C -31- -55- -82- -118- -U- MATRIX FOR -ZZ- DIRECTION
C ------------------------------------------------------------------
C
C -32- -56- -83- -119- -G- MATRIX FOR -XX- DIRECTION
C -33- -57- -84- -120- -G- MATRIX FOR -XY- DIRECTION
C -34- -58- -85- -121- -G- MATRIX FOR -XZ- DIRECTION
C -86- -122- -G- MATRIX FOR -YX- DIRECTION
C -35- -59- -87- -123- -G- MATRIX FOR -YY- DIRECTION
C -36- -60- -88- -124- -G- MATRIX FOR -YZ- DIRECTION
C -89- -125- -G- MATRIX FOR -ZX- DIRECTION
C -90- -126- -G- MATRIX FOR -ZY- DIRECTION
C -37- -61- -91- -127- -G- MATRIX FOR -ZZ- DIRECTION
C ------------------------------------------------------------------
C
C -38- -62- -92- -128- -E- MATRIX FOR -XX- DIRECTION
C -39- -63- -93- -129- -E- MATRIX FOR -XY- DIRECTION
C -40- -64- -94- -130- -E- MATRIX FOR -XZ- DIRECTION
C -95- -131- -E- MATRIX FOR -YX- DIRECTION
C -41- -65- -96- -132- -E- MATRIX FOR -YY- DIRECTION
C -42- -66- -97- -133- -E- MATRIX FOR -YZ- DIRECTION
C -98- -134- -E- MATRIX FOR -ZX- DIRECTION
C -99- -135- -E- MATRIX FOR -ZY- DIRECTION
C -43- -67- -100- -136- -E- MATRIX FOR -ZZ- DIRECTION
C ------------------------------------------------------------------
C
C -44- -68- -101- -137- -UM- MATRIX FOR -XX- DIRECTION
C -45- -69- -102- -138- -UM- MATRIX FOR -XY- DIRECTION
C -46- -70- -103- -139- -UM- MATRIX FOR -XZ- DIRECTION
C -104- -140- -UM- MATRIX FOR -YX- DIRECTION
C -47- -71- -105- -141- -UM- MATRIX FOR -YY- DIRECTION
C -48- -72- -106- -142- -UM- MATRIX FOR -YZ- DIRECTION
C -107- -143- -UM- MATRIX FOR -ZX- DIRECTION
C -108- -144- -UM- MATRIX FOR -ZY- DIRECTION
C -49- -73- -109- -145- -UM- MATRIX FOR -ZZ- DIRECTION
C ------------------------------------------------------------------
C
C CALCULATION OF DIFFERENT GAMMA VALUES IN A NONITERATIVE METHOD.
C
C IGAM=2 (DC-ELECTIC FIELD INDUCED SECOND HARMONIC GENERATION)
C
JGARC=16
JUARC=13
JUREC=01
JGREC=04
JG2REC=55
JU2REC=49
JU2MRC=67
JEPREC=61
C LOOP BEGINS FOR THE CALCULATION OF GAMMA(ABCD)
C
GAV = 0.0D00
DO 90 IE=1,15
IA=IDA(IE)
IB=IDB(IE)
IC=IDC(IE)
ID=IDD(IE)
ICD=IP(IC,ID)
IBD=IPAIR(IB,ID)
IBC=IPAIR(IB,IC)
C
C READ IN THE FIRST ORDER U3 OMEGA AND G3 OMEGA IN THE DIRECTION A
C MAKE GD3 OMEGA MATRIX FROM G3 MATRIX
C
CALL DAREAD(X,MSQ,JGARC+IA)
CALL FHPATN(GD3,X,NORBS,2,ONE)
C
C MAKE UD3 OMEGA MATRIX FROM U3 OMEGA MATRIX
C
CALL DAREAD(X,MSQ,JUARC+IA)
CALL FHPATN(UD3,X,NORBS,2,-ONE)
YY=0.0D00
IMOVE=1
20 CONTINUE
C
C DC EFISHG
C
30 GO TO (40,50,60), IMOVE
40 J2=IB
J34=ICD
GO TO 70
50 J2=IC+6
C J34=IBD+24
J3U=IBD+24
J3G=IBD+27
J3E=IBD+30
J3UM=IBD+33
GO TO 70
60 J2=ID+6
J3U=IBC+24
J3G=IBC+27
J3E=IBC+30
J3UM=IBC+33
70 CONTINUE
C
C READ IN G1,U1,GS,US,UMS,EPS
C
C CALL UB
C
CALL DAREAD(U1,MSQ,JUREC+J2)
C CALL GB
CALL DAREAD(G1,MSQ,JGREC+J2)
IF (IMOVE .EQ. 1) THEN
C CALL GCD
CALL DAREAD(GS,MSQ,JG2REC+J34)
C CALL UCD
CALL DAREAD(US,MSQ,JU2REC+J34)
C CALL USMD
CALL DAREAD(USMD,MSQ,JU2MRC+J34)
C CALL EPCD
CALL DAREAD(EPS,MSQ,JEPREC+J34)
C
ELSE
C CALL GCD
CALL DAREAD(GS,MSQ,JG2REC+J3G)
C CALL UCD
CALL DAREAD(US,MSQ,JU2REC+J3U)
C CALL USMD
CALL DAREAD(USMD,MSQ,JU2MRC+J3UM)
C CALL EPCD
CALL DAREAD(EPS,MSQ,JEPREC+J3E)
ENDIF
C
C FIRST KIND
C
YY = YY+TRSUB(UD3,G1,US,NCLOSE,NORBS,NORBS)
YY = YY-TRSUB(USMD,G1,UD3,NCLOSE,NORBS,NORBS)
YY = YY-TRSUB(UD3,G1,US,NORBS,NCLOSE,NORBS)
YY = YY+TRSUB(USMD,G1,UD3,NORBS,NCLOSE,NORBS)
C
C SECOND KIND
C
YY = YY+TRSUB(UD3,GS,U1,NCLOSE,NORBS,NORBS)
YY = YY+TRSUB(U1,GS,UD3,NCLOSE,NORBS,NORBS)
YY = YY-TRSUB(UD3,EPS,U1,NORBS,NCLOSE,NORBS)
YY = YY-TRSUB(U1,EPS,UD3,NORBS,NCLOSE,NORBS)
C
C THIRD KIND
C
YY = YY+TRSUB(U1,GD3,US,NCLOSE,NORBS,NORBS)
YY = YY-TRSUB(USMD,GD3,U1,NCLOSE,NORBS,NORBS)
YY = YY-TRSUB(U1,GD3,US,NORBS,NCLOSE,NORBS)
YY = YY+TRSUB(USMD,GD3,U1,NORBS,NCLOSE,NORBS)
C
IMOVE=IMOVE+1
IF (IMOVE .LE. 3) GO TO 20
C
GAMMA(IE) = YY
C CALCULATE THE AVERAGE GAMMA VALUE
IF (IE .LE. 3) THEN
GAV = GAV + 3*YY
ELSEIF (IE .GT. 9) THEN
GAV = GAV + YY
ELSE
GAV = GAV + 2*YY
ENDIF
C
C WRITE GAMMA(ABCD)
C
WRITE(6,80) ALAB(IA),ALAB(IB),ALAB(IC),ALAB(ID),GAMMA(IE)
80 FORMAT(' GAMMA(',A1,',',A1,',',A1,',',A1,') = ',1PD14.7)
C
90 CONTINUE
GAVE = GAV/15.0D+00
WRITE(6,100) OMEGA,GAVE
100 FORMAT(//,' AVERAGE GAMMA VALUE AT ',F10.5, ' EV = ',1PD14.7,//)
RETURN
END
SUBROUTINE NGIDRI(IGAM,X,GD3,UD3,G1,U1,GS,USMD,EPS,US)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
INCLUDE 'SIZES'
C.....................................................................
C CALCULATE GAMMA(IDRI) IN A NONITERATIVE FASHION
C.....................................................................
COMMON /MOLKST/ NUMAT,NAT(NUMATM),NFIRST(NUMATM),NMIDLE(NUMATM),
1 NLAST(NUMATM),NORBS,NELECS,NALPHA,NBETA,NCLOSE,
2 NOPEN,NDUMY,FRACT
COMMON /OMVAL/ OMEGA
COMMON /IODAF/IDAF,IRECLN,IRECST,IFILEN(145),IODA(145)
COMMON /CHANEL/ IFILES(30)
EQUIVALENCE(IW,IFILES(6))
DIMENSION X(MAXORB,MAXORB),GD3(MAXORB,MAXORB),UD3(MAXORB,MAXORB),
1 G1(MAXORB,MAXORB),U1(MAXORB,MAXORB),GS(MAXORB,MAXORB),
2 USMD(MAXORB,MAXORB),EPS(MAXORB,MAXORB),
3 GAMMA(15),US(MAXORB,MAXORB)
DIMENSION ALAB(3),IDA(15),IDB(15),IDC(15),IDD(15),
1 IP(3,3),IPAIR(3,3)
CHARACTER*1 ALAB
SAVE ALAB, IDA, IDB, IDC, IDD, IP, IPAIR
DATA ALAB /'X','Y','Z'/
C
DATA IDA /1,2,3,1,1,2,2,3,3,1,1,2,2,3,3/
DATA IDB /1,2,3,1,1,2,2,3,3,2,3,1,3,1,2/
DATA IDC /1,2,3,2,3,1,3,1,2,2,3,1,3,1,2/
DATA IDD /1,2,3,2,3,1,3,1,2,1,1,2,2,3,3/
DATA IP /1,2,3,2,4,5,3,5,6/
DATA IPAIR /1,4,7,2,5,8,3,6,9/
ONE=1.0D00
MSQ = NORBS*NORBS
C
WRITE(6,10) OMEGA
10 FORMAT (//,
1 ' GAMMA (IDRI) AT ',F10.5,' EV.'//)
C
C GET DATA FROM ALPHA AND ITERATIVE BETA CALCULATIONS
C
C
C IGAM=3 (INTENSITY DEPENDENT REFRACTIVE INDEX OR DEGENERATED FOUR
C WAVE MIXING)
C
JGARC=10
JUARC=07
JUREC=07
JGREC=10
C LOOP BEGINS FOR THE CALCULATION OF GAMMA(ABCD)
C
GAV = 0.0D+00
DO 80 IE=1,15
IA=IDA(IE)
IB=IDB(IE)
IC=IDC(IE)
ID=IDD(IE)
ICD=IPAIR(IC,ID)
IBD=IPAIR(IB,ID)
IBC=IP(IB,IC)
C
C READ IN THE FIRST ORDER U3 OMEGA AND G3 OMEGA IN THE DIRECTION A
C
C MAKE GD3 OMEGA MATRIX FROM G3 MATRIX
C
CALL DAREAD(X,MSQ,JGARC+IA)
CALL FHPATN(GD3,X,NORBS,2,ONE)
C
C MAKE UD3 OMEGA MATRIX FROM U3 OMEGA MATRIX
C
CALL DAREAD(X,MSQ,JUARC+IA)
CALL FHPATN(UD3,X,NORBS,2,-ONE)
C
YY=0.0D00
IMOVE=1
20 CONTINUE
C
C
C IDRI
C
GO TO (30,40,50), IMOVE
30 J2= IB
J34=ICD
JG2REC=118
JU2REC=109
JU2MRC=136
JEPREC=127
GO TO 60
40 J2=IC
J34=IBD
JG2REC=118
JU2REC=109
JU2MRC=136
JEPREC=127
GO TO 60
50 J2=ID
J34=IBC
JG2REC= 55
JU2REC= 49
JU2MRC= 67
JEPREC= 61
60 CONTINUE
C READ IN G1,U1,GS,US,UMS,EPS
C
C CALL UB
IF (IMOVE.EQ.3) THEN
CALL DAREAD(X,MSQ,JUREC+J2)
CALL FHPATN(U1,X,NORBS,2,-ONE)
ELSE
CALL DAREAD(U1,MSQ,JUREC+J2)
ENDIF
C CALL GB
IF (IMOVE.EQ.3) THEN
CALL DAREAD(X,MSQ,JGREC+J2)
CALL FHPATN(G1,X,NORBS,2,ONE)
ELSE
CALL DAREAD(G1,MSQ,JGREC+J2)
ENDIF
C CALL GCD
CALL DAREAD(GS,MSQ,JG2REC+J34)
C CALL UCD
CALL DAREAD(US,MSQ,JU2REC+J34)
C CALL USMD
CALL DAREAD(USMD,MSQ,JU2MRC+J34)
C CALL EPCD
CALL DAREAD(EPS,MSQ,JEPREC+J34)
C
C FIRST KIND
C
YY = YY+TRSUB(UD3,G1,US,NCLOSE,NORBS,NORBS)
YY = YY-TRSUB(USMD,G1,UD3,NCLOSE,NORBS,NORBS)
YY = YY-TRSUB(UD3,G1,US,NORBS,NCLOSE,NORBS)
YY = YY+TRSUB(USMD,G1,UD3,NORBS,NCLOSE,NORBS)
C
C SECOND KIND
C
YY = YY+TRSUB(UD3,GS,U1,NCLOSE,NORBS,NORBS)
YY = YY+TRSUB(U1,GS,UD3,NCLOSE,NORBS,NORBS)
YY = YY-TRSUB(UD3,EPS,U1,NORBS,NCLOSE,NORBS)
YY = YY-TRSUB(U1,EPS,UD3,NORBS,NCLOSE,NORBS)
C
C THIRD KIND
C
YY = YY+TRSUB(U1,GD3,US,NCLOSE,NORBS,NORBS)
YY = YY-TRSUB(USMD,GD3,U1,NCLOSE,NORBS,NORBS)
YY = YY-TRSUB(U1,GD3,US,NORBS,NCLOSE,NORBS)
YY = YY+TRSUB(USMD,GD3,U1,NORBS,NCLOSE,NORBS)
C
IMOVE=IMOVE+1
IF (IMOVE .LE. 3) GO TO 20
C
GAMMA(IE) = YY
C
C CALCULATE THE AVERAGE GAMMA VALUE
C
IF (IE .LE. 3) THEN
GAV = GAV + 3.0D0*YY
ELSEIF (IE .GT. 9) THEN
GAV = GAV + YY
ELSE
GAV = GAV + 2.0D0*YY
ENDIF
C
C WRITE GAMMA(ABCD)
C
WRITE(6,70) ALAB(IA),ALAB(IB),ALAB(IC),ALAB(ID),GAMMA(IE)
70 FORMAT(' GAMMA(',A1,',',A1,',',A1,',',A1,') = ',1PD14.7)
C
80 CONTINUE
GAVE = GAV/15.0D+00
WRITE(6,90) OMEGA,GAVE
90 FORMAT(//,' AVERAGE GAMMA VALUE AT ',F10.5,' = ',1PD14.7,//)
RETURN
END
SUBROUTINE NGOKE(IGAM,X,GD3,UD3,G1,U1,GS,USMD,EPS,US)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
INCLUDE 'SIZES'
C.....................................................................
C CALCULATE GAMMA(OKE) IN A NONITERATIVE FASHION
C.....................................................................
COMMON /MOLKST/ NUMAT,NAT(NUMATM),NFIRST(NUMATM),NMIDLE(NUMATM),
1 NLAST(NUMATM),NORBS,NELECS,NALPHA,NBETA,NCLOSE,
2 NOPEN,NDUMY,FRACT
COMMON /OMVAL/ OMEGA
COMMON /IODAF/IDAF,IRECLN,IRECST,IFILEN(145),IODA(145)
COMMON /CHANEL/ IFILES(30)
EQUIVALENCE(IW,IFILES(6))
DIMENSION X(MAXORB,MAXORB),GD3(MAXORB,MAXORB),UD3(MAXORB,MAXORB),
1 G1(MAXORB,MAXORB),U1(MAXORB,MAXORB),GS(MAXORB,MAXORB),
2 USMD(MAXORB,MAXORB),EPS(MAXORB,MAXORB),
3 GAMMA(15),US(MAXORB,MAXORB)
CHARACTER*1 ALAB
DIMENSION ALAB(3),IDA(15),IDB(15),IDC(15),IDD(15),
1 IP(3,3),IPAIR(3,3)
SAVE ALAB, IDA, IDB, IDC, IDD, IP, IPAIR
DATA ALAB /'X','Y','Z'/
C
DATA IDA /1,2,3,1,1,2,2,3,3,1,1,2,2,3,3/
DATA IDB /1,2,3,1,1,2,2,3,3,2,3,1,3,1,2/
DATA IDC /1,2,3,2,3,1,3,1,2,2,3,1,3,1,2/
DATA IDD /1,2,3,2,3,1,3,1,2,1,1,2,2,3,3/
DATA IP /1,2,3,2,4,5,3,5,6/
DATA IPAIR /1,4,7,2,5,8,3,6,9/
ONE=1.0D00
MSQ = NORBS*NORBS
C
IF (IGAM .EQ. 3 ) THEN
WRITE(6,10) OMEGA
10 FORMAT (//,
1 ' GAMMA (IDRI) AT ',F10.5,' EV.'//)
ELSE
WRITE(6,20) OMEGA
20 FORMAT (//,
1 ' GAMMA (OKE) AT ',F10.5,' EV.'//)
ENDIF
C
C DATA INCLUDING YX, ZY, ZX DIRECTIONS
C GET DATA FROM ALPHA AND ITERATIVE BETA CALCULATIONS
C
C REQUIRED RECORDS FROM POLARIZABILITY CALCULATIONS
C
C -------------------------------------------------------
C 0 W 2W 3W
C
C -02- -08- -14- -20- -U- MATRIX FOR -X- DIRECTION
C -03- -09- -15- -21- -U- MATRIX FOR -Y- DIRECTION
C -04- -10- -16- -22- -U- MATRIX FOR -Z- DIRECTION
C -05- -11- -17- -23- -G- MATRIX FOR -X- DIRECTION
C -06- -12- -18- -24- -G- MATRIX FOR -Y- DIRECTION
C -07- -13- -19- -25- -G- MATRIX FOR -Z- DIRECTION
C -------------------------------------------------------
C (0,0) (W,W) (0,W) (W,-W)
C
C -26- -50- -74- -110- -U- MATRIX FOR -XX- DIRECTION
C -27- -51- -75- -111- -U- MATRIX FOR -XY- DIRECTION
C -28- -52- -76- -112- -U- MATRIX FOR -XZ- DIRECTION
C -77- -113- -U- MATRIX DOE -YX- DIRECTION
C -29- -53- -78- -114- -U- MATRIX FOR -YY- DIRECTION
C -30- -54- -79- -115- -U- MATRIX FOR -YZ- DIRECTION
C -80- -116- -U- MATRIX FOR -ZX- DIRECTION
C -81- -117- -U- MATRIX FOR -ZY- DIRECTION
C -31- -55- -82- -118- -U- MATRIX FOR -ZZ- DIRECTION
C ------------------------------------------------------------------
C
C -32- -56- -83- -119- -G- MATRIX FOR -XX- DIRECTION
C -33- -57- -84- -120- -G- MATRIX FOR -XY- DIRECTION
C -34- -58- -85- -121- -G- MATRIX FOR -XZ- DIRECTION
C -86- -122- -G- MATRIX FOR -YX- DIRECTION
C -35- -59- -87- -123- -G- MATRIX FOR -YY- DIRECTION
C -36- -60- -88- -124- -G- MATRIX FOR -YZ- DIRECTION
C -89- -125- -G- MATRIX FOR -ZX- DIRECTION
C -90- -126- -G- MATRIX FOR -ZY- DIRECTION
C -37- -61- -91- -127- -G- MATRIX FOR -ZZ- DIRECTION
C ------------------------------------------------------------------
C
C -38- -62- -92- -128- -E- MATRIX FOR -XX- DIRECTION
C -39- -63- -93- -129- -E- MATRIX FOR -XY- DIRECTION
C -40- -64- -94- -130- -E- MATRIX FOR -XZ- DIRECTION
C -95- -131- -E- MATRIX FOR -YX- DIRECTION
C -41- -65- -96- -132- -E- MATRIX FOR -YY- DIRECTION
C -42- -66- -97- -133- -E- MATRIX FOR -YZ- DIRECTION
C -98- -134- -E- MATRIX FOR -ZX- DIRECTION
C -99- -135- -E- MATRIX FOR -ZY- DIRECTION
C -43- -67- -100- -136- -E- MATRIX FOR -ZZ- DIRECTION
C ------------------------------------------------------------------
C
C -44- -68- -101- -137- -UM- MATRIX FOR -XX- DIRECTION
C -45- -69- -102- -138- -UM- MATRIX FOR -XY- DIRECTION
C -46- -70- -103- -139- -UM- MATRIX FOR -XZ- DIRECTION
C -104- -140- -UM- MATRIX FOR -YX- DIRECTION
C -47- -71- -105- -141- -UM- MATRIX FOR -YY- DIRECTION
C -48- -72- -106- -142- -UM- MATRIX FOR -YZ- DIRECTION
C -107- -143- -UM- MATRIX FOR -ZX- DIRECTION
C -108- -144- -UM- MATRIX FOR -ZY- DIRECTION
C -49- -73- -109- -145- -UM- MATRIX FOR -ZZ- DIRECTION
C ------------------------------------------------------------------
C
C GET DATA FROM ALPHA AND ITERATIVE BETA CALCULATIONS
C
C
C IGAM=4 (OPTICAL KERR EFFECT)
C
JGARC=10
JUARC=07
JUREC=01
JGREC=04
C LOOP BEGINS FOR THE CALCULATION OF GAMMA(ABCD)
C
GAV = 0.0D+00
DO 90 IE=1,15
IA=IDA(IE)
IB=IDB(IE)
IC=IDC(IE)
ID=IDD(IE)
ICD=IPAIR(IC,ID)
IBD=IPAIR(IB,ID)
IBC=IP(IB,IC)
C
C READ IN THE FIRST ORDER U3 OMEGA AND G3 OMEGA IN THE DIRECTION A
C
C MAKE GD3 OMEGA MATRIX FROM G3 MATRIX
C
CALL DAREAD(X,MSQ,JGARC+IA)
CALL FHPATN(GD3,X,NORBS,2,ONE)
C
C MAKE UD3 OMEGA MATRIX FROM U3 OMEGA MATRIX
C
CALL DAREAD(X,MSQ,JUARC+IA)
CALL FHPATN(UD3,X,NORBS,2,-ONE)
C
YY=0.0D00
IMOVE=1
30 CONTINUE
C
C OKE
GO TO (40,50,60), IMOVE
40 J2= IB
J34=ICD
JG2REC=82
JU2REC=73
JU2MRC=100
JEPREC=91
GO TO 70
50 J2=IC
J34=IBD
JG2REC=82
JU2REC=73
JU2MRC=100
JEPREC=91
GO TO 70
60 J2=ID
J34=IBC
JG2REC=31
JU2REC=25
JU2MRC=43
JEPREC=37
70 CONTINUE
C READ IN G1,U1,GS,US,UMS,EPS
C
C CALL UB
IF (IMOVE.EQ.3) THEN
CALL DAREAD(U1,MSQ,JUARC+J2)
ELSE
CALL DAREAD(U1,MSQ,JUREC+J2)
ENDIF
C CALL GB
IF (IMOVE.EQ.3) THEN
CALL DAREAD(G1,MSQ,JGARC+J2)
ELSE
CALL DAREAD(G1,MSQ,JGREC+J2)
ENDIF
C CALL GCD
CALL DAREAD(GS,MSQ,JG2REC+J34)
C CALL UCD
CALL DAREAD(US,MSQ,JU2REC+J34)
C CALL USMD
CALL DAREAD(USMD,MSQ,JU2MRC+J34)
C CALL EPCD
CALL DAREAD(EPS,MSQ,JEPREC+J34)
C
C FIRST KIND
C
YY = YY+TRSUB(UD3,G1,US,NCLOSE,NORBS,NORBS)
YY = YY-TRSUB(USMD,G1,UD3,NCLOSE,NORBS,NORBS)
YY = YY-TRSUB(UD3,G1,US,NORBS,NCLOSE,NORBS)
YY = YY+TRSUB(USMD,G1,UD3,NORBS,NCLOSE,NORBS)
C
C SECOND KIND
C
YY = YY+TRSUB(UD3,GS,U1,NCLOSE,NORBS,NORBS)
YY = YY+TRSUB(U1,GS,UD3,NCLOSE,NORBS,NORBS)
YY = YY-TRSUB(UD3,EPS,U1,NORBS,NCLOSE,NORBS)
YY = YY-TRSUB(U1,EPS,UD3,NORBS,NCLOSE,NORBS)
C
C THIRD KIND
C
YY = YY+TRSUB(U1,GD3,US,NCLOSE,NORBS,NORBS)
YY = YY-TRSUB(USMD,GD3,U1,NCLOSE,NORBS,NORBS)
YY = YY-TRSUB(U1,GD3,US,NORBS,NCLOSE,NORBS)
YY = YY+TRSUB(USMD,GD3,U1,NORBS,NCLOSE,NORBS)
C
IMOVE=IMOVE+1
IF (IMOVE .LE. 3) GO TO 30
C
GAMMA(IE) = YY
C
C CALCULATE THE AVERAGE GAMMA VALUE
C
IF (IE .LE. 3) THEN
GAV = GAV + 3.0D0*YY
ELSEIF (IE .GT. 9) THEN
GAV = GAV + YY
ELSE
GAV = GAV + 2.0D0*YY
ENDIF
C
C WRITE GAMMA(ABCD)
C
WRITE(6,80) ALAB(IA),ALAB(IB),ALAB(IC),ALAB(ID),GAMMA(IE)
80 FORMAT(' GAMMA(',A1,',',A1,',',A1,',',A1,') = ',1PD14.7)
C
90 CONTINUE
GAVE = GAV/15.0D+00
WRITE(6,100) OMEGA,GAVE
100 FORMAT(//,' AVERAGE GAMMA VALUE AT ',F10.5,' = ',1PD14.7,//)
RETURN
END
SUBROUTINE NONBET (U1X,U1Y,U1Z,U2X,U2Y,U2Z,
1 G1X,G1Y,G1Z,G2X,G2Y,G2Z)
C
C THIS SUBROUTINE CALCULATES SECOND HARMONIC GENERATION IN A
C NONITERATIVE WAY.
C
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
INCLUDE 'SIZES'
C.....................................................................
C CALCULATE BETA IN A NONITERATIVE FASHION
C.....................................................................
COMMON /MOLKST/ NUMAT,NAT(NUMATM),NFIRST(NUMATM),NMIDLE(NUMATM),
1 NLAST(NUMATM),NORBS,NELECS,NALPHA,NBETA,NCLOSE,
2 NOPEN,NDUMY,FRACT
COMMON /OMVAL/ OMEGA
COMMON /CHANEL/ IFILES(30)
EQUIVALENCE(IW,IFILES(6))
DIMENSION U1X(MAXORB,MAXORB),U1Y(MAXORB,MAXORB),U1Z(MAXORB,MAXORB)
DIMENSION U2X(MAXORB,MAXORB),U2Y(MAXORB,MAXORB),U2Z(MAXORB,MAXORB)
DIMENSION G1X(MAXORB,MAXORB),G1Y(MAXORB,MAXORB),G1Z(MAXORB,MAXORB)
DIMENSION G2X(MAXORB,MAXORB),G2Y(MAXORB,MAXORB),G2Z(MAXORB,MAXORB)
C
C GET DATA FROM ALPHA CALCULATIONS
C
MAXSQ = NORBS*NORBS
BAVX = 0.0D+00
BAVY = 0.0D+00
BAVZ = 0.0D+00
CALL DAREAD (U1X,MAXSQ,8)
CALL DAREAD (U1Y,MAXSQ,9)
CALL DAREAD (U1Z,MAXSQ,10)
CALL DAREAD (G1X,MAXSQ,11)
CALL DAREAD (G1Y,MAXSQ,12)
CALL DAREAD (G1Z,MAXSQ,13)
CALL DAREAD (U2X,MAXSQ,14)
CALL DAREAD (U2Y,MAXSQ,15)
CALL DAREAD (U2Z,MAXSQ,16)
CALL DAREAD (G2X,MAXSQ,17)
CALL DAREAD (G2Y,MAXSQ,18)
CALL DAREAD (G2Z,MAXSQ,19)
C XXX
CALL BETCOM (U1X,G1X,U2X,G2X,NCLOSE,NORBS,BXXX)
BAVX = BAVX +3.0D0 * BXXX
C YXX
CALL BETCOM (U1X,G1X,U2Y,G2Y,NCLOSE,NORBS,BYXX)
BAVY = BAVY + BYXX
C ZXX
CALL BETCOM (U1X,G1X,U2Z,G2Z,NCLOSE,NORBS,BZXX)
BAVZ = BAVZ + BZXX
C XXY
CALL BETALL (U2X,G2X,U1X,G1X,U1Y,G1Y,NCLOSE,NORBS,BXXY)
BAVY = BAVY + BXXY
C YXY
CALL BETALL (U2Y,G2Y,U1X,G1X,U1Y,G1Y,NCLOSE,NORBS,BYXY)
BAVX = BAVX + BYXY
C ZXY
CALL BETALL (U2Z,G2Z,U1X,G1X,U1Y,G1Y,NCLOSE,NORBS,BZXY)
C XXZ
CALL BETALL (U2X,G2X,U1X,G1X,U1Z,G1Z,NCLOSE,NORBS,BXXZ)
BAVZ = BAVZ + BXXZ
C YXZ
CALL BETALL (U2Y,G2Y,U1X,G1X,U1Z,G1Z,NCLOSE,NORBS,BYXZ)
C ZXZ
CALL BETALL (U2Z,G2Z,U1X,G1X,U1Z,G1Z,NCLOSE,NORBS,BZXZ)
BAVX = BAVX + BZXZ
C XYX
CALL BETALL (U2X,G2X,U1Y,G1Y,U1X,G1X,NCLOSE,NORBS,BXYX)
BAVY = BAVY + BXYX
C YYX
CALL BETALL (U2Y,G2Y,U1Y,G1Y,U1X,G1X,NCLOSE,NORBS,BYYX)
BAVX = BAVX + BYYX
C ZYX
CALL BETALL (U2Z,G2Z,U1Y,G1Y,U1X,G1X,NCLOSE,NORBS,BZYX)
C XYY
CALL BETCOM (U1Y,G1Y,U2X,G2X,NCLOSE,NORBS,BXYY)
BAVX = BAVX + BXYY
C YYY
CALL BETCOM (U1Y,G1Y,U2Y,G2Y,NCLOSE,NORBS,BYYY)
BAVY = BAVY + 3.0D0*BYYY
C ZYY
CALL BETCOM (U1Y,G1Y,U2Z,G2Z,NCLOSE,NORBS,BZYY)
BAVZ = BAVZ + BZYY
C XYZ
CALL BETALL (U2X,G2X,U1Y,G1Y,U1Z,G1Z,NCLOSE,NORBS,BXYZ)
C YYZ
CALL BETALL (U2Y,G2Y,U1Y,G1Y,U1Z,G1Z,NCLOSE,NORBS,BYYZ)
BAVZ = BAVZ + BYYZ
C ZYZ
CALL BETALL (U2Z,G2Z,U1Y,G1Y,U1Z,G1Z,NCLOSE,NORBS,BZYZ)
BAVY = BAVY + BZYZ
C XZX
CALL BETALL (U2X,G2X,U1Z,G1Z,U1X,G1X,NCLOSE,NORBS,BXZX)
BAVZ = BAVZ + BXZX
C YZX
CALL BETALL (U2Y,G2Y,U1Z,G1Z,U1X,G1X,NCLOSE,NORBS,BYZX)
C ZZX
CALL BETALL (U2Z,G2Z,U1Z,G1Z,U1X,G1X,NCLOSE,NORBS,BZZX)
BAVX = BAVX + BZZX
C XZY
CALL BETALL (U2X,G2X,U1Z,G1Z,U1Y,G1Y,NCLOSE,NORBS,BXZY)
C YZY
CALL BETALL (U2Y,G2Y,U1Z,G1Z,U1Y,G1Y,NCLOSE,NORBS,BYZY)
BAVZ = BAVZ + BYZY
C ZZY
CALL BETALL (U2Z,G2Z,U1Z,G1Z,U1Y,G1Y,NCLOSE,NORBS,BZZY)
BAVY = BAVY + BZZY
C XZZ
CALL BETCOM (U1Z,G1Z,U2X,G2X,NCLOSE,NORBS,BXZZ)
BAVX = BAVX + BXZZ
C YZZ
CALL BETCOM (U1Z,G1Z,U2Y,G2Y,NCLOSE,NORBS,BYZZ)
BAVY = BAVY + BYZZ
C ZZZ
CALL BETCOM (U1Z,G1Z,U2Z,G2Z,NCLOSE,NORBS,BZZZ)
BAVZ = BAVZ + 3.0D0 * BZZZ
C
BAVX = BAVX/5.0D+00
BAVY = BAVY/5.0D+00
BAVZ = BAVZ/5.0D+00
C
BVEC = (BAVX*BAVX+BAVY*BAVY+BAVZ*BAVZ)**0.5D+00
WRITE(6,10)
10 FORMAT (//, ' BETA (SECOND HARMONIC GENERATION)'//)
WRITE(6,20) BXXX,BYXX,BZXX,BXXY,BYXY,BZXY,
1 BXXZ,BYXZ,BZXZ,BXYX,BYYX,BZYX,
2 BXYY,BYYY,BZYY,BXYZ,BYYZ,BZYZ,
3 BXZX,BYZX,BZZX,BXZY,BYZY,BZZY,
4 BXZZ,BYZZ,BZZZ
20 FORMAT (//,' BXXX ',D15.8,' BYXX ',D15.8,' BZXX ',D15.8,/,
1 ' BXXY ',D15.8,' BYXY ',D15.8,' BZXY ',D15.8,/,
2 ' BXXZ ',D15.8,' BYXZ ',D15.8,' BZXZ ',D15.8,/,
3 ' BXYX ',D15.8,' BYYX ',D15.8,' BZYX ',D15.8,/,
4 ' BXYY ',D15.8,' BYYY ',D15.8,' BZYY ',D15.8,/,
5 ' BXYZ ',D15.8,' BYYZ ',D15.8,' BZYZ ',D15.8,/,
6 ' BXZX ',D15.8,' BYZX ',D15.8,' BZZX ',D15.8,/,
7 ' BXZY ',D15.8,' BYZY ',D15.8,' BZZY ',D15.8,/,
8 ' BXZZ ',D15.8,' BYZZ ',D15.8,' BZZZ ',D15.8)
C
WRITE(6,30) OMEGA,BAVX
30 FORMAT (//, ' AVERAGE BETAX(SHG) VALUE AT',F10.5, 'EV = ',
1 1F15.5 )
C
WRITE(6,40) OMEGA,BAVY
40 FORMAT (' AVERAGE BETAY(SHG) VALUE AT',F10.5, 'EV = ',
1 1F15.5 )
C
WRITE(6,50) OMEGA,BAVZ
50 FORMAT (' AVERAGE BETAZ(SHG) VALUE AT',F10.5, 'EV = ',
1 1F15.5 ,//)
C
WRITE(6,60) OMEGA,BVEC
60 FORMAT (//, ' AVERAGE BETA (SHG) VALUE AT',F10.5, 'EV = ',
1 1F15.5 ,//)
RETURN
END
SUBROUTINE NONOPE (U0X,U1Y,U1Z,U1X,U0Y,U0Z,
1 G0X,G1Y,G1Z,G1X,G0Y,G0Z)
C
C THIS SUBROUTINE CALCULATES ELECTROOPTIC POCKEL'S EFFECT
C IN A NONITERATIVE WAY.
C
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
INCLUDE 'SIZES'
C.....................................................................
C CALCULATE BETA IN A NONITERATIVE FASHION
C.....................................................................
COMMON /MOLKST/ NUMAT,NAT(NUMATM),NFIRST(NUMATM),NMIDLE(NUMATM),
1 NLAST(NUMATM),NORBS,NELECS,NALPHA,NBETA,NCLOSE,
2 NOPEN,NDUMY,FRACT
COMMON /OMVAL/ OMEGA
COMMON /CHANEL/ IFILES(30)
EQUIVALENCE(IW,IFILES(6))
DIMENSION U0X(MAXORB,MAXORB),U1Y(MAXORB,MAXORB),U1Z(MAXORB,MAXORB)
DIMENSION U1X(MAXORB,MAXORB),U0Y(MAXORB,MAXORB),U0Z(MAXORB,MAXORB)
DIMENSION G0X(MAXORB,MAXORB),G1Y(MAXORB,MAXORB),G1Z(MAXORB,MAXORB)
DIMENSION G1X(MAXORB,MAXORB),G0Y(MAXORB,MAXORB),G0Z(MAXORB,MAXORB)
C
MAXSQ = NORBS*NORBS
C
C READ DATA FROM ALPHA CALCULATION
C
BAVX = 0.0D+00
BAVY = 0.0D+00
BAVZ = 0.0D+00
C
CALL DAREAD (U0X,MAXSQ,2)
CALL DAREAD (U0Y,MAXSQ,3)
CALL DAREAD (U0Z,MAXSQ,4)
CALL DAREAD (G0X,MAXSQ,5)
CALL DAREAD (G0Y,MAXSQ,6)
CALL DAREAD (G0Z,MAXSQ,7)
CALL DAREAD (U1X,MAXSQ,8)
CALL DAREAD (U1Y,MAXSQ,9)
CALL DAREAD (U1Z,MAXSQ,10)
CALL DAREAD (G1X,MAXSQ,11)
CALL DAREAD (G1Y,MAXSQ,12)
CALL DAREAD (G1Z,MAXSQ,13)
C XXX
CALL BETALL (U1X,G1X,U0X,G0X,U1X,G1X,NCLOSE,NORBS,BXXX)
BAVX = BAVX + 3.0D0 * BXXX
C YXX
CALL BETALL (U1Y,G1Y,U0X,G0X,U1X,G1X,NCLOSE,NORBS,BYXX)
BAVY = BAVY + BYXX
C ZXX
CALL BETALL (U1Z,G1Z,U0X,G0X,U1X,G1X,NCLOSE,NORBS,BZXX)
BAVZ = BAVZ + BZXX
C XXY
CALL BETALL (U1X,G1X,U0X,G0X,U1Y,G1Y,NCLOSE,NORBS,BXXY)
BAVY = BAVY + BXXY
C YXY
CALL BETALL (U1Y,G1Y,U0X,G0X,U1Y,G1Y,NCLOSE,NORBS,BYXY)
BAVX = BAVX + BYXY
C ZXY
CALL BETALL (U1Z,G1Z,U0X,G0X,U1Y,G1Y,NCLOSE,NORBS,BZXY)
C XXZ
CALL BETALL (U1X,G1X,U0X,G0X,U1Z,G1Z,NCLOSE,NORBS,BXXZ)
BAVZ = BAVZ + BXXZ
C YXZ
CALL BETALL (U1Y,G1Y,U0X,G0X,U1Z,G1Z,NCLOSE,NORBS,BYXZ)
C ZXZ
CALL BETALL (U1Z,G1Z,U0X,G0X,U1Z,G1Z,NCLOSE,NORBS,BZXZ)
BAVX = BAVX + BZXZ
C XYX
CALL BETALL (U1X,G1X,U0Y,G0Y,U1X,G1X,NCLOSE,NORBS,BXYX)
BAVY = BAVY + BXYX
C YYX
CALL BETALL (U1Y,G1Y,U0Y,G0Y,U1X,G1X,NCLOSE,NORBS,BYYX)
BAVX = BAVX + BYYX
C ZYX
CALL BETALL (U1Z,G1Z,U0Y,G0Y,U1X,G1X,NCLOSE,NORBS,BZYX)
C XYY
CALL BETALL (U1X,G1X,U0Y,G0Y,U1Y,G1Y,NCLOSE,NORBS,BXYY)
BAVX = BAVX + BXYY
C YYY
CALL BETALL (U1Y,G1Y,U0Y,G0Y,U1Y,G1Y,NCLOSE,NORBS,BYYY)
BAVY = BAVY + 3.0D0 * BYYY
C ZYY
CALL BETALL (U1Z,G1Z,U0Y,G0Y,U1Y,G1Y,NCLOSE,NORBS,BZYY)
BAVZ = BAVZ + BZYY
C XYZ
CALL BETALL (U1X,G1X,U0Y,G0Y,U1Z,G1Z,NCLOSE,NORBS,BXYZ)
C YYZ
CALL BETALL (U1Y,G1Y,U0Y,G0Y,U1Z,G1Z,NCLOSE,NORBS,BYYZ)
BAVZ = BAVZ + BYYZ
C ZYZ
CALL BETALL (U1Z,G1Z,U0Y,G0Y,U1Z,G1Z,NCLOSE,NORBS,BZYZ)
BAVY = BAVY + BZYZ
C XZX
CALL BETALL (U1X,G1X,U0Z,G0Z,U1X,G1X,NCLOSE,NORBS,BXZX)
BAVZ = BAVZ + BXZX
C YZX
CALL BETALL (U1Y,G1Y,U0Z,G0Z,U1X,G1X,NCLOSE,NORBS,BYZX)
C ZZX
CALL BETALL (U1Z,G1Z,U0Z,G0Z,U1X,G1X,NCLOSE,NORBS,BZZX)
BAVX = BAVX + BZZX
C XZY
CALL BETALL (U1X,G1X,U0Z,G0Z,U1Y,G1Y,NCLOSE,NORBS,BXZY)
C YZY
CALL BETALL (U1Y,G1Y,U0Z,G0Z,U1Y,G1Y,NCLOSE,NORBS,BYZY)
BAVZ = BAVZ + BYZY
C ZZY
CALL BETALL (U1Z,G1Z,U0Z,G0Z,U1Y,G1Y,NCLOSE,NORBS,BZZY)
BAVY = BAVY + BZZY
C XZZ
CALL BETALL (U1X,G1X,U0Z,G0Z,U1Z,G1Z,NCLOSE,NORBS,BXZZ)
BAVX = BAVX + BXZZ
C YZZ
CALL BETALL (U1Y,G1Y,U0Z,G0Z,U1Z,G1Z,NCLOSE,NORBS,BYZZ)
BAVY = BAVY + BYZZ
C ZZZ
CALL BETALL (U1Z,G1Z,U0Z,G0Z,U1Z,G1Z,NCLOSE,NORBS,BZZZ)
BAVZ = BAVZ + 3.0D0 * BZZZ
C
BAVX = BAVX/5.0D+00
BAVY = BAVY/5.0D+00
BAVZ = BAVZ/5.0D+00
C
BVEC = (BAVX*BAVX+BAVY*BAVY+BAVZ*BAVZ)**0.5D+00
WRITE(6,*) ' BETA (ELECTOPTIC POCKELS EFFECT) '
WRITE(6,10) BXXX,BYXX,BZXX,BXXY,BYXY,BZXY,
1 BXXZ,BYXZ,BZXZ,BXYX,BYYX,BZYX,
2 BXYY,BYYY,BZYY,BXYZ,BYYZ,BZYZ,
3 BXZX,BYZX,BZZX,BXZY,BYZY,BZZY,
4 BXZZ,BYZZ,BZZZ
10 FORMAT (//,' BXXX ',D15.8,' BYXX ',D15.8,' BZXX ',D15.8,/,
1 ' BXXY ',D15.8,' BYXY ',D15.8,' BZXY ',D15.8,/,
2 ' BXXZ ',D15.8,' BYXZ ',D15.8,' BZXZ ',D15.8,/,
3 ' BXYX ',D15.8,' BYYX ',D15.8,' BZYX ',D15.8,/,
4 ' BXYY ',D15.8,' BYYY ',D15.8,' BZYY ',D15.8,/,
5 ' BXYZ ',D15.8,' BYYZ ',D15.8,' BZYZ ',D15.8,/,
6 ' BXZX ',D15.8,' BYZX ',D15.8,' BZZX ',D15.8,/,
7 ' BXZY ',D15.8,' BYZY ',D15.8,' BZZY ',D15.8,/,
8 ' BXZZ ',D15.8,' BYZZ ',D15.8,' BZZZ ',D15.8)
C
WRITE(6,20) OMEGA,BAVX
20 FORMAT(//,' AVERAGE BETAX VALUE AT', F10.5, 'EV = ',
1 1F15.5 )
C
WRITE(6,30) OMEGA,BAVY
30 FORMAT(' AVERAGE BETAY VALUE AT', F10.5, 'EV = ',
1 1F15.5 )
C
WRITE(6,40) OMEGA,BAVZ
40 FORMAT(' AVERAGE BETAZ VALUE AT', F10.5, 'EV = ',
1 1F15.5 ,//)
C
WRITE(6,50) OMEGA,BVEC
50 FORMAT(//,' AVERAGE BETA(EOPE) VALUE AT', F10.5, 'EV = ',
1 1F15.5 ,//)
RETURN
END
SUBROUTINE NONOR (U0X,U1Y,U1Z,U1X,U0Y,U0Z,G0X,G1Y,G1Z,
1 G1X,G0Y,G0Z)
C
C THIS SUBROUTINE CALCULATES OPTICAL RECTIFICATION IN A
C NONITERATIVE WAY
C
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
INCLUDE 'SIZES'
C.....................................................................
C CALCULATE BETA IN A NONITERATIVE FASHION
C.....................................................................
COMMON /MOLKST/ NUMAT,NAT(NUMATM),NFIRST(NUMATM),NMIDLE(NUMATM),
1 NLAST(NUMATM),NORBS,NELECS,NALPHA,NBETA,NCLOSE,
2 NOPEN,NDUMY,FRACT
COMMON /OMVAL/ OMEGA
COMMON /CHANEL/ IFILES(30)
EQUIVALENCE(IW,IFILES(6))
DIMENSION U0X(MAXORB,MAXORB),U1Y(MAXORB,MAXORB),U1Z(MAXORB,MAXORB)
DIMENSION U1X(MAXORB,MAXORB),U0Y(MAXORB,MAXORB),U0Z(MAXORB,MAXORB)
DIMENSION G0X(MAXORB,MAXORB),G1Y(MAXORB,MAXORB),G1Z(MAXORB,MAXORB)
DIMENSION G1X(MAXORB,MAXORB),G0Y(MAXORB,MAXORB),G0Z(MAXORB,MAXORB)
MAXSQ = NORBS*NORBS
C
C READ DATA FROM ALPHA CALCULATION
C
BAVX = 0.0D+00
BAVY = 0.0D+00
BAVZ = 0.0D+00
C
CALL DAREAD (U0X,MAXSQ,2)
CALL DAREAD (U0Y,MAXSQ,3)
CALL DAREAD (U0Z,MAXSQ,4)
CALL DAREAD (G0X,MAXSQ,5)
CALL DAREAD (G0Y,MAXSQ,6)
CALL DAREAD (G0Z,MAXSQ,7)
CALL DAREAD (U1X,MAXSQ,8)
CALL DAREAD (U1Y,MAXSQ,9)
CALL DAREAD (U1Z,MAXSQ,10)
CALL DAREAD (G1X,MAXSQ,11)
CALL DAREAD (G1Y,MAXSQ,12)
CALL DAREAD (G1Z,MAXSQ,13)
C
C NONITERATIVE BETA CALCULATION
C
C XXX
CALL BETAL1 (U0X,G0X,U1X,G1X,U1X,G1X,NCLOSE,NORBS,BXXX)
BAVX = BAVX + 3.0D0* BXXX
C YXX
CALL BETAL1 (U0Y,G0Y,U1X,G1X,U1X,G1X,NCLOSE,NORBS,BYXX)
BAVY = BAVY + BYXX
C ZXX
CALL BETAL1 (U0Z,G0Z,U1X,G1X,U1X,G1X,NCLOSE,NORBS,BZXX)
BAVZ = BAVZ + BZXX
C XXY
CALL BETAL1 (U0X,G0X,U1X,G1X,U1Y,G1Y,NCLOSE,NORBS,BXXY)
BAVY = BAVY + BXXY
C YXY
CALL BETAL1 (U0Y,G0Y,U1X,G1X,U1Y,G1Y,NCLOSE,NORBS,BYXY)
BAVX = BAVX + BYXY
C ZXY
CALL BETAL1 (U0Z,G0Z,U1X,G1X,U1Y,G1Y,NCLOSE,NORBS,BZXY)
C XXZ
CALL BETAL1 (U0X,G0X,U1X,G1X,U1Z,G1Z,NCLOSE,NORBS,BXXZ)
BAVZ = BAVZ + BXXZ
C YXZ
CALL BETAL1 (U0Y,G0Y,U1X,G1X,U1Z,G1Z,NCLOSE,NORBS,BYXZ)
C ZXZ
CALL BETAL1 (U0Z,G0Z,U1X,G1X,U1Z,G1Z,NCLOSE,NORBS,BZXZ)
BAVX = BAVX + BZXZ
C XYX
CALL BETAL1 (U0X,G0X,U1Y,G1Y,U1X,G1X,NCLOSE,NORBS,BXYX)
BAVY = BAVY + BXYX
C YYX
CALL BETAL1 (U0Y,G0Y,U1Y,G1Y,U1X,G1X,NCLOSE,NORBS,BYYX)
BAVX = BAVX + BYYX
C ZYX
CALL BETAL1 (U0Z,G0Z,U1Y,G1Y,U1X,G1X,NCLOSE,NORBS,BZYX)
C XYY
CALL BETAL1 (U0X,G0X,U1Y,G1Y,U1Y,G1Y,NCLOSE,NORBS,BXYY)
BAVX = BAVX + BXYY
C YYY
CALL BETAL1 (U0Y,G0Y,U1Y,G1Y,U1Y,G1Y,NCLOSE,NORBS,BYYY)
BAVY = BAVY + 3.0D0 * BYYY
C ZYY
CALL BETAL1 (U0Z,G0Z,U1Y,G1Y,U1Y,G1Y,NCLOSE,NORBS,BZYY)
BAVZ = BAVZ + BZYY
C XYZ
CALL BETAL1 (U0X,G0X,U1Y,G1Y,U1Z,G1Z,NCLOSE,NORBS,BXYZ)
C YYZ
CALL BETAL1 (U0Y,G0Y,U1Y,G1Y,U1Z,G1Z,NCLOSE,NORBS,BYYZ)
BAVZ = BAVZ + BYYZ
C ZYZ
CALL BETAL1 (U0Z,G0Z,U1Y,G1Y,U1Z,G1Z,NCLOSE,NORBS,BZYZ)
BAVY = BAVY + BZYZ
C XZX
CALL BETAL1 (U0X,G0X,U1Z,G1Z,U1X,G1X,NCLOSE,NORBS,BXZX)
BAVZ = BAVZ + BXZX
C YZX
CALL BETAL1 (U0Y,G0Y,U1Z,G1Z,U1X,G1X,NCLOSE,NORBS,BYZX)
C ZZX
CALL BETAL1 (U0Z,G0Z,U1Z,G1Z,U1X,G1X,NCLOSE,NORBS,BZZX)
BAVX = BAVX + BZZX
C XZY
CALL BETAL1 (U0X,G0X,U1Z,G1Z,U1Y,G1Y,NCLOSE,NORBS,BXZY)
C YZY
CALL BETAL1 (U0Y,G0Y,U1Z,G1Z,U1Y,G1Y,NCLOSE,NORBS,BYZY)
BAVZ = BAVZ + BYZY
C ZZY
CALL BETAL1 (U0Z,G0Z,U1Z,G1Z,U1Y,G1Y,NCLOSE,NORBS,BZZY)
BAVY = BAVY + BZZY
C XZZ
CALL BETAL1 (U0X,G0X,U1Z,G1Z,U1Z,G1Z,NCLOSE,NORBS,BXZZ)
BAVX = BAVX + BXZZ
C YZZ
CALL BETAL1 (U0Y,G0Y,U1Z,G1Z,U1Z,G1Z,NCLOSE,NORBS,BYZZ)
BAVY = BAVY + BYZZ
C ZZZ
CALL BETAL1 (U0Z,G0Z,U1Z,G1Z,U1Z,G1Z,NCLOSE,NORBS,BZZZ)
BAVZ = BAVZ + 3.0D0 * BZZZ
C
BAVX = BAVX/5.0D+00
BAVY = BAVY/5.0D+00
BAVZ = BAVZ/5.0D+00
C
BVEC = (BAVX*BAVX+BAVY*BAVY+BAVZ*BAVZ)**0.5D+00
WRITE(6,10)
10 FORMAT (//, ' BETA (OPTICAL RECTIFICATION) ')
WRITE(6,20) BXXX,BYXX,BZXX,BXXY,BYXY,BZXY,
1 BXXZ,BYXZ,BZXZ,BXYX,BYYX,BZYX,
2 BXYY,BYYY,BZYY,BXYZ,BYYZ,BZYZ,
3 BXZX,BYZX,BZZX,BXZY,BYZY,BZZY,
4 BXZZ,BYZZ,BZZZ
20 FORMAT (//,' BXXX ',D15.8,' BYXX ',D15.8,' BZXX ',D15.8,/,
1 ' BXXY ',D15.8,' BYXY ',D15.8,' BZXY ',D15.8,/,
2 ' BXXZ ',D15.8,' BYXZ ',D15.8,' BZXZ ',D15.8,/,
3 ' BXYX ',D15.8,' BYYX ',D15.8,' BZYX ',D15.8,/,
4 ' BXYY ',D15.8,' BYYY ',D15.8,' BZYY ',D15.8,/,
5 ' BXYZ ',D15.8,' BYYZ ',D15.8,' BZYZ ',D15.8,/,
6 ' BXZX ',D15.8,' BYZX ',D15.8,' BZZX ',D15.8,/,
7 ' BXZY ',D15.8,' BYZY ',D15.8,' BZZY ',D15.8,/,
8 ' BXZZ ',D15.8,' BYZZ ',D15.8,' BZZZ ',D15.8)
C
WRITE(6,30) OMEGA,BAVX
30 FORMAT(//,' AVERAGE BETAX VALUE AT ',F10.5, 'EV = ',
1 1F15.5 )
C
WRITE(6,40) OMEGA,BAVY
40 FORMAT(' AVERAGE BETAY VALUE AT ',F10.5, 'EV = ',
1 1F15.5 )
C
WRITE(6,50) OMEGA,BAVZ
50 FORMAT(' AVERAGE BETAZ VALUE AT ',F10.5, 'EV = ',
1 1F15.5 ,//)
C
WRITE(6,60) OMEGA,BVEC
60 FORMAT(//,' AVERAGE BETA(OR) VALUE AT ',F10.5, 'EV = ',
1 1F15.5 ,//)
C
RETURN
END
SUBROUTINE OPENDA(IREST)
C
C - - - - OPEN MASTER DICTIONARY FILE 10 - - - -
C
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
C
COMMON /IODAF/ IDAF,IRECLN,IRECST,IFILEN(145),IODA(145)
COMMON /JOBNAM/ JOBNAM
COMMON /CHANEL/ IFILES(30)
CHARACTER*80 JOBNAM
EQUIVALENCE(IW,IFILES(6))
C
IDAF = 17
*VAX IRECLN = 512
IRECLN = 1023
C
C GET OPEN PARAMETERS FROM INPUT (OPTIONAL)
C
C OBTAIN DICTNRY FILE NAME FROM RUN COMMAND LINE
C
*VAX OPEN (UNIT=IDAF, FILE='DICTNRY', STATUS='UNKNOWN',
*VAX * ACCESS='DIRECT', FORM='UNFORMATTED', RECL=2*IRECLN)
C
C---------- modified by I. Cserny, June 21, 1995 -------------
C- I=INDEX(JOBNAM,' ')-1
C- OPEN(UNIT=IDAF, FILE=JOBNAM(:I)//'.POL', STATUS='UNKNOWN',
C- 1 ACCESS='DIRECT', FORM='UNFORMATTED', RECL=8*IRECLN)
OPEN(UNIT=IDAF, FILE='DICTNRY', STATUS='UNKNOWN',
1 ACCESS='DIRECT', FORM='UNFORMATTED', RECL=8*IRECLN)
C--------------------------------------------------------------
C
C ----- IS THIS A NEW OR OLD DAF FILE -----
C
IF (IREST .NE. 0) GO TO 20
C
C ----- MARK THE NEW DAF RECORDS AS EMPTY -----
C
IRECST = 1
DO 10 I = 1,145
IODA(I) = -1
10 CONTINUE
IRECST = IRECST + 1
WRITE(UNIT=IDAF, REC=1) IRECST,IODA,IFILEN,IS,IPK
RETURN
C
C ----- LOAD THE OLD DAF DIRECTORY -----
C
20 CONTINUE
READ(UNIT=IDAF, REC=1) IRECST,IODA,IFILEN,IS,IPK
RETURN
END
|