Skip to content

Commit

Permalink
Merge pull request #121 from pdziekan/piggy_tadve_error
Browse files Browse the repository at this point in the history
throw an error when running piggybacker with SGS
  • Loading branch information
pdziekan committed Dec 22, 2020
2 parents c6b4c23 + e97707e commit 0fc77ec
Show file tree
Hide file tree
Showing 316 changed files with 405 additions and 3,366 deletions.
2 changes: 2 additions & 0 deletions src/uwlcm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ int main(int argc, char** argv)
if(!sgs) throw std::runtime_error("ILES option was disabled at compile time");
#endif

if(piggy && sgs) throw std::runtime_error("SGS does not work in a piggybacker run");

// set aerosol params to user_params data structure
user_params.mean_rd1 = vm["mean_rd1"].as<setup::real_t>() * si::metres;
user_params.sdev_rd1 = vm["sdev_rd1"].as<setup::real_t>();
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ endif()
add_executable(api_test api_test.cpp)
target_compile_features(api_test PRIVATE cxx_std_11)

add_test(api_test_iles api_test ${CMAKE_BINARY_DIR})
add_test(api_test_smg api_test ${CMAKE_BINARY_DIR} " --sgs=1 ")
add_test(api_test_iles api_test ${CMAKE_BINARY_DIR} 1)
add_test(api_test_smg api_test ${CMAKE_BINARY_DIR} 0 " --sgs=1 ")

add_test(api_test_iles_diff bash -c "
cd ${CMAKE_CURRENT_SOURCE_DIR}/refdata_iles/ && find ./* -maxdepth 1 -type d -print0 |
Expand Down
11 changes: 7 additions & 4 deletions tests/unit/api_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ using std::string;

int main(int ac, char** av)
{
if (ac != 2 && ac != 3) error_macro("expecting one or two arguments: 1. CMAKE_BINARY_DIR 2. additional command line options (optional)");
string opts_additional = ac == 3 ? av[2] : "";
if (ac != 3 && ac != 4) error_macro("expecting two or three arguments: 1. CMAKE_BINARY_DIR 2. should piggybacking be tested (bool) 3. additional command line options (optional)");
string opts_additional = ac == 4 ? av[3] : "";
bool run_piggy = std::stoi(av[2]);

string opts_common =
"--outfreq=1000 --nt=2 --spinup=1 --dt=1 --serial=true --prs_tol=1e-3 --rng_seed=44";
Expand All @@ -38,9 +39,11 @@ int main(int ac, char** av)
});
vector<string> opts_piggy({
"--piggy=0",
"--piggy=0 --save_vel=1",
"--piggy=1 --vel_in=velocity_out.dat" // take vel file from blk, cause it's ran first
"--piggy=0 --save_vel=1"
});
// run the piggybacker, if required
if(run_piggy)
opts_piggy.push_back("--piggy=1 --vel_in=velocity_out.dat"); // take vel file from blk, cause it's ran first

system("mkdir output");

Expand Down
Binary file modified tests/unit/refdata_smg/10008670509437324989/const.h5
Binary file not shown.
Binary file not shown.
Binary file modified tests/unit/refdata_smg/10061331760712049176/const.h5
Binary file not shown.
Binary file not shown.
Binary file removed tests/unit/refdata_smg/10271969262434480967/const.h5
Binary file not shown.
8 changes: 0 additions & 8 deletions tests/unit/refdata_smg/10271969262434480967/temp.xmf

This file was deleted.

Binary file not shown.
46 changes: 0 additions & 46 deletions tests/unit/refdata_smg/10271969262434480967/timestep0000000000.xmf

This file was deleted.

Binary file modified tests/unit/refdata_smg/10395329763337603010/const.h5
Binary file not shown.
Binary file not shown.
Binary file removed tests/unit/refdata_smg/10793849686973811368/const.h5
Binary file not shown.
8 changes: 0 additions & 8 deletions tests/unit/refdata_smg/10793849686973811368/temp.xmf

This file was deleted.

Binary file not shown.
82 changes: 0 additions & 82 deletions tests/unit/refdata_smg/10793849686973811368/timestep0000000000.xmf

This file was deleted.

Binary file modified tests/unit/refdata_smg/11189046563788975500/const.h5
Binary file not shown.
Binary file not shown.
8 changes: 4 additions & 4 deletions tests/unit/refdata_smg/11189046563788975500/velocity_out.dat
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
(-2,5) x (-2,5)
[ -0.0174617 -0.00930048 -0.00807265 -0.00930048 -0.0174617 -0.0173128 -0.0174617 -0.00930048
-0.0172987 -0.00922905 -0.010169 -0.00922905 -0.0172987 -0.0189474 -0.0172987 -0.00922905
-0.0172851 -0.00896632 0 -0.000712843 0.000285516 0 -0.0172851 -0.00896632
-0.0174617 -0.00930048 0 -0.000616798 0.000344027 0 -0.0174617 -0.00930048
-0.0172987 -0.00922905 0 -0.000637455 0.000290189 0 -0.0172987 -0.00922905
-0.0172851 -0.00896632 0 -0.000712843 0.000285516 0 -0.0172851 -0.00896632
-0.0172851 -0.00896632 0 -0.000712842 0.000285519 0 -0.0172851 -0.00896632
-0.0174617 -0.00930048 0 -0.000616796 0.000344027 0 -0.0174617 -0.00930048
-0.0172987 -0.00922905 0 -0.000637454 0.000290196 0 -0.0172987 -0.00922905
-0.0172851 -0.00896632 0 -0.000712842 0.000285519 0 -0.0172851 -0.00896632
-0.0174617 -0.00930048 -0.00807265 -0.00930048 -0.0174617 -0.0173128 -0.0174617 -0.00930048
-0.0172987 -0.00922905 -0.010169 -0.00922905 -0.0172987 -0.0189474 -0.0172987 -0.00922905 ]
Binary file modified tests/unit/refdata_smg/11476352679002413259/const.h5
Binary file not shown.
Binary file not shown.
Binary file removed tests/unit/refdata_smg/11573656417793777868/const.h5
Binary file not shown.
8 changes: 0 additions & 8 deletions tests/unit/refdata_smg/11573656417793777868/temp.xmf

This file was deleted.

Binary file not shown.
50 changes: 0 additions & 50 deletions tests/unit/refdata_smg/11573656417793777868/timestep0000000000.xmf

This file was deleted.

Binary file removed tests/unit/refdata_smg/11741014305933818104/const.h5
Binary file not shown.
8 changes: 0 additions & 8 deletions tests/unit/refdata_smg/11741014305933818104/temp.xmf

This file was deleted.

Binary file not shown.
53 changes: 0 additions & 53 deletions tests/unit/refdata_smg/11741014305933818104/timestep0000000000.xmf

This file was deleted.

Binary file modified tests/unit/refdata_smg/11998417678073278782/const.h5
Binary file not shown.
Binary file not shown.
Binary file removed tests/unit/refdata_smg/12092397533297004774/const.h5
Binary file not shown.
8 changes: 0 additions & 8 deletions tests/unit/refdata_smg/12092397533297004774/temp.xmf

This file was deleted.

Binary file not shown.

0 comments on commit 0fc77ec

Please sign in to comment.