31#include <sys/resource.h>
71using std::resetiosflags;
73using std::setprecision;
80using std::stringstream;
103 if ((!isatty(fileno(stdout))) || (!isatty(fileno(stderr))))
108 for (
int i = 1; i < nArg; i++)
110 string strArg = pcArgv[i];
118 if (strArg.find(
"--gdal") != string::npos)
124 for (
int j = 0; j < GDALGetDriverCount(); j++)
126 GDALDriverH hDriver = GDALGetDriver(j);
128 string strTmp(GDALGetDriverShortName(hDriver));
130 strTmp.append(GDALGetDriverLongName(hDriver));
132 cout << strTmp << endl;
140 if (strArg.find(
"--about") != string::npos)
143 cout <<
ABOUT << endl;
151 if (strArg.find(
"--home") != string::npos)
157 size_t const pos = strArg.find(
'=');
160 if (pos != string::npos)
169 cout <<
"No '=' found in the input string" << endl;
179 cout <<
USAGE << endl;
210 if (
static_cast<clock_t
>(-1) == clock())
238 if (0 != GetModuleFileName(NULL, szBuf,
BUF_SIZE))
248 if (-1 != readlink(
"/proc/self/exe", szBuf,
BUF_SIZE))
262 int const nPos =
static_cast<int>(strTmp.find_last_of(
PATH_SEPARATOR));
274 cout <<
LINE << endl;
312 return 24 * 30.416667;
367 if (strIn->find(
"hour") != string::npos)
370 else if (strIn->find(
"day") != string::npos)
373 else if (strIn->find(
"month") != string::npos)
376 else if (strIn->find(
"year") != string::npos)
390 LogStream.open(
"/dev/null", ios::out | ios::trunc);
391 cout <<
"Warning: log file is not writting" << endl;
400 cerr <<
ERR <<
"cannot open " <<
m_strLogFile <<
" for output" << endl;
919 if (strTmp.size() > 2)
920 strTmp.resize(strTmp.size() - 2);
1001 strTmp.append(
", ");
1007 strTmp.append(
", ");
1013 strTmp.append(
", ");
1019 strTmp.append(
", ");
1023 if (strTmp.size() > 2)
1024 strTmp.resize(strTmp.size() - 2);
1039 strTmp.append(
", ");
1045 strTmp.append(
", ");
1051 strTmp.append(
", ");
1057 strTmp.append(
", ");
1063 strTmp.append(
", ");
1069 strTmp.append(
", ");
1075 strTmp.append(
", ");
1081 strTmp.append(
", ");
1087 strTmp.append(
", ");
1093 strTmp.append(
", ");
1099 strTmp.append(
", ");
1105 strTmp.append(
", ");
1109 if (strTmp.size() > 2)
1110 strTmp.resize(strTmp.size() - 2);
1127 strTSFile.append(
CSVEXT);
1135 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1145 strTSFile.append(
CSVEXT);
1153 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1163 strTSFile.append(
CSVEXT);
1171 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1181 strTSFile.append(
CSVEXT);
1189 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1199 strTSFile.append(
CSVEXT);
1207 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1217 strTSFile.append(
CSVEXT);
1225 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1235 strTSFile.append(
CSVEXT);
1243 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1253 strTSFile.append(
CSVEXT);
1261 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1271 strTSFile.append(
CSVEXT);
1279 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1289 strTSFile.append(
CSVEXT);
1297 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1307 strTSFile.append(
CSVEXT);
1315 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1325 strTSFile.append(
CSVEXT);
1333 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1374 string strComputerName;
1378 strComputerName = getenv(
"COMPUTERNAME");
1384 strComputerName = szHostName;
1386 if (strComputerName.empty())
1387 strComputerName =
"Unknown Computer";
1391 return strComputerName;
1399 if (
static_cast<clock_t
>(-1) == clock())
1402 LogStream <<
"CPU time not available" << endl;
1408 double dClkThis =
static_cast<double>(clock());
1409 dClkThis -= CLOCK_T_MIN;
1421 <<
" before rollover=" << (CLOCK_T_RANGE + 1 -
m_dClkLast) << endl
1423 <<
" after rollover=" << dClkThis << endl
1425 <<
" ADDED=" << (CLOCK_T_RANGE + 1 -
m_dClkLast + dClkThis) << endl;
1464 double const dDuration =
m_dCPUClock / CLOCKS_PER_SEC;
1471 double const dPerTimestep = dDuration /
static_cast<double>(
m_ulTotTimestep);
1474 OutStream << fixed << setprecision(4) <<
" (" << dPerTimestep <<
" per timestep)" << endl;
1475 LogStream << fixed << setprecision(4) <<
" (" << dPerTimestep <<
" per timestep)" << endl;
1478 OutStream << resetiosflags(ios::floatfield);
1479 OutStream << fixed << setprecision(0) <<
"In terms of CPU time, this is ";
1480 LogStream << resetiosflags(ios::floatfield);
1481 LogStream << fixed << setprecision(0) <<
"In terms of CPU time, this is ";
1483 if (dDuration > dRunLength)
1485 OutStream << dDuration / dRunLength <<
" x slower than reality" << endl;
1486 LogStream << dDuration / dRunLength <<
" x slower than reality" << endl;
1491 OutStream << dRunLength / dDuration <<
" x faster than reality" << endl;
1492 LogStream << dRunLength / dDuration <<
" x faster than reality" << endl;
1504 double const dPerTimestep = dDuration /
static_cast<double>(
m_ulTotTimestep);
1507 OutStream << resetiosflags(ios::floatfield);
1508 OutStream <<
" (" << fixed << setprecision(4) << dPerTimestep <<
" per timestep)" << endl;
1509 LogStream << resetiosflags(ios::floatfield);
1510 LogStream <<
" (" << fixed << setprecision(4) << dPerTimestep <<
" per timestep)" << endl;
1513 OutStream << fixed << setprecision(0) <<
"In terms of run time, this is ";
1514 LogStream << fixed << setprecision(0) <<
"In terms of run time, this is ";
1516 if (dDuration > dRunLength)
1518 OutStream << dDuration / dRunLength <<
" x slower than reality" << endl;
1519 LogStream << dDuration / dRunLength <<
" x slower than reality" << endl;
1524 OutStream << dRunLength / dDuration <<
" x faster than reality" << endl;
1525 LogStream << dRunLength / dDuration <<
" x faster than reality" << endl;
1535 double dTmpTime =
tMax(dTimeIn, 0.0);
1540 double const dHoursInYear = 24 * 365;
1541 double const dHoursInDay = 24;
1544 if (dTmpTime >= dHoursInYear)
1546 double const dYears = floor(dTmpTime / dHoursInYear);
1547 dTmpTime -= (dYears * dHoursInYear);
1549 strTime = to_string(
static_cast<int>(dYears));
1550 strTime.append(
"y ");
1557 if (dTmpTime >= dHoursInDay)
1559 double const dJDays = floor(dTmpTime / dHoursInDay);
1560 dTmpTime -= (dJDays * dHoursInDay);
1562 stringstream ststrTmp;
1563 ststrTmp << FillToWidth('0', 3) << static_cast<int>(dJDays);
1564 strTime.append(ststrTmp.str());
1565 strTime.append(
"d ");
1569 strTime.append(
"000d ");
1572 stringstream ststrTmp;
1573 ststrTmp << FillToWidth('0', 2) << static_cast<int>(dTmpTime);
1574 strTime.append(ststrTmp.str());
1575 strTime.append(
"h");
1586 double dTime =
tMax(dTimeIn, 0.0);
1593 unsigned long ulTimeIn =
static_cast<unsigned long>(floor(dTime));
1594 dTime -=
static_cast<double>(ulTimeIn);
1597 if (ulTimeIn >= 3600)
1600 unsigned long const ulHours = ulTimeIn / 3600ul;
1601 ulTimeIn -= (ulHours * 3600ul);
1603 strTime = to_string(ulHours);
1604 strTime.append(
":");
1614 unsigned long const ulMins = ulTimeIn / 60ul;
1615 ulTimeIn -= (ulMins * 60ul);
1617 stringstream ststrTmp;
1618 ststrTmp << FillToWidth(
'0', 2) << ulMins;
1619 strTime.append(ststrTmp.str());
1620 strTime.append(
":");
1624 strTime.append(
"00:");
1627 stringstream ststrTmp;
1628 ststrTmp << FillToWidth(
'0', 2) << ulTimeIn;
1629 strTime.append(ststrTmp.str());
1634 strTime.append(
".");
1636 ststrTmp.str(
string());
1637 ststrTmp << FillToWidth('0', 2) << static_cast<unsigned long>(dTime * 100);
1638 strTime.append(ststrTmp.str());
1649 string strBuild(
"(");
1650 strBuild.append(__TIME__);
1651 strBuild.append(
" ");
1652 strBuild.append(__DATE__);
1654 strBuild.append(
" DEBUG");
1656 strBuild.append(
" build)");
1666 if (isatty(fileno(stdout)))
1669 static double sdElapsed = 0;
1670 static double sdToGo = 0;
1671 time_t
const tNow = time(
nullptr);
1680 cout <<
"% (elapsed " <<
strDispTime(sdElapsed,
false,
false) <<
" remaining ";
1682 cout <<
strDispTime(sdToGo,
false,
false) <<
") ";
1686 cout << setw(9) <<
"GIS" + to_string(
m_nGISSave);
1689 cout << setw(9) <<
"SED INPUT";
1692 cout << setw(9) <<
SPACE;
1703 string const NA =
"Not available";
1706 OutStream <<
"Process statistics" << endl;
1707 OutStream <<
"------------------" << endl;
1711 OSVERSIONINFOEX osvi;
1712 BOOL bOsVersionInfoEx;
1714 ZeroMemory(&osvi,
sizeof(OSVERSIONINFOEX));
1715 osvi.dwOSVersionInfoSize =
sizeof(OSVERSIONINFOEX);
1717 if (!(bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO*)&osvi)))
1720 osvi.dwOSVersionInfoSize =
sizeof(OSVERSIONINFO);
1722 if (!GetVersionEx((OSVERSIONINFO*)&osvi))
1733 switch (osvi.dwPlatformId)
1735 case VER_PLATFORM_WIN32_NT:
1736 if (osvi.dwMajorVersion <= 4)
1739 else if (5 == osvi.dwMajorVersion && 0 == osvi.dwMinorVersion)
1742 else if (5 == osvi.dwMajorVersion && 1 == osvi.dwMinorVersion)
1745 else if (6 == osvi.dwMajorVersion && 0 == osvi.dwMinorVersion)
1748 else if (6 == osvi.dwMajorVersion && 1 == osvi.dwMinorVersion)
1751 else if (6 == osvi.dwMajorVersion && 2 == osvi.dwMinorVersion)
1754 else if (6 == osvi.dwMajorVersion && 3 == osvi.dwMinorVersion)
1757 else if (10 == osvi.dwMajorVersion && 0 == osvi.dwMinorVersion)
1760 else if (11 == osvi.dwMajorVersion && 0 == osvi.dwMinorVersion)
1764 OutStream <<
"unknown Windows version ";
1767 if (osvi.dwMajorVersion <= 4)
1768 OutStream <<
"version " << osvi.dwMajorVersion <<
"." << osvi.dwMinorVersion <<
" " << osvi.szCSDVersion <<
" (Build " << (osvi.dwBuildNumber & 0xFFFF) <<
")" << endl;
1771 OutStream << osvi.szCSDVersion <<
" (Build " << (osvi.dwBuildNumber & 0xFFFF) <<
")" << endl;
1775 case VER_PLATFORM_WIN32_WINDOWS:
1776 if (4 == osvi.dwMajorVersion && 0 == osvi.dwMinorVersion)
1780 if (
'C' == osvi.szCSDVersion[1] ||
'B' == osvi.szCSDVersion[1])
1786 else if (4 == osvi.dwMajorVersion && 10 == osvi.dwMinorVersion)
1790 if (
'A' == osvi.szCSDVersion[1])
1796 else if (4 == osvi.dwMajorVersion && 90 == osvi.dwMinorVersion)
1800 OutStream <<
"unknown 16-bit Windows version " << endl;
1804 case VER_PLATFORM_WIN32s:
1810 if (VER_PLATFORM_WIN32_NT == osvi.dwPlatformId)
1812 FILETIME ftCreate, ftExit, ftKernel, ftUser;
1814 if (GetProcessTimes(GetCurrentProcess(), &ftCreate, &ftExit, &ftKernel, &ftUser))
1817 ul.LowPart = ftUser.dwLowDateTime;
1818 ul.HighPart = ftUser.dwHighDateTime;
1819 OutStream <<
"Time spent executing user code \t: " <<
strDispTime(
static_cast<double>(ul.QuadPart) * 1e-7,
false) << endl;
1820 ul.LowPart = ftKernel.dwLowDateTime;
1821 ul.HighPart = ftKernel.dwHighDateTime;
1822 OutStream <<
"Time spent executing kernel code \t: " <<
strDispTime(
static_cast<double>(ul.QuadPart) * 1e-7,
false) << endl;
1827 OutStream <<
"Process timings \t: " << NA << endl;
1830 HINSTANCE hDLL = LoadLibrary(
"psapi.dll");
1835 typedef BOOL(__stdcall * DLLPROC)(HANDLE, PPROCESS_MEMORY_COUNTERS, DWORD);
1839 ProcAdd = (DLLPROC)GetProcAddress(hDLL,
"GetProcessMemoryInfo");
1844 PROCESS_MEMORY_COUNTERS pmc;
1847 if ((ProcAdd)(GetCurrentProcess(), &pmc,
sizeof(pmc)))
1849 OutStream <<
"Peak working set size \t: " << pmc.PeakWorkingSetSize / (1024.0 * 1024.0) <<
" Mb" << endl;
1850 OutStream <<
"Current working set size \t: " << pmc.WorkingSetSize / (1024.0 * 1024.0) <<
" Mb" << endl;
1851 OutStream <<
"Peak paged pool usage \t: " << pmc.QuotaPeakPagedPoolUsage / (1024.0 * 1024.0) <<
" Mb" << endl;
1852 OutStream <<
"Current paged pool usage \t: " << pmc.QuotaPagedPoolUsage / (1024.0 * 1024.0) <<
" Mb" << endl;
1853 OutStream <<
"Peak non-paged pool usage \t: " << pmc.QuotaPeakNonPagedPoolUsage / (1024.0 * 1024.0) <<
" Mb" << endl;
1854 OutStream <<
"Current non-paged pool usage \t: " << pmc.QuotaNonPagedPoolUsage / (1024.0 * 1024.0) <<
" Mb" << endl;
1855 OutStream <<
"Peak pagefile usage \t: " << pmc.PeakPagefileUsage / (1024.0 * 1024.0) <<
" Mb" << endl;
1856 OutStream <<
"Current pagefile usage \t: " << pmc.PagefileUsage / (1024.0 * 1024.0) <<
" Mb" << endl;
1857 OutStream <<
"No. of page faults \t: " << pmc.PageFaultCount << endl;
1865#elif defined __GNUG__
1868 if (getrusage(RUSAGE_SELF, &ru) >= 0)
1870 OutStream <<
"Time spent executing user code \t: " <<
strDispTime(
static_cast<double>(ru.ru_utime.tv_sec),
false,
true) << endl;
1872 OutStream <<
"Time spent executing kernel code \t: " <<
strDispTime(
static_cast<double>(ru.ru_stime.tv_sec),
false,
true) << endl;
1878 OutStream <<
"No. of page faults not requiring physical I/O\t: " << ru.ru_minflt << endl;
1879 OutStream <<
"No. of page faults requiring physical I/O \t: " << ru.ru_majflt << endl;
1884 OutStream <<
"No. of voluntary context switches \t: " << ru.ru_nvcsw << endl;
1885 OutStream <<
"No. of involuntary context switches \t: " << ru.ru_nivcsw << endl;
1900 if (0 == omp_get_thread_num())
1902 OutStream <<
"Number of OpenMP threads \t: " << omp_get_num_threads() << endl;
1903 OutStream <<
"Number of OpenMP processors \t: " << omp_get_num_procs() << endl;
1905 LogStream <<
"Number of OpenMP threads \t: " << omp_get_num_threads() << endl;
1906 LogStream <<
"Number of OpenMP processors \t: " << omp_get_num_procs() << endl;
1912 struct tm* ptmRunTime = gmtime(&tRunTime);
1914 OutStream <<
"Time required for simulation \t: " << put_time(ptmRunTime,
"%T") << endl;
1915 LogStream <<
"Time required for simulation \t: " << put_time(ptmRunTime,
"%T") << endl;
1917 double const dSpeedUp =
m_dSimDuration * 3600 /
static_cast<double>(tRunTime);
1919 OutStream <<
"Time simulated / time required for simulation\t: " << dSpeedUp <<
" x faster than reality" << endl;
1922 LogStream <<
"Time simulated / time required for simulation\t: " << dSpeedUp <<
" x faster than reality" << endl;
1935 strErr =
"run ended by user";
1939 strErr =
"error in command-line parameter";
1943 strErr =
"error reading initialization file";
1947 strErr =
"error in directory name";
1951 strErr =
"error reading run details file";
1955 strErr =
"error reading SCAPE shape function file";
1959 strErr =
"error reading tide data file";
1963 strErr =
"error creating log file";
1967 strErr =
"error creating text output file";
1971 strErr =
"error creating time series file";
1975 strErr =
"error reading initial DEM file";
1979 strErr =
"error reading raster GIS file";
1983 strErr =
"error reading vector GIS file";
1987 strErr =
"error allocating memory";
1991 strErr =
"problem with raster GIS output format";
1995 strErr =
"problem with vector GIS output format";
1999 strErr =
"error writing text output file";
2003 strErr =
"error writing raster GIS output file";
2007 strErr =
"error writing vector GIS output file";
2011 strErr =
"error writing time series output file";
2015 strErr =
"error putting linear feature onto raster grid";
2019 strErr =
"no sea cells found";
2023 strErr =
"error when searching grid for linear feature";
2027 strErr =
"error tracing coastline on grid";
2031 strErr =
"no coastlines found. Is the SWL correct?";
2035 strErr =
"error writing coastline-normal profiles";
2039 strErr =
"error in time units";
2043 strErr =
"no solution when finding end point for coastline-normal line";
2050 strErr =
"end point for coastline-normal line is not in the contiguous sea";
2054 strErr =
"cliff notch is above sediment top elevation";
2058 strErr =
"unable to deposit sediment from cliff collapse";
2062 strErr =
"coastline-normal profiles are too closely spaced";
2066 strErr =
"no coastline-normal profiles created, check the SWL";
2070 strErr =
"no coastline-normal profiles created during rasterization";
2074 strErr =
"hit grid edge when eroding beach";
2078 strErr =
"could not locate seaward end of profile when creating Dean profile during estimation of beach erosion";
2082 strErr =
"could not locate seaward end of profile when creating Dean profile for beach erosion";
2086 strErr =
"could not locate seaward end of profile when creating Dean profile for beach deposition (up-coast)";
2090 strErr =
"could not locate seaward end of profile when creating Dean profile for beach deposition (down-coast)";
2094 strErr =
"updating grid with landforms";
2098 strErr =
"no top layer of sediment";
2102 strErr =
"problem with polygon-to-polygon sediment routing sequence";
2106 strErr =
"inconsistent multiline";
2110 strErr =
"cannot insert point into multiline";
2114 strErr =
"cannot assign coastal landform";
2118 strErr =
"start point for cell-by-cell fill of wave shadow zone is outside grid";
2122 strErr =
"could not find start point for cell-by-cell fill of wave shadow zone";
2126 strErr =
"empty profile during during CShore wave propagation";
2130 strErr =
"creating file for CShore input";
2134 strErr =
"reading CShore output file";
2138 strErr =
"during wave interpolation lookup";
2142 strErr =
"while running GDALGridCreate()";
2146 strErr =
"cannot find edge cell while constructing grid-edge profile";
2150 strErr =
"CShore did not finish correctly";
2154 strErr =
"Could not find cell under coastline";
2158 strErr =
"opening deep sea wave time series file";
2162 strErr =
"reading deep sea wave time series file";
2166 strErr =
"finding edges of the bounding box";
2170 strErr =
"reading sediment input event time series file";
2174 strErr =
"simulating sediment input event";
2178 strErr =
"location of sediment input event is outside grod";
2182 strErr =
"location of wavestation is outside grid";
2186 strErr =
"cliff not in polygon";
2190 strErr =
"unknown error";
2195 strErr =
"totally unknown error";
2250 if (isatty(fileno(stdout)))
2265 string strCmd(
"echo \"");
2267 stringstream ststrTmp;
2268 ststrTmp << put_time(localtime(&
m_tSysEndTime),
"%T on %A %d %B %Y") << endl;
2274 strCmd.append(
"Simulation ");
2276 strCmd.append(
", running on ");
2278 strCmd.append(
", completed normally at ");
2279 strCmd.append(ststrTmp.str());
2280 strCmd.append(
"\" | mail -s \"");
2282 strCmd.append(
": normal completion\" ");
2289 strCmd.append(
"Simulation ");
2291 strCmd.append(
", running on ");
2293 strCmd.append(
", aborted with error code ");
2294 strCmd.append(to_string(nRtn));
2295 strCmd.append(
": ");
2297 strCmd.append(
" at timestep ");
2298 strCmd.append(to_string(
m_ulIter));
2299 strCmd.append(
" (");
2301 strCmd.append(
").\n\nThis message sent at ");
2302 strCmd.append(ststrTmp.str());
2303 strCmd.append(
"\" | mail -s \"");
2305 strCmd.append(
": ERROR\" ");
2309 int const nRet = system(strCmd.c_str());
2311 if (WEXITSTATUS(nRet) != 0)
2324 string strOut(*strIn);
2325 strOut.replace(strOut.begin(), strOut.end(),
'/',
'\\');
2334 string strOut(*strIn);
2335 strOut.replace(strOut.begin(), strOut.end(),
'\\',
'/');
2345 size_t const nStartpos = strIn->find_first_not_of(
" \t");
2347 if (nStartpos == string::npos)
2351 return strIn->substr(nStartpos);
2359 string strTmp(*strIn);
2362 strTmp.erase(remove(strTmp.begin(), strTmp.end(),
'\r'), strTmp.end());
2365 size_t const nEndpos = strTmp.find_last_not_of(
" \t");
2367 if (nEndpos == string::npos)
2371 return strTmp.substr(0, nEndpos + 1);
2379 string strTmp = *strIn;
2382 strTmp.erase(remove(strTmp.begin(), strTmp.end(),
'\r'), strTmp.end());
2385 size_t nPos = strTmp.find_last_not_of(
" \t");
2387 if (nPos != string::npos)
2388 strTmp.resize(nPos + 1);
2391 nPos = strTmp.find_first_not_of(
" \t");
2393 if (nPos != string::npos)
2394 strTmp = strTmp.substr(nPos);
2404 string strOut = *strIn;
2405 transform(strIn->begin(), strIn->end(), strOut.begin(), tolower);
2424 size_t const nPos = pStrIn->find(*pStrSub);
2426 if (nPos != string::npos)
2429 pStrIn->replace(nPos, pStrSub->size(),
"");
2445 stringstream ss(*s);
2448 while (getline(ss, item, delim))
2451 elems->push_back(item);
2462 vector<string> elems;
2505 int const nX = pPti->
nGetX();
2506 int const nY = pPti->
nGetY();
2507 int const nXLast = pVPtiPoints->back().nGetX();
2508 int const nYLast = pVPtiPoints->back().nGetY();
2509 int const nXDiff = nX - nXLast;
2510 int const nYDiff = nY - nYLast;
2511 int const nXDiffA =
tAbs(nXDiff);
2512 int const nYDiffA =
tAbs(nYDiff);
2513 int const nDiff =
tMax(nXDiffA, nYDiffA);
2523 dXInc =
static_cast<double>(nXDiff) / nDiff;
2526 dYInc =
static_cast<double>(nYDiff) / nDiff;
2528 for (
int n = 1; n < nDiff; n++)
2531 pVPtiPoints->push_back(Pti);
2541void CSimulation::CalcDeanProfile(vector<double>* pdVDeanProfile,
double const dInc,
double const dDeanTopElev,
double const dA,
bool const bDeposition,
int const nSeawardOffset,
double const dStartCellElev)
2543 double dDistFromProfileStart = 0;
2548 pdVDeanProfile->at(0) = dStartCellElev;
2550 for (
int n = 1; n < static_cast<int>(pdVDeanProfile->size()); n++)
2552 if (n <= nSeawardOffset)
2554 pdVDeanProfile->at(n) = dStartCellElev;
2558 double const dDistBelowTop = dA * pow(dDistFromProfileStart,
DEAN_POWER);
2559 pdVDeanProfile->at(n) = dDeanTopElev - dDistBelowTop;
2561 dDistFromProfileStart += dInc;
2569 for (
int n = 0; n < static_cast<int>(pdVDeanProfile->size()); n++)
2571 double const dDistBelowTop = dA * pow(dDistFromProfileStart,
DEAN_POWER);
2572 pdVDeanProfile->at(n) = dDeanTopElev - dDistBelowTop;
2574 dDistFromProfileStart += dInc;
2584 double dTotElevDiff = 0;
2587 for (
int n = 0; n < static_cast<int>(pdVFirstProfile->size()); n++)
2589 if (pbVIsValid->at(n))
2591 double const dProfileDiff = pdVFirstProfile->at(n) - pdVSecondProfile->at(n);
2593 dTotElevDiff += dProfileDiff;
2619 return dTotElevDiff;
2628 dDeepWaterWaveHeight,
2655 m_dDepthOfClosure = (1.75 * dDeepWaterWaveHeight) - (57.9 * dDeepWaterWaveHeight * dDeepWaterWaveHeight / (
m_dG * dDeepWaterPeriod * dDeepWaterPeriod));
2673 if (VstrTmp.size() < 3)
2675 cerr <<
"date string must include day, month, and year '" << strDate <<
"'" << endl;
2682 cerr <<
"invalid integer for day in date '" << strDate <<
"'" << endl;
2686 nDay = stoi(VstrTmp[0]);
2688 if ((nDay < 1) || (nDay > 31))
2690 cerr <<
"day must be between 1 and 31 in date '" << strDate <<
"'" << endl;
2697 cerr <<
"invalid integer for month in date '" << strDate <<
"'" << endl;
2701 nMonth = stoi(VstrTmp[1]);
2703 if ((nMonth < 1) || (nMonth > 12))
2705 cerr <<
"month must be between 1 and 12 in date '" << strDate <<
"'" << endl;
2712 cerr <<
"invalid integer for year in date '" << strDate <<
"'" << endl;
2716 nYear = stoi(VstrTmp[2]);
2720 cerr <<
"year must be > 0 in date '" << strDate <<
"'" << endl;
2734 if (VstrTmp.size() < 3)
2736 cerr <<
"time string must include hours, minutes, and seconds '" << strTime <<
"'" << endl;
2743 cerr <<
"invalid integer for hours in time '" << strTime <<
"'" << endl;
2747 nHour = stoi(VstrTmp[0]);
2749 if ((nHour < 0) || (nHour > 23))
2751 cerr <<
"hour must be between 0 and 23 in time '" << strTime <<
"'" << endl;
2758 cerr <<
"invalid integer for minutes in time '" << strTime <<
"'" << endl;
2762 nMin = stoi(VstrTmp[1]);
2764 if ((nMin < 0) || (nMin > 59))
2766 cerr <<
"minutes must be betwen 0 and 59 in time '" << strTime <<
"'" << endl;
2773 cerr <<
"invalid integer for seconds in time '" << strTime <<
"'" << endl;
2777 nSec = stoi(VstrTmp[2]);
2779 if ((nSec < 0) || (nSec > 59))
2781 cerr <<
"seconds must be between 0 and 59 in time '" << strTime <<
"'" << endl;
2793 unsigned long ulTimeStep = 0;
2799 if (strDate.find(
"hour") != string::npos)
2806 cerr <<
"Error in number of hours '" + strDate +
"' for sediment input event" << endl;
2810 double const dHours = stod(
strTrim(&VstrTmp[0]));
2814 cerr <<
"Sediment input event '" + strDate +
"' occurs after end of simulation" << endl;
2821 else if (strDate.find(
"day") != string::npos)
2828 cerr <<
"Error in number of days '" + strDate +
"' for sediment input event" << endl;
2832 double const dHours = stod(
strTrim(&VstrTmp[0])) * 24;
2836 cerr <<
"Sediment input event '" + strDate +
"' occurs after end of simulation" << endl;
2848 if (VstrTmp.size() < 2)
2850 cerr <<
"Error in time/date '" + strDate +
"' of sediment input event" << endl;
2859 if (!
bParseTime(&VstrTmp[0], nHour, nMin, nSec))
2861 cerr <<
"Error in time '" + VstrTmp[0] +
"' of sediment input event" << endl;
2870 if (!
bParseDate(&VstrTmp[1], nDay, nMonth, nYear))
2872 cerr <<
"Error in date '" + VstrTmp[1] +
"' of sediment input event" << endl;
2877 struct tm tmSimStart = {};
2885 struct tm tmSimEvent = {};
2886 tmSimEvent.tm_sec = nSec;
2887 tmSimEvent.tm_min = nMin;
2888 tmSimEvent.tm_hour = nHour;
2889 tmSimEvent.tm_mday = nDay;
2890 tmSimEvent.tm_mon = nMonth - 1;
2891 tmSimEvent.tm_year = nYear - 1900;
2893 time_t
const tStart = mktime(&tmSimStart);
2894 time_t
const tEvent = mktime(&tmSimEvent);
2896 if (tStart == (time_t)(-1))
2898 cerr <<
"Error in simulation start time/date" << endl;
2902 if (tEvent == (time_t)(-1))
2904 cerr <<
"Error in time/date '" + strDate +
"' of sediment input event" << endl;
2908 double const dHours = difftime(tEvent, tStart) / (60 * 60);
2912 cerr <<
"Sediment input event '" + strDate +
"' occurs before start of simulation" << endl;
2918 cerr <<
"Sediment input event '" + strDate +
"' occurs after end of simulation" << endl;
2922 ulTimeStep =
static_cast<unsigned long>(dHours /
m_dTimeStep);
Contains CGeom2DIPoint definitions.
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
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)
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...
vector< CGeomCoastPolygon * > m_pVCoastPolygon
Pointers to coast polygon objects, in down-coast sequence TODO 044 Will need to use global polygon ID...
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_bRasterNormalProfileSave
Save rasterized coastline-normal profiles GIS files?
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
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)
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 rasterized 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.
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.
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_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.