This file is indexed.

/usr/bin/ncargex is in libncarg-bin 6.2.0-3+b1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

   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
#!/bin/csh -f
#
#   $Id: ncargex.csh,v 1.175 2010-05-07 16:15:39 haley Exp $
#                                                                      
#                Copyright (C)  2000
#        University Corporation for Atmospheric Research
#                All Rights Reserved
#
# The use of this Software is governed by a License Agreement.
#

if ($#argv < 1) goto usage

#*********************************************#
#                                             #
# Make sure NCARG_ROOT is set for this script #
#                                             #
#*********************************************#
setenv NCARG_ROOT  `ncargpath root`
if ($status != 0) then
  exit 1
endif

#****************************#
#                            #
# Check for directories that #
# contain the examples       #
#                            #
#****************************#
set example_dir=`ncargpath examples`
if ($status != 0) then
  exit 1
endif

if (! -d "$example_dir") then
  echo "Example directory <$example_dir> does not exist."
  exit 1
endif
set fund_dir = $example_dir
set pdoc_dir = $example_dir

set test_dir=`ncargpath tests`
if ($status != 0) then
  exit 1
endif

if (! -d "$test_dir") then
  echo "Test directory <$test_dir> does not exist."
  exit 2
endif

set tutor_dir=`ncargpath tutorial`
if ($status != 0) then
  exit 1
endif

if (! -d "$tutor_dir") then
  echo "Test directory <$tutor_dir> does not exist."
  exit 2
endif

#*************************************************#
#                                                 #
# Initialize file types, orientation types, color #
# types, names of default output files, output    #
# messages, etc.                                  #
#                                                 #
# If new workstation types are added, this is     #
# where you specify the name for it.  The         #
# position (index, starting at "1") of the        # 
# workstation description in the following        #
# lists corresponds to its associated integer     #
# value.                                          #
#                                                 #
#*************************************************#
set file_types     = (ncgm x11 text oldps eps epsi oldpdf ps png pdf)
set orient_types = (port land)
set color_types  = (color mono)
set ws_types = (                                                   \
                "ncgm.port.color"                                  \
                "" "" "" "" "" ""                                  \
                "x11.port.color" "" "text.port.color"              \
                "oldpdf.port.color" "oldpdf.land.color"            \
                "" "" "" "" "" "" ""                               \
                "oldps.port.color" "eps.port.color" "epsi.port.color" \
                "oldps.port.mono"  "eps.port.mono"  "epsi.port.mono"  \
                "oldps.land.color" "eps.land.color" "epsi.land.color" \
                "oldps.land.mono"  "eps.land.mono"  "epsi.land.mono"  \
                "" "" "" "" "" "" "" ""                            \
                "ps.port.color" "png.port.color" "pdf.port.color" \
               )
set suffix_names = (                                               \
                "ncgm"                                             \
                "" "" "" "" "" ""                                  \
                "" "" "txt"                                        \
                "pdf" "pdf"                                        \
                "" "" "" "" "" "" ""                               \
                "ps" "eps" "epsi"                                  \
                "ps" "eps" "epsi"                                  \
                "ps" "eps" "epsi"                                  \
                "ps" "eps" "epsi"                                  \
                "" "" "" "" "" "" "" ""                            \
                "ps" "png" "pdf"                                   \
                    )
set default_msgs = (                                                       \
  "Metafile file is named"                                                 \
  "" "" "" "" "" ""                                                        \
  "" "" "Text dump file is named"                                          \
  "Older-style color portrait PDF file is named"                                       \
  "Older-style Color landscape PDF file is named"                                      \
  "" "" "" "" "" "" ""                                                     \
  "Older-style color portrait PostScript file is named"                                \
  "Color portrait encapsulated PostScript file is named"                   \
  "Color portrait interchange encapsulated PostScript file is named"       \
  "Older-style monochrome portrait PostScript file is named"                           \
  "Monochrome portrait encapsulated PostScript file is named"              \
  "Monochrome portrait interchange encapsulated PostScript file is named"  \
  "Older-style color landscape PostScript file is named"                               \
  "Color landscape encapsulated PostScript file is named"                  \
  "Color landscape interchange encapsulated PostScript file is named"      \
  "Older-style monochrome landscape PostScript file is named"                          \
  "Monochrome landscape encapsulated PostScript file is named"             \
  "Monochrome landscape interchange encapsulated PostScript file is named" \
  "" "" "" "" "" "" "" ""                                                  \
  "cairo Postscript file is named"                                         \
  ""                                                                       \
  "cairo PDF file is named"                                                \
)

set f_list
set c_list
#**********************#
#                      #
#  Set areas examples  #
#                      #
#**********************#
set areas_fex   = (arex01 arex02 arex03)
set areas_ftst  = (tareas)
set areas_fttr  = (cardb1 caredg carline cardb2 carfill carmap)
set areas_flist = ($areas_fex $areas_ftst $areas_fttr)

set areas_ctst  = (c_tareas)
set areas_clist = ($areas_ctst)
set f_list = ($f_list $areas_flist)
set c_list = ($c_list $areas_clist)

#**************************#
#                          #
#  Set autograph examples  #
#                          #
#**************************#
set autograph_fex   = (agex01 agex02 agex03 agex04 agex05 agex06 agex07 \
		      agex08 agex09 agex10 agex11 agex12 agex13 agdp01)
set autograph_ftst  = (tautog tagupw)
set autograph_ffnd  = (fagaxclr fagaxlbl fagaxmax fagcuclr fagcudsh fagezmxy \
                      fagezmy fagezxy fagezy fagilclr fagovrvw)
set autograph_flist = ($autograph_fex $autograph_ftst $autograph_ffnd)

set autograph_cex   = (c_agex07)
set autograph_clist = ($autograph_cex)

set f_list = ($f_list $autograph_flist)
set c_list = ($c_list $autograph_clist)

#**********************#
#                      #
#  Set bivar examples  #
#                      #
#**********************#
set cbivar_fex   = (cbex01)
set cbivar_fttr  = (cidsfft)
set cbivar_flist = ($cbivar_fex $cbivar_fttr)

set cbivar_cex   = (c_cbex01)
set cbivar_clist = ($cbivar_cex)

set f_list = ($f_list $cbivar_flist)
set c_list = ($c_list $cbivar_clist)

#************************#
#                        #
#  Set colconv examples  #
#                        #
#************************#
set colconv_fex   = (coex01 coex02 coex03)
set colconv_ftst  = (tcolcv)
set colconv_ffnd  = (fcce01 fcce02)
set colconv_flist = ($colconv_fex $colconv_ftst $colconv_ffnd)

set colconv_cex   = (c_coex02)
set colconv_clist = ($colconv_cex)

set f_list = ($f_list $colconv_flist)
set c_list = ($c_list $colconv_clist)

#************************#
#                        #
#  Set conpack examples  #
#                        #
#************************#
set conpack_fex  = (cpex01 cpex02 cpex03 cpex04 cpex05 cpex06 cpex07 \
                    cpex08 cpex09 cpex10 cpex11 cpex12 cpex13 cpex14 \
                    cpex15 cpex16 ${cbivar_fex})
set conpack_ftst = (tconpa)
set conpack_fttr = (ccpback ccpcff ccpcfx ccpcica ccpcir ccpcis ccpcit ccpclc \
                    ccpcld ccpcldm ccpcldr ccpcll ccpclu ccpcnrc ccpdflt \
                    ccpezct ccpfil ccpga ccphand ccphcf ccphl ccphlt ccpila \
                    ccpils ccpilt ccpklb ccplbam ccplbdr ccpline ccpllb \
                    ccpllc ccplll ccpllo ccpllp ccpllt ccpllw ccpmap \
                    ccpmovi ccpmpxy ccpncls ccpnet ccpnof ccpnsd ccppc ccppc1 \
                    ccppc2 ccppc3 ccppc4 ccppkcl ccppole ccpt2d ccprc ccprect \
                    ccprwc ccprwu ccpscam ccpset ccpsps1 ccpsps2 ccpspv \
                    ccptitle ccpvp ccpvs colcon ${cbivar_fttr})
set conpack_flist = ($conpack_fex $conpack_ftst $conpack_fttr)

set conpack_cttr  = (c_colcon)
set conpack_cex   = (${cbivar_cex})
set conpack_clist = ($conpack_cex $conpack_cttr)

set f_list = ($f_list $conpack_flist)
set c_list = ($c_list $conpack_clist)

#*************************#
#                         #
#  Set conpackt examples  #
#                         #
#*************************#
set conpackt_fex   = (ctcbay ctex01 ctex02 ctfite ctgaus ctgc23 ctgeo1 ctgeo2 \
		      ctgeo3 ctiscp ctisc2 ctllg1 ctllg2 ctllg3 ctnccl ctorca \
		      ctpopg ctswth ctwng1 ctwng2 cttd01 cttd02 ctterr)
set conpackt_flist = ($conpackt_fex)

set conpackt_cex   = (c_ctllg3)
set conpackt_clist = ($conpackt_cex)

set f_list = ($f_list $conpackt_flist)
set c_list = ($c_list $conpackt_clist)

#******************************#
#                              #
#  Set conran_family examples  #
#                              #
#******************************#
set cnrn_family_ftst  = (tconan tconaq tconas)
set cnrn_family_flist = (${cnrn_family_ftst})

set f_list = ($f_list ${cnrn_family_flist})

#******************************#
#                              #
#  Set conrec_family examples  #
#                              #
#******************************#
set cnrc_family_ftst  = (tconre tcnqck tcnsmt tcnsup)
set cnrc_family_flist = (${cnrc_family_ftst})

set f_list = ($f_list ${cnrc_family_flist})

#*************************#
#                         #
#  Set dashline examples  #
#                         #
#*************************#
set dashline_ftst  = (tdashc tdashl tdashp tdashs)
set dashline_ffnd  = (fdlcurvd fdldashc fdldashd fdlsmth)
set dashline_flist = ($dashline_ftst $dashline_ffnd)

set dashline_cfnd  = (c_fdldashc)
set dashline_clist = ($dashline_cfnd)

set f_list = ($f_list $dashline_flist)
set c_list = ($c_list $dashline_clist)

#***********************#
#                       #
# set dashpack examples #
#                       #
#***********************#
set dashpack_ftst  = (tdshpk)
set dashpack_flist = ($dashpack_ftst)

set dashpack_ctst  = (c_tdshpk)
set dashpack_clist = ($dashpack_ctst)

set f_list = ($f_list $dashpack_flist)
set c_list = ($c_list $dashpack_clist)

#**********************#
#                      #
#  Set ezmap examples  #
#                      #
#**********************#
set ezmap_fex   = (mpex01 mpex02 mpex03 mpex04 mpex05 mpex06 mpex07 mpex08 \
		  mpex09 mpex10 mpex11 mpex12 mpex13 mpex14 mpex15 mpexfi \
		  eezmpa)
set ezmap_ftst  = (tezmap tezmpa tezmpb)
set ezmap_fttr  = (cezmap1 cezmap2 cezmap3 cmpclr cmpdd cmpdrw cmpel \
                  cmpfil cmpgci cmpgrd cmpgrp cmpita cmpitm cmplab cmplbl \
                  cmplot cmpmsk cmpou cmppos cmpsat cmpsup cmptit cmptra \
                  cmpusr)
set ezmap_flist = ($ezmap_fex $ezmap_ftst $ezmap_fttr)

set ezmap_cex   = (c_mpex05 c_eezmpa c_eezmpb)
set ezmap_clist = ($ezmap_cex)

set f_list = ($f_list $ezmap_flist)
set c_list = ($c_list $ezmap_clist)

#***********************#
#                       #
#  Set gflash examples  #
#                       #
#***********************#
set gflash_ftst  = (tgflas)
set gflash_flist = ($gflash_ftst)

set gflash_ctst  = (c_tgflas)
set gflash_clist = ($gflash_ctst)

set f_list = ($f_list $gflash_flist)
set c_list = ($c_list $gflash_clist)

#******************#
#                  #
# set gks examples #
#                  #
#******************#
set gks_ffnd    = (fgke02 fgke03 fcell fcell0 fgpm01 fgkgpl fgkgpm fgkgtx \
                  fgklnclr fgklnwth fcirc)
set gks_fpdc    = (pgkex01 pgkex02 pgkex03 pgkex04 pgkex05 pgkex06 pgkex07 \
                  pgkex08 pgkex09 pgkex10 pgkex11 pgkex12 pgkex13 pgkex14 \
                  pgkex15 pgkex16 pgkex17 pgkex18 pgkex19 pgkex20 pgkex21 \
                  pgkex22 pgkex23 pgkex24 pgkex25 pgkex26 pgkex27)
set gks_flist   = ($gks_ffnd $gks_fpdc)

set gks_cex     = (c_gtxpac c_gcell)
set gks_cpdc    = (c_pgkex21)
set gks_clist   = ($gks_cex $gks_cpdc)

set f_list = ($f_list $gks_flist)
set c_list = ($c_list $gks_clist)

#************************#
#                        #
#  Set gridall examples  #
#                        #
#************************#
set gridall_ftst  = (tgrida)
set gridall_ffnd  = (ccpga)
set gridall_flist = ($gridall_ffnd $gridall_ftst)

set gridall_ctst  = (c_tgrida)
set gridall_clist = ($gridall_ctst)

set f_list = ($f_list $gridall_flist)
set c_list = ($c_list $gridall_clist)

#*************************#
#                         #
#  Set halftone examples  #
#                         #
#*************************#
set halftone_ftst  = (thafto)
set halftone_flist = ($halftone_ftst)

set f_list = ($f_list $halftone_flist)

#**************************#
#                          #
#  Set histogram examples  #
#                          #
#**************************#
set histogram_ftst  = (thstgr thstmv)
set histogram_flist = ($histogram_ftst)

set histogram_ctst  = (c_thstmv)
set histogram_clist = ($histogram_ctst)

set f_list = ($f_list $histogram_flist)
set c_list = ($c_list $histogram_clist)

#***********************#
#                       #
# set isosrfhr examples #
#                       #
#***********************#
set isosrfhr_ftst  = (tisohr)
set isosrfhr_flist = ($isosrfhr_ftst)

set f_list = ($f_list $isosrfhr_flist)

#*************************#
#                         #
# set isosurface examples #
#                         #
#*************************#
set isosurface_ftst  = (tisosr tpwrzi)
set isosurface_ffnd  = (fisissrf fispwrzi)
set isosurface_flist = ($isosurface_ftst $isosurface_ffnd)

set isosurface_ctst  = (c_tisosr)
set isosurface_clist = ($isosurface_ctst)

set f_list = ($f_list $isosurface_flist)
set c_list = ($c_list $isosurface_clist)

#***********************#
#                       #
# set labelbar examples #
#                       #
#***********************#
set labelbar_fex   = (elblba)
set labelbar_ftst  = (tlblba)
set labelbar_ffnd  = (clbfil clbbar clblbr)
set labelbar_flist = ($labelbar_fex $labelbar_ftst $labelbar_ffnd)

set labelbar_cex   = (c_elblba)
set labelbar_clist = ($labelbar_cex)

set f_list = ($f_list $labelbar_flist)
set c_list = ($c_list $labelbar_clist)

#*********************#
#                     #
# set ngmath examples #
#                     #
#*********************#
set csagrid_flist = (csex01 csex02 csex03 csex04 csex05 csex06 csex07)
set cssgrid_flist = (cssex01 cssex02 cssex03)
set dsgrid_flist  = (dsex01 dsex01d dsex02 dsex03 dsex04 dsex05 dsex06)
set fitgrid_flist = (ftex01  ftex02  ftex03  ftex04  ftex05  ftex06  ftex07 \
                     ftex01d ftex02d ftex03d ftex04d ftex05d ftex06d ftex07d)
set natgrid_flist = (nnex01 nnex01d nnex02 nnex03 nnex04 nnex05 nnex06 \
                     nnex07 nnex08 nnex09 nnex10)
set shgrid_flist  = (shex01 shex02 shex03)

set ngmath_flist  = ($csagrid_flist $cssgrid_flist $dsgrid_flist \
                     $fitgrid_flist $natgrid_flist $shgrid_flist)
                   
set csagrid_clist = (c_csex01 c_csex02 c_csex03 c_csex04 c_csex05 \
                     c_csex06 c_csex07)
set cssgrid_clist = (c_cssex01 c_cssex02 c_cssex03)
set dsgrid_clist  = (c_dsex01 c_dsex01d c_dsex02 c_dsex03 c_dsex04 \
                     c_dsex05 c_dsex06)
set fitgrid_clist = (c_ftex01  c_ftex02  c_ftex03  c_ftex04  c_ftex05 \
                     c_ftex06  c_ftex07 \
                     c_ftex01d c_ftex02d c_ftex03d c_ftex04d c_ftex05d \
                     c_ftex06d c_ftex07d)
set natgrid_clist = (c_nnex01 c_nnex01d c_nnex02 c_nnex03 c_nnex04 c_nnex06)
set shgrid_clist  = (c_shex01 c_shex02 c_shex03)

set ngmath_clist  = ($csagrid_clist $cssgrid_clist $dsgrid_clist \
                     $fitgrid_clist $natgrid_clist $shgrid_clist)
                      
set ngmath_fex    = ($ngmath_flist)
set ngmath_cex    = ($ngmath_clist)
set f_list = ($f_list $ngmath_flist)
set c_list = ($c_list $ngmath_clist)

#*********************#
#                     #
# set ngmisc examples #
#                     #
#*********************#
set ngmisc_ffnd  = (fngngdts fngwsym miex01)
set ngmisc_flist = ($ngmisc_ffnd)

set ngmisc_cfnd  = (c_fngwsym)
set ngmisc_clist = ($ngmisc_cfnd)

set f_list = ($f_list $ngmisc_flist)
set c_list = ($c_list $ngmisc_clist)

#***********************#
#                       #
# set plotchar examples #
#                       #
#***********************#
set plotchar_fex   = (epltch)
set plotchar_ftst  = (tpltch)
set plotchar_ffnd  = (fpchiqu fpcloqu fpcfonts)
set plotchar_flist = ($plotchar_fex $plotchar_ftst $plotchar_ffnd)

set plotchar_cex   = (c_epltch)
set plotchar_clist = ($plotchar_cex)

set f_list = ($f_list $plotchar_flist)
set c_list = ($c_list $plotchar_clist)

#***********************#
#                       #
# set polypack examples #
#                       #
#***********************#
set polypack_fex   = (ppex01)
set polypack_ftst  = (tppack)
set polypack_flist = ($polypack_fex $polypack_ftst)

set polypack_cex   = (c_ppex01)
set polypack_clist = ($polypack_cex)

set f_list = ($f_list $polypack_flist)
set c_list = ($c_list $polypack_clist)

#****************************#
#                            #
# set pwrite_family examples #
#                            #
#****************************#
set pwrite_ftst  = (tpwrtx tpwry)
set pwrite_flist = ($pwrite_ftst)

set f_list = ($f_list $pwrite_flist)

#*****************************#
#                             #
# set scrolled title examples #
#                             #
#*****************************#
set scrlld_title_fex   = (slex01 slex02)
set scrlld_title_ftst  = (tstitl)
set scrlld_title_ffnd  = (fslfont)
set scrlld_title_flist = (${scrlld_title_fex} ${scrlld_title_ftst} \
                         ${scrlld_title_ffnd})

set scrlld_title_cex   = (c_slex01)
set scrlld_title_clist = (${scrlld_title_cex})

set f_list = ($f_list ${scrlld_title_flist})
set c_list = ($c_list ${scrlld_title_clist})

#********************#
#                    #
# set seter examples #
#                    #
#********************#
set seter_ftst  = (tseter)
set seter_flist = ($seter_ftst)

set f_list = ($f_list $seter_flist)

#***********************#
#                       #
# set softfill examples #
#                       #
#***********************#
set softfill_fex   = (sfex01 sfex02)
set softfill_ftst  = (tsoftf)
set softfill_ffnd  = (fsfwrld fsfsgfa)
set softfill_flist = ($softfill_fex $softfill_ftst $softfill_ffnd)

set softfill_cex   = (c_sfex02)
set softfill_clist = ($softfill_cex)

set f_list = ($f_list $softfill_flist)
set c_list = ($c_list $softfill_clist)

#*******************#
#                   #
# set spps examples #
#                   #
#*******************#
set spps_fex   = (splogy sprevx)
set spps_ffnd  = (fspcurve fspline fsppoint fspponts fcoord fcoord1 fcoord2)
set spps_flist = ($spps_fex $spps_ffnd)

set spps_cfnd  = (c_fcoord2)
set spps_clist = ($spps_cfnd)

set f_list = ($f_list $spps_flist)
set c_list = ($c_list $spps_clist)

#**************************#
#                          #
# set streamlines examples #
#                          #
#**************************#
set streamlines_fex   = (stex01 stex02 stex03)
set streamlines_ftst  = (tstrml)
set streamlines_ffnd  = (fstream ffex00 ffex01 ffex03 ffex04)
set streamlines_flist = ($streamlines_fex $streamlines_ftst $streamlines_ffnd)

set streamlines_cfnd  = (c_ffex03)
set streamlines_clist = ($streamlines_cfnd)

set f_list = ($f_list $streamlines_flist)
set c_list = ($c_list $streamlines_clist)

#**********************#
#                      #
# set surface examples #
#                      #
#**********************#
set surface_fex   = (srex01)
set surface_ftst  = (tsrfac tpwrzs)
set surface_ffnd  = (fsrezsrf fsrpwrzs fsrsrfac)
set surface_flist = ($surface_fex $surface_ftst $surface_ffnd)

set surface_cex   = (c_srex01)
set surface_clist = ($surface_cex)

set f_list = ($f_list $surface_flist)
set c_list = ($c_list $surface_clist)

#*********************#
#                     #
# set tdpack examples #
#                     #
#*********************#
set tdpack_fex   = (tdex01 tdex02 tdex03 tdex04 tdex05 tdex06 tdex07 tdex08)
set tdpack_ftst  = ()
set tdpack_flist = ($tdpack_fex $tdpack_ftst)

set tdpack_cex   = (c_tdex01 c_tdex03)
set tdpack_clist = ($tdpack_cex)

set f_list = ($f_list $tdpack_flist)
set c_list = ($c_list $tdpack_clist)

#*********************#
#                     #
# set threed examples #
#                     #
#*********************#
set threed_ftst  = (tthree tpwrzt)
set threed_ffnd  = (fthex01 fthex02 fthex03 fthex04 fthex05)
set threed_flist = ($threed_ftst $threed_ffnd)

set threed_cfnd  = (c_fthex01)
set threed_clist = ($threed_cfnd)

set f_list = ($f_list $threed_flist)
set c_list = ($c_list $threed_clist)

#*************************#
#                         #
#  Set vaspackt examples  #
#                         #
#*************************#
set vaspackt_fex   = (vtex01 vtex02 vtex03)
set vaspackt_flist = ($vaspackt_fex)

set vaspackt_cex   = ()
set vaspackt_clist = ($vaspackt_cex)

set f_list = ($f_list $vaspackt_flist)
set c_list = ($c_list $vaspackt_clist)

#**********************#
#                      #
# set vectors examples #
#                      #
#**********************#
set vectors_fex   = (vvex01 vvex02 vvex03)
set vectors_ftst  = (tvelvc)
set vectors_ffnd  = (ffex00 ffex01 ffex02 ffex05 fcover)
set vectors_flist = ($vectors_fex $vectors_ftst $vectors_ffnd)

set vectors_cex   = (c_vvex03)
set vectors_clist = ($vectors_cex)

set f_list = ($f_list $vectors_flist)
set c_list = ($c_list $vectors_clist)

#*******************#
#                   #
# set wmap examples #
#                   #
#*******************#
set wmap_fex   = (wmex01 wmex02 wmex03 wmex04 wmex05 wmex06 wmex07 wmex08\
                 wmex09 wmex10 wmex11 wmex12 wmex13 wmex14 wmex15 wmex16 \
                 wmex17)
set wmap_flist = ($wmap_fex)

set wmap_cex   = (c_wmex09)
set wmap_clist = ($wmap_cex)

set f_list = ($f_list $wmap_flist)
set c_list = ($c_list $wmap_clist)

#****************************************#
#                                        #
#  Set field flow examples - consists of #
#  all streamlines and vectors examples  #
#                                        #
#****************************************#
set field_fex   = (stex01 stex02 stex03 vvex01 vvex02 vvex03)
set field_ftst  = (tstrml tvelvc)
set field_ffnd  = (fstream ffex00 ffex01 ffex02 ffex03 ffex04 ffex05 fcover)
set field_flist = ($field_fex $field_ftst $field_ffnd)

set field_cex   = (c_vvex03)
set field_cfnd  = (c_ffex03)
set field_clist = ($field_cex $field_cfnd)

#****************************#
#                            #
# set miscellaneous examples #
#                            #
#****************************#
set misc_fex   = (example bnchmk ncargworld)
set misc_flist = ($misc_fex)

set f_list = ($f_list $misc_flist)

#********************#
#                    #
# set class examples #
#                    #
#*******************#
set class_fttr   = (class1 class2 class3)
set class_flist  = ($class_fttr)

set f_list = ($f_list $class_flist)

#*************************************************************#
#                                                             #
# Some of the other examples are considered tutorial examples #
#                                                             #
#*************************************************************#
set overlap_fttr = (mpex03 mpex05 arex01 sfex01 tsoftf)

#****************************************#
#                                        #
# Set lists of various types of examples #
#                                        #
#****************************************#
set list_fx11 = (fgke01 fgke04)
set list_cx11 = (c_xwndws)
set list_fex = ($areas_fex $autograph_fex $colconv_fex $conpack_fex \
		$conpackt_fex $ezmap_fex $field_fex $labelbar_fex $ngmath_fex \
		$plotchar_fex $polypack_fex ${scrlld_title_fex} $softfill_fex \
		$spps_fex $surface_fex $tdpack_fex $wmap_fex $misc_fex \
		$vaspackt_fex)

set list_cex  = ($autograph_cex $colconv_cex $conpack_cex $conpackt_cex \
		$ezmap_cex $field_cex $gks_cex $labelbar_cex $ngmath_cex \
		$plotchar_cex $polypack_cex ${scrlld_title_cex} $softfill_cex \
		$surface_cex $tdpack_cex $wmap_cex $vaspackt_cex)

set list_ftst = ($areas_ftst $autograph_ftst $colconv_ftst $conpack_ftst \
                ${cnrn_family_ftst} ${cnrc_family_ftst} $dashline_ftst \
                $dashpack_ftst $ezmap_ftst $field_ftst $gflash_ftst \
                $gridall_ftst $halftone_ftst $histogram_ftst $isosrfhr_ftst \
                $isosurface_ftst $labelbar_ftst $plotchar_ftst $polypack_ftst \
                $pwrite_ftst ${scrlld_title_ftst} $seter_ftst $softfill_ftst \
                $surface_ftst $tdpack_ftst $threed_ftst)

set list_ctst = ($areas_ctst $dashpack_ctst $gflash_ctst $gridall_ctst \
                $histogram_ctst $isosurface_ctst)

set list_fttr = ($areas_fttr $conpack_fttr $ezmap_fttr $class_fttr)

set list_cttr = ($conpack_cttr)

set list_ffnd = ($autograph_ffnd $colconv_ffnd $dashline_ffnd $field_ffnd \
                $gks_ffnd $gridall_ffnd $isosurface_ffnd $labelbar_ffnd \
                $ngmisc_ffnd $plotchar_ffnd ${scrlld_title_ffnd} \
                $softfill_ffnd $spps_ffnd $surface_ffnd $threed_ffnd)

set list_cfnd = ($dashline_cfnd $field_cfnd $ngmisc_cfnd $spps_cfnd \
                 $threed_cfnd)

set list_fpdc = ($gks_fpdc)
set list_cpdc = ($gks_cpdc)

set list_fps = (pgkex19 pgkex20 pgkex21 pgkex22 pgkex23 wmex12 wmex13 wmex14)
set list_cps = (c_pgkex21)

#****************************************************#
#                                                    #
# Default is to load in the X11 library. If the      #
# user specifies "-noX11" or "-NCGMonly on the       #
# command line, then a stub will be linked instead   #
# of the X11 library                                 #
#                                                    #
#****************************************************#
set X11_option
set ncarbd_flag
set ngmathbd_flag

#*******************************#
#                               #
# Parse options on command line #
#                               #
#*******************************#
set names

#*******************************#
#                               #
# change_ws_type is used to keep#
# track of whether the user     #
# explicitly changed the ws type#
#                               #
#*******************************#
unset change_ws_type
set ws_type      = 1

while ($#argv > 0)

  switch ($1)
    case "-all":
    case "-A":
      shift
      set names=($names $list_fex $list_ftst $list_fttr $list_ffnd $list_fpdc \
                 $list_cex $list_ctst $list_cttr $list_cfnd $list_cpdc)
      breaksw

    case "-c":
    case "-C":
      shift
      set names=($names $c_list)
      breaksw

    case "-fortran":
    case "-Fortran":
      shift
      set names=($names $f_list)
      breaksw

    case "-allexamples":
    case "-E":
      shift
      set names=($names $list_fex $list_cex)
      breaksw

    case "-alltests":
    case "-T":
      shift
      set names=($names $list_ftst $list_ctst)
      breaksw
        
    case "-alltutorial":
    case "-U":
      shift
      set names=($names $list_fttr $overlap_fttr $list_cttr)
      breaksw
        
    case "-allfundamental":
    case "-F":
      shift
      set names=($names $list_ffnd $list_cfnd)
      breaksw
        
    case "-allpdocs":
    case "-P":
      shift
      set names=($names $list_fpdc $list_cpdc)
      breaksw
        
    case "-areas":
      shift
      set names=($names $areas_flist $areas_clist)
      breaksw
        
    case "-autograph":
      shift
      set names=($names $autograph_flist $autograph_clist)
      breaksw

    case "-bivar":
      shift
      set names=($names $cbivar_flist $cbivar_clist)
      breaksw

    case "-colconv":
      shift
      set names=($names $colconv_flist $colconv_clist)
      breaksw

    case "-conpack":
      shift
      set names=($names $conpack_flist $conpack_clist)
      breaksw

    case "-conpackt":
      shift
      set names=($names $conpackt_flist $conpackt_clist)
      breaksw

    case "-conran_family":
      shift
      set names=($names ${cnrn_family_flist})
      breaksw

    case "-conrec_family":
      shift
      set names=($names ${cnrc_family_flist})
      breaksw

    case "-csagrid":
      shift
      set names=($names $csagrid_flist $csagrid_clist)
      breaksw

    case "-cssgrid":
      shift
      set names=($names $cssgrid_flist $cssgrid_clist)
      breaksw

    case "-dashline":
      shift
      set names=($names $dashline_flist $dashline_clist)
      breaksw

    case "-dashpack":
      shift
      set names=($names $dashpack_flist $dashpack_clist)
      breaksw

    case "-dsgrid":
      shift
      set names=($names $dsgrid_flist $dsgrid_clist)
      breaksw

    case "-ezmap":
      shift
      set names=($names $ezmap_flist $ezmap_clist)
      breaksw

    case "-field_flow":
      shift
      set names=($names $field_flist $field_clist)
      breaksw

    case "-fitgrid":
      shift
      set names=($names $fitgrid_flist $fitgrid_clist)
      breaksw

    case "-gflash":
      shift
      set names=($names $gflash_flist $gflash_clist)
      breaksw

    case "-gks":
      shift
      set names=($names $gks_flist $gks_clist)
      breaksw

    case "-gridall":
      shift
      set names=($names $gridall_flist $gridall_clist)
      breaksw

    case "-halftone":
      shift
      set names=($names $halftone_flist)
      breaksw

    case "-histogram":
      shift
      set names=($names $histogram_flist $histogram_clist)
      breaksw

    case "-isosrfhr":
      shift
      set names=($names $isosrfhr_flist)
      breaksw

    case "-isosurface":
      shift
      set names=($names $isosurface_flist $isosurface_clist)
      breaksw

    case "-labelbar":
      shift
      set names=($names $labelbar_flist $labelbar_clist)
      breaksw

    case "-natgrid":
      shift
      set names=($names $natgrid_flist $natgrid_clist)
      breaksw

    case "-ngmath":
      shift
      set names=($names $ngmath_flist $ngmath_clist)
      breaksw

    case "-ngmisc":
      shift
      set names=($names $ngmisc_flist $ngmisc_clist)
      breaksw

    case "-plotchar":
      shift
      set names=($names $plotchar_flist $plotchar_clist)
      breaksw

    case "-polypack":
      shift
      set names=($names $polypack_flist $polypack_clist)
      breaksw

    case "-pwrite_family":
      shift
      set names=($names $pwrite_flist)
      breaksw

    case "-scrolled_title":
      shift
      set names=($names ${scrlld_title_flist} ${scrlld_title_clist})
      breaksw

    case "-seter":
      shift
      set names=($names $seter_flist)
      breaksw

    case "-shgrid":
      shift
      set names=($names $shgrid_flist $shgrid_clist)
      breaksw

    case "-softfill":
      shift
      set names=($names $softfill_flist $softfill_clist)
      breaksw

    case "-spps":
      shift
      set names=($names $spps_flist $spps_clist)
      breaksw

    case "-streamlines":
      shift
      set names=($names $streamlines_flist $streamlines_clist)
      breaksw

    case "-surface":
      shift
      set names=($names $surface_flist $surface_clist)
      breaksw

    case "-tdpack":
      shift
      set names=($names $tdpack_flist $tdpack_clist)
      breaksw

    case "-threed":
      shift
      set names=($names $threed_flist $threed_clist)
      breaksw

    case "-vaspackt":
      shift
      set names=($names $vaspackt_flist $vaspackt_clist)
      breaksw

    case "-vectors":
      shift
      set names=($names $vectors_flist $vectors_clist)
      breaksw

    case "-wmap":
      shift
      set names=($names $wmap_flist $wmap_clist)
      breaksw

    case "-misc":
      shift
      set names=($names $misc_flist)
      breaksw

    case "-class":
      shift
      set names=($names $class_flist)
      breaksw

    case "-ps":
      shift
      set names=($names $list_fps $list_cps)
      breaksw

    case "-x11":
      shift
      set names=($names $list_fx11 $list_cx11)
      breaksw

    case "-clean":
      shift
      set CleanOption
      breaksw

    case "-n":
      shift
      set NoRunOption
      breaksw
        
    case "-onebyone":
      shift
      set OneByOneOption
      breaksw

    case "-unique":
      shift
      set Unique
      breaksw

    case "-W":
    case "-w":
      shift
      set new_ws_type = $1
      if ( !(`expr "$new_ws_type" : '[0-9]'`)) then
#***********************************************#
#                                               #
# The workstation type has been specified as a  #
# string and not a number, so we have to get    #
# the number by parsing the string.             #
#                                               #
# If the workstation is a PostScript file, then #
# it can have three different attributes:  file #
# type, orientation type, and color type.       #
#                                               #
#***********************************************#
        set file_type
        set orient_type
        set color_type
        set str = ("$new_ws_type" "" "")
        set num = 1
#************************#
#                        #
# Parse the string.      #
#                        #
# String can be of form  #
# "xxx", "xxx.yyy", or   #
# "xxx.yyy.zzz"          #
#                        #
#************************#
        if ( `expr "$new_ws_type" : '.*\..*\..*'` ) then
#***********************#
#                       #
# String is xxx.yyy.zzz #
#                       #
#***********************#
          set str[1] = `expr "$new_ws_type" : '\(.*\)\..*\..*'`
          set str[2] = `expr "$new_ws_type" : '.*\.\(.*\)\..*'`
          set str[3] = `expr "$new_ws_type" : '.*\..*\.\(.*\)'`
          set num = 3
        else
          if ( `expr "$new_ws_type" : '.*\..*'` ) then
#*******************#
#                   #
# String is xxx.yyy #
#                   #
#*******************#
            set str[1] = `expr "$new_ws_type" : '\(.*\)\..*'`
            set str[2] = `expr "$new_ws_type" : '.*\.\(.*\)'`
            set num = 2
          endif
        endif
        set i = 1
        while ($i <= $num)
          foreach ftype($file_types)
            if ("$str[$i]" == "$ftype") then
              set file_type = "$str[$i]"
              break
            endif
          end
          foreach otype($orient_types)
            if ("$str[$i]" == "$otype") then
              set orient_type = "$str[$i]"
              break
            endif
          end
          foreach ctype($color_types)
            if ("$str[$i]" == "$ctype") then
              set color_type = "$str[$i]"
              break
            endif
          end
          @ i++
        end
#*********************************************#
#                                             #
# If the workstation type was not specified,  #
# or one of the attributes was not recognized #
# then this is an error.                      #
#                                             #
#*********************************************#
        if ("$file_type" == "" || \
           ($num == 2 && ("$orient_type" == "" && "$color_type" == "")) || \
           ($num == 3 && ("$orient_type" == "" || "$color_type" == ""))) then
          set not_valid
          goto invalid
        endif
        if ("$orient_type" == "") set orient_type = "port"
        if ("$color_type" == "") set color_type = "color"
        set str = "$file_type.$orient_type.$color_type"
#**************************************#
#                                      #
# Find the workstation type associated #
# with the string and assign the       #
# correct workstation number.          #
#                                      #
#**************************************#
        @ i = 1
        unset found
        while ($i <= $#ws_types)
          if ("$str" == "$ws_types[$i]" ) then
            set new_ws_type = "$i"
            set found
            break
          endif
          @ i++
        end
        if (! $?found) then
          set not_valid
          goto invalid
        endif        
      else
        if ("$new_ws_type" < 1 || "$new_ws_type" > $#ws_types ) then
          set not_valid
          goto invalid
        else
          if ("$ws_types[$new_ws_type]" == "" ) then
            set not_valid
            goto invalid
          endif
        endif
      endif
invalid:
      if ($?not_valid) then
          echo ""
          echo "    '$1' is not a valid workstation type."
          echo ""
          exit 1
      endif
      set change_ws_type
      shift
      breaksw

    case "-ncarbd":
      shift
      set ncarbd_flag = "-ncarbd"
      breaksw

    case "-ngmathbd":
      shift
      set ngmathbd_flag = "-ngmathbd"
      breaksw

    case "-noX11":
    case "-nox11":
    case "-NCGMonly":
    case "-ncgmonly":
      shift
      set X11_option = "-noX11"
      breaksw

    case "-list":
      shift
      set List
      breaksw

    case "-*":
      echo "$0 : Unknown option <$1>"
      exit 1
      breaksw

    default:
      set names=($names $1)
      shift
      breaksw
    endsw
end

#***********************************************#
#                                               #
# If you just want to see what list of examples #
# you have asked for, list them and exit.       #
#                                               #
#***********************************************#
if ($?List) then
   echo $names
   exit
endif

#***************************#
#                           #
# Loop through each example #
#                           #
#***************************#
foreach name ($names)

unset tmp_msg
set input
set output

#*************************************#
#                                     #
# Find out what type of example it is #
#                                     #
#*************************************#
set ex_type = "Unknown"

foreach known ($list_fex $list_cex $list_cx11)
  if ("$name" == "$known") then
    set ex_type
    set temp_dir = "$example_dir"
    break
  endif
end

if ( "$ex_type" == "Unknown" ) then
  foreach known ($list_ftst $list_ctst)
    if ("$name" == "$known") then
      set ex_type = "Test"
      set temp_dir = "$test_dir"
      break
    endif
  end
endif

if ( "$ex_type" == "Unknown" ) then
  foreach known ($list_fttr $list_cttr)
    if ("$name" == "$known") then
      set ex_type = "Tutorial"
      set temp_dir = "$tutor_dir"
      break
    endif
  end
endif

if ( "$ex_type" == "Unknown" ) then
  foreach known ($list_ffnd $list_cfnd $list_fx11)
    if ("$name" == "$known") then
      set ex_type = "Fundamentals"
      set temp_dir = "$fund_dir"
      break
    endif
  end
endif

if ( "$ex_type" == "Unknown" ) then
  foreach known ($list_fpdc $list_cpdc)
    if ("$name" == "$known") then
      set ex_type = "Programmer"
      set temp_dir = "$pdoc_dir"
      break
    endif
  end
endif

# 
# There are four types of examples:
# 
#   1. One that creates an NCGM by default, but can be changed
#      via the "-W" option. This is how most examples are currently.
#      They must have an IWTYPE parameter in order for this to work.
# 
#   2. One that creates something other than an NCGM, but can
#      be changed via the "-W" option. Again, IWTYPE must be present.
# 
# Set the "modifiable" for types of both #1 and #2.
#
#   3. One that creates an output file that cannot be changed
#      via the "-W" option.
# 
# Set std_file for types of #1-#3. This just means a "standard"
# file of the form "example_name.xxxx" is created.
#
#   4. One that doesn't create a file of the form example_name.xxx,
#      or creates no file at all.
# 
# Unset "modifiable" for types of both #3 and #4.
# Unset std_file for types of #4.
#
# The variable "orig_ws_type" represents the workstation type.  In most
# cases, this value will be equal to 1 (case #1). If a Fortran example
# has the IWTYPE parameter, and it is set to 1, then leave orig_ws_type
# alone. Otherwise, if IWTYPE exists and is set to something other than
# 1, then set orig_ws_type to this value.
# 
# If the example does not have an IWTYPE parameter, but it supposed to
# create a file of the style example_name.xxx, then unset modifiable,
# but leave std_file set.
# 
# If the example is either not meant to create an output file, or else
# it doesn't create one of the form example_ncgm.xxxx, then unset 
# modifiable AND std_file.
# 

set orig_ws_type = "1"
set modifiable
set std_file

switch($name)
    case pgkex19:
    case pgkex20:
    case pgkex21:
    case pgkex22:
    case pgkex23:
    case c_pgkex21:
      unset modifiable
      set orig_ws_type = "20"
      if ("$name" == "pgkex20") then
        set orig_ws_type = "26"
      endif
      echo ""
      echo "  This example was set up to demonstrate how to use"
      echo "  the Ngmisc routines to define the Postscript output."
      echo ""
    breaksw

    case wmex12:
    case wmex13:
    case wmex14:
      set orig_ws_type = "26"
      if (! $?change_ws_type) then
        echo ""
        echo "  This example was set up to use the entire"
        echo "  page when going to PostScript, so workstation"
        echo "  type 26 is being used."
        echo ""
      endif
    breaksw

    case pgkex26:
    case fgke03:
      unset modifiable
      unset std_file
      echo ""
      echo "  This example was set up to demonstrate how to change"
      echo "  the name of the metafile from within the program."
      echo ""
      set tmp_msg = "Metafiles META01 and META02 produced."
    breaksw

    case pgkex27:
      unset modifiable
      unset std_file
      echo ""
      echo "  This example was set up to demonstrate how to write"
      echo "  to more than one metafile at a time."
      echo ""
      set tmp_msg = "Metafiles gmeta1 and gmeta2 produced."
    breaksw

    case fgke01:
    case fgke04:
      set orig_ws_type = 8
      unset modifiable
      unset std_file
      echo ""
      echo "  This example was set up to demonstrate the X11"
      echo "  driver.  It also generates a graphic file."
      echo ""
      set tmp_msg = "   "
    breaksw

    case nnex08:
    case nnex09:
    case nnex10:
    case mpex12:
      unset modifiable
      unset std_file
      set tmp_msg = "   "
      echo ""
      echo "  This example does not produce a metafile."
      echo ""
    breaksw

    case ccpcff:
    case tcolcv:
    case fcce02:
    case ftex01d:
    case ftex02d:
    case ftex03d:
    case ftex04d:
    case ftex05d:
    case ftex06d:
    case ftex07d:
    case c_ftex01d:
    case c_ftex02d:
    case c_ftex03d:
    case c_ftex04d:
    case c_ftex05d:
    case c_ftex06d:
    case c_ftex07d:
      unset modifiable
      unset std_file
      set tmp_msg = "   "
      echo ""
      echo "  No graphics file will be produced by this example."
      echo ""
    breaksw
endsw

#
# If the user changed the workstation type with the -W option,
# then only use it if this particular example is a modifiable one.
#
if ($?change_ws_type && $?modifiable) then
  set ws_type = $new_ws_type
else
  set ws_type = $orig_ws_type
endif

#******************************************#
#                                          #
# Determine if it's a C or Fortran example #
#                                          #
#******************************************#
unset fprog
unset cprog
if ( `expr "$name" : "c_.*"`) then 
  set cprog
  set prog_type = "C"
  set comp_script = "ncargcc"
else
  set fprog
  set prog_type = "Fortran"
  set comp_script = "ncargf77"
endif

#***************#
#               #
# Echo the type #
#               #
#***************#

if ( "$ex_type" == "Unknown" ) then
  echo ""
  echo "ncargex: <$name> is not a known example"
  echo ""
  goto theend
else
  echo ""
  echo "NCAR Graphics $prog_type $ex_type Example <$name>"
  echo ""
endif

#********************************************#
#                                            #
# "-noX11" only works if going to an NCGM    #
# file.                                      #
#                                            #
#********************************************#
if ("$X11_option" == "-noX11" && "$ws_type" != "1") then
    echo ""
    echo "Warning:  You can only use the '-noX11' option if you are"
    echo "          sending your output to an NCGM file. The '-noX11'"
    echo "          option will be turned off for this example."
    echo ""
    set xoption = ""
else
    set xoption = $X11_option
endif


#***************************************#
#                                       #
# If the workstation type is "8" (X11)  #
# or "10" (text dump) then no file is   #
# created when the example is executed. #
#                                       #
#***************************************#
if ("$ws_type" == "8" || "$ws_type" == "10" ) unset std_file

#**************************************#
#                                      #
# Initialize the name of the default   #
# output file and the name of the file #
# it is going to be renamed to.        #
#                                      #
#**************************************#
set suffix = "$suffix_names[$ws_type]"
set graphic_file = "$name.$suffix"

if ($ws_type == 41) then
  set msg = "cairo PNG files are named $name.xxxxxx.png (xxxxxx is the frame #)"
else
  set msg = "$default_msgs[$ws_type] $graphic_file."
endif
if ($?fprog) then
  set main = "$name.f"
else
  set main = "$name.c"
endif

if ($?tmp_msg) then
  set msg = "$tmp_msg"
endif

if ("$ws_type" == "8") then
  echo ""
  echo "NOTE: This example is being run interactively and can only"
  echo "      be executed if you have X running and have your     "
  echo "      DISPLAY environment variable set properly.  It will "
  echo "      create an X11 window that you must click on with your"
  echo "      mouse to advance the frame(s)."
  echo ""
  set xoption = ""
endif

#**********************************#
#                                  #
# For workstation "10" (text dump) #
# the output goes to stdout        #
#                                  #
#**********************************#
if ("$ws_type" == "10") then
  set output = "$graphic_file"
endif

#***********************************************#
#                                               #
# If the "-unique" option was selected and the  #
# NCGM already exists, don't generate it again. #
#                                               #
#***********************************************#
if ($?Unique && -f $graphic_file) goto theend

#****************************#
#                            #
# Set initial compiler flags #
#                            #
#****************************#
set comp_flags = ($ncarbd_flag $ngmathbd_flag $xoption)

#**********************************#
#                                  #
# Some examples need extra Fortran #
# files, data files, or special    #
# compiler options                 #
#                                  #
#**********************************#
set extra_src_files
set stdin_data_file
set other_data_files

switch ($name)
    case agex13:
	set stdin_data_file = (agda13.dat)
    breaksw

    case ccpcica:
    case ccpcir:
    case ccpcnrc:
    case ccpezct:
    case ccphl:
    case ccpmap:
    case ccpmovi:
    case ccpvp:
        set extra_src_files = (ggdini.f)
    breaksw

    case ccpila:
    case ccpt2d:
	set stdin_data_file = (ccpila.dat)
    breaksw

    case ccpils:
    case ccpilt:
    case ccplbdr:
    case ccptitle:
	set stdin_data_file = (ccpex.dat)
    breaksw

    case ccpmpxy:
	set stdin_data_file = (cpmpxy1.dat)
    breaksw

    case class1:
	set stdin_data_file = (class1.dat)
    breaksw

    case cpex01:
    case cpex02:
    case cpex03:
    case cpex04:
    case cpex05:
    case cpex06:
    case cpex07:
    case cpex08:
    case cpex09:
        set extra_src_files = (cpexcc.f)
    breaksw

    case cpex14:
	set other_data_files = (cpex14.dat)
    breaksw

    case cpex16:
	set other_data_files = (cpex16.dat)
    breaksw

    case ctcbay:
	set other_data_files = (ctcbay.dat)
    breaksw

    case ctfite:
	set other_data_files = (ctfite.dat)
    breaksw

    case ctgaus:
	set other_data_files = (ctgaus.dat)
    breaksw

    case ctgeo3:
    case ctgc23:
	set other_data_files = (ctgeo3.dat)
    breaksw

    case ctiscp:
    case ctisc2:
	set other_data_files = (ctiscp.dat)
    breaksw

    case ctnccl:
	set other_data_files = (ctnccl.dat)
    breaksw

    case ctorca:
	set other_data_files = (ctorca.dat)
    breaksw

    case ctpopg:
	set other_data_files = (ctpopg.dat)
    breaksw

    case ctswth:
	set other_data_files = (ctswth.dat)
    breaksw

    case ctterr:
	set other_data_files = (ctterr.dat)
    breaksw

    case ctwng1:
	set other_data_files = (ctwng1.dat)
    breaksw

    case ctwng2:
	set other_data_files = (ctwng2.dat)
    breaksw

    case fcover:
	set stdin_data_file = (fcover.dat)
    breaksw

    case ffex02:
    case ffex03:
    case c_ffex03:
	set stdin_data_file = (ffex02.dat)
    breaksw

    case ffex05:
	set stdin_data_file = (ffex05.dat)
    breaksw

    case mpex01:
    case mpex02:
    case mpex03:
    case mpex04:
    case mpex05:
    case mpex06:
    case mpex07:
    case mpex08:
    case mpex09:
    case mpex10:
        set extra_src_files = (mpexcc.f)
    breaksw

    case mpex15:
	set other_data_files = (Europe.png Europe.pngi)
        set comp_flags = ($comp_flags "-lpng -lz")
    breaksw

    case mpexfi:
	set stdin_data_file = (mpexfi.dat)
        set extra_src_files = (mpexcc.f)
    breaksw

    case srex01:
    case c_srex01:
	set stdin_data_file = (srex01.dat)
    breaksw

    case csex01:
    case csex02:
    case csex03:
    case csex04:
    case csex05:
    case csex06:
    case csex07:
    case cssex01:
    case cssex02:
    case cssex03:
    case dsex01:
    case dsex01d:
    case dsex02:
    case dsex03:
    case dsex04:
    case dsex05:
    case dsex06:
    case ftex01:
    case ftex02:
    case ftex03:
    case ftex04:
    case ftex05:
    case ftex06:
    case ftex07:
    case ftex01d:
    case ftex02d:
    case ftex03d:
    case ftex04d:
    case ftex05d:
    case ftex06d:
    case ftex07d:
    case shex01:
    case shex02:
    case shex03:
    case wmex01:
    case wmex02:
    case wmex03:
    case wmex04:
    case wmex13:
    case wmex14:
    case c_csex01:
    case c_csex02:
    case c_csex03:
    case c_csex04:
    case c_csex05:
    case c_csex06:
    case c_csex07:
    case c_cssex01:
    case c_cssex02:
    case c_cssex03:
    case c_dsex01:
    case c_dsex01d:
    case c_dsex02:
    case c_dsex03:
    case c_dsex04:
    case c_dsex05:
    case c_dsex06:
    case c_ftex01:
    case c_ftex02:
    case c_ftex03:
    case c_ftex04:
    case c_ftex05:
    case c_ftex06:
    case c_ftex07:
    case c_ftex01d:
    case c_ftex02d:
    case c_ftex03d:
    case c_ftex04d:
    case c_ftex05d:
    case c_ftex06d:
    case c_ftex07d:
    case c_shex01:
    case c_shex02:
    case c_shex03
       set comp_flags = ($comp_flags "-ngmath")
    breaksw

    case nnex01:
    case nnex02:
    case nnex03:
    case nnex04:
    case nnex05:
    case nnex06:
    case nnex07:
    case nnex08:
    case nnex09:
    case nnex10:
    case nnex01d:
        set extra_src_files = (nnplotf.f)
        set comp_flags = ($comp_flags "-ngmath")
    breaksw

    case c_nnex01:
    case c_nnex02:
    case c_nnex03:
    case c_nnex04:
    case c_nnex06:
    case c_nnex01d:
        set extra_src_files = (nnplotc.c)
        set comp_flags = ($comp_flags "-ngmath")
    breaksw

#************************************************#           
#                                                #
# autograph with pwritx for character generation #
#                                                #
#************************************************#           
    case tagupw:
        set comp_flags = ($comp_flags "-agupwrtx")
    breaksw

#***************************#           
#                           #
# smooth routines (default) #
#                           #
#***************************#           
    case tdashs:
    case tcnsmt:
    case tconan:
        set comp_flags = ($comp_flags "-smooth")
    breaksw
#****************#           
#                #
# quick routines #
#                #
#****************#           
    case tdashl:
    case tcnqck:
    case tconaq:
        set comp_flags = ($comp_flags "-quick")
    breaksw
#****************#
#                #
# super routines #
#                #
#****************#
    case tdashp:
    case tcnsup:
    case tconas:
    case fdlsmth:
        set comp_flags = ($comp_flags "-super")
    breaksw

    case vvex01:
    case vvex02:
        set extra_src_files = (vvexcc.f)
    breaksw
endsw

#**********************************#
#                                  #
# Check if this particular example #
# needs a data file on "stdin"     #
#                                  #
#**********************************#
if ("$stdin_data_file" != "") then
  set input = "$stdin_data_file"
endif

#******************************#
#                              #
# Modify the main program to   #
# give it the workstation type #
#                              #
#******************************#

echo "  Copying $main"
echo ""
cp $temp_dir/$main ./$main
if ($?fprog && $?change_ws_type && $?modifiable) then
if($orig_ws_type != $ws_type) then
ed << EOF - ./$main >& /dev/null
g/^ *PARAMETER/s/IWTYPE=[0-9][0-9]*/IWTYPE=$ws_type/g
.
w
q
endif
endif

if ($?cprog && $?change_ws_type && $?modifiable) then
if($orig_ws_type != $ws_type) then
ed << EOF - ./$main >& /dev/null
/define IWTYPE
c
#define IWTYPE $ws_type
.
w
q
EOF
endif
endif

set src_files = ($extra_src_files $main)

#***********************#
#                       #
# Copy the needed files #
#                       #
#***********************#
   
set copy_files = ($extra_src_files $stdin_data_file $other_data_files)

foreach file($copy_files)
    echo "  Copying $file"
    echo ""
    cp $temp_dir/$file .
end

#******************************#
#                              #
# Compile and link the example #
#                              #
#******************************#
   
if (! $?NoRunOption) then
    echo "Compiling and linking..."
    $comp_script $comp_flags -o $name $src_files
    if ($status != 0) then
        echo ""
        echo "The compile and link failed."
        echo ""
        exit
    endif
#*****************#
#                 #
# Run the example #
#                 #
#*****************#
    set rename_option = "-o $graphic_file"
    if (! $?std_file) set rename_option
    echo ""
    echo "Executing <$name>..."

    if ("$input" != "" ) then
      if ("$output" != "") then
        ncargrun $rename_option ./$name < $input > $output
      else 
        ncargrun $rename_option ./$name < $input
      endif
    else
      if ("$output" != "") then
        ncargrun $rename_option ./$name > $output
      else 
        ncargrun $rename_option ./$name
      endif
    endif
    if ($status != 0) then
        echo ""
        echo "The execution of ./$name failed"
        echo ""
        exit
    endif
    echo ""
    echo "$msg"
    echo ""
endif

#*******************************************#
#                                           #
# Remove files created after the execution. #
#                                           #
#*******************************************#
switch ($name)
    case slex02:
	set other_data_files = ($other_data_files slex02.input)
    breaksw
endsw


#***********************#
#                       #
# Remove unwanted files #
#                       #
#***********************#
set rmfiles = ($stdin_data_file $other_data_files $src_files $name)
foreach file($src_files)
  set obj_file = {$file:r}.o
  set rmfiles = ($rmfiles $obj_file)
end

if ($?CleanOption) /bin/rm $rmfiles >& /dev/null

#************************#
#                        #
# Display NCGM on screen #
# as it is generated     #
#                        #
#************************#
if ($?OneByOneOption) then
  if ( -f $graphic_file) then
    if ("$suffix" == "ncgm") then
      ctrans -d X11 -geometry 1142x865+10+0 $graphic_file
    else if ("$suffix" == "ps" || "$suffix" == "eps" || \
             "$suffix" == "epsi" ) then
      gs $graphic_file
    endif
    /bin/rm -f $graphic_file $rmfiles >& /dev/null
  endif
endif

theend:

end

exit

usage:
#*************************#
#                         #
# ncargex usage statement #
#                         #
#*************************#
echo "usage: ncargex [options] [example names]"
echo ""
echo " Options:"
echo ""
echo " To invoke various classes of examples:"
echo "   [-A] [-E] [-F] [-P] [-T] [-U] [-ngmath] [-class] [-ps] [-x11]"
echo ""
echo " To invoke various utilities:"
echo "   [-areas] [-autograph] [-bivar] [-colconv] [-conpack]     "
echo "   [-conpackt] [-conran_family] [-conrec_family] [-csagrid] "
echo "   [-cssgrid] [-dashline] [-dashpack] [-dsgrid] [-ezmap]    "
echo "   [-field_flow] [-fitgrid] [-gflash] [-gks] [-gridall]     "
echo "   [-halftone] [-histogram] [-isosrfhr] [-isosurface]       "
echo "   [-labelbar] [-natgrid] [-ngmisc] [-plotchar]             "
echo "   [-polypack] [-pwrite_family] [-scrolled_title]           "
echo "   [-seter] [-shgrid] [-softfill] [-spps] [-streamlines]    "
echo "   [-surface] [-threed] [-vaspackt][-vectors] [-wmap]       "
echo "   [-misc]                                                  "
echo ""
echo " Other options:"
echo "   [-W workstation_type] [-n] [-clean] [-onebyone] names"
echo ""
echo "See <man ncargex> for explanation of options." 
echo ""
exit