Skip to content

Commit 3e085f6

Browse files
committed
Merge branch 'master' of github.com:igfuw/libcloudphxx into sgs_tke
2 parents fc810b9 + 1c992f7 commit 3e085f6

36 files changed

+261
-149
lines changed

.travis.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ aliases:
6868
jobs:
6969
include:
7070
- <<: *precache_tests_mpi
71-
env: TEST_SUITE=MPI_tests MPI=mvapich2
71+
env: TEST_SUITE=tests MPI=mvapich2
7272
compiler: gcc
7373
# clang MPI_tests disabled due to issues with manually built boost python libstdc++ / libc++ issues
7474
# - <<: *precache_default
@@ -88,7 +88,7 @@ jobs:
8888
env: TEST_SUITE=cuda MPI=none
8989

9090
- compiler: clang
91-
env: TEST_SUITE=MPI_tests MPI=none
91+
env: TEST_SUITE=tests MPI=mvapich2
9292

9393
- compiler: clang
9494
env: TEST_SUITE=UWLCM_MT MPI=mvapich2
@@ -162,8 +162,10 @@ install:
162162
- if [[ $MPI != 'none' ]]; then . ./.travis_scripts/deps_install/boost.sh; fi
163163
- if [[ $MPI != 'none' && $TEST_SUITE == 'UWLCM_MT' ]]; then . ./.travis_scripts/deps_install/mpi_hdf5.sh; fi
164164

165-
- sudo pip3 install -U pytest --ignore-installed six
166-
- sudo pip3 install -U scipy --ignore-installed six
165+
- sudo -H pip3 install --upgrade pip
166+
- sudo -H pip3 install -U pytest --ignore-installed six
167+
- sudo -H pip3 install -U numpy==1.18.5 --ignore-installed six # newer versions require python >= 3.6
168+
- sudo -H pip3 install -U scipy==1.4.1 six # ditto
167169

168170
- if [[ $TEST_SUITE == 'cuda' ]]; then sudo apt-get install -y cuda-toolkit-8-0; fi
169171
- if [[ $TEST_SUITE == 'cuda' ]]; then export CUDA_HOME=/usr/local/cuda; fi
@@ -178,7 +180,7 @@ install:
178180
- if [[ $MPI == 'none' && ($TEST_SUITE != 'tests' || $TEST_SUITE != 'KidA') ]]; then sudo ln -s /usr/lib/x86_64-linux-gnu/libboost_python-py35.so /usr/lib/x86_64-linux-gnu/libboost_python3.so; fi # different naming conventions for boost python with python 3
179181

180182
# thrust
181-
- git clone --depth=1 git://github.com/thrust/thrust.git;
183+
- git clone --depth=1 git://github.com/thrust/thrust.git --branch 1.9.10-1;
182184
- sudo ln -s `pwd`/thrust/thrust /usr/local/include/thrust;
183185
- if [[ $TEST_SUITE == 'cuda' ]]; then sudo ln -s `pwd`/thrust/thrust /usr/local/cuda/include/thrust; fi
184186

@@ -200,6 +202,4 @@ script:
200202
- if [[ $TEST_SUITE == 'UWLCM_unit_smg' ]]; then . ./.travis_scripts/UWLCM.sh unit_smg; fi
201203
# KiD-A 1D
202204
- if [[ $TEST_SUITE == 'KidA' ]]; then . ./.travis_scripts/KidA.sh; fi
203-
# unit tests and drops.py with MPI (drop drops here?)
204-
- if [[ $TEST_SUITE == 'MPI_tests' ]]; then . ./.travis_scripts/tests.sh; fi
205205

.travis_scripts/UWLCM.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ sudo make install
2929
cd ../../..
3030

3131
## UWLCM
32-
# TEMP: use mpi branch from pdziekan
33-
git clone --depth=1 --branch=mpi_up_to_date git://github.com/pdziekan/UWLCM.git
34-
#git clone --depth=1 git://github.com/igfuw/UWLCM.git
32+
git clone --depth=1 git://github.com/igfuw/UWLCM.git
3533
cd UWLCM
3634
. .travis_scripts/$1.sh
3735
set +ex # see https://github.com/travis-ci/travis-ci/issues/6522

.travis_scripts/deps_install/boost.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
1919
cat $HOME/user-config.jam
2020
if [[ $COMPILER == 'g++' ]]; then
2121
./bootstrap.sh --prefix=${DEPS_DIR}/boost/ --with-libraries=chrono,regex,serialization,mpi,atomic,thread,date_time,system,iostreams,timer,filesystem,program_options,python
22-
./b2 -d0 install
22+
travis_wait 30 ./b2 -d0 install
2323
fi
2424
if [[ $COMPILER == 'clang++' ]]; then
2525
#clang installation taken from https://gist.github.com/jimporter/10442880

CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ project(libcloudph++ LANGUAGES CXX)
1313
# cmake_policy(VERSION 3.0)
1414
#endif()
1515

16-
#cmake_policy(SET CMP0079 NEW)
16+
cmake_policy(SET CMP0079 NEW)
1717

1818
# put out custom find scripts first
1919
list(INSERT CMAKE_MODULE_PATH 0 ${PROJECT_SOURCE_DIR}/cmake)
@@ -108,11 +108,11 @@ target_include_directories(cloudphxx_lgrngn
108108
)
109109

110110
# enabling additional warnings
111-
target_compile_options(cloudphxx_lgrngn PRIVATE $<$<COMPILE_LANGUAGE:CXX>: -Wextra>)
111+
#target_compile_options(cloudphxx_lgrngn PRIVATE $<$<COMPILE_LANGUAGE:CXX>: -Wextra>)
112112
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
113113

114-
# enabling c++11
115-
target_compile_features(cloudphxx_lgrngn PUBLIC cxx_std_11)
114+
# enabling c++14
115+
target_compile_features(cloudphxx_lgrngn PUBLIC cxx_std_14)
116116
# config-specific flags
117117
target_compile_options(cloudphxx_lgrngn PRIVATE $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>: -g -Og -DTHRUST_DEBUG>)
118118
target_compile_options(cloudphxx_lgrngn PRIVATE $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:RELWITHDEBINFO>>: -Ofast -march=native>)
@@ -332,7 +332,7 @@ file(WRITE "${tmpdir}/test.cpp" "
332332
chem_stepper.do_step(rhs(), v, 0, 1);
333333
}
334334
")
335-
execute_process(COMMAND "${CMAKE_CXX_COMPILER}" "test.cpp" "-I${Boost_INCLUDE_DIR}" "-I${THRUST_INCLUDE_DIR}" WORKING_DIRECTORY ${tmpdir} RESULT_VARIABLE status ERROR_VARIABLE msg)
335+
execute_process(COMMAND "${CMAKE_CXX_COMPILER}" "-std=c++14" "test.cpp" "-I${Boost_INCLUDE_DIR}" "-I${THRUST_INCLUDE_DIR}" WORKING_DIRECTORY ${tmpdir} RESULT_VARIABLE status ERROR_VARIABLE msg)
336336
if (NOT status EQUAL 0)
337337
message(FATAL_ERROR "${pfx}: c++ compiler failed\n ${msg}")
338338
endif()

include/libcloudph++/common/detail/toms748.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,9 @@ T toms748_solve(F f, const T& ax, const T& bx, const T& fax, const T& fbx, Tol t
295295

296296
a = ax;
297297
b = bx;
298+
299+
fa = fax;
300+
fb = fbx;
298301

299302
#if !defined(NDEBUG)
300303
if(a >= b)
@@ -303,10 +306,6 @@ T toms748_solve(F f, const T& ax, const T& bx, const T& fax, const T& fbx, Tol t
303306
assert(0);
304307
}
305308
#endif
306-
307-
308-
fa = fax;
309-
fb = fbx;
310309

311310
if(tol(a, b) || (fa == 0) || (fb == 0))
312311
{

include/libcloudph++/common/kappa_koehler.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace libcloudphxx
3434
quantity<si::dimensionless, real_t> RH
3535
)
3636
{
37-
assert(RH > .05); // kappa-koehler assumes well dissolved matter
37+
assert(RH > .03); // kappa-koehler assumes well dissolved matter
3838
assert(RH < 1.); // no equilibrium over RH=100%
3939
assert(kappa > 0); // pure-water case left out
4040
return rd3 * (1 - RH * (1 - kappa)) / (1 - RH);

include/libcloudph++/common/output.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ namespace libcloudphxx
1616
outS_VI = chem::S_VI,
1717
outH = chem::H,
1818
outliq_vol,
19-
outdry_vol
19+
outdry_vol,
20+
outprtcl_num
2021
};
2122

2223
const std::map<output_t, std::string> output_names
@@ -30,7 +31,8 @@ namespace libcloudphxx
3031
{outS_VI , "S_VI"},
3132
{outH , "H"},
3233
{outliq_vol, "liquid_volume"},
33-
{outdry_vol, "dry_volume"}
34+
{outdry_vol, "dry_volume"},
35+
{outprtcl_num, "particle_number"}
3436
};
3537
};
3638
};

include/libcloudph++/lgrngn/opts_init.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ namespace libcloudphxx
139139

140140
bool no_ccn_at_init; // if true, no ccn / SD are put at the start of the simulation
141141

142-
bool open_side_walls; // if true, side walls are "open", i.e. SD are removed at contact.
142+
bool open_side_walls, // if true, side walls are "open", i.e. SD are removed at contact. Periodic otherwise.
143+
periodic_topbot_walls; // if true, top and bot walls are periodic. Open otherwise
144+
143145

144146
// ctor with defaults (C++03 compliant) ...
145147
opts_init_t() :
@@ -183,7 +185,8 @@ namespace libcloudphxx
183185
rd_min(0.),
184186
diag_incloud_time(false),
185187
no_ccn_at_init(false),
186-
open_side_walls(false)
188+
open_side_walls(false),
189+
periodic_topbot_walls(false)
187190
{}
188191

189192
// dtor (just to silence -Winline warnings)

models/kinematic_2D/tests/paper_GMD_2015/fig_a/CMakeLists.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ add_test(travis_2D_kin_cloud_dims_blk bash -c "
5959
add_test(travis_2D_kin_cloud_diff_blk_1m bash -c "
6060
for dir in travis_out_blk_1m; do
6161
echo 'comparing const.h5' &&
62-
h5diff --delta=2e-7 -v2 $dir/const.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/const.h5 &&
62+
h5diff --delta=3e-7 -v2 $dir/const.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/const.h5 &&
6363
echo 'comparing timestep0000000000.h5' &&
6464
h5diff --delta=2e-5 -v2 $dir/timestep0000000000.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/timestep0000000000.h5 /rv &&
6565
h5diff --delta=2e-5 -v2 $dir/timestep0000000000.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/timestep0000000000.h5 /rr &&
@@ -76,7 +76,7 @@ add_test(travis_2D_kin_cloud_diff_blk_1m bash -c "
7676
add_test(travis_2D_kin_cloud_diff_blk_2m bash -c "
7777
for dir in travis_out_blk_2m; do
7878
echo 'comparing const.h5'
79-
h5diff --delta=2e-7 -v2 $dir/const.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/const.h5 &&
79+
h5diff --delta=3e-7 -v2 $dir/const.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/const.h5 &&
8080
echo 'comparing timestep0000000000.h5' &&
8181
h5diff --relative=1e-9 -v2 $dir/timestep0000000000.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/timestep0000000000.h5 /rv &&
8282
h5diff --relative=1e-9 -v2 $dir/timestep0000000000.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/timestep0000000000.h5 /rr &&
@@ -106,14 +106,14 @@ add_test(travis_2D_kin_cloud_dims_lgrngn bash -c "
106106
add_test(travis_2D_kin_cloud_diff_lgrngn bash -c "
107107
for dir in travis_out_lgrngn; do
108108
echo 'comparing const.h5'
109-
h5diff --delta=1e-6 -v2 $dir/const.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/travis_const.h5 &&
109+
h5diff --delta=1e-6 -v2 $dir/const.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/travis_const.h5 &&
110110
echo 'comparing timestep0000000000.h5' &&
111-
h5diff --relative=1e-9 -v2 $dir/timestep0000000000.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/travis_timestep0000000000.h5 /th &&
112-
h5diff --relative=1e-9 -v2 $dir/timestep0000000000.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/travis_timestep0000000000.h5 /rv &&
113-
h5diff --relative=1e-9 -v2 $dir/timestep0000000000.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/travis_timestep0000000000.h5 /sd_conc &&
111+
h5diff --relative=1e-9 -v2 $dir/timestep0000000000.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/travis_timestep0000000000.h5 /th &&
112+
h5diff --relative=1e-9 -v2 $dir/timestep0000000000.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/travis_timestep0000000000.h5 /rv &&
113+
h5diff --relative=1e-9 -v2 $dir/timestep0000000000.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/travis_timestep0000000000.h5 /sd_conc &&
114114
echo 'comparing timestep0000000020.h5' &&
115-
h5diff --relative=0.001 -v2 $dir/timestep0000000020.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/travis_timestep0000000020.h5 /th &&
116-
h5diff --relative=0.002 -v2 $dir/timestep0000000020.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/travis_timestep0000000020.h5 /rv &&
117-
h5diff --delta=1 -v2 $dir/timestep0000000020.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/travis_timestep0000000020.h5 /sd_conc || exit 1;
115+
h5diff --relative=0.001 -v2 $dir/timestep0000000020.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/travis_timestep0000000020.h5 /th &&
116+
h5diff --relative=0.0021 -v2 $dir/timestep0000000020.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/travis_timestep0000000020.h5 /rv &&
117+
h5diff --delta=1 -v2 $dir/timestep0000000020.h5 ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$dir/travis_timestep0000000020.h5 /sd_conc || exit 1;
118118
done
119119
")

src/detail/config.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ namespace libcloudphxx
2828
// range of beard77fast bins:
2929
const real_t vt0_ln_r_min, vt0_ln_r_max;
3030

31+
const real_t bcond_tolerance = 2e-4; // [m]; error tolerance for position near bcond after distmem copy
32+
3133
// ctor
3234
config():
3335
vt0_ln_r_min(log(5e-7)),

0 commit comments

Comments
 (0)