-
Notifications
You must be signed in to change notification settings - Fork 434
EAMXX: Implement aqueous and gas state diagnostic output on request. #7459
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
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.
Thanks, James for putting this together with the MAM4xx codes. I left some comments to get feedback from other on the variabable names. We might need to add one master flag for diganostics as well.
components/eamxx/src/physics/mam/eamxx_mam_microphysics_process_interface.cpp
Outdated
Show resolved
Hide resolved
components/eamxx/src/physics/mam/eamxx_mam_microphysics_process_interface.cpp
Show resolved
Hide resolved
This PR should be BFB. Do we know why the tests are failing? |
Yes this merge request, #7459 , should be BFB but there is one unit test that fails on GPU only and I do not know why. I'm doing a GPU build now to track it down. |
components/eamxx/src/physics/mam/eamxx_mam_microphysics_process_interface.hpp
Show resolved
Hide resolved
I have tested it on Frontier, and it works for a short test. |
components/eamxx/src/physics/mam/eamxx_mam_microphysics_process_interface.cpp
Outdated
Show resolved
Hide resolved
components/eamxx/src/physics/mam/eamxx_mam_microphysics_process_interface.cpp
Outdated
Show resolved
Hide resolved
components/eamxx/src/physics/mam/eamxx_mam_microphysics_process_interface.cpp
Outdated
Show resolved
Hide resolved
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.
re names:
- mixing_ratio_tendency_due_to_gas_phase_chemistry
- mixing_ratio_tendency_due_to_aqueous_chemistry
Mixing ratio of what specifically? In the model, most mixing ratios are 3D resolved (i.e., they have col and lev dimensions). This doesn't seem to be like that, right? If so, you'd want to clearly indicate the reduction in the name so that it is clear they are somehow reduced (I assumed you vertically integrate it them in mam4xx, which is unwise and should be redone --- these should be exposed as 3D variables and eamxx utilities can take care of the reduction/integration).
Feel free to delete "due to" (it's implied)
@mahf708 Yes, the full mixing ratio diagnostic arrays are dimentioned by (number of columns) by (number of levels) by (number of gas and aerosol constituents). It is the full 3D variables so the eamxx utilities can take care of any reduction/integration over columns. (also removed "due_to" from name) |
a34380b
to
b7b4d4c
Compare
I am still not sure what these mixing ratios are... I assume they're not "qc", right? You will need a better description of what they are. Are they "aerosol" mixing ratios? |
@singhbalwinder @overfelt Is this ready to integrate? |
Not yet, I need to add a test for these diagnostics. I will let you know when this is ready to merge. |
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.
I suggest renaming the fields in add_field calls to something like (e.g., prefixing with "mam_microphysics")
- mam_microphysics_tendency_gas_phase_chemistry
- mam_microphysics_tendency_aqueous_chemistry
re
O3, H2O2, H2SO4, SO2, DMS,SOAG, so4_a1, pom_a1, soa_a1, bc_a1, dst_a1, ncl_a1, mom_a1, num_a1, so4_a2, soa_a2, ncl_a2, mom_a2, num_a2, dst_a3, ncl_a3, so4_a3,bc_a3, pom_a3, soa_a3, mom_a3, num_a3, pom_a4, bc_a4, mom_a4, num_a4
@singhbalwinder, is this how these were output in EAM days? As one big structure? Or were they output individually? Either way, I think it is unsustainable to have mam_tendency_gas_phase_chemistry output many (30+?) fields at once. What if someone just wants the DMS tendency? Also, some of these will be zero, right?
You can rework this to output them separately in two ways:
- you can do it here, by simply doing doing add_field("DMS_mam_tedency...", scalar3d, ...) and then assigning the specific index of the big vector3d you get back from the submodule; you will do the assignment in a kernel or you can use ekat subviewing utils (or subfielding utils if you end up making the big one a field, but that would be duplicating stuff)
- you can do it later by asking the diagnostics/analysis people to add something under src/diagnostics to parse out specific fields; components/eamxx/src/diagnostics/aodvis.cpp is a good example to follow for that
components/eamxx/src/physics/mam/eamxx_mam_microphysics_process_interface.cpp
Outdated
Show resolved
Hide resolved
@@ -61,6 +61,9 @@ class MAMMicrophysics final : public MAMGenericInterface { | |||
void finalize_impl(){/*Do nothing*/}; | |||
|
|||
private: | |||
// Output extra mam4xx diagnostics. | |||
bool extra_mam4_diags_ = false; |
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.
wanna expose this in the xml file or are you planning to do that later? Also, I would name it after the process (mam_microphysics or mam4_microphyiscs)
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.
I will add it along with the test.
@mahf708: Thanks for your suggestion. That is a very good point. These species are output as separate variables in EAM. We can do the same (or better) using the approach you suggested (using the src/diagnostics folder) to request the species that we need. We can do that in follow-up PRs. I have now added a test, renamed diagnostic variables, added the namelist flag, and guarded the older diagnostic variable also under the new flag. Is there anything else we need to do before merging? |
@@ -2119,102 +2119,6 @@ | |||
</environment_variables--> | |||
</machine> | |||
|
|||
<machine MACH="anlgce"> |
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.
@overfelt: Why was this machine entry removed?
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.
I think a rebase to master will fix the config_machines.xml
diff. This file was not changed in this PR and the diff shown is what was updated on master recently.
I am undoing this in this PR. We will add this in a follow-up PR (see #7469 ). |
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.
✅
All good, but be sure to do a clean rebase before merging. The rebase in here is not clean in the sense it is pulling in random commits that don't need to be included. |
459f2eb
to
143a2b5
Compare
This PR should be ready to merge once the ghci tests pass. I have rebased it and pointed the mam4xx submodule to its main branch. |
Thanks Balwinder, Kai and Naser.
333f078
to
a5ee2dd
Compare
The "mam4_microphysics_tendency_gas_phase_chemistry" and "mam4_microphysics_tendency_aqueous_chemistry" diagnostics are added. This PR also: - Adds a namelist flag to control diagnostic output (default: false) - Adds a REP CIME test where the namelist flag is turned to true [BFB]
The "mam4_microphysics_tendency_gas_phase_chemistry" and "mam4_microphysics_tendency_aqueous_chemistry" diagnostics are added.
This PR also:
. Adds a namelist flag to control diagnostic output (default: false)
. Adds a REP CIME test where the namelist flag is turned to true
[BFB]