Skip to content

Commit

Permalink
Initial commit with Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
CallStormer committed Jul 23, 2024
1 parent d3c273e commit 634a98d
Show file tree
Hide file tree
Showing 19 changed files with 290 additions and 267 deletions.
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ if(parallel)
src/tSimulator/tSimul.h
src/tStorm/tStorm.cpp
src/tStorm/tStorm.h
${exe} PUBLIC tests/tHydroTests/ThydroModelTests.cpp
)

else()
Expand Down Expand Up @@ -270,6 +271,7 @@ else()
src/tSimulator/tSimul.h
src/tStorm/tStorm.cpp
src/tStorm/tStorm.h
tests/tHydroTests/ThydroModelTests.cpp
)

endif()
Expand Down Expand Up @@ -307,4 +309,16 @@ endif ()

enable_testing ()

add_executable(
tHydroTests
${PROJECT_SOURCE_DIR}/tests/tHydrotests/THydroModelTests.cpp
)
target_link_libraries(
tHydroTests
GTest::gtest_main
)

include(GoogleTest)
gtest_discover_tests(tHydroTests)

add_subdirectory(tests)
18 changes: 9 additions & 9 deletions src/Headers/Inclusions.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
#include <stdio.h>
#include <math.h>
#include <malloc.h>
#include <iostream.h>
#include <iomanip.h>
#include <fstream.h>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string.h>
#include <assert.h>
#include <memory.h>
Expand Down Expand Up @@ -64,9 +64,9 @@
#include <stdio.h>
#include <math.h>
#include <malloc.h>
#include <iostream.h>
#include <iomanip.h>
#include <fstream.h>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string.h>
#include <assert.h>
#include <memory.h>
Expand All @@ -76,9 +76,9 @@
#include <stdio.h>
#include <math.h>
#include <malloc.h>
#include <iostream.h>
#include <iomanip.h>
#include <fstream.h>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string.h>
#include <assert.h>
#include <memory.h>
Expand Down
6 changes: 3 additions & 3 deletions src/Headers/globalFns.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "src/tArray/tMatrix.h"

#ifdef ALPHA_64
#include <iostream.h>
#include <iostream>
#include <math.h>
#elif defined LINUX_32 //TODO update to LINUX
#include <iostream>
Expand All @@ -43,10 +43,10 @@
#include <cmath>

#elif defined WIN
#include <iostream.h>
#include <iostream>
#include <math.h>
#else
#include <iostream.h>
#include <iostream>
#include <math.h>
#endif

Expand Down
12 changes: 6 additions & 6 deletions src/Mathutil/mathutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

#ifdef ALPHA_64
#include <math.h>
#include<iostream.h>
#include<iomanip.h>
#include<iostream>
#include<iomanip>
#include<assert.h>
#elif defined LINUX_32
#include <cmath>
Expand All @@ -42,13 +42,13 @@
#include <cstdio>
#elif defined WIN
#include <math.h>
#include<iostream.h>
#include<iomanip.h>
#include<iostream>
#include<iomanip>
#include<assert.h>
#else
#include <math.h>
#include<iostream.h>
#include<iomanip.h>
#include<iostream>
#include<iomanip>
#include<assert.h>
#endif

Expand Down
12 changes: 6 additions & 6 deletions src/tArray/tArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@


#ifdef ALPHA_64
#include <iostream.h>
#include <fstream.h>
#include <iostream>
#include <fstream>
#include <assert.h>
#elif defined LINUX_32
#include <iostream>
Expand All @@ -39,12 +39,12 @@
#include <fstream>
#include <cassert>
#elif defined WIN
#include <iostream.h>
#include <fstream.h>
#include <iostream>
#include <fstream>
#include <assert.h>
#else
#include <iostream.h>
#include <fstream.h>
#include <iostream>
#include <fstream>
#include <assert.h>
#endif

Expand Down
12 changes: 6 additions & 6 deletions src/tCNode/tCNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
#include <list> //SMM - added 09232008

#ifdef ALPHA_64
#include <iostream.h>
#include <fstream.h>
#include <iostream>
#include <fstream>
#include <assert.h>
#include <math.h>
#elif defined LINUX_32
Expand All @@ -53,13 +53,13 @@
#include <cmath>

#elif defined WIN
#include <iostream.h>
#include <fstream.h>
#include <iostream>
#include <fstream>
#include <assert.h>
#include <math.h>
#else
#include <iostream.h>
#include <fstream.h>
#include <iostream>
#include <fstream>
#include <assert.h>
#include <math.h>
#endif
Expand Down
6 changes: 3 additions & 3 deletions src/tFlowNet/tFlowResults.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <iostream.h>
#include <iostream>
#include <stdio.h>
#elif defined LINUX_32
#include <cmath>
Expand All @@ -58,13 +58,13 @@
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <iostream.h>
#include <iostream>
#include <stdio.h>
#else
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <iostream.h>
#include <iostream>
#include <stdio.h>
#endif

Expand Down
12 changes: 6 additions & 6 deletions src/tInOut/tInputFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
#include "src/Headers/Classes.h"

#ifdef ALPHA_64
#include <iostream.h>
#include <fstream.h>
#include <iostream>
#include <fstream>
#include <assert.h>
#include <string.h>
#include <stdlib.h>
Expand All @@ -50,14 +50,14 @@
#include <string>
#include <cstdlib>
#elif defined WIN
#include <iostream.h>
#include <fstream.h>
#include <iostream>
#include <fstream>
#include <assert.h>
#include <string.h>
#include <stdlib.h>
#else
#include <iostream.h>
#include <fstream.h>
#include <iostream>
#include <fstream>
#include <assert.h>
#include <string.h>
#include <stdlib.h>
Expand Down
6 changes: 3 additions & 3 deletions src/tList/tList.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "src/Headers/Classes.h"

#ifdef ALPHA_64
#include <iostream.h>
#include <iostream>
#include <assert.h>
#elif defined LINUX_32
#include <iostream>
Expand All @@ -44,10 +44,10 @@
#include <iostream>
#include <cassert>
#elif defined WIN
#include <iostream.h>
#include <iostream>
#include <assert.h>
#else
#include <iostream.h>
#include <iostream>
#include <assert.h>
#endif

Expand Down
8 changes: 5 additions & 3 deletions src/tMesh/tMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2408,6 +2408,8 @@ MakeRandomPointsFromArcGrid( tInputFile &infile )
zinterp; // interp'd elev.
double mindist;
double delx, dely, dist;
void srand48();
void drand48();

tSubNode tempnode( infile ), // temporary node used in creating new pts
*stp1, *stp2, *stp3; // supertriangle vertices
Expand Down Expand Up @@ -2500,14 +2502,14 @@ MakeRandomPointsFromArcGrid( tInputFile &infile )
// Read and initialize seed for random number generation

seed = infile.ReadItem( seed, "SEED" );
srand48( seed );
srand( seed );
numpts = numcols * numrows;
tempnode.setBoundaryFlag( kNonBoundary );

mindist = delgrid / 10.0;
for( i=0; i<numpts; ++i ){
xgen = drand48() * (di - 1.0);
ygen = drand48() * (dj - 1.0);
xgen = std::rand() * (di - 1.0);
ygen = std::rand() * (dj - 1.0);

zinterp = InterpSquareGrid( xgen, ygen, elev, nodata );

Expand Down
12 changes: 6 additions & 6 deletions src/tMesh/tTriangulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@

#ifdef ALPHA_64
#include <math.h>
#include <fstream.h>
#include <fstream>
#include <stdlib.h>
#include <time.h>
#include <assert.h>
#include <iostream.h>
#include <iostream>
#elif defined LINUX_32
#include <cmath>
#include <fstream>
Expand All @@ -48,18 +48,18 @@

#elif defined WIN
#include <math.h>
#include <fstream.h>
#include <fstream>
#include <stdlib.h>
#include <time.h>
#include <assert.h>
#include <iostream.h>
#include <iostream>
#else
#include <math.h>
#include <fstream.h>
#include <fstream>
#include <stdlib.h>
#include <time.h>
#include <assert.h>
#include <iostream.h>
#include <iostream>
#endif

using namespace std;
Expand Down
6 changes: 3 additions & 3 deletions src/tMeshElements/meshElements.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
#include "src/Headers/globalFns.h"

#ifdef ALPHA_64
#include <iostream.h>
#include <iostream>
#include <math.h>
#elif defined LINUX_32
#include <iostream>
Expand All @@ -66,10 +66,10 @@
#include <iostream>
#include <cmath>
#elif defined WIN
#include <iostream.h>
#include <iostream>
#include <math.h>
#else
#include <iostream.h>
#include <iostream>
#include <math.h>
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/tRasTin/tInvariant.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#define TINVARIANT_H

#include "src/Headers/Inclusions.h"
#include <vector>

using namespace std;

class SoilType;
class LandType;
Expand Down Expand Up @@ -56,7 +56,7 @@ class GenericSoilData
// WR debug convert read grid flow to use smart pointes
// Define a typedef for convenience
using CharArrayPtr = std::unique_ptr<char[]>;

// Create vectors of unique_ptr to manage your character arrays
vector<CharArrayPtr> SCgridParamNames;
vector<CharArrayPtr> SCgridBaseNames;
Expand Down
6 changes: 3 additions & 3 deletions src/tSimulator/tControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@


#ifdef ALPHA_64
#include <iostream.h>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#elif defined LINUX_32
Expand All @@ -45,11 +45,11 @@
#include <cstdlib>

#elif defined WIN
#include <iostream.h>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#else
#include <iostream.h>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#endif
Expand Down
Loading

0 comments on commit 634a98d

Please sign in to comment.