-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly initialize reference values for Rayleigh damping if using Ra…
…yleigh + input_sounding + terrain (#1429) * Remove duplicative print statement * Clarify comment * Properly initialize rayleigh from sounding when there's terrain * Remove out-of-date notification
- Loading branch information
Showing
5 changed files
with
54 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef ParFunctions_H | ||
#define ParFunctions_H | ||
|
||
/** | ||
* Reduce a multifab to a vector of values at height levels | ||
*/ | ||
AMREX_FORCE_INLINE | ||
void reduce_to_max_per_level (amrex::Vector<amrex::Real>& v, | ||
std::unique_ptr<amrex::MultiFab>& mf) | ||
{ | ||
amrex::MultiArray4<const amrex::Real> const& ma = mf->const_arrays(); | ||
for (int k = 0; k < v.size(); k++) { | ||
v[k] = amrex::ParReduce(amrex::TypeList<amrex::ReduceOpMax>{}, | ||
amrex::TypeList<amrex::Real>{}, | ||
*mf, | ||
amrex::IntVect(0), | ||
[=] AMREX_GPU_DEVICE (int box_no, int i, int j, int) noexcept | ||
-> amrex::GpuTuple<amrex::Real> | ||
{ | ||
return { ma[box_no](i,j,k) }; | ||
}); | ||
} | ||
amrex::ParallelDescriptor::ReduceRealMax(v.data(), v.size()); | ||
} | ||
|
||
#endif /* ParFunctions_H */ |