CoastalME (Coastal Modelling Environment)
Simulates the long-term behaviour of complex coastlines
Loading...
Searching...
No Matches
write_output.cpp
Go to the documentation of this file.
1
10
11/* ==============================================================================================================================
12 This file is part of CoastalME, the Coastal Modelling Environment.
13
14 CoastalME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
15
16 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19==============================================================================================================================*/
20#include <assert.h>
21
22#include <ctime>
23using std::localtime;
24
25#include <ios>
26using std::fixed;
27using std::scientific;
28
29#include <iostream>
30using std::cerr;
31using std::endl;
32using std::ios;
33using std::noshowpos;
34using std::showpos;
35
36#include <iomanip>
37using std::put_time;
38using std::resetiosflags;
39using std::setprecision;
40using std::setw;
41
42#include <sstream>
43using std::stringstream;
44
45#include <string>
46using std::to_string;
47
48#include <algorithm>
49using std::sort;
50
51#include "cme.h"
52#include "simulation.h"
53#include "coast.h"
54#include "2di_point.h"
55
56//===============================================================================================================================
58//===============================================================================================================================
60{
61 // Set the Out file output format to fixed point
62 OutStream << fixed;
63
64 // Start outputting stuff
65 OutStream << PROGRAM_NAME << " for " << PLATFORM << " " << strGetBuild() << " on " << strGetComputerName() << endl << endl;
66
67 LogStream << PROGRAM_NAME << " for " << PLATFORM << " " << strGetBuild() << " on " << strGetComputerName() << endl << endl;
68
69 // ----------------------------------------------- Run Information ----------------------------------------------------------
70 OutStream << "RUN DETAILS" << endl;
71 OutStream << " Name \t: " << m_strRunName << endl;
72 OutStream << " Run started \t: " << put_time(localtime(&m_tSysStartTime), "%T %A %d %B %Y") << endl;
73
74 // Same info. for Log file
75 LogStream << m_strRunName << " run started at " << put_time(localtime(&m_tSysStartTime), "%T on %A %d %B %Y") << endl << endl;
76
77 // Continue with Out file
78 OutStream << " Initialization file \t: "
79#ifdef _WIN32
81#else
82 << m_strCMEIni << endl;
83#endif
84
85 OutStream << " Input data read from \t: "
86#ifdef _WIN32
88#else
89 << m_strDataPathName << endl;
90#endif
91
92 OutStream << " Main output file (this file) \t: "
93#ifdef _WIN32
95#else
96 << m_strOutFile << endl;
97#endif
98
99 LogStream << "Main output file \t: "
100#ifdef _WIN32
102#else
103 << m_strOutFile << endl;
104#endif
105
106 OutStream << " Log file \t: "
107#ifdef _WIN32
109#else
110 << m_strOutFile << endl;
111#endif
112
113 LogStream << "Log file (this file) \t: "
114#ifdef _WIN32
116#else
117 << m_strOutFile << endl;
118#endif
119
120 OutStream << " Level of Log detail \t: ";
121
123 OutStream << "0 (least detail)";
124
126 OutStream << "1 (least detail)";
127
129 OutStream << "2 (medium detail)";
130
132 OutStream << "3 (high detail)";
133
134 else if (m_nLogFileDetail == LOG_FILE_ALL)
135 OutStream << "4 (everything)";
136
137 OutStream << endl;
138
139 LogStream << "Level of Log detail \t: ";
140
142 LogStream << "1 (least detail)";
143
145 LogStream << "2 (medium detail)";
146
148 LogStream << "3 (high detail)";
149
150 else if (m_nLogFileDetail == LOG_FILE_ALL)
151 LogStream << "4 (everything)";
152
153 LogStream << endl;
154
155 LogStream << "GDAL performance optimisations enabled \t: " << (m_bGDALOptimisations ? "Y" : "N") << endl;
156
157 LogStream << endl << endl;
158
159 OutStream << " Simulation start date/time \t: ";
160 // hh:mm:ss dd/mm/yyyy
161 char const cPrev = OutStream.fill('0');
162 OutStream << setw(2) << m_nSimStartHour << COLON << setw(2) << m_nSimStartMin << COLON << setw(2) << m_nSimStartSec << SPACE << setw(2) << m_nSimStartDay << SLASH << setw(2) << m_nSimStartMonth << SLASH << setw(2) << m_nSimStartYear << endl;
163 OutStream.fill(cPrev);
164
165 OutStream << " Duration of simulation \t: ";
167
168 if (m_bSaveRegular)
169 {
170 // Saves at regular intervals
171 OutStream << " Time between saves \t: ";
173 }
174 else
175 {
176 // Saves at user-defined intervals
177 OutStream << " Saves at \t: ";
178 string strTmp;
179
180 for (int i = 0; i < m_nUSave; i++)
181 {
182 strTmp.append(strDispSimTime(m_dUSaveTime[i]));
183 strTmp.append(", ");
184 }
185
186 // Also at end of run
187 strTmp.append(strDispSimTime(m_dSimDuration));
188 OutStream << strTmp << endl;
189 }
190
191 OutStream << " Raster GIS output format \t: " << m_strGDALRasterOutputDriverLongname << endl;
192 OutStream << " Maximum number of GIS Save Number digits \t: " << m_nGISMaxSaveDigits << endl;
193 OutStream << " GIS Save Numbers sequential (S) or iteration number (I) \t: " << (m_bGISSaveDigitsSequential ? "S" : "I") << endl;
194 OutStream << " Random number seeds \t: ";
195 {
196 for (int i = 0; i < NUMBER_OF_RNGS; i++)
197 OutStream << m_ulRandSeed[i] << '\t';
198 }
199 OutStream << endl;
200
201 OutStream << " Raster GIS output format \t: " << m_strGDALRasterOutputDriverLongname << endl;
202 OutStream << " Raster output values scaled (if needed) \t: " << (m_bScaleRasterOutput ? "Y" : "N") << endl;
203 OutStream << " Raster world files created (if needed) \t: " << (m_bWorldFile ? "Y" : "N") << endl;
204 OutStream << " Raster GIS files saved \t: " << strListRasterFiles() << endl;
205
206 if (m_bSliceSave)
207 {
208 OutStream << fixed << setprecision(3);
209 OutStream << " Elevations for 'slice' raster output files \t: ";
210
211 for (int i = 0; i < static_cast<int>(m_VdSliceElev.size()); i++)
212 OutStream << m_VdSliceElev[i] << " ";
213
214 OutStream << endl;
215 }
216
217 OutStream << " Vector GIS output format \t: " << m_strVectorGISOutFormat << endl;
218 OutStream << " Vector GIS files saved \t: " << strListVectorFiles() << endl;
219 OutStream << " GDAL performance optimisations enabled \t: " << (m_bGDALOptimisations ? "Y" : "N") << endl;
220 OutStream << " Output file (this file) \t: "
221#ifdef _WIN32
223#else
224 << m_strOutFile << endl;
225#endif
226 OutStream << " Log file \t: "
227#ifdef _WIN32
229#else
230 << m_strLogFile << endl;
231#endif
232
233 OutStream << " Optional time series files saved \t: " << strListTSFiles() << endl;
234
235 OutStream << " Coastline vector smoothing algorithm \t: ";
236
237 switch (m_nCoastSmooth)
238 {
239 case SMOOTH_NONE:
240 {
241 OutStream << "none";
242 break;
243 }
244
246 {
247 OutStream << "running mean";
248 break;
249 }
250
252 {
253 OutStream << "Savitzky-Golay";
254 break;
255 }
256 }
257
258 OutStream << endl;
259
260 OutStream << " Grid edge(s) to omit when searching for coastline \t: " << (m_bOmitSearchNorthEdge ? "N" : "") << (m_bOmitSearchSouthEdge ? "S" : "") << (m_bOmitSearchWestEdge ? "W" : "") << (m_bOmitSearchEastEdge ? "E" : "") << endl;
261
263 {
264 OutStream << " Size of coastline vector smoothing window \t: " << m_nCoastSmoothingWindowSize << endl;
265
267 OutStream << " Savitzky-Golay coastline smoothing polynomial order \t: " << m_nSavGolCoastPoly << endl;
268 }
269
270 OutStream << " Size of profile slope smoothing window \t: " << m_nProfileSmoothWindow << endl;
271 OutStream << resetiosflags(ios::floatfield);
272 OutStream << fixed << setprecision(2);
273 OutStream << " Max local slope on profile (m/m) \t: " << m_dProfileMaxSlope << endl;
274 OutStream << " Vertical tolerance for beach to be included in smoothing \t: " << m_dMaxBeachElevAboveSWL << " m" << endl;
275 OutStream << endl;
276
277 // --------------------------------------------------- Raster GIS stuff -------------------------------------------------------
278 OutStream << "Raster GIS Input Files" << endl;
279 OutStream << " Basement DEM file \t: "
280#ifdef _WIN32
282#else
284#endif
285 OutStream << " Basement DEM driver code \t: " << m_strGDALBasementDEMDriverCode << endl;
286 OutStream << " GDAL basement DEM driver description \t: " << m_strGDALBasementDEMDriverDesc << endl;
287 OutStream << " GDAL basement DEM projection \t: " << m_strGDALBasementDEMProjection << endl;
288 OutStream << " GDAL basement DEM data type \t: " << m_strGDALBasementDEMDataType << endl;
289 OutStream << " Grid size (X by Y) \t: " << m_nXGridSize << " by " << m_nYGridSize << endl;
290 OutStream << resetiosflags(ios::floatfield);
291 OutStream << fixed << setprecision(1);
292 OutStream << "*Coordinates of NW corner of grid (external CRS) \t: " << m_dNorthWestXExtCRS << ", " << m_dNorthWestYExtCRS << endl;
293 OutStream << "*Coordinates of SE corner of grid (external CRS) \t: " << m_dSouthEastXExtCRS << ", " << m_dSouthEastYExtCRS << endl;
294 OutStream << "*Cell size \t: " << m_dCellSide << " m" << endl;
295 OutStream << "*Grid area \t: " << m_dExtCRSGridArea << " m^2" << endl;
296 OutStream << fixed << setprecision(2);
297 OutStream << "*Grid area \t: " << m_dExtCRSGridArea * 1e-6 << " km^2" << endl;
298
299 if (! m_strInitialLandformFile.empty())
300 {
301 OutStream << " Initial Landform Class file \t: " << m_strInitialLandformFile << endl;
302 OutStream << " GDAL Initial Landform Class file driver code \t: " << m_strGDALLDriverCode << endl;
303 OutStream << " GDAL Initial Landform Class file driver description \t: " << m_strGDALLDriverDesc << endl;
304 OutStream << " GDAL Initial Landform Class file projection \t: " << m_strGDALLProjection << endl;
305 OutStream << " GDAL Initial Landform Class file data type \t: " << m_strGDALLDataType << endl;
306 OutStream << endl;
307 }
308
309 if (! m_strInterventionClassFile.empty())
310 {
311 OutStream << " Intervention Class file \t: " << m_strInterventionClassFile << endl;
312 OutStream << " GDAL Intervention Class file driver code \t: " << m_strGDALICDriverCode << endl;
313 OutStream << " GDAL Intervention Class file driver description \t: " << m_strGDALICDriverDesc << endl;
314 OutStream << " GDAL Intervention Class file projection \t: " << m_strGDALICProjection << endl;
315 OutStream << " GDAL Intervention Class file data type \t: " << m_strGDALICDataType << endl;
316 OutStream << endl;
317 }
318
319 if (! m_strInterventionHeightFile.empty())
320 {
321 OutStream << " Intervention Height file \t: " << m_strInterventionHeightFile << endl;
322 OutStream << " GDAL Intervention Height file driver code \t: " << m_strGDALIHDriverCode << endl;
323 OutStream << " GDAL Intervention Height file driver description \t: " << m_strGDALIHDriverDesc << endl;
324 OutStream << " GDAL Intervention Height file projection \t: " << m_strGDALIHProjection << endl;
325 OutStream << " GDAL Intervention Height file data type \t: " << m_strGDALIHDataType << endl;
326 OutStream << endl;
327 }
328
329 if (! m_strInitialSuspSedimentFile.empty())
330 {
331 OutStream << " Initial Susp Sediment file \t: " << m_strInitialSuspSedimentFile << endl;
332 OutStream << " GDAL Initial Susp Sediment file driver code \t: " << m_strGDALISSDriverCode << endl;
333 OutStream << " GDAL Initial Susp Sediment file driver description \t: " << m_strGDALISSDriverDesc << endl;
334 OutStream << " GDAL Initial Susp Sediment file projection \t: " << m_strGDALISSProjection << endl;
335 OutStream << " GDAL Initial Susp Sediment file data type \t: " << m_strGDALISSDataType << endl;
336 OutStream << endl;
337 }
338
339 for (int i = 0; i < m_nLayers; i++)
340 {
341 if (m_nLayers == 1)
342 OutStream << " Only one layer" << endl;
343
344 else
345 OutStream << " Layer " << i << (i == 0 ? "(Top)" : "") << (i == m_nLayers - 1 ? "(Bottom)" : "") << endl;
346
348 {
349 OutStream << " Initial Fine Uncons Sediment file \t: " << m_VstrInitialFineUnconsSedimentFile[i] << endl;
350 OutStream << " GDAL Initial Fine Uncons Sediment file driver code \t: " << m_VstrGDALIUFDriverCode[i] << endl;
351 OutStream << " GDAL Initial Fine Uncons Sediment file driver desc \t: " << m_VstrGDALIUFDriverDesc[i] << endl;
352 OutStream << " GDAL Initial Fine Uncons Sediment file projection \t: " << m_VstrGDALIUFProjection[i] << endl;
353 OutStream << " GDAL Initial Fine Uncons Sediment file data type \t: " << m_VstrGDALIUFDataType[i] << endl;
354 OutStream << endl;
355 }
356
358 {
359 OutStream << " Initial Sand Uncons Sediment file \t: " << m_VstrInitialSandUnconsSedimentFile[i] << endl;
360 OutStream << " GDAL Initial Sand Uncons Sediment file driver code \t: " << m_VstrGDALIUSDriverCode[i] << endl;
361 OutStream << " GDAL Initial Sand Uncons Sediment file driver desc \t: " << m_VstrGDALIUSDriverDesc[i] << endl;
362 OutStream << " GDAL Initial Sand Uncons Sediment file projection \t: " << m_VstrGDALIUSProjection[i] << endl;
363 OutStream << " GDAL Initial Sand Uncons Sediment file data type \t: " << m_VstrGDALIUSDataType[i] << endl;
364 OutStream << endl;
365 }
366
368 {
369 OutStream << " Initial Coarse Uncons Sediment file \t: " << m_VstrInitialCoarseUnconsSedimentFile[i] << endl;
370 OutStream << " GDAL Initial Coarse Uncons Sediment file driver code \t: " << m_VstrGDALIUCDriverCode[i] << endl;
371 OutStream << " GDAL Initial Coarse Uncons Sediment file driver desc \t: " << m_VstrGDALIUCDriverDesc[i] << endl;
372 OutStream << " GDAL Initial Coarse Uncons Sediment file projection \t: " << m_VstrGDALIUCProjection[i] << endl;
373 OutStream << " GDAL Initial Coarse Uncons Sediment file data type \t: " << m_VstrGDALIUCDataType[i] << endl;
374 OutStream << endl;
375 }
376
377 if (! m_VstrInitialFineConsSedimentFile[i].empty())
378 {
379 OutStream << " Initial Fine Cons Sediment file \t: " << m_VstrInitialFineConsSedimentFile[i] << endl;
380 OutStream << " GDAL Initial Fine Cons Sediment file driver code \t: " << m_VstrGDALICFDriverCode[i] << endl;
381 OutStream << " GDAL Initial Fine Cons Sediment file driver desc \t: " << m_VstrGDALICFDriverDesc[i] << endl;
382 OutStream << " GDAL Initial Fine Cons Sediment file projection \t: " << m_VstrGDALICFProjection[i] << endl;
383 OutStream << " GDAL Initial Fine Cons Sediment file data type \t: " << m_VstrGDALICFDataType[i] << endl;
384 OutStream << endl;
385 }
386
387 if (! m_VstrInitialSandConsSedimentFile[i].empty())
388 {
389 OutStream << " Initial Sand Cons Sediment file \t: " << m_VstrInitialSandConsSedimentFile[i] << endl;
390 OutStream << " GDAL Initial Sand Cons Sediment file driver code \t: " << m_VstrGDALICSDriverCode[i] << endl;
391 OutStream << " GDAL Initial Sand Cons Sediment file driver desc \t: " << m_VstrGDALICSDriverDesc[i] << endl;
392 OutStream << " GDAL Initial Sand Cons Sediment file projection \t: " << m_VstrGDALICSProjection[i] << endl;
393 OutStream << " GDAL Initial Sand Cons Sediment file data type \t: " << m_VstrGDALICSDataType[i] << endl;
394 OutStream << endl;
395 }
396
398 {
399 OutStream << " Initial Coarse Cons Sediment file \t: " << m_VstrInitialCoarseConsSedimentFile[i] << endl;
400 OutStream << " GDAL Initial Coarse Cons Sediment file driver code \t: " << m_VstrGDALICCDriverCode[i] << endl;
401 OutStream << " GDAL Initial Coarse Cons Sediment file driver desc \t: " << m_VstrGDALICCDriverDesc[i] << endl;
402 OutStream << " GDAL Initial Coarse Cons Sediment file projection \t: " << m_VstrGDALICCProjection[i] << endl;
403 OutStream << " GDAL Initial Coarse Cons Sediment file data type \t: " << m_VstrGDALICCDataType[i] << endl;
404 OutStream << endl;
405 }
406 }
407
408 // OutStream << endl;
409
410 // ---------------------------------------------------- Vector GIS stuff ------------------------------------------------------
411 OutStream << "Vector GIS Input Files" << endl;
412
414 OutStream << " None" << endl;
415
416 else
417 {
419 {
420 OutStream << " Deep water wave stations shapefile \t: " << m_strDeepWaterWaveStationsShapefile << endl;
421 OutStream << " Deep water wave values file \t: " << m_strDeepWaterWavesInputFile << endl;
422
423 if (m_dWaveDataWrapHours > 0)
424 OutStream << " Deep water wave values will wrap every " << m_dWaveDataWrapHours << " hours" << endl;
425
426 OutStream << " GDAL/OGR deep water wave stations shapefile driver code \t: " << m_strOGRDWWVDriverCode << endl;
427 OutStream << " GDAL/OGR deep water wave stations shapefile driver desc \t: " << m_strOGRDWWVDriverDesc << endl;
428 OutStream << " GDAL/OGR deep water wave stations shapefile data type \t: " << m_strOGRDWWVDataType << endl;
429 OutStream << " GDAL/OGR deep water wave stations shapefile geometry \t: " << m_strOGRDWWVGeometry << endl;
430 }
431
433 {
434 OutStream << " Sediment input event shapefile \t: " << m_strSedimentInputEventShapefile << endl;
435 OutStream << " Sediment input event values file \t: " << m_strSedimentInputEventFile << endl;
436 OutStream << " Sediment input event type \t: ";
437
439 OutStream << "point";
441 OutStream << "coast block";
443 OutStream << "line";
444
445 OutStream << endl;
446 OutStream << " GDAL/OGR sediment input event shapefile driver code \t: " << m_strOGRSedInputDriverCode << endl;
447 OutStream << " GDAL/OGR sediment input event shapefile driver desc \t: " << m_strOGRSedInputDriverCode << endl;
448 OutStream << " GDAL/OGR sediment input event shapefile data type \t: " << m_strOGRSedInputDataType << endl;
449 OutStream << " GDAL/OGR sediment input event shapefile geometry \t: " << m_strOGRSedInputGeometry << endl;
450 }
451
453 {
454 OutStream << " Riverine flooding shapefile \t: " << m_strFloodLocationShapefile << endl;
455 OutStream << " Riverine flood location? \t: " << (m_bFloodLocationSave ? "Y" : "N") << endl;
456 OutStream << " Riverine flood save? \t: " << (m_bVectorWaveFloodLineSave ? "Y" : "N") << endl;
457 OutStream << " GDAL/OGR riverine flooding event shapefile driver code \t: " << m_strOGRFloodDriverCode << endl;
458 OutStream << " GDAL/OGR riverine flooding shapefile driver desc \t: " << m_strOGRFloodDriverDesc << endl;
459 OutStream << " GDAL/OGR riverine flooding shapefile data type \t: " << m_strOGRFloodDataType << endl;
460 OutStream << " GDAL/OGR riverine flooding shapefile geometry \t: " << m_strOGRFloodGeometry << endl;
461 }
462 }
463
464 OutStream << endl;
465
466 // -------------------------------------------------------- Other data --------------------------------------------------------
467 OutStream << "Other Input Data" << endl;
468
469 OutStream << " Wave propagation model \t: ";
470
472 OutStream << "COVE";
474 OutStream << "CShore (output arrays have " << CSHOREARRAYOUTSIZE << " points)";
475
476 OutStream << endl;
477 OutStream << " Density of sea water \t: " << resetiosflags(ios::floatfield) << fixed << setprecision(0) << m_dSeaWaterDensity << " kg/m^3" << endl;
478 OutStream << " Initial still water level \t: " << resetiosflags(ios::floatfield) << fixed << setprecision(1) << m_dInitialMeanSWL << " m" << endl;
479 OutStream << " Final still water level \t: " << resetiosflags(ios::floatfield) << fixed << setprecision(1) << m_dFinalMeanSWL << " m" << endl;
480
482 {
483 OutStream << " Deep water wave height \t: " << m_dAllCellsDeepWaterWaveHeight << " m" << endl;
484 OutStream << " Deep water wave orientation \t: " << m_dAllCellsDeepWaterWaveAngle << " degrees" << endl;
485 OutStream << " Wave period \t: " << m_dAllCellsDeepWaterWavePeriod << " s" << endl;
486 }
487 else
488 {
489 OutStream << " Maximum User input Deep water wave height \t: " << m_dMaxUserInputWaveHeight << " m" << endl;
490 OutStream << " Maximum User input Deep waterWave period \t: " << m_dMaxUserInputWavePeriod << " s" << endl;
491 }
492
493 OutStream << " Start depth for wave calcs (*deep water wave height) \t: " << m_dWaveDepthRatioForWaveCalcs << endl;
494 OutStream << "*Depth of closure \t: " << resetiosflags(ios::floatfield) << fixed << setprecision(3) << m_dDepthOfClosure << " m" << endl;
495 OutStream << " Tide data file \t: " << m_strTideDataFile << endl;
496 OutStream << " Do coast platform erosion? \t: " << (m_bDoShorePlatformErosion ? "Y" : "N") << endl;
497 OutStream << resetiosflags(ios::floatfield);
498 OutStream << scientific << setprecision(2);
499 OutStream << " Coast platform resistance to erosion \t: " << m_dR << endl;
500 OutStream << resetiosflags(ios::floatfield);
501 OutStream << fixed << setprecision(1);
502 OutStream << " Do beach sediment transport? \t: " << (m_bDoBeachSedimentTransport ? "Y" : "N") << endl;
503 OutStream << " Handling of beach sediment at grid edges \t: ";
504
506 OutStream << "closed";
508 OutStream << "open";
510 OutStream << "recirculate";
511
512 OutStream << endl;
513 OutStream << " Beach potential erosion/deposition equation \t: ";
514
516 OutStream << "CERC";
518 OutStream << "Kamphuis";
519
520 OutStream << endl;
521 OutStream << " Median particle size of fine sediment \t: " << resetiosflags(ios::floatfield) << fixed << m_dD50Fine << " mm" << endl;
522 OutStream << " Median particle size of sand sediment \t: " << resetiosflags(ios::floatfield) << fixed << m_dD50Sand << " mm" << endl;
523 OutStream << " Median particle size of coarse sediment \t: " << resetiosflags(ios::floatfield) << fixed << m_dD50Coarse << " mm" << endl;
524 OutStream << " Beach sediment density \t: " << resetiosflags(ios::floatfield) << fixed << m_dBeachSedimentDensity << " kg/m^3" << endl;
525 OutStream << " Beach sediment porosity \t: " << resetiosflags(ios::floatfield) << fixed << m_dBeachSedimentPorosity << endl;
526 OutStream << " Fine-sized sediment relative erodibility \t: " << resetiosflags(ios::floatfield) << fixed << setprecision(1) << m_dFineErodibility << endl;
527 OutStream << " Sand-sized sediment relative erodibility \t: " << resetiosflags(ios::floatfield) << m_dSandErodibility << endl;
528 OutStream << " Coarse-sized sediment relative erodibility \t: " << m_dCoarseErodibility << endl;
529
531 OutStream << " Transport parameter KLS for CERC equation \t: " << resetiosflags(ios::floatfield) << fixed << setprecision(3) << m_dKLS << endl;
532
534 OutStream << " Transport parameter for Kamphuis equation \t: " << resetiosflags(ios::floatfield) << fixed << setprecision(3) << m_dKamphuis << endl;
535
536 OutStream << " Height of Dean profile start above SWL \t: " << resetiosflags(ios::floatfield) << fixed << setprecision(1) << m_dDeanProfileStartAboveSWL << " m" << endl;
537 OutStream << " Sediment input at a point \t: " << (m_bSedimentInput ? "Y" : "N") << endl;
538
540 {
541 OutStream << " Sediment input shapefile \t: " << m_strSedimentInputEventShapefile << endl;
542 OutStream << " Sediment input type \t: ";
543
545 OutStream << "point";
547 OutStream << "block on coast";
549 OutStream << "line intersection with coast";
550
551 OutStream << endl;
552 OutStream << " Sediment input file \t: " << m_strSedimentInputEventFile << endl;
553 }
554
556 {
557 OutStream << " Do cliff collapse? \t: " << (m_bDoCliffCollapse ? "Y" : "N") << endl;
558 OutStream << resetiosflags(ios::floatfield);
559 OutStream << scientific << setprecision(2);
560 OutStream << " Cliff resistance to erosion \t: " << m_dCliffErosionResistance << endl;
561 OutStream << resetiosflags(ios::floatfield);
562 OutStream << fixed << setprecision(1);
563 OutStream << " Notch overhang to initiate collapse \t: " << m_dNotchIncisionAtCollapse << " m" << endl;
564 OutStream << " Notch base below SWL \t: " << m_dNotchApexAboveMHW << " m" << endl;
565 OutStream << " Scale parameter A for cliff deposition \t: ";
566
568 OutStream << "auto";
569 else
570 OutStream << m_dCliffDepositionA << " m^(1/3)";
571
572 OutStream << endl;
573 OutStream << " Planview width of cliff deposition talus \t: " << resetiosflags(ios::floatfield) << fixed << m_dCliffDepositionPlanviewWidth << " m" << endl;
574 OutStream << " Planview length of cliff deposition talus \t: " << m_dCliffTalusMinDepositionLength << " m" << endl;
575 OutStream << " Min height of land-end talus (fraction of cliff elevation)\t: " << m_dMinCliffTalusHeightFrac << endl;
576 }
577
578 OutStream << " Do riverine flooding? \t: " << (m_bRiverineFlooding ? "Y" : "N") << endl;
579
581 {
582 // TODO 007 Need more info on this
583 OutStream << " FloodSWLSetupLine \t: " << (m_bFloodSWLSetupLineSave ? "Y" : "N") << endl;
584 OutStream << " FloodSWLSetupSurgeLine \t: " << (m_bFloodSWLSetupSurgeLine ? "Y" : "N") << endl;
585 OutStream << " m_bFloodSWLSetupSurgeRunupLineSave \t: " << (m_bFloodSWLSetupSurgeRunupLineSave ? "Y" : "N") << endl;
586 }
587
588 OutStream << " Gravitational acceleration \t: " << resetiosflags(ios::floatfield) << fixed << m_dG << " m^2/s" << endl;
589 OutStream << " Usual spacing of coastline normals \t: " << resetiosflags(ios::floatfield) << fixed << m_dCoastNormalSpacing << " m" << endl;
590 OutStream << "*Usual spacing of coastline normals on interventions \t: " << resetiosflags(ios::floatfield) << fixed << m_dCoastNormalInterventionSpacing << " m" << endl;
591 OutStream << " Random factor for spacing of normals \t: " << resetiosflags(ios::floatfield) << fixed << m_dCoastNormalRandSpacingFactor << endl;
592 OutStream << " Length of coastline normals \t: " << m_dCoastNormalLength << " m" << endl;
593 OutStream << endl;
594 /*
595 OutStream << fixed << setprecision(8);
596 OutStream << " Erosion potential shape function:" << endl;
597 OutStream << "\tDepth over DB\tErosion potential\tFirst derivative of erosion potential" << endl;
598 for (int i = 0; i < m_VdDepthOverDB.size(); i++)
599 OutStream << "\t" << m_VdDepthOverDB[i] << "\t\t" << m_VdErosionPotential[i] << "\t\t" << m_VdErosionPotentialFirstDeriv[i] << endl;
600 OutStream << endl;
601 */
602 // ------------------------------------------------------ Testing only --------------------------------------------------------
603 OutStream << "Testing only" << endl;
604
605 OutStream << " Output profile data? \t: " << (m_bOutputConsolidatedProfileData ? "Y" : "N") << endl;
606 OutStream << " Profile numbers to be saved \t: ";
607
608 for (unsigned int i = 0; i < m_VnProfileToSave.size(); i++)
610
611 OutStream << endl;
612 OutStream << " Timesteps when profiles are saved \t: ";
613
614 for (unsigned int i = 0; i < m_VulProfileTimestep.size(); i++)
616
617 OutStream << endl;
618 OutStream << " Output parallel profile data? \t: " << (m_bOutputParallelProfileData ? "Y" : "N") << endl;
619 OutStream << " Output erosion potential look-up data? \t: " << (m_bOutputErosionPotentialData ? "Y" : "N");
620
623
624 OutStream << " Runup equation \t: ";
625 if (m_nRunUpEquation == 0)
626 OutStream << "none";
628 OutStream << "Nielsen and Hanslow (1991)";
630 OutStream << "Mase (1989)";
632 OutStream << "Stockdon et al. (2006)";
633
634 OutStream << endl << endl;
635
636 // -------------------------------------------------- Per-iteration output ----------------------------------------------------
637 OutStream << fixed << setprecision(3);
638
639 // Write per-timestep headers to .out file
641 {
642 // CSV format header
643 OutStream << "# CSV FORMAT PER-ITERATION RESULTS" << endl;
644 OutStream << "# Sea depth in metres. All erosion and deposition values in millimetres" << endl;
645 OutStream << "# GISn = GIS files saved as <filename>n." << endl;
646 OutStream << PER_ITER_CSV_HEAD << endl;
647 }
648 else
649 {
650 // Fixed-width format headers
651 OutStream << PER_ITER_HEAD << endl;
652 OutStream << "Sea depth in metres. All erosion and deposition values in millimetres" << endl;
653 OutStream << "GISn = GIS files saved as <filename>n." << endl;
654 OutStream << endl;
655
656 OutStream << PER_ITER_HEAD1 << endl;
657 OutStream << PER_ITER_HEAD2 << endl;
658 OutStream << PER_ITER_HEAD3 << endl;
659 OutStream << PER_ITER_HEAD4 << endl;
660 OutStream << PER_ITER_HEAD5 << endl;
661 }
662}
663
664//===============================================================================================================================
666//===============================================================================================================================
674
675//===============================================================================================================================
677//===============================================================================================================================
679{
680 OutStream << resetiosflags(ios::floatfield);
681 OutStream << fixed << setprecision(0);
682
683 // Output timestep and simulated time info ===================================================================================
684 OutStream << setw(4) << m_ulIter;
685 OutStream << setw(7) << m_dSimElapsed; // In hours
686 OutStream << resetiosflags(ios::floatfield);
687 OutStream << fixed << setprecision(0);
688 OutStream << setw(7) << m_dSimElapsed / (24 * 365.25); // In years
689
690 // Output average sea depth (m) per sea cell =================================================================================
691 OutStream << resetiosflags(ios::floatfield);
692 OutStream << fixed << setprecision(2);
693 double const dAvgSeaDepth = m_dThisIterTotSeaDepth / static_cast<double>(m_ulThisIterNumSeaCells);
694 OutStream << setw(7) << dAvgSeaDepth;
695 OutStream << " ";
696
697 // Output the this-timestep % of sea cells with potential shore platform erosion ==============================================
698 OutStream << fixed << setprecision(0);
700
701 // Output per-timestep potential shore platform erosion in m (average for all sea cells)
702 OutStream << fixed << setprecision(1);
703 OutStream << setw(6) << 1000 * m_dThisIterPotentialPlatformErosion / static_cast<double>(m_ulThisIterNumSeaCells);
704
705 // Output per-timestep potential shore platform erosion in m (average for all cells with potential shore platform erosion)
706 OutStream << fixed << setprecision(1);
707
710 else
711 OutStream << setw(6) << SPACE;
712
713 // Output the this-timestep % of sea cells with actual shore platform erosion =================================================
714 OutStream << fixed << setprecision(0);
716
717 // Output per-timestep actual shore platform erosion in m (average for all sea cells)
718 OutStream << fixed << setprecision(1);
720 OutStream << setw(6) << 1000 * dThisIterActualPlatformErosion / static_cast<double>(m_ulThisIterNumSeaCells);
721
722 // Output per-timestep actual shore platform erosion in m (average for all cells with actual shore platform erosion)
723 OutStream << fixed << setprecision(1);
724
726 OutStream << setw(6) << 1000 * dThisIterActualPlatformErosion / static_cast<double>(m_ulThisIterNumActualPlatformErosionCells);
727 else
728 OutStream << setw(6) << SPACE;
729
730 // Output per-timestep actual shore platform erosion in m (average for all sea cells)
731 OutStream << fixed << setprecision(1) << SPACE;
732
734 OutStream << setw(4) << 1000 * m_dThisIterActualPlatformErosionFineCons / static_cast<double>(m_ulThisIterNumSeaCells);
735 else
736 OutStream << setw(4) << SPACE;
737
739 OutStream << setw(4) << 1000 * m_dThisIterActualPlatformErosionSandCons / static_cast<double>(m_ulThisIterNumSeaCells);
740 else
741 OutStream << setw(4) << SPACE;
742
744 OutStream << setw(4) << 1000 * m_dThisIterActualPlatformErosionCoarseCons / static_cast<double>(m_ulThisIterNumSeaCells);
745 else
746 OutStream << setw(4) << SPACE;
747
748 // Output the this-timestep % of sea cells with potential beach erosion ======================================================
750
751 // Output per-timestep potential beach erosion in m (average for all sea cells)
752 OutStream << fixed << setprecision(0);
753 // assert(m_ulThisIterNumSeaCells > 0);
754 double dTmp = 1000 * m_dThisIterPotentialBeachErosion / static_cast<double>(m_ulThisIterNumSeaCells);
755
756 if (dTmp > 99999)
757 {
758 OutStream << setw(6) << scientific << setprecision(0) << dTmp;
759 OutStream << fixed;
760 }
761 else
762 OutStream << setw(6) << dTmp;
763
764 // Output per-timestep potential beach erosion in m (average for all cells with potential beach erosion)
765 OutStream << fixed << setprecision(1);
766
768 {
770
771 if (dTmp > 99999)
772 {
773 OutStream << setw(6) << scientific << setprecision(0) << dTmp;
774 OutStream << fixed;
775 }
776 else
777 OutStream << setw(6) << dTmp;
778 }
779 else
780 OutStream << setw(6) << SPACE;
781
782 // This-timestep % of sea cells with actual beach erosion =====================================================================
783 OutStream << fixed << setprecision(0);
785
786 // Output per-timestep actual beach erosion in m (average for all sea cells)
788 OutStream << setw(7) << 1000 * dThisIterActualBeachErosion / static_cast<double>(m_ulThisIterNumSeaCells);
789
790 // Per-iteration actual beach erosion in m (average for all cells with actual beach erosion)
791 OutStream << fixed << setprecision(1);
792
794 OutStream << setw(7) << 1000 * dThisIterActualBeachErosion / static_cast<double>(m_ulThisIterNumActualBeachErosionCells);
795 else
796 OutStream << setw(7) << SPACE;
797
798 // Per-iteration actual beach erosion in m (average for all sea cells)
799 OutStream << fixed << setprecision(1) << SPACE;
800
802 OutStream << setw(4) << 1000 * m_dThisIterBeachErosionFine / static_cast<double>(m_ulThisIterNumSeaCells);
803 else
804 OutStream << setw(4) << SPACE;
805
807 OutStream << setw(4) << 1000 * m_dThisIterBeachErosionSand / static_cast<double>(m_ulThisIterNumSeaCells);
808 else
809 OutStream << setw(4) << SPACE;
810
812 OutStream << setw(4) << 1000 * m_dThisIterBeachErosionCoarse / static_cast<double>(m_ulThisIterNumSeaCells);
813 else
814 OutStream << setw(4) << SPACE;
815
816 // Output the this-timestep % of sea cells with beach deposition =============================================================
817 OutStream << fixed << setprecision(0);
819
820 // Per-iteration beach deposition in m (average for all sea cells)
821 double const dThisIterBeachDeposition = m_dThisIterBeachDepositionSand + m_dThisIterBeachDepositionCoarse;
822 OutStream << setw(6) << 1000 * dThisIterBeachDeposition / static_cast<double>(m_ulThisIterNumSeaCells);
823
824 // Per-iteration beach deposition in m (average for all cells with beach deposition)
825 OutStream << fixed << setprecision(1);
826
828 OutStream << setw(7) << 1000 * dThisIterBeachDeposition / static_cast<double>(m_ulThisIterNumBeachDepositionCells);
829 else
830 OutStream << setw(7) << SPACE;
831
832 // Per-iteration beach deposition in m (average for all sea cells)
833 OutStream << fixed << setprecision(1) << SPACE;
834
836 OutStream << setw(5) << 1000 * m_dThisIterBeachDepositionSand / static_cast<double>(m_ulThisIterNumSeaCells);
837 else
838 OutStream << setw(5) << SPACE;
839
841 OutStream << setw(4) << 1000 * m_dThisIterBeachDepositionCoarse / static_cast<double>(m_ulThisIterNumSeaCells);
842 else
843 OutStream << setw(4) << SPACE;
844
845 // Output the this-timestep sediment input in m ==============================================================================
846 OutStream << scientific << setprecision(0) << SPACE;
847
850 else
851 OutStream << setw(5) << SPACE;
852
855 else
856 OutStream << setw(4) << SPACE;
857
860 else
861 OutStream << setw(4) << SPACE;
862
863 // Per-iteration cliff collapse erosion (both cons and uncons) in m (average for all coast cells) ============================
864 OutStream << fixed << setprecision(1) << SPACE;
865
868 else
869 OutStream << setw(5) << SPACE;
870
873 else
874 OutStream << setw(4) << SPACE;
875
878 else
879 OutStream << setw(4) << SPACE;
880
881 // Per-iteration cliff collapse deposition in m (average for all sea cells) ==================================================
883 OutStream << setw(5) << 1000 * m_dThisIterUnconsSandCliffDeposition / static_cast<double>(m_ulThisIterNumSeaCells);
884 else
885 OutStream << setw(5) << SPACE;
886
888 OutStream << setw(4) << 1000 * m_dThisIterUnconsCoarseCliffDeposition / static_cast<double>(m_ulThisIterNumSeaCells);
889 else
890 OutStream << setw(4) << SPACE;
891
892 // Output per-timestep fine sediment going to suspension, in m (average for all sea cells) ==================================
894 OutStream << setw(7) << 1000 * m_dThisIterFineSedimentToSuspension / static_cast<double>(m_ulThisIterNumSeaCells);
895 else
896 OutStream << setw(7) << SPACE;
897
898 OutStream << " ";
899
900 // Finally, set 'markers' for events that have occurred this timestep
902 OutStream << " GIS" << m_nGISSave;
903
904 OutStream << endl;
905
906 // Did a text file write error occur?
907 if (OutStream.fail())
908 return false;
909
910 return true;
911}
912
913//===============================================================================================================================
915//===============================================================================================================================
917{
918 OutStream << setprecision(6);
919
920 // Output timestep and simulated time info
921 OutStream << m_ulIter << ",";
922 OutStream << m_dSimElapsed << ","; // In hours
923 OutStream << m_dSimElapsed / (24 * 365.25) << ","; // In years
924
925 // Output average sea depth (m) per sea cell
926 double const dAvgSeaDepth = m_dThisIterTotSeaDepth / static_cast<double>(m_ulThisIterNumSeaCells);
927 OutStream << dAvgSeaDepth << ",";
928
929 // Platform erosion data
931 OutStream << 1000 * m_dThisIterPotentialPlatformErosion / static_cast<double>(m_ulThisIterNumSeaCells) << ",";
932
935 else
936 OutStream << ",";
937
939
941 OutStream << 1000 * dThisIterActualPlatformErosion / static_cast<double>(m_ulThisIterNumSeaCells) << ",";
942
944 OutStream << 1000 * dThisIterActualPlatformErosion / static_cast<double>(m_ulThisIterNumActualPlatformErosionCells) << ",";
945 else
946 OutStream << ",";
947
948 // Platform erosion by sediment type
950 OutStream << 1000 * m_dThisIterActualPlatformErosionFineCons / static_cast<double>(m_ulThisIterNumSeaCells) << ",";
951 else
952 OutStream << ",";
953
955 OutStream << 1000 * m_dThisIterActualPlatformErosionSandCons / static_cast<double>(m_ulThisIterNumSeaCells) << ",";
956 else
957 OutStream << ",";
958
961 else
962 OutStream << ",";
963
964 // Beach erosion data
966
967 double dTmp = 1000 * m_dThisIterPotentialBeachErosion / static_cast<double>(m_ulThisIterNumSeaCells);
968 OutStream << dTmp << ",";
969
971 {
973 OutStream << dTmp << ",";
974 }
975 else
976 OutStream << ",";
977
979
981 OutStream << 1000 * dThisIterActualBeachErosion / static_cast<double>(m_ulThisIterNumSeaCells) << ",";
982
984 OutStream << 1000 * dThisIterActualBeachErosion / static_cast<double>(m_ulThisIterNumActualBeachErosionCells) << ",";
985 else
986 OutStream << ",";
987
988 // Beach erosion by sediment type
990 OutStream << 1000 * m_dThisIterBeachErosionFine / static_cast<double>(m_ulThisIterNumSeaCells) << ",";
991 else
992 OutStream << ",";
993
995 OutStream << 1000 * m_dThisIterBeachErosionSand / static_cast<double>(m_ulThisIterNumSeaCells) << ",";
996 else
997 OutStream << ",";
998
1000 OutStream << 1000 * m_dThisIterBeachErosionCoarse / static_cast<double>(m_ulThisIterNumSeaCells) << ",";
1001 else
1002 OutStream << ",";
1003
1004 // Beach deposition data
1006
1007 double const dThisIterBeachDeposition = m_dThisIterBeachDepositionSand + m_dThisIterBeachDepositionCoarse;
1008 OutStream << 1000 * dThisIterBeachDeposition / static_cast<double>(m_ulThisIterNumSeaCells) << ",";
1009
1011 OutStream << 1000 * dThisIterBeachDeposition / static_cast<double>(m_ulThisIterNumBeachDepositionCells) << ",";
1012 else
1013 OutStream << ",";
1014
1015 // Beach deposition by sediment type
1017 OutStream << 1000 * m_dThisIterBeachDepositionSand / static_cast<double>(m_ulThisIterNumSeaCells) << ",";
1018 else
1019 OutStream << ",";
1020
1022 OutStream << 1000 * m_dThisIterBeachDepositionCoarse / static_cast<double>(m_ulThisIterNumSeaCells) << ",";
1023 else
1024 OutStream << ",";
1025
1026 // Sediment input data
1029 else
1030 OutStream << ",";
1031
1034 else
1035 OutStream << ",";
1036
1039 else
1040 OutStream << ",";
1041
1042 // Cliff collapse erosion data
1045 else
1046 OutStream << ",";
1047
1050 else
1051 OutStream << ",";
1052
1055 else
1056 OutStream << ",";
1057
1058 // Cliff collapse deposition data
1060 OutStream << 1000 * m_dThisIterUnconsSandCliffDeposition / static_cast<double>(m_ulThisIterNumSeaCells) << ",";
1061 else
1062 OutStream << ",";
1063
1065 OutStream << 1000 * m_dThisIterUnconsCoarseCliffDeposition / static_cast<double>(m_ulThisIterNumSeaCells) << ",";
1066 else
1067 OutStream << ",";
1068
1069 // Suspended sediment data
1071 OutStream << 1000 * m_dThisIterFineSedimentToSuspension / static_cast<double>(m_ulThisIterNumSeaCells) << ",";
1072 else
1073 OutStream << ",";
1074
1075 // GIS events (no comma after last column)
1077 OutStream << "GIS" << m_nGISSave;
1078
1079 OutStream << endl;
1080
1081 // Did a text file write error occur?
1082 if (OutStream.fail())
1083 return false;
1084
1085 return true;
1086}
1087
1088//===============================================================================================================================
1090//===============================================================================================================================
1092{
1093 // This-iteration sea area
1094 if (m_bSeaAreaTSSave)
1095 {
1096 // Output in external CRS units
1097 SeaAreaTSStream << m_dSimElapsed << "\t,\t" << m_dExtCRSGridArea * static_cast<double>(m_ulThisIterNumSeaCells) / static_cast<double>(m_ulNumCells) << endl;
1098
1099 // Did a time series file write error occur?
1100 if (SeaAreaTSStream.fail())
1101 return false;
1102 }
1103
1104 // This-iteration SWL, mean SWL, and MHW
1105 if (m_bSWLTSSave)
1106 {
1107 // Output as is (m)
1108 SWLTSStream << m_dSimElapsed << "\t,\t" << m_dThisIterSWL << "\t,\t" << m_dThisIterMeanSWL << "\t,\t" << m_dThisIterMHWElev << endl;
1109
1110 // Did a time series file write error occur?
1111 if (SWLTSStream.fail())
1112 return false;
1113 }
1114
1115 // This-iteration actual platform erosion (fine, sand, and coarse)
1117 {
1118 // Output as is (m depth equivalent)
1120
1121 // Did a time series file write error occur?
1122 if (PlatformErosionTSStream.fail())
1123 return false;
1124 }
1125
1126 // This-iteration cliff collapse erosion (fine, sand, and coarse)
1128 {
1129 // Output the number of cells with cliff collapse this iteration
1131
1132 // Now output how much was eroded via cliff collapse, as is (m depth equivalent)
1134
1135 // Did a time series file write error occur?
1137 return false;
1138 }
1139
1140 // This-iteration cliff notch apex elevation
1142 {
1143 // Output as is (m depth equivalent)
1145
1146 // Did a time series file write error occur?
1147 if (CliffNotchElevTSStream.fail())
1148 return false;
1149 }
1150
1151 // This-iteration cliff talus collapse deposition (sand and coarse)
1153 {
1154 // Output as is (m depth equivalent)
1156
1157 // Did a time series file write error occur?
1159 return false;
1160 }
1161
1162 // This-iteration cliff collapse net
1164 {
1165 // Output as is (m depth equivalent)
1167
1168 // Did a time series file write error occur?
1170 return false;
1171 }
1172
1173 // This-iteration beach erosion (fine, sand, and coarse)
1175 {
1176 // Output as is (m depth equivalent)
1178
1179 // Did a time series file write error occur?
1180 if (BeachErosionTSStream.fail())
1181 return false;
1182 }
1183
1184 // This-iteration beach deposition (sand and coarse)
1186 {
1187 // Output as is (m depth equivalent)
1189
1190 // Did a time series file write error occur?
1191 if (BeachDepositionTSStream.fail())
1192 return false;
1193 }
1194
1195 // This iteration net change in beach sediment
1197 {
1198 // Output as is (m depth equivalent)
1200
1201 // Did a time series file write error occur?
1203 return false;
1204 }
1205
1206 // This-iteration suspended sediment to suspension
1207 if (m_bSuspSedTSSave)
1208 {
1209 // Output as is (m depth equivalent)
1211
1212 // Did a time series file write error occur?
1213 if (FineSedSuspensionTSStream.fail())
1214 return false;
1215 }
1216
1217 // This-iteration setup surge water level
1219 {
1220 // Output as is (m depth equivalent)
1222
1223 // Did a time series file write error occur?
1224 if (FloodSetupSurgeTSStream.fail())
1225 return false;
1226 }
1227
1228 // This-iteration setup surge runup
1230 {
1231 // Output as is (m depth equivalent)
1233
1234 // Did a time series file write error occur?
1236 return false;
1237 }
1238
1239 return true;
1240}
1241
1242//===============================================================================================================================
1244//===============================================================================================================================
1246{
1247 // Open the output file
1248 string strLookUpFile = m_strOutPath;
1249 strLookUpFile.append(EROSION_POTENTIAL_LOOKUP_FILE);
1250 ofstream LookUpOutStream;
1251 LookUpOutStream.open(strLookUpFile.c_str(), ios::out | ios::trunc);
1252
1253 if (LookUpOutStream)
1254 {
1255 // File opened OK, so output the values
1256 LookUpOutStream << "DepthOverDB, \tErosionPotential" << endl;
1257 double dDepthOverDB = 0.0;
1258
1259 while (dDepthOverDB <= m_dDepthOverDBMax)
1260 {
1261 double const dErosionPotential = dGetInterpolatedValue(&m_VdDepthOverDB, &m_VdErosionPotential, dDepthOverDB, false);
1262 LookUpOutStream << dDepthOverDB << ",\t" << dErosionPotential << endl;
1263 dDepthOverDB += DEPTH_OVER_DB_INCREMENT;
1264 }
1265
1266 LookUpOutStream << endl;
1267
1268 // And close the file
1269 LookUpOutStream.close();
1270 }
1271}
1272
1273//===============================================================================================================================
1275//===============================================================================================================================
1276int CSimulation::nSaveProfile(int const nCoast, CGeomProfile const* pProfile, int const nProfSize, vector<double> const* pdVDistXY, vector<double> const* pdVZ, vector<double> const* pdVDepthOverDB, vector<double> const* pdVErosionPotentialFunc, vector<double> const* pdVSlope, vector<double> const* pdVRecessionXY, vector<double> const* pdVChangeElevZ, vector<CGeom2DIPoint>* const pPtVGridProfile, vector<double> const* pdVScapeXY) const
1277{
1278 // TODO 052 Make this more efficient, also give warnings if no profiles will be output
1279 int const nProfile = pProfile->nGetProfileID();
1280
1281 for (unsigned int i = 0; i < m_VulProfileTimestep.size(); i++)
1282 {
1283 for (unsigned int j = 0; j < m_VnProfileToSave.size(); j++)
1284 {
1285 if ((m_ulIter == m_VulProfileTimestep[i]) && (nProfile == m_VnProfileToSave[j]))
1286 {
1287 if (! bWriteProfileData(nCoast, pProfile, nProfSize, pdVDistXY, pdVZ, pdVDepthOverDB, pdVErosionPotentialFunc, pdVSlope, pdVRecessionXY, pdVChangeElevZ, pPtVGridProfile, pdVScapeXY))
1288 return RTN_ERR_PROFILE_WRITE;
1289 }
1290 }
1291 }
1292
1293 return RTN_OK;
1294}
1295
1296//===============================================================================================================================
1298//===============================================================================================================================
1299bool CSimulation::bWriteProfileData(int const nCoast, CGeomProfile const* pProfile, int const nProfSize, vector<double> const* pdVDistXY, vector<double> const* pdVZ, vector<double> const* pdVDepthOverDB, vector<double> const* pdVErosionPotentialFunc, vector<double> const* pdVSlope, vector<double> const* pdVRecessionXY, vector<double> const* pdVChangeElevZ, vector<CGeom2DIPoint>* const pPtVGridProfile, vector<double> const* pdVScapeXY) const
1300{
1301 int const nProfile = pProfile->nGetProfileID();
1302
1303 string strFName = m_strOutPath;
1304 stringstream ststrTmp;
1305
1306 strFName.append("profile_");
1307 ststrTmp << FillToWidth('0', 3) << nProfile;
1308 strFName.append(ststrTmp.str());
1309
1310 strFName.append("_timestep_");
1311 ststrTmp.clear();
1312 ststrTmp.str(string());
1313 ststrTmp << FillToWidth('0', 4) << m_ulIter;
1314 strFName.append(ststrTmp.str());
1315
1316 strFName.append(".csv");
1317
1318 ofstream OutProfStream;
1319 OutProfStream.open(strFName.c_str(), ios::out | ios::trunc);
1320
1321 if (!OutProfStream)
1322 {
1323 // Error, cannot open file
1324 cerr << ERR << "cannot open " << strFName << " for output" << endl;
1325 return false;
1326 }
1327
1328 OutProfStream << "\"Dist\", \"X\", \"Y\", \"Z (before erosion)\", \"Depth/DB\", \"Erosion Potential\", \"Slope\", \"Recession XY\", \"Change Elev Z\", \"Grid X\", \"Grid Y\", \"Weight\", \"For profile " << nProfile << " from coastline " << nCoast << " at timestep " << m_ulIter << "\"" << endl;
1329
1330 for (int i = 0; i < nProfSize; i++)
1331 {
1332 double const dX = dGridCentroidXToExtCRSX(pPtVGridProfile->at(i).nGetX());
1333 double const dY = dGridCentroidYToExtCRSY(pPtVGridProfile->at(i).nGetY());
1334
1335 OutProfStream << pdVDistXY->at(i) << ",\t" << dX << ",\t" << dY << ",\t" << pdVZ->at(i) << ",\t" << pdVDepthOverDB->at(i) << ",\t" << pdVErosionPotentialFunc->at(i) << ",\t" << pdVSlope->at(i) << ",\t" << pdVRecessionXY->at(i) << ",\t" << pdVChangeElevZ->at(i) << ",\t" << pPtVGridProfile->at(i).nGetX() << ",\t" << pPtVGridProfile->at(i).nGetY() << ", \t" << pdVScapeXY->at(i) << endl;
1336 }
1337
1338 OutProfStream.close();
1339
1340 return true;
1341}
1342
1343//===============================================================================================================================
1345//===============================================================================================================================
1346int CSimulation::nSaveParProfile(int const nCoast, CGeomProfile const* pProfile, int const nParProfSize, int const nDirection, int const nDistFromProfile, vector<double> const* pdVDistXY, vector<double> const* pdVZ, vector<double> const* pdVDepthOverDB, vector<double> const* pdVErosionPotentialFunc, vector<double> const* pdVSlope, vector<double> const* pdVRecessionXY, vector<double> const* pdVChangeElevZ, vector<CGeom2DIPoint>* const pPtVGridProfile, vector<double> const* pdVScapeXY) const
1347{
1348 // TODO 052 Make this more efficient, also give warnings if no profiles will be output
1349 int const nProfile = pProfile->nGetProfileID();
1350
1351 for (unsigned int i = 0; i < m_VulProfileTimestep.size(); i++)
1352 {
1353 for (unsigned int j = 0; j < m_VnProfileToSave.size(); j++)
1354 {
1355 if ((m_ulIter == m_VulProfileTimestep[i]) && (nProfile == m_VnProfileToSave[j]))
1356 {
1357 if (! bWriteParProfileData(nCoast, nProfile, nParProfSize, nDirection, nDistFromProfile, pdVDistXY, pdVZ, pdVDepthOverDB, pdVErosionPotentialFunc, pdVSlope, pdVRecessionXY, pdVChangeElevZ, pPtVGridProfile, pdVScapeXY))
1358 return RTN_ERR_PROFILE_WRITE;
1359 }
1360 }
1361 }
1362
1363 return RTN_OK;
1364}
1365
1366//===============================================================================================================================
1368//===============================================================================================================================
1369bool CSimulation::bWriteParProfileData(int const nCoast, int const nProfile, int const nProfSize, int const nDirection, int const nDistFromProfile, vector<double> const* pdVDistXY, vector<double> const* pdVZ, vector<double> const* pdVDepthOverDB, vector<double> const* pdVErosionPotentialFunc, vector<double> const* pdVSlope, vector<double> const* pdVRecessionXY, vector<double> const* pdVChangeElevZ, vector<CGeom2DIPoint>* const pPtVGridProfile, vector<double> const* pdVScapeXY) const
1370{
1371 string strFName = m_strOutPath;
1372 stringstream ststrTmp;
1373
1374 strFName.append("profile_");
1375 ststrTmp << FillToWidth('0', 3) << nProfile;
1376 strFName.append(ststrTmp.str());
1377
1378 strFName.append("_parallel_");
1379 ststrTmp.clear();
1380 ststrTmp.str(string());
1381 ststrTmp << FillToWidth('0', 3) << nDistFromProfile;
1382 strFName.append(ststrTmp.str());
1383
1384 strFName.append((nDirection == 0 ? "_F" : "_B"));
1385
1386 strFName.append("_timestep_");
1387 ststrTmp.clear();
1388 ststrTmp.str(string());
1389 ststrTmp << FillToWidth('0', 4) << m_ulIter;
1390 strFName.append(ststrTmp.str());
1391
1392 strFName.append(".csv");
1393
1394 ofstream OutProfStream;
1395 OutProfStream.open(strFName.c_str(), ios::out | ios::trunc);
1396
1397 if (!OutProfStream)
1398 {
1399 // Error, cannot open file
1400 cerr << ERR << "cannot open " << strFName << " for output" << endl;
1401 return false;
1402 }
1403
1404 OutProfStream << "\"Dist\", \"X\", \"Y\", \"Z (before erosion)\", \"Depth/DB\", \"Erosion Potential\", \"Slope\", \"Recession XY\", \"Change Elev Z\", \"Grid X\", \"Grid Y\", \"Weight\", \"For profile " << nProfile << " from coastline " << nCoast << " at timestep " << m_ulIter << "\"" << endl;
1405
1406 for (int i = 0; i < nProfSize; i++)
1407 {
1408 double const dX = dGridCentroidXToExtCRSX(pPtVGridProfile->at(i).nGetX());
1409 double const dY = dGridCentroidYToExtCRSY(pPtVGridProfile->at(i).nGetY());
1410
1411 OutProfStream << pdVDistXY->at(i) << ",\t" << dX << ",\t" << dY << ",\t" << pdVZ->at(i) << ",\t" << pdVDepthOverDB->at(i) << ",\t" << pdVErosionPotentialFunc->at(i) << ",\t" << pdVSlope->at(i) << ",\t" << pdVRecessionXY->at(i) << ",\t" << pdVChangeElevZ->at(i) << ",\t" << pPtVGridProfile->at(i).nGetX() << ",\t" << pPtVGridProfile->at(i).nGetY() << ", \t" << pdVScapeXY->at(i) << endl;
1412 }
1413
1414 OutProfStream.close();
1415
1416 return true;
1417}
1418
1419//===============================================================================================================================
1421//===============================================================================================================================
1423{
1424 // Final write to time series CSV files
1425 if (! bWriteTSFiles())
1427
1428 // Save the values from the RasterGrid array into raster GIS files
1429 if (! bSaveAllRasterGISFiles())
1431
1432 // Save the vector GIS files
1433 if (! bSaveAllVectorGISFiles())
1435
1436 OutStream << " GIS" << m_nGISSave << endl;
1437
1438 // Print out run totals etc.
1439 OutStream << PER_ITER_HEAD1 << endl;
1440 OutStream << PER_ITER_HEAD2 << endl;
1441 OutStream << PER_ITER_HEAD3 << endl;
1442 OutStream << PER_ITER_HEAD4 << endl;
1443 OutStream << PER_ITER_HEAD5 << endl;
1444
1445 OutStream << fixed << setprecision(3);
1446 OutStream << endl << endl;
1447
1448 // Write out hydrology grand totals etc.
1449 OutStream << ENDHYDROLOGYHEAD << endl;
1450 OutStream << "Minimum still water level = " << m_dMinSWLSoFar << endl;
1451 OutStream << "Maximum still water level = " << m_dMaxSWLSoFar << endl;
1452 OutStream << endl;
1453
1454 // Now write out sediment movement grand totals etc.
1455 OutStream << ENDSEDIMENTHEAD << endl << endl;
1456
1457 OutStream << "TOTAL PLATFORM EROSION" << endl;
1458 OutStream << "Potential platform erosion, all size classes = " << m_ldGTotPotentialPlatformErosion * m_dCellArea << " m^3" << endl << endl;
1459 OutStream << "Actual platform erosion, fine = " << m_ldGTotFineActualPlatformErosion * m_dCellArea << " m^3" << endl;
1460 OutStream << "Actual platform erosion, sand = " << m_ldGTotSandActualPlatformErosion * m_dCellArea << " m^3" << endl;
1461 OutStream << "Actual platform erosion, coarse = " << m_ldGTotCoarseActualPlatformErosion * m_dCellArea << " m^3" << endl;
1462 OutStream << "Actual platform erosion, all size classes = " << (m_ldGTotFineActualPlatformErosion + m_ldGTotSandActualPlatformErosion + m_ldGTotCoarseActualPlatformErosion) * m_dCellArea << " m^3" << endl;
1463 OutStream << endl;
1464
1465 OutStream << "TOTAL CLIFF COLLAPSE EROSION" << endl;
1466 OutStream << "Cliff collapse, fine = " << m_ldGTotCliffCollapseFine * m_dCellArea << " m^3" << endl;
1467 OutStream << "Cliff collapse, sand = " << m_ldGTotCliffCollapseSand * m_dCellArea << " m^3" << endl;
1468 OutStream << "Cliff collapse, coarse = " << m_ldGTotCliffCollapseCoarse * m_dCellArea << " m^3" << endl;
1469 OutStream << "Cliff collapse, all size classes = " << (m_ldGTotCliffCollapseFine + m_ldGTotCliffCollapseSand + m_ldGTotCliffCollapseCoarse) * m_dCellArea << " m^3" << endl << endl;
1470 OutStream << "Cliff collapse, fine eroded during deposition = " << m_ldGTotCliffCollapseFineErodedDuringDeposition * m_dCellArea << " m^3" << endl;
1471 OutStream << "Cliff collapse, sand eroded during deposition = " << m_ldGTotCliffCollapseSandErodedDuringDeposition * m_dCellArea << " m^3" << endl;
1472 OutStream << "Cliff collapse, coarse eroded during deposition = " << m_ldGTotCliffCollapseCoarseErodedDuringDeposition * m_dCellArea << " m^3" << endl;
1474 OutStream << endl;
1475
1476 OutStream << "TOTAL DEPOSITION AND SUSPENSION OF CLIFF COLLAPSE TALUS" << endl;
1477 OutStream << "Cliff collapse to suspension, fine = " << m_ldGTotCliffTalusFineToSuspension * m_dCellArea << " m^3" << endl;
1478 OutStream << "Cliff collapse deposition, sand = " << m_ldGTotCliffTalusSandDeposition * m_dCellArea << " m^3" << endl;
1479 OutStream << "Cliff collapse deposition, coarse = " << m_ldGTotCliffTalusCoarseDeposition * m_dCellArea << " m^3" << endl;
1480 OutStream << "Cliff collapse deposition, sand and coarse = " << (m_ldGTotCliffTalusSandDeposition + m_ldGTotCliffTalusCoarseDeposition) * m_dCellArea << " m^3" << endl;
1481 OutStream << endl;
1482
1483 OutStream << "TOTAL BEACH EROSION" << endl;
1484 OutStream << "Potential beach erosion, all size classes = " << m_ldGTotPotentialBeachErosion * m_dCellArea << " m^3" << endl
1485 << endl;
1486 OutStream << "Actual fine beach erosion, fine = " << m_ldGTotActualFineBeachErosion * m_dCellArea << " m^3" << endl;
1487 OutStream << "Actual sand beach erosion, sand = " << m_ldGTotActualSandBeachErosion * m_dCellArea << " m^3" << endl;
1488 OutStream << "Actual coarse beach erosion, coarse = " << m_ldGTotActualCoarseBeachErosion * m_dCellArea << " m^3" << endl;
1489 OutStream << "Actual beach erosion, all size classes = " << (m_ldGTotActualFineBeachErosion + m_ldGTotActualSandBeachErosion + m_ldGTotActualCoarseBeachErosion) * m_dCellArea << " m^3" << endl;
1490 OutStream << endl;
1491
1492 OutStream << "TOTAL BEACH DEPOSITION" << endl;
1493 OutStream << "Beach deposition, sand = " << m_ldGTotSandBeachDeposition * m_dCellArea << " m^3" << endl;
1494 OutStream << "Beach deposition, coarse = " << m_ldGTotCoarseBeachDeposition * m_dCellArea << " m^3" << endl;
1495 OutStream << "Beach deposition, sand and coarse = " << (m_ldGTotSandBeachDeposition + m_ldGTotCoarseBeachDeposition) * m_dCellArea << " m^3" << endl;
1496 OutStream << endl;
1497
1498 OutStream << "TOTAL SEDIMENT INPUT EVENTS" << endl;
1499 OutStream << "Sediment from sediment input events, fine = " << m_ldGTotFineSedimentInput * m_dCellArea << " m^3" << endl;
1500 OutStream << "Sediment from sediment input events, sand = " << m_ldGTotSandSedimentInput * m_dCellArea << " m^3" << endl;
1501 OutStream << "Sediment from sediment input events, coarse = " << m_ldGTotCoarseSedimentInput * m_dCellArea << " m^3" << endl;
1502 OutStream << "Sediment from sediment input events, all size classes = " << (m_ldGTotFineSedimentInput + m_ldGTotSandSedimentInput + m_ldGTotCoarseSedimentInput) * m_dCellArea << " m^3" << endl;
1503 OutStream << endl;
1504
1505 OutStream << "TOTAL SUSPENDED SEDIMENT" << endl;
1506 OutStream << "Suspended fine sediment = " << m_ldGTotSuspendedSediment * m_dCellArea << " m^3" << endl;
1507 OutStream << endl;
1508
1509 OutStream << "TOTAL LOST FROM GRID BY BEACH MOVEMENT" << endl;
1510 OutStream << "Potential sediment lost, all size classes = " << m_ldGTotPotentialSedLostBeachErosion * m_dCellArea << " m^3" << endl;
1511 OutStream << "Actual sediment lost, fine = " << m_ldGTotActualFineLostBeachErosion * m_dCellArea << " m^3" << endl;
1512 OutStream << "Actual sediment lost, sand = " << m_ldGTotActualSandLostBeachErosion * m_dCellArea << " m^3" << endl;
1513 OutStream << "Actual sediment lost, coarse = " << m_ldGTotActualCoarseLostBeachErosion * m_dCellArea << " m^3" << endl;
1514 OutStream << "Actual sediment lost, all size classes = " << (m_ldGTotActualFineLostBeachErosion + m_ldGTotActualSandLostBeachErosion + m_ldGTotActualCoarseLostBeachErosion) * m_dCellArea << " m^3" << endl;
1515 OutStream << endl;
1516
1517 OutStream << "TOTAL LOST FROM GRID BY CLIFF COLLAPSE" << endl;
1518 OutStream << "Sediment lost, sand = " << m_ldGTotSandSedLostCliffCollapse * m_dCellArea << " m^3" << endl;
1519 OutStream << "Sediment lost, coarse = " << m_ldGTotCoarseSedLostCliffCollapse * m_dCellArea << " m^3" << endl;
1520 OutStream << endl;
1521
1522 OutStream << "ALL-PROCESS TOTALS (all size classes)" << endl;
1524 OutStream << "Fine sediment eroded = " << ldFineEroded * m_dCellArea << " m^3" << endl;
1525 OutStream << "Fine sediment to suspension = " << m_ldGTotSuspendedSediment * m_dCellArea << " m^3" << endl;
1526
1527 if (! bFPIsEqual(ldFineEroded, m_ldGTotSuspendedSediment, 1.0L))
1528 OutStream << MASS_BALANCE_ERROR << endl;
1529
1531 OutStream << "Sand sediment eroded = " << ldSandEroded * m_dCellArea << " m^3" << endl;
1532 long double const ldSandDeposited = m_ldGTotCliffTalusSandDeposition + m_ldGTotSandBeachDeposition;
1533 OutStream << "Sand sediment deposited = " << ldSandDeposited * m_dCellArea << " m^3" << endl;
1535 OutStream << "Sand sediment lost from grid = " << ldSandLost * m_dCellArea << " m^3" << endl;
1536
1537 if (! bFPIsEqual(ldSandEroded, (ldSandDeposited + ldSandLost), 1.0L))
1538 OutStream << MASS_BALANCE_ERROR << endl;
1539
1541 OutStream << "Coarse sediment eroded = " << ldCoarseEroded * m_dCellArea << " m^3" << endl;
1542 long double const ldCoarseDeposited = m_ldGTotCliffTalusCoarseDeposition + m_ldGTotCoarseBeachDeposition;
1543 OutStream << "Coarse sediment deposited = " << ldCoarseDeposited * m_dCellArea << " m^3" << endl;
1545 OutStream << "Coarse sediment lost from grid = " << ldCoarseLost * m_dCellArea << " m^3" << endl;
1546
1547 if (! bFPIsEqual(ldCoarseEroded, (ldCoarseDeposited + ldCoarseLost), 1.0L))
1548 OutStream << MASS_BALANCE_ERROR << endl;
1549
1550 OutStream << endl;
1551
1553 OutStream << "Total sediment eroded (all processes) = " << ldActualTotalEroded * m_dCellArea << " m^3" << endl;
1554
1556 OutStream << "Total sediment deposited/to suspension (all processes) = " << ldTotalDepositedAndSuspension * m_dCellArea << " m^3" << endl;
1557
1559 OutStream << "Total sediment lost from grid (all processes) = " << ldTotalLost * m_dCellArea << " m^3" << endl;
1560 OutStream << " = " << 24 * 365.25 * ldTotalLost * m_dCellArea / m_dSimDuration << " m^3/year" << endl;
1561 OutStream << " = " << 24 * ldTotalLost * m_dCellArea / m_dSimDuration << " m^3/day" << endl;
1562 OutStream << " = " << ldTotalLost * m_dCellArea / m_dSimDuration << " m^3/hour" << endl;
1563 OutStream << fixed << setprecision(6);
1564 OutStream << " = " << ldTotalLost * m_dCellArea / (m_dSimDuration * 3600) << " m^3/sec" << endl << endl;
1565 OutStream << fixed << setprecision(3);
1566
1568 {
1569 OutStream << "Grid edge option is ";
1570
1572 OutStream << "CLOSED.";
1574 OutStream << "OPEN.";
1576 OutStream << "RE-CIRCULATING.";
1577
1578 OutStream << endl << endl;
1579 }
1580
1581 // Finally calculate performance details
1582 OutStream << PERFORMHEAD << endl;
1583
1584 // Get the time that the run ended
1585 m_tSysEndTime = time(nullptr);
1586
1587 OutStream << RUN_END_NOTICE << put_time(localtime(&m_tSysEndTime), "%T on %A %d %B %Y") << endl;
1588 OutStream << "Time simulated: " << strDispSimTime(m_dSimDuration) << endl << endl;
1589
1590 // Write to log file
1591 LogStream << "END OF RUN TOTALS =================================================================================================================================================" << endl << endl;
1592
1593 LogStream << "ALL-PROCESS TOTALS (all size classes)" << endl;
1595 LogStream << "Sediment eroded (all processes) = " << ldActualTotalEroded * m_dCellArea << " m^3" << endl;
1596
1597 LogStream << "Sediment deposited and in suspension (all processes) = " << ldTotalDepositedAndSuspension * m_dCellArea << " m^3" << endl;
1598
1599 LogStream << "Sediment lost from grid (all processes) = " << ldTotalLost * m_dCellArea << " m^3" << endl;
1600 LogStream << " = " << 24 * 365.25 * ldTotalLost * m_dCellArea / m_dSimDuration << " m^3/year" << endl;
1601 LogStream << " = " << 24 * ldTotalLost * m_dCellArea / m_dSimDuration << " m^3/day" << endl;
1602 LogStream << " = " << ldTotalLost * m_dCellArea / m_dSimDuration << " m^3/hour" << endl;
1603 LogStream << " = " << setprecision(6) << ldTotalLost * m_dCellArea / (m_dSimDuration * 3600) << " m^3/sec" << endl;
1604 LogStream << endl;
1605 LogStream << fixed << setprecision(3);
1606
1608 {
1609 LogStream << "Grid edge option is ";
1610
1612 LogStream << "CLOSED.";
1614 LogStream << "OPEN.";
1616 LogStream << "RE-CIRCULATING.";
1617
1618 LogStream << endl << endl;
1619
1620 // Output averages for on-profile and between-profile potential shore platform erosion, ideally these are roughly equal
1621 LogStream << fixed << setprecision(6);
1622 LogStream << "On-profile average potential shore platform erosion = " << (m_ulTotPotentialPlatformErosionOnProfiles > 0 ? m_dTotPotentialPlatformErosionOnProfiles / static_cast<double>(m_ulTotPotentialPlatformErosionOnProfiles) : 0) << " mm (n = " << m_ulTotPotentialPlatformErosionOnProfiles << ")" << endl;
1623 LogStream << "Between-profile average potential shore platform erosion = " << (m_ulTotPotentialPlatformErosionBetweenProfiles > 0 ? m_dTotPotentialPlatformErosionBetweenProfiles / static_cast<double>(m_ulTotPotentialPlatformErosionBetweenProfiles) : 0) << " mm (n = " << m_ulTotPotentialPlatformErosionBetweenProfiles << ")" << endl;
1624 LogStream << endl;
1625 }
1626
1627 // Calculate statistics re. memory usage etc.
1629 // CalcTime();
1630 OutStream << endl << "END OF RUN" << endl;
1631 LogStream << endl << "END OF RUN" << endl;
1632
1633 // Need to flush these here (if we don't, the buffer may not get written)
1634 LogStream.flush();
1635 OutStream.flush();
1636
1637 return RTN_OK;
1638}
1639
1640//===============================================================================================================================
1642//===============================================================================================================================
1644{
1645 LogStream << endl << m_ulIter << ": Per-polygon profile info, seawater volume (m^3), and D50 values (mm: a blank D50 value means that there is no unconsolidated sediment on that polygon)." << endl;
1646
1647 LogStream << "-----------|-----------|-----------|-----------|--------------|--------------|" << endl;
1648 LogStream << strCentre("Coast", 11) << "|" << strCentre("Polygon", 11) << "|" << strCentre("Up-coast", 11) << "|" << strCentre("Down-coast", 11) << "|" << strCentre("Seawater", 14) << "|" << strCentre("Uncons d50", 14) << "|" << endl;
1649 LogStream << strCentre("ID", 11) << "|" << strCentre("ID", 11) << "|" << strCentre("Profile ID", 11) << "|" << strCentre("Profile ID", 11) << "|" << strCentre("Volume", 14) << "|" << strCentre("", 14) << "|" << endl;
1650 LogStream << "-----------|-----------|-----------|-----------|--------------|--------------|" << endl;
1651
1652 for (int nCoast = 0; nCoast < static_cast<int>(m_VCoast.size()); nCoast++)
1653 {
1654 for (int n = 0; n < m_VCoast[nCoast].nGetNumPolygons(); n++)
1655 {
1656 CGeomCoastPolygon const* pPolygon = m_VCoast[nCoast].pGetPolygon(n);
1657
1658 LogStream << strIntRight(nCoast, 11) << "|" << strIntRight(pPolygon->nGetPolygonCoastID(), 11) << "|" << strIntRight(pPolygon->nGetUpCoastProfile(), 11) << "|" << strIntRight(pPolygon->nGetDownCoastProfile(), 11) << "|" << strDblRight(pPolygon->dGetSeawaterVolume(), 0, 14) << "|" << strDblRight(pPolygon->dGetAvgUnconsD50(), 2, 14) << "| " << endl;
1659 }
1660 }
1661
1662 LogStream << "-----------|-----------|-----------|-----------|--------------|--------------|" << endl << endl;
1663}
1664
1665//===============================================================================================================================
1667//===============================================================================================================================
1669{
1670 double dTmpTot = 0;
1671 double dTmpFineTot = 0;
1672 double dTmpSandTot = 0;
1673 double dTmpCoarseTot = 0;
1674
1681
1682 // TODO 082 Also show m_dStartIterUnconsFineAllCells etc.
1683
1684 LogStream << m_ulIter << ": Per-polygon pre-existing unconsolidated sediment. Note that this does not include pre-existing unconsolidated sediment outside the polygons.";
1685
1686 if (m_ulIter > 1)
1687 LogStream << " Also the all-polygon total will be slightly different from the all-polygon total at the end of the last timestep, since the coastline and polygons have been re-drawn.";
1688
1689 LogStream << endl;
1690
1691 LogStream << "-----------|-----------|--------------|--------------|--------------|--------------|" << endl;
1692 LogStream << strCentre("Coast", 11) << "|" << strCentre("Polygon", 11) << "|" << strCentre("All", 14) << "|" << strCentre("Fine", 14) << "|" << strCentre("Sand", 14) << "|" << strCentre("Coarse", 14) << "|" << endl;
1693 LogStream << strCentre("ID", 11) << "|" << strCentre("ID", 11) << "|" << strCentre("Sediment", 14) << "|" << strCentre("Sediment", 14) << "|" << strCentre("Sediment", 14) << "|" << strCentre("Sediment", 14) << "|" << endl;
1694 LogStream << "-----------|-----------|--------------|--------------|--------------|--------------|" << endl;
1695
1696 for (int nCoast = 0; nCoast < static_cast<int>(m_VCoast.size()); nCoast++)
1697 {
1698 for (int n = 0; n < m_VCoast[nCoast].nGetNumPolygons(); n++)
1699 {
1700 CGeomCoastPolygon const* pPolygon = m_VCoast[nCoast].pGetPolygon(n);
1701
1702 // Add to this-iteration all-polygon totals of consolidated sediment within polygons
1706
1707 // Now consider unconsolidated sediment
1708 double const dThisFine = pPolygon->dGetPreExistingUnconsFine() + pPolygon->dGetSedimentInputUnconsFine();
1709 double const dThisSand = pPolygon->dGetPreExistingUnconsSand() + pPolygon->dGetSedimentInputUnconsSand();
1710 double const dThisCoarse = pPolygon->dGetPreExistingUnconsCoarse() + pPolygon->dGetSedimentInputUnconsCoarse();
1711
1712 LogStream << strIntRight(nCoast, 11) << "|" << strIntRight(pPolygon->nGetPolygonCoastID(), 11) << "|" << strDblRight((dThisFine + dThisSand + dThisCoarse) * m_dCellArea, 0, 14) << "|" << strDblRight(dThisFine * m_dCellArea, 0, 14) << "|" << strDblRight(dThisSand * m_dCellArea, 0, 14) << "|" << strDblRight(dThisCoarse * m_dCellArea, 0, 14) << "|" << endl;
1713
1714 dTmpFineTot += (dThisFine * m_dCellArea);
1715 dTmpSandTot += (dThisSand * m_dCellArea);
1716 dTmpCoarseTot += (dThisCoarse * m_dCellArea);
1717 dTmpTot += (dThisFine + dThisSand + dThisCoarse) * m_dCellArea;
1718
1719 // Add to this-iteration all-polygon totals of unconsolidated sediment within polygons
1720 m_dTotalFineUnconsInPolygons += dThisFine;
1721 m_dTotalSandUnconsInPolygons += dThisSand;
1722 m_dTotalCoarseUnconsInPolygons += dThisCoarse;
1723 }
1724 }
1725
1726 LogStream << "-----------|-----------|--------------|--------------|--------------|--------------|" << endl;
1727 LogStream << "TOTAL |" << strDblRight(dTmpTot, 0, 14) << "|" << strDblRight(dTmpFineTot, 0, 14) << "|" << strDblRight(dTmpSandTot, 0, 14) << "|" << strDblRight(dTmpCoarseTot, 0, 14) << "|" << endl;
1728 LogStream << "-----------|-----------|--------------|--------------|--------------|--------------|" << endl << endl;
1729}
1730
1731//===============================================================================================================================
1733//===============================================================================================================================
1735{
1736 LogStream << m_ulIter << ": Per-polygon sediment input event totals." << endl;
1737
1738 LogStream << "-----------|-----------|--------------|--------------|--------------|--------------|" << endl;
1739 LogStream << strCentre("Coast", 11) << "|" << strCentre("Polygon", 11) << "|" << strCentre("All", 14) << "|" << strCentre("Fine", 14) << "|" << strCentre("Sand", 14) << "|" << strCentre("Coarse", 14) << "|" << endl;
1740 LogStream << strCentre("ID", 11) << "|" << strCentre("ID", 11) << "|" << strCentre("Sediment", 14) << "|" << strCentre("Sediment", 14) << "|" << strCentre("Sediment", 14) << "|" << strCentre("Sediment", 14) << "|" << endl;
1741 LogStream << "-----------|-----------|--------------|--------------|--------------|--------------|" << endl;
1742
1743 double dTmpFineTot = 0;
1744 double dTmpSandTot = 0;
1745 double dTmpCoarseTot = 0;
1746 double dTmpTot = 0;
1747
1748 for (int nCoast = 0; nCoast < static_cast<int>(m_VCoast.size()); nCoast++)
1749 {
1750 for (int n = 0; n < m_VCoast[nCoast].nGetNumPolygons(); n++)
1751 {
1752 CGeomCoastPolygon const* pPolygon = m_VCoast[nCoast].pGetPolygon(n);
1753
1754 double const dThisFine = pPolygon->dGetSedimentInputUnconsFine();
1755 double const dThisSand = pPolygon->dGetSedimentInputUnconsSand();
1756 double const dThisCoarse = pPolygon->dGetSedimentInputUnconsCoarse();
1757
1758 LogStream << strIntRight(nCoast, 11) << "|" << strIntRight(pPolygon->nGetPolygonCoastID(), 11) << "|" << strDblRight((dThisFine + dThisSand + dThisCoarse) * m_dCellArea, 0, 14) << "|" << strDblRight(dThisFine * m_dCellArea, 0, 14) << "|" << strDblRight(dThisSand * m_dCellArea, 0, 14) << "|" << strDblRight(dThisCoarse * m_dCellArea, 0, 14) << "|" << endl;
1759
1760 dTmpFineTot += (dThisFine * m_dCellArea);
1761 dTmpSandTot += (dThisSand * m_dCellArea);
1762 dTmpCoarseTot += (dThisCoarse * m_dCellArea);
1763 dTmpTot += (dThisFine + dThisSand + dThisCoarse) * m_dCellArea;
1764 }
1765 }
1766
1767 LogStream << "-----------|-----------|--------------|--------------|--------------|--------------|" << endl;
1768 LogStream << "TOTAL |" << strDblRight(dTmpTot, 0, 14) << "|" << strDblRight(dTmpFineTot, 0, 14) << "|" << strDblRight(dTmpSandTot, 0, 14) << "|" << strDblRight(dTmpCoarseTot, 0, 14) << "|" << endl;
1769 LogStream << "-----------|-----------|--------------|--------------|--------------|--------------|" << endl << endl;
1770}
1771
1772//===============================================================================================================================
1774//===============================================================================================================================
1776{
1777 double dTmpTot = 0;
1778 double const dTmpFineTot = 0;
1779 double dTmpSandTot = 0;
1780 double dTmpCoarseTot = 0;
1781
1782 LogStream << endl << m_ulIter << ": Per-polygon unconsolidated sand/coarse sediment derived from erosion of the consolidated shore platform (all m^3). All fine sediment eroded from the shore platform goes to suspension." << endl;
1783
1784 LogStream << "-----------|-----------|--------------|--------------|--------------|--------------|" << endl;
1785 LogStream << strCentre("Coast", 11) << "|" << strCentre("Polygon", 11) << "|" << strCentre("All", 14) << "|" << strCentre("Fine", 14) << "|" << strCentre("Sand", 14) << "|" << strCentre("Coarse", 14) << "|" << endl;
1786 LogStream << strCentre("ID", 11) << "|" << strCentre("ID", 11) << "|" << strCentre("Sediment", 14) << "|" << strCentre("Sediment", 14) << "|" << strCentre("Sediment", 14) << "|" << strCentre("Sediment", 14) << "|" << endl;
1787 LogStream << "-----------|-----------|--------------|--------------|--------------|--------------|" << endl;
1788
1789 for (int nCoast = 0; nCoast < static_cast<int>(m_VCoast.size()); nCoast++)
1790 {
1791 for (int n = 0; n < m_VCoast[nCoast].nGetNumPolygons(); n++)
1792 {
1793 CGeomCoastPolygon const* pPolygon = m_VCoast[nCoast].pGetPolygon(n);
1794
1795 LogStream << strIntRight(nCoast, 11) << "|" << strIntRight(pPolygon->nGetPolygonCoastID(), 11) << "|" << strDblRight((pPolygon->dGetPlatformErosionUnconsSand() + pPolygon->dGetPlatformErosionUnconsCoarse()) * m_dCellArea, 0, 14) << "|" << strDblRight(0, 0, 14) << "|" << strDblRight(pPolygon->dGetPlatformErosionUnconsSand() * m_dCellArea, 0, 14) << "|" << strDblRight(pPolygon->dGetPlatformErosionUnconsCoarse() * m_dCellArea, 0, 14) << "|" << endl;
1796
1797 dTmpTot += (pPolygon->dGetPlatformErosionUnconsSand() + pPolygon->dGetPlatformErosionUnconsCoarse()) * m_dCellArea;
1798 dTmpSandTot += (pPolygon->dGetPlatformErosionUnconsSand() * m_dCellArea);
1799 dTmpCoarseTot += (pPolygon->dGetPlatformErosionUnconsCoarse() * m_dCellArea);
1800 }
1801 }
1802
1803 LogStream << "-----------|-----------|--------------|--------------|--------------|--------------|" << endl;
1804 LogStream << "TOTAL from platform |" << strDblRight(dTmpTot, 0, 14) << "|" << strDblRight(dTmpFineTot, 0, 14) << "|" << strDblRight(dTmpSandTot, 0, 14) << "|" << strDblRight(dTmpCoarseTot, 0, 14) << "|" << endl;
1805 LogStream << "-----------|-----------|--------------|--------------|--------------|--------------|" << endl << endl;
1806}
1807
1808//===============================================================================================================================
1810//===============================================================================================================================
1812{
1813 LogStream << m_ulIter << ": Per-polygon cliff collapse (all m^3). Fine sediment derived from cliff collapse goes to suspension, sand/coarse sediment derived from cliff collapse becomes unconsolidated talus (DDPD = During Dean Profile Deposition)." << endl;
1814
1815 LogStream << "-----------|-----------|--------------------------------------------|-----------------------------|--------------------------------------------|--------------------------------------------|" << endl;
1816 LogStream << strCentre("Coast", 11) << "|" << strCentre("Polygon", 11) << "|" << strCentre("All sediment", 44) << "|" << strCentre("Fine sediment", 29) << "|" << strCentre("Sand sediment", 44) << "|" << strCentre("Coarse sediment", 44) << "|" << endl;
1817 LogStream << strCentre("ID", 11) << "|" << strCentre("ID", 11) << "|" << strCentre("Eroded Cliff", 15) << strCentre("Eroded DDPD", 15) << strCentre("Deposited", 14) << "|" << strCentre("Eroded", 14) << "|" << strCentre("Suspension", 14) << "|" << strCentre("Eroded Cliff", 15) << strCentre("Eroded DDPD", 15) << strCentre("Deposited", 14) << "|" << strCentre("Eroded Cliff", 15) << strCentre("Eroded DDPD", 15) << strCentre("Deposited", 14) << "|" << endl;
1818 LogStream << "-----------|-----------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|" << endl;
1819
1820 double dTmpErosionTot = 0;
1821 double dTmpErosionDDPDTot = 0;
1822 double dTmpDepositTot = 0;
1823
1824 double dTmpErosionFineTot = 0;
1825 double dTmpSuspensionFineTot = 0;
1826
1827 double dTmpErosionSandTot = 0;
1828 double dTmpErosionSandDDPDTot = 0;
1829 double dTmpDepositSandTot = 0;
1830
1831 double dTmpErosionCoarseTot = 0;
1832 double dTmpErosionCoarseDDPDTot = 0;
1833 double dTmpDepositCoarseTot = 0;
1834
1835 for (int nCoast = 0; nCoast < static_cast<int>(m_VCoast.size()); nCoast++)
1836 {
1837 for (int n = 0; n < m_VCoast[nCoast].nGetNumPolygons(); n++)
1838 {
1839 CGeomCoastPolygon const* pPolygon = m_VCoast[nCoast].pGetPolygon(n);
1840
1841 LogStream << strIntRight(nCoast, 11) << "|" << strIntRight(pPolygon->nGetPolygonCoastID(), 11)
1842 // All
1844 // Fine
1845 << strDblRight(pPolygon->dGetCliffCollapseErosionFine(), 0, 14) << "|" << strDblRight(pPolygon->dGetCliffCollapseToSuspensionFine(), 0, 14) << "|"
1846 // Sand
1847 << strDblRight(pPolygon->dGetCliffCollapseErosionSand(), 0, 14) << " " << strDblRight(pPolygon->dGetCliffCollapseSandErodedDeanProfile() * m_dCellArea, 0, 14) << "|" << strDblRight(pPolygon->dGetCliffCollapseUnconsSandDeposition() * m_dCellArea, 0, 14) << "|"
1848 // Coarse
1849 << strDblRight(pPolygon->dGetCliffCollapseErosionCoarse(), 0, 14) << " " << strDblRight(pPolygon->dGetCliffCollapseCoarseErodedDeanProfile() * m_dCellArea, 0, 14) << "|" << strDblRight(pPolygon->dGetCliffCollapseUnconsCoarseDeposition() * m_dCellArea, 0, 14) << "|" << endl;
1850
1851 dTmpErosionTot += ((pPolygon->dGetCliffCollapseErosionFine() + pPolygon->dGetCliffCollapseErosionSand() + pPolygon->dGetCliffCollapseErosionCoarse()) * m_dCellArea);
1852
1853 dTmpErosionDDPDTot += ((pPolygon->dGetCliffCollapseSandErodedDeanProfile() + pPolygon->dGetCliffCollapseCoarseErodedDeanProfile()) * m_dCellArea);
1854
1856
1857 dTmpErosionFineTot += (pPolygon->dGetCliffCollapseErosionFine() * m_dCellArea);
1858 dTmpSuspensionFineTot += (pPolygon->dGetCliffCollapseToSuspensionFine() * m_dCellArea);
1859
1860 dTmpErosionSandTot += ((pPolygon->dGetCliffCollapseErosionSand()) * m_dCellArea);
1861 dTmpErosionSandDDPDTot += ((pPolygon->dGetCliffCollapseSandErodedDeanProfile()) * m_dCellArea);
1862 dTmpDepositSandTot += (pPolygon->dGetCliffCollapseUnconsSandDeposition() * m_dCellArea);
1863
1864 dTmpErosionCoarseTot += ((pPolygon->dGetCliffCollapseErosionCoarse()) * m_dCellArea);
1865 dTmpErosionCoarseDDPDTot += ((pPolygon->dGetCliffCollapseCoarseErodedDeanProfile()) * m_dCellArea);
1866 dTmpDepositCoarseTot += pPolygon->dGetCliffCollapseUnconsCoarseDeposition() * m_dCellArea;
1867 }
1868 }
1869
1870 LogStream << "-----------|-----------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|" << endl;
1871 LogStream << "TOTAL cliff collapse |" << strDblRight(dTmpErosionTot, 0, 14) << " " << strDblRight(dTmpErosionDDPDTot, 0, 14) << "|" << strDblRight(dTmpDepositTot, 0, 14) << "|"
1872 << strDblRight(dTmpErosionFineTot, 0, 14) << "|" << strDblRight(dTmpSuspensionFineTot, 0, 14) << "|"
1873 << strDblRight(dTmpErosionSandTot, 0, 14) << " " << strDblRight(dTmpErosionSandDDPDTot, 0, 14) << "|" << strDblRight(dTmpDepositSandTot, 0, 14) << "|"
1874 << strDblRight(dTmpErosionCoarseTot, 0, 14) << " " << strDblRight(dTmpErosionCoarseDDPDTot, 0, 14) << "|" << strDblRight(dTmpDepositCoarseTot, 0, 14) << "|" << endl;
1875 LogStream << "-----------|-----------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|" << endl << endl;
1876}
1877
1878//===============================================================================================================================
1880//===============================================================================================================================
1882{
1883 LogStream << m_ulIter << ": Per-polygon totals of stored unconsolidated beach sediment prior to polygon-to-polygon movement (all m^3). Note that this does not include unconsolidated sediment stored outside the polygons." << endl;
1884
1885 LogStream << "-----------|-----------|--------------|--------------|--------------|--------------|" << endl;
1886 LogStream << strCentre("Coast", 11) << "|" << strCentre("Polygon", 11) << "|" << strCentre("All", 14) << "|" << strCentre("Fine", 14) << "|" << strCentre("Sand", 14) << "|" << strCentre("Coarse", 14) << "|" << endl;
1887 LogStream << strCentre("ID", 11) << "|" << strCentre("ID", 11) << "|" << strCentre("Sediment", 14) << "|" << strCentre("Sediment", 14) << "|" << strCentre("Sediment", 14) << "|" << strCentre("Sediment", 14) << "|" << endl;
1888 LogStream << "-----------|-----------|--------------|--------------|--------------|--------------|" << endl;
1889
1890 double dTmpTot = 0;
1891 double dTmpFineTot = 0;
1892 double dTmpSandTot = 0;
1893 double dTmpCoarseTot = 0;
1894
1895 for (int nCoast = 0; nCoast < static_cast<int>(m_VCoast.size()); nCoast++)
1896 {
1897 for (int n = 0; n < m_VCoast[nCoast].nGetNumPolygons(); n++)
1898 {
1899 CGeomCoastPolygon const* pPolygon = m_VCoast[nCoast].pGetPolygon(n);
1900
1901 double const dFine = pPolygon->dGetPreExistingUnconsFine();
1902 double const dSand = pPolygon->dGetPreExistingUnconsSand();
1903 double const dCoarse = pPolygon->dGetPreExistingUnconsCoarse();
1904
1905 LogStream << strIntRight(nCoast, 11) << "|" << strIntRight(pPolygon->nGetPolygonCoastID(), 11) << "|" << strDblRight((dFine + dSand + dCoarse) * m_dCellArea, 0, 14) << "|" << strDblRight(dFine * m_dCellArea, 0, 14) << "|" << strDblRight(dSand * m_dCellArea, 0, 14) << "|" << strDblRight(dCoarse * m_dCellArea, 0, 14) << "|" << endl;
1906
1907 dTmpTot += (dFine + dSand + dCoarse) * m_dCellArea;
1908 dTmpFineTot += (dFine * m_dCellArea);
1909 dTmpSandTot += (dSand * m_dCellArea);
1910 dTmpCoarseTot += (dCoarse * m_dCellArea);
1911 }
1912 }
1913
1914 LogStream << "-----------|-----------|--------------|--------------|--------------|--------------|" << endl;
1915 LogStream << "TOTAL |" << strDblRight(dTmpTot, 0, 14) << "|" << strDblRight(dTmpFineTot, 0, 14) << "|" << strDblRight(dTmpSandTot, 0, 14) << "|" << strDblRight(dTmpCoarseTot, 0, 14) << "|" << endl;
1916 LogStream << "-----------|-----------|--------------|--------------|--------------|--------------|" << endl << endl;
1917}
1918
1919//===============================================================================================================================
1921//===============================================================================================================================
1923{
1924 LogStream << m_ulIter << ": Per-polygon potential (i.e. not considering sediment availability) erosion of all size classes of unconsolidated beach sediment (-ve, all m^3), calculated with the ";
1925
1927 LogStream << "CERC";
1928
1930 LogStream << "Kamphuis";
1931
1932 LogStream << " equation." << endl;
1933
1934 LogStream << "-----------|-----------|--------------|" << endl;
1935 LogStream << strCentre("Coast", 11) << "|" << strCentre("Polygon", 11) << "|" << strCentre("Potential", 14) << "|" << endl;
1936 LogStream << strCentre("", 11) << "|" << strCentre("Coast ID", 11) << "|" << strCentre("Erosion", 14) << "|" << endl;
1937 LogStream << "-----------|-----------|--------------|" << endl;
1938
1939 double dTmpTot = 0;
1940
1941 for (int nCoast = 0; nCoast < static_cast<int>(m_VCoast.size()); nCoast++)
1942 {
1943 for (int n = 0; n < m_VCoast[nCoast].nGetNumPolygons(); n++)
1944 {
1945 CGeomCoastPolygon const* pPolygon = m_VCoast[nCoast].pGetPolygon(n);
1946
1947 LogStream << strIntRight(nCoast, 11) << "|" << strIntRight(pPolygon->nGetPolygonCoastID(), 11) << "|" << strDblRight(pPolygon->dGetPotentialErosion() * m_dCellArea, 0, 14) << "|" << endl;
1948
1949 dTmpTot += (pPolygon->dGetPotentialErosion() * m_dCellArea);
1950 }
1951 }
1952
1953 LogStream << "-----------|-----------|--------------|" << endl;
1954 LogStream << "TOTAL |" << strDblRight(dTmpTot, 0, 14) << "|" << endl;
1955 LogStream << "-----------|-----------|--------------|" << endl << endl;
1956}
1957
1958// //===============================================================================================================================
1959// //! Writes to the log file a table showing per-polygon supply-limited erosion of unconsolidated beach sediment
1960// //===============================================================================================================================
1961// void CSimulation::WritePolygonUnconsErosion(int const nCoast)
1962// {
1963// LogStream << m_ulIter << ": per-polygon supply-limited erosion of unconsolidated beach sediment (-ve, all m^3). All fine sediment eroded goes to suspension." << endl;
1964//
1965// LogStream << "-----------|-----------|--------------|--------------|--------------|--------------|" << endl;
1966// LogStream << strCentre("Coast", 11) << "|" << strCentre("Polygon", 11) << "|" << strCentre("All", 14) << "|" << strCentre("Fine", 14) <<"|" << strCentre("Sand", 14) << "|" << strCentre("Coarse", 14) << "|" << endl;
1967// LogStream << strCentre("", 11) << "|" << strCentre("Coast ID", 11) << "|" << strCentre("Estimated", 14) << "|" << strCentre("Estimated", 14) <<"|" << strCentre("Estimated", 14) << "|" << strCentre("Estimated", 14) << "|" << endl;
1968// LogStream << "-----------|-----------|--------------|--------------|--------------|--------------|" << endl;
1969//
1970// double
1971// dTmpTot = 0,
1972// dTmpFineTot = 0,
1973// dTmpSandTot = 0,
1974// dTmpCoarseTot = 0;
1975//
1976// for (int nPoly = 0; nPoly < m_VCoast[nCoast].nGetNumPolygons(); nPoly++)
1977// {
1978// CGeomCoastPolygon const* pPolygon = m_VCoast[nCoast].pGetPolygon(nPoly);
1979//
1980// LogStream << strIntRight(nCoast, 11) << "|" << strIntRight(m_VCoast[nCoast].pGetPolygon(nPoly)->nGetPolygonCoastID(), 11) << "|" << strDblRight((pPolygon->dGetBeachErosionUnconsFine() + pPolygon->dGetBeachErosionUnconsSand() + pPolygon->dGetBeachErosionUnconsCoarse()) * m_dCellArea, 0, 14) << "|" << strDblRight(pPolygon->dGetBeachErosionUnconsFine() * m_dCellArea, 0, 14) << "|" << strDblRight(pPolygon->dGetBeachErosionUnconsSand() * m_dCellArea, 0, 14) << "|" << strDblRight(pPolygon->dGetBeachErosionUnconsCoarse() * m_dCellArea, 0, 14) << "|" << endl;
1981//
1982// dTmpTot += (pPolygon->dGetBeachErosionUnconsFine() + pPolygon->dGetBeachErosionUnconsSand() + pPolygon->dGetBeachErosionUnconsCoarse()) * m_dCellArea;
1983// dTmpFineTot += (pPolygon->dGetBeachErosionUnconsFine() * m_dCellArea);
1984// dTmpSandTot += (pPolygon->dGetBeachErosionUnconsSand() * m_dCellArea);
1985// dTmpCoarseTot += (pPolygon->dGetBeachErosionUnconsCoarse() * m_dCellArea);
1986// }
1987//
1988// LogStream << "-----------|-----------|--------------|--------------|--------------|--------------|" << endl;
1989// LogStream << "TOTAL estimated erosion|" << strDblRight(dTmpTot, 0, 14) << "|" << strDblRight(dTmpFineTot, 0, 14) << "|" << strDblRight(dTmpSandTot, 0, 14) << "|" << strDblRight(dTmpCoarseTot, 0, 14) << "|" << endl;
1990// LogStream << "-----------|-----------|--------------|--------------|--------------|--------------|" << endl << endl;
1991// }
1992
1993//===============================================================================================================================
1995//===============================================================================================================================
1996void CSimulation::WritePolygonUnsortedSequence(vector<vector<vector<int>>>& pnVVVAllCoastPolyAndAdjacent)
1997{
1998 LogStream << m_ulIter << ": Unsorted sequence of polygon processing (-9999 = leaves grid)" << endl;
1999 LogStream << "-----------|-----------|-----------|----------------------|" << endl;
2000 LogStream << strCentre("From", 11) << "|" << strCentre("From", 11) << "|" << strCentre("Direction", 11) << "|" << strCentre("To", 22) << "|" << endl;
2001 LogStream << strCentre("Coast ID", 11) << "|" << strCentre("Polygon ID", 11) << "|" << strCentre("", 11) << "|" << strCentre("(Coast ID, Polygon ID)", 22) << "|" << endl;
2002 LogStream << "-----------|-----------|-----------|----------------------|" << endl;
2003
2004 for (int nCoast = 0; nCoast < static_cast<int>(pnVVVAllCoastPolyAndAdjacent.size()); nCoast++)
2005 {
2006 for (int nPoly = 0; nPoly < static_cast<int>(pnVVVAllCoastPolyAndAdjacent[nCoast].size()); nPoly++)
2007 {
2008 CGeomCoastPolygon const* pPolygon = m_VCoast[nCoast].pGetPolygon(pnVVVAllCoastPolyAndAdjacent[nCoast][nPoly][0]);
2009
2010 // For the list of adjacent polygons
2011 vector<int> nVTmp;
2012
2013 for (int m = 0; m < static_cast<int>(pnVVVAllCoastPolyAndAdjacent[nCoast][nPoly].size()); m++)
2014 {
2015 if (m == 0)
2016 {
2017 LogStream << strIntRight(nCoast, 11) << "|";
2018 LogStream << strIntRight(pPolygon->nGetPolygonCoastID(), 11) << "|";
2019 continue;
2020 }
2021
2022 if (m == 1)
2023 {
2024 if (pnVVVAllCoastPolyAndAdjacent[nCoast][nPoly][1] == true)
2025 LogStream << strCentre("DOWN ", 11) << "|";
2026 else
2027 LogStream << strCentre("UP ", 11) << "|";
2028
2029 continue;
2030 }
2031
2032 // Add to the list of adjacent polygons
2033 nVTmp.push_back(pnVVVAllCoastPolyAndAdjacent[nCoast][nPoly][m]);
2034
2035 if (m == static_cast<int>(pnVVVAllCoastPolyAndAdjacent[nCoast][nPoly].size()) - 1)
2036 {
2037 // No more adjacent polygons, so sort the copy
2038 sort(nVTmp.begin(), nVTmp.end());
2039
2040 // And write it out
2041 string strTmp;
2042 for (int mm = 0; mm < static_cast<int>(nVTmp.size()); mm++)
2043 {
2044 strTmp += "(";
2045 strTmp += to_string(nCoast); // TODO 090 assumes that sediment never moves from one coastline to another coastline
2046 strTmp +=", ";
2047 strTmp += to_string(nVTmp[mm]);
2048 strTmp += ")";
2049
2050 if (mm < static_cast<int>(nVTmp.size()) - 1)
2051 strTmp += " ";
2052 }
2053
2054 LogStream << strRight(strTmp, 22) << "|";
2055 }
2056 }
2057 LogStream << endl;
2058 }
2059 }
2060
2061 LogStream << "-----------|-----------|-----------|----------------------|" << endl << endl;
2062}
2063
2064//===============================================================================================================================
2066//===============================================================================================================================
2067void CSimulation::WritePolygonSortedSequence(vector<vector<vector<int>>>& pnVVVAllCoastPolyAndAdjacent)
2068{
2069 // Show sorted order of polygon processing, and any circularities
2070 LogStream << m_ulIter << ": Sorted sequence of polygon processing (" << INT_NODATA << " = leaves grid), and any X -> Y -> X circularities" << endl;
2071
2072 LogStream << "-----------|-----------|-----------|----------------------|----------------------|" << endl;
2073 LogStream << strCentre("From", 11) << "|" << strCentre("From", 11) << "|" << strCentre("Direction", 11) << "|" << strCentre("To", 22) << "|" << strCentre("Circularity", 22) << "|" << endl;
2074 LogStream << strCentre("Coast ID", 11) << "|" << strCentre("Polygon ID", 11) << "|" << strCentre("", 11) << "|" << strCentre("(Coast ID, Polygon ID)", 22) << "|" << strCentre("", 22) << "|" << endl;
2075 LogStream << "-----------|-----------|-----------|----------------------|----------------------|" << endl;
2076
2077 for (int nCoast = 0; nCoast < static_cast<int>(pnVVVAllCoastPolyAndAdjacent.size()); nCoast++)
2078 {
2079 for (int nPoly = 0; nPoly < static_cast<int>(pnVVVAllCoastPolyAndAdjacent[nCoast].size()); nPoly++)
2080 {
2081 const CGeomCoastPolygon* pPoly = m_VCoast[nCoast].pGetPolygon(pnVVVAllCoastPolyAndAdjacent[nCoast][nPoly][0]);
2082 vector<int> VCirc = *pPoly->VnGetCircularities();
2083
2084 LogStream << strIntRight(nCoast, 11) << "|" << strIntRight(pPoly->nGetPolygonCoastID(), 11) << "|";
2085
2086 // Up-coast or down-coast sediment movement?
2087 if (pnVVVAllCoastPolyAndAdjacent[nCoast][nPoly][1] == true)
2088 LogStream << strCentre("DOWN ", 11) << "|";
2089 else
2090 LogStream << strCentre("UP ", 11) << "|";
2091
2092 // Now the 'To' polygons: first copy the list of adjacent polygons
2093 vector<int> nVTmp;
2094
2095 for (int m = 2; m < static_cast<int>(pnVVVAllCoastPolyAndAdjacent[nCoast][nPoly].size()); m++)
2096 nVTmp.push_back(pnVVVAllCoastPolyAndAdjacent[nCoast][nPoly][m]);
2097
2098 // Now sort the copy
2099 sort(nVTmp.begin(), nVTmp.end());
2100
2101 // And write it out
2102 string strTmp;
2103
2104 for (int m = 0; m < static_cast<int>(nVTmp.size()); m++)
2105 {
2106 strTmp += "(";
2107 strTmp += to_string(nCoast); // TODO 090 assumes that sediment never moves from one coastline to another coastline
2108 strTmp +=", ";
2109 strTmp += to_string(nVTmp[m]);
2110 strTmp += ")";
2111
2112 if (m < static_cast<int>(nVTmp.size()) - 1)
2113 strTmp += " ";
2114 }
2115
2116 LogStream << strRight(strTmp, 22) << "|";
2117
2118 // Now show any circularities
2119 strTmp = "";
2120
2121 if (!VCirc.empty())
2122 {
2123 // There is at least one circularity
2124 for (unsigned int i = 0; i < VCirc.size(); i++)
2125 {
2126 strTmp += to_string(VCirc[i]);
2127
2128 if (i < (VCirc.size() - 1))
2129 strTmp += " ";
2130 }
2131 }
2132
2133 LogStream << strCentre(strTmp, 22) << "|" << endl;
2134 }
2135 }
2136
2137 LogStream << "-----------|-----------|-----------|----------------------|----------------------|" << endl << endl;
2138}
2139
2140//===============================================================================================================================
2142//===============================================================================================================================
2143void CSimulation::WritePolygonActualMovement(vector<vector<vector<int>>>& pnVVVAllCoastPolyAndAdjacent)
2144{
2145 // Show estimated polygon-to-polygon movement
2146 LogStream << m_ulIter << ": Per-polygon erosion and deposition of unconsolidated beach sediment, all m^3. Fine sediment is moved to suspension, not deposited (DDPD = During Dean Profile Deposition)." << endl;
2147
2148 LogStream << "-----------|-----------|--------------------------------------------|-----------------------------|--------------------------------------------|--------------------------------------------|" << endl;
2149 LogStream << strCentre("Coast ID", 11) << "|" << strCentre("Polygon ID", 11) << "|" << strCentre("All", 44) << "|" << strCentre("Fine", 29) << "|" << strCentre("Sand", 44) << "|" << strCentre("Coarse", 44) << "|" << endl;
2150 LogStream << strCentre("", 11) << "|" << strCentre("", 11) << "|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|" << endl;
2151 LogStream << strCentre("", 11) << "|" << strCentre("", 11) << "|" << strCentre("Erosion", 14) << " " << strCentre("Erosion DPDD", 14) << "|" << strCentre("Dep + Susp", 14) << "|" << strCentre("Erosion", 14) << "|" << strCentre("Suspension", 14) << "|" << strCentre("Erosion", 14) << " " << strCentre("Erosion DPDD", 14) << "|" << strCentre("Deposition", 14) << "|" << strCentre("Erosion", 14) << " " << strCentre("Erosion DPDD", 14) << "|" << strCentre("Deposition", 14) << "|" << endl;
2152 LogStream << "-----------|-----------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|" << endl;
2153
2154 double dTmpTotAllErosion = 0;
2155 double dTmpTotAllErosionDDPD = 0;
2156 double dTmpTotAllDeposition = 0;
2157
2158 double dTmpFineErosion = 0;
2159 // double dTmpFineDeposition = 0;
2160
2161 double dTmpSandErosion = 0;
2162 double dTmpSandErosionDDPD = 0;
2163 double dTmpSandDeposition = 0;
2164
2165 double dTmpCoarseErosion = 0;
2166 double dTmpCoarseErosionDDPD = 0;
2167 double dTmpCoarseDeposition = 0;
2168
2169 for (int nCoast = 0; nCoast < static_cast<int>(pnVVVAllCoastPolyAndAdjacent.size()); nCoast++)
2170 {
2171 for (int n = 0; n < m_VCoast[nCoast].nGetNumPolygons(); n++)
2172 {
2173 int const nPoly = pnVVVAllCoastPolyAndAdjacent[nCoast][n][0];
2174
2175 double const dAllErosionNotDDPD = -m_VCoast[nCoast].pGetPolygon(nPoly)->dGeBeachErosionAllUncons() - (m_VCoast[nCoast].pGetPolygon(nPoly)->dGetBeachSandErodedDeanProfile() + m_VCoast[nCoast].pGetPolygon(nPoly)->dGetBeachCoarseErodedDeanProfile());
2176 double const dSandErosionNotDDPD = -m_VCoast[nCoast].pGetPolygon(nPoly)->dGetBeachErosionUnconsSand() - m_VCoast[nCoast].pGetPolygon(nPoly)->dGetBeachSandErodedDeanProfile();
2177 double const dCoarseErosionNotDDPD = -m_VCoast[nCoast].pGetPolygon(nPoly)->dGetBeachErosionUnconsCoarse() - m_VCoast[nCoast].pGetPolygon(nPoly)->dGetBeachCoarseErodedDeanProfile();
2178
2179 LogStream << strIntRight(nCoast, 11) << "|" << strIntRight(m_VCoast[nCoast].pGetPolygon(nPoly)->nGetPolygonCoastID(), 11) << "|"
2180 // All
2181 << strDblRight(dAllErosionNotDDPD * m_dCellArea, 0, 14) << " " << strDblRight((m_VCoast[nCoast].pGetPolygon(nPoly)->dGetBeachSandErodedDeanProfile() + m_VCoast[nCoast].pGetPolygon(nPoly)->dGetBeachCoarseErodedDeanProfile()) * m_dCellArea, 0, 14) << "|" << strDblRight(m_VCoast[nCoast].pGetPolygon(nPoly)->dGetBeachDepositionAndSuspensionAllUncons() * m_dCellArea, 0, 14) << "|"
2182 // Fine
2183 << strDblRight(-m_VCoast[nCoast].pGetPolygon(nPoly)->dGetBeachErosionUnconsFine() * m_dCellArea, 0, 14) << "|" << strDblRight(-m_VCoast[nCoast].pGetPolygon(nPoly)->dGetBeachErosionUnconsFine() * m_dCellArea, 0, 14) << "|"
2184 // Sand
2185 << strDblRight(dSandErosionNotDDPD * m_dCellArea, 0, 14) << " " << strDblRight(m_VCoast[nCoast].pGetPolygon(nPoly)->dGetBeachSandErodedDeanProfile() * m_dCellArea, 0, 14) << "|" << strDblRight(m_VCoast[nCoast].pGetPolygon(nPoly)->dGetBeachDepositionUnconsSand() * m_dCellArea, 0, 14) << "|"
2186 // Coarse
2187 << strDblRight(dCoarseErosionNotDDPD * m_dCellArea, 0, 14) << " " << strDblRight(m_VCoast[nCoast].pGetPolygon(nPoly)->dGetBeachCoarseErodedDeanProfile() * m_dCellArea, 0, 14) << "|" << strDblRight(m_VCoast[nCoast].pGetPolygon(nPoly)->dGetToDoBeachDepositionUnconsCoarse() * m_dCellArea, 0, 14) << "|" << endl;
2188
2189 dTmpTotAllErosion += (dAllErosionNotDDPD * m_dCellArea);
2190 dTmpTotAllErosionDDPD += ((m_VCoast[nCoast].pGetPolygon(nPoly)->dGetBeachSandErodedDeanProfile() + m_VCoast[nCoast].pGetPolygon(nPoly)->dGetBeachCoarseErodedDeanProfile()) * m_dCellArea);
2191 dTmpTotAllDeposition += (m_VCoast[nCoast].pGetPolygon(nPoly)->dGetBeachDepositionAndSuspensionAllUncons() * m_dCellArea);
2192
2193 dTmpFineErosion += (m_VCoast[nCoast].pGetPolygon(nPoly)->dGetBeachErosionUnconsFine() * m_dCellArea);
2194 // dTmpFineDeposition +=
2195
2196 dTmpSandErosion += (dSandErosionNotDDPD * m_dCellArea);
2197 dTmpSandErosionDDPD += (m_VCoast[nCoast].pGetPolygon(nPoly)->dGetBeachSandErodedDeanProfile() * m_dCellArea);
2198 dTmpSandDeposition += (m_VCoast[nCoast].pGetPolygon(nPoly)->dGetBeachDepositionUnconsSand() * m_dCellArea);
2199
2200 dTmpCoarseErosion += (dCoarseErosionNotDDPD * m_dCellArea);
2201 dTmpCoarseErosionDDPD += (m_VCoast[nCoast].pGetPolygon(nPoly)->dGetBeachCoarseErodedDeanProfile() * m_dCellArea);
2202 dTmpCoarseDeposition += (m_VCoast[nCoast].pGetPolygon(nPoly)->dGetToDoBeachDepositionUnconsCoarse() * m_dCellArea);
2203 }
2204 }
2205
2206 LogStream << "-----------|-----------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|" << endl;
2207 LogStream << "Lost from grid |" << strLeft("", 14) << "|" << strLeft("", 14) << "|" << strDblRight((m_dThisIterLeftGridUnconsSand + m_dThisIterLeftGridUnconsCoarse) * m_dCellArea, 0, 14) << "|" << strLeft("", 14) << "|" << strLeft("", 14) << "|" << strLeft("", 14) << "|" << strLeft("", 14) << "|" << strDblRight(m_dThisIterLeftGridUnconsSand * m_dCellArea, 0, 14) << "|" << strLeft("", 14) << "|" << strLeft("", 14) << "|" << strDblRight(m_dThisIterLeftGridUnconsCoarse * m_dCellArea, 0, 14) << "|" << endl;
2208
2210 dTmpSandDeposition += (m_dThisIterLeftGridUnconsSand * m_dCellArea);
2211 dTmpCoarseDeposition += (m_dThisIterLeftGridUnconsCoarse * m_dCellArea);
2212
2213 bool bShowZeroFine = false;
2214 bool bShowZeroSand = false;
2215 bool bShowZeroCoarse = false;
2216
2217 if (! bFPIsEqual(dTmpFineErosion, 0.0, MASS_BALANCE_TOLERANCE))
2218 bShowZeroFine = true;
2219
2220 if (! bFPIsEqual(dTmpSandErosion, 0.0, MASS_BALANCE_TOLERANCE))
2221 bShowZeroSand = true;
2222
2223 if (! bFPIsEqual(dTmpCoarseErosion, 0.0, MASS_BALANCE_TOLERANCE))
2224 bShowZeroCoarse = true;
2225
2226 LogStream << "-----------|-----------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|" << endl;
2227 LogStream << "TOTAL |"
2228 // All
2229 << strDblRight(-dTmpTotAllErosion, 0, 14) << "|" << strDblRight(dTmpTotAllErosionDDPD, 0, 14) << "|" << strDblRight(dTmpTotAllDeposition, 0, 14) << "|"
2230 // Fine
2231 << strDblRight(-dTmpFineErosion, 0, 14, bShowZeroFine) << "|" << strDblRight(dTmpFineErosion, 0, 14, bShowZeroFine) << "|"
2232 // Sand
2233 << strDblRight(-dTmpSandErosion, 0, 14, bShowZeroSand) << "|" << strDblRight(dTmpSandErosionDDPD, 0, 14, bShowZeroSand) << "|" << strDblRight(dTmpSandDeposition, 0, 14, bShowZeroSand) << "|"
2234 // Coarse
2235 << strDblRight(-dTmpCoarseErosion, 0, 14, bShowZeroCoarse) << "|" << strDblRight(dTmpCoarseErosionDDPD, 0, 14, bShowZeroCoarse) << "|" << strDblRight(dTmpCoarseDeposition, 0, 14, bShowZeroCoarse) << "|" << endl;
2236 LogStream << "-----------|-----------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|" << endl;
2237}
2238
2239//===============================================================================================================================
2241//===============================================================================================================================
2243{
2245 {
2246 // TODO 062 show these results somewhere
2247 // At end of timestep, get the numbers of cells with consolidated and unconsolidated sediment stored or in suspension, for all cells (both inside and outside polygons)
2248 int nSuspFineCellsAllCells = 0;
2249 int nUnconsFineCellsAllCells = 0;
2250 int nUnconsSandCellsAllCells = 0;
2251 int nUnconsCoarseCellsAllCells = 0;
2252
2253 // TODO 062 show these results somewhere
2254 // Also get the numbers of cells with consolidated and unconsolidated sediment stored or in suspension, only for cells inside polygons
2255 int nSuspFineCellsInPolygons = 0;
2256 int nUnconsFineCellsInPolygons = 0;
2257 int nUnconsSandCellsInPolygons = 0;
2258 int nUnconsCoarseCellsInPolygons = 0;
2259
2260 // Get the depths of consolidated and unconsolidated sediment stored or in suspension, for all cells (both inside and outside polygons)
2261 double dEndIterSuspFineAllCells = 0;
2262 double dEndIterUnconsFineAllCells = 0;
2263 double dEndIterUnconsSandAllCells = 0;
2264 double dEndIterUnconsCoarseAllCells = 0;
2265 double dEndIterConsFineAllCells = 0;
2266 double dEndIterConsSandAllCells = 0;
2267 double dEndIterConsCoarseAllCells = 0;
2268
2269 // Also get the depths of consolidated and unconsolidated sediment stored or in suspension, only for cells inside polygons
2270 double dEndIterSuspFineInPolygons = 0;
2271 double dEndIterUnconsFineInPolygons = 0;
2272 double dEndIterUnconsSandInPolygons = 0;
2273 double dEndIterUnconsCoarseInPolygons = 0;
2274 double dEndIterConsFineInPolygons = 0;
2275 double dEndIterConsSandInPolygons = 0;
2276 double dEndIterConsCoarseInPolygons = 0;
2277
2278 // Get depth of consolidated and unconsolidated (and suspended) sediment from each cell (both within and outside polygons)
2279 for (int nX = 0; nX < m_nXGridSize; nX++)
2280 {
2281 for (int nY = 0; nY < m_nYGridSize; nY++)
2282 {
2283 dEndIterConsFineAllCells += m_pRasterGrid->m_Cell[nX][nY].dGetConsFineDepthAllLayers();
2284 dEndIterConsSandAllCells += m_pRasterGrid->m_Cell[nX][nY].dGetConsSandDepthAllLayers();
2285 dEndIterConsCoarseAllCells += m_pRasterGrid->m_Cell[nX][nY].dGetConsCoarseDepthAllLayers();
2286
2287 double dSuspFine = m_pRasterGrid->m_Cell[nX][nY].dGetSuspendedSediment();
2288
2289 if (dSuspFine > 0)
2290 {
2291 dEndIterSuspFineAllCells += dSuspFine;
2292 nSuspFineCellsAllCells++;
2293 }
2294
2295 double dUnconsFine = m_pRasterGrid->m_Cell[nX][nY].dGetUnconsFineDepthAllLayers();
2296
2297 if (dUnconsFine > 0)
2298 {
2299 dEndIterUnconsFineAllCells += dUnconsFine;
2300 nUnconsFineCellsAllCells++;
2301 }
2302
2303 double dUnconsSand = m_pRasterGrid->m_Cell[nX][nY].dGetUnconsSandDepthAllLayers();
2304
2305 if (dUnconsSand > 0)
2306 {
2307 dEndIterUnconsSandAllCells += dUnconsSand;
2308 nUnconsSandCellsAllCells++;
2309 }
2310
2311 double dUnconsCoarse = m_pRasterGrid->m_Cell[nX][nY].dGetUnconsCoarseDepthAllLayers();
2312
2313 if (dUnconsCoarse > 0)
2314 {
2315 dEndIterUnconsCoarseAllCells += dUnconsCoarse;
2316 nUnconsCoarseCellsAllCells++;
2317 }
2318
2319 // Is this cell within a polygon?
2320 if (m_pRasterGrid->m_Cell[nX][nY].nGetPolygonID() != INT_NODATA)
2321 {
2322 // It is within a polygon
2323 dEndIterConsFineInPolygons += m_pRasterGrid->m_Cell[nX][nY].dGetConsFineDepthAllLayers();
2324 dEndIterConsSandInPolygons += m_pRasterGrid->m_Cell[nX][nY].dGetConsSandDepthAllLayers();
2325 dEndIterConsCoarseInPolygons += m_pRasterGrid->m_Cell[nX][nY].dGetConsCoarseDepthAllLayers();
2326
2327 dSuspFine = m_pRasterGrid->m_Cell[nX][nY].dGetSuspendedSediment();
2328
2329 if (dSuspFine > 0)
2330 {
2331 dEndIterSuspFineInPolygons += dSuspFine;
2332 nSuspFineCellsInPolygons++;
2333 }
2334
2335 dUnconsFine = m_pRasterGrid->m_Cell[nX][nY].dGetUnconsFineDepthAllLayers();
2336
2337 if (dUnconsFine > 0)
2338 {
2339 dEndIterUnconsFineInPolygons += dUnconsFine;
2340 nUnconsFineCellsInPolygons++;
2341 }
2342
2343 dUnconsSand = m_pRasterGrid->m_Cell[nX][nY].dGetUnconsSandDepthAllLayers();
2344
2345 if (dUnconsSand > 0)
2346 {
2347 dEndIterUnconsSandInPolygons += dUnconsSand;
2348 nUnconsSandCellsInPolygons++;
2349 }
2350
2351 dUnconsCoarse = m_pRasterGrid->m_Cell[nX][nY].dGetUnconsCoarseDepthAllLayers();
2352
2353 if (dUnconsCoarse > 0)
2354 {
2355 dEndIterUnconsCoarseInPolygons += dUnconsCoarse;
2356 nUnconsCoarseCellsInPolygons++;
2357 }
2358 }
2359 }
2360 }
2361
2362 double dFineTmp = 0;
2363 double dSandTmp = 0;
2364 double dCoarseTmp = 0;
2365
2366 LogStream << endl
2367 << m_ulIter << ": Consolidated sediment budget, all m^3. This includes sediment within and outside the polygons." << endl;
2368
2369 // Stored consolidated sediment at start of timestep: sediment within and outside the polygons
2370 LogStream << string(101, '-') << "|" << string(8, '-') << "|" << string(14, '-') << "|" << string(14, '-') << "|" << string(14, '-') << "|" << endl;
2371 LogStream << strLeft("", 101) << "|" << strLeft("", 8) << "|" << strCentre("In Polygons", 14) << "|" << strCentre("Outside", 14) << "|" << strCentre("ALL", 14) << "|" << endl;
2372 LogStream << string(101, '-') << "|" << string(8, '-') << "|" << string(14, '-') << "|" << string(14, '-') << "|" << string(14, '-') << "|" << endl;
2373
2374 // Don't show inside/outside polygon values if not simulating beach erosion (since polygons are not constructed if no beach erosion)
2377
2378 LogStream << strLeft("At start of timestep " + to_string(m_ulIter) + ", stored consolidated sediment", 101) << "|" << strLeft("Fine", 8) << "|" << strDblRight(dTmp1 * m_dCellArea, 0, 14) << "|" << strDblRight(dTmp2 * m_dCellArea, 0, 14) << "|" << strDblRight(m_dStartIterConsFineAllCells * m_dCellArea, 0, 14) << "|" << endl;
2379
2380 // Don't show inside/outside polygon values if not simulating beach erosion (since polygons are not constructed if no beach erosion)
2383
2384 LogStream << strLeft("", 101) << "|" << strLeft("Sand", 8) << "|" << strDblRight(dTmp3 * m_dCellArea, 0, 14) << "|" << strDblRight(dTmp4 * m_dCellArea, 0, 14) << "|" << strDblRight(m_dStartIterConsSandAllCells * m_dCellArea, 0, 14) << "|" << endl;
2385
2386 // Don't show inside/outside polygon values if not simulating beach erosion (since polygons are not constructed if no beach erosion)
2389
2390 LogStream << strLeft("", 101) << "|" << strLeft("Coarse", 8) << "|" << strDblRight(dTmp5 * m_dCellArea, 0, 14) << "|" << strDblRight(dTmp6 * m_dCellArea, 0, 14) << "|" << strDblRight(m_dStartIterConsCoarseAllCells * m_dCellArea, 0, 14) << "|" << endl;
2391
2392 LogStream << strLeft("", 101) << "|" << strLeft("ALL", 8) << "|" << strDblRight((dTmp1 + dTmp3 + dTmp5) * m_dCellArea, 0, 14) << "|" << strDblRight((dTmp2 + dTmp4 + dTmp6) * m_dCellArea, 0, 14) << "|" << strDblRight((m_dStartIterConsFineAllCells + m_dStartIterConsSandAllCells + m_dStartIterConsCoarseAllCells) * m_dCellArea, 0, 14) << "|" << endl;
2393
2394 LogStream << string(101, '-') << "|" << string(8, '-') << "|" << string(14, '-') << "|" << string(14, '-') << "|" << string(14, '-') << "|" << endl;
2395
2399
2400 // Shore platform erosion, consolidated sediment lost (becomes unconsolidated esediment and suspended sediment)
2401 LogStream << strLeft("Consolidated sediment lost via platform erosion (becomes suspended sediment)", 101) << "|" << strLeft("Fine", 8) << "|" << strDblRight(-m_dThisIterActualPlatformErosionFineCons * m_dCellArea, 0, 44) << "|" << endl;
2402 LogStream << strLeft("Consolidated sediment lost via platform erosion (becomes unconsolidated sediment)", 101) << "|" << strLeft("Sand", 8) << "|" << strDblRight(-m_dThisIterActualPlatformErosionSandCons * m_dCellArea, 0, 44) << "|" << endl;
2403 LogStream << strLeft("", 101) << "|" << strLeft("Coarse", 8) << "|" << strDblRight(-m_dThisIterActualPlatformErosionCoarseCons * m_dCellArea, 0, 44) << "|" << endl;
2405 LogStream << string(101, '-') << "|" << string(8, '-') << "|" << string(44, '-') << "|" << endl;
2406
2410
2411 // Cliff collapse, consolidated sediment lost (becomes unconsolidated esediment and suspended sediment)
2412 LogStream << strLeft("Consolidated sediment lost via cliff collapse (becomes suspended sediment)", 101) << "|" << strLeft("Fine", 8) << "|" << strDblRight(-m_dThisIterCliffCollapseErosionFineCons * m_dCellArea, 0, 44) << "|" << endl;
2413 LogStream << strLeft("Consolidated sediment lost via cliff collapse (becomes unconsolidated sediment)", 101) << "|" << strLeft("Sand", 8) << "|" << strDblRight(-m_dThisIterCliffCollapseErosionSandCons * m_dCellArea, 0, 44) << "|" << endl;
2414 LogStream << strLeft("", 101) << "|" << strLeft("Coarse", 8) << "|" << strDblRight(-m_dThisIterCliffCollapseErosionCoarseCons * m_dCellArea, 0, 44) << "|" << endl;
2416
2420
2421 LogStream << string(101, '-') << "|" << string(8, '-') << "|" << string(14, '-') << "|" << string(14, '-') << "|" << string(14, '-') << "|" << endl;
2422 LogStream << strLeft("", 101) << "|" << strLeft("", 8) << "|" << strCentre("In Polygons", 14) << "|" << strCentre("Outside", 14) << "|" << strCentre("ALL", 14) << "|" << endl;
2423 LogStream << string(101, '-') << "|" << string(8, '-') << "|" << string(14, '-') << "|" << string(14, '-') << "|" << string(14, '-') << "|" << endl;
2424
2425 // Don't show inside/outside polygon values if not simulating beach erosion
2426 dTmp1 = (m_bDoBeachSedimentTransport ? dEndIterConsFineInPolygons : 0);
2427 dTmp2 = (m_bDoBeachSedimentTransport ? (dEndIterConsFineAllCells - dEndIterConsFineInPolygons) : 0);
2428
2429 LogStream << strLeft("At end of timestep " + to_string(m_ulIter) + ", stored consolidated sediment", 101) << "|" << strLeft("Fine", 8) << "|" << strDblRight(dTmp1 * m_dCellArea, 0, 14) << "|" << strDblRight(dTmp2 * m_dCellArea, 0, 14) << "|" << strDblRight(dEndIterConsFineAllCells * m_dCellArea, 0, 14) << "|" << endl;
2430
2431 // Don't show inside/outside polygon values if not simulating beach erosion
2432 dTmp3 = (m_bDoBeachSedimentTransport ? dEndIterConsSandInPolygons : 0);
2433 dTmp4 = (m_bDoBeachSedimentTransport ? (dEndIterConsSandAllCells - dEndIterConsSandInPolygons) : 0);
2434 LogStream << strLeft("", 101) << "|" << strLeft("Sand", 8) << "|" << strDblRight(dTmp3 * m_dCellArea, 0, 14) << "|" << strDblRight(dTmp4 * m_dCellArea, 0, 14) << "|" << strDblRight(dEndIterConsSandAllCells * m_dCellArea, 0, 14) << "|" << endl;
2435
2436 // Don't show inside/outside polygon values if not simulating beach erosion
2437 dTmp5 = (m_bDoBeachSedimentTransport ? dEndIterConsCoarseInPolygons : 0);
2438 dTmp6 = (m_bDoBeachSedimentTransport ? (dEndIterConsCoarseAllCells - dEndIterConsCoarseInPolygons) : 0);
2439
2440 LogStream << strLeft("", 101) << "|" << strLeft("Coarse", 8) << "|" << strDblRight(dTmp5 * m_dCellArea, 0, 14) << "|" << strDblRight(dTmp6 * m_dCellArea, 0, 14) << "|" << strDblRight(dEndIterConsCoarseAllCells * m_dCellArea, 0, 14) << "|" << endl;
2441
2442 LogStream << strLeft("", 101) << "|" << strLeft("ALL", 8) << "|" << strDblRight((dTmp1 + dTmp3 + dTmp5) * m_dCellArea, 0, 14) << "|" << strDblRight((dTmp2 + dTmp4 + dTmp6) * m_dCellArea, 0, 14) << "|" << strDblRight((dEndIterConsFineAllCells + dEndIterConsSandAllCells + dEndIterConsCoarseAllCells) * m_dCellArea, 0, 14) << "|" << endl;
2443
2444 LogStream << string(101, '-') << "|" << string(8, '-') << "|" << string(14, '-') << "|" << string(14, '-') << "|" << string(14, '-') << "|" << endl;
2445
2446 double dFineError = (dEndIterConsFineAllCells * m_dCellArea) - dFineTmp;
2447 double dSandError = (dEndIterConsSandAllCells * m_dCellArea) - dSandTmp;
2448 double dCoarseError = (dEndIterConsCoarseAllCells * m_dCellArea) - dCoarseTmp;
2449
2450 // Mass balance check
2451 bool bError = false;
2452 string strFineErrMsg = "";
2453 string strSandErrMsg = "";
2454 string strCoarseErrMsg = "";
2455 string strAllErrMsg = "";
2456
2457 if (! bFPIsEqual(dFineError, 0.0, MASS_BALANCE_TOLERANCE))
2458 {
2459 strFineErrMsg = MASS_BALANCE_ERROR;
2460 bError = true;
2461 }
2462
2463 if (! bFPIsEqual(dSandError, 0.0, MASS_BALANCE_TOLERANCE))
2464 {
2465 strSandErrMsg = MASS_BALANCE_ERROR;
2466 bError = true;
2467 }
2468
2469 if (! bFPIsEqual(dCoarseError, 0.0, MASS_BALANCE_TOLERANCE))
2470 {
2471 strCoarseErrMsg = MASS_BALANCE_ERROR;
2472 bError = true;
2473 }
2474
2475 if (bError)
2476 strAllErrMsg = MASS_BALANCE_ERROR;
2477
2478 LogStream << strLeft("Consolidated sediment mass balance check (+ve means end total > start total)", 101) << "|" << strLeft("", 8) << "|" << strLeft("", 44) << "|" << endl;
2479 LogStream << strLeft(strFineErrMsg, 101) << "|" << strLeft("Fine", 8) << "|" << strDblRight(dFineError, 3, 30, false) << strRightPerCent(dFineError, dEndIterConsFineAllCells, 14, 2) << "|" << endl;
2480 LogStream << strLeft(strSandErrMsg, 101) << "|" << strLeft("Sand", 8) << "|" << strDblRight(dSandError, 3, 30, false) << strRightPerCent(dSandError, dEndIterConsSandAllCells, 14, 2) << "|" << endl;
2481 LogStream << strLeft(strCoarseErrMsg, 101) << "|" << strLeft("Coarse", 8) << "|" << strDblRight(dCoarseError, 3, 30, false) << strRightPerCent(dCoarseError, dEndIterConsCoarseAllCells, 14, 2) << "|" << endl;
2482 LogStream << strLeft(strAllErrMsg, 101) << "|" << strLeft("ALL", 8) << "|" << strDblRight(dFineError + dSandError + dCoarseError, 3, 30, false) << strRightPerCent(dFineError + dSandError + dCoarseError, dEndIterConsFineAllCells + dEndIterConsSandAllCells + dEndIterConsCoarseAllCells, 14, 2) << "|" << endl;
2483 LogStream << string(101, '-') << "|" << string(8, '-') << "|" << string(44, '-') << "|" << endl;
2484 LogStream << endl;
2485
2486 // Now look at unconsolidated sediment
2487 dFineTmp = 0;
2488 dSandTmp = 0;
2489 dCoarseTmp = 0;
2490
2491 LogStream << m_ulIter << ": Unconsolidated sediment budget, all m^3." << endl;
2492
2493 // Stored unconsolidated sediment, and in suspension, at start of timestep: sediment within and outside the polygons
2494 LogStream << string(101, '-') << "|" << string(8, '-') << "|" << string(14, '-') << "|" << string(14, '-') << "|" << string(14, '-') << "|" << endl;
2495 LogStream << strLeft("", 101) << "|" << strLeft("", 8) << "|" << strCentre("In Polygons", 14) << "|" << strCentre("Outside", 14) << "|" << strCentre("ALL", 14) << "|" << endl;
2496 LogStream << string(101, '-') << "|" << string(8, '-') << "|" << string(14, '-') << "|" << string(14, '-') << "|" << string(14, '-') << "|" << endl;
2497
2498 // Don't show inside/outside polygon values if not simulating beach erosion (since polygons are not constructed if no beach erosion)
2501
2502 LogStream << strLeft("At start of timestep " + to_string(m_ulIter) + ", sediment in suspension", 101) << "|" << strLeft("Fine", 8) << "|" << strDblRight(dTmp1 * m_dCellArea, 0, 14) << "|" << strDblRight(dTmp2 * m_dCellArea, 0, 14) << "|" << strDblRight(m_dStartIterSuspFineAllCells * m_dCellArea, 0, 14) << "|" << endl;
2503
2504 // Don't show inside/outside polygon values if not simulating beach erosion (since polygons are not constructed if no beach erosion)
2507
2508 LogStream << strLeft("At start of timestep " + to_string(m_ulIter) + ", stored unconsolidated sediment", 101) << "|" << strLeft("Fine", 8) << "|" << strDblRight(dTmp3 * m_dCellArea, 0, 14) << "|" << strDblRight(dTmp4 * m_dCellArea, 0, 14) << "|" << strDblRight(m_dStartIterUnconsFineAllCells * m_dCellArea, 0, 14) << "|" << endl;
2509
2510 // Don't show inside/outside polygon values if not simulating beach erosion (since polygons are not constructed if no beach erosion)
2513
2514 LogStream << strLeft("", 101) << "|" << strLeft("Sand", 8) << "|" << strDblRight(dTmp5 * m_dCellArea, 0, 14) << "|" << strDblRight(dTmp6 * m_dCellArea, 0, 14) << "|" << strDblRight(m_dStartIterUnconsSandAllCells * m_dCellArea, 0, 14) << "|" << endl;
2515
2516 // Don't show inside/outside polygon values if not simulating beach erosion (since polygons are not constructed if no beach erosion)
2519
2520 LogStream << strLeft("", 101) << "|" << strLeft("Coarse", 8) << "|" << strDblRight(dTmp7 * m_dCellArea, 0, 14) << "|" << strDblRight(dTmp8 * m_dCellArea, 0, 14) << "|" << strDblRight(m_dStartIterUnconsCoarseAllCells * m_dCellArea, 0, 14) << "|" << endl;
2521
2522 LogStream << strLeft("", 101) << "|" << strLeft("ALL", 8) << "|" << strDblRight((dTmp1 + dTmp3 + dTmp5 + dTmp7) * m_dCellArea, 0, 14) << "|" << strDblRight((dTmp2 + dTmp4 + dTmp6 + dTmp8) * m_dCellArea, 0, 14) << "|" << strDblRight((m_dStartIterSuspFineAllCells + m_dStartIterUnconsFineAllCells + m_dStartIterUnconsSandAllCells + m_dStartIterUnconsCoarseAllCells) * m_dCellArea, 0, 14) << "|" << endl;
2523
2524 LogStream << string(101, '-') << "|" << string(8, '-') << "|" << string(14, '-') << "|" << string(14, '-') << "|" << string(14, '-') << "|" << endl;
2525
2529
2530 // Shore platform erosion, consolidated sediment becomes unconsolidated sediment and suspended sediment
2531 LogStream << strLeft("Suspended sediment derived from platform erosion of consolidated sediment", 101) << "|" << strLeft("Fine", 8) << "|" << strDblRight(m_dThisIterActualPlatformErosionFineCons * m_dCellArea, 0, 44) << "|" << endl;
2532 LogStream << strLeft("Unconsolidated sediment derived from platform erosion of consolidated sediment", 101) << "|" << strLeft("Sand", 8) << "|" << strDblRight(m_dThisIterActualPlatformErosionSandCons * m_dCellArea, 0, 44) << "|" << endl;
2533 LogStream << strLeft("", 101) << "|" << strLeft("Coarse", 8) << "|" << strDblRight(m_dThisIterActualPlatformErosionCoarseCons * m_dCellArea, 0, 44) << "|" << endl;
2535 LogStream << string(101, '-') << "|" << string(8, '-') << "|" << string(44, '-') << "|" << endl;
2536
2540
2541 // Cliff collapse, consolidated sediment becomes unconsolidated sediment and suspended sediment
2542 LogStream << strLeft("Suspended sediment derived from cliff collapse erosion of consolidated sediment", 101) << "|" << strLeft("Fine", 8) << "|" << strDblRight(m_dThisIterCliffCollapseErosionFineCons * m_dCellArea, 0, 44) << "|" << endl;
2543 LogStream << strLeft("Unconsolidated sediment derived from cliff collapse erosion of consolidated sediment only", 101) << "|" << strLeft("Sand", 8) << "|" << strDblRight(m_dThisIterCliffCollapseErosionSandCons * m_dCellArea, 0, 44) << "|" << endl;
2544 LogStream << strLeft("", 101) << "|" << strLeft("Coarse", 8) << "|" << strDblRight(m_dThisIterCliffCollapseErosionCoarseCons * m_dCellArea, 0, 44) << "|" << endl;
2546 LogStream << string(101, '-') << "|" << string(8, '-') << "|" << string(44, '-') << "|" << endl;
2547
2551
2552 // Beach (unconsolidated sediment) lost from grid due to beach erosion and deposition, and to cliff collapse with talus going outside the grid
2553 LogStream << strLeft("Unconsolidated sediment lost from grid", 101) << "|" << strLeft("Fine", 8) << "|" << strDblRight(-m_dThisIterLeftGridUnconsFine * m_dCellArea, 0, 44) << "|" << endl;
2554 LogStream << strLeft("", 101) << "|" << strLeft("Sand", 8) << "|" << strDblRight(-m_dThisIterLeftGridUnconsSand * m_dCellArea, 0, 44) << "|" << endl;
2555 LogStream << strLeft("", 101) << "|" << strLeft("Coarse", 8) << "|" << strDblRight(-m_dThisIterLeftGridUnconsCoarse * m_dCellArea, 0, 44) << "|" << endl;
2557 LogStream << string(101, '-') << "|" << string(8, '-') << "|" << string(44, '-') << "|" << endl;
2558
2562
2563 // Sediment added via input events
2564 LogStream << strLeft("Unconsolidated sediment added via input event(s)", 101) << "|" << strLeft("Fine", 8) << "|" << strDblRight(m_dThisiterUnconsFineInput * m_dCellArea, 0, 44) << "|" << endl;
2565 LogStream << strLeft("", 101) << "|" << strLeft("Sand", 8) << "|" << strDblRight(m_dThisiterUnconsSandInput * m_dCellArea, 0, 44) << "|" << endl;
2566 LogStream << strLeft("", 101) << "|" << strLeft("Coarse", 8) << "|" << strDblRight(m_dThisiterUnconsCoarseInput * m_dCellArea, 0, 44) << "|" << endl;
2567 LogStream << string(101, '-') << "|" << string(8, '-') << "|" << string(44, '-') << "|" << endl;
2568
2571 dCoarseTmp += (m_dThisiterUnconsCoarseInput * m_dCellArea);
2572
2573 // Any uncons sediment left over from last iter and deposited this iter?
2574
2575 LogStream << strLeft("Insufficient unconsolidated sediment deposited last iteration, carried forward to this iteration", 101) << "|" << strLeft("Sand", 8) << "|" << strDblRight(m_dUnconsSandNotDepositedLastIter * m_dCellArea, 0, 44) << "|" << endl;
2576 LogStream << strLeft("", 101) << "|" << strLeft("Coarse", 8) << "|" << strDblRight(m_dUnconsCoarseNotDepositedLastIter * m_dCellArea, 0, 44) << "|" << endl;
2577
2580
2581 // Any insufficient deposition?
2582 LogStream << strLeft("Insufficient unconsolidated sediment deposited this iteration", 101) << "|" << strLeft("Sand", 8) << "|" << strDblRight(m_dDepositionSandDiff * m_dCellArea, 0, 44) << "|" << endl;
2583 LogStream << strLeft("", 101) << "|" << strLeft("Coarse", 8) << "|" << strDblRight(m_dDepositionCoarseDiff * m_dCellArea, 0, 44) << "|" << endl;
2584
2585 dSandTmp -= (m_dDepositionSandDiff * m_dCellArea);
2586 dCoarseTmp -= (m_dDepositionCoarseDiff * m_dCellArea);
2587
2588 LogStream << string(101, '-') << "|" << string(8, '-') << "|" << string(14, '-') << "|" << string(14, '-') << "|" << string(14, '-') << "|" << endl;
2589 LogStream << strLeft("", 101) << "|" << strLeft("", 8) << "|" << strCentre("In Polygons", 14) << "|" << strCentre("Outside", 14) << "|" << strCentre("ALL", 14) << "|" << endl;
2590 LogStream << string(101, '-') << "|" << string(8, '-') << "|" << string(14, '-') << "|" << string(14, '-') << "|" << string(14, '-') << "|" << endl;
2591
2592 // Don't show inside/outside polygon values if not simulating beach erosion
2593 dTmp1 = (m_bDoBeachSedimentTransport ? dEndIterSuspFineInPolygons : 0);
2594 dTmp2 = (m_bDoBeachSedimentTransport ? (dEndIterSuspFineAllCells - dEndIterSuspFineInPolygons) : 0);
2595
2596 LogStream << strLeft("At end of timestep " + to_string(m_ulIter) + ", sediment in suspension", 101) << "|" << strLeft("Fine", 8) << "|" << strDblRight(dTmp1 * m_dCellArea, 0, 14) << "|" << strDblRight(dTmp2 * m_dCellArea, 0, 14) << "|" << strDblRight(dEndIterSuspFineAllCells * m_dCellArea, 0, 14) << "|" << endl;
2597
2598 // Don't show inside/outside polygon values if not simulating beach erosion
2599 dTmp3 = (m_bDoBeachSedimentTransport ? dEndIterUnconsFineInPolygons : 0);
2600 dTmp4 = (m_bDoBeachSedimentTransport ? (dEndIterUnconsFineAllCells - dEndIterUnconsFineInPolygons) : 0);
2601
2602 LogStream << strLeft("At end of timestep " + to_string(m_ulIter) + ", stored unconsolidated sediment", 101) << "|" << strLeft("Fine", 8) << "|" << strDblRight(dTmp3 * m_dCellArea, 0, 14) << "|" << strDblRight(dTmp4 * m_dCellArea, 0, 14) << "|" << strDblRight(dEndIterUnconsFineAllCells * m_dCellArea, 0, 14) << "|" << endl;
2603
2604 // Don't show inside/outside polygon values if not simulating beach erosion
2605 dTmp5 = (m_bDoBeachSedimentTransport ? dEndIterUnconsSandInPolygons : 0);
2606 dTmp6 = (m_bDoBeachSedimentTransport ? (dEndIterUnconsSandAllCells - dEndIterUnconsSandInPolygons) : 0);
2607
2608 LogStream << strLeft("", 101) << "|" << strLeft("Sand", 8) << "|" << strDblRight(dTmp5 * m_dCellArea, 0, 14) << "|" << strDblRight(dTmp6 * m_dCellArea, 0, 14) << "|" << strDblRight(dEndIterUnconsSandAllCells * m_dCellArea, 0, 14) << "|" << endl;
2609
2610 // Don't show inside/outside polygon values if not simulating beach erosion
2611 dTmp7 = (m_bDoBeachSedimentTransport ? dEndIterUnconsCoarseInPolygons : 0);
2612 dTmp8 = (m_bDoBeachSedimentTransport ? (dEndIterUnconsCoarseAllCells - dEndIterUnconsCoarseInPolygons) : 0);
2613
2614 LogStream << strLeft("", 101) << "|" << strLeft("Coarse", 8) << "|" << strDblRight(dTmp7 * m_dCellArea, 0, 14) << "|" << strDblRight(dTmp8 * m_dCellArea, 0, 14) << "|" << strDblRight(dEndIterUnconsCoarseAllCells * m_dCellArea, 0, 14) << "|" << endl;
2615
2616 LogStream << strLeft("", 101) << "|" << strLeft("ALL", 8) << "|" << strDblRight((dTmp1 + dTmp3 + dTmp5 + dTmp7) * m_dCellArea, 0, 14) << "|" << strDblRight((dTmp2 + dTmp4 + dTmp6 + dTmp8) * m_dCellArea, 0, 14) << "|" << strDblRight((dEndIterSuspFineAllCells + dEndIterUnconsFineAllCells + dEndIterUnconsSandAllCells + dEndIterUnconsCoarseAllCells) * m_dCellArea, 0, 14) << "|" << endl;
2617
2618 LogStream << string(101, '-') << "|" << string(8, '-') << "|" << string(14, '-') << "|" << string(14, '-') << "|" << string(14, '-') << "|" << endl;
2619
2620 dFineError = ((dEndIterSuspFineAllCells + dEndIterUnconsFineAllCells) * m_dCellArea) - dFineTmp,
2621 dSandError = (dEndIterUnconsSandAllCells * m_dCellArea) - dSandTmp,
2622 dCoarseError = (dEndIterUnconsCoarseAllCells * m_dCellArea) - dCoarseTmp;
2623
2624 // Mass balance check
2625 bError = false;
2626 strFineErrMsg = "";
2627 strSandErrMsg = "";
2628 strCoarseErrMsg = "";
2629 strAllErrMsg = "";
2630
2631 if (! bFPIsEqual(dFineError, 0.0, MASS_BALANCE_TOLERANCE))
2632 {
2633 strFineErrMsg = MASS_BALANCE_ERROR;
2634 bError = true;
2635 }
2636
2637 if (! bFPIsEqual(dSandError, 0.0, MASS_BALANCE_TOLERANCE))
2638 {
2639 strSandErrMsg = MASS_BALANCE_ERROR;
2640 bError = true;
2641 }
2642
2643 if (! bFPIsEqual(dCoarseError, 0.0, MASS_BALANCE_TOLERANCE))
2644 {
2645 strCoarseErrMsg = MASS_BALANCE_ERROR;
2646 bError = true;
2647 }
2648
2649 if (bError)
2650 strAllErrMsg = MASS_BALANCE_ERROR;
2651
2652 LogStream << strLeft("Unconsolidated sediment mass balance check (+ve means iteration-end total > iteration-start total)", 101) << "|" << strLeft("", 8) << "|" << strLeft("", 44) << "|" << endl;
2653 LogStream << strLeft(strFineErrMsg, 101) << "|" << strLeft("Fine", 8) << "|" << strDblRight(dFineError, 0, 30, false) << strRightPerCent(dFineError, (dEndIterSuspFineAllCells + dEndIterUnconsFineAllCells), 14, 2) << "|" << endl;
2654 LogStream << strLeft(strSandErrMsg, 101) << "|" << strLeft("Sand", 8) << "|" << strDblRight(dSandError, 0, 30, false) << strRightPerCent(dSandError, dEndIterUnconsSandAllCells, 14, 2) << "|" << endl;
2655 LogStream << strLeft(strCoarseErrMsg, 101) << "|" << strLeft("Coarse", 8) << "|" << strDblRight(dCoarseError, 0, 30, false) << strRightPerCent(dCoarseError, dEndIterUnconsCoarseAllCells, 14, 2) << "|" << endl;
2656 LogStream << strLeft(strAllErrMsg, 101) << "|" << strLeft("ALL", 8) << "|" << strDblRight(dFineError + dSandError + dCoarseError, 0, 30, false) << strRightPerCent(dFineError + dSandError + dCoarseError, dEndIterSuspFineAllCells + dEndIterUnconsFineAllCells + dEndIterUnconsSandAllCells + dEndIterUnconsCoarseAllCells, 14, 2) << "|" << endl;
2657 LogStream << string(101, '-') << "|" << string(8, '-') << "|" << string(44, '-') << "|" << endl;
2658 LogStream << endl;
2659 }
2660
2661 // Add to grand totals: first platform erosion
2663 // assert(isfinite(m_dThisIterPotentialPlatformErosion));
2664
2668
2669 // Erosion from cliff collapse, both consolidated and unconsolidated
2676
2677 // Deposition (with fine to suspension) of unconsolidated talus from cliff collapse
2681
2682 // Erosion of unconsolidated sediment during deposition of unconsolidated cliff collapse talus
2686
2687 // Beach erosion of unconsolidated sediment
2689
2693
2694 // Beach deposition of unconsolidated sediment
2697
2698 // Unconsolidated sediment lost due to beach erosion
2700
2704
2705 // Unconsolidated sediment input event(s)
2709
2710 // Suspended unconsolidated sediment
2712
2713 // Shortfall in unconsolidated sediment deposition
2716}
Contains CGeom2DIPoint definitions.
Geometry class used for coast polygon objects.
double dGetCliffCollapseErosionCoarse(void) const
Get the this-iteration total of unconsolidated coarse sediment from cliff collapse on this polygon,...
double dGetSedimentInputUnconsSand(void) const
Get the value of sand sediment on the polygon derived from sediment input events(s)
double dGetPotentialErosion(void) const
Returns this timestep's total change in depth of unconsolidated sediment (all size classes) due to be...
double dGetCliffCollapseUnconsSandDeposition(void) const
Get the this-iteration total of unconsolidated sand sediment deposited from cliff collapse on this po...
double dGetCliffCollapseToSuspensionFine(void) const
Get the this-iteration total of unconsolidated fine sediment from cliff collapse which goes to suspen...
double dGetPreExistingUnconsSand(void) const
Get the value of pre-existing unconsolidated sand sediment stored on this polygon.
vector< int > const * VnGetCircularities(void) const
Get all circularities for this polygon.
double dGetPreExistingConsSand(void) const
Get the value of pre-existing consolidated sand sediment stored on this polygon.
double dGetCliffCollapseErosionFine(void) const
Get the this-iteration total of unconsolidated fine sediment eroded from cliff collapse on this polyg...
double dGetPlatformErosionUnconsCoarse(void) const
Get the this-iteration total of unconsolidated coarse sediment derived from shore platform erosion on...
double dGetCliffCollapseCoarseErodedDeanProfile(void) const
Get the this-iteration total of unconsolidated coarse sediment eroded during deposition of cliff coll...
double dGetSedimentInputUnconsFine(void) const
Get the value of fine sediment on the polygon derived from sediment input events(s)
double dGetPreExistingConsFine(void) const
Get the value of pre-existing consolidated fine sediment stored on this polygon.
double dGetCliffCollapseUnconsCoarseDeposition(void) const
Get the this-iteration total of unconsolidated coarse sediment deposited from cliff collapse on this ...
double dGetSeawaterVolume(void) const
Get the volume of seawater in the coast polygon.
double dGetPreExistingUnconsFine(void) const
Get the value of pre-existing unconsolidated fine sediment stored on this polygon.
int nGetPolygonCoastID(void) const
Get the coast ID, this is the same as the down-coast sequence of polygons.
int nGetUpCoastProfile(void) const
Return the number of the up-coast profile.
double dGetCliffCollapseErosionSand(void) const
Get the this-iteration total of unconsolidated sand sediment from cliff collapse on this polygon,...
double dGetAvgUnconsD50(void) const
Get the average d50 for unconsolidated sediment on this polygon.
double dGetPlatformErosionUnconsSand(void) const
Get the this-iteration total of unconsolidated sand sediment derived from shore platform erosion on t...
double dGetPreExistingUnconsCoarse(void) const
Get the value of pre-existing unconsolidated coarse sediment stored on this polygon.
double dGetCliffCollapseSandErodedDeanProfile(void) const
Get the this-iteration total of unconsolidated sand sediment eroded during deposition of cliff collap...
double dGetPreExistingConsCoarse(void) const
Get the value of pre-existing consolidated coarse sediment stored on this polygon.
double dGetSedimentInputUnconsCoarse(void) const
Get the value of coarse sediment on the polygon derived from sediment input events(s)
int nGetDownCoastProfile(void) const
Return the number of the down-coast profile.
Geometry class used to represent coast profile objects.
Definition profile.h:33
int nGetProfileID(void) const
Returns the profile's this-coast ID.
Definition profile.cpp:74
double m_dThisIterPotentialBeachErosion
Total potential beach erosion (all size classes of unconsolidated sediment) for this iteration (depth...
Definition simulation.h:861
double m_dCliffDepositionPlanviewWidth
Planview width of cliff collapse talus (m)
Definition simulation.h:939
int m_nLogFileDetail
The level of detail in the log file output. Can be LOG_FILE_LOW_DETAIL, LOG_FILE_MIDDLE_DETAIL,...
Definition simulation.h:588
string m_strGDALISSDriverCode
GDAL code for the initial suspended sediment raster file.
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.
Definition simulation.h:768
int m_nGISMaxSaveDigits
The maximum number of digits in GIS filenames. These can be sequential, or the iteration number.
Definition simulation.h:516
string m_strGDALISSProjection
GDAL projection string for the initial suspended sediment raster file.
string m_strInitialSuspSedimentFile
Name of initial suspended sediment file.
void WritePolygonShorePlatformErosion(void)
Writes to the log file a table showing per-polygon unconsolidated sand/coarse sediment derived from e...
string m_strSedimentInputEventFile
The name of the sediment input events time series file.
bool m_bHaveConsolidatedSediment
Does this simulation consider consolidated sediment, or is it an unconsolidated sediment only simulat...
Definition simulation.h:456
bool m_bFloodSWLSetupSurgeLine
Are we saving the flood still water level setup surge line? TODO 007 Finish surge and runup stuff.
Definition simulation.h:441
time_t m_tSysEndTime
System finish-simulation time.
string m_strCMEIni
Folder for the CME .ini file.
double m_dTotalCoarseUnconsInPolygons
Total coarse unconsolidated sediment in all polygons, before polygon-to-polygon movement (only cells ...
bool m_bSedimentInputAtPoint
Do we have sediment inputat a point?
Definition simulation.h:396
double m_dG
Gravitational acceleration (m**2/sec)
Definition simulation.h:825
vector< string > m_VstrInitialCoarseUnconsSedimentFile
The name of the initial coarse-sized unconsolidated sediment GIS file.
double m_dThisIterSWL
The still water level for this timestep (this includes tidal changes and any long-term SWL change)
Definition simulation.h:726
string m_strGDALICDataType
GDAL data type of the initial intervention class raster file.
int m_nBeachErosionDepositionEquation
Which beach erosion-deposition equation is used. Possible values are UNCONS_SEDIMENT_EQUATION_CERC an...
Definition simulation.h:543
ofstream CliffCollapseNetChangeTSStream
Cliff collapse net change (erosion - deposition) time series file output stream.
bool m_bBeachDepositionTSSave
Save the beach (unconsolidated sediment) deposition time series file?
Definition simulation.h:315
bool bWritePerTimestepResults(void)
Write the results for this timestep to the .out file.
CGeomRasterGrid * m_pRasterGrid
Pointer to the raster grid object.
vector< string > m_VstrGDALICCDataType
GDAL data type for the initial consolidated coarse sediment GIS data.
int m_nXGridSize
The size of the grid in the x direction.
Definition simulation.h:477
string strListRasterFiles(void) const
Return a space-separated string containing the names of the raster GIS output files.
Definition utils.cpp:759
double m_dWaveDataWrapHours
Number of hours after which deep water wave data wraps.
Definition simulation.h:984
string strListVectorFiles(void) const
Return a space-separated string containing the names of the vector GIS output files.
Definition utils.cpp:1019
vector< string > m_VstrGDALICFDataType
GDAL data type for the initial consolidated fine sediment GIS data.
double m_dMaxUserInputWavePeriod
Used to constrain depth of closure.
Definition simulation.h:780
void WritePolygonInfoTable(void)
Writes to the log file a table showing polygon info for all coasts.
bool m_bFloodSetupSurgeRunupTSSave
Save the flood setup surge runup time series file? TODO 007 Finish surge and runup stuff.
Definition simulation.h:327
ofstream LogStream
int nWriteEndRunDetails(void)
Writes end-of-run information to Out, Log and time-series files.
vector< string > m_VstrGDALICCDriverCode
GDAL driver code for the initial consolidated coarse sediment GIS data.
double m_dThisIterBeachErosionCoarse
Total actual beach erosion (coarse unconsolidated sediment) for this iteration (depth in m)
Definition simulation.h:870
double m_dStartIterUnconsCoarseAllCells
Depth (m) of coarse unconsolidated sediment at the start of the simulation, all cells (both inside an...
vector< CRWCoast > m_VCoast
The coastline objects.
double m_dCoastNormalLength
Length of the coastline-normal profiles, in m.
Definition simulation.h:840
static string pstrChangeToForwardSlash(string const *)
Swaps all backslashes in the input string to forward slashes, leaving the original unchanged.
Definition utils.cpp:2469
vector< string > m_VstrGDALIUFDataType
GDAL data type for the initial unconsolidated fine sediment GIS data.
bool m_bSaveGISThisIter
Save GIS files this iteration?
Definition simulation.h:333
long double m_ldGTotCliffCollapseCoarseErodedDuringDeposition
All-simulation total of coarse sediment eroded during talus deposition following cliff collapse (m)
double m_dUnconsCoarseNotDepositedLastIter
Depth of unconsolidated coarse sediment that could not be deposited during the last iteration,...
string m_strOGRSedInputDataType
GDAL data type for the sediment input event locations vector file.
bool bSaveAllVectorGISFiles(void)
The bSaveAllvectorGISFiles member function saves the vector GIS files TODO 081 Choose more files to o...
bool m_bSingleDeepWaterWaveValues
Do we have just a point source for (i.e. only a single measurement of) deep water wave values.
Definition simulation.h:387
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.
Definition utils.cpp:1474
static string strDispSimTime(double const)
strDispSimTime returns a string formatted as year Julian_day hour, given a parameter in hours
Definition utils.cpp:1633
double m_dSouthEastXExtCRS
The south-east x coordinate, in the external coordinate reference system (CRS)
Definition simulation.h:663
long double m_ldGTotActualCoarseBeachErosion
All-simulation total of coarse sediment eroded during beach (unconsolidated sediment) movement (m)
double m_dThisIterCliffCollapseFineErodedDuringDeposition
Total fine sediment eroded during Dean profile deposition of talus following cliff collapse (depth in...
Definition simulation.h:894
double m_dThisIterDiffWaveSetupSurgeWaterLevel
TODO 007 Finish surge and runup stuff.
Definition simulation.h:747
double m_dThisIterActualPlatformErosionCoarseCons
Total actual platform erosion (coarse consolidated sediment) for this iteration (depth in m)
Definition simulation.h:858
int m_nNumThisIterCliffCollapse
The number of cells with cliff collapse this iteration.
Definition simulation.h:534
int m_nYGridSize
The size of the grid in the y direction.
Definition simulation.h:480
vector< double > m_VdErosionPotential
For erosion potential lookup.
vector< string > m_VstrGDALIUFProjection
GDAL projection for the initial unconsolidated fine sediment GIS data.
long double m_ldGTotCliffTalusFineToSuspension
All-simulation total of fine sediment moved to suspension, due to cliff collapse (m)
int nSaveParProfile(int const, CGeomProfile const *, int const, int const, int const, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< CGeom2DIPoint > *const, vector< double > const *) const
Save a coastline-normal parallel profile.
string m_strSedimentInputEventShapefile
The name of the sediment input events shape file.
double m_dCoarseErodibility
The relative erodibility (0-1) of coarse unconsolidated beach sediment.
Definition simulation.h:807
double m_dMaxSWLSoFar
Maximum still water level (m)
Definition simulation.h:738
double m_dCliffTalusMinDepositionLength
Planview length of cliff deposition talus (m)
Definition simulation.h:942
string m_strVectorGISOutFormat
Vector GIS output format.
vector< string > m_VstrGDALICFDriverCode
GDAL driver code for the initial consolidated fine sediment GIS data.
vector< string > m_VstrInitialFineConsSedimentFile
The name of the initial fine-sized consolidated sediment GIS file.
double m_dNotchIncisionAtCollapse
Notch overhang (i.e. length of horizontal incision at the apex elevation) to initiate collapse (m)
Definition simulation.h:927
int m_nUnconsSedimentHandlingAtGridEdges
How sediment which moves off an edge of the grid is handled. Possible values are GRID_EDGE_CLOSED,...
Definition simulation.h:540
double m_dSandErodibility
The relative erodibility (0-1) of sand unconsolidated beach sediment.
Definition simulation.h:804
int m_nSimStartHour
Start time of the simulation (hours)
Definition simulation.h:573
string m_strGDALLDriverCode
GDAL code for the for the initial landform class raster file.
bool m_bSuspSedTSSave
Save the suspended sediment time series file?
Definition simulation.h:321
string m_strDeepWaterWaveStationsShapefile
The name of the deep water wave stations shape file.
vector< double > m_VdDepthOverDB
For erosion potential lookup.
bool m_bCliffCollapseNetTSSave
Save the cliff collapse net change time series file?
Definition simulation.h:309
double m_dStartIterSuspFineInPolygons
Depth (m) of fine suspended sediment at the start of the simulation (only cells in polygons)
unsigned long m_ulThisIterNumCoastCells
The number of grid cells which are marked as coast, for this iteration.
Definition simulation.h:624
vector< string > m_VstrGDALICSDriverCode
GDAL driver code for the initial consolidated sand sediment GIS data.
unsigned long m_ulNumCells
The number of cells in the grid.
Definition simulation.h:618
double m_dTotPotentialPlatformErosionBetweenProfiles
Total potential platform erosion between profiles.
Definition simulation.h:915
bool m_bFloodLocationSave
Are we saving the flood location? TODO 007 Finish surge and runup stuff.
Definition simulation.h:435
double m_dWaveDepthRatioForWaveCalcs
Start depth for wave calculations.
Definition simulation.h:762
string m_strGDALISSDataType
GDAL data type for the initial suspended sediment raster file.
void WriteStartRunDetails(void)
Writes beginning-of-run information to Out and Log files.
double m_dThisIterCliffCollapseErosionCoarseUncons
This-iteration total of coarse unconsolidated sediment produced by cliff collapse (m^3)
Definition simulation.h:954
vector< string > m_VstrGDALIUCProjection
GDAL projection for the initial unconsolidated coarse sediment GIS data.
ofstream CliffCollapseDepositionTSStream
Cliff collapse deposition time series file output stream.
string m_strGDALLDataType
GDAL data type for the initial landform class raster file.
long double m_ldGTotCoarseBeachDeposition
All-simulation total of coarse sediment deposited during beach (unconsolidated sediment) movement (m)
double m_dDepositionCoarseDiff
Error term: if we are unable to deposit enough unconslidated coarse on polygon(s),...
Definition simulation.h:906
double m_dBeachSedimentPorosity
The porosity of unconsolidated beach sediment (0-1)
Definition simulation.h:798
int m_nSimStartSec
Start time of the simulation (seconds)
Definition simulation.h:567
int m_nSimStartDay
Start date of the simulation (day)
Definition simulation.h:576
bool m_bGDALOptimisations
GDAL optimisations enabled?
Definition simulation.h:459
unsigned long m_ulThisIterNumActualPlatformErosionCells
The number of grid cells on which actual platform erosion occurs, for this iteration.
Definition simulation.h:630
bool m_bActualPlatformErosionTSSave
Save the actual (supply-limited) shore platform erosion time series file?
Definition simulation.h:300
string m_strOGRFloodGeometry
GDAL geometry for the flood input locations point or vector file.
long double m_ldGTotPotentialSedLostBeachErosion
All-simulation total of potential sediment lost via beach (unconsolidated) sediment movement (m),...
double m_dThisIterCliffCollapseErosionFineUncons
This-iteration total of fine unconsolidated sediment produced by cliff collapse (m^3)
Definition simulation.h:948
bool m_bDoShorePlatformErosion
Simulate shore platform erosion?
Definition simulation.h:363
bool m_bSliceSave
Save slices?
Definition simulation.h:99
double m_dInitialMeanSWL
The start-of-simulation still water level (m)
Definition simulation.h:717
string m_strOGRDWWVDriverCode
GDAL code for the deep water wave stations vector file.
double m_dThisIterNewNotchApexElev
Elevation (m) of the apex of any cliff notches created during this iteration.
Definition simulation.h:930
double m_dNorthWestYExtCRS
The north-west y coordinate, in the external coordinate reference system (CRS)
Definition simulation.h:660
vector< string > m_VstrGDALICSDriverDesc
GDAL driver description for the initial consolidated sand sediment GIS data.
bool m_bSaveRegular
Save GIS files at regular intervals?
Definition simulation.h:258
int m_nLayers
The number of sediment layers.
Definition simulation.h:483
double m_dStartIterConsCoarseAllCells
Depth (m) of coarse consolidated sediment at the start of the simulation, all cells (both inside and ...
double m_dStartIterConsSandAllCells
Depth (m) of sand consolidated sediment at the start of the simulation, all cells (both inside and ou...
int m_nCoastSmoothingWindowSize
The size of the window used for coast smoothing. Must be an odd number.
Definition simulation.h:489
bool m_bSedimentInputAlongLine
Do we have sediment input along a line?
Definition simulation.h:402
bool m_bSedimentInput
Do we have sediment input events?
Definition simulation.h:393
bool m_bFloodSWLSetupSurgeRunupLineSave
Are we saving the flood still water level setup surge runup line? TODO 007 Finish surge and runup stu...
Definition simulation.h:450
unsigned long m_ulThisIterNumBeachDepositionCells
The number of grid cells on which beach (unconsolidated sediment) deposition occurs,...
Definition simulation.h:639
double m_dDepositionSandDiff
Error term: if we are unable to deposit enough unconslidated sand on polygon(s), this is held over to...
Definition simulation.h:903
string m_strGDALBasementDEMDriverCode
GDAL code for the basement DEM raster file type.
vector< string > m_VstrGDALIUFDriverCode
GDAL driver code for the initial unconsolidated fine sediment GIS data.
void WritePolygonSortedSequence(vector< vector< vector< int > > > &)
Writes to the log file a table showing the sorted sequence of polygon processing for all coasts,...
int nSaveProfile(int const, CGeomProfile const *, int const, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< CGeom2DIPoint > *const, vector< double > const *) const
Save a coastline-normal profile.
void WritePolygonSedimentBeforeMovement(void)
Writes to the log file a table showing per-polygon totals of stored unconsolidated beach sediment pri...
double m_dThisiterUnconsCoarseInput
Depth (m) of coarse unconsolidated sediment added, at this iteration.
Definition simulation.h:999
int m_nUSave
If user-defined GIS save intervals, the number of these.
Definition simulation.h:522
double m_dThisIterPotentialPlatformErosion
Total potential platform erosion (all size classes of consolidated sediment) for this iteration (dept...
Definition simulation.h:849
bool bWriteTSFiles(void)
Write the results for this timestep to the time series CSV files.
double m_dDeanProfileStartAboveSWL
Berm height i.e. height above SWL of start of depositional Dean profile.
Definition simulation.h:975
int m_nSavGolCoastPoly
The order of the coastline profile smoothing polynomial if Savitzky-Golay smoothing is used (usually ...
Definition simulation.h:492
ofstream BeachDepositionTSStream
Beach sediment deposition time series file output stream.
string m_strInitialBasementDEMFile
Name of initial basement DEM file.
int m_nRunUpEquation
The run-up equation used TODO 007 Finish surge and runup stuff.
Definition simulation.h:591
long double m_ldGTotCliffCollapseFine
All-simulation total of fine sediment from cliff collapse (m)
bool m_bWorldFile
Write a GIS World file?
Definition simulation.h:384
long double m_ldGTotCliffTalusCoarseDeposition
All-simulation total of coarse sediment deposited as talus following cliff collapse (m)
string m_strLogFile
Name of output log file.
double m_dDepthOverDBMax
Maximum value of deoth over DB, is used in erosion potential look-up function.
Definition simulation.h:909
long double m_ldGTotCliffCollapseCoarse
All-simulation total of coarse sediment from cliff collapse (m)
double m_dFineErodibility
The relative erodibility (0-1) of fine unconsolidated beach sediment.
Definition simulation.h:801
double m_dThisiterUnconsFineInput
Depth (m) of fine unconsolidated sediment added, at this iteration.
Definition simulation.h:993
time_t m_tSysStartTime
System start-simulation time.
double m_dCoastNormalSpacing
Average spacing of the coastline-normal profiles, in m.
Definition simulation.h:834
double m_dSeaWaterDensity
Density of sea water in kg/m**3.
Definition simulation.h:714
long double m_ldGTotSuspendedSediment
All-simulation total of suspended sediment (m)
double m_dR
Coast platform resistance to erosion R, see Walkden & Hall, 2011.
Definition simulation.h:783
void WritePolygonSedimentInputEventTable(void)
Writes to the log file a table showing per-polygon sediment input event totals for all coasts.
string m_strGDALLProjection
GDAL projection string for the initial landform class raster file.
vector< string > m_VstrInitialSandUnconsSedimentFile
The name of the initial sand-sized unconsolidated sediment GIS file.
double m_dThisIterActualPlatformErosionSandCons
Total actual platform erosion (sand consolidated sediment) for this iteration (depth in m)
Definition simulation.h:855
bool m_bOmitSearchWestEdge
Omit the west edge of the grid from coast-end searches?
Definition simulation.h:357
string m_strGDALIHProjection
GDAL projection string for the initial intervention height raster file.
string m_strGDALICDriverDesc
GDAL description of the initial intervention class raster file.
bool m_bSedimentInputAtCoast
Do we have sediment input at the coast?
Definition simulation.h:399
double m_dCliffErosionResistance
Resistance of cliff to notch erosion.
Definition simulation.h:924
vector< string > m_VstrGDALIUSProjection
GDAL projection for the initial unconsolidated sand sediment GIS data.
double m_dThisIterBeachDepositionCoarse
Total beach deposition (coarse unconsolidated sediment) for this iteration (depth in m)
Definition simulation.h:876
double dGridCentroidYToExtCRSY(int const) const
Given the integer Y-axis ordinate of a cell in the raster grid CRS, returns the external CRS Y-axis o...
Definition gis_utils.cpp:74
double m_dD50Sand
The D50 for sand sediment.
Definition simulation.h:789
void WritePolygonPreExistingSedimentTable(void)
Writes to the log file a table showing per-polygon pre-existing unconsolidated sediment for all coast...
long double m_ldGTotCliffTalusSandDeposition
All-simulation total of sand sediment deposited as talus following cliff collapse (m)
vector< int > m_VnProfileToSave
The numbers of the profiles which are to be saved.
double m_dKLS
Transport parameter KLS in the CERC equation.
Definition simulation.h:819
ofstream BeachSedimentNetChangeTSStream
Beach sediment net change (erosion - deposition) time series file output stream.
string m_strOGRDWWVDriverDesc
int m_nWavePropagationModel
The wave propagation model used. Possible values are WAVE_MODEL_CSHORE and WAVE_MODEL_COVE.
Definition simulation.h:564
long double m_ldGTotCliffCollapseSandErodedDuringDeposition
All-simulation total of sand sediment eroded during talus deposition following cliff collapse (m)
double m_dAllCellsDeepWaterWaveAngle
Deep water wave angle for all sea cells.
Definition simulation.h:771
vector< string > m_VstrGDALICFProjection
GDAL projection for the initial consolidated fine sediment GIS data.
string m_strOGRFloodDriverCode
GDAL code for the flood input locations point or vector file.
double m_dSimElapsed
Time simulated so far, in hours.
Definition simulation.h:693
vector< string > m_VstrGDALICCProjection
GDAL projection for the initial consolidated coarse sediment GIS data.
double m_dMinSWLSoFar
Minimum still water level (m)
Definition simulation.h:735
bool bWriteProfileData(int const, CGeomProfile const *, int const, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< CGeom2DIPoint > *const, vector< double > const *) const
Writes values for a single profile, for checking purposes.
long double m_ldGTotCoarseSedimentInput
All-simulation total of coarse sediment input (m)
double m_dFinalMeanSWL
The end-of-simulation still water (m), is same as m_dInitialMeanSWL unless SWL changes.
Definition simulation.h:720
bool bWriteParProfileData(int const, int const, int const, int const, int const, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< double > const *, vector< CGeom2DIPoint > *const, vector< double > const *) const
Writes values for a single parallel profile, for checking purposes.
double m_dThisIterUnconsCoarseCliffDeposition
This-iteration total of coarse unconsolidated sediment deposited due to cliff collapse (m^3)
Definition simulation.h:969
bool bWritePerTimestepResultsCSV(void)
Write the results for this timestep to the .out file in CSV format.
bool m_bSWLTSSave
Save the SWL (still water level) time series file?
Definition simulation.h:297
double m_dThisIterTotSeaDepth
Total sea depth (m) for this iteration.
Definition simulation.h:846
double m_dTotPotentialPlatformErosionOnProfiles
Total potential platform erosion on profiles.
Definition simulation.h:912
bool m_bOmitSearchNorthEdge
Omit the north edge of the grid from coast-end searches?
Definition simulation.h:351
long double m_ldGTotCoarseActualPlatformErosion
All-simulation total of coarse sediment actual platform erosion (m)
long double m_ldGTotFineActualPlatformErosion
All-simulation total of fine sediment actual platform erosion (m)
double m_dThisIterUnconsSandCliffDeposition
This-iteration total of sand unconsolidated sediment deposited due to cliff collapse (m^3)
Definition simulation.h:966
long double m_ldGTotSandSedimentInput
All-simulation total of sand sediment input (m)
string strListTSFiles(void) const
Return a space-separated string containing the names of the time series output files.
Definition utils.cpp:1123
bool m_bFloodSetupSurgeTSSave
Save the flood setup surge time series file? TODO 007 Finish surge and runup stuff.
Definition simulation.h:324
string m_strGDALLDriverDesc
GDAL description of the initial landform class raster file.
double m_dNorthWestXExtCRS
The north-west x coordinate, in the external coordinate reference system (CRS)
Definition simulation.h:657
double m_dD50Coarse
The D50 for coarse sediment.
Definition simulation.h:792
ofstream SWLTSStream
SWL time series file output stream.
vector< unsigned long > m_VulProfileTimestep
Timesteps at which to save profiles.
ofstream CliffCollapseErosionTSStream
Cliff collapse erosion time series file output stream.
double m_dThisIterPotentialSedLostBeachErosion
Total unconsolidated sediment from beach erosion (all size classes) lost from the grid this iteration...
Definition simulation.h:882
double m_dSouthEastYExtCRS
The south-east y coordinate, in the external coordinate reference system (CRS)
Definition simulation.h:666
string m_strFloodLocationShapefile
The name of the flood loction events shape file.
long double m_ldGTotCliffCollapseFineErodedDuringDeposition
All-simulation total of fine sediment eroded during talus deposition following cliff collapse (m)
long double m_ldGTotCoarseDepositionDiff
All-simulation total of shortfall in unconsolidated coarse sediment deposition (m,...
double m_dStartIterConsFineAllCells
Depth (m) of fine consolidated sediment at the start of the simulation, all cells (both inside and ou...
long double m_ldGTotActualCoarseLostBeachErosion
All-simulation total of coarse sediment lost via beach (unconsolidated) sediment movement (m)
bool m_bGISSaveDigitsSequential
Are the GIS save digits (which are part of each GIS file name) sequential, or are they the iteration ...
Definition simulation.h:453
int m_nSimStartMonth
Start date of the simulation (month)
Definition simulation.h:579
double m_dMinCliffTalusHeightFrac
Minimum height of the landward end of cliff collapse talus, as a fraction of cliff elevation.
Definition simulation.h:945
double m_dThisIterBeachErosionSand
Total actual beach erosion (sand unconsolidated sediment) for this iteration (depth in m)
Definition simulation.h:867
vector< string > m_VstrGDALIUSDriverDesc
GDAL driver description for the initial unconsolidated sand sediment GIS data.
vector< string > m_VstrInitialFineUnconsSedimentFile
The name of the initial fine-sized unconsolidated sediment GIS file.
double m_dThisIterFineSedimentToSuspension
Total fine unconsolidated sediment in suspension for this iteration (depth in m)
Definition simulation.h:879
bool bWritePerTimestepResultsFixedWidth(void)
Write the results for this timestep to the .out file in fixed-width format.
double m_dThisIterBeachErosionFine
Total actual beach erosion (fine unconsolidated sediment) for this iteration (depth in m)
Definition simulation.h:864
double m_dNotchApexAboveMHW
Distance of notch base below SWL (m)
Definition simulation.h:933
double m_dThisIterCliffCollapseSandErodedDuringDeposition
Total sand sediment eroded during Dean profile deposition of talus following cliff collapse (depth in...
Definition simulation.h:897
int m_nSimStartMin
Start time of the simulation (minutes)
Definition simulation.h:570
bool bSaveAllRasterGISFiles(void)
The bSaveAllRasterGISFiles member function saves the raster GIS files using values from the RasterGri...
string m_strOGRDWWVGeometry
GDAL geometry for the deep water wave stations vector file.
unsigned long m_ulThisIterNumActualBeachErosionCells
The number of grid cells on which actual beach (unconsolidated sediment) erosion occurs,...
Definition simulation.h:636
double m_dCliffDepositionA
Scale parameter A for cliff deposition (m^(1/3)), may be zero for auto-calculation.
Definition simulation.h:936
string m_strDataPathName
Folder in which the CME data file is found.
string m_strOutPath
Path for all output files.
bool m_bBeachErosionTSSave
Save the beach (unconsolidated sediment) erosion time series file?
Definition simulation.h:312
vector< string > m_VstrGDALICFDriverDesc
GDAL driver description for the initial consolidated fine sediment GIS data.
void WritePolygonUnsortedSequence(vector< vector< vector< int > > > &)
Writes to the log file a table showing the unsorted sequence of polygon processing for all coasts.
static string strGetBuild(void)
Returns the date and time on which the program was compiled.
Definition utils.cpp:1744
string m_strTideDataFile
Name of tide data file.
vector< string > m_VstrGDALIUFDriverDesc
GDAL driver description for the initial unconsolidated fine sediment GIS data.
unsigned long m_ulThisIterNumPotentialPlatformErosionCells
The number of grid cells on which potential platform erosion occurs, for this iteration.
Definition simulation.h:627
vector< string > m_VstrGDALIUSDataType
GDAL data type for the initial unconsolidated sand sediment GIS data.
double m_dStartIterUnconsSandAllCells
Depth (m) of sand unconsolidated sediment at the start of the simulation, all cells (both inside and ...
long double m_ldGTotActualSandLostBeachErosion
All-simulation total of sand sediment lost via beach (unconsolidated) sediment movement (m)
int m_nGISSave
The save number for GIS files (can be sequential, or the iteration number)
Definition simulation.h:519
string m_strInterventionClassFile
Name of intervention class file.
long double m_ldGTotActualFineLostBeachErosion
All-simulation total of fine sediment lost via beach (unconsolidated) sediment movement (m)
string m_strGDALBasementDEMDataType
GDAL data type for the basement DEM raster file.
double m_dThisIterCliffCollapseErosionFineCons
This-iteration total of fine consolidated sediment produced by cliff collapse (m^3)
Definition simulation.h:957
long double m_ldGTotCoarseSedLostCliffCollapse
All-simulation total of coarse sediment lost via cliff collapse (m)
double m_dCoastNormalInterventionSpacing
Average spacing of the coastline-normal profiles on interventions, in m.
Definition simulation.h:837
long double m_ldGTotSandActualPlatformErosion
All-simulation total of sand sediment actual platform erosion (m)
int m_nSimStartYear
Start date of the simulation (year)
Definition simulation.h:582
string m_strDeepWaterWavesInputFile
The name of the deep water wave stations time series file.
long double m_ldGTotSandSedLostCliffCollapse
All-simulation total of sand sediment lost via cliff collapse (m)
double m_dUnconsSandNotDepositedLastIter
Depth of unconsolidated sand sediment that could not be deposited during the last iteration,...
string m_strGDALICProjection
GDAL projection string for the initial intervention class raster file.
double m_dTotalCoarseConsInPolygons
Total coarse consolidated sediment in all polygons, before polygon-to-polygon movement (only cells in...
ofstream SeaAreaTSStream
Sea area time series file output stream.
unsigned long m_ulThisIterNumSeaCells
The number of grid cells which are marked as sea, for this iteration.
Definition simulation.h:621
double m_dTotalSandUnconsInPolygons
Total sand unconsolidated sediment in all polygons, before polygon-to-polygon movement (only cells in...
bool m_bRiverineFlooding
Are we doing riverine flooding?
Definition simulation.h:411
double m_dStartIterUnconsFineAllCells
Depth (m) of fine unconsolidated sediment at the start of the simulation, all cells (both inside and ...
double m_dThisIterMHWElev
This iteration's Mean High Water (MHW) elevation, calculated using a moving time window....
double m_dRegularSaveInterval
The interval between regular saves, in hours.
Definition simulation.h:699
long double m_ldGTotActualFineBeachErosion
All-simulation total of fine sediment eroded during beach (unconsolidated sediment) movement (m)
string m_strGDALISSDriverDesc
GDAL description for the initial suspended sediment raster file.
unsigned long m_ulTotPotentialPlatformErosionOnProfiles
The number of cells on which on-profile average potential shore platform erosion occurs.
Definition simulation.h:642
bool m_bCliffCollapseDepositionTSSave
Save the cliff collapse deposition time series file?
Definition simulation.h:306
string m_strGDALRasterOutputDriverLongname
GDAL raster output driver long name.
vector< string > m_VstrGDALIUCDriverCode
GDAL driver code for the initial unconsolidated coarse sediment GIS data.
ofstream PlatformErosionTSStream
Shore platform erosion time series file output stream.
void DoEndOfTimestepTotals(void)
Update and print totals at the end of each timestep.
double m_dCellArea
Area of a cell (in external CRS units)
Definition simulation.h:675
unsigned long m_ulTotPotentialPlatformErosionBetweenProfiles
The number of cells on which between-profile average potential shore platform erosion occurs.
Definition simulation.h:645
void WritePolygonPotentialErosion(void)
Writes to the log file a table showing per-polygon potential erosion of all size classes of unconsoli...
double m_dCoastNormalRandSpacingFactor
Random factor for spacing of along-coast normals.
Definition simulation.h:972
double m_dMaxUserInputWaveHeight
Maximum deep water wave height.
Definition simulation.h:777
vector< double > m_VdSliceElev
Elevations for raster slice output.
bool m_bOutputConsolidatedProfileData
Output profile data?
Definition simulation.h:336
ofstream CliffNotchElevTSStream
Cliff notch elevation time series file output stream.
string m_strOGRSedInputGeometry
GDAL geometry for the sediment input event locations vector file.
string m_strOGRSedInputDriverCode
GDAL code for the sediment input event locations vector file.
bool m_bDoBeachSedimentTransport
Simulate unconsolidated sediment (beach) transport?
Definition simulation.h:369
unsigned long m_ulThisIterNumPotentialBeachErosionCells
The number of grid cells on which potential beach (unconsolidated sediment) erosion occurs,...
Definition simulation.h:633
bool m_bCliffNotchElevTSSave
Save the cliff notch elevation time series file?
Definition simulation.h:330
int m_nCoastSmooth
Which method to use for coast smoothing.
Definition simulation.h:486
string m_strGDALBasementDEMDriverDesc
GDAL description of the basement DEM raster file type.
string m_strInitialLandformFile
Name of initial landform file.
string m_strInterventionHeightFile
Name of intervention height file.
double m_dThisIterCliffCollapseErosionSandCons
This-iteration total of sand consolidated sediment produced by cliff collapse (m^3)
Definition simulation.h:960
bool m_bBeachSedimentChangeNetTSSave
Save the beach (unconsolidated sediment) net change time series file?
Definition simulation.h:318
vector< string > m_VstrGDALICSDataType
GDAL data type for the initial consolidated sand sediment GIS data.
double m_dThisIterBeachDepositionSand
Total beach deposition (sand unconsolidated sediment) for this iteration (depth in m)
Definition simulation.h:873
string m_strOGRFloodDriverDesc
bool m_bSeaAreaTSSave
Save the sea area time series file?
Definition simulation.h:294
bool m_bScaleRasterOutput
Scale raster output?
Definition simulation.h:381
vector< string > m_VstrGDALICSProjection
GDAL dprojection for the initial consolidated sand sediment GIS data.
void CalcProcessStats(void)
This calculates and displays process statistics.
Definition utils.cpp:1796
void WriteLookUpData(void)
Output the erosion potential look-up values, for checking purposes.
double m_dThisIterLeftGridUnconsCoarse
Total coarse unconsolidated sediment lost from the grid this iteration (depth in m)
Definition simulation.h:891
double m_dThisIterCliffCollapseErosionSandUncons
This-iteration total of sand unconsolidated sediment produced by cliff collapse (m^3)
Definition simulation.h:951
string m_strOGRFloodDataType
GDAL data type for the flood input locations point or vector file.
double m_dD50Fine
The D50 for fine sediment.
Definition simulation.h:786
unsigned long m_ulRandSeed[NUMBER_OF_RNGS]
A seed for each of the random number generators.
Definition simulation.h:615
bool m_bOmitSearchSouthEdge
Omit the south edge of the grid from coast-end searches?
Definition simulation.h:354
string m_strGDALBasementDEMProjection
GDAL projection string for the basement DEM raster file.
double m_dTotalSandConsInPolygons
Total sand consolidated sediment in all polygons, before polygon-to-polygon movement (only cells in p...
unsigned long m_ulIter
The number of the current iteration (time step)
Definition simulation.h:609
double m_dBeachSedimentDensity
The density of unconsolidated beach sediment (kg/m**3)
Definition simulation.h:795
double dGridCentroidXToExtCRSX(int const) const
Given the integer X-axis ordinate of a cell in the raster grid CRS, returns the external CRS X-axis o...
Definition gis_utils.cpp:65
vector< string > m_VstrInitialCoarseConsSedimentFile
The name of the initial coarse-sized consolidated sediment GIS file.
string m_strOGRDWWVDataType
GDAL data type for the deep water wave stations vector file.
double dGetInterpolatedValue(vector< double > const *, vector< double > const *, double, bool)
double m_dSimDuration
Duration of simulation, in hours.
Definition simulation.h:687
double m_dTotalFineUnconsInPolygons
Total fine unconsolidated sediment in all polygons, before polygon-to-polygon movement (only cells in...
string m_strGDALIHDriverCode
GDAL code for the initial intervention height raster file.
long double m_ldGTotSandDepositionDiff
All-simulation total of shortfall in unconsolidated sand sediment deposition (m, not currently used)
bool m_bCSVPerTimestepResults
Output per-timestep results in CSV format instead of fixed-width?
Definition simulation.h:345
string m_strGDALICDriverCode
GDAL code for the initial intervention class raster file.
ofstream FloodSetupSurgeTSStream
Flood setup surge time series file output stream.
double m_dTotalFineConsInPolygons
Total fine consolidated sediment in all polygons, before polygon-to-polygon movement (only cells in p...
double m_dThisiterUnconsSandInput
Depth (m) of sand unconsolidated sediment added, at this iteration.
Definition simulation.h:996
double m_dExtCRSGridArea
The area of the grid (in external CRS units)
Definition simulation.h:669
double m_dThisIterDiffWaveSetupSurgeRunupWaterLevel
TODO 007 Finish surge and runup stuff.
Definition simulation.h:750
double m_dCellSide
Length of a cell side (in external CRS units)
Definition simulation.h:672
vector< string > m_VstrGDALIUCDriverDesc
GDAL driver description for the initial unconsolidated coarse sediment GIS data.
double m_dMaxBeachElevAboveSWL
Maximum elevation of beach above SWL (m)
Definition simulation.h:921
long double m_ldGTotActualSandBeachErosion
All-simulation total of sand sediment eroded during beach (unconsolidated sediment) movement (m)
double m_dAllCellsDeepWaterWavePeriod
Deep water wave period for all sea cells.
Definition simulation.h:774
double m_dThisIterCliffCollapseCoarseErodedDuringDeposition
Total coarse sediment eroded during Dean profile deposition of talus following cliff collapse (depth ...
Definition simulation.h:900
long double m_ldGTotSandBeachDeposition
All-simulation total of sand sediment deposited during beach (unconsolidated sediment) movement (m)
double m_dUSaveTime[SAVEMAX]
Save time, in hours from the start of the simukation, if we are not saving regularly.
Definition simulation.h:702
void WritePolygonCliffCollapseErosion(void)
Writes to the log file a table showing per-polygon per-polygon cliff collapse for all coasts.
double m_dThisIterActualPlatformErosionFineCons
Total actual platform erosion (fine consolidated sediment) for this iteration (depth in m)
Definition simulation.h:852
long double m_ldGTotPotentialBeachErosion
All-simulation total of potential beach erosion (m), all size classes.
double m_dProfileMaxSlope
Maximum slope on coastline-normal profiles.
Definition simulation.h:918
int m_nProfileSmoothWindow
The size of the window used for running-mean coast-normal profile smoothing (must be odd)
Definition simulation.h:504
string m_strGDALIHDriverDesc
GDAL description for the initial intervention height raster file.
bool m_bDoCliffCollapse
Simulate cliff collapse?
Definition simulation.h:366
double m_dThisIterCliffCollapseErosionCoarseCons
This-iteration total of coarse consolidated sediment produced by cliff collapse (m^3)
Definition simulation.h:963
double m_dThisIterLeftGridUnconsSand
Total sand unconsolidated sediment lost from the grid this iteration (depth in m)
Definition simulation.h:888
double m_dDepthOfClosure
Depth of closure (in m) TODO 007 can be calculated using Hallermeier, R.J. (1978) or Birkemeier (1985...
Definition simulation.h:831
vector< string > m_VstrGDALICCDriverDesc
GDAL driver decription for the initial consolidated coarse sediment GIS data.
double m_dStartIterSuspFineAllCells
Depth (m) of fine suspended sediment at the start of the simulation, all cells (both inside and outsi...
string m_strOutFile
Name of main output file.
string m_strGDALIHDataType
GDAL data type for the initial intervention height raster file.
ofstream FineSedSuspensionTSStream
Fine sediment in suspension time series file output stream.
ofstream FloodSetupSurgeRunupTSStream
Flood setup surge runup time series file output stream.
bool m_bFloodSWLSetupLineSave
Are we saving the flood still water level setup line? TODO 007 Finish surge and runup stuff.
Definition simulation.h:438
void WritePolygonActualMovement(vector< vector< vector< int > > > &)
Writes to the log file a table showing per-polygon actual movement of unconsolidated beach sediment f...
long double m_ldGTotFineSedimentInput
All-simulation total of fine sediment input (m)
double m_dThisIterMeanSWL
The mean still water level for this timestep (does not include tidal changes, but includes any long-t...
Definition simulation.h:729
vector< string > m_VstrGDALIUCDataType
GDAL data type for the initial unconsolidated coarse sediment GIS data.
bool m_bCliffCollapseErosionTSSave
Save the cliff collapse erosion time series file?
Definition simulation.h:303
long double m_ldGTotPotentialPlatformErosion
All-simulation total of potential platform erosion (m), all size classes.
ofstream BeachErosionTSStream
Beach sediment erosion time series file output stream.
long double m_ldGTotCliffCollapseSand
All-simulation total of sand sediment from cliff collapse (m)
ofstream OutStream
The main output file stream.
bool m_bOutputParallelProfileData
Output parallel profile data?
Definition simulation.h:339
double m_dKamphuis
Transport parameter for the Kamphuis equation.
Definition simulation.h:822
bool m_bOutputErosionPotentialData
Output erosion potential data?
Definition simulation.h:342
bool m_bVectorWaveFloodLineSave
Are we saving the vector wave flood line? TODO 007 Finish surge and runup stuff.
Definition simulation.h:432
vector< string > m_VstrGDALIUSDriverCode
GDAL driver code for the initial unconsolidated sand sediment GIS data.
bool m_bOmitSearchEastEdge
Omit the east edge of the grid from coast-end searches?
Definition simulation.h:360
double m_dThisIterLeftGridUnconsFine
Total fine unconsolidated sediment lost from the grid this iteration (depth in m)
Definition simulation.h:885
This file contains global definitions for CoastalME.
int const INT_NODATA
Definition cme.h:380
char const SLASH
Definition cme.h:356
int const SMOOTH_NONE
Definition cme.h:675
int const WAVE_MODEL_COVE
Definition cme.h:685
double const TOLERANCE
Definition cme.h:725
string const PERFORMHEAD
Definition cme.h:827
int const NO_LOG_FILE
Definition cme.h:391
string const PER_ITER_HEAD
Definition cme.h:821
int const UNCONS_SEDIMENT_EQUATION_KAMPHUIS
Definition cme.h:690
string const ERR
Definition cme.h:805
int const LOG_FILE_LOW_DETAIL
Definition cme.h:392
int const RUNUP_EQUATION_NIELSEN_HANSLOW
Definition cme.h:699
int const RTN_ERR_PROFILE_WRITE
Definition cme.h:619
int const RTN_ERR_RASTER_FILE_WRITE
Definition cme.h:605
string const PER_ITER_CSV_HEAD
Definition cme.h:823
string const PER_ITER_HEAD4
Definition cme.h:817
double const DEPTH_OVER_DB_INCREMENT
Definition cme.h:717
int const WAVE_MODEL_CSHORE
Definition cme.h:686
int const RUNUP_EQUATION_MASE
Definition cme.h:700
string const PER_ITER_HEAD2
Definition cme.h:813
int const LOG_FILE_MIDDLE_DETAIL
Definition cme.h:393
bool bFPIsEqual(const T d1, const T d2, const T dEpsilon)
Definition cme.h:1213
string const ENDHYDROLOGYHEAD
Definition cme.h:825
int const GRID_EDGE_CLOSED
Definition cme.h:680
int const GRID_EDGE_RECIRCULATE
Definition cme.h:682
double const MASS_BALANCE_TOLERANCE
Definition cme.h:727
string const ENDSEDIMENTHEAD
Definition cme.h:826
int const LOG_FILE_HIGH_DETAIL
Definition cme.h:394
int const NUMBER_OF_RNGS
Definition cme.h:367
string const PROGRAM_NAME
Definition cme.h:738
int const SMOOTH_SAVITZKY_GOLAY
Definition cme.h:677
string const PER_ITER_HEAD3
Definition cme.h:815
int const SMOOTH_RUNNING_MEAN
Definition cme.h:676
string const RUN_END_NOTICE
Definition cme.h:792
int const LOG_FILE_ALL
Definition cme.h:395
int const RTN_OK
Definition cme.h:585
int const RTN_ERR_VECTOR_FILE_WRITE
Definition cme.h:606
string const PER_ITER_HEAD5
Definition cme.h:819
int const CSHOREARRAYOUTSIZE
The size of the arrays output by CShore. If this is changed, then must also set the same value on lin...
Definition cme.h:376
int const GRID_EDGE_OPEN
Definition cme.h:681
string const EROSION_POTENTIAL_LOOKUP_FILE
Definition cme.h:800
int const UNCONS_SEDIMENT_EQUATION_CERC
Definition cme.h:689
string const PER_ITER_HEAD1
Definition cme.h:811
int const RUNUP_EQUATION_STOCKDON
Definition cme.h:701
char const COLON
Definition cme.h:350
string const MASS_BALANCE_ERROR
Definition cme.h:809
int const RTN_ERR_TIMESERIES_FILE_WRITE
Definition cme.h:607
char const SPACE
Definition cme.h:357
Contains CRWCoast definitions.
Contains CSimulation definitions.
string strLeft(const string &strIn, int const nWidth)
Left-aligns string within a field of given width, pads with blank spaces to enforce alignment....
string strDblRight(double const dX, int const nDigits, int const nWidth, bool const bShowDash)
Converts double to string with specified number of decimal places, within a field of given width,...
string strRightPerCent(double const d1, double const d2, int const nWidth, int const nDigits, bool const bShowDash)
Calculates a percentage from two numbers then, if the result is non-zero, right-aligns the result as ...
string strCentre(const char *pchIn, int const nWidth)
Centre-aligns char array within a field of given width, pads with blank spaces to enforce alignment....
string strRight(const string &strIn, int const nWidth)
Right-aligns string within a field of given width, pads with blank spaces to enforce alignment....
string strIntRight(int const nX, int const nWidth)
Converts int to string within a field of given width, pads with blank spaces to enforce alignment....