Skip to content

Commit b819ea3

Browse files
authored
Merge pull request #417 from mwarusz/shrink_pbl_test
Shrink pbl test
2 parents 48581fc + c374b14 commit b819ea3

22 files changed

+49
-47
lines changed

tests/sandbox/pbl/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ add_test(pbl_iles_travis_diff bash -c "
5353
echo 'comparing timestep0000000000.xmf' &&
5454
diff $dir/timestep0000000000.xmf ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/timestep0000000000.xmf &&
5555
echo 'comparing timestep0000000600.h5' &&
56-
h5diff --delta=1e-6 -v $dir/timestep0000000600.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/timestep0000000600.h5 &&
56+
h5diff --delta=1e-5 -v $dir/timestep0000000600.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/timestep0000000600.h5 &&
5757
echo 'comparing timestep0000000600.xmf' &&
5858
diff $dir/timestep0000000600.xmf ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/timestep0000000600.xmf || exit 1;
5959
")
@@ -69,7 +69,7 @@ add_test(pbl_smg_travis_diff bash -c "
6969
echo 'comparing timestep0000000000.xmf' &&
7070
diff $dir/timestep0000000000.xmf ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/timestep0000000000.xmf &&
7171
echo 'comparing timestep0000000600.h5' &&
72-
h5diff --delta=1e-6 -v $dir/timestep0000000600.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/timestep0000000600.h5 &&
72+
h5diff --delta=1e-5 -v $dir/timestep0000000600.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/timestep0000000600.h5 &&
7373
echo 'comparing timestep0000000600.xmf' &&
7474
diff $dir/timestep0000000600.xmf ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/timestep0000000600.xmf || exit 1;
7575
")

tests/sandbox/pbl/budget.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
outname = dirname[4:]
9999
outfile = open('budget_' + outname + '.txt', 'w')
100100
for lev_d in zip(Z, hflux, tke_t, dssp, inb):
101-
outfile.write('{:6.2f} {:10.4e} {:10.4e} {:10.4e} {:10.4e}\n'.format(*lev_d))
101+
outfile.write('{:6.2f} {:10.3e} {:10.3e} {:10.3e} {:10.1e}\n'.format(*lev_d))
102102

103103
fig, axarr = plt.subplots(1, 1, figsize= (10, 6))
104104
axarr.plot(hflux, Z, 'k-', lw = 1, label = 'B')

tests/sandbox/pbl/pbl_iles.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99

1010
int main()
1111
{
12-
test<iles_tag>("out_pbl_iles", 1501);
12+
test<iles_tag>("out_pbl_iles", 65, 1501);
1313
}

tests/sandbox/pbl/pbl_iles_travis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99

1010
int main()
1111
{
12-
test<iles_tag>("out_pbl_iles_travis", 601);
12+
test<iles_tag>("out_pbl_iles_travis", 33, 601);
1313
}

tests/sandbox/pbl/pbl_smg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99

1010
int main()
1111
{
12-
test<smg_tag>("out_pbl_smg", 1501);
12+
test<smg_tag>("out_pbl_smg", 65, 1501);
1313
}

tests/sandbox/pbl/pbl_smg_travis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99

1010
int main()
1111
{
12-
test<smg_tag>("out_pbl_smg_travis", 601);
12+
test<smg_tag>("out_pbl_smg_travis", 33, 601);
1313
}

tests/sandbox/pbl/pbl_test_def.hpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ void set_sgs_specific(params_t &p, smg_tag)
3535
}
3636

3737
template <typename sgs_t>
38-
void test(const std::string &dirname, const int nt)
38+
void test(const std::string &dirname, const int np, const int nt)
3939
{
40-
const int nx = 65, ny = 65, nz = 51;
40+
const int nx = np, ny = np, nz = 51;
4141

4242
struct ct_params_t : ct_params_default_t
4343
{
@@ -60,11 +60,13 @@ void test(const std::string &dirname, const int nt)
6060

6161
using solver_t = pbl<ct_params_t>;
6262

63+
const int scale = 64 / (np - 1);
64+
6365
typename solver_t::rt_params_t p;
6466
p.n_iters = 2;
65-
p.dt = 10;
66-
p.di = 50;
67-
p.dj = 50;
67+
p.dt = 10 * scale;
68+
p.di = 50 * scale;
69+
p.dj = 50 * scale;
6870
p.dk = 30;
6971
p.grid_size = {nx, ny, nz};
7072
p.prs_tol = 1e-6;

tests/sandbox/pbl/profiles.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
outname = dirname[4:]
5353
outfile = open('profiles_' + outname + '.txt', 'w')
5454
for lev_d in zip(Z, hflux, var_th, var_w):
55-
outfile.write('{:6.2f} {:10.4e} {:10.4e} {:10.4e}\n'.format(*lev_d))
55+
outfile.write('{:6.2f} {:10.3e} {:10.3e} {:10.3e}\n'.format(*lev_d))
5656

5757
# plot profiles
5858
fig, axarr = plt.subplots(1, 3, figsize= (10, 6))
-122 Bytes
Binary file not shown.
-127 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)