-
Notifications
You must be signed in to change notification settings - Fork 54
Adds Interface and Validation Testing for MAM4xx Online Emissions #3083
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
Merged
Merged
Changes from 40 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
9673d6b
emissions interface--running and calling mam4xx. next diagnose error
mjschmidt271 c3f2ebf
cleanup to fix warnings and change path to emissions input files
mjschmidt271 749f207
got online emis. interface working
mjschmidt271 484d2c1
online emissions interface appears to be working
mjschmidt271 829c560
bump mam4xx submodule, add comments to srf_online_emis_interface
mjschmidt271 b2dbb85
update mam4xx to main
mjschmidt271 24d3e11
comment out error-inducing code in mam4_amicphys.cpp and small reorg …
mjschmidt271 405ce81
Adds sst variable from the ocean model in EAMxx via coupler
singhbalwinder e38b45b
Adds dstfluxes (4 values per col) from coupler to eamxx
singhbalwinder 13f6cfc
Adds all input variables for online emissions into the interface cpp
singhbalwinder 52afd72
Commits changes in submodule MAM4xx
singhbalwinder 16a1217
EAMxx:Adds soil erodibility file read and sent to online emission read
singhbalwinder 52f32c0
Changes needed to start validatioon with EAM
singhbalwinder dd258df
EAMxx: dust emissions matches EAMvs grdi cell
singhbalwinder 9e0ad96
EAMxx:calculate_seasalt_numflux_in_bins validated
singhbalwinder a7d47e9
EAMxx: marine_organic_emis validated with hardwired file read mom
singhbalwinder 0594667
EAMxx: Partial implementation of marine orgaics file read
singhbalwinder 2f0d6c8
EAMxx:Reading and interpolation of mariane organic file works, not te…
singhbalwinder 82e843b
EAMxx: Connects marine organics emiss with MAM4xx codes
singhbalwinder 5d8341f
EAMxx:Fixes units for marine organic emissions
singhbalwinder c681f07
EAMxx: Adds logic to zero out constituent fluxes, cleanup
singhbalwinder a150d9d
EAMxx: Reverts input yaml and CMake, changes cons fluxes to updated
singhbalwinder f0a33da
EAMxx: Some fixes after rebase
singhbalwinder 80a57f0
EAMxx:Adds loop to update file read for marine organics, cleanup
singhbalwinder 15f44fd
fixup! EAMxx: Some fixes after rebase
mjschmidt271 bdd475f
EAMxx:Fixes file path and specify vector components for dust flux
singhbalwinder 4e120c7
EAMxx: MAM4xx submodule pointing to main that include GPU fixes
singhbalwinder 7b8f7fd
EAMxx: Some codes re-arranged after rebase
singhbalwinder 4195b41
EAMxx:Removes accidently added file
singhbalwinder e715b8b
update mam4xx submodule to fix gpu compilation error
mjschmidt271 cc63e5d
EAMxx: Fixes a gpu bug requiring a particular format for dstflx
singhbalwinder 40a6190
EAMxx: Clang format
singhbalwinder f3a29b1
EAMxx: Fixed some comments paths and other minor cleanup
singhbalwinder 8d4ca76
EAMxx: Moves online emiss and constituent init to a new function hpp …
singhbalwinder a20712c
fix cuda compile warnings
mjschmidt271 a40341e
EAMxx:Inits constituent fluxes to zero
singhbalwinder df4f13c
Revert "EAMxx: Clang format"
mjschmidt271 60a90e9
ff mam4xx to current main
mjschmidt271 c8c4d65
EAMxx: Remove all diffs from microphysics cpp file
singhbalwinder e02b76c
EAMxx: Adds missing namelist entries for multi process test
singhbalwinder 71e4bc5
EAMxx: Moves fences into the interface and remove extra comments
singhbalwinder 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 hidden or 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 hidden or 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 hidden or 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
76 changes: 76 additions & 0 deletions
76
components/eamxx/src/physics/mam/eamxx_mam_srf_and_online_emissions_functions.hpp
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#ifndef EAMXX_MAM_SRF_AND_ONLINE_EMISSIONS_FUNCTIONS_HPP | ||
#define EAMXX_MAM_SRF_AND_ONLINE_EMISSIONS_FUNCTIONS_HPP | ||
|
||
namespace scream { | ||
|
||
namespace { | ||
|
||
using KT = ekat::KokkosTypes<DefaultDevice>; | ||
using view_1d = typename KT::template view_1d<Real>; | ||
using view_2d = typename KT::template view_2d<Real>; | ||
using const_view_1d = typename KT::template view_1d<const Real>; | ||
using const_view_2d = typename KT::template view_2d<const Real>; | ||
|
||
//-------- Inititlize gas and aerosol fluxes ------ | ||
void init_fluxes(const int &ncol, | ||
singhbalwinder marked this conversation as resolved.
Show resolved
Hide resolved
|
||
view_2d &constituent_fluxes) { // input-output | ||
|
||
constexpr int pcnst = mam4::aero_model::pcnst; | ||
const int gas_start_ind = mam4::utils::gasses_start_ind(); | ||
|
||
const auto policy = | ||
ekat::ExeSpaceUtils<KT::ExeSpace>::get_default_team_policy( | ||
ncol, pcnst - gas_start_ind); | ||
|
||
// Parallel loop over all the columns | ||
Kokkos::parallel_for( | ||
policy, KOKKOS_LAMBDA(const KT::MemberType &team) { | ||
const int icol = team.league_rank(); | ||
view_1d flux_col = ekat::subview(constituent_fluxes, icol); | ||
|
||
// Zero out constituent fluxes only for gasses and aerosols | ||
Kokkos::parallel_for( | ||
Kokkos::TeamVectorRange(team, gas_start_ind, pcnst), | ||
[&](int icnst) { flux_col(icnst) = 0; }); | ||
}); | ||
Kokkos::fence(); | ||
} // init_fluxes ends | ||
|
||
//-------- compute online emissions for dust, sea salt and marine organics ----- | ||
void compute_online_dust_nacl_emiss( | ||
const int &ncol, const int &nlev, const const_view_1d &ocnfrac, | ||
const const_view_1d &sst, const const_view_2d &u_wind, | ||
const const_view_2d &v_wind, const const_view_2d &dstflx, | ||
const const_view_1d &mpoly, const const_view_1d &mprot, | ||
const const_view_1d &mlip, const const_view_1d &soil_erodibility, | ||
const const_view_2d &z_mid, | ||
// output | ||
view_2d &constituent_fluxes) { | ||
const int surf_lev = nlev - 1; // surface level | ||
|
||
Kokkos::parallel_for( | ||
"online_emis_fluxes", ncol, KOKKOS_LAMBDA(int icol) { | ||
// Input | ||
const const_view_1d dstflx_icol = ekat::subview(dstflx, icol); | ||
|
||
// Output | ||
view_1d fluxes_col = ekat::subview(constituent_fluxes, icol); | ||
|
||
// Compute online emissions | ||
// NOTE: mam4::aero_model_emissions calculates mass and number emission | ||
// fluxes in units of [kg/m2/s or #/m2/s] (MKS), so no need to convert | ||
mam4::aero_model_emissions::aero_model_emissions( | ||
sst(icol), ocnfrac(icol), u_wind(icol, surf_lev), | ||
v_wind(icol, surf_lev), z_mid(icol, surf_lev), dstflx_icol, | ||
soil_erodibility(icol), mpoly(icol), mprot(icol), mlip(icol), | ||
// out | ||
fluxes_col); | ||
}); | ||
Kokkos::fence(); | ||
singhbalwinder marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
} // compute_online_dust_nacl_emiss ends | ||
|
||
} // namespace | ||
} // namespace scream | ||
|
||
#endif // EAMXX_MAM_SRF_AND_ONLINE_EMISSIONS_FUNCTIONS_HPP |
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.
Uh oh!
There was an error while loading. Please reload this page.