-
Notifications
You must be signed in to change notification settings - Fork 383
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
EAMxx: add p3 process rates as outputs #6938
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,9 @@ void P3Microphysics::set_grids(const std::shared_ptr<const GridsManager> grids_m | |
m_num_cols = m_grid->get_num_local_dofs(); // Number of columns on this rank | ||
m_num_levs = m_grid->get_num_vertical_levels(); // Number of levels per column | ||
|
||
// Gather runtime options from file | ||
runtime_options.load_runtime_options_from_file(m_params); | ||
|
||
// --Infrastructure | ||
// dt is passed as an argument to run_impl | ||
infrastructure.it = 0; | ||
|
@@ -108,6 +111,24 @@ void P3Microphysics::set_grids(const std::shared_ptr<const GridsManager> grids_m | |
add_field<Computed>("micro_vap_liq_exchange", scalar3d_layout_mid, kg/kg, grid_name, ps); | ||
add_field<Computed>("micro_vap_ice_exchange", scalar3d_layout_mid, kg/kg, grid_name, ps); | ||
add_field<Computed>("rainfrac", scalar3d_layout_mid, nondim, grid_name, ps); | ||
// P3 process rate diagnostics, use convention P3_<process_rate> | ||
if (runtime_options.p3_extra_diags){ | ||
add_field<Computed>("P3_qr2qv_evap", scalar3d_layout_mid, kg/kg/s, grid_name, ps); | ||
add_field<Computed>("P3_qi2qv_sublim", scalar3d_layout_mid, kg/kg/s, grid_name, ps); | ||
add_field<Computed>("P3_qc2qr_accret", scalar3d_layout_mid, kg/kg/s, grid_name, ps); | ||
add_field<Computed>("P3_qc2qr_autoconv", scalar3d_layout_mid, kg/kg/s, grid_name, ps); | ||
add_field<Computed>("P3_qv2qi_vapdep", scalar3d_layout_mid, kg/kg/s, grid_name, ps); | ||
add_field<Computed>("P3_qc2qi_berg", scalar3d_layout_mid, kg/kg/s, grid_name, ps); | ||
add_field<Computed>("P3_qc2qr_ice_shed", scalar3d_layout_mid, kg/kg/s, grid_name, ps); | ||
add_field<Computed>("P3_qc2qi_collect", scalar3d_layout_mid, kg/kg/s, grid_name, ps); | ||
add_field<Computed>("P3_qr2qi_collect", scalar3d_layout_mid, kg/kg/s, grid_name, ps); | ||
add_field<Computed>("P3_qc2qi_hetero_freeze", scalar3d_layout_mid, kg/kg/s, grid_name, ps); | ||
add_field<Computed>("P3_qr2qi_immers_freeze", scalar3d_layout_mid, kg/kg/s, grid_name, ps); | ||
add_field<Computed>("P3_qi2qr_melt", scalar3d_layout_mid, kg/kg/s, grid_name, ps); | ||
add_field<Computed>("P3_qr_sed", scalar3d_layout_mid, kg/kg/s, grid_name, ps); | ||
add_field<Computed>("P3_qc_sed", scalar3d_layout_mid, kg/kg/s, grid_name, ps); | ||
add_field<Computed>("P3_qi_sed", scalar3d_layout_mid, kg/kg/s, grid_name, ps); | ||
} | ||
|
||
// Boundary flux fields for energy and mass conservation checks | ||
if (has_column_conservation_check()) { | ||
|
@@ -217,8 +238,6 @@ void P3Microphysics::init_buffers(const ATMBufferManager &buffer_manager) | |
// ========================================================================================= | ||
void P3Microphysics::initialize_impl (const RunType /* run_type */) | ||
{ | ||
// Gather runtime options from file | ||
runtime_options.load_runtime_options_from_file(m_params); | ||
|
||
// Set property checks for fields in this process | ||
add_invariant_check<FieldWithinIntervalCheck>(get_field_out("T_mid"),m_grid,100.0,500.0,false); | ||
|
@@ -332,6 +351,45 @@ void P3Microphysics::initialize_impl (const RunType /* run_type */) | |
history_only.liq_ice_exchange = get_field_out("micro_liq_ice_exchange").get_view<Pack**>(); | ||
history_only.vap_liq_exchange = get_field_out("micro_vap_liq_exchange").get_view<Pack**>(); | ||
history_only.vap_ice_exchange = get_field_out("micro_vap_ice_exchange").get_view<Pack**>(); | ||
if(runtime_options.p3_extra_diags) { | ||
// if we are doing extra diagnostics, assign the fields to the history only struct | ||
history_only.P3_qr2qv_evap = get_field_out("P3_qr2qv_evap").get_view<Pack**>(); | ||
history_only.P3_qi2qv_sublim = get_field_out("P3_qi2qv_sublim").get_view<Pack**>(); | ||
history_only.P3_qc2qr_accret = get_field_out("P3_qc2qr_accret").get_view<Pack**>(); | ||
history_only.P3_qc2qr_autoconv = get_field_out("P3_qc2qr_autoconv").get_view<Pack**>(); | ||
history_only.P3_qv2qi_vapdep = get_field_out("P3_qv2qi_vapdep").get_view<Pack**>(); | ||
history_only.P3_qc2qi_berg = get_field_out("P3_qc2qi_berg").get_view<Pack**>(); | ||
history_only.P3_qc2qr_ice_shed = get_field_out("P3_qc2qr_ice_shed").get_view<Pack**>(); | ||
history_only.P3_qc2qi_collect = get_field_out("P3_qc2qi_collect").get_view<Pack**>(); | ||
history_only.P3_qr2qi_collect = get_field_out("P3_qr2qi_collect").get_view<Pack**>(); | ||
history_only.P3_qc2qi_hetero_freeze = get_field_out("P3_qc2qi_hetero_freeze").get_view<Pack**>(); | ||
history_only.P3_qr2qi_immers_freeze = get_field_out("P3_qr2qi_immers_freeze").get_view<Pack**>(); | ||
history_only.P3_qi2qr_melt = get_field_out("P3_qi2qr_melt").get_view<Pack**>(); | ||
history_only.P3_qr_sed = get_field_out("P3_qr_sed").get_view<Pack**>(); | ||
history_only.P3_qc_sed = get_field_out("P3_qc_sed").get_view<Pack**>(); | ||
history_only.P3_qi_sed = get_field_out("P3_qi_sed").get_view<Pack**>(); | ||
} else { | ||
// if not, let's just use the buffer for the unused? field | ||
// TODO: check if this is actually okay and doesn't have uintended consequences | ||
// if we are not outputing these fields, we really don't care about their values | ||
// but would this have side effects or memory issues? idk | ||
// TODO: maybe just use more buffer and assign stuff? | ||
history_only.P3_qr2qv_evap = m_buffer.unused; | ||
history_only.P3_qi2qv_sublim = m_buffer.unused; | ||
history_only.P3_qc2qr_accret = m_buffer.unused; | ||
Comment on lines
+372
to
+379
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this may be stupid as hell, so we might need to add more to the buffer or figure out an alternative |
||
history_only.P3_qc2qr_autoconv = m_buffer.unused; | ||
history_only.P3_qv2qi_vapdep = m_buffer.unused; | ||
history_only.P3_qc2qi_berg = m_buffer.unused; | ||
history_only.P3_qc2qr_ice_shed = m_buffer.unused; | ||
history_only.P3_qc2qi_collect = m_buffer.unused; | ||
history_only.P3_qr2qi_collect = m_buffer.unused; | ||
history_only.P3_qc2qi_hetero_freeze = m_buffer.unused; | ||
history_only.P3_qr2qi_immers_freeze = m_buffer.unused; | ||
history_only.P3_qi2qr_melt = m_buffer.unused; | ||
history_only.P3_qr_sed = m_buffer.unused; | ||
history_only.P3_qc_sed = m_buffer.unused; | ||
history_only.P3_qi_sed = m_buffer.unused; | ||
} | ||
#ifdef SCREAM_P3_SMALL_KERNELS | ||
// Temporaries | ||
temporaries.mu_r = m_buffer.mu_r; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@bartgol is this enough for documentation or would you like something else addressed?
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.
Since you are offering... I suppose you could be more verbose. Here, the description seems just a spell out of the short code name. Maybe something like "Enable calculation of additional diagnostic output from P3"?
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.
Ah, sorry, I misunderstood your comment. Well, the larger issue is the convoluted code, but if you and Jim are happy with how I did it, it is time to merge it and let the p3 warriors (not me) do their testing
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.
Let's just merge then. I am marking this as resolved. I think the "P3 diagnostics" will be something only select few will be using.
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.
Well, we have to fix a few fails first.
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.
Ooops!
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.
☠️
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.
When I ran the basic p3_tests and p3_sk_tests, they passed fine on pm-gpu (sp and dbg). I obviously didn't try the p3_tests_omp1 etc.