-
Notifications
You must be signed in to change notification settings - Fork 8
Oscar/seq drydep set h coeff #353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| constexpr Real ph = 1.e-5; // measure of the acidity (dimensionless) | ||
|
|
||
| const Real t0 = 298.0; // Standard Temperature | ||
| const Real ph_inv = 1.0 / ph; // Inverse of PH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both t0 and ph_inv can be constexpr as they are known at compile time.
| const Real t0 = 298.0; // Standard Temperature | ||
| const Real ph_inv = 1.0 / ph; // Inverse of PH | ||
|
|
||
| const Real wrk = (t0 - sfc_temp) / (t0 * sfc_temp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add an EKAT ASSERT before line 97 to guard against dividing by zero?
EKAT_KERNEL_ASSERT_MSG((t0 * sfc_temp) !=0,
"Error! : set_hcoeff_scalar,"
"(t0 * sfc_temp) is zero, division by zero \n");
or something similar....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t0 is 298, and sfc_temp (surface temperature) is very unlikely to be zero. Thus, I do not think we will encounter a division by zero. In addition, if sfc_temp were to be zero, an error would be produced before any threads reach this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that is a good point. I also think it is unlikely to get into divide by zero error here.
|
Looks great! I just left some minor comments. |
mingxuanwupnnl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@odiazib Thank you for porting this subroutine. It looks good to me. I don't have other comments.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #353 +/- ##
==========================================
- Coverage 96.16% 96.14% -0.02%
==========================================
Files 43 44 +1
Lines 9490 9526 +36
==========================================
+ Hits 9126 9159 +33
- Misses 364 367 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
We've ported the set_hcoeff_vector routine.
This routine utilizes dheff (the effective Henry's Law coefficient), defined here.
Originally, dheff includes definitions for 192 species. In our ported version, we have customized this table to include only 3 gas species currently used in our base case simulation:
H2O2,H2SO4, andSO2.