31#include <sys/resource.h>
58using std::resetiosflags;
59using std::setiosflags;
60using std::setprecision;
67using std::stringstream;
75using std::inner_product;
88 if ((! isatty(fileno(stdout))) || (! isatty(fileno(stderr))))
93 for (
int i = 1; i < nArg; i++)
95 string strArg = pcArgv[i];
103 if (strArg.find(
"--gdal") != string::npos)
108 for (
int j = 0; j < GDALGetDriverCount(); j++)
110 GDALDriverH hDriver = GDALGetDriver(j);
112 string strTmp(GDALGetDriverShortName(hDriver));
114 strTmp.append(GDALGetDriverLongName(hDriver));
116 cout << strTmp << endl;
123 if (strArg.find(
"--about") != string::npos)
126 cout <<
ABOUT << endl;
133 if (strArg.find(
"--home") != string::npos)
139 size_t pos = strArg.find(
'=');
142 if (pos != string::npos)
150 cout <<
"No '=' found in the input string" << endl;
158 cout <<
USAGE << endl;
188 if (
static_cast<clock_t
>(-1) == clock())
214 if (0 != GetModuleFileName(NULL, szBuf,
BUF_SIZE))
222 if (-1 != readlink(
"/proc/self/exe", szBuf,
BUF_SIZE))
246 cout <<
LINE << endl;
284 return 24 * 30.416667;
339 if (strIn->find(
"hour") != string::npos)
341 else if (strIn->find(
"day") != string::npos)
343 else if (strIn->find(
"month") != string::npos)
345 else if (strIn->find(
"year") != string::npos)
358 LogStream.open(
"/dev/null", ios::out | ios::trunc);
359 cout <<
"Warning: log file is not writting" << endl;
367 cerr <<
ERR <<
"cannot open " <<
m_strLogFile <<
" for output" << endl;
879 if (strTmp.size() > 2)
880 strTmp.resize(strTmp.size() - 2);
983 if (strTmp.size() > 2)
984 strTmp.resize(strTmp.size() - 2);
1005 strTmp.append(
", ");
1011 strTmp.append(
", ");
1017 strTmp.append(
", ");
1023 strTmp.append(
", ");
1029 strTmp.append(
", ");
1035 strTmp.append(
", ");
1041 strTmp.append(
", ");
1047 strTmp.append(
", ");
1053 strTmp.append(
", ");
1059 strTmp.append(
", ");
1065 strTmp.append(
", ");
1069 if (strTmp.size() > 2)
1070 strTmp.resize(strTmp.size() - 2);
1087 strTSFile.append(
CSVEXT);
1094 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1104 strTSFile.append(
CSVEXT);
1111 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1121 strTSFile.append(
CSVEXT);
1128 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1138 strTSFile.append(
CSVEXT);
1145 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1155 strTSFile.append(
CSVEXT);
1162 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1172 strTSFile.append(
CSVEXT);
1179 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1189 strTSFile.append(
CSVEXT);
1196 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1206 strTSFile.append(
CSVEXT);
1213 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1223 strTSFile.append(
CSVEXT);
1230 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1240 strTSFile.append(
CSVEXT);
1247 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1257 strTSFile.append(
CSVEXT);
1264 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1274 strTSFile.append(
CSVEXT);
1281 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1322 string strComputerName;
1326 strComputerName = getenv(
"COMPUTERNAME");
1332 strComputerName = szHostName;
1333 if (strComputerName.empty())
1334 strComputerName =
"Unknown Computer";
1337 return strComputerName;
1345 if (
static_cast<clock_t
>(-1) == clock())
1348 LogStream <<
"CPU time not available" << endl;
1354 double dClkThis =
static_cast<double>(clock());
1355 dClkThis -= CLOCK_T_MIN;
1367 <<
" before rollover=" << (CLOCK_T_RANGE + 1 -
m_dClkLast) << endl
1369 <<
" after rollover=" << dClkThis << endl
1371 <<
" ADDED=" << (CLOCK_T_RANGE + 1 -
m_dClkLast + dClkThis) << endl;
1416 double dPerTimestep = dDuration /
static_cast<double>(
m_ulTotTimestep);
1419 OutStream << fixed << setprecision(4) <<
" (" << dPerTimestep <<
" per timestep)" << endl;
1420 LogStream << fixed << setprecision(4) <<
" (" << dPerTimestep <<
" per timestep)" << endl;
1423 OutStream << resetiosflags(ios::floatfield);
1424 OutStream << fixed << setprecision(0) <<
"In terms of CPU time, this is ";
1425 LogStream << resetiosflags(ios::floatfield);
1426 LogStream << fixed << setprecision(0) <<
"In terms of CPU time, this is ";
1427 if (dDuration > dRunLength)
1429 OutStream << dDuration / dRunLength <<
" x slower than reality" << endl;
1430 LogStream << dDuration / dRunLength <<
" x slower than reality" << endl;
1434 OutStream << dRunLength / dDuration <<
" x faster than reality" << endl;
1435 LogStream << dRunLength / dDuration <<
" x faster than reality" << endl;
1447 double dPerTimestep = dDuration /
static_cast<double>(
m_ulTotTimestep);
1450 OutStream << resetiosflags(ios::floatfield);
1451 OutStream <<
" (" << fixed << setprecision(4) << dPerTimestep <<
" per timestep)" << endl;
1452 LogStream << resetiosflags(ios::floatfield);
1453 LogStream <<
" (" << fixed << setprecision(4) << dPerTimestep <<
" per timestep)" << endl;
1456 OutStream << fixed << setprecision(0) <<
"In terms of run time, this is ";
1457 LogStream << fixed << setprecision(0) <<
"In terms of run time, this is ";
1458 if (dDuration > dRunLength)
1460 OutStream << dDuration / dRunLength <<
" x slower than reality" << endl;
1461 LogStream << dDuration / dRunLength <<
" x slower than reality" << endl;
1465 OutStream << dRunLength / dDuration <<
" x faster than reality" << endl;
1466 LogStream << dRunLength / dDuration <<
" x faster than reality" << endl;
1476 double dTmpTime =
tMax(dTimeIn, 0.0);
1481 double const dHoursInYear = 24 * 365;
1482 double dHoursInDay = 24;
1485 if (dTmpTime >= dHoursInYear)
1487 double dYears = floor(dTmpTime / dHoursInYear);
1488 dTmpTime -= (dYears * dHoursInYear);
1490 strTime = to_string(
static_cast<int>(dYears));
1491 strTime.append(
"y ");
1497 if (dTmpTime >= dHoursInDay)
1499 double dJDays = floor(dTmpTime / dHoursInDay);
1500 dTmpTime -= (dJDays * dHoursInDay);
1502 stringstream ststrTmp;
1503 ststrTmp << FillToWidth('0', 3) << static_cast<int>(dJDays);
1504 strTime.append(ststrTmp.str());
1505 strTime.append(
"d ");
1508 strTime.append(
"000d ");
1511 stringstream ststrTmp;
1512 ststrTmp << FillToWidth('0', 2) << static_cast<int>(dTmpTime);
1513 strTime.append(ststrTmp.str());
1514 strTime.append(
"h");
1525 double dTime =
tMax(dTimeIn, 0.0);
1532 unsigned long ulTimeIn =
static_cast<unsigned long>(floor(dTime));
1533 dTime -=
static_cast<double>(ulTimeIn);
1536 if (ulTimeIn >= 3600)
1539 unsigned long ulHours = ulTimeIn / 3600ul;
1540 ulTimeIn -= (ulHours * 3600ul);
1542 strTime = to_string(ulHours);
1543 strTime.append(
":");
1552 unsigned long ulMins = ulTimeIn / 60ul;
1553 ulTimeIn -= (ulMins * 60ul);
1555 stringstream ststrTmp;
1556 ststrTmp << FillToWidth(
'0', 2) << ulMins;
1557 strTime.append(ststrTmp.str());
1558 strTime.append(
":");
1561 strTime.append(
"00:");
1564 stringstream ststrTmp;
1565 ststrTmp << FillToWidth(
'0', 2) << ulTimeIn;
1566 strTime.append(ststrTmp.str());
1571 strTime.append(
".");
1573 ststrTmp.str(
string());
1574 ststrTmp << FillToWidth('0', 2) << static_cast<unsigned long>(dTime * 100);
1575 strTime.append(ststrTmp.str());
1586 string strBuild(
"(");
1587 strBuild.append(__TIME__);
1588 strBuild.append(
" ");
1589 strBuild.append(__DATE__);
1591 strBuild.append(
" DEBUG");
1593 strBuild.append(
" build)");
1603 if (isatty(fileno(stdout)))
1606 static double sdElapsed = 0;
1607 static double sdToGo = 0;
1608 time_t tNow = time(
nullptr);
1617 cout <<
"% (elapsed " <<
strDispTime(sdElapsed,
false,
false) <<
" remaining ";
1619 cout <<
strDispTime(sdToGo,
false,
false) <<
") ";
1623 cout << setw(9) <<
"GIS" + to_string(
m_nGISSave);
1625 cout << setw(9) <<
"SED INPUT";
1627 cout << setw(9) <<
SPACE;
1638 string const NA =
"Not available";
1641 OutStream <<
"Process statistics" << endl;
1642 OutStream <<
"------------------" << endl;
1646 OSVERSIONINFOEX osvi;
1647 BOOL bOsVersionInfoEx;
1649 ZeroMemory(&osvi,
sizeof(OSVERSIONINFOEX));
1650 osvi.dwOSVersionInfoSize =
sizeof(OSVERSIONINFOEX);
1652 if (!(bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO *)&osvi)))
1655 osvi.dwOSVersionInfoSize =
sizeof(OSVERSIONINFO);
1657 if (!GetVersionEx((OSVERSIONINFO *)&osvi))
1667 switch (osvi.dwPlatformId)
1669 case VER_PLATFORM_WIN32_NT:
1670 if (osvi.dwMajorVersion <= 4)
1672 else if (5 == osvi.dwMajorVersion && 0 == osvi.dwMinorVersion)
1674 else if (5 == osvi.dwMajorVersion && 1 == osvi.dwMinorVersion)
1676 else if (6 == osvi.dwMajorVersion && 0 == osvi.dwMinorVersion)
1678 else if (6 == osvi.dwMajorVersion && 1 == osvi.dwMinorVersion)
1680 else if (6 == osvi.dwMajorVersion && 2 == osvi.dwMinorVersion)
1682 else if (6 == osvi.dwMajorVersion && 3 == osvi.dwMinorVersion)
1684 else if (10 == osvi.dwMajorVersion && 0 == osvi.dwMinorVersion)
1686 else if (11 == osvi.dwMajorVersion && 0 == osvi.dwMinorVersion)
1689 OutStream <<
"unknown Windows version ";
1692 if (osvi.dwMajorVersion <= 4)
1693 OutStream <<
"version " << osvi.dwMajorVersion <<
"." << osvi.dwMinorVersion <<
" " << osvi.szCSDVersion <<
" (Build " << (osvi.dwBuildNumber & 0xFFFF) <<
")" << endl;
1695 OutStream << osvi.szCSDVersion <<
" (Build " << (osvi.dwBuildNumber & 0xFFFF) <<
")" << endl;
1698 case VER_PLATFORM_WIN32_WINDOWS:
1699 if (4 == osvi.dwMajorVersion && 0 == osvi.dwMinorVersion)
1702 if (
'C' == osvi.szCSDVersion[1] ||
'B' == osvi.szCSDVersion[1])
1706 else if (4 == osvi.dwMajorVersion && 10 == osvi.dwMinorVersion)
1709 if (
'A' == osvi.szCSDVersion[1])
1713 else if (4 == osvi.dwMajorVersion && 90 == osvi.dwMinorVersion)
1716 OutStream <<
"unknown 16-bit Windows version " << endl;
1719 case VER_PLATFORM_WIN32s:
1725 if (VER_PLATFORM_WIN32_NT == osvi.dwPlatformId)
1727 FILETIME ftCreate, ftExit, ftKernel, ftUser;
1728 if (GetProcessTimes(GetCurrentProcess(), &ftCreate, &ftExit, &ftKernel, &ftUser))
1731 ul.LowPart = ftUser.dwLowDateTime;
1732 ul.HighPart = ftUser.dwHighDateTime;
1733 OutStream <<
"Time spent executing user code \t: " <<
strDispTime(
static_cast<double>(ul.QuadPart) * 1e-7,
false) << endl;
1734 ul.LowPart = ftKernel.dwLowDateTime;
1735 ul.HighPart = ftKernel.dwHighDateTime;
1736 OutStream <<
"Time spent executing kernel code \t: " <<
strDispTime(
static_cast<double>(ul.QuadPart) * 1e-7,
false) << endl;
1740 OutStream <<
"Process timings \t: " << NA << endl;
1743 HINSTANCE hDLL = LoadLibrary(
"psapi.dll");
1747 typedef BOOL(__stdcall * DLLPROC)(HANDLE, PPROCESS_MEMORY_COUNTERS, DWORD);
1751 ProcAdd = (DLLPROC)GetProcAddress(hDLL,
"GetProcessMemoryInfo");
1755 PROCESS_MEMORY_COUNTERS pmc;
1758 if ((ProcAdd)(GetCurrentProcess(), &pmc,
sizeof(pmc)))
1760 OutStream <<
"Peak working set size \t: " << pmc.PeakWorkingSetSize / (1024.0 * 1024.0) <<
" Mb" << endl;
1761 OutStream <<
"Current working set size \t: " << pmc.WorkingSetSize / (1024.0 * 1024.0) <<
" Mb" << endl;
1762 OutStream <<
"Peak paged pool usage \t: " << pmc.QuotaPeakPagedPoolUsage / (1024.0 * 1024.0) <<
" Mb" << endl;
1763 OutStream <<
"Current paged pool usage \t: " << pmc.QuotaPagedPoolUsage / (1024.0 * 1024.0) <<
" Mb" << endl;
1764 OutStream <<
"Peak non-paged pool usage \t: " << pmc.QuotaPeakNonPagedPoolUsage / (1024.0 * 1024.0) <<
" Mb" << endl;
1765 OutStream <<
"Current non-paged pool usage \t: " << pmc.QuotaNonPagedPoolUsage / (1024.0 * 1024.0) <<
" Mb" << endl;
1766 OutStream <<
"Peak pagefile usage \t: " << pmc.PeakPagefileUsage / (1024.0 * 1024.0) <<
" Mb" << endl;
1767 OutStream <<
"Current pagefile usage \t: " << pmc.PagefileUsage / (1024.0 * 1024.0) <<
" Mb" << endl;
1768 OutStream <<
"No. of page faults \t: " << pmc.PageFaultCount << endl;
1776#elif defined __GNUG__
1778 if (getrusage(RUSAGE_SELF, &ru) >= 0)
1780 OutStream <<
"Time spent executing user code \t: " <<
strDispTime(
static_cast<double>(ru.ru_utime.tv_sec),
false,
true) << endl;
1782 OutStream <<
"Time spent executing kernel code \t: " <<
strDispTime(
static_cast<double>(ru.ru_stime.tv_sec),
false,
true) << endl;
1788 OutStream <<
"No. of page faults not requiring physical I/O\t: " << ru.ru_minflt << endl;
1789 OutStream <<
"No. of page faults requiring physical I/O \t: " << ru.ru_majflt << endl;
1794 OutStream <<
"No. of voluntary context switches \t: " << ru.ru_nvcsw << endl;
1795 OutStream <<
"No. of involuntary context switches \t: " << ru.ru_nivcsw << endl;
1806 if (0 == omp_get_thread_num())
1808 OutStream <<
"Number of OpenMP threads \t: " << omp_get_num_threads() << endl;
1809 OutStream <<
"Number of OpenMP processors \t: " << omp_get_num_procs() << endl;
1825 strErr =
"run ended by user";
1828 strErr =
"error in command-line parameter";
1831 strErr =
"error reading initialization file";
1834 strErr =
"error in directory name";
1837 strErr =
"error reading run details file";
1840 strErr =
"error reading SCAPE shape function file";
1843 strErr =
"error reading tide data file";
1846 strErr =
"error creating log file";
1849 strErr =
"error creating text output file";
1852 strErr =
"error creating time series file";
1855 strErr =
"error reading initial DEM file";
1858 strErr =
"error reading raster GIS file";
1861 strErr =
"error reading vector GIS file";
1864 strErr =
"error allocating memory";
1867 strErr =
"problem with raster GIS output format";
1870 strErr =
"problem with vector GIS output format";
1873 strErr =
"error writing text output file";
1876 strErr =
"error writing raster GIS output file";
1879 strErr =
"error writing vector GIS output file";
1882 strErr =
"error writing time series output file";
1885 strErr =
"error putting linear feature onto raster grid";
1888 strErr =
"no sea cells found";
1891 strErr =
"error when searching grid for linear feature";
1894 strErr =
"error tracing coastline on grid";
1897 strErr =
"no coastlines found. Is the SWL correct?";
1900 strErr =
"error writing coastline-normal profiles";
1903 strErr =
"error in time units";
1906 strErr =
"no solution when finding end point for coastline-normal line";
1909 strErr =
"end point for coastline-normal line is at the grid edge";
1912 strErr =
"end point for coastline-normal line is not in the contiguous sea";
1915 strErr =
"cliff notch is above sediment top elevation";
1918 strErr =
"unable to deposit sediment from cliff collapse";
1921 strErr =
"coastline-normal profiles are too closely spaced";
1924 strErr =
"no coastline-normal profiles created, check the SWL";
1927 strErr =
"no coastline-normal profiles created during rasterization";
1930 strErr =
"hit grid edge when eroding beach";
1933 strErr =
"could not locate seaward end of profile when creating Dean profile during estimation of beach erosion";
1936 strErr =
"could not locate seaward end of profile when creating Dean profile for beach erosion";
1939 strErr =
"could not locate seaward end of profile when creating Dean profile for beach deposition (up-coast)";
1942 strErr =
"could not locate seaward end of profile when creating Dean profile for beach deposition (down-coast)";
1945 strErr =
"updating grid with landforms";
1948 strErr =
"no top layer of sediment";
1951 strErr =
"problem with polygon-to-polygon sediment routing sequence";
1954 strErr =
"inconsistent multiline";
1957 strErr =
"cannot insert point into multiline";
1960 strErr =
"cannot assign coastal landform";
1963 strErr =
"start point for flood fill of wave shadow zone is outside grid";
1966 strErr =
"could not find start point for flood fill of wave shadow zone";
1969 strErr =
"empty profile during during CShore wave propagation";
1972 strErr =
"creating file for CShore input";
1975 strErr =
"reading CShore output file";
1978 strErr =
"during wave interpolation lookup";
1981 strErr =
"while running GDALGridCreate()";
1984 strErr =
"cannot find edge cell while constructing grid-edge profile";
1987 strErr =
"CShore did not finish correctly";
1990 strErr =
"Could not find cell under coastline";
1993 strErr =
"opening deep sea wave time series file";
1996 strErr =
"reading deep sea wave time series file";
1999 strErr =
"finding edges of the bounding box";
2002 strErr =
"reading sediment input event time series file";
2005 strErr =
"simulating sediment input event";
2008 strErr =
"location of sediment input event is outside grod";
2011 strErr =
"location of wavestation is outside grid";
2014 strErr =
"cliff not in polygon";
2017 strErr =
"unknown error";
2021 strErr =
"totally unknown error";
2075 if (isatty(fileno(stdout)))
2090 string strCmd(
"echo \"");
2092 stringstream ststrTmp;
2093 ststrTmp << put_time(localtime(&
m_tSysEndTime),
"%T on %A %d %B %Y") << endl;
2099 strCmd.append(
"Simulation ");
2101 strCmd.append(
", running on ");
2103 strCmd.append(
", completed normally at ");
2104 strCmd.append(ststrTmp.str());
2105 strCmd.append(
"\" | mail -s \"");
2107 strCmd.append(
": normal completion\" ");
2113 strCmd.append(
"Simulation ");
2115 strCmd.append(
", running on ");
2117 strCmd.append(
", aborted with error code ");
2118 strCmd.append(to_string(nRtn));
2119 strCmd.append(
": ");
2121 strCmd.append(
" at timestep ");
2122 strCmd.append(to_string(
m_ulIter));
2123 strCmd.append(
" (");
2125 strCmd.append(
").\n\nThis message sent at ");
2126 strCmd.append(ststrTmp.str());
2127 strCmd.append(
"\" | mail -s \"");
2129 strCmd.append(
": ERROR\" ");
2132 int nRet = system(strCmd.c_str());
2133 if (WEXITSTATUS(nRet) != 0)
2145 string strOut(*strIn);
2146 strOut.replace(strOut.begin(), strOut.end(),
'/',
'\\');
2155 string strOut(*strIn);
2156 strOut.replace(strOut.begin(), strOut.end(),
'\\',
'/');
2166 size_t nStartpos = strIn->find_first_not_of(
" \t");
2167 if (nStartpos == string::npos)
2170 return strIn->substr(nStartpos);
2178 string strTmp(*strIn);
2181 strTmp.erase(remove(strTmp.begin(), strTmp.end(),
'\r'), strTmp.end());
2184 size_t nEndpos = strTmp.find_last_not_of(
" \t");
2185 if (nEndpos == string::npos)
2188 return strTmp.substr(0, nEndpos + 1);
2196 string strTmp = *strIn;
2199 strTmp.erase(remove(strTmp.begin(), strTmp.end(),
'\r'), strTmp.end());
2202 size_t nPos = strTmp.find_last_not_of(
" \t");
2204 if (nPos != string::npos)
2205 strTmp.resize(nPos+1);
2208 nPos = strTmp.find_first_not_of(
" \t");
2210 if (nPos != string::npos)
2211 strTmp = strTmp.substr(nPos);
2221 string strOut = *strIn;
2222 transform(strIn->begin(), strIn->end(), strOut.begin(), tolower);
2241 size_t nPos = pStrIn->find(*pStrSub);
2243 if (nPos != string::npos)
2246 pStrIn->replace(nPos, pStrSub->size(),
"");
2261 stringstream ss(*s);
2263 while (getline(ss, item, delim))
2266 elems->push_back(item);
2276 vector<string> elems;
2322 nXLast = pVPtiPoints->back().nGetX(),
2323 nYLast = pVPtiPoints->back().nGetY(),
2324 nXDiff = nX - nXLast,
2325 nYDiff = nY - nYLast,
2326 nXDiffA =
tAbs(nXDiff),
2327 nYDiffA =
tAbs(nYDiff),
2328 nDiff =
tMax(nXDiffA, nYDiffA);
2338 dXInc =
static_cast<double>(nXDiff) / nDiff;
2341 dYInc =
static_cast<double>(nYDiff) / nDiff;
2343 for (
int n = 1; n < nDiff; n++)
2346 pVPtiPoints->push_back(Pti);
2356void CSimulation::CalcDeanProfile(vector<double>* pdVDeanProfile,
double const dInc,
double const dDeanTopElev,
double const dA,
bool const bDeposition,
int const nSeawardOffset,
double const dStartCellElev)
2358 double dDistFromProfileStart = 0;
2363 pdVDeanProfile->at(0) = dStartCellElev;
2364 for (
int n = 1; n < static_cast<int>(pdVDeanProfile->size()); n++)
2366 if (n <= nSeawardOffset)
2368 pdVDeanProfile->at(n) = dStartCellElev;
2371 double dDistBelowTop = dA * pow(dDistFromProfileStart,
DEAN_POWER);
2372 pdVDeanProfile->at(n) = dDeanTopElev - dDistBelowTop;
2374 dDistFromProfileStart += dInc;
2381 for (
int n = 0; n < static_cast<int>(pdVDeanProfile->size()); n++)
2383 double dDistBelowTop = dA * pow(dDistFromProfileStart,
DEAN_POWER);
2384 pdVDeanProfile->at(n) = dDeanTopElev - dDistBelowTop;
2386 dDistFromProfileStart += dInc;
2396 double dTotElevDiff = 0;
2399 for (
int n = 0; n < static_cast<int>(pdVFirstProfile->size()); n++)
2401 if (pbVIsValid->at(n))
2403 double dProfileDiff = pdVFirstProfile->at(n) - pdVSecondProfile->at(n);
2405 dTotElevDiff += dProfileDiff;
2431 return dTotElevDiff;
2440 dDeepWaterWaveHeight,
2466 m_dDepthOfClosure = (1.75 * dDeepWaterWaveHeight) - (57.9 * dDeepWaterWaveHeight * dDeepWaterWaveHeight / (
m_dG * dDeepWaterPeriod * dDeepWaterPeriod));
2484 if (VstrTmp.size() < 3)
2486 cerr <<
"date string must include day, month, and year '" << strDate <<
"'" << endl;
2493 cerr <<
"invalid integer for day in date '" << strDate <<
"'" << endl;
2497 nDay = stoi(VstrTmp[0]);
2499 if ((nDay < 1) || (nDay > 31))
2501 cerr <<
"day must be between 1 and 31 in date '" << strDate <<
"'" << endl;
2508 cerr <<
"invalid integer for month in date '" << strDate <<
"'" << endl;
2512 nMonth = stoi(VstrTmp[1]);
2514 if ((nMonth < 1) || (nMonth > 12))
2516 cerr <<
"month must be between 1 and 12 in date '" << strDate <<
"'" << endl;
2523 cerr <<
"invalid integer for year in date '" << strDate <<
"'" << endl;
2527 nYear = stoi(VstrTmp[2]);
2531 cerr <<
"year must be > 0 in date '" << strDate <<
"'" << endl;
2545 if (VstrTmp.size() < 3)
2547 cerr <<
"time string must include hours, minutes, and seconds '" << strTime <<
"'" << endl;
2554 cerr <<
"invalid integer for hours in time '" << strTime <<
"'" << endl;
2558 nHour = stoi(VstrTmp[0]);
2560 if ((nHour < 0) || (nHour > 23))
2562 cerr <<
"hour must be between 0 and 23 in time '" << strTime <<
"'" << endl;
2569 cerr <<
"invalid integer for minutes in time '" << strTime <<
"'" << endl;
2573 nMin = stoi(VstrTmp[1]);
2575 if ((nMin < 0) || (nMin > 59))
2577 cerr <<
"minutes must be betwen 0 and 59 in time '" << strTime <<
"'" << endl;
2584 cerr <<
"invalid integer for seconds in time '" << strTime <<
"'" << endl;
2588 nSec = stoi(VstrTmp[2]);
2590 if ((nSec < 0) || (nSec > 59))
2592 cerr <<
"seconds must be between 0 and 59 in time '" << strTime <<
"'" << endl;
2604 unsigned long ulTimeStep = 0;
2610 if (strDate.find(
"hour") != string::npos)
2616 cerr <<
"Error in number of hours '" + strDate +
"' for sediment input event" << endl;
2620 double dHours = stod(
strTrim(&VstrTmp[0]));
2623 cerr <<
"Sediment input event '" + strDate +
"' occurs after end of simulation" << endl;
2629 else if (strDate.find(
"day") != string::npos)
2635 cerr <<
"Error in number of days '" + strDate +
"' for sediment input event" << endl;
2639 double dHours = stod(
strTrim(&VstrTmp[0])) * 24;
2642 cerr <<
"Sediment input event '" + strDate +
"' occurs after end of simulation" << endl;
2652 if (VstrTmp.size() < 2)
2654 cerr <<
"Error in time/date '" + strDate +
"' of sediment input event" << endl;
2664 if (!
bParseTime(&VstrTmp[0], nHour, nMin, nSec))
2666 cerr <<
"Error in time '" + VstrTmp[0] +
"' of sediment input event" << endl;
2676 if (!
bParseDate(&VstrTmp[1], nDay, nMonth, nYear))
2678 cerr <<
"Error in date '" + VstrTmp[1] +
"' of sediment input event" << endl;
2683 struct tm tmSimStart = {};
2691 struct tm tmSimEvent = {};
2692 tmSimEvent.tm_sec = nSec;
2693 tmSimEvent.tm_min = nMin;
2694 tmSimEvent.tm_hour = nHour;
2695 tmSimEvent.tm_mday = nDay;
2696 tmSimEvent.tm_mon = nMonth - 1;
2697 tmSimEvent.tm_year = nYear - 1900;
2699 time_t tStart = mktime(&tmSimStart);
2700 time_t tEvent = mktime(&tmSimEvent);
2702 if (tStart == (time_t)(-1))
2704 cerr <<
"Error in simulation start time/date" << endl;
2708 if (tEvent == (time_t)(-1))
2710 cerr <<
"Error in time/date '" + strDate +
"' of sediment input event" << endl;
2714 double dHours = difftime(tEvent, tStart) / (60 * 60);
2717 cerr <<
"Sediment input event '" + strDate +
"' occurs before start of simulation" << endl;
2723 cerr <<
"Sediment input event '" + strDate +
"' occurs after end of simulation" << endl;
2727 ulTimeStep =
static_cast<unsigned long>(dHours /
m_dTimeStep);
Geometry class used to represent 2D point objects with integer coordinates.
int nGetY(void) const
Returns the CGeom2DIPoint object's integer Y coordinate.
int nGetX(void) const
Returns the CGeom2DIPoint object's integer X coordinate.
Geometry class used for coast polygon objects.
void CalcDepthOfClosure(void)
Calculate the depth of closure.
int m_nLogFileDetail
The level of detail in the log file output. Can be LOG_FILE_LOW_DETAIL, LOG_FILE_MIDDLE_DETAIL,...
bool m_bAvgSeaDepthSave
Save average sea depth raster GIS files?
vector< string > m_VstrInitialSandConsSedimentFile
The name of the initial sand-sized consolidated sediment GIS file.
double m_dAllCellsDeepWaterWaveHeight
Deep water wave height (m) for all sea cells.
static void AnnounceInitializing(void)
Tells the user that we are now initializing.
bool m_bTopSurfSave
Save fop surface (sediment and sea) raster DEMs?
static void AnnounceReadSCAPEShapeFunctionFile(void)
Now reading the SCAPE shape function file.
string m_strInitialSuspSedimentFile
Name of initial suspended sediment file.
static void AnnounceIsRunning(void)
Tell the user that the simulation is now running.
void DoCPUClockReset(void)
Resets the CPU clock timer to prevent it 'rolling over', as can happen during long runs....
bool m_bSedimentTopSurfSave
Save sediment top surface raster DEMs?
bool m_bFineUnconsSedSave
Save fine unconsolidated sediment raster GIS files?
string m_strSedimentInputEventFile
The name of the sediment input events time series file.
time_t m_tSysEndTime
System finish-simulation time.
string m_strCMEIni
Folder for the CME .ini file.
double m_dG
Gravitational acceleration (m**2/sec)
vector< string > m_VstrInitialCoarseUnconsSedimentFile
The name of the initial coarse-sized unconsolidated sediment GIS file.
void AnnounceReadDeepWaterWaveValuesGIS(void) const
Tells the user that we are now reading the deep water wave values GIS file.
ofstream CliffCollapseNetChangeTSStream
Cliff collapse net change (erosion - deposition) time series file output stream.
bool m_bBeachDepositionTSSave
Save the beach (unconsolidated sediment) deposition time series file?
static string strRemoveSubstr(string *, string const *)
Returns a string with a substring removed, and with whitespace trimmed.
CGeomRasterGrid * m_pRasterGrid
Pointer to the raster grid object.
static bool bParseTime(string const *, int &, int &, int &)
Parses a time string into hours, minutes, and seconds, and checks each of them.
void AnnounceReadInitialSandConsSedGIS(int const) const
Tells the user that we are now reading the initial sand consolidated sediment depth GIS file.
string strListRasterFiles(void) const
Return a space-separated string containing the names of the raster GIS output files.
void AnnounceReadInitialSandUnconsSedGIS(int const) const
Tells the user that we are now reading the initial sand unconsolidated sediment depth GIS file.
string strListVectorFiles(void) const
Return a space-separated string containing the names of the vector GIS output files.
double m_dMaxUserInputWavePeriod
Used to constrain depth of closure.
bool m_bFloodSetupSurgeRunupTSSave
Save the flood setup surge runup time series file? TODO 007 Does this work correctly?
bool bSetUpTSFiles(void)
The bSetUpTSFiles member function sets up the time series files.
void AnnounceReadInitialFineUnconsSedGIS(int const) const
Tells the user that we are now reading the initial fine unconsolidated sediment depth GIS file.
vector< CRWCoast > m_VFloodWaveSetupSurgeRunup
TODO 007 Info needed.
vector< CRWCoast > m_VCoast
The coastline objects.
static string pstrChangeToForwardSlash(string const *)
Swaps all backslashes in the input string to forward slashes, leaving the original unchanged.
bool m_bSaveGISThisIter
Save GIS files this iteration?
void DoSimulationEnd(int const)
Carries out end-of-simulation tidying (error messages etc.)
double m_dCPUClock
Total elapsed CPU time.
bool bSaveAllVectorGISFiles(void)
The bSaveAllvectorGISFiles member function saves the vector GIS files TODO 081 Choose more files to o...
bool m_bSingleDeepWaterWaveValues
Do we have just a point source for (i.e. only a single measurement of) deep water wave values.
string m_strRunName
The name of this simulation.
static string strGetComputerName(void)
Returns a string, hopefully giving the name of the computer on which the simulation is running.
static string strDispSimTime(double const)
strDispSimTime returns a string formatted as year Julian_day hour, given a parameter in hours
bool m_bAvgWaveAngleAndHeightSave
Save average wave angle and average wave height raster GIS files?
bool m_bInvalidNormalsSave
Save invalid coastline-normal vector GIS files?
bool m_bShadowBoundarySave
Save wave shadow boundary vector GIS files?
int nDoSimulationTimeMultiplier(string const *)
Given a string containing time units, this sets up the appropriate multiplier and display units for t...
bool m_bActualBeachErosionSave
Save actual (supply-limited) beach (unconsolidated sediment) erosion raster GIS files?
bool m_bStillWaterLevelTSSave
Save the still water level time series file?
bool m_bTotalActualPlatformErosionSave
Save total actual (supply-limited) shore platform erosion raster GIS files?
static string strTrimLeft(string const *)
Trims whitespace from the left side of a string, does not change the original string.
vector< string > m_VstrInitialFineConsSedimentFile
The name of the initial fine-sized consolidated sediment GIS file.
bool m_bBasementElevSave
Save basement raster DEMs?
int m_nSimStartHour
Start time of the simulation (hours)
bool m_bCoarseUnconsSedSave
Save coarse unconsolidated sediment raster GIS files?
bool m_bSuspSedTSSave
Save the suspended sediment time series file?
bool m_bCliffCollapseNetTSSave
Save the cliff collapse net change time series file?
bool m_bPotentialPlatformErosionMaskSave
Save potential platform erosion mask raster GIS files?
static void AnnounceSimEnd(void)
Announce the end of the simulation.
void AnnounceReadICGIS(void) const
Tells the user that we are now reading the Intervention class GIS file.
bool m_bWaveHeightSave
Save wave height raster GIS files?
bool m_bLandformSave
Save coast landform raster GIS files?
ofstream CliffCollapseDepositionTSStream
Cliff collapse deposition time series file output stream.
vector< CRWCoast > m_VFloodWaveSetupSurge
TODO 007 Info needed.
static string strTrim(string const *)
Trims whitespace from both sides of a string, does not change the original string.
bool m_bTotalBeachDepositionSave
Save total beach (unconsolidated sediment) deposition raster GIS files?
int m_nSimStartSec
Start time of the simulation (seconds)
int m_nSimStartDay
Start date of the simulation (day)
bool m_bSandUnconsSedSave
Save sand unconsolidated sediment raster GIS files?
bool m_bActualPlatformErosionTSSave
Save the actual (supply-limited) shore platform erosion time series file?
unsigned long ulConvertToTimestep(string const *) const
For sediment input events, parses a string that may be relative (a number of hours or days after the ...
static void AnnounceAddLayers(void)
Tells the user that we are now adding layers.
bool m_bRasterPolygonSave
Save raster polygon raster GIS files?
bool m_bBeachDepositionSave
Save beach (unconsolidated sediment) deposition raster GIS files?
bool bFindExeDir(char const *)
Finds the folder (directory) in which the CoastalME executable is located.
static double dSubtractProfiles(vector< double > const *, vector< double > const *, vector< bool > const *)
Calculate the total elevation difference between every point in two elevation profiles (first profile...
bool m_bNormalsSave
Save coastline-normal vector GIS files?
bool m_bAvgWaveHeightSave
Save wave height raster GIS files?
static string strToLower(string const *)
Returns the lower case version of an string, leaving the original unchanged.
bool m_bHaveSandSediment
Does this simulation consider sand-sized sediment?
bool m_bSeaDepthSave
Save sea depth raster GIS files?
bool m_bWaveAngleAndHeightSave
Save wave angle and wave height raster GIS files?
ofstream BeachDepositionTSStream
Beach sediment deposition time series file output stream.
string m_strInitialBasementDEMFile
Name of initial basement DEM file.
static string strTrimRight(string const *)
Trims whitespace from the right side of a string, does not change the original string.
void AnnounceReadSedimentEventInputValuesGIS(void) const
Tells the user that we are now reading the sediment input events GIS file.
string m_strLogFile
Name of output log file.
time_t m_tSysStartTime
System start-simulation time.
void AnnounceReadFloodLocationGIS(void) const
Tells the user that we are now reading the flood location GIS file.
void StartClock(void)
Starts the clock ticking.
bool m_bActiveZoneSave
Save active zone raster GIS files?
void AnnounceReadInitialSuspSedGIS(void) const
Tells the user that we are now reading the initial suspended sediment depth GIS file.
ofstream StillWaterLevelTSStream
SWL time series file output stream.
void DoEndOfRunDeletes(void)
Do end-of-run memory clearance.
vector< string > m_VstrInitialSandUnconsSedimentFile
The name of the initial sand-sized unconsolidated sediment GIS file.
static int nDoTimeUnits(string const *)
This finds time units in a string.
static void AnnounceReadRasterFiles(void)
Now reading raster GIS files.
string m_strCMEDir
The CME folder.
bool m_bMeanWaveEnergySave
Save mean wave energy raster GIS files?
ofstream BeachSedimentNetChangeTSStream
Beach sediment net change (erosion - deposition) time series file output stream.
double m_dSimElapsed
Time simulated so far, in hours.
static double dGetTimeMultiplier(string const *)
Given a string containing time units, this returns the appropriate multiplier.
bool m_bCoastCurvatureSave
Save coastline-curvature vector GIS files?
void AnnounceReadBasementDEM(void) const
Tells the user that we are now reading the DEM file.
bool m_bBreakingWaveHeightSave
Save breaking wave height raster GIS files?
string m_strMailAddress
An email addresx to which to send end-of-simulation messages.
bool m_bPolygonNodeSave
Save polygon node vector GIS files?
string strListTSFiles(void) const
Return a space-separated string containing the names of the time series output files.
bool m_bFloodSetupSurgeTSSave
Save the flood setup surge time series file? TODO 007 Does this work correctly?
bool m_bTotalPotentialPlatformErosionSave
Save total potential shore platform erosion raster GIS files?
bool m_bWaveEnergySinceCollapseSave
Save wave energy since cliff collapse raster GIS files?
static void AnnounceStart(void)
Tells the user that we have started the simulation.
ofstream CliffCollapseErosionTSStream
Cliff collapse erosion time series file output stream.
bool m_bPotentialBeachErosionSave
Save potential beach (unconsolidated sediment) erosion raster GIS files?
static bool bParseDate(string const *, int &, int &, int &)
Parses a date string into days, months, and years, and checks each of them.
string m_strFloodLocationShapefile
The name of the flood loction events shape file.
int m_nSimStartMonth
Start date of the simulation (month)
bool m_bSuspSedSave
Save suspended sediment raster GIS files?
string m_strDurationUnits
The duration units for this simulation.
bool m_bPolygonBoundarySave
Save polygon boundary vector GIS files?
vector< string > m_VstrInitialFineUnconsSedimentFile
The name of the initial fine-sized unconsolidated sediment GIS file.
bool m_bActualPlatformErosionSave
Save actual (supply-limited) shore platform erosion raster GIS files?
int m_nSimStartMin
Start time of the simulation (minutes)
bool bSaveAllRasterGISFiles(void)
The bSaveAllRasterGISFiles member function saves the raster GIS files using values from the RasterGri...
bool m_bHaveFineSediment
Does this simulation consider fine-sized sediment?
string m_strOutPath
Path for all output files.
bool m_bBeachErosionTSSave
Save the beach (unconsolidated sediment) erosion time series file?
static string strGetBuild(void)
Returns the date and time on which the program was compiled.
string m_strTideDataFile
Name of tide data file.
bool m_bTotalPotentialBeachErosionSave
Save total potential beach (unconsolidated sediment) erosion raster GIS files?
int m_nGISSave
The save number for GIS files (can be sequential, or the iteration number)
string m_strInterventionClassFile
Name of intervention class file.
bool m_bSeaMaskSave
Save sea mask raster GIS files?
void CalcTime(double const)
Calculates and displays time elapsed in terms of CPU time and real time, also calculates time per tim...
bool m_bInterventionClassSave
Save intervention class raster GIS files?
int m_nSimStartYear
Start date of the simulation (year)
bool m_bTotalActualBeachErosionSave
Save total actual (supply-limited) beach (unconsolidated sediment) erosion raster GIS files?
bool m_bRasterCoastlineSave
Save raster coastline GIS files?
string m_strDeepWaterWavesInputFile
The name of the deep water wave stations time series file.
static string pstrChangeToBackslash(string const *)
Changes all forward slashes in the input string to backslashes, leaving the original unchanged.
bool m_bInterventionHeightSave
Save intervention height raster GIS files?
ofstream SeaAreaTSStream
Sea area time series file output stream.
void AnnounceReadIHGIS(void) const
Tells the user that we are now reading the Intervention height GIS file.
void AnnounceReadInitialCoarseConsSedGIS(int const) const
Tells the user that we are now reading the initial coarse consolidated sediment depth GIS file.
static string strGetErrorText(int const)
Returns an error message given an error code.
bool m_bSandConsSedSave
Save sand consolidated sediment raster GIS files?
CGeomCoastPolygon * pGetPolygon(int const) const
Returns a pointer to a coast polygon, in down-coast sequence.
bool m_bSedimentInputEventSave
Save sediment inut data?
bool m_bHaveCoarseSediment
Does this simulation consider coarse-sized sediment?
double m_dTimeStep
The length of an iteration (a time step) in hours.
static void AnnounceAllocateMemory(void)
Tells the user that we are now allocating memory.
bool m_bCliffCollapseDepositionTSSave
Save the cliff collapse deposition time series file?
ofstream PlatformErosionTSStream
Shore platform erosion time series file output stream.
bool m_bDeepWaterWaveAngleAndHeightSave
Save deep water wave angle and wave height raster GIS files?
double m_dMaxUserInputWaveHeight
Maximum deep water wave height.
void AnnounceReadInitialFineConsSedGIS(int const) const
Tells the user that we are now reading the initial fine consolidated sediment depth GIS file.
bool m_bBeachProtectionSave
Save beach protection raster GIS files>
static string strDispTime(double const, bool const, bool const)
strDispTime returns a string formatted as h:mm:ss, given a parameter in seconds, with rounding and fr...
bool m_bFineConsSedSave
Save fine consolidated sediment raster GIS files?
bool m_bShadowDowndriftBoundarySave
Save wave shadow downdrift boundary vector GIS files?
string m_strInitialLandformFile
Name of initial landform file.
string m_strInterventionHeightFile
Name of intervention height file.
bool m_bBeachSedimentChangeNetTSSave
Save the beach (unconsolidated sediment) net change time series file?
bool m_bCoarseConsSedSave
Save coarse consolidated sediment raster GIS files?
bool m_bSeaAreaTSSave
Save the sea area time series file?
void CalcProcessStats(void)
This calculates and displays process statistics.
int nGetCoastPolygonSize(void) const
Returns the size of the coast polygon vector.
bool m_bBeachMaskSave
Save beach mask raster GIS files?
bool bOpenLogFile(void)
Opens the log file.
static void AppendEnsureNoGap(vector< CGeom2DIPoint > *, CGeom2DIPoint const *)
Appends a CGeom2DIPoint to a vector<CGeom2DIPoint>, making sure that the new end point touches the pr...
unsigned long m_ulIter
The number of the current iteration (time step)
void AnnounceLicence(void)
Tells the user about the licence.
bool m_bAvgSuspSedSave
Save average suspended sediment raster GIS files?
vector< string > m_VstrInitialCoarseConsSedimentFile
The name of the initial coarse-sized consolidated sediment GIS file.
double m_dSimDuration
Duration of simulation, in hours.
ofstream FloodSetupSurgeTSStream
Flood setup surge time series file output stream.
bool bTimeToQuit(void)
Checks to see if the simulation has gone on too long, amongst other things.
bool bIsInterventionCell(int const, int const) const
Returns true if the cell is an intervention.
bool m_bRasterNormalSave
Save raster coastline-normal GIS files?
void AnnounceProgress(void)
Displays information regarding the progress of the simulation.
double m_dAllCellsDeepWaterWavePeriod
Deep water wave period for all sea cells.
void AnnounceReadLGIS(void) const
Tells the user that we are now reading the Landscape category GIS file.
static void AnnounceReadVectorFiles(void)
Now reading vector GIS files.
double m_dDepthOfClosure
Depth of closure (in m) TODO 007 can be calculated using Hallermeier, R.J. (1978) or Birkemeier (1985...
static void CalcDeanProfile(vector< double > *, double const, double const, double const, bool const, int const, double const)
Calculates a Dean equilibrium profile h(y) = A * y^(2/3) where h(y) is the distance below the highest...
ofstream FineSedSuspensionTSStream
Fine sediment in suspension time series file output stream.
ofstream FloodSetupSurgeRunupTSStream
Flood setup surge runup time series file output stream.
void AnnounceReadTideData(void) const
Now reading tide data file.
double m_dClkLast
Last value returned by clock()
bool m_bCliffCollapseErosionTSSave
Save the cliff collapse erosion time series file?
bool m_bPotentialPlatformErosionSave
Save potential shore platform erosion raster GIS files?
ofstream BeachErosionTSStream
Beach sediment erosion time series file output stream.
void AnnounceReadInitialCoarseUnconsSedGIS(int const) const
Tells the user that we are now reading the initial coarse unconsolidated sediment depth GIS file.
int nHandleCommandLineParams(int, char const *[])
Handles command-line parameters.
ofstream OutStream
The main output file stream.
double m_dDurationUnitsMult
Multiplier for duration units, to convert to hours.
unsigned long m_ulTotTimestep
The target number of iterations.
static vector< string > * VstrSplit(string const *, char const, vector< string > *)
From http://stackoverflow.com/questions/236129/split-a-string-in-c They implement (approximately) Pyt...
bool m_bSedimentInputThisIter
Do we have a sediment input event this iteration?
bool m_bCliffNotchSave
Save cliff notch incision depth vector GIS files?
bool m_bWaveAngleSave
Save wave angle raster GIS files?
void AppendPolygon(CGeomCoastPolygon *)
Appends a pointer to a coast polygon to the coast polygon vector.
vector< CGeomCoastPolygon * > m_pVCoastPolygon
Pointers to coast polygon objects, in down-coast sequence TODO 044 Will need to use global polygon ID...
bool m_bLocalSlopeSave
Save local slope raster GIS files?
This file contains global definitions for CoastalME.
string const TIME_SERIES_CLIFF_COLLAPSE_DEPOSITION_CODE
string const READING_UNCONS_SAND_SEDIMENT_FILE
string const TIME_SERIES_SUSPENDED_SEDIMENT_CODE
string const RASTER_POTENTIAL_PLATFORM_EROSION_MASK_CODE
string const RASTER_SEA_DEPTH_NAME
int const RTN_ERR_READING_SEDIMENT_INPUT_EVENT
int const RTN_ERR_CLIFFNOTCH
string const TIME_SERIES_PLATFORM_EROSION_CODE
int const RTN_ERR_NO_TOP_LAYER
string const RASTER_COARSE_CONS_CODE
string const VECTOR_POLYGON_NODE_CODE
int const RTN_ERR_GRIDTOLINE
int const RTN_ERR_TIMEUNITS
int const RTN_ERR_NO_SEAWARD_END_OF_PROFILE_2
string const TIME_SERIES_FLOOD_SETUP_SURGE_RUNUP_CODE
string const READING_VECTOR_FILES
string const READING_CONS_FINE_SEDIMENT_FILE
int const RTN_ERR_NOCOAST
int const RTN_ERR_DEMFILE
string const READING_BASEMENT
string const RASTER_ACTIVE_ZONE_CODE
int const RTN_ERR_COAST_CANT_FIND_EDGE_CELL
int const RTN_ERR_CSHORE_FILE_INPUT
string const RASTER_SAND_CONS_CODE
string const TIME_SERIES_FLOOD_SETUP_SURGE_CODE
int const RTN_ERR_MEMALLOC
int const RTN_ERR_SCAPE_SHAPE_FUNCTION_FILE
int const RTN_ERR_WAVESTATION_LOCATION
int const RTN_ERR_LOGFILE
string const RASTER_COAST_NORMAL_CODE
string const RASTER_AVG_SUSP_SED_CODE
string const TIME_SERIES_STILL_WATER_LEVEL_NAME
string const RASTER_COAST_CODE
int const RTN_ERR_SHADOW_ZONE_FLOOD_START_POINT
string const RASTER_SEDIMENT_INPUT_EVENT_CODE
string const VECTOR_WAVE_ENERGY_SINCE_COLLAPSE_CODE
string const RASTER_WAVE_ORIENTATION_CODE
int const RTN_ERR_EDGE_OF_GRID
string const READING_CONS_SAND_SEDIMENT_FILE
int const RTN_ERR_GRIDCREATE
int const RTN_ERR_RASTER_GIS_OUT_FORMAT
string const TIME_SERIES_BEACH_EROSION_NAME
int const RTN_ERR_LANDFORM_TO_GRID
int const RTN_ERR_RASTER_FILE_WRITE
string const INITIALIZING_NOTICE
string const RASTER_COARSE_UNCONS_CODE
int const RTN_ERR_BADPARAM
string const READING_RASTER_FILES
char const PATH_SEPARATOR
int const RTN_ERR_SHADOW_ZONE_FLOOD_FILL_NOGRID
string const VECTOR_INVALID_NORMALS_CODE
string const RASTER_BASEMENT_ELEVATION_CODE
int const RTN_ERR_PROFILEWRITE
string const RASTER_WAVE_HEIGHT_CODE
string const RASTER_INTERVENTION_CLASS_CODE
string const RASTER_POTENTIAL_PLATFORM_EROSION_CODE
int const RTN_ERR_WAVE_INTERPOLATION_LOOKUP
string const RASTER_POTENTIAL_BEACH_EROSION_CODE
string const READING_CONS_COARSE_SEDIMENT_FILE
string const READING_TIDE_DATA_FILE
int const RTN_ERR_RASTER_FILE_READ
string const VECTOR_MEAN_WAVE_ENERGY_CODE
string const READING_SCAPE_SHAPE_FUNCTION_FILE
int const RTN_ERR_CSHORE_ERROR
string const TIME_SERIES_BEACH_DEPOSITION_NAME
string const READING_INTERVENTION_CLASS_FILE
bool bFPIsEqual(const T d1, const T d2, const T dEpsilon)
int const RTN_ERR_PROFILESPACING
string const READING_UNCONS_COARSE_SEDIMENT_FILE
string const READING_DEEP_WATER_WAVE_FILE
int const RTN_ERR_BOUNDING_BOX
string const TIME_SERIES_CLIFF_COLLAPSE_NET_CODE
int const RTN_ERR_OPEN_DEEP_WATER_WAVE_DATA
int const RTN_ERR_RUNDATA
int const RTN_ERR_SEDIMENT_INPUT_EVENT_LOCATION
string const RASTER_TOTAL_ACTUAL_BEACH_EROSION_CODE
string const INITIALIZING
string const VECTOR_NORMALS_CODE
int const CLOCK_CHECK_ITERATION
string const RASTER_BEACH_DEPOSITION_CODE
string const FINAL_OUTPUT
string const RASTER_TOTAL_BEACH_DEPOSITION_CODE
int const RTN_ERR_NO_SEAWARD_END_OF_PROFILE_1
string const TIME_SERIES_BEACH_CHANGE_NET_NAME
int const RTN_ERR_NO_ADJACENT_POLYGON
string const VECTOR_DEEP_WATER_WAVE_ANGLE_AND_HEIGHT_CODE
string const READING_LANDFORM_FILE
int const RTN_ERR_READING_CSHORE_FILE_OUTPUT
string const RASTER_BEACH_PROTECTION_CODE
string const RASTER_TOTAL_POTENTIAL_PLATFORM_EROSION_CODE
int const RTN_ERR_CLIFF_NOT_IN_POLYGON
string const TIME_SERIES_CLIFF_COLLAPSE_EROSION_CODE
string const PROGRAM_NAME
int const RTN_ERR_VECTOR_FILE_READ
string const RASTER_BEACH_MASK_CODE
int const RTN_ERR_NOSEACELLS
int const RTN_ERR_VECTOR_GIS_OUT_FORMAT
string const RASTER_AVG_WAVE_HEIGHT_CODE
string const READING_INTERVENTION_HEIGHT_FILE
string const TIME_SERIES_BEACH_EROSION_CODE
string const RASTER_TOTAL_POTENTIAL_BEACH_EROSION_CODE
string const RASTER_AVG_SEA_DEPTH_CODE
int const RTN_ERR_NO_PROFILES_2
int const RTN_ERR_PROFILE_ENDPOINT_IS_INLAND
int const RTN_ERR_NO_SEAWARD_END_OF_PROFILE_4
string const RASTER_SAND_UNCONS_CODE
string const RUN_END_NOTICE
string const TIME_SERIES_PLATFORM_EROSION_NAME
int const RTN_ERR_BAD_MULTILINE
string const READING_SED_INPUT_EVENT_FILE
int const RTN_ERR_TEXT_FILE_WRITE
string const VECTOR_CLIFF_NOTCH_SIZE_CODE
string const RASTER_LANDFORM_CODE
int const RTN_ERR_VECTOR_FILE_WRITE
string const TIME_SERIES_CLIFF_COLLAPSE_NET_NAME
string const RASTER_TOTAL_ACTUAL_PLATFORM_EROSION_CODE
int const RTN_ERR_READING_DEEP_WATER_WAVE_DATA
string const RASTER_ACTUAL_PLATFORM_EROSION_CODE
string const VECTOR_BREAKING_WAVE_HEIGHT_CODE
string const TIME_SERIES_CLIFF_COLLAPSE_EROSION_NAME
int const RTN_ERR_NO_PROFILES_1
unsigned long const SEDIMENT_INPUT_EVENT_ERROR
int const RTN_ERR_TIDEDATAFILE
string const RASTER_SUSP_SED_CODE
int const RTN_ERR_CANNOT_INSERT_POINT
string const VECTOR_SHADOW_BOUNDARY_CODE
string const VECTOR_COAST_CURVATURE_CODE
string const TIME_SERIES_SEA_AREA_NAME
int const RTN_ERR_CLIFFDEPOSIT
int const RTN_ERR_UNKNOWN
string const READING_SUSPENDED_SEDIMENT_FILE
int const RTN_ERR_CANNOT_ASSIGN_COASTAL_LANDFORM
string const READING_FLOOD_LOCATION
int const RTN_ERR_OUTFILE
string const ALLOCATE_MEMORY
string const RASTER_LOCAL_SLOPE_CODE
string const TIME_SERIES_SUSPENDED_SEDIMENT_NAME
int const RTN_ERR_NO_SOLUTION_FOR_ENDPOINT
string const TIME_SERIES_CLIFF_COLLAPSE_DEPOSITION_NAME
string const RASTER_FINE_CONS_CODE
string const VECTOR_POLYGON_BOUNDARY_CODE
string const RASTER_FINE_UNCONS_CODE
string const TIME_SERIES_STILL_WATER_LEVEL_CODE
string const RASTER_SEDIMENT_TOP_CODE
string const VECTOR_WAVE_ANGLE_AND_HEIGHT_CODE
int const RTN_ERR_PROFILE_ENDPOINT_AT_GRID_EDGE
int const RTN_ERR_TRACING_COAST
int const RTN_ERR_SEDIMENT_INPUT_EVENT
int const RTN_ERR_CSHORE_EMPTY_PROFILE
string const VECTOR_AVG_WAVE_ANGLE_AND_HEIGHT_CODE
string const TIME_SERIES_BEACH_CHANGE_NET_CODE
string const RASTER_INTERVENTION_HEIGHT_CODE
string const TIME_SERIES_BEACH_DEPOSITION_CODE
string const READING_UNCONS_FINE_SEDIMENT_FILE
string const START_NOTICE
string const RASTER_POLYGON_CODE
string const RASTER_ACTUAL_BEACH_EROSION_CODE
string const RASTER_INUNDATION_MASK_CODE
int const RTN_ERR_NO_SEAWARD_END_OF_PROFILE_3
string const VECTOR_COAST_CODE
string const TIME_SERIES_SEA_AREA_CODE
int const RTN_ERR_LINETOGRID
string const GDAL_DRIVERS
string const ERROR_NOTICE
int const RTN_ERR_NO_CELL_UNDER_COASTLINE
int const LF_CAT_INTERVENTION
string const RASTER_TOP_CODE
int const RTN_ERR_TIMESERIES_FILE_WRITE
string const VECTOR_DOWNDRIFT_BOUNDARY_CODE
Contains CRWCoast definitions.
Contains CSimulation definitions.
double dRound(double const d)
Correctly rounds doubles.
bool bIsStringValidInt(string &str)
Checks to see if a string can be read as a valid integer, from https://stackoverflow....
int nRound(double const d)
Version of the above that returns an int.