31 #include <sys/resource.h>
62using std::resetiosflags;
63using std::setiosflags;
64using std::setprecision;
71using std::stringstream;
79using std::inner_product;
92 if ((! isatty(fileno(stdout))) || (! isatty(fileno(stderr))))
97 for (
int i = 1; i < nArg; i++)
99 string strArg = pcArgv[i];
107 if (strArg.find(
"--gdal") != string::npos)
112 for (
int j = 0; j < GDALGetDriverCount(); j++)
114 GDALDriverH hDriver = GDALGetDriver(j);
116 string strTmp(GDALGetDriverShortName(hDriver));
118 strTmp.append(GDALGetDriverLongName(hDriver));
120 cout << strTmp << endl;
128 if (strArg.find(
"--about") != string::npos)
131 cout <<
ABOUT << endl;
139 if (strArg.find(
"--home") != string::npos)
145 size_t pos = strArg.find(
'=');
148 if (pos != string::npos)
157 cout <<
"No '=' found in the input string" << endl;
167 cout <<
USAGE << endl;
197 if (
static_cast<clock_t
>(-1) == clock())
225 if (0 != GetModuleFileName(NULL, szBuf,
BUF_SIZE))
235 if (-1 != readlink(
"/proc/self/exe", szBuf,
BUF_SIZE))
261 cout <<
LINE << endl;
299 return 24 * 30.416667;
354 if (strIn->find(
"hour") != string::npos)
357 else if (strIn->find(
"day") != string::npos)
360 else if (strIn->find(
"month") != string::npos)
363 else if (strIn->find(
"year") != string::npos)
377 LogStream.open(
"/dev/null", ios::out | ios::trunc);
378 cout <<
"Warning: log file is not writting" << endl;
387 cerr <<
ERR <<
"cannot open " <<
m_strLogFile <<
" for output" << endl;
906 if (strTmp.size() > 2)
907 strTmp.resize(strTmp.size() - 2);
1000 strTmp.append(
", ");
1006 strTmp.append(
", ");
1010 if (strTmp.size() > 2)
1011 strTmp.resize(strTmp.size() - 2);
1026 strTmp.append(
", ");
1032 strTmp.append(
", ");
1038 strTmp.append(
", ");
1044 strTmp.append(
", ");
1050 strTmp.append(
", ");
1056 strTmp.append(
", ");
1062 strTmp.append(
", ");
1068 strTmp.append(
", ");
1074 strTmp.append(
", ");
1080 strTmp.append(
", ");
1086 strTmp.append(
", ");
1092 strTmp.append(
", ");
1096 if (strTmp.size() > 2)
1097 strTmp.resize(strTmp.size() - 2);
1114 strTSFile.append(
CSVEXT);
1122 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1132 strTSFile.append(
CSVEXT);
1140 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1150 strTSFile.append(
CSVEXT);
1158 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1168 strTSFile.append(
CSVEXT);
1176 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1186 strTSFile.append(
CSVEXT);
1194 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1204 strTSFile.append(
CSVEXT);
1212 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1222 strTSFile.append(
CSVEXT);
1230 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1240 strTSFile.append(
CSVEXT);
1248 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1258 strTSFile.append(
CSVEXT);
1266 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1276 strTSFile.append(
CSVEXT);
1284 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1294 strTSFile.append(
CSVEXT);
1302 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1312 strTSFile.append(
CSVEXT);
1320 cerr <<
ERR <<
"cannot open " << strTSFile <<
" for output" << endl;
1361 string strComputerName;
1365 strComputerName = getenv(
"COMPUTERNAME");
1371 strComputerName = szHostName;
1373 if (strComputerName.empty())
1374 strComputerName =
"Unknown Computer";
1378 return strComputerName;
1386 if (
static_cast<clock_t
>(-1) == clock())
1389 LogStream <<
"CPU time not available" << endl;
1395 double dClkThis =
static_cast<double>(clock());
1396 dClkThis -= CLOCK_T_MIN;
1408 <<
" before rollover=" << (CLOCK_T_RANGE + 1 -
m_dClkLast) << endl
1410 <<
" after rollover=" << dClkThis << endl
1412 <<
" ADDED=" << (CLOCK_T_RANGE + 1 -
m_dClkLast + dClkThis) << endl;
1457 double dPerTimestep = dDuration /
static_cast<double>(
m_ulTotTimestep);
1460 OutStream << fixed << setprecision(4) <<
" (" << dPerTimestep <<
" per timestep)" << endl;
1461 LogStream << fixed << setprecision(4) <<
" (" << dPerTimestep <<
" per timestep)" << endl;
1464 OutStream << resetiosflags(ios::floatfield);
1465 OutStream << fixed << setprecision(0) <<
"In terms of CPU time, this is ";
1466 LogStream << resetiosflags(ios::floatfield);
1467 LogStream << fixed << setprecision(0) <<
"In terms of CPU time, this is ";
1469 if (dDuration > dRunLength)
1471 OutStream << dDuration / dRunLength <<
" x slower than reality" << endl;
1472 LogStream << dDuration / dRunLength <<
" x slower than reality" << endl;
1477 OutStream << dRunLength / dDuration <<
" x faster than reality" << endl;
1478 LogStream << dRunLength / dDuration <<
" x faster than reality" << endl;
1490 double dPerTimestep = dDuration /
static_cast<double>(
m_ulTotTimestep);
1493 OutStream << resetiosflags(ios::floatfield);
1494 OutStream <<
" (" << fixed << setprecision(4) << dPerTimestep <<
" per timestep)" << endl;
1495 LogStream << resetiosflags(ios::floatfield);
1496 LogStream <<
" (" << fixed << setprecision(4) << dPerTimestep <<
" per timestep)" << endl;
1499 OutStream << fixed << setprecision(0) <<
"In terms of run time, this is ";
1500 LogStream << fixed << setprecision(0) <<
"In terms of run time, this is ";
1502 if (dDuration > dRunLength)
1504 OutStream << dDuration / dRunLength <<
" x slower than reality" << endl;
1505 LogStream << dDuration / dRunLength <<
" x slower than reality" << endl;
1510 OutStream << dRunLength / dDuration <<
" x faster than reality" << endl;
1511 LogStream << dRunLength / dDuration <<
" x faster than reality" << endl;
1521 double dTmpTime =
tMax(dTimeIn, 0.0);
1526 double const dHoursInYear = 24 * 365;
1527 double dHoursInDay = 24;
1530 if (dTmpTime >= dHoursInYear)
1532 double dYears = floor(dTmpTime / dHoursInYear);
1533 dTmpTime -= (dYears * dHoursInYear);
1535 strTime = to_string(
static_cast<int>(dYears));
1536 strTime.append(
"y ");
1543 if (dTmpTime >= dHoursInDay)
1545 double dJDays = floor(dTmpTime / dHoursInDay);
1546 dTmpTime -= (dJDays * dHoursInDay);
1548 stringstream ststrTmp;
1549 ststrTmp << FillToWidth('0', 3) << static_cast<int>(dJDays);
1550 strTime.append(ststrTmp.str());
1551 strTime.append(
"d ");
1555 strTime.append(
"000d ");
1558 stringstream ststrTmp;
1559 ststrTmp << FillToWidth('0', 2) << static_cast<int>(dTmpTime);
1560 strTime.append(ststrTmp.str());
1561 strTime.append(
"h");
1572 double dTime =
tMax(dTimeIn, 0.0);
1579 unsigned long ulTimeIn =
static_cast<unsigned long>(floor(dTime));
1580 dTime -=
static_cast<double>(ulTimeIn);
1583 if (ulTimeIn >= 3600)
1586 unsigned long ulHours = ulTimeIn / 3600ul;
1587 ulTimeIn -= (ulHours * 3600ul);
1589 strTime = to_string(ulHours);
1590 strTime.append(
":");
1600 unsigned long ulMins = ulTimeIn / 60ul;
1601 ulTimeIn -= (ulMins * 60ul);
1603 stringstream ststrTmp;
1604 ststrTmp << FillToWidth(
'0', 2) << ulMins;
1605 strTime.append(ststrTmp.str());
1606 strTime.append(
":");
1610 strTime.append(
"00:");
1613 stringstream ststrTmp;
1614 ststrTmp << FillToWidth(
'0', 2) << ulTimeIn;
1615 strTime.append(ststrTmp.str());
1620 strTime.append(
".");
1622 ststrTmp.str(
string());
1623 ststrTmp << FillToWidth('0', 2) << static_cast<unsigned long>(dTime * 100);
1624 strTime.append(ststrTmp.str());
1635 string strBuild(
"(");
1636 strBuild.append(__TIME__);
1637 strBuild.append(
" ");
1638 strBuild.append(__DATE__);
1640 strBuild.append(
" DEBUG");
1642 strBuild.append(
" build)");
1652 if (isatty(fileno(stdout)))
1655 static double sdElapsed = 0;
1656 static double sdToGo = 0;
1657 time_t tNow = time(
nullptr);
1666 cout <<
"% (elapsed " <<
strDispTime(sdElapsed,
false,
false) <<
" remaining ";
1668 cout <<
strDispTime(sdToGo,
false,
false) <<
") ";
1672 cout << setw(9) <<
"GIS" + to_string(
m_nGISSave);
1675 cout << setw(9) <<
"SED INPUT";
1678 cout << setw(9) <<
SPACE;
1689 string const NA =
"Not available";
1692 OutStream <<
"Process statistics" << endl;
1693 OutStream <<
"------------------" << endl;
1697 OSVERSIONINFOEX osvi;
1698 BOOL bOsVersionInfoEx;
1700 ZeroMemory(&osvi,
sizeof(OSVERSIONINFOEX));
1701 osvi.dwOSVersionInfoSize =
sizeof(OSVERSIONINFOEX);
1703 if (! (bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO *) &osvi)))
1706 osvi.dwOSVersionInfoSize =
sizeof(OSVERSIONINFO);
1708 if (! GetVersionEx((OSVERSIONINFO *) &osvi))
1719 switch (osvi.dwPlatformId)
1721 case VER_PLATFORM_WIN32_NT:
1722 if (osvi.dwMajorVersion <= 4)
1725 else if (5 == osvi.dwMajorVersion && 0 == osvi.dwMinorVersion)
1728 else if (5 == osvi.dwMajorVersion && 1 == osvi.dwMinorVersion)
1731 else if (6 == osvi.dwMajorVersion && 0 == osvi.dwMinorVersion)
1734 else if (6 == osvi.dwMajorVersion && 1 == osvi.dwMinorVersion)
1737 else if (6 == osvi.dwMajorVersion && 2 == osvi.dwMinorVersion)
1740 else if (6 == osvi.dwMajorVersion && 3 == osvi.dwMinorVersion)
1743 else if (10 == osvi.dwMajorVersion && 0 == osvi.dwMinorVersion)
1746 else if (11 == osvi.dwMajorVersion && 0 == osvi.dwMinorVersion)
1750 OutStream <<
"unknown Windows version ";
1753 if (osvi.dwMajorVersion <= 4)
1754 OutStream <<
"version " << osvi.dwMajorVersion <<
"." << osvi.dwMinorVersion <<
" " << osvi.szCSDVersion <<
" (Build " << (osvi.dwBuildNumber& 0xFFFF) <<
")" << endl;
1757 OutStream << osvi.szCSDVersion <<
" (Build " << (osvi.dwBuildNumber& 0xFFFF) <<
")" << endl;
1761 case VER_PLATFORM_WIN32_WINDOWS:
1762 if (4 == osvi.dwMajorVersion && 0 == osvi.dwMinorVersion)
1766 if (
'C' == osvi.szCSDVersion[1] ||
'B' == osvi.szCSDVersion[1])
1772 else if (4 == osvi.dwMajorVersion && 10 == osvi.dwMinorVersion)
1776 if (
'A' == osvi.szCSDVersion[1])
1782 else if (4 == osvi.dwMajorVersion && 90 == osvi.dwMinorVersion)
1786 OutStream <<
"unknown 16-bit Windows version " << endl;
1790 case VER_PLATFORM_WIN32s:
1796 if (VER_PLATFORM_WIN32_NT == osvi.dwPlatformId)
1798 FILETIME ftCreate, ftExit, ftKernel, ftUser;
1800 if (GetProcessTimes(GetCurrentProcess(), &ftCreate, &ftExit, &ftKernel, &ftUser))
1803 ul.LowPart = ftUser.dwLowDateTime;
1804 ul.HighPart = ftUser.dwHighDateTime;
1805 OutStream <<
"Time spent executing user code \t: " <<
strDispTime(
static_cast<double>(ul.QuadPart) * 1e-7,
false) << endl;
1806 ul.LowPart = ftKernel.dwLowDateTime;
1807 ul.HighPart = ftKernel.dwHighDateTime;
1808 OutStream <<
"Time spent executing kernel code \t: " <<
strDispTime(
static_cast<double>(ul.QuadPart) * 1e-7,
false) << endl;
1813 OutStream <<
"Process timings \t: " << NA << endl;
1816 HINSTANCE hDLL = LoadLibrary(
"psapi.dll");
1821 typedef BOOL(__stdcall * DLLPROC)(HANDLE, PPROCESS_MEMORY_COUNTERS, DWORD);
1825 ProcAdd = (DLLPROC)GetProcAddress(hDLL,
"GetProcessMemoryInfo");
1830 PROCESS_MEMORY_COUNTERS pmc;
1833 if ((ProcAdd)(GetCurrentProcess(), &pmc,
sizeof(pmc)))
1835 OutStream <<
"Peak working set size \t: " << pmc.PeakWorkingSetSize / (1024.0 * 1024.0) <<
" Mb" << endl;
1836 OutStream <<
"Current working set size \t: " << pmc.WorkingSetSize / (1024.0 * 1024.0) <<
" Mb" << endl;
1837 OutStream <<
"Peak paged pool usage \t: " << pmc.QuotaPeakPagedPoolUsage / (1024.0 * 1024.0) <<
" Mb" << endl;
1838 OutStream <<
"Current paged pool usage \t: " << pmc.QuotaPagedPoolUsage / (1024.0 * 1024.0) <<
" Mb" << endl;
1839 OutStream <<
"Peak non-paged pool usage \t: " << pmc.QuotaPeakNonPagedPoolUsage / (1024.0 * 1024.0) <<
" Mb" << endl;
1840 OutStream <<
"Current non-paged pool usage \t: " << pmc.QuotaNonPagedPoolUsage / (1024.0 * 1024.0) <<
" Mb" << endl;
1841 OutStream <<
"Peak pagefile usage \t: " << pmc.PeakPagefileUsage / (1024.0 * 1024.0) <<
" Mb" << endl;
1842 OutStream <<
"Current pagefile usage \t: " << pmc.PagefileUsage / (1024.0 * 1024.0) <<
" Mb" << endl;
1843 OutStream <<
"No. of page faults \t: " << pmc.PageFaultCount << endl;
1851#elif defined __GNUG__
1854 if (getrusage(RUSAGE_SELF, &ru) >= 0)
1856 OutStream <<
"Time spent executing user code \t: " <<
strDispTime(
static_cast<double>(ru.ru_utime.tv_sec),
false,
true) << endl;
1858 OutStream <<
"Time spent executing kernel code \t: " <<
strDispTime(
static_cast<double>(ru.ru_stime.tv_sec),
false,
true) << endl;
1864 OutStream <<
"No. of page faults not requiring physical I/O\t: " << ru.ru_minflt << endl;
1865 OutStream <<
"No. of page faults requiring physical I/O \t: " << ru.ru_majflt << endl;
1870 OutStream <<
"No. of voluntary context switches \t: " << ru.ru_nvcsw << endl;
1871 OutStream <<
"No. of involuntary context switches \t: " << ru.ru_nivcsw << endl;
1884 #pragma omp parallel
1886 if (0 == omp_get_thread_num())
1888 OutStream <<
"Number of OpenMP threads \t: " << omp_get_num_threads() << endl;
1889 OutStream <<
"Number of OpenMP processors \t: " << omp_get_num_procs() << endl;
1891 LogStream <<
"Number of OpenMP threads \t: " << omp_get_num_threads() << endl;
1892 LogStream <<
"Number of OpenMP processors \t: " << omp_get_num_procs() << endl;
1898 struct tm * ptmRunTime = gmtime(&tRunTime);
1900 OutStream <<
"Time required for simulation \t: " << put_time(ptmRunTime,
"%T") << endl;
1901 LogStream <<
"Time required for simulation \t: " << put_time(ptmRunTime,
"%T") << endl;
1903 double dSpeedUp =
m_dSimDuration * 3600 /
static_cast<double>(tRunTime);
1905 OutStream <<
"Time simulated / time required for simulation\t: " << dSpeedUp <<
" x faster than reality" << endl;
1908 LogStream <<
"Time simulated / time required for simulation\t: " << dSpeedUp <<
" x faster than reality" << endl;
1921 strErr =
"run ended by user";
1925 strErr =
"error in command-line parameter";
1929 strErr =
"error reading initialization file";
1933 strErr =
"error in directory name";
1937 strErr =
"error reading run details file";
1941 strErr =
"error reading SCAPE shape function file";
1945 strErr =
"error reading tide data file";
1949 strErr =
"error creating log file";
1953 strErr =
"error creating text output file";
1957 strErr =
"error creating time series file";
1961 strErr =
"error reading initial DEM file";
1965 strErr =
"error reading raster GIS file";
1969 strErr =
"error reading vector GIS file";
1973 strErr =
"error allocating memory";
1977 strErr =
"problem with raster GIS output format";
1981 strErr =
"problem with vector GIS output format";
1985 strErr =
"error writing text output file";
1989 strErr =
"error writing raster GIS output file";
1993 strErr =
"error writing vector GIS output file";
1997 strErr =
"error writing time series output file";
2001 strErr =
"error putting linear feature onto raster grid";
2005 strErr =
"no sea cells found";
2009 strErr =
"error when searching grid for linear feature";
2013 strErr =
"error tracing coastline on grid";
2017 strErr =
"no coastlines found. Is the SWL correct?";
2021 strErr =
"error writing coastline-normal profiles";
2025 strErr =
"error in time units";
2029 strErr =
"no solution when finding end point for coastline-normal line";
2036 strErr =
"end point for coastline-normal line is not in the contiguous sea";
2040 strErr =
"cliff notch is above sediment top elevation";
2044 strErr =
"unable to deposit sediment from cliff collapse";
2048 strErr =
"coastline-normal profiles are too closely spaced";
2052 strErr =
"no coastline-normal profiles created, check the SWL";
2056 strErr =
"no coastline-normal profiles created during rasterization";
2060 strErr =
"hit grid edge when eroding beach";
2064 strErr =
"could not locate seaward end of profile when creating Dean profile during estimation of beach erosion";
2068 strErr =
"could not locate seaward end of profile when creating Dean profile for beach erosion";
2072 strErr =
"could not locate seaward end of profile when creating Dean profile for beach deposition (up-coast)";
2076 strErr =
"could not locate seaward end of profile when creating Dean profile for beach deposition (down-coast)";
2080 strErr =
"updating grid with landforms";
2084 strErr =
"no top layer of sediment";
2088 strErr =
"problem with polygon-to-polygon sediment routing sequence";
2092 strErr =
"inconsistent multiline";
2096 strErr =
"cannot insert point into multiline";
2100 strErr =
"cannot assign coastal landform";
2104 strErr =
"start point for cell-by-cell fill of wave shadow zone is outside grid";
2108 strErr =
"could not find start point for cell-by-cell fill of wave shadow zone";
2112 strErr =
"empty profile during during CShore wave propagation";
2116 strErr =
"creating file for CShore input";
2120 strErr =
"reading CShore output file";
2124 strErr =
"during wave interpolation lookup";
2128 strErr =
"while running GDALGridCreate()";
2132 strErr =
"cannot find edge cell while constructing grid-edge profile";
2136 strErr =
"CShore did not finish correctly";
2140 strErr =
"Could not find cell under coastline";
2144 strErr =
"opening deep sea wave time series file";
2148 strErr =
"reading deep sea wave time series file";
2152 strErr =
"finding edges of the bounding box";
2156 strErr =
"reading sediment input event time series file";
2160 strErr =
"simulating sediment input event";
2164 strErr =
"location of sediment input event is outside grod";
2168 strErr =
"location of wavestation is outside grid";
2172 strErr =
"cliff not in polygon";
2176 strErr =
"unknown error";
2181 strErr =
"totally unknown error";
2236 if (isatty(fileno(stdout)))
2251 string strCmd(
"echo \"");
2253 stringstream ststrTmp;
2254 ststrTmp << put_time(localtime(&
m_tSysEndTime),
"%T on %A %d %B %Y") << endl;
2260 strCmd.append(
"Simulation ");
2262 strCmd.append(
", running on ");
2264 strCmd.append(
", completed normally at ");
2265 strCmd.append(ststrTmp.str());
2266 strCmd.append(
"\" | mail -s \"");
2268 strCmd.append(
": normal completion\" ");
2275 strCmd.append(
"Simulation ");
2277 strCmd.append(
", running on ");
2279 strCmd.append(
", aborted with error code ");
2280 strCmd.append(to_string(nRtn));
2281 strCmd.append(
": ");
2283 strCmd.append(
" at timestep ");
2284 strCmd.append(to_string(
m_ulIter));
2285 strCmd.append(
" (");
2287 strCmd.append(
").\n\nThis message sent at ");
2288 strCmd.append(ststrTmp.str());
2289 strCmd.append(
"\" | mail -s \"");
2291 strCmd.append(
": ERROR\" ");
2295 int nRet = system(strCmd.c_str());
2297 if (WEXITSTATUS(nRet) != 0)
2310 string strOut( * strIn);
2311 strOut.replace(strOut.begin(), strOut.end(),
'/',
'\\');
2320 string strOut( * strIn);
2321 strOut.replace(strOut.begin(), strOut.end(),
'\\',
'/');
2331 size_t nStartpos = strIn->find_first_not_of(
" \t");
2333 if (nStartpos == string::npos)
2337 return strIn->substr(nStartpos);
2345 string strTmp( * strIn);
2348 strTmp.erase(remove(strTmp.begin(), strTmp.end(),
'\r'), strTmp.end());
2351 size_t nEndpos = strTmp.find_last_not_of(
" \t");
2353 if (nEndpos == string::npos)
2357 return strTmp.substr(0, nEndpos + 1);
2365 string strTmp = * strIn;
2368 strTmp.erase(remove(strTmp.begin(), strTmp.end(),
'\r'), strTmp.end());
2371 size_t nPos = strTmp.find_last_not_of(
" \t");
2373 if (nPos != string::npos)
2374 strTmp.resize(nPos + 1);
2377 nPos = strTmp.find_first_not_of(
" \t");
2379 if (nPos != string::npos)
2380 strTmp = strTmp.substr(nPos);
2390 string strOut = * strIn;
2391 transform(strIn->begin(), strIn->end(), strOut.begin(), tolower);
2410 size_t nPos = pStrIn->find( * pStrSub);
2412 if (nPos != string::npos)
2415 pStrIn->replace(nPos, pStrSub->size(),
"");
2431 stringstream ss( * s);
2434 while (getline(ss, item, delim))
2437 elems->push_back(item);
2448 vector<string> elems;
2494 nXLast = pVPtiPoints->back().nGetX(),
2495 nYLast = pVPtiPoints->back().nGetY(),
2496 nXDiff = nX - nXLast,
2497 nYDiff = nY - nYLast,
2498 nXDiffA =
tAbs(nXDiff),
2499 nYDiffA =
tAbs(nYDiff),
2500 nDiff =
tMax(nXDiffA, nYDiffA);
2510 dXInc =
static_cast<double>(nXDiff) / nDiff;
2513 dYInc =
static_cast<double>(nYDiff) / nDiff;
2515 for (
int n = 1; n < nDiff; n++)
2518 pVPtiPoints->push_back(Pti);
2528void CSimulation::CalcDeanProfile(vector<double> *pdVDeanProfile,
double const dInc,
double const dDeanTopElev,
double const dA,
bool const bDeposition,
int const nSeawardOffset,
double const dStartCellElev)
2530 double dDistFromProfileStart = 0;
2535 pdVDeanProfile->at(0) = dStartCellElev;
2537 for (
int n = 1; n < static_cast<int>(pdVDeanProfile->size()); n++)
2539 if (n <= nSeawardOffset)
2541 pdVDeanProfile->at(n) = dStartCellElev;
2545 double dDistBelowTop = dA * pow(dDistFromProfileStart,
DEAN_POWER);
2546 pdVDeanProfile->at(n) = dDeanTopElev - dDistBelowTop;
2548 dDistFromProfileStart += dInc;
2556 for (
int n = 0; n < static_cast<int>(pdVDeanProfile->size()); n++)
2558 double dDistBelowTop = dA * pow(dDistFromProfileStart,
DEAN_POWER);
2559 pdVDeanProfile->at(n) = dDeanTopElev - dDistBelowTop;
2561 dDistFromProfileStart += dInc;
2571 double dTotElevDiff = 0;
2574 for (
int n = 0; n < static_cast<int>(pdVFirstProfile->size()); n++)
2576 if (pbVIsValid->at(n))
2578 double dProfileDiff = pdVFirstProfile->at(n) - pdVSecondProfile->at(n);
2580 dTotElevDiff += dProfileDiff;
2606 return dTotElevDiff;
2615 dDeepWaterWaveHeight,
2642 m_dDepthOfClosure = (1.75 * dDeepWaterWaveHeight) - (57.9 * dDeepWaterWaveHeight * dDeepWaterWaveHeight / (
m_dG * dDeepWaterPeriod * dDeepWaterPeriod));
2660 if (VstrTmp.size() < 3)
2662 cerr <<
"date string must include day, month, and year '" << strDate <<
"'" << endl;
2669 cerr <<
"invalid integer for day in date '" << strDate <<
"'" << endl;
2673 nDay = stoi(VstrTmp[0]);
2675 if ((nDay < 1) || (nDay > 31))
2677 cerr <<
"day must be between 1 and 31 in date '" << strDate <<
"'" << endl;
2684 cerr <<
"invalid integer for month in date '" << strDate <<
"'" << endl;
2688 nMonth = stoi(VstrTmp[1]);
2690 if ((nMonth < 1) || (nMonth > 12))
2692 cerr <<
"month must be between 1 and 12 in date '" << strDate <<
"'" << endl;
2699 cerr <<
"invalid integer for year in date '" << strDate <<
"'" << endl;
2703 nYear = stoi(VstrTmp[2]);
2707 cerr <<
"year must be > 0 in date '" << strDate <<
"'" << endl;
2721 if (VstrTmp.size() < 3)
2723 cerr <<
"time string must include hours, minutes, and seconds '" << strTime <<
"'" << endl;
2730 cerr <<
"invalid integer for hours in time '" << strTime <<
"'" << endl;
2734 nHour = stoi(VstrTmp[0]);
2736 if ((nHour < 0) || (nHour > 23))
2738 cerr <<
"hour must be between 0 and 23 in time '" << strTime <<
"'" << endl;
2745 cerr <<
"invalid integer for minutes in time '" << strTime <<
"'" << endl;
2749 nMin = stoi(VstrTmp[1]);
2751 if ((nMin < 0) || (nMin > 59))
2753 cerr <<
"minutes must be betwen 0 and 59 in time '" << strTime <<
"'" << endl;
2760 cerr <<
"invalid integer for seconds in time '" << strTime <<
"'" << endl;
2764 nSec = stoi(VstrTmp[2]);
2766 if ((nSec < 0) || (nSec > 59))
2768 cerr <<
"seconds must be between 0 and 59 in time '" << strTime <<
"'" << endl;
2780 unsigned long ulTimeStep = 0;
2786 if (strDate.find(
"hour") != string::npos)
2793 cerr <<
"Error in number of hours '" + strDate +
"' for sediment input event" << endl;
2797 double dHours = stod(
strTrim(&VstrTmp[0]));
2801 cerr <<
"Sediment input event '" + strDate +
"' occurs after end of simulation" << endl;
2808 else if (strDate.find(
"day") != string::npos)
2815 cerr <<
"Error in number of days '" + strDate +
"' for sediment input event" << endl;
2819 double dHours = stod(
strTrim(&VstrTmp[0])) * 24;
2823 cerr <<
"Sediment input event '" + strDate +
"' occurs after end of simulation" << endl;
2835 if (VstrTmp.size() < 2)
2837 cerr <<
"Error in time/date '" + strDate +
"' of sediment input event" << endl;
2846 if (!
bParseTime(&VstrTmp[0], nHour, nMin, nSec))
2848 cerr <<
"Error in time '" + VstrTmp[0] +
"' of sediment input event" << endl;
2857 if (!
bParseDate(&VstrTmp[1], nDay, nMonth, nYear))
2859 cerr <<
"Error in date '" + VstrTmp[1] +
"' of sediment input event" << endl;
2864 struct tm tmSimStart = {};
2872 struct tm tmSimEvent = {};
2873 tmSimEvent.tm_sec = nSec;
2874 tmSimEvent.tm_min = nMin;
2875 tmSimEvent.tm_hour = nHour;
2876 tmSimEvent.tm_mday = nDay;
2877 tmSimEvent.tm_mon = nMonth - 1;
2878 tmSimEvent.tm_year = nYear - 1900;
2880 time_t tStart = mktime(&tmSimStart);
2881 time_t tEvent = mktime(&tmSimEvent);
2883 if (tStart == (time_t)(-1))
2885 cerr <<
"Error in simulation start time/date" << endl;
2889 if (tEvent == (time_t)(-1))
2891 cerr <<
"Error in time/date '" + strDate +
"' of sediment input event" << endl;
2895 double dHours = difftime(tEvent, tStart) / (60 * 60);
2899 cerr <<
"Sediment input event '" + strDate +
"' occurs before start of simulation" << endl;
2905 cerr <<
"Sediment input event '" + strDate +
"' occurs after end of simulation" << endl;
2909 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.
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
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
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
bool m_bActualBeachErosionSave
bool m_bStillWaterLevelTSSave
Save the still water level time series file?
bool m_bTotalActualPlatformErosionSave
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
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
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
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.
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.