Skip to content

Commit 8d6a53d

Browse files
committed
Merge branch 'beydoun/fix_cond_tend' into master (PR #7450)
EAMxx: compute shoc_cond and shoc_evap before ql update Fixes #7448 [BFB]
2 parents f05a2b7 + edf978e commit 8d6a53d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_impl.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,13 @@ void Functions<S,D>::shoc_assumed_pdf(
238238
// Compute SGS cloud fraction
239239
shoc_cldfrac(k) = ekat::min(1, a*C1 + (1 - a)*C2);
240240

241+
// Compute cond and evap tendencies
242+
if (extra_diags) {
243+
auto dum = ekat::max(0, a * ql1 + (1 - a) * ql2);
244+
shoc_cond(k) = ekat::max(0, (dum - shoc_ql(k)) / dtime);
245+
shoc_evap(k) = ekat::max(0, (shoc_ql(k) - dum) / dtime);
246+
}
247+
241248
// Compute SGS liquid water mixing ratio
242249
shoc_assumed_pdf_compute_sgs_liquid(a, ql1, ql2, shoc_ql(k));
243250

@@ -246,13 +253,6 @@ void Functions<S,D>::shoc_assumed_pdf(
246253
s2, ql2, C2, std_s2, shoc_ql(k),
247254
shoc_ql2(k));
248255

249-
// Compute cond and evap tendencies
250-
if (extra_diags) {
251-
auto dum = ekat::max(0, a * ql1 + (1 - a) * ql2);
252-
shoc_cond(k) = ekat::max(0, (dum - shoc_ql(k)) / dtime);
253-
shoc_evap(k) = ekat::max(0, (shoc_ql(k) - dum) / dtime);
254-
}
255-
256256
// Compute liquid water flux
257257
shoc_assumed_pdf_compute_liquid_water_flux(a, w1_1, w_first, ql1, w1_2, ql2, wqls(k));
258258

0 commit comments

Comments
 (0)