-
Notifications
You must be signed in to change notification settings - Fork 55
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
Update check_flux_state_consistency() computation #2525
base: master
Are you sure you want to change the base?
Update check_flux_state_consistency() computation #2525
Conversation
tagging here previous discussions #2418 . |
@@ -239,7 +240,6 @@ void SHOCMacrophysics::initialize_impl (const RunType run_type) | |||
const auto& pseudo_density = get_field_in("pseudo_density").get_view<const Spack**>(); | |||
const auto& omega = get_field_in("omega").get_view<const Spack**>(); | |||
const auto& surf_sens_flux = get_field_in("surf_sens_flux").get_view<const Real*>(); | |||
const auto& surf_evap = get_field_in("surf_evap").get_view<const Real*>(); |
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.
needs to be grabbed back
@@ -376,7 +377,7 @@ void SHOCMacrophysics::initialize_impl (const RunType run_type) | |||
const auto& water_flux = get_field_out("water_flux").get_view<Real*>(); | |||
const auto& ice_flux = get_field_out("ice_flux").get_view<Real*>(); | |||
const auto& heat_flux = get_field_out("heat_flux").get_view<Real*>(); | |||
shoc_postprocess.set_mass_and_energy_fluxes (surf_evap, surf_sens_flux, | |||
shoc_postprocess.set_mass_and_energy_fluxes (surf_evap_input, surf_sens_flux, |
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.
use original surf_evap here.
@@ -499,17 +506,16 @@ void SHOCMacrophysics::check_flux_state_consistency(const double dt) | |||
{ | |||
using PC = scream::physics::Constants<Real>; | |||
const Real gravit = PC::gravit; | |||
const Real qmin = 1e-12; // minimum permitted constituent concentration (kg/kg) |
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.
@bogensch @AaronDonahue @PeterCaldwell this lower bound was taken from EAM setup (iirc EAM won't run if this bount is set to 0.0). Do we need a certain nontrivial bound in scream or can we always assume lower acceptable bounds for tracers are zero. In this case it is only for vapor. If a certain bound is needed, Conrad will put it in physics constants.
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.
maybe it is a question for @brhillman instead, since in EAM the comment mentions radiation
real(r8),intent(in) :: qminc ! minimum value of mass mixing ratio (kg/kg)
! normally 0., except water 1.E-12, for radiation.
const auto adjust = cc*qv_i(k)*pseudo_density_i(k)/mm; | ||
qv_i(k) = (qv_i(k)*pseudo_density_i(k) - adjust)/pseudo_density_i(k); | ||
const auto excess_mass = surf_evap_mass + column_vapor_mass(last_pack_idx)[last_pack_entry]; | ||
if (excess_mass < 0) { |
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.
qmin?
// reciprocal of pseudo_density at the bottom layer | ||
const auto rpdel = 1.0/pseudo_density_i(last_pack_idx)[last_pack_entry]; | ||
// Define lambda to calculate column vapor mass | ||
auto column_vapor_mass = [&](const int k) { |
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.
add function in the mname then?
"than mass of surf_evap.\n"); | ||
|
||
// Redistribute excess mass | ||
Kokkos::parallel_for(Kokkos::TeamVectorRange(team, nlev_m_1_packs), [&](const int& k) { |
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.
excess mass needs to be used here
@tcclevenger here is the code i ran in EAM (in place of qneg4 call in physpkg line 1767)
|
i forgot about mass_borrower for the runs above, will repeat them. |
@oksanaguba and @tcclevenger , what is the status of this PR? Is it still WIP? |
@AaronDonahue For now still WIP, I need to implement Oksana's suggestions. I'll try and get to that this week. |
Status Flag 'Pre-Test Inspection' - Auto Inspected - Inspection is Not Necessary for this Pull Request. |
Status Flag 'Pull Request AutoTester' - Failure: Timed out waiting for job SCREAM_PullRequest_Autotester_Mappy to start: Total Wait = 1803
|
Status Flag 'Pull Request AutoTester' - Failure: Timed out waiting for job SCREAM_PullRequest_Autotester_Weaver to start: Total Wait = 1803
|
@oksanaguba Could you take a look at this again and maybe test? I updated the computation based on your code. |
@tcclevenger thanks, i cannot do it immediately, maybe in 1-2 weeks. |
@tcclevenger , is there any reason to keep this PR open? If so, can it be revived and updated w/ the latest master? |
@oksanaguba Is there any reason to keep this open? Can't remember if we were going a different direction. |
@AaronDonahue i haven't looked at this for a while. i remember that it required nontrivial changes, because we want to use limiter on cflx each macmic iteration, not just once before macmic loop. i will try to talk to Conrad soon to figure this out. |
7114e81
to
579850c
Compare
6318f41
to
db5b35d
Compare
@oksana I update the computation as we talked about.
Notes/Questions:
1e-10
, and both simulations had energy errors around1e-8
, no difference between with or without checks.dt
). It would be easy to propagate this information, but where are you suggesting we use it?surf_evap_intput
in the mass and energy checks for shoc, or the originalsurf_evap
?