Skip to content

Commit

Permalink
Merge pull request #2865 from E3SM-Project/beydoun/fix_rh_diag
Browse files Browse the repository at this point in the history
Beydoun/fix rh diag
  • Loading branch information
bartgol authored Jun 14, 2024
2 parents b30b5e0 + 9e82d9d commit b7ba172
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions components/eamxx/src/diagnostics/relative_humidity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ void RelativeHumidityDiagnostic::compute_diagnostic_impl()
const int jpack = idx % npacks;
const auto range_pack = ekat::range<Pack>(jpack*Pack::n);
const auto range_mask = range_pack < num_levs;
auto qv_sat_l = physics::qv_sat_wet(T_mid(icol,jpack), p_dry_mid(icol,jpack), false, range_mask, dp_wet(icol,jpack), dp_dry(icol,jpack),
physics::MurphyKoop, "RelativeHumidityDiagnostic::compute_diagnostic_impl");
auto qv_sat_l = physics::qv_sat_wet(T_mid(icol,jpack), p_dry_mid(icol,jpack), true, range_mask, dp_wet(icol,jpack), dp_dry(icol,jpack),
physics::MurphyKoop, "RelativeHumidityDiagnostic::compute_diagnostic_impl");
RH(icol,jpack) = qv_mid(icol,jpack)/qv_sat_l;

});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ void run(std::mt19937_64& engine)

Kokkos::parallel_for(Kokkos::TeamVectorRange(team,num_mid_packs), [&] (const Int& jpack) {
dpdry_sub(jpack) = dpwet_sub(jpack) - dpwet_sub(jpack)*qv_sub(jpack);
auto qv_sat_l = physics::qv_sat_dry(T_mid_v(icol,jpack), p_dry_mid_v(icol,jpack), false, range_mask);
auto qv_sat_l = physics::qv_sat_dry(T_mid_v(icol,jpack), p_dry_mid_v(icol,jpack), true, range_mask);
qv_sat_l *= dpdry_v(icol,jpack) ;
qv_sat_l /= dpwet_v(icol,jpack) ;
rh_v(icol,jpack) = qv_v(icol,jpack)/qv_sat_l;
Expand Down

0 comments on commit b7ba172

Please sign in to comment.