Skip to content

Commit

Permalink
Calculate planar average of tke only if it is available (#956)
Browse files Browse the repository at this point in the history
  • Loading branch information
ewquon authored Jan 11, 2024
1 parent 7befe70 commit aa9b7e8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions amr-wind/wind_energy/ABLStats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,11 @@ void ABLStats::write_netcdf()
*t_sfs_stress, m_sim.time(), m_normal_dir);
pa_tsfs();

auto& m_ksgs = m_sim.repo().get_field("tke");
FieldPlaneAveraging pa_ksgs(m_ksgs, m_sim.time(), m_normal_dir);
pa_ksgs();
if (m_sim.repo().field_exists("tke")) {
auto& m_ksgs = m_sim.repo().get_field("tke");
FieldPlaneAveraging pa_ksgs(m_ksgs, m_sim.time(), m_normal_dir);
pa_ksgs();
}

if (!amrex::ParallelDescriptor::IOProcessor()) return;
auto ncf = ncutils::NCFile::open(m_ncfile_name, NC_WRITE);
Expand Down

0 comments on commit aa9b7e8

Please sign in to comment.