diff --git a/.github/workflows/cuda-ci.yml b/.github/workflows/cuda-ci.yml index b2d33b732..7eae2fe48 100644 --- a/.github/workflows/cuda-ci.yml +++ b/.github/workflows/cuda-ci.yml @@ -18,11 +18,20 @@ concurrency: jobs: cuda-build: runs-on: ubuntu-22.04 - name: CUDA v${{matrix.cuda_ver}} - Particles ${{matrix.particles}} + name: CUDA v${{matrix.cuda_ver}} - Mesh ${{matrix.mesh_precision}} Particles ${{matrix.particles}} ${{matrix.particles_precision}} strategy: matrix: cuda_pkg: [12-2] particles: [OFF, ON] + particles_precision: [DOUBLE, SINGLE] + mesh_precision: [DOUBLE, SINGLE] + exclude: + - particles: OFF + particles_precision: SINGLE + # SP-mesh entries are temporarily disabled because the upstream + # SP-mesh build currently fails on non-particle code. Remove the + # guard below to re-enable SP-mesh + DP/SP particles once fixed. + - mesh_precision: SINGLE include: - cuda_ver: "12.2" cuda_pkg: 12-2 @@ -71,6 +80,8 @@ jobs: -DERF_ENABLE_MPI:BOOL=ON \ -DERF_ENABLE_CUDA:BOOL=ON \ -DERF_ENABLE_PARTICLES:BOOL=${{matrix.particles}} \ + -DERF_PRECISION:STRING=${{matrix.mesh_precision}} \ + -DERF_PARTICLES_PRECISION:STRING=${{matrix.particles_precision}} \ -DERF_ENABLE_UNIT_TESTS:BOOL=ON . echo "Building with $(nproc) processes" cmake --build build-${{matrix.cuda_pkg}} --parallel $(nproc) \ diff --git a/.github/workflows/gcc.yml b/.github/workflows/gcc.yml index bbe5e3af6..b6ae55c5c 100644 --- a/.github/workflows/gcc.yml +++ b/.github/workflows/gcc.yml @@ -8,12 +8,21 @@ concurrency: jobs: library: - name: GNU@9.3 C++17 Release - Particles ${{matrix.particles}} + name: GNU@9.3 C++17 Release - Mesh ${{matrix.mesh_precision}} Particles ${{matrix.particles}} ${{matrix.particles_precision}} runs-on: ubuntu-22.04 # env: {CXXFLAGS: "-fno-operator-names -Werror -Wall -Wextra -Wpedantic -Wnull-dereference -Wfloat-conversion -Wshadow -Woverloaded-virtual"} strategy: matrix: particles: [OFF, ON] + particles_precision: [DOUBLE, SINGLE] + mesh_precision: [DOUBLE, SINGLE] + exclude: + - particles: OFF + particles_precision: SINGLE + # SP-mesh entries are temporarily disabled because the upstream + # SP-mesh build currently fails on non-particle code. Remove the + # guard below to re-enable SP-mesh + DP/SP particles once fixed. + - mesh_precision: SINGLE steps: @@ -45,6 +54,8 @@ jobs: -DERF_DIM:STRING=3 \ -DERF_ENABLE_MPI:BOOL=ON \ -DERF_ENABLE_PARTICLES:BOOL=${{matrix.particles}} \ + -DERF_PRECISION:STRING=${{matrix.mesh_precision}} \ + -DERF_PARTICLES_PRECISION:STRING=${{matrix.particles_precision}} \ -DERF_ENABLE_TESTS:BOOL=ON \ -DERF_ENABLE_ALL_WARNINGS:BOOL=ON \ -DERF_ENABLE_FCOMPARE:BOOL=ON \ @@ -73,17 +84,20 @@ jobs: exit ${return} - name: Check Unit Test Registration + if: matrix.particles_precision == 'DOUBLE' && matrix.mesh_precision == 'DOUBLE' run: | Tests/Unit/erf_unit_tests --gtest_list_tests | tee ${{runner.workspace}}/unit-test-list.txt grep -Eq '^[A-Za-z0-9_].*\.$' ${{runner.workspace}}/unit-test-list.txt working-directory: ${{runner.workspace}}/ERF/build - name: CMake Unit Tests + if: matrix.particles_precision == 'DOUBLE' && matrix.mesh_precision == 'DOUBLE' run: | ctest -L unit -VV working-directory: ${{runner.workspace}}/ERF/build - name: CMake Regression Tests # see file ERF/Tests/CTestList.cmake + if: matrix.particles_precision == 'DOUBLE' && matrix.mesh_precision == 'DOUBLE' run: | ctest -L regression -VV working-directory: ${{runner.workspace}}/ERF/build diff --git a/.github/workflows/hip.yml b/.github/workflows/hip.yml index 5d9638c66..97c8a179c 100644 --- a/.github/workflows/hip.yml +++ b/.github/workflows/hip.yml @@ -20,7 +20,7 @@ jobs: # https://gitlab.kitware.com/cmake/cmake/-/issues/21968 # https://github.com/ROCm-Developer-Tools/HIP/issues/2246 Build-And-Test-HIP: - name: HIP ROCm GFortran@9.3 C++17 - Particles ${{matrix.particles}} + name: HIP ROCm GFortran@9.3 C++17 - Mesh ${{matrix.mesh_precision}} Particles ${{matrix.particles}} ${{matrix.particles_precision}} runs-on: ubuntu-22.04 # Have to have -Wno-deprecated-declarations due to deprecated atomicAddNoRet # Have to have -Wno-gnu-zero-variadic-macro-arguments to avoid @@ -37,6 +37,15 @@ jobs: strategy: matrix: particles: [OFF, ON] + particles_precision: [DOUBLE, SINGLE] + mesh_precision: [DOUBLE, SINGLE] + exclude: + - particles: OFF + particles_precision: SINGLE + # SP-mesh entries are temporarily disabled because the upstream + # SP-mesh build currently fails on non-particle code. Remove the + # guard below to re-enable SP-mesh + DP/SP particles once fixed. + - mesh_precision: SINGLE steps: @@ -85,6 +94,8 @@ jobs: -DERF_ENABLE_HIP:BOOL=ON \ -DAMReX_AMD_ARCH=gfx908 \ -DERF_ENABLE_PARTICLES:BOOL=${{matrix.particles}} \ + -DERF_PRECISION:STRING=${{matrix.mesh_precision}} \ + -DERF_PARTICLES_PRECISION:STRING=${{matrix.particles_precision}} \ -DERF_ENABLE_TESTS:BOOL=ON \ -DERF_ENABLE_ALL_WARNINGS:BOOL=ON \ -DERF_ENABLE_FCOMPARE:BOOL=ON \ diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 9097b8421..cf66aa5a9 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -8,12 +8,21 @@ concurrency: jobs: MacOS-Clang: - name: Apple Clang@11.0 - Particles ${{matrix.particles}} + name: Apple Clang@11.0 - Mesh ${{matrix.mesh_precision}} Particles ${{matrix.particles}} ${{matrix.particles_precision}} runs-on: macos-latest # env: {CXXFLAGS: "-fno-operator-names -Werror -Wall -Wextra -Wpedantic -Wnull-dereference -Wfloat-conversion -Wshadow -Woverloaded-virtual"} strategy: matrix: particles: [OFF, ON] + particles_precision: [DOUBLE, SINGLE] + mesh_precision: [DOUBLE, SINGLE] + exclude: + - particles: OFF + particles_precision: SINGLE + # SP-mesh entries are temporarily disabled because the upstream + # SP-mesh build currently fails on non-particle code. Remove the + # guard below to re-enable SP-mesh + DP/SP particles once fixed. + - mesh_precision: SINGLE steps: @@ -43,6 +52,8 @@ jobs: -DERF_DIM:STRING=3 \ -DERF_ENABLE_MPI:BOOL=TRUE \ -DERF_ENABLE_PARTICLES:BOOL=${{matrix.particles}} \ + -DERF_PRECISION:STRING=${{matrix.mesh_precision}} \ + -DERF_PARTICLES_PRECISION:STRING=${{matrix.particles_precision}} \ -DERF_ENABLE_TESTS:BOOL=TRUE \ -DERF_ENABLE_ALL_WARNINGS:BOOL=TRUE \ -DERF_ENABLE_FCOMPARE:BOOL=TRUE \ @@ -72,17 +83,20 @@ jobs: exit ${return} - name: Check Unit Test Registration + if: matrix.particles_precision == 'DOUBLE' && matrix.mesh_precision == 'DOUBLE' run: | Tests/Unit/erf_unit_tests --gtest_list_tests | tee ${{runner.workspace}}/unit-test-list.txt grep -Eq '^[A-Za-z0-9_].*\.$' ${{runner.workspace}}/unit-test-list.txt working-directory: ${{runner.workspace}}/ERF/build - name: CMake Unit Tests + if: matrix.particles_precision == 'DOUBLE' && matrix.mesh_precision == 'DOUBLE' run: | ctest -L unit -VV working-directory: ${{runner.workspace}}/ERF/build - name: CMake Regression Tests # see file ERF/Tests/CTestList.cmake + if: matrix.particles_precision == 'DOUBLE' && matrix.mesh_precision == 'DOUBLE' run: | ctest -L regression -VV working-directory: ${{runner.workspace}}/ERF/build diff --git a/.github/workflows/sycl.yml b/.github/workflows/sycl.yml index c7bc21c07..33063e96c 100644 --- a/.github/workflows/sycl.yml +++ b/.github/workflows/sycl.yml @@ -17,11 +17,20 @@ concurrency: jobs: Build-And-Test-SYCL: - name: oneAPI SYCL - Particles ${{matrix.particles}} + name: oneAPI SYCL - Mesh ${{matrix.mesh_precision}} Particles ${{matrix.particles}} ${{matrix.particles_precision}} runs-on: ubuntu-24.04 strategy: matrix: particles: [OFF, ON] + particles_precision: [DOUBLE, SINGLE] + mesh_precision: [DOUBLE, SINGLE] + exclude: + - particles: OFF + particles_precision: SINGLE + # SP-mesh entries are temporarily disabled because the upstream + # SP-mesh build currently fails on non-particle code. Remove the + # guard below to re-enable SP-mesh + DP/SP particles once fixed. + - mesh_precision: SINGLE steps: @@ -72,6 +81,8 @@ jobs: -DERF_ENABLE_TESTS:BOOL=ON \ -DERF_ENABLE_ALL_WARNINGS:BOOL=ON \ -DERF_ENABLE_PARTICLES:BOOL=${{matrix.particles}} \ + -DERF_PRECISION:STRING=${{matrix.mesh_precision}} \ + -DERF_PARTICLES_PRECISION:STRING=${{matrix.particles_precision}} \ -DCMAKE_C_COMPILER=$(which icx) \ -DCMAKE_CXX_COMPILER=$(which icpx) \ -DCMAKE_CXX_STANDARD=17 \ diff --git a/.github/workflows/windows-mpi.yml b/.github/workflows/windows-mpi.yml index 4b0caac28..4b50441c1 100644 --- a/.github/workflows/windows-mpi.yml +++ b/.github/workflows/windows-mpi.yml @@ -8,13 +8,22 @@ concurrency: jobs: WIN64-MSVC: - name: WIN64-MSVC - MPI ${{ matrix.mpi }} - Particles ${{ matrix.particles }} + name: WIN64-MSVC - MPI ${{ matrix.mpi }} - Mesh ${{ matrix.mesh_precision }} Particles ${{ matrix.particles }} ${{ matrix.particles_precision }} runs-on: windows-latest strategy: fail-fast: false matrix: particles: [OFF, ON] + particles_precision: [DOUBLE, SINGLE] + mesh_precision: [DOUBLE, SINGLE] mpi: [ON] + exclude: + - particles: OFF + particles_precision: SINGLE + # SP-mesh entries are temporarily disabled because the upstream + # SP-mesh build currently fails on non-particle code. Remove the + # guard below to re-enable SP-mesh + DP/SP particles once fixed. + - mesh_precision: SINGLE steps: - name: Checkout (with submodules) @@ -39,6 +48,9 @@ jobs: cmake -S . -B build ` -DCMAKE_BUILD_TYPE=Release ` -DERF_ENABLE_MPI=ON ` + -DERF_ENABLE_PARTICLES:BOOL=${{ matrix.particles }} ` + -DERF_PRECISION:STRING=${{ matrix.mesh_precision }} ` + -DERF_PARTICLES_PRECISION:STRING=${{ matrix.particles_precision }} ` -DMPI_CXX_LIB_NAMES=msmpi ` -DMPI_C_LIB_NAMES=msmpi ` -DMPI_msmpi_LIBRARY="$env:MSMPI_LIB\msmpi.lib" ` @@ -157,7 +169,7 @@ jobs: - name: Upload artifact (from build tree) uses: actions/upload-artifact@v4 with: - name: ERF-win64-Release-mpi-${{ matrix.mpi }}-particles-${{ matrix.particles }} + name: ERF-win64-Release-mpi-${{ matrix.mpi }}-mesh-${{ matrix.mesh_precision }}-particles-${{ matrix.particles }}-${{ matrix.particles_precision }} path: | build if-no-files-found: warn diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 5a2d5d7c6..857a3bbd9 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -8,11 +8,20 @@ concurrency: jobs: WIN32-MSVC10: - name: WIN32 MSVC@19.29 - Particles ${{matrix.particles}} + name: WIN32 MSVC@19.29 - Mesh ${{matrix.mesh_precision}} Particles ${{matrix.particles}} ${{matrix.particles_precision}} runs-on: windows-latest strategy: matrix: particles: [OFF, ON] + particles_precision: [DOUBLE, SINGLE] + mesh_precision: [DOUBLE, SINGLE] + exclude: + - particles: OFF + particles_precision: SINGLE + # SP-mesh entries are temporarily disabled because the upstream + # SP-mesh build currently fails on non-particle code. Remove the + # guard below to re-enable SP-mesh + DP/SP particles once fixed. + - mesh_precision: SINGLE steps: @@ -28,6 +37,8 @@ jobs: -DERF_DIM:STRING=3 ` -DERF_ENABLE_MPI:BOOL=OFF ` -DERF_ENABLE_PARTICLES:BOOL=${{matrix.particles}} ` + -DERF_PRECISION:STRING=${{matrix.mesh_precision}} ` + -DERF_PARTICLES_PRECISION:STRING=${{matrix.particles_precision}} ` -DERF_ENABLE_TESTS:BOOL=ON ` -DERF_ENABLE_ALL_WARNINGS:BOOL=OFF ` -DERF_ENABLE_FCOMPARE:BOOL=ON ` @@ -38,6 +49,7 @@ jobs: cmake --build build --config Debug --parallel 2 --verbose - name: Check Unit Test Registration + if: matrix.particles_precision == 'DOUBLE' && matrix.mesh_precision == 'DOUBLE' shell: pwsh run: | $out = & "${{runner.workspace}}/ERF/build/Tests/Unit/Debug/erf_unit_tests.exe" --gtest_list_tests @@ -49,11 +61,13 @@ jobs: working-directory: ${{runner.workspace}}/ERF/build - name: CMake Unit Tests + if: matrix.particles_precision == 'DOUBLE' && matrix.mesh_precision == 'DOUBLE' run: | ctest -C Debug -L unit -VV working-directory: ${{runner.workspace}}/ERF/build - name: CMake Regression Tests # see file ERF/Tests/CTestList.cmake + if: matrix.particles_precision == 'DOUBLE' && matrix.mesh_precision == 'DOUBLE' run: | ctest -C Debug -L regression -VV working-directory: ${{runner.workspace}}/ERF/build diff --git a/CMake/SetAmrexOptions.cmake b/CMake/SetAmrexOptions.cmake index ce358e354..6817c0622 100644 --- a/CMake/SetAmrexOptions.cmake +++ b/CMake/SetAmrexOptions.cmake @@ -5,6 +5,7 @@ set(AMReX_PIC OFF) set(AMReX_MPI ${ERF_ENABLE_MPI}) set(AMReX_OMP ${ERF_ENABLE_OPENMP}) set(AMReX_PRECISION "${ERF_PRECISION}" CACHE STRING "Floating point precision" FORCE) +set(AMReX_PARTICLES_PRECISION "${ERF_PARTICLES_PRECISION}" CACHE STRING "Particle floating point precision" FORCE) set(AMReX_EB OFF) set(AMReX_FORTRAN_INTERFACES OFF) set(AMReX_AMRDATA OFF) diff --git a/CMakeLists.txt b/CMakeLists.txt index 74c6d0537..c55f3cefa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -136,6 +136,7 @@ option(ERF_ENABLE_HDF5 "Enable HDF5 IO" ${ERF_ENABLE_NETCDF}) option(ERF_ENABLE_PARTICLES "Enable Lagrangian particles" OFF) option(ERF_ENABLE_FCOMPARE "Enable building fcompare when not testing" OFF) set(ERF_PRECISION "DOUBLE" CACHE STRING "Floating point precision SINGLE or DOUBLE") +set(ERF_PARTICLES_PRECISION "${ERF_PRECISION}" CACHE STRING "Particle floating point precision SINGLE or DOUBLE") option(ERF_ENABLE_RRTMGP "Enable RTE-RRTMGP Radiation" OFF) option(ERF_ENABLE_ML_UPHYS_DIAGNOSTICS "Enable ML UPHYS diagnostics in SDM" OFF) @@ -233,8 +234,21 @@ else() endif() else() set(CMAKE_PREFIX_PATH ${AMREX_DIR} ${CMAKE_PREFIX_PATH}) + if(ERF_PRECISION STREQUAL "SINGLE") + set(_amrex_mesh_precision_component "SINGLE") + else() + set(_amrex_mesh_precision_component "DOUBLE") + endif() + if(ERF_PARTICLES_PRECISION STREQUAL "SINGLE") + set(_amrex_particle_precision_component "PSINGLE") + else() + set(_amrex_particle_precision_component "PDOUBLE") + endif() list(APPEND AMREX_COMPONENTS - "3D" "PIC" "PARTICLES" "PDOUBLE" "DOUBLE" "LSOLVERS") + "3D" "PIC" "PARTICLES" + "${_amrex_particle_precision_component}" + "${_amrex_mesh_precision_component}" + "LSOLVERS") if (ERF_ENABLE_MPI) list(APPEND AMREX_COMPONENTS "MPI") endif() diff --git a/Docs/sphinx_doc/Particles.rst b/Docs/sphinx_doc/Particles.rst index dbd69d8a5..855416ef0 100644 --- a/Docs/sphinx_doc/Particles.rst +++ b/Docs/sphinx_doc/Particles.rst @@ -51,6 +51,27 @@ One must also set in the inputs file or on the command line at runtime. +Particle Precision +~~~~~~~~~~~~~~~~~~ + +Particle floating-point data (positions, velocities, and any user-defined +real-typed attributes) can be stored in single precision independently of +the mesh-data precision. With cmake, set + +:: + + -DERF_PARTICLES_PRECISION:STRING=SINGLE \ + +(default is ``DOUBLE``, which matches ``ERF_PRECISION``). This forwards to +``AMReX_PARTICLES_PRECISION`` and defines ``AMREX_SINGLE_PRECISION_PARTICLES``. +With gmake, set + +:: + + USE_SINGLE_PRECISION_PARTICLES = TRUE + +in the GNUmakefile. + Initialization -------------- diff --git a/Docs/sphinx_doc/buildingSystems.rst b/Docs/sphinx_doc/buildingSystems.rst index 9068ce607..ace93a10b 100644 --- a/Docs/sphinx_doc/buildingSystems.rst +++ b/Docs/sphinx_doc/buildingSystems.rst @@ -548,6 +548,14 @@ CMake can also generate makefiles for the Ninja build system for faster compilat - Enables support for Lagrangian particles - OFF - ON/OFF + * - ``ERF_PRECISION`` + - Floating-point precision for mesh data + - DOUBLE + - SINGLE/DOUBLE + * - ``ERF_PARTICLES_PRECISION`` + - Floating-point precision for particle data; defaults to ``ERF_PRECISION`` + - DOUBLE + - SINGLE/DOUBLE * - ``ERF_ENABLE_MULTIBLOCK`` - Enables multiblock capability - OFF diff --git a/Source/Particles/ERF_SuperDropletPCCoalescence.cpp b/Source/Particles/ERF_SuperDropletPCCoalescence.cpp index b2e8bdaa4..d0a62a90d 100644 --- a/Source/Particles/ERF_SuperDropletPCCoalescence.cpp +++ b/Source/Particles/ERF_SuperDropletPCCoalescence.cpp @@ -296,11 +296,11 @@ void SuperDropletPC::Coalescence( int a_lev, CollisionKernel ckernel{}; - Gpu::Buffer particle_collisions({0}); + Gpu::Buffer particle_collisions({0}); auto particle_collisions_ptr = particle_collisions.data(); Gpu::DeviceVector coal_partner_idx, flag_prey, num_particles_bin; - Gpu::DeviceVector coal_rate, coal_rmndr; + Gpu::DeviceVector coal_rate, coal_rmndr; num_particles_bin.resize(np); coal_partner_idx.resize(np); flag_prey.resize(np); @@ -478,7 +478,7 @@ void SuperDropletPC::Coalescence( int a_lev, } ); Gpu::synchronize(); - num_collisions = *(particle_collisions.copyToHost()); + num_collisions = static_cast(*(particle_collisions.copyToHost())); ParallelFor( np, [=] AMREX_GPU_DEVICE (int i) { diff --git a/Source/Particles/ERF_SuperDropletPCMassChange.cpp b/Source/Particles/ERF_SuperDropletPCMassChange.cpp index 93e791c9c..a3cc60d88 100644 --- a/Source/Particles/ERF_SuperDropletPCMassChange.cpp +++ b/Source/Particles/ERF_SuperDropletPCMassChange.cpp @@ -53,22 +53,22 @@ void SuperDropletPC::MassChange ( int a_ auto ti_choice = m_mass_change_ti; // Solver setup (shared across tiles) - dRsqdt drsqdt{ vapour_mat.m_lat_vap, - therco, - vapour_mat.m_Rv, - mat_density }; + dRsqdt drsqdt{ static_cast(vapour_mat.m_lat_vap), + static_cast(therco), + static_cast(vapour_mat.m_Rv), + static_cast(mat_density) }; NewtonSolver< dRsqdt, ParticleReal > newton_solver{ drsqdt, - m_newton_rtol, - m_newton_atol, - m_newton_stol, + static_cast(m_newton_rtol), + static_cast(m_newton_atol), + static_cast(m_newton_stol), m_newton_maxits }; #ifdef ERF_USE_ML_UPHYS_DIAGNOSTICS - dRdt drdt{ vapour_mat.m_lat_vap, - therco, - vapour_mat.m_Rv, - mat_density }; + dRdt drdt{ static_cast(vapour_mat.m_lat_vap), + static_cast(therco), + static_cast(vapour_mat.m_Rv), + static_cast(mat_density) }; constexpr int rtoff_r = SuperDropletsRealIdx::ncomps; #endif @@ -159,11 +159,15 @@ void SuperDropletPC::MassChange ( int a_ TI< dRsqdt, NewtonSolver, ParticleReal>, - ParticleReal > ti { drsqdt, newton_solver, a_dt, 100, + ParticleReal > ti { drsqdt, newton_solver, static_cast(a_dt), 100, sat_ratio, temperature, e_sat, - coeff_moldiff, coeff_curv, coeff_sol, + static_cast(coeff_moldiff), + static_cast(coeff_curv), + static_cast(coeff_sol), solute_moles, - cfl, 1e-40, 1e-3, 1e-6, false, false }; + static_cast(cfl), + ParticleReal(1e-40), ParticleReal(1e-3), ParticleReal(1e-6), + false, false }; auto r_init = SD_effective_radius( i, ctx.idx_water, ctx.rho_water, @@ -201,7 +205,7 @@ void SuperDropletPC::MassChange ( int a_ auto d_mass = four_thirds_pi*mat_density * (r_new*r_new*r_new - r_init*r_init*r_init); ptrs.sp_mass_ptrs[idx_vap][i] += d_mass; // don't let it go negative - ptrs.sp_mass_ptrs[idx_vap][i] = std::max(ptrs.sp_mass_ptrs[idx_vap][i],amrex::Real(0)); + ptrs.sp_mass_ptrs[idx_vap][i] = std::max(ptrs.sp_mass_ptrs[idx_vap][i],ParticleReal(0)); // Update particle attributes (radius and mass) SuperDropletPC::updateParticleAttributes( diff --git a/Source/Particles/ERF_SuperDropletPCUtils.cpp b/Source/Particles/ERF_SuperDropletPCUtils.cpp index 4237d1578..213bb09f0 100644 --- a/Source/Particles/ERF_SuperDropletPCUtils.cpp +++ b/Source/Particles/ERF_SuperDropletPCUtils.cpp @@ -307,7 +307,7 @@ void SuperDropletPC::cloudRainDensity(MultiFab& a_mf, const MultiFab& a_z_phys_n [=] AMREX_GPU_DEVICE (const SDTDType& ptd, int i) { auto radius = ptd.m_runtime_rdata[SuperDropletsRealIdxSoA_RT::radius][i]; if ((radius < a_rmin) || (radius >= a_rmax)) { - return 0.0; + return ParticleReal(0); } auto ai = ptd.m_runtime_idata[SuperDropletsIntIdxSoA_RT::active][i]; auto num_par = ptd.m_runtime_rdata[SuperDropletsRealIdxSoA_RT::multiplicity][i];