Depth sampling.xml

Page auto-generated from XML file.

Failure

The generated TethysL source could not be parsed, likely due to source XML not being well-formed.

Below is the compile error at the TethysL level, as well as the source XML.

The TethysL file name shown below does not necessarily indicate the file exists, but hints about the actual corresponding .xml file.

Syntax error:
     --> lrauv-application/Missions/Deprecated/Science/depth_sampling.xml:1802:7
      | 
 1798 | 
 1799 |     aggregate SetSpeedInitialDive {
 1800 |       run in sequence
 1801 | 
 1802 |       run when (
      |       ^^^
 1803 |         CntSamples == 1 count
 1804 |         and ( not ( FlagInitialDiveSpeedSet ) )
 1805 |       )
 1806 | 
      | 
Unexpected: `run`
Possible items include (total 15):
  break
  aggregate
  assign
  behavior
  [...7 more...]
  macro
  preemptive
  timeout
  }
   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
# Generated by TethysL
mission DepthSampling {
  arguments {
    # You probably need to change these.

    NumSamplers = 1 count
      """
      Total number of ESP or CANON samplers (Maximum 60 for ESP samplers. Set
      to a smaller number if not using all of them. Set to 0 to disable
      sampling).
      """

    MaxDepth = 30 meter
      """
      Maximum depth for the entire mission.
      """

    MinAltitude = 7 meter
      """
      Minimum altitude for the entire mission.
      """

    MinOffshore = 2 kilometer
      """
      Minimum offshore distance for the entire mission.
      """

    MissionTimeout = 12 hour
      """
      Maximum duration of mission
      """

    AcousticTrackingTimeout = 21 hour
      """
      If the vehicle does not receive an acoustic signal for more than this
      length of time, it will surface for communications. Set longer than
      MissionTimeout to effectively disable.
      """

    MaxWaitNoFiring = 3 hour
      """
      If no firing after more than MaxWaitNoFiring, terminate mission.
      """

    MaxWaitNotAchievingDepth = 3 hour
      """
      Maximum wait time the vehicle cannot reach the targeted depth.
      """

    RunToWaypointTimeout = 3 hour
      """
      Maximum duration for trying to achieve spiral cast waypoint
      """

    RunToWaypointNeedCommsTime = 30 minute
      """
      How often to surface for commumications when heading to waypoint
      """

    InitialDiveDuration = 5.0 minute
      """
      On the first dive to the target depth, run at SpeedInitialDive for this
      duration (e.g., 1 m/s spiral to dive fast).
      """

    SpeedTransit = 1.0 meter_per_second
      """
      Vehicle speed when transiting.
      """

    SpeedInitialDive = 1.0 meter_per_second
      """
      Vehicle speed during initial dive. 0.0 for drift mode (prop off); 1.0
      for spiral mode (prop on). Initialized to 1 m/s.
      """

    # debug
    #     </Description><Units:meter_per_second/><Value>0</Value></DefineArg>

    SpeedSampling = 1.0 meter_per_second
      """
      Vehicle speed during sampling: 0.0 for drift mode (prop off); 1.0 for
      donut mode (prop on). Initialized to 1 m/s.
      """

    # debug
    #     </Description><Units:meter_per_second/><Value>0</Value></DefineArg>

    RudderAngleSpiralOrDonut = 13 degree
      """
      Rudder angle during spiral or donut.
      """

    Latitude = NaN degree
      """
      Latitude of waypoint to seek. If set to NaN, uses latitude at mission
      initialization.
      """

    # debug
    #     </Description><Units:degree/><Value>36.810</Value></DefineArg>

    Longitude = NaN degree
      """
      Longitude of waypoint to seek. If set to NaN, uses longitude at mission
      initialization.
      """

    # debug
    #     </Description><Units:degree/><Value>-121.825</Value></DefineArg>

    Northings = 0 meter
      """
      Northward distance of the waypoint to seek. If combined with Latitude
      and/or Longitude, this is an offset from the specified Latitude and/or
      Longitude.
      """

    Eastings = 0 meter
      """
      Eastward distance of the waypoint to seek. If combined with Latitude
      and/or Longitude, this is an offset from the specified Latitude and/or
      Longitude.
      """

    DepthLevelFlight = NaN meter
      """
      Depth of level flight during the mission. If NaN, then yo-yo flight.
      """
      # debug
      #     </Description><Units:meter/><Value>10</Value></DefineArg>

    TransitYoYoMinDepth = 5 meter
      """
      Minimum depth while performing the YoYo behavior. Irrelevant if
      DepthLevelFlight is non-NaN (i.e., if level flight).
      """

    TransitYoYoMaxDepth = 20 meter
      """
      Maximum depth while performing the YoYo behavior. Irrelevant if
      DepthLevelFlight is non-NaN (i.e., if level flight). flight.
      """

    Depth1 = NaN meter
      """
      Depth of sample 1. If NaN, then smear sampling.
      """
      # debug
      #     </Description><Units:meter/><Value>10</Value></DefineArg>

    Depth2 = NaN meter
      """
      Depth of sample 2.
      """
      # debug
      #     </Description><Units:meter/><Value>20</Value></DefineArg>

    Depth3 = NaN meter
      """
      Depth of sample 3.
      """

    Depth4 = NaN meter
      """
      Depth of sample 4.
      """

    Depth5 = NaN meter
      """
      Depth of sample 5.
      """

    Depth6 = NaN meter
      """
      Depth of sample 6.
      """

    Depth7 = NaN meter
      """
      Depth of sample 7.
      """

    Depth8 = NaN meter
      """
      Depth of sample 8.
      """

    Depth9 = NaN meter
      """
      Depth of sample 9.
      """

    Depth10 = NaN meter
      """
      Depth of sample 10.
      """

    Depth11 = NaN meter
      """
      Depth of sample 11.
      """

    Depth12 = NaN meter
      """
      Depth of sample 12.
      """

    Depth13 = NaN meter
      """
      Depth of sample 13.
      """

    Depth14 = NaN meter
      """
      Depth of sample 14.
      """

    Depth15 = NaN meter
      """
      Depth of sample 15.
      """

    Depth16 = NaN meter
      """
      Depth of sample 16.
      """

    Depth17 = NaN meter
      """
      Depth of sample 17.
      """

    Depth18 = NaN meter
      """
      Depth of sample 18.
      """

    Depth19 = NaN meter
      """
      Depth of sample 19.
      """

    Depth20 = NaN meter
      """
      Depth of sample 20.
      """

    Depth21 = NaN meter
      """
      Depth of sample 21.
      """

    Depth22 = NaN meter
      """
      Depth of sample 22.
      """

    Depth23 = NaN meter
      """
      Depth of sample 23.
      """

    Depth24 = NaN meter
      """
      Depth of sample 24.
      """

    Depth25 = NaN meter
      """
      Depth of sample 25.
      """

    Depth26 = NaN meter
      """
      Depth of sample 26.
      """

    Depth27 = NaN meter
      """
      Depth of sample 27.
      """

    Depth28 = NaN meter
      """
      Depth of sample 28.
      """

    Depth29 = NaN meter
      """
      Depth of sample 29.
      """

    Depth30 = NaN meter
      """
      Depth of sample 30.
      """

    Depth31 = NaN meter
      """
      Depth of sample 31.
      """

    Depth32 = NaN meter
      """
      Depth of sample 32.
      """

    Depth33 = NaN meter
      """
      Depth of sample 33.
      """

    Depth34 = NaN meter
      """
      Depth of sample 34.
      """

    Depth35 = NaN meter
      """
      Depth of sample 35.
      """

    Depth36 = NaN meter
      """
      Depth of sample 36.
      """

    Depth37 = NaN meter
      """
      Depth of sample 37.
      """

    Depth38 = NaN meter
      """
      Depth of sample 38.
      """

    Depth39 = NaN meter
      """
      Depth of sample 39.
      """

    Depth40 = NaN meter
      """
      Depth of sample 40.
      """

    Depth41 = NaN meter
      """
      Depth of sample 41.
      """

    Depth42 = NaN meter
      """
      Depth of sample 42.
      """

    Depth43 = NaN meter
      """
      Depth of sample 43.
      """

    Depth44 = NaN meter
      """
      Depth of sample 44.
      """

    Depth45 = NaN meter
      """
      Depth of sample 45.
      """

    Depth46 = NaN meter
      """
      Depth of sample 46.
      """

    Depth47 = NaN meter
      """
      Depth of sample 47.
      """

    Depth48 = NaN meter
      """
      Depth of sample 48.
      """

    Depth49 = NaN meter
      """
      Depth of sample 49.
      """

    Depth50 = NaN meter
      """
      Depth of sample 50.
      """

    Depth51 = NaN meter
      """
      Depth of sample 51.
      """

    Depth52 = NaN meter
      """
      Depth of sample 52.
      """

    Depth53 = NaN meter
      """
      Depth of sample 53.
      """

    Depth54 = NaN meter
      """
      Depth of sample 54.
      """

    Depth55 = NaN meter
      """
      Depth of sample 55.
      """

    Depth56 = NaN meter
      """
      Depth of sample 56.
      """

    Depth57 = NaN meter
      """
      Depth of sample 57.
      """

    Depth58 = NaN meter
      """
      Depth of sample 58.
      """

    Depth59 = NaN meter
      """
      Depth of sample 59.
      """

    Depth60 = NaN meter
      """
      Depth of sample 60.
      """

    WaitDepUndulation1 = 10.0 minute
      """
      Sample 1. Wait duration for the depth undulation to damp down.
      """

    WaitDepUndulation2 = 10.0 minute
      """
      Sample 2.
      """

    WaitDepUndulation3 = 10.0 minute
      """
      Sample 3.
      """

    WaitDepUndulation4 = 10.0 minute
      """
      Sample 4.
      """

    WaitDepUndulation5 = 10.0 minute
      """
      Sample 5.
      """

    WaitDepUndulation6 = 10.0 minute
      """
      Sample 6.
      """

    WaitDepUndulation7 = 10.0 minute
      """
      Sample 7.
      """

    WaitDepUndulation8 = 10.0 minute
      """
      Sample 8.
      """

    WaitDepUndulation9 = 10.0 minute
      """
      Sample 9.
      """

    WaitDepUndulation10 = 10.0 minute
      """
      Sample 10.
      """

    WaitDepUndulation11 = 10.0 minute
      """
      Sample 11.
      """

    WaitDepUndulation12 = 10.0 minute
      """
      Sample 12.
      """

    WaitDepUndulation13 = 10.0 minute
      """
      Sample 13.
      """

    WaitDepUndulation14 = 10.0 minute
      """
      Sample 14.
      """

    WaitDepUndulation15 = 10.0 minute
      """
      Sample 15.
      """

    WaitDepUndulation16 = 10.0 minute
      """
      Sample 16.
      """

    WaitDepUndulation17 = 10.0 minute
      """
      Sample 17.
      """

    WaitDepUndulation18 = 10.0 minute
      """
      Sample 18.
      """

    WaitDepUndulation19 = 10.0 minute
      """
      Sample 19.
      """

    WaitDepUndulation20 = 10.0 minute
      """
      Sample 20.
      """

    WaitDepUndulation21 = 10.0 minute
      """
      Sample 21.
      """

    WaitDepUndulation22 = 10.0 minute
      """
      Sample 22.
      """

    WaitDepUndulation23 = 10.0 minute
      """
      Sample 23.
      """

    WaitDepUndulation24 = 10.0 minute
      """
      Sample 24.
      """

    WaitDepUndulation25 = 10.0 minute
      """
      Sample 25.
      """

    WaitDepUndulation26 = 10.0 minute
      """
      Sample 26.
      """

    WaitDepUndulation27 = 10.0 minute
      """
      Sample 27.
      """

    WaitDepUndulation28 = 10.0 minute
      """
      Sample 28.
      """

    WaitDepUndulation29 = 10.0 minute
      """
      Sample 29.
      """

    WaitDepUndulation30 = 10.0 minute
      """
      Sample 30.
      """

    WaitDepUndulation31 = 10.0 minute
      """
      Sample 31.
      """

    WaitDepUndulation32 = 10.0 minute
      """
      Sample 32.
      """

    WaitDepUndulation33 = 10.0 minute
      """
      Sample 33.
      """

    WaitDepUndulation34 = 10.0 minute
      """
      Sample 34.
      """

    WaitDepUndulation35 = 10.0 minute
      """
      Sample 35.
      """

    WaitDepUndulation36 = 10.0 minute
      """
      Sample 36.
      """

    WaitDepUndulation37 = 10.0 minute
      """
      Sample 37.
      """

    WaitDepUndulation38 = 10.0 minute
      """
      Sample 38.
      """

    WaitDepUndulation39 = 10.0 minute
      """
      Sample 39.
      """

    WaitDepUndulation40 = 10.0 minute
      """
      Sample 40.
      """

    WaitDepUndulation41 = 10.0 minute
      """
      Sample 41.
      """

    WaitDepUndulation42 = 10.0 minute
      """
      Sample 42.
      """

    WaitDepUndulation43 = 10.0 minute
      """
      Sample 43.
      """

    WaitDepUndulation44 = 10.0 minute
      """
      Sample 44.
      """

    WaitDepUndulation45 = 10.0 minute
      """
      Sample 45.
      """

    WaitDepUndulation46 = 10.0 minute
      """
      Sample 46.
      """

    WaitDepUndulation47 = 10.0 minute
      """
      Sample 47.
      """

    WaitDepUndulation48 = 10.0 minute
      """
      Sample 48.
      """

    WaitDepUndulation49 = 10.0 minute
      """
      Sample 49.
      """

    WaitDepUndulation50 = 10.0 minute
      """
      Sample 50.
      """

    WaitDepUndulation51 = 10.0 minute
      """
      Sample 51.
      """

    WaitDepUndulation52 = 10.0 minute
      """
      Sample 52.
      """

    WaitDepUndulation53 = 10.0 minute
      """
      Sample 53.
      """

    WaitDepUndulation54 = 10.0 minute
      """
      Sample 54.
      """

    WaitDepUndulation55 = 10.0 minute
      """
      Sample 55.
      """

    WaitDepUndulation56 = 10.0 minute
      """
      Sample 56.
      """

    WaitDepUndulation57 = 10.0 minute
      """
      Sample 57.
      """

    WaitDepUndulation58 = 10.0 minute
      """
      Sample 58.
      """

    WaitDepUndulation59 = 10.0 minute
      """
      Sample 59.
      """

    WaitDepUndulation60 = 10.0 minute
      """
      Sample 60.
      """

    ShallowBndSmear1 = NaN meter
      """
      Shallow depth bound for smear sampling.
      """

    DeepBndSmear1 = NaN meter
      """
      Deep depth bound for smear sampling.
      """

    ShallowBndSmear2 = NaN meter
      """
      Sample 2.
      """
      # debug
      #     </Description><Units:meter/><Value>17</Value></DefineArg>

    DeepBndSmear2 = NaN meter
      """
      Sample 2.
      """
      # debug
      #     </Description><Units:meter/><Value>20</Value></DefineArg>

    ShallowBndSmear3 = NaN meter
      """
      Sample 3.
      """

    DeepBndSmear3 = NaN meter
      """
      Sample 3.
      """

    ShallowBndSmear4 = NaN meter
      """
      Sample 4.
      """

    DeepBndSmear4 = NaN meter
      """
      Sample 4.
      """

    ShallowBndSmear5 = NaN meter
      """
      Sample 5.
      """

    DeepBndSmear5 = NaN meter
      """
      Sample 5.
      """

    ShallowBndSmear6 = NaN meter
      """
      Sample 6.
      """

    DeepBndSmear6 = NaN meter
      """
      Sample 6.
      """

    ShallowBndSmear7 = NaN meter
      """
      Sample 7.
      """

    DeepBndSmear7 = NaN meter
      """
      Sample 7.
      """

    ShallowBndSmear8 = NaN meter
      """
      Sample 8.
      """

    DeepBndSmear8 = NaN meter
      """
      Sample 8.
      """

    ShallowBndSmear9 = NaN meter
      """
      Sample 9.
      """

    DeepBndSmear9 = NaN meter
      """
      Sample 9.
      """

    ShallowBndSmear10 = NaN meter
      """
      Sample 10.
      """

    DeepBndSmear10 = NaN meter
      """
      Sample 10.
      """

    ShallowBndSmear11 = NaN meter
      """
      Sample 11.
      """

    DeepBndSmear11 = NaN meter
      """
      Sample 11.
      """

    ShallowBndSmear12 = NaN meter
      """
      Sample 12.
      """

    DeepBndSmear12 = NaN meter
      """
      Sample 12.
      """

    ShallowBndSmear13 = NaN meter
      """
      Sample 13.
      """

    DeepBndSmear13 = NaN meter
      """
      Sample 13.
      """

    ShallowBndSmear14 = NaN meter
      """
      Sample 14.
      """

    DeepBndSmear14 = NaN meter
      """
      Sample 14.
      """

    ShallowBndSmear15 = NaN meter
      """
      Sample 15.
      """

    DeepBndSmear15 = NaN meter
      """
      Sample 15.
      """

    ShallowBndSmear16 = NaN meter
      """
      Sample 16.
      """

    DeepBndSmear16 = NaN meter
      """
      Sample 16.
      """

    ShallowBndSmear17 = NaN meter
      """
      Sample 17.
      """

    DeepBndSmear17 = NaN meter
      """
      Sample 17.
      """

    ShallowBndSmear18 = NaN meter
      """
      Sample 18.
      """

    DeepBndSmear18 = NaN meter
      """
      Sample 18.
      """

    ShallowBndSmear19 = NaN meter
      """
      Sample 19.
      """

    DeepBndSmear19 = NaN meter
      """
      Sample 19.
      """

    ShallowBndSmear20 = NaN meter
      """
      Sample 20.
      """

    DeepBndSmear20 = NaN meter
      """
      Sample 20.
      """

    ShallowBndSmear21 = NaN meter
      """
      Sample 21.
      """

    DeepBndSmear21 = NaN meter
      """
      Sample 21.
      """

    ShallowBndSmear22 = NaN meter
      """
      Sample 22.
      """

    DeepBndSmear22 = NaN meter
      """
      Sample 22.
      """

    ShallowBndSmear23 = NaN meter
      """
      Sample 23.
      """

    DeepBndSmear23 = NaN meter
      """
      Sample 23.
      """

    ShallowBndSmear24 = NaN meter
      """
      Sample 24.
      """

    DeepBndSmear24 = NaN meter
      """
      Sample 24.
      """

    ShallowBndSmear25 = NaN meter
      """
      Sample 25.
      """

    DeepBndSmear25 = NaN meter
      """
      Sample 25.
      """

    ShallowBndSmear26 = NaN meter
      """
      Sample 26.
      """

    DeepBndSmear26 = NaN meter
      """
      Sample 26.
      """

    ShallowBndSmear27 = NaN meter
      """
      Sample 27.
      """

    DeepBndSmear27 = NaN meter
      """
      Sample 27.
      """

    ShallowBndSmear28 = NaN meter
      """
      Sample 28.
      """

    DeepBndSmear28 = NaN meter
      """
      Sample 28.
      """

    ShallowBndSmear29 = NaN meter
      """
      Sample 29.
      """

    DeepBndSmear29 = NaN meter
      """
      Sample 29.
      """

    ShallowBndSmear30 = NaN meter
      """
      Sample 30.
      """

    DeepBndSmear30 = NaN meter
      """
      Sample 30.
      """

    ShallowBndSmear31 = NaN meter
      """
      Sample 31.
      """

    DeepBndSmear31 = NaN meter
      """
      Sample 31.
      """

    ShallowBndSmear32 = NaN meter
      """
      Sample 32.
      """

    DeepBndSmear32 = NaN meter
      """
      Sample 32.
      """

    ShallowBndSmear33 = NaN meter
      """
      Sample 33.
      """

    DeepBndSmear33 = NaN meter
      """
      Sample 33.
      """

    ShallowBndSmear34 = NaN meter
      """
      Sample 34.
      """

    DeepBndSmear34 = NaN meter
      """
      Sample 34.
      """

    ShallowBndSmear35 = NaN meter
      """
      Sample 35.
      """

    DeepBndSmear35 = NaN meter
      """
      Sample 35.
      """

    ShallowBndSmear36 = NaN meter
      """
      Sample 36.
      """

    DeepBndSmear36 = NaN meter
      """
      Sample 36.
      """

    ShallowBndSmear37 = NaN meter
      """
      Sample 37.
      """

    DeepBndSmear37 = NaN meter
      """
      Sample 37.
      """

    ShallowBndSmear38 = NaN meter
      """
      Sample 38.
      """

    DeepBndSmear38 = NaN meter
      """
      Sample 38.
      """

    ShallowBndSmear39 = NaN meter
      """
      Sample 39.
      """

    DeepBndSmear39 = NaN meter
      """
      Sample 39.
      """

    ShallowBndSmear40 = NaN meter
      """
      Sample 40.
      """

    DeepBndSmear40 = NaN meter
      """
      Sample 40.
      """

    ShallowBndSmear41 = NaN meter
      """
      Sample 41.
      """

    DeepBndSmear41 = NaN meter
      """
      Sample 41.
      """

    ShallowBndSmear42 = NaN meter
      """
      Sample 42.
      """

    DeepBndSmear42 = NaN meter
      """
      Sample 42.
      """

    ShallowBndSmear43 = NaN meter
      """
      Sample 43.
      """

    DeepBndSmear43 = NaN meter
      """
      Sample 43.
      """

    ShallowBndSmear44 = NaN meter
      """
      Sample 44.
      """

    DeepBndSmear44 = NaN meter
      """
      Sample 44.
      """

    ShallowBndSmear45 = NaN meter
      """
      Sample 45.
      """

    DeepBndSmear45 = NaN meter
      """
      Sample 45.
      """

    ShallowBndSmear46 = NaN meter
      """
      Sample 46.
      """

    DeepBndSmear46 = NaN meter
      """
      Sample 46.
      """

    ShallowBndSmear47 = NaN meter
      """
      Sample 47.
      """

    DeepBndSmear47 = NaN meter
      """
      Sample 47.
      """

    ShallowBndSmear48 = NaN meter
      """
      Sample 48.
      """

    DeepBndSmear48 = NaN meter
      """
      Sample 48.
      """

    ShallowBndSmear49 = NaN meter
      """
      Sample 49.
      """

    DeepBndSmear49 = NaN meter
      """
      Sample 49.
      """

    ShallowBndSmear50 = NaN meter
      """
      Sample 50.
      """

    DeepBndSmear50 = NaN meter
      """
      Sample 50.
      """

    ShallowBndSmear51 = NaN meter
      """
      Sample 51.
      """

    DeepBndSmear51 = NaN meter
      """
      Sample 51.
      """

    ShallowBndSmear52 = NaN meter
      """
      Sample 52.
      """

    DeepBndSmear52 = NaN meter
      """
      Sample 52.
      """

    ShallowBndSmear53 = NaN meter
      """
      Sample 53.
      """

    DeepBndSmear53 = NaN meter
      """
      Sample 53.
      """

    ShallowBndSmear54 = NaN meter
      """
      Sample 54.
      """

    DeepBndSmear54 = NaN meter
      """
      Sample 54.
      """

    ShallowBndSmear55 = NaN meter
      """
      Sample 55.
      """

    DeepBndSmear55 = NaN meter
      """
      Sample 55.
      """

    ShallowBndSmear56 = NaN meter
      """
      Sample 56.
      """

    DeepBndSmear56 = NaN meter
      """
      Sample 56.
      """

    ShallowBndSmear57 = NaN meter
      """
      Sample 57.
      """

    DeepBndSmear57 = NaN meter
      """
      Sample 57.
      """

    ShallowBndSmear58 = NaN meter
      """
      Sample 58.
      """

    DeepBndSmear58 = NaN meter
      """
      Sample 58.
      """

    ShallowBndSmear59 = NaN meter
      """
      Sample 59.
      """

    DeepBndSmear59 = NaN meter
      """
      Sample 59.
      """

    ShallowBndSmear60 = NaN meter
      """
      Sample 60.
      """

    DeepBndSmear60 = NaN meter
      """
      Sample 60.
      """

    # Use caution when changing these.

    UpRate = -0.1 meter_per_second
      """
      Go-up depth rate in smear sampling mode (negative depth rate means going
      up).
      """

    DownRate = 0.1 meter_per_second
      """
      Go-down depth rate in smear sampling mode (positive depth rate means
      going down).
      """

    # You probably do not need to change these.

    TransitYoYoUpPitch = 20 degree
      """
      Vehicle up pitch while performing the YoYo behavior.
      """

    TransitYoYoDownPitch = -20 degree
      """
      Vehicle down pitch while performing the YoYo behavior.
      """

    BuoyancyNeutral = Control:VerticalControl.buoyancyNeutral
      """
      Buoyancy bladder position while performing the YoYo behavior. Defaults
      to buoyancyNeutral setting in the Config/Control.cfg file. Set to NaN cc
      for active buoyancy
      """

    MassDefault = Control:VerticalControl.massDefault
      """
      Static setting for mass during the mission. Set to NaN mm for active
      mass position
      """

    # Internal variables that you should not change

    SpeedApproachThenSample = 1.0 meter_per_second
      """
      Vehicle speed when approaching the target isotherm or depth and then
      sampling. Initialized to 1 m/s.
      """

    DepthLogged = 0.0 meter
      """

      """

    TempLogged = 0.0 celsius
      """

      """

    ChlLogged = 0.0 microgram_per_liter
      """

      """

    TransitCompleted = false
      """
      Transit is completed (initialized to false).
      """

    TargetedDepth = NaN meter
      """
      Depth if pre-designated. Initialized to NaN.
      """

    WaitDepthUndulation = 10.0 minute
      """
      Wait duration for the depth undulation to damp down. Initialized to 10
      minutes.
      """

    ShallowBoundSmear = NaN meter
      """
      Shallow depth bound for smear sampling.
      """

    DeepBoundSmear = NaN meter
      """
      Deep depth bound for smear sampling.
      """

    SampleOptionsSet = false
      """
      Sample options (VertDistance, ReportAtSurface, ReacquirePeak) already
      set. Initialized to false.
      """

    SampleCompleted = false
      """
      Sampling completed. Initialized to false.
      """

    StoppedForNoFiringForTooLong = false
      """
      Mission stopped because of no firing for too long. Initialized to false.
      """

    FlagSamplingOngoing = false
      """
      Flag of water sampling in process (initialized to false).
      """

    FlagFired = false
      """
      Flag of sample fired (initialized to false).
      """

    FlagGoUp = false
      """
      Go-up flag (set to true when going up. Initialized to false).
      """

    FlagGoDown = false
      """
      Go-down flag (set to true when going down. Initialized to false).
      """

    FlagInitialDiveSpeedSet = false
      """
      Flag of initial dive speed set. Initialized to false.
      """

    EnableFiringSmear = true
      """
      Enable firing. Initialized to true.
      """

    FromLastTimeFixToStartDive = NaN minute
      """
      Elapsed time from last time-fix to StartDive.
      """

    FromLastTimeFixToNow = NaN minute
      """
      Elapsed time from last time-fix to now.
      """

    FromLastTimeFixToLastFiring = NaN minute
      """
      Elapsed time from last time-fix to last firing.
      """

    CntSamples = 1 count
      """
      Count of water samples (initilized to 1).
      """
  }

  # Missions should almost always start with a timeout and a NeedComms aggregate. Drift missions will not use NeedComms.

  timeout duration=MissionTimeout

  insert Insert/AbortDrift.tl {
    redefineArg AcousticTimeout = AcousticTrackingTimeout
  }



  insert Insert/Science.tl {
    redefineArg PeakDetectChlActive = true
  }



  insert Insert/StandardEnvelopes.tl


  assign in sequence StandardEnvelopes:MinAltitude = MinAltitude

  assign in sequence StandardEnvelopes:MaxDepth = MaxDepth

  assign in sequence StandardEnvelopes:MinOffshore = MinOffshore

  behavior Guidance:Pitch {
    run in parallel
    set Guidance:Pitch.massPosition = MassDefault
  }

  insert Insert/SampleAtDepth.tl {
    redefineArg MaxWaitNotReachingDepth = MaxWaitNotAchievingDepth
  }



  insert Insert/NeedComms.tl id="NeedComms"


  call id="StartingMission" refId="NeedComms"

  aggregate ESPSampling {
    run when (
      called
    )

    aggregate TriggerESP {
      run in sequence

      assign in sequence DepthLogged = Universal:depth

      assign in sequence TempLogged = Universal:sea_water_temperature

      assign in sequence ChlLogged = Universal:mass_concentration_of_chlorophyll_in_sea_water

      syslog important "Trigger ESP sampling. DepthLogged, TempLogged, ChlLogged = "
           + DepthLogged ~ meter
           + ", "
           + TempLogged ~ celsius
           + ", "
           + ChlLogged ~ microgram_per_liter
           + "."

      readDatum {
        Science:ESPComponent.sampling
      }

      syslog important "Wait for ESP sampling to complete."

      readDatum {
        Science:ESPComponent.sample_number
      }
    }
  }

  aggregate SampleAtDepthWrapper {
    run when (
      called
    )

    break if (
      TargetedDepth >= MaxDepth
    )

    assign in sequence SampleAtDepth:TargetDepth = TargetedDepth

    assign in sequence SampleAtDepth:SettleTime = WaitDepthUndulation

    call id="SampleAtTargetDepth" refId="SampleAtDepth"

    syslog important "ESP sample No."
         + CntSamples ~ count
         + " completed."
  }

  aggregate SmearSamplingWrapper {
    run when (
      called
    )

    break if (
      not ( EnableFiringSmear )
    )

    aggregate GoDownGoUpFire {
      run in sequence

      aggregate GoDownInSpiralMode {
        run while (
          EnableFiringSmear
          and FlagGoDown
        )

        behavior Guidance:Pitch {
          run in parallel
          set Guidance:Pitch.depthRate = DownRate
        }
      }

      aggregate GoUpInSpiralMode {
        run while (
          EnableFiringSmear
          and FlagGoUp
        )

        behavior Guidance:Pitch {
          run in parallel
          set Guidance:Pitch.depthRate = UpRate
        }
      }

      aggregate ResetFlagGoDownSetFlagGoUp {
        run when (
          EnableFiringSmear
          and ( Universal:depth >= DeepBoundSmear )
          and ( not ( FlagGoUp ) )
        )

        assign in sequence FlagGoDown = false

        assign in sequence FlagGoUp = true

        syslog important "Bounce up from "
             + Universal:depth ~ meter
             + "."
      }

      aggregate ResetFlagGoUpSetFlagGoDown {
        run when (
          EnableFiringSmear
          and ( Universal:depth <= ShallowBoundSmear )
          and ( not ( FlagGoDown ) )
        )

        assign in sequence FlagGoUp = false

        assign in sequence FlagGoDown = true

        syslog important "Bounce down from "
             + Universal:depth ~ meter
             + "."
      }

      aggregate Firing {
        run when (
          EnableFiringSmear
          and FlagGoDown
          and ( Universal:depth >= ShallowBoundSmear )
          or (
            EnableFiringSmear
            and FlagGoUp
            and ( Universal:depth <= DeepBoundSmear )
          )
        )

        call id="Sampling" refId="ESPSampling"

        syslog important " ESP sample No."
             + CntSamples ~ count
             + " completed."

        assign in sequence EnableFiringSmear = false
      }
    }
  }

  aggregate Transit {
    run in sequence

    timeout duration=RunToWaypointTimeout {
      syslog important "Timed out trying to reach the waypoint. Stopping mission."
      behavior Guidance:Execute {
        run in sequence
        set Guidance:Execute.command = "stop"
      }
    }


    assign in sequence NeedComms:DiveInterval = RunToWaypointNeedCommsTime

    assign in sequence NeedComms:SurfaceSpeed = SpeedTransit

    behavior Guidance:SetSpeed {
      run in parallel
      set Guidance:SetSpeed.speed = SpeedTransit
    }

    behavior Guidance:Buoyancy {
      run in parallel
      set Guidance:Buoyancy.position = BuoyancyNeutral
    }

    aggregate YoyoToWaypoint {
      run in sequence

      break if (
        not ( isNaN ( DepthLevelFlight ) )
      )

      behavior Guidance:DepthEnvelope {
        run in parallel
        set Guidance:DepthEnvelope.minDepth = TransitYoYoMinDepth
        set Guidance:DepthEnvelope.maxDepth = TransitYoYoMaxDepth
        set Guidance:DepthEnvelope.downPitch = TransitYoYoDownPitch
        set Guidance:DepthEnvelope.upPitch = TransitYoYoUpPitch
      }

      behavior Guidance:YoYo {
        run in parallel
        set Guidance:YoYo.downPitch = TransitYoYoDownPitch
        set Guidance:YoYo.upPitch = TransitYoYoUpPitch
      }

      behavior Guidance:Waypoint {
        run in sequence
        set Guidance:Waypoint.latitude = Latitude
        set Guidance:Waypoint.longitude = Longitude
        set Guidance:Waypoint.northingsDelta = Northings
        set Guidance:Waypoint.eastingsDelta = Eastings
      }
    }

    aggregate LevelFlightToWaypoint {
      run in sequence

      break if (
        isNaN ( DepthLevelFlight )
      )

      behavior Guidance:Pitch {
        run in parallel
        set Guidance:Pitch.depth = DepthLevelFlight
      }

      behavior Guidance:Waypoint {
        run in sequence
        set Guidance:Waypoint.latitude = Latitude
        set Guidance:Waypoint.longitude = Longitude
        set Guidance:Waypoint.northingsDelta = Northings
        set Guidance:Waypoint.eastingsDelta = Eastings
      }
    }

    call id="DoneTransit" refId="NeedComms"

    assign in sequence TransitCompleted = true

    assign in sequence FlagGoDown = true

    syslog important "Transit and NeedComms completed. Go down from "
         + Universal:depth ~ meter
         + "."

    assign in sequence FromLastTimeFixToStartDive = elapsed ( Universal:time_fix )

    # debug
    #   <Syslog Severity="Important">FromLastTimeFixToStartDive = <Arg Name="FromLastTimeFixToStartDive"/><Units:minute/></Syslog>

    assign in sequence SpeedApproachThenSample = SpeedInitialDive
  }

  assign in sequence NeedComms:DiveInterval = MissionTimeout

  aggregate TakeSamples {
    run in sequence

    break if (
      not ( TransitCompleted )
      or ( CntSamples == ( NumSamplers + 1 count ) )
    )

    aggregate SetSpeedInitialDive {
      run in sequence

      run when (
        CntSamples == 1 count
        and ( not ( FlagInitialDiveSpeedSet ) )
      )

      assign in sequence SpeedApproachThenSample = SpeedInitialDive

      behavior Guidance:Wait {
        run in sequence
        set Guidance:Wait.duration = InitialDiveDuration
      }

      assign in sequence SpeedApproachThenSample = SpeedSampling

      assign in sequence FlagInitialDiveSpeedSet = true
    }

    aggregate SetNeutralBuoyancyNonZeroRudderInSpiralOrDonutMode {
      run in parallel

      run while ( SpeedApproachThenSample > 0.0 meter_per_second )

      behavior Guidance:SetSpeed {
        run in parallel
        set Guidance:SetSpeed.speed = SpeedApproachThenSample
      }

      behavior Guidance:Buoyancy {
        run in parallel
        set Guidance:Buoyancy.position = BuoyancyNeutral
      }

      behavior Guidance:Point {
        run in parallel
        set Guidance:Point.rudderAngle = RudderAngleSpiralOrDonut
      }
    }

    aggregate SetZeroRudderInDriftMode {
      run in parallel

      run while ( not ( SpeedApproachThenSample > 0.0 meter_per_second ) )

      behavior Guidance:SetSpeed {
        run in parallel
        set Guidance:SetSpeed.speed = SpeedApproachThenSample
      }

      behavior Guidance:Point {
        run in parallel
        set Guidance:Point.rudderAngle = 0.0 degree
      }
    }

    aggregate NoFiringForTooLong {
      run when (
        elapsed ( Universal:time_fix ) > ( FromLastTimeFixToStartDive + MaxWaitNoFiring )
        and ( not ( FlagSamplingOngoing ) )
        and ( CntSamples == 1 count )
        and ( not ( FlagFired ) )
        and ( not ( StoppedForNoFiringForTooLong ) )
        or (
          elapsed ( Universal:time_fix ) > ( FromLastTimeFixToLastFiring + MaxWaitNoFiring )
          and ( not ( FlagSamplingOngoing ) )
          and ( CntSamples >= 2 count )
          and ( not ( StoppedForNoFiringForTooLong ) )
        )
      )

      assign in sequence FromLastTimeFixToNow = elapsed ( Universal:time_fix )

      syslog important "No firing for too long. Stopping mission. FromLastTimeFixToNow, FromLastTimeFixToLastFiring = "
           + FromLastTimeFixToNow ~ minute
           + ", "
           + FromLastTimeFixToLastFiring ~ minute

      behavior Guidance:Execute {
        run in sequence
        set Guidance:Execute.command = "stop"
      }

      assign in sequence StoppedForNoFiringForTooLong = true
    }

    aggregate SetOptionsOfSample1 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 1 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth1

      assign in sequence WaitDepthUndulation = WaitDepUndulation1

      assign in sequence ShallowBoundSmear = ShallowBndSmear1

      assign in sequence DeepBoundSmear = DeepBndSmear1

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample2 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 2 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth2

      assign in sequence WaitDepthUndulation = WaitDepUndulation2

      assign in sequence ShallowBoundSmear = ShallowBndSmear2

      assign in sequence DeepBoundSmear = DeepBndSmear2

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample3 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 3 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth3

      assign in sequence WaitDepthUndulation = WaitDepUndulation3

      assign in sequence ShallowBoundSmear = ShallowBndSmear3

      assign in sequence DeepBoundSmear = DeepBndSmear3

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample4 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 4 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth4

      assign in sequence WaitDepthUndulation = WaitDepUndulation4

      assign in sequence ShallowBoundSmear = ShallowBndSmear4

      assign in sequence DeepBoundSmear = DeepBndSmear4

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample5 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 5 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth5

      assign in sequence WaitDepthUndulation = WaitDepUndulation5

      assign in sequence ShallowBoundSmear = ShallowBndSmear5

      assign in sequence DeepBoundSmear = DeepBndSmear5

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample6 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 6 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth6

      assign in sequence WaitDepthUndulation = WaitDepUndulation6

      assign in sequence ShallowBoundSmear = ShallowBndSmear6

      assign in sequence DeepBoundSmear = DeepBndSmear6

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample7 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 7 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth7

      assign in sequence WaitDepthUndulation = WaitDepUndulation7

      assign in sequence ShallowBoundSmear = ShallowBndSmear7

      assign in sequence DeepBoundSmear = DeepBndSmear7

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample8 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 8 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth8

      assign in sequence WaitDepthUndulation = WaitDepUndulation8

      assign in sequence ShallowBoundSmear = ShallowBndSmear8

      assign in sequence DeepBoundSmear = DeepBndSmear8

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample9 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 9 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth9

      assign in sequence WaitDepthUndulation = WaitDepUndulation9

      assign in sequence ShallowBoundSmear = ShallowBndSmear9

      assign in sequence DeepBoundSmear = DeepBndSmear9

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample10 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 10 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth10

      assign in sequence WaitDepthUndulation = WaitDepUndulation10

      assign in sequence ShallowBoundSmear = ShallowBndSmear10

      assign in sequence DeepBoundSmear = DeepBndSmear10

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample11 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 11 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth11

      assign in sequence WaitDepthUndulation = WaitDepUndulation11

      assign in sequence ShallowBoundSmear = ShallowBndSmear11

      assign in sequence DeepBoundSmear = DeepBndSmear11

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample12 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 12 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth12

      assign in sequence WaitDepthUndulation = WaitDepUndulation12

      assign in sequence ShallowBoundSmear = ShallowBndSmear12

      assign in sequence DeepBoundSmear = DeepBndSmear12

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample13 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 13 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth13

      assign in sequence WaitDepthUndulation = WaitDepUndulation13

      assign in sequence ShallowBoundSmear = ShallowBndSmear13

      assign in sequence DeepBoundSmear = DeepBndSmear13

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample14 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 14 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth14

      assign in sequence WaitDepthUndulation = WaitDepUndulation14

      assign in sequence ShallowBoundSmear = ShallowBndSmear14

      assign in sequence DeepBoundSmear = DeepBndSmear14

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample15 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 15 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth15

      assign in sequence WaitDepthUndulation = WaitDepUndulation15

      assign in sequence ShallowBoundSmear = ShallowBndSmear15

      assign in sequence DeepBoundSmear = DeepBndSmear15

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample16 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 16 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth16

      assign in sequence WaitDepthUndulation = WaitDepUndulation16

      assign in sequence ShallowBoundSmear = ShallowBndSmear16

      assign in sequence DeepBoundSmear = DeepBndSmear16

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample17 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 17 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth17

      assign in sequence WaitDepthUndulation = WaitDepUndulation17

      assign in sequence ShallowBoundSmear = ShallowBndSmear17

      assign in sequence DeepBoundSmear = DeepBndSmear17

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample18 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 18 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth18

      assign in sequence WaitDepthUndulation = WaitDepUndulation18

      assign in sequence ShallowBoundSmear = ShallowBndSmear18

      assign in sequence DeepBoundSmear = DeepBndSmear18

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample19 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 19 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth19

      assign in sequence WaitDepthUndulation = WaitDepUndulation19

      assign in sequence ShallowBoundSmear = ShallowBndSmear19

      assign in sequence DeepBoundSmear = DeepBndSmear19

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample20 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 20 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth20

      assign in sequence WaitDepthUndulation = WaitDepUndulation20

      assign in sequence ShallowBoundSmear = ShallowBndSmear20

      assign in sequence DeepBoundSmear = DeepBndSmear20

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample21 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 21 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth21

      assign in sequence WaitDepthUndulation = WaitDepUndulation21

      assign in sequence ShallowBoundSmear = ShallowBndSmear21

      assign in sequence DeepBoundSmear = DeepBndSmear21

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample22 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 22 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth22

      assign in sequence WaitDepthUndulation = WaitDepUndulation22

      assign in sequence ShallowBoundSmear = ShallowBndSmear22

      assign in sequence DeepBoundSmear = DeepBndSmear22

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample23 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 23 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth23

      assign in sequence WaitDepthUndulation = WaitDepUndulation23

      assign in sequence ShallowBoundSmear = ShallowBndSmear23

      assign in sequence DeepBoundSmear = DeepBndSmear23

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample24 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 24 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth24

      assign in sequence WaitDepthUndulation = WaitDepUndulation24

      assign in sequence ShallowBoundSmear = ShallowBndSmear24

      assign in sequence DeepBoundSmear = DeepBndSmear24

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample25 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 25 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth25

      assign in sequence WaitDepthUndulation = WaitDepUndulation25

      assign in sequence ShallowBoundSmear = ShallowBndSmear25

      assign in sequence DeepBoundSmear = DeepBndSmear25

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample26 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 26 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth26

      assign in sequence WaitDepthUndulation = WaitDepUndulation26

      assign in sequence ShallowBoundSmear = ShallowBndSmear26

      assign in sequence DeepBoundSmear = DeepBndSmear26

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample27 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 27 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth27

      assign in sequence WaitDepthUndulation = WaitDepUndulation27

      assign in sequence ShallowBoundSmear = ShallowBndSmear27

      assign in sequence DeepBoundSmear = DeepBndSmear27

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample28 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 28 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth28

      assign in sequence WaitDepthUndulation = WaitDepUndulation28

      assign in sequence ShallowBoundSmear = ShallowBndSmear28

      assign in sequence DeepBoundSmear = DeepBndSmear28

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample29 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 29 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth29

      assign in sequence WaitDepthUndulation = WaitDepUndulation29

      assign in sequence ShallowBoundSmear = ShallowBndSmear29

      assign in sequence DeepBoundSmear = DeepBndSmear29

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample30 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 30 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth30

      assign in sequence WaitDepthUndulation = WaitDepUndulation30

      assign in sequence ShallowBoundSmear = ShallowBndSmear30

      assign in sequence DeepBoundSmear = DeepBndSmear30

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample31 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 31 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth31

      assign in sequence WaitDepthUndulation = WaitDepUndulation31

      assign in sequence ShallowBoundSmear = ShallowBndSmear31

      assign in sequence DeepBoundSmear = DeepBndSmear31

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample32 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 32 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth32

      assign in sequence WaitDepthUndulation = WaitDepUndulation32

      assign in sequence ShallowBoundSmear = ShallowBndSmear32

      assign in sequence DeepBoundSmear = DeepBndSmear32

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample33 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 33 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth33

      assign in sequence WaitDepthUndulation = WaitDepUndulation33

      assign in sequence ShallowBoundSmear = ShallowBndSmear33

      assign in sequence DeepBoundSmear = DeepBndSmear33

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample34 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 34 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth34

      assign in sequence WaitDepthUndulation = WaitDepUndulation34

      assign in sequence ShallowBoundSmear = ShallowBndSmear34

      assign in sequence DeepBoundSmear = DeepBndSmear34

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample35 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 35 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth35

      assign in sequence WaitDepthUndulation = WaitDepUndulation35

      assign in sequence ShallowBoundSmear = ShallowBndSmear35

      assign in sequence DeepBoundSmear = DeepBndSmear35

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample36 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 36 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth36

      assign in sequence WaitDepthUndulation = WaitDepUndulation36

      assign in sequence ShallowBoundSmear = ShallowBndSmear36

      assign in sequence DeepBoundSmear = DeepBndSmear36

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample37 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 37 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth37

      assign in sequence WaitDepthUndulation = WaitDepUndulation37

      assign in sequence ShallowBoundSmear = ShallowBndSmear37

      assign in sequence DeepBoundSmear = DeepBndSmear37

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample38 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 38 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth38

      assign in sequence WaitDepthUndulation = WaitDepUndulation38

      assign in sequence ShallowBoundSmear = ShallowBndSmear38

      assign in sequence DeepBoundSmear = DeepBndSmear38

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample39 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 39 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth39

      assign in sequence WaitDepthUndulation = WaitDepUndulation39

      assign in sequence ShallowBoundSmear = ShallowBndSmear39

      assign in sequence DeepBoundSmear = DeepBndSmear39

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample40 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 40 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth40

      assign in sequence WaitDepthUndulation = WaitDepUndulation40

      assign in sequence ShallowBoundSmear = ShallowBndSmear40

      assign in sequence DeepBoundSmear = DeepBndSmear40

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample41 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 41 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth41

      assign in sequence WaitDepthUndulation = WaitDepUndulation41

      assign in sequence ShallowBoundSmear = ShallowBndSmear41

      assign in sequence DeepBoundSmear = DeepBndSmear41

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample42 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 42 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth42

      assign in sequence WaitDepthUndulation = WaitDepUndulation42

      assign in sequence ShallowBoundSmear = ShallowBndSmear42

      assign in sequence DeepBoundSmear = DeepBndSmear42

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample43 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 43 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth43

      assign in sequence WaitDepthUndulation = WaitDepUndulation43

      assign in sequence ShallowBoundSmear = ShallowBndSmear43

      assign in sequence DeepBoundSmear = DeepBndSmear43

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample44 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 44 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth44

      assign in sequence WaitDepthUndulation = WaitDepUndulation44

      assign in sequence ShallowBoundSmear = ShallowBndSmear44

      assign in sequence DeepBoundSmear = DeepBndSmear44

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample45 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 45 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth45

      assign in sequence WaitDepthUndulation = WaitDepUndulation45

      assign in sequence ShallowBoundSmear = ShallowBndSmear45

      assign in sequence DeepBoundSmear = DeepBndSmear45

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample46 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 46 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth46

      assign in sequence WaitDepthUndulation = WaitDepUndulation46

      assign in sequence ShallowBoundSmear = ShallowBndSmear46

      assign in sequence DeepBoundSmear = DeepBndSmear46

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample47 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 47 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth47

      assign in sequence WaitDepthUndulation = WaitDepUndulation47

      assign in sequence ShallowBoundSmear = ShallowBndSmear47

      assign in sequence DeepBoundSmear = DeepBndSmear47

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample48 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 48 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth48

      assign in sequence WaitDepthUndulation = WaitDepUndulation48

      assign in sequence ShallowBoundSmear = ShallowBndSmear48

      assign in sequence DeepBoundSmear = DeepBndSmear48

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample49 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 49 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth49

      assign in sequence WaitDepthUndulation = WaitDepUndulation49

      assign in sequence ShallowBoundSmear = ShallowBndSmear49

      assign in sequence DeepBoundSmear = DeepBndSmear49

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample50 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 50 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth50

      assign in sequence WaitDepthUndulation = WaitDepUndulation50

      assign in sequence ShallowBoundSmear = ShallowBndSmear50

      assign in sequence DeepBoundSmear = DeepBndSmear50

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample51 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 51 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth51

      assign in sequence WaitDepthUndulation = WaitDepUndulation51

      assign in sequence ShallowBoundSmear = ShallowBndSmear51

      assign in sequence DeepBoundSmear = DeepBndSmear51

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample52 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 52 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth52

      assign in sequence WaitDepthUndulation = WaitDepUndulation52

      assign in sequence ShallowBoundSmear = ShallowBndSmear52

      assign in sequence DeepBoundSmear = DeepBndSmear52

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample53 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 53 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth53

      assign in sequence WaitDepthUndulation = WaitDepUndulation53

      assign in sequence ShallowBoundSmear = ShallowBndSmear53

      assign in sequence DeepBoundSmear = DeepBndSmear53

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample54 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 54 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth54

      assign in sequence WaitDepthUndulation = WaitDepUndulation54

      assign in sequence ShallowBoundSmear = ShallowBndSmear54

      assign in sequence DeepBoundSmear = DeepBndSmear54

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample55 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 55 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth55

      assign in sequence WaitDepthUndulation = WaitDepUndulation55

      assign in sequence ShallowBoundSmear = ShallowBndSmear55

      assign in sequence DeepBoundSmear = DeepBndSmear55

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample56 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 56 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth56

      assign in sequence WaitDepthUndulation = WaitDepUndulation56

      assign in sequence ShallowBoundSmear = ShallowBndSmear56

      assign in sequence DeepBoundSmear = DeepBndSmear56

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample57 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 57 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth57

      assign in sequence WaitDepthUndulation = WaitDepUndulation57

      assign in sequence ShallowBoundSmear = ShallowBndSmear57

      assign in sequence DeepBoundSmear = DeepBndSmear57

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample58 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 58 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth58

      assign in sequence WaitDepthUndulation = WaitDepUndulation58

      assign in sequence ShallowBoundSmear = ShallowBndSmear58

      assign in sequence DeepBoundSmear = DeepBndSmear58

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample59 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 59 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth59

      assign in sequence WaitDepthUndulation = WaitDepUndulation59

      assign in sequence ShallowBoundSmear = ShallowBndSmear59

      assign in sequence DeepBoundSmear = DeepBndSmear59

      assign in sequence SampleOptionsSet = true
    }

    aggregate SetOptionsOfSample60 {
      run when (
        not ( SampleOptionsSet )
        and ( CntSamples == 60 count )
        and ( CntSamples <= NumSamplers )
        and ( not ( FlagSamplingOngoing ) )
      )

      assign in sequence TargetedDepth = Depth60

      assign in sequence WaitDepthUndulation = WaitDepUndulation60

      assign in sequence ShallowBoundSmear = ShallowBndSmear60

      assign in sequence DeepBoundSmear = DeepBndSmear60

      assign in sequence SampleOptionsSet = true
    }

    aggregate SampleAtConstantDepth {
      run when (
        TransitCompleted
        and ( not ( isNaN ( TargetedDepth ) ) )
        and ( not ( FlagSamplingOngoing ) )
        and ( CntSamples <= NumSamplers )
        and SampleOptionsSet
        and ( not ( SampleCompleted ) )
      )

      syslog important "Taking sample No."
           + CntSamples ~ count
           + " at "
           + TargetedDepth ~ meter
           + "."

      assign in sequence FlagSamplingOngoing = true

      call id="TakeSampleAtTargetDepth" refId="SampleAtDepthWrapper"

      assign in sequence FlagSamplingOngoing = false

      assign in sequence SampleCompleted = true

      assign in sequence SampleOptionsSet = false
    }

    aggregate SmearSampling {
      run when (
        TransitCompleted
        and ( not ( isNaN ( ShallowBoundSmear ) ) )
        and ( not ( isNaN ( DeepBoundSmear ) ) )
        and ( not ( FlagSamplingOngoing ) )
        and ( CntSamples <= NumSamplers )
        and SampleOptionsSet
        and ( not ( SampleCompleted ) )
      )

      syslog important "Taking sample No."
           + CntSamples ~ count
           + " smeared between "
           + ShallowBoundSmear ~ meter
           + " and "
           + DeepBoundSmear ~ meter
           + "."

      assign in sequence EnableFiringSmear = true

      assign in sequence FlagSamplingOngoing = true

      assign in sequence FlagFired = true

      assign in sequence FromLastTimeFixToLastFiring = elapsed ( Universal:time_fix )

      # debug
      #            <Syslog Severity="Important">FromLastTimeFixToLastFiring = <Arg Name="FromLastTimeFixToLastFi ring"/><Units:minute/></Syslog>

      call id="TakeSmearSample" refId="SmearSamplingWrapper"

      assign in sequence FlagSamplingOngoing = false

      assign in sequence SampleCompleted = true

      assign in sequence SampleOptionsSet = false
    }

    aggregate IncrementSampleCounter {
      run when (
        SampleCompleted
      )

      assign in sequence CntSamples = CntSamples + 1 count

      assign in sequence SampleCompleted = false
    }
  }
}
   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
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by TethysL -->
<Mission xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="Tethys"
         xmlns:Units="Tethys/Units"
         xmlns:Control="Tethys/Control"
         xmlns:Science="Tethys/Science"
         xmlns:Guidance="Tethys/Guidance"
         xmlns:Universal="Tethys/Universal"
         xsi:schemaLocation="Tethys http://okeanids.mbari.org/tethys/Xml/Tethys.xsd
                             Tethys/Units http://okeanids.mbari.org/tethys/Xml/Units.xsd
                             Tethys/Control http://okeanids.mbari.org/tethys/Xml/Control.xsd
                             Tethys/Science http://okeanids.mbari.org/tethys/Xml/Science.xsd
                             Tethys/Guidance http://okeanids.mbari.org/tethys/Xml/Guidance.xsd
                             Tethys/Universal http://okeanids.mbari.org/tethys/Xml/Universal.xsd"
         Id="DepthSampling"
>

<!-- You probably need to change these. -->

    <DefineArg Name="NumSamplers"><Description>
        Total number of ESP or CANON samplers (Maximum 60 for ESP samplers. Set
        to a smaller number if not using all of them. Set to 0 to disable
        sampling).
    </Description><Units:count/><Value>1</Value></DefineArg>

    <DefineArg Name="MaxDepth"><Description>
        Maximum depth for the entire mission.
    </Description><Units:meter/><Value>30</Value></DefineArg>

    <DefineArg Name="MinAltitude"><Description>
        Minimum altitude for the entire mission.
    </Description><Units:meter/><Value>7</Value></DefineArg>

    <DefineArg Name="MinOffshore"><Description>
        Minimum offshore distance for the entire mission.
    </Description><Units:kilometer/><Value>2</Value></DefineArg>

    <DefineArg Name="MissionTimeout"><Description>
        Maximum duration of mission
    </Description><Units:hour/><Value>12</Value></DefineArg>

    <DefineArg Name="AcousticTrackingTimeout"><Description>
        If the vehicle does not receive an acoustic signal for more than this
        length of time, it will surface for communications. Set longer than
        MissionTimeout to effectively disable.
    </Description><Units:hour/><Value>21</Value></DefineArg>

    <DefineArg Name="MaxWaitNoFiring"><Description>
        If no firing after more than MaxWaitNoFiring, terminate mission.
    </Description><Units:hour/><Value>3</Value></DefineArg>

    <DefineArg Name="MaxWaitNotAchievingDepth"><Description>
        Maximum wait time the vehicle cannot reach the targeted depth.
    </Description><Units:hour/><Value>3</Value></DefineArg>

    <DefineArg Name="RunToWaypointTimeout"><Description>
        Maximum duration for trying to achieve spiral cast waypoint
    </Description><Units:hour/><Value>3</Value></DefineArg>

    <DefineArg Name="RunToWaypointNeedCommsTime"><Description>
        How often to surface for commumications when heading to waypoint
    </Description><Units:minute/><Value>30</Value></DefineArg>

    <DefineArg Name="InitialDiveDuration"><Description>
        On the first dive to the target depth, run at SpeedInitialDive for this
        duration (e.g., 1 m/s spiral to dive fast).
    </Description><Units:minute/><Value>5.0</Value></DefineArg>

    <DefineArg Name="SpeedTransit"><Description>
        Vehicle speed when transiting.
    </Description><Units:meter_per_second/><Value>1.0</Value></DefineArg>

    <DefineArg Name="SpeedInitialDive"><Description>
        Vehicle speed during initial dive. 0.0 for drift mode (prop off); 1.0
        for spiral mode (prop on). Initialized to 1 m/s.
    </Description><Units:meter_per_second/><Value>1.0</Value></DefineArg>

<!--debug
    </Description><Units:meter_per_second/><Value>0</Value></DefineArg>
-->

    <DefineArg Name="SpeedSampling"><Description>
        Vehicle speed during sampling: 0.0 for drift mode (prop off); 1.0 for
        donut mode (prop on). Initialized to 1 m/s.
    </Description><Units:meter_per_second/><Value>1.0</Value></DefineArg>

<!--debug
    </Description><Units:meter_per_second/><Value>0</Value></DefineArg>
-->

    <DefineArg Name="RudderAngleSpiralOrDonut"><Description>
        Rudder angle during spiral or donut.
    </Description><Units:degree/><Value>13</Value></DefineArg>

    <DefineArg Name="Latitude"><Description>
        Latitude of waypoint to seek. If set to NaN, uses latitude at mission
        initialization.
    </Description><Units:degree/><Value>NaN</Value></DefineArg>

<!--debug
    </Description><Units:degree/><Value>36.810</Value></DefineArg>
-->

    <DefineArg Name="Longitude"><Description>
        Longitude of waypoint to seek. If set to NaN, uses longitude at mission
        initialization.
    </Description><Units:degree/><Value>NaN</Value></DefineArg>

<!--debug
    </Description><Units:degree/><Value>-121.825</Value></DefineArg>
-->

    <DefineArg Name="Northings"><Description>
        Northward distance of the waypoint to seek. If combined with Latitude
        and/or Longitude, this is an offset from the specified Latitude and/or
        Longitude.
    </Description><Units:meter/><Value>0</Value></DefineArg>

    <DefineArg Name="Eastings"><Description>
        Eastward distance of the waypoint to seek. If combined with Latitude
        and/or Longitude, this is an offset from the specified Latitude and/or
        Longitude.
    </Description><Units:meter/><Value>0</Value></DefineArg>

    <DefineArg Name="DepthLevelFlight"><Description>
        Depth of level flight during the mission. If NaN, then yo-yo flight.
<!--debug
    </Description><Units:meter/><Value>10</Value></DefineArg>
-->
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="TransitYoYoMinDepth"><Description>
        Minimum depth while performing the YoYo behavior. Irrelevant if
        DepthLevelFlight is non-NaN (i.e., if level flight).
    </Description><Units:meter/><Value>5</Value></DefineArg>

    <DefineArg Name="TransitYoYoMaxDepth"><Description>
        Maximum depth while performing the YoYo behavior. Irrelevant if
        DepthLevelFlight is non-NaN (i.e., if level flight). flight.
    </Description><Units:meter/><Value>20</Value></DefineArg>

    <DefineArg Name="Depth1"><Description>
        Depth of sample 1. If NaN, then smear sampling.
<!--debug
    </Description><Units:meter/><Value>10</Value></DefineArg>
-->
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth2"><Description>
        Depth of sample 2.
<!--debug
    </Description><Units:meter/><Value>20</Value></DefineArg>
-->
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth3"><Description>
        Depth of sample 3.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth4"><Description>
        Depth of sample 4.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth5"><Description>
        Depth of sample 5.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth6"><Description>
        Depth of sample 6.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth7"><Description>
        Depth of sample 7.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth8"><Description>
        Depth of sample 8.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth9"><Description>
        Depth of sample 9.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth10"><Description>
        Depth of sample 10.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth11"><Description>
        Depth of sample 11.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth12"><Description>
        Depth of sample 12.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth13"><Description>
        Depth of sample 13.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth14"><Description>
        Depth of sample 14.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth15"><Description>
        Depth of sample 15.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth16"><Description>
        Depth of sample 16.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth17"><Description>
        Depth of sample 17.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth18"><Description>
        Depth of sample 18.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth19"><Description>
        Depth of sample 19.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth20"><Description>
        Depth of sample 20.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth21"><Description>
        Depth of sample 21.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth22"><Description>
        Depth of sample 22.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth23"><Description>
        Depth of sample 23.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth24"><Description>
        Depth of sample 24.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth25"><Description>
        Depth of sample 25.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth26"><Description>
        Depth of sample 26.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth27"><Description>
        Depth of sample 27.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth28"><Description>
        Depth of sample 28.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth29"><Description>
        Depth of sample 29.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth30"><Description>
        Depth of sample 30.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth31"><Description>
        Depth of sample 31.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth32"><Description>
        Depth of sample 32.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth33"><Description>
        Depth of sample 33.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth34"><Description>
        Depth of sample 34.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth35"><Description>
        Depth of sample 35.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth36"><Description>
        Depth of sample 36.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth37"><Description>
        Depth of sample 37.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth38"><Description>
        Depth of sample 38.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth39"><Description>
        Depth of sample 39.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth40"><Description>
        Depth of sample 40.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth41"><Description>
        Depth of sample 41.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth42"><Description>
        Depth of sample 42.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth43"><Description>
        Depth of sample 43.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth44"><Description>
        Depth of sample 44.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth45"><Description>
        Depth of sample 45.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth46"><Description>
        Depth of sample 46.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth47"><Description>
        Depth of sample 47.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth48"><Description>
        Depth of sample 48.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth49"><Description>
        Depth of sample 49.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth50"><Description>
        Depth of sample 50.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth51"><Description>
        Depth of sample 51.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth52"><Description>
        Depth of sample 52.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth53"><Description>
        Depth of sample 53.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth54"><Description>
        Depth of sample 54.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth55"><Description>
        Depth of sample 55.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth56"><Description>
        Depth of sample 56.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth57"><Description>
        Depth of sample 57.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth58"><Description>
        Depth of sample 58.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth59"><Description>
        Depth of sample 59.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="Depth60"><Description>
        Depth of sample 60.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation1"><Description>
        Sample 1. Wait duration for the depth undulation to damp down.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation2"><Description>
        Sample 2.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation3"><Description>
        Sample 3.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation4"><Description>
        Sample 4.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation5"><Description>
        Sample 5.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation6"><Description>
        Sample 6.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation7"><Description>
        Sample 7.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation8"><Description>
        Sample 8.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation9"><Description>
        Sample 9.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation10"><Description>
        Sample 10.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation11"><Description>
        Sample 11.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation12"><Description>
        Sample 12.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation13"><Description>
        Sample 13.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation14"><Description>
        Sample 14.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation15"><Description>
        Sample 15.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation16"><Description>
        Sample 16.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation17"><Description>
        Sample 17.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation18"><Description>
        Sample 18.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation19"><Description>
        Sample 19.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation20"><Description>
        Sample 20.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation21"><Description>
        Sample 21.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation22"><Description>
        Sample 22.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation23"><Description>
        Sample 23.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation24"><Description>
        Sample 24.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation25"><Description>
        Sample 25.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation26"><Description>
        Sample 26.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation27"><Description>
        Sample 27.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation28"><Description>
        Sample 28.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation29"><Description>
        Sample 29.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation30"><Description>
        Sample 30.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation31"><Description>
        Sample 31.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation32"><Description>
        Sample 32.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation33"><Description>
        Sample 33.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation34"><Description>
        Sample 34.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation35"><Description>
        Sample 35.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation36"><Description>
        Sample 36.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation37"><Description>
        Sample 37.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation38"><Description>
        Sample 38.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation39"><Description>
        Sample 39.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation40"><Description>
        Sample 40.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation41"><Description>
        Sample 41.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation42"><Description>
        Sample 42.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation43"><Description>
        Sample 43.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation44"><Description>
        Sample 44.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation45"><Description>
        Sample 45.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation46"><Description>
        Sample 46.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation47"><Description>
        Sample 47.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation48"><Description>
        Sample 48.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation49"><Description>
        Sample 49.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation50"><Description>
        Sample 50.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation51"><Description>
        Sample 51.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation52"><Description>
        Sample 52.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation53"><Description>
        Sample 53.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation54"><Description>
        Sample 54.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation55"><Description>
        Sample 55.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation56"><Description>
        Sample 56.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation57"><Description>
        Sample 57.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation58"><Description>
        Sample 58.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation59"><Description>
        Sample 59.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="WaitDepUndulation60"><Description>
        Sample 60.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear1"><Description>
        Shallow depth bound for smear sampling.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear1"><Description>
        Deep depth bound for smear sampling.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear2"><Description>
        Sample 2.
<!--debug
    </Description><Units:meter/><Value>17</Value></DefineArg>
-->
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear2"><Description>
        Sample 2.
<!--debug
    </Description><Units:meter/><Value>20</Value></DefineArg>
-->
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear3"><Description>
        Sample 3.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear3"><Description>
        Sample 3.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear4"><Description>
        Sample 4.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear4"><Description>
        Sample 4.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear5"><Description>
        Sample 5.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear5"><Description>
        Sample 5.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear6"><Description>
        Sample 6.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear6"><Description>
        Sample 6.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear7"><Description>
        Sample 7.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear7"><Description>
        Sample 7.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear8"><Description>
        Sample 8.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear8"><Description>
        Sample 8.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear9"><Description>
        Sample 9.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear9"><Description>
        Sample 9.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear10"><Description>
        Sample 10.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear10"><Description>
        Sample 10.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear11"><Description>
        Sample 11.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear11"><Description>
        Sample 11.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear12"><Description>
        Sample 12.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear12"><Description>
        Sample 12.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear13"><Description>
        Sample 13.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear13"><Description>
        Sample 13.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear14"><Description>
        Sample 14.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear14"><Description>
        Sample 14.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear15"><Description>
        Sample 15.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear15"><Description>
        Sample 15.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear16"><Description>
        Sample 16.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear16"><Description>
        Sample 16.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear17"><Description>
        Sample 17.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear17"><Description>
        Sample 17.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear18"><Description>
        Sample 18.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear18"><Description>
        Sample 18.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear19"><Description>
        Sample 19.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear19"><Description>
        Sample 19.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear20"><Description>
        Sample 20.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear20"><Description>
        Sample 20.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear21"><Description>
        Sample 21.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear21"><Description>
        Sample 21.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear22"><Description>
        Sample 22.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear22"><Description>
        Sample 22.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear23"><Description>
        Sample 23.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear23"><Description>
        Sample 23.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear24"><Description>
        Sample 24.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear24"><Description>
        Sample 24.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear25"><Description>
        Sample 25.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear25"><Description>
        Sample 25.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear26"><Description>
        Sample 26.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear26"><Description>
        Sample 26.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear27"><Description>
        Sample 27.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear27"><Description>
        Sample 27.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear28"><Description>
        Sample 28.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear28"><Description>
        Sample 28.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear29"><Description>
        Sample 29.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear29"><Description>
        Sample 29.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear30"><Description>
        Sample 30.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear30"><Description>
        Sample 30.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear31"><Description>
        Sample 31.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear31"><Description>
        Sample 31.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear32"><Description>
        Sample 32.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear32"><Description>
        Sample 32.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear33"><Description>
        Sample 33.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear33"><Description>
        Sample 33.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear34"><Description>
        Sample 34.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear34"><Description>
        Sample 34.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear35"><Description>
        Sample 35.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear35"><Description>
        Sample 35.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear36"><Description>
        Sample 36.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear36"><Description>
        Sample 36.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear37"><Description>
        Sample 37.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear37"><Description>
        Sample 37.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear38"><Description>
        Sample 38.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear38"><Description>
        Sample 38.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear39"><Description>
        Sample 39.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear39"><Description>
        Sample 39.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear40"><Description>
        Sample 40.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear40"><Description>
        Sample 40.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear41"><Description>
        Sample 41.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear41"><Description>
        Sample 41.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear42"><Description>
        Sample 42.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear42"><Description>
        Sample 42.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear43"><Description>
        Sample 43.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear43"><Description>
        Sample 43.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear44"><Description>
        Sample 44.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear44"><Description>
        Sample 44.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear45"><Description>
        Sample 45.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear45"><Description>
        Sample 45.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear46"><Description>
        Sample 46.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear46"><Description>
        Sample 46.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear47"><Description>
        Sample 47.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear47"><Description>
        Sample 47.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear48"><Description>
        Sample 48.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear48"><Description>
        Sample 48.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear49"><Description>
        Sample 49.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear49"><Description>
        Sample 49.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear50"><Description>
        Sample 50.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear50"><Description>
        Sample 50.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear51"><Description>
        Sample 51.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear51"><Description>
        Sample 51.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear52"><Description>
        Sample 52.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear52"><Description>
        Sample 52.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear53"><Description>
        Sample 53.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear53"><Description>
        Sample 53.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear54"><Description>
        Sample 54.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear54"><Description>
        Sample 54.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear55"><Description>
        Sample 55.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear55"><Description>
        Sample 55.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear56"><Description>
        Sample 56.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear56"><Description>
        Sample 56.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear57"><Description>
        Sample 57.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear57"><Description>
        Sample 57.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear58"><Description>
        Sample 58.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear58"><Description>
        Sample 58.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear59"><Description>
        Sample 59.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear59"><Description>
        Sample 59.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="ShallowBndSmear60"><Description>
        Sample 60.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBndSmear60"><Description>
        Sample 60.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

<!-- Use caution when changing these. -->

    <DefineArg Name="UpRate"><Description>
        Go-up depth rate in smear sampling mode (negative depth rate means going
        up).
    </Description><Units:meter_per_second/><Value>-0.1</Value></DefineArg>

    <DefineArg Name="DownRate"><Description>
        Go-down depth rate in smear sampling mode (positive depth rate means
        going down).
    </Description><Units:meter_per_second/><Value>0.1</Value></DefineArg>

<!-- You probably do not need to change these. -->

    <DefineArg Name="TransitYoYoUpPitch"><Description>
        Vehicle up pitch while performing the YoYo behavior.
    </Description><Units:degree/><Value>20</Value></DefineArg>

    <DefineArg Name="TransitYoYoDownPitch"><Description>
        Vehicle down pitch while performing the YoYo behavior.
    </Description><Units:degree/><Value>-20</Value></DefineArg>

    <DefineArg Name="BuoyancyNeutral"><Description>
        Buoyancy bladder position while performing the YoYo behavior. Defaults
        to buoyancyNeutral setting in the Config/Control.cfg file. Set to NaN cc
        for active buoyancy
    </Description><Control:VerticalControl.buoyancyNeutral/></DefineArg>

    <DefineArg Name="MassDefault"><Description>
        Static setting for mass during the mission. Set to NaN mm for active
        mass position
    </Description><Control:VerticalControl.massDefault/></DefineArg>

<!-- Internal variables that you should not change -->

    <DefineArg Name="SpeedApproachThenSample"><Description>
        Vehicle speed when approaching the target isotherm or depth and then
        sampling. Initialized to 1 m/s.
    </Description><Units:meter_per_second/><Value>1.0</Value></DefineArg>

    <DefineArg Name="DepthLogged"><Description></Description><Units:meter/><Value>0.0</Value></DefineArg>

    <DefineArg Name="TempLogged"><Description></Description><Units:celsius/><Value>0.0</Value></DefineArg>

    <DefineArg Name="ChlLogged"><Description></Description><Units:microgram_per_liter/><Value>0.0</Value></DefineArg>

    <DefineArg Name="TransitCompleted"><Description>
        Transit is completed (initialized to false).
    </Description><False/></DefineArg>

    <DefineArg Name="TargetedDepth"><Description>
        Depth if pre-designated. Initialized to NaN.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="WaitDepthUndulation"><Description>
        Wait duration for the depth undulation to damp down. Initialized to 10
        minutes.
    </Description><Units:minute/><Value>10.0</Value></DefineArg>

    <DefineArg Name="ShallowBoundSmear"><Description>
        Shallow depth bound for smear sampling.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="DeepBoundSmear"><Description>
        Deep depth bound for smear sampling.
    </Description><Units:meter/><Value>NaN</Value></DefineArg>

    <DefineArg Name="SampleOptionsSet"><Description>
        Sample options (VertDistance, ReportAtSurface, ReacquirePeak) already
        set. Initialized to false.
    </Description><False/></DefineArg>

    <DefineArg Name="SampleCompleted"><Description>
        Sampling completed. Initialized to false.
    </Description><False/></DefineArg>

    <DefineArg Name="StoppedForNoFiringForTooLong"><Description>
        Mission stopped because of no firing for too long. Initialized to false.
    </Description><False/></DefineArg>

    <DefineArg Name="FlagSamplingOngoing"><Description>
        Flag of water sampling in process (initialized to false).
    </Description><False/></DefineArg>

    <DefineArg Name="FlagFired"><Description>
        Flag of sample fired (initialized to false).
    </Description><False/></DefineArg>

    <DefineArg Name="FlagGoUp"><Description>
        Go-up flag (set to true when going up. Initialized to false).
    </Description><False/></DefineArg>

    <DefineArg Name="FlagGoDown"><Description>
        Go-down flag (set to true when going down. Initialized to false).
    </Description><False/></DefineArg>

    <DefineArg Name="FlagInitialDiveSpeedSet"><Description>
        Flag of initial dive speed set. Initialized to false.
    </Description><False/></DefineArg>

    <DefineArg Name="EnableFiringSmear"><Description>
        Enable firing. Initialized to true.
    </Description><True/></DefineArg>

    <DefineArg Name="FromLastTimeFixToStartDive"><Description>
        Elapsed time from last time-fix to StartDive.
    </Description><Units:minute/><Value>NaN</Value></DefineArg>

    <DefineArg Name="FromLastTimeFixToNow"><Description>
        Elapsed time from last time-fix to now.
    </Description><Units:minute/><Value>NaN</Value></DefineArg>

    <DefineArg Name="FromLastTimeFixToLastFiring"><Description>
        Elapsed time from last time-fix to last firing.
    </Description><Units:minute/><Value>NaN</Value></DefineArg>

    <DefineArg Name="CntSamples"><Description>
        Count of water samples (initilized to 1).
    </Description><Units:count/><Value>1</Value></DefineArg>

<!-- Missions should almost always start with a timeout and a NeedComms aggregate. Drift missions will not use NeedComms. -->

    <Timeout Duration="MissionTimeout"/>

    <Insert Filename="Insert/AbortDrift.tl">
        <RedefineArg Name="AcousticTimeout"><Arg Name="AcousticTrackingTimeout"/></RedefineArg>
    </Insert>

    <Insert Filename="Insert/Science.tl">
        <RedefineArg Name="PeakDetectChlActive"><True/></RedefineArg>
    </Insert>

    <Insert Filename="Insert/StandardEnvelopes.tl"/>

    <Assign><Sequence/><Arg Name="StandardEnvelopes:MinAltitude"/><Arg Name="MinAltitude"/></Assign>

    <Assign><Sequence/><Arg Name="StandardEnvelopes:MaxDepth"/><Arg Name="MaxDepth"/></Assign>

    <Assign><Sequence/><Arg Name="StandardEnvelopes:MinOffshore"/><Arg Name="MinOffshore"/></Assign>

    <Guidance:Pitch>
        <Parallel/>
        <Setting><Guidance:Pitch.massPosition/><Arg Name="MassDefault"/></Setting>
    </Guidance:Pitch>

    <Insert Filename="Insert/SampleAtDepth.tl">
        <RedefineArg Name="MaxWaitNotReachingDepth"><Arg Name="MaxWaitNotAchievingDepth"/></RedefineArg>
    </Insert>

    <Insert Filename="Insert/NeedComms.tl" Id="NeedComms"/>

    <Call Id="StartingMission" RefId="NeedComms"/>

    <Aggregate Id="ESPSampling">

        <When>
            <Called/>
        </When>

        <Aggregate Id="TriggerESP">

            <Sequence/>

            <Assign><Sequence/><Arg Name="DepthLogged"/><Universal:depth/></Assign>

            <Assign><Sequence/><Arg Name="TempLogged"/><Universal:sea_water_temperature/></Assign>

            <Assign><Sequence/><Arg Name="ChlLogged"/><Universal:mass_concentration_of_chlorophyll_in_sea_water/></Assign>

            <Syslog Severity="Important">Trigger ESP sampling. DepthLogged, TempLogged, ChlLogged = <Arg Name="DepthLogged"/><Units:meter/>, <Arg Name="TempLogged"/><Units:celsius/>, <Arg Name="ChlLogged"/><Units:microgram_per_liter/>.</Syslog>

            <ReadDatum>
                <Science:ESPComponent.sampling/>
            </ReadDatum>

            <Syslog Severity="Important">Wait for ESP sampling to complete.</Syslog>

            <ReadDatum>
                <Science:ESPComponent.sample_number/>
            </ReadDatum>

        </Aggregate>

    </Aggregate>

    <Aggregate Id="SampleAtDepthWrapper">

        <When>
            <Called/>
        </When>

        <Break><Arg Name="TargetedDepth"/>
            <Ge><Arg Name="MaxDepth"/></Ge>
        </Break>

        <Assign><Sequence/><Arg Name="SampleAtDepth:TargetDepth"/><Arg Name="TargetedDepth"/></Assign>

        <Assign><Sequence/><Arg Name="SampleAtDepth:SettleTime"/><Arg Name="WaitDepthUndulation"/></Assign>

        <Call Id="SampleAtTargetDepth" RefId="SampleAtDepth"/>

        <Syslog Severity="Important">ESP sample No.<Arg Name="CntSamples"/><Units:count/> completed.</Syslog>

    </Aggregate>

    <Aggregate Id="SmearSamplingWrapper">

        <When>
            <Called/>
        </When>

        <Break>
            <Not><Arg Name="EnableFiringSmear"/></Not>
        </Break>

        <Aggregate Id="GoDownGoUpFire">

            <Sequence/>

            <Aggregate Id="GoDownInSpiralMode">

                <While>
                    <Arg Name="EnableFiringSmear"/>
                    <And><Arg Name="FlagGoDown"/></And>
                </While>

                <Guidance:Pitch>
                    <Parallel/>
                    <Setting><Guidance:Pitch.depthRate/><Arg Name="DownRate"/></Setting>
                </Guidance:Pitch>

            </Aggregate>

            <Aggregate Id="GoUpInSpiralMode">

                <While>
                    <Arg Name="EnableFiringSmear"/>
                    <And><Arg Name="FlagGoUp"/></And>
                </While>

                <Guidance:Pitch>
                    <Parallel/>
                    <Setting><Guidance:Pitch.depthRate/><Arg Name="UpRate"/></Setting>
                </Guidance:Pitch>

            </Aggregate>

            <Aggregate Id="ResetFlagGoDownSetFlagGoUp">

                <When>
                    <Arg Name="EnableFiringSmear"/>
                    <And><Universal:depth/><Ge><Arg Name="DeepBoundSmear"/></Ge></And>
                    <And><Not><Arg Name="FlagGoUp"/></Not></And>
                </When>

                <Assign><Sequence/><Arg Name="FlagGoDown"/><False/></Assign>

                <Assign><Sequence/><Arg Name="FlagGoUp"/><True/></Assign>

                <Syslog Severity="Important">Bounce up from <Universal:depth/><Units:meter/>.</Syslog>

            </Aggregate>

            <Aggregate Id="ResetFlagGoUpSetFlagGoDown">

                <When>
                    <Arg Name="EnableFiringSmear"/>
                    <And><Universal:depth/><Le><Arg Name="ShallowBoundSmear"/></Le></And>
                    <And><Not><Arg Name="FlagGoDown"/></Not></And>
                </When>

                <Assign><Sequence/><Arg Name="FlagGoUp"/><False/></Assign>

                <Assign><Sequence/><Arg Name="FlagGoDown"/><True/></Assign>

                <Syslog Severity="Important">Bounce down from <Universal:depth/><Units:meter/>.</Syslog>

            </Aggregate>

            <Aggregate Id="Firing">

                <When>
                    <Arg Name="EnableFiringSmear"/>
                    <And><Arg Name="FlagGoDown"/></And>
                    <And><Universal:depth/><Ge><Arg Name="ShallowBoundSmear"/></Ge></And>
                    <Or><Arg Name="EnableFiringSmear"/><And><Arg Name="FlagGoUp"/></And><And><Universal:depth/><Le><Arg Name="DeepBoundSmear"/></Le></And></Or>
                </When>

                <Call Id="Sampling" RefId="ESPSampling"/>

                <Syslog Severity="Important"> ESP sample No.<Arg Name="CntSamples"/><Units:count/> completed.</Syslog>

                <Assign><Sequence/><Arg Name="EnableFiringSmear"/><False/></Assign>

            </Aggregate>

        </Aggregate>

    </Aggregate>

    <Aggregate Id="Transit">

        <Sequence/>

        <Timeout Duration="RunToWaypointTimeout">
            <Syslog Severity="Important">Timed out trying to reach the waypoint. Stopping mission.</Syslog>
            <Guidance:Execute>
                <Sequence/>
                <Setting><Guidance:Execute.command/><String>stop</String></Setting>
            </Guidance:Execute>
        </Timeout>

        <Assign><Sequence/><Arg Name="NeedComms:DiveInterval"/><Arg Name="RunToWaypointNeedCommsTime"/></Assign>

        <Assign><Sequence/><Arg Name="NeedComms:SurfaceSpeed"/><Arg Name="SpeedTransit"/></Assign>

        <Guidance:SetSpeed>
            <Parallel/>
            <Setting><Guidance:SetSpeed.speed/><Arg Name="SpeedTransit"/></Setting>
        </Guidance:SetSpeed>

        <Guidance:Buoyancy>
            <Parallel/>
            <Setting><Guidance:Buoyancy.position/><Arg Name="BuoyancyNeutral"/></Setting>
        </Guidance:Buoyancy>

        <Aggregate Id="YoyoToWaypoint">

            <Sequence/>

            <Break>
                <Not><IsNaN><Arg Name="DepthLevelFlight"/>
                </IsNaN></Not>
            </Break>

            <Guidance:DepthEnvelope>
                <Parallel/>
                <Setting><Guidance:DepthEnvelope.minDepth/><Arg Name="TransitYoYoMinDepth"/></Setting>
                <Setting><Guidance:DepthEnvelope.maxDepth/><Arg Name="TransitYoYoMaxDepth"/></Setting>
                <Setting><Guidance:DepthEnvelope.downPitch/><Arg Name="TransitYoYoDownPitch"/></Setting>
                <Setting><Guidance:DepthEnvelope.upPitch/><Arg Name="TransitYoYoUpPitch"/></Setting>
            </Guidance:DepthEnvelope>

            <Guidance:YoYo>
                <Parallel/>
                <Setting><Guidance:YoYo.downPitch/><Arg Name="TransitYoYoDownPitch"/></Setting>
                <Setting><Guidance:YoYo.upPitch/><Arg Name="TransitYoYoUpPitch"/></Setting>
            </Guidance:YoYo>

            <Guidance:Waypoint>
                <Sequence/>
                <Setting><Guidance:Waypoint.latitude/><Arg Name="Latitude"/></Setting>
                <Setting><Guidance:Waypoint.longitude/><Arg Name="Longitude"/></Setting>
                <Setting><Guidance:Waypoint.northingsDelta/><Arg Name="Northings"/></Setting>
                <Setting><Guidance:Waypoint.eastingsDelta/><Arg Name="Eastings"/></Setting>
            </Guidance:Waypoint>

        </Aggregate>

        <Aggregate Id="LevelFlightToWaypoint">

            <Sequence/>

            <Break>
                <IsNaN><Arg Name="DepthLevelFlight"/>
                </IsNaN>
            </Break>

            <Guidance:Pitch>
                <Parallel/>
                <Setting><Guidance:Pitch.depth/><Arg Name="DepthLevelFlight"/></Setting>
            </Guidance:Pitch>

            <Guidance:Waypoint>
                <Sequence/>
                <Setting><Guidance:Waypoint.latitude/><Arg Name="Latitude"/></Setting>
                <Setting><Guidance:Waypoint.longitude/><Arg Name="Longitude"/></Setting>
                <Setting><Guidance:Waypoint.northingsDelta/><Arg Name="Northings"/></Setting>
                <Setting><Guidance:Waypoint.eastingsDelta/><Arg Name="Eastings"/></Setting>
            </Guidance:Waypoint>

        </Aggregate>

        <Call Id="DoneTransit" RefId="NeedComms"/>

        <Assign><Sequence/><Arg Name="TransitCompleted"/><True/></Assign>

        <Assign><Sequence/><Arg Name="FlagGoDown"/><True/></Assign>

        <Syslog Severity="Important">Transit and NeedComms completed. Go down from <Universal:depth/><Units:meter/>.</Syslog>

        <Assign><Sequence/><Arg Name="FromLastTimeFixToStartDive"/><Elapsed><Universal:time_fix/></Elapsed></Assign>

<!--debug
    <Syslog Severity="Important">FromLastTimeFixToStartDive = <Arg Name="FromLastTimeFixToStartDive"/><Units:minute/></Syslog>
-->

        <Assign><Sequence/><Arg Name="SpeedApproachThenSample"/><Arg Name="SpeedInitialDive"/></Assign>

    </Aggregate>

    <Assign><Sequence/><Arg Name="NeedComms:DiveInterval"/><Arg Name="MissionTimeout"/></Assign>

    <Aggregate Id="TakeSamples">

        <Sequence/>

        <Break>
            <Not><Arg Name="TransitCompleted"/></Not>
            <Or><Arg Name="CntSamples"/><Eq><Arg Name="NumSamplers"/> <Add><Units:count/> <Value>1</Value></Add></Eq></Or>
        </Break>

        <Aggregate Id="SetSpeedInitialDive">

            <Sequence/>

            <When>
                <Arg Name="CntSamples"/>
                <Eq><Units:count/><Value>1</Value></Eq>
                <And><Not><Arg Name="FlagInitialDiveSpeedSet"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="SpeedApproachThenSample"/><Arg Name="SpeedInitialDive"/></Assign>

            <Guidance:Wait>
                <Sequence/>
                <Setting><Guidance:Wait.duration/><Arg Name="InitialDiveDuration"/></Setting>
            </Guidance:Wait>

            <Assign><Sequence/><Arg Name="SpeedApproachThenSample"/><Arg Name="SpeedSampling"/></Assign>

            <Assign><Sequence/><Arg Name="FlagInitialDiveSpeedSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetNeutralBuoyancyNonZeroRudderInSpiralOrDonutMode">

            <Parallel/>

            <While>
                <Arg Name="SpeedApproachThenSample"/>
                <Gt><Units:meter_per_second/><Value>0.0</Value></Gt>
            </While>

            <Guidance:SetSpeed>
                <Parallel/>
                <Setting><Guidance:SetSpeed.speed/><Arg Name="SpeedApproachThenSample"/></Setting>
            </Guidance:SetSpeed>

            <Guidance:Buoyancy>
                <Parallel/>
                <Setting><Guidance:Buoyancy.position/><Arg Name="BuoyancyNeutral"/></Setting>
            </Guidance:Buoyancy>

            <Guidance:Point>
                <Parallel/>
                <Setting><Guidance:Point.rudderAngle/><Arg Name="RudderAngleSpiralOrDonut"/></Setting>
            </Guidance:Point>

        </Aggregate>

        <Aggregate Id="SetZeroRudderInDriftMode">

            <Parallel/>

            <While>
                <Not><Arg Name="SpeedApproachThenSample"/><Gt><Units:meter_per_second/><Value>0.0</Value></Gt></Not>
            </While>

            <Guidance:SetSpeed>
                <Parallel/>
                <Setting><Guidance:SetSpeed.speed/><Arg Name="SpeedApproachThenSample"/></Setting>
            </Guidance:SetSpeed>

            <Guidance:Point>
                <Parallel/>
                <Setting><Guidance:Point.rudderAngle/><Units:degree/><Value>0.0</Value></Setting>
            </Guidance:Point>

        </Aggregate>

        <Aggregate Id="NoFiringForTooLong">

            <When>
                <Elapsed><Universal:time_fix/></Elapsed>
                <Gt><Arg Name="FromLastTimeFixToStartDive"/><Add><Arg Name="MaxWaitNoFiring"/></Add></Gt>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>1</Value></Eq></And>
                <And><Not><Arg Name="FlagFired"/></Not></And>
                <And><Not><Arg Name="StoppedForNoFiringForTooLong"/></Not></And>
                <Or><Elapsed><Universal:time_fix/></Elapsed><Gt><Arg Name="FromLastTimeFixToLastFiring"/><Add><Arg Name="MaxWaitNoFiring"/></Add></Gt><And><Not><Arg Name="FlagSamplingOngoing"/></Not></And><And><Arg Name="CntSamples"/><Ge><Units:count/><Value>2</Value></Ge></And><And><Not><Arg Name="StoppedForNoFiringForTooLong"/></Not></And></Or>
            </When>

            <Assign><Sequence/><Arg Name="FromLastTimeFixToNow"/><Elapsed><Universal:time_fix/></Elapsed></Assign>

            <Syslog Severity="Important">No firing for too long. Stopping mission. FromLastTimeFixToNow, FromLastTimeFixToLastFiring = <Arg Name="FromLastTimeFixToNow"/><Units:minute/>, <Arg Name="FromLastTimeFixToLastFiring"/><Units:minute/></Syslog>

            <Guidance:Execute>
                <Sequence/>
                <Setting><Guidance:Execute.command/><String>stop</String></Setting>
            </Guidance:Execute>

            <Assign><Sequence/><Arg Name="StoppedForNoFiringForTooLong"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample1">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>1</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth1"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation1"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear1"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear1"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample2">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>2</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth2"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation2"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear2"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear2"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample3">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>3</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth3"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation3"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear3"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear3"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample4">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>4</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth4"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation4"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear4"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear4"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample5">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>5</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth5"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation5"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear5"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear5"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample6">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>6</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth6"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation6"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear6"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear6"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample7">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>7</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth7"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation7"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear7"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear7"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample8">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>8</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth8"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation8"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear8"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear8"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample9">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>9</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth9"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation9"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear9"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear9"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample10">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>10</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth10"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation10"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear10"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear10"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample11">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>11</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth11"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation11"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear11"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear11"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample12">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>12</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth12"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation12"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear12"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear12"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample13">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>13</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth13"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation13"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear13"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear13"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample14">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>14</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth14"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation14"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear14"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear14"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample15">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>15</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth15"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation15"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear15"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear15"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample16">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>16</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth16"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation16"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear16"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear16"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample17">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>17</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth17"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation17"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear17"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear17"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample18">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>18</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth18"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation18"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear18"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear18"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample19">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>19</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth19"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation19"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear19"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear19"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample20">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>20</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth20"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation20"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear20"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear20"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample21">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>21</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth21"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation21"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear21"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear21"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample22">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>22</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth22"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation22"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear22"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear22"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample23">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>23</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth23"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation23"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear23"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear23"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample24">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>24</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth24"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation24"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear24"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear24"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample25">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>25</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth25"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation25"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear25"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear25"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample26">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>26</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth26"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation26"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear26"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear26"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample27">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>27</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth27"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation27"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear27"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear27"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample28">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>28</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth28"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation28"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear28"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear28"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample29">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>29</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth29"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation29"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear29"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear29"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample30">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>30</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth30"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation30"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear30"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear30"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample31">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>31</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth31"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation31"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear31"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear31"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample32">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>32</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth32"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation32"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear32"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear32"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample33">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>33</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth33"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation33"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear33"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear33"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample34">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>34</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth34"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation34"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear34"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear34"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample35">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>35</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth35"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation35"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear35"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear35"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample36">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>36</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth36"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation36"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear36"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear36"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample37">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>37</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth37"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation37"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear37"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear37"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample38">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>38</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth38"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation38"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear38"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear38"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample39">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>39</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth39"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation39"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear39"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear39"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample40">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>40</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth40"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation40"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear40"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear40"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample41">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>41</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth41"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation41"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear41"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear41"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample42">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>42</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth42"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation42"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear42"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear42"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample43">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>43</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth43"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation43"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear43"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear43"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample44">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>44</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth44"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation44"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear44"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear44"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample45">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>45</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth45"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation45"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear45"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear45"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample46">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>46</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth46"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation46"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear46"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear46"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample47">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>47</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth47"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation47"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear47"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear47"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample48">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>48</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth48"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation48"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear48"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear48"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample49">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>49</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth49"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation49"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear49"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear49"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample50">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>50</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth50"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation50"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear50"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear50"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample51">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>51</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth51"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation51"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear51"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear51"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample52">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>52</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth52"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation52"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear52"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear52"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample53">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>53</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth53"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation53"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear53"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear53"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample54">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>54</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth54"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation54"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear54"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear54"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample55">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>55</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth55"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation55"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear55"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear55"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample56">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>56</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth56"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation56"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear56"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear56"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample57">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>57</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth57"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation57"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear57"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear57"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample58">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>58</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth58"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation58"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear58"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear58"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample59">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>59</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth59"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation59"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear59"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear59"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SetOptionsOfSample60">

            <When>
                <Not><Arg Name="SampleOptionsSet"/></Not>
                <And><Arg Name="CntSamples"/><Eq><Units:count/><Value>60</Value></Eq></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
            </When>

            <Assign><Sequence/><Arg Name="TargetedDepth"/><Arg Name="Depth60"/></Assign>

            <Assign><Sequence/><Arg Name="WaitDepthUndulation"/><Arg Name="WaitDepUndulation60"/></Assign>

            <Assign><Sequence/><Arg Name="ShallowBoundSmear"/><Arg Name="ShallowBndSmear60"/></Assign>

            <Assign><Sequence/><Arg Name="DeepBoundSmear"/><Arg Name="DeepBndSmear60"/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><True/></Assign>

        </Aggregate>

        <Aggregate Id="SampleAtConstantDepth">

            <When>
                <Arg Name="TransitCompleted"/>
                <And><Not><IsNaN><Arg Name="TargetedDepth"/>
                </IsNaN></Not></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Arg Name="SampleOptionsSet"/></And>
                <And><Not><Arg Name="SampleCompleted"/></Not></And>
            </When>

            <Syslog Severity="Important">Taking sample No.<Arg Name="CntSamples"/><Units:count/> at <Arg Name="TargetedDepth"/><Units:meter/>.</Syslog>

            <Assign><Sequence/><Arg Name="FlagSamplingOngoing"/><True/></Assign>

            <Call Id="TakeSampleAtTargetDepth" RefId="SampleAtDepthWrapper"/>

            <Assign><Sequence/><Arg Name="FlagSamplingOngoing"/><False/></Assign>

            <Assign><Sequence/><Arg Name="SampleCompleted"/><True/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><False/></Assign>

        </Aggregate>

        <Aggregate Id="SmearSampling">

            <When>
                <Arg Name="TransitCompleted"/>
                <And><Not><IsNaN><Arg Name="ShallowBoundSmear"/>
                </IsNaN></Not></And>
                <And><Not><IsNaN><Arg Name="DeepBoundSmear"/>
                </IsNaN></Not></And>
                <And><Not><Arg Name="FlagSamplingOngoing"/></Not></And>
                <And><Arg Name="CntSamples"/><Le><Arg Name="NumSamplers"/></Le></And>
                <And><Arg Name="SampleOptionsSet"/></And>
                <And><Not><Arg Name="SampleCompleted"/></Not></And>
            </When>

            <Syslog Severity="Important">Taking sample No.<Arg Name="CntSamples"/><Units:count/> smeared between <Arg Name="ShallowBoundSmear"/><Units:meter/> and <Arg Name="DeepBoundSmear"/><Units:meter/>.</Syslog>

            <Assign><Sequence/><Arg Name="EnableFiringSmear"/><True/></Assign>

            <Assign><Sequence/><Arg Name="FlagSamplingOngoing"/><True/></Assign>

            <Assign><Sequence/><Arg Name="FlagFired"/><True/></Assign>

            <Assign><Sequence/><Arg Name="FromLastTimeFixToLastFiring"/><Elapsed><Universal:time_fix/></Elapsed></Assign>

<!--debug
           <Syslog Severity="Important">FromLastTimeFixToLastFiring = <Arg Name="FromLastTimeFixToLastFi ring"/><Units:minute/></Syslog>
-->

            <Call Id="TakeSmearSample" RefId="SmearSamplingWrapper"/>

            <Assign><Sequence/><Arg Name="FlagSamplingOngoing"/><False/></Assign>

            <Assign><Sequence/><Arg Name="SampleCompleted"/><True/></Assign>

            <Assign><Sequence/><Arg Name="SampleOptionsSet"/><False/></Assign>

        </Aggregate>

        <Aggregate Id="IncrementSampleCounter">

            <When>
                <Arg Name="SampleCompleted"/>
            </When>

            <Assign><Sequence/><Arg Name="CntSamples"/><Arg Name="CntSamples"/><Add><Units:count/> <Value>1</Value></Add></Assign>

            <Assign><Sequence/><Arg Name="SampleCompleted"/><False/></Assign>

        </Aggregate>

    </Aggregate>

</Mission>