-
Notifications
You must be signed in to change notification settings - Fork 6
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
Water uptake final. #222
Merged
Merged
Water uptake final. #222
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c903ced
Adding water_uptake driver.
pressel 55f0168
Overloading modal_aero_water_uptake_dr.
pressel f0955ea
Initial validation.
pressel faffd00
Adding validation data.
pressel eaef136
clang-format
pressel 7e6e629
Adding validation for dr_wetdens.
pressel d3945a7
Fixing validation test.
pressel 1ae26b5
updating validation data
pressel bd4ee13
renaming
pressel 885f96c
More renaming.
pressel db41371
Adding validation data.
pressel 071caee
Updating validation data.
pressel 6258317
Merge branch 'main' into kylepres/water_uptake_final
pressel d653e71
Merge branch 'main' into kylepres/water_uptake_final
pressel 0c1f380
Responding to comments on PR.
pressel 703f39a
Updating valdiation data submodule.
pressel 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
Submodule mam_x_validation
updated
5 files
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
54 changes: 54 additions & 0 deletions
54
src/validation/water_uptake/modal_aero_water_uptake_dr.cpp
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// mam4xx: Copyright (c) 2022, | ||
// Battelle Memorial Institute and | ||
// National Technology & Engineering Solutions of Sandia, LLC (NTESS) | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
|
||
#include <iostream> | ||
#include <mam4xx/aero_modes.hpp> | ||
#include <mam4xx/mam4.hpp> | ||
#include <mam4xx/water_uptake.hpp> | ||
#include <skywalker.hpp> | ||
#include <validation.hpp> | ||
|
||
using namespace skywalker; | ||
using namespace mam4; | ||
using namespace haero; | ||
|
||
void modal_aero_water_uptake_dr(Ensemble *ensemble) { | ||
|
||
// Run the ensemble. | ||
ensemble->process([=](const Input &input, Output &output) { | ||
EKAT_REQUIRE_MSG(input.has_array("state_q"), "Required name: state_q"); | ||
EKAT_REQUIRE_MSG(input.has_array("temperature"), | ||
"Required name: temperature"); | ||
EKAT_REQUIRE_MSG(input.has_array("pmid"), "Required name: pmid"); | ||
EKAT_REQUIRE_MSG(input.has_array("cldn"), "Required name: cldn"); | ||
EKAT_REQUIRE_MSG(input.has_array("dgncur_a"), "Required name: dgncur_a"); | ||
EKAT_REQUIRE_MSG(input.has_array("dgncur_awet"), | ||
"Required name: dgncur_awet"); | ||
EKAT_REQUIRE_MSG(input.has_array("qaerwat"), "Required name: qaerwat"); | ||
|
||
auto temperature = input.get_array("temperature")[0]; | ||
auto pmid = input.get_array("pmid")[0]; | ||
auto cldn = input.get_array("cldn")[0]; | ||
auto state_q = input.get_array("state_q"); | ||
auto dgncur_a = input.get_array("dgncur_a"); | ||
auto dgncur_awet = input.get_array("dgncur_awet"); | ||
auto qaerwat = input.get_array("qaerwat"); | ||
|
||
int nspec_amode[AeroConfig::num_modes()]; | ||
int lspectype_amode[water_uptake::maxd_aspectype][AeroConfig::num_modes()]; | ||
Real specdens_amode[water_uptake::maxd_aspectype]; | ||
Real spechygro[water_uptake::maxd_aspectype]; | ||
|
||
water_uptake::get_e3sm_parameters(nspec_amode, lspectype_amode, | ||
specdens_amode, spechygro); | ||
|
||
water_uptake::modal_aero_water_uptake_dr( | ||
nspec_amode, specdens_amode, spechygro, lspectype_amode, state_q.data(), | ||
temperature, pmid, cldn, dgncur_a.data(), dgncur_awet.data()); | ||
|
||
output.set("dgncur_awet", dgncur_awet); | ||
output.set("qaerwat", qaerwat); | ||
}); | ||
} |
57 changes: 57 additions & 0 deletions
57
src/validation/water_uptake/modal_aero_water_uptake_dr_wetdens.cpp
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// mam4xx: Copyright (c) 2022, | ||
// Battelle Memorial Institute and | ||
// National Technology & Engineering Solutions of Sandia, LLC (NTESS) | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
|
||
#include <iostream> | ||
#include <mam4xx/aero_modes.hpp> | ||
#include <mam4xx/mam4.hpp> | ||
#include <mam4xx/water_uptake.hpp> | ||
#include <skywalker.hpp> | ||
#include <validation.hpp> | ||
|
||
using namespace skywalker; | ||
using namespace mam4; | ||
using namespace haero; | ||
|
||
void modal_aero_water_uptake_dr_wetdens(Ensemble *ensemble) { | ||
|
||
// Run the ensemble. | ||
ensemble->process([=](const Input &input, Output &output) { | ||
EKAT_REQUIRE_MSG(input.has_array("state_q"), "Required name: state_q"); | ||
EKAT_REQUIRE_MSG(input.has_array("temperature"), | ||
"Required name: temperature"); | ||
EKAT_REQUIRE_MSG(input.has_array("pmid"), "Required name: pmid"); | ||
EKAT_REQUIRE_MSG(input.has_array("cldn"), "Required name: cldn"); | ||
EKAT_REQUIRE_MSG(input.has_array("dgncur_a"), "Required name: dgncur_a"); | ||
EKAT_REQUIRE_MSG(input.has_array("dgncur_awet"), | ||
"Required name: dgncur_awet"); | ||
EKAT_REQUIRE_MSG(input.has_array("qaerwat"), "Required name: qaerwat"); | ||
|
||
auto temperature = input.get_array("temperature")[0]; | ||
auto pmid = input.get_array("pmid")[0]; | ||
auto cldn = input.get_array("cldn")[0]; | ||
auto state_q = input.get_array("state_q"); | ||
auto dgncur_a = input.get_array("dgncur_a"); | ||
auto dgncur_awet = input.get_array("dgncur_awet"); | ||
auto qaerwat = input.get_array("qaerwat"); | ||
|
||
int nspec_amode[AeroConfig::num_modes()]; | ||
int lspectype_amode[water_uptake::maxd_aspectype][AeroConfig::num_modes()]; | ||
Real specdens_amode[water_uptake::maxd_aspectype]; | ||
Real spechygro[water_uptake::maxd_aspectype]; | ||
|
||
water_uptake::get_e3sm_parameters(nspec_amode, lspectype_amode, | ||
specdens_amode, spechygro); | ||
|
||
std::vector<Real> wetdens(AeroConfig::num_modes(), 0.0); | ||
water_uptake::modal_aero_water_uptake_dr( | ||
nspec_amode, specdens_amode, spechygro, lspectype_amode, state_q.data(), | ||
temperature, pmid, cldn, dgncur_a.data(), dgncur_awet.data(), | ||
wetdens.data()); | ||
|
||
output.set("dgncur_awet", dgncur_awet); | ||
output.set("qaerwat", qaerwat); | ||
output.set("wetdens", wetdens); | ||
}); | ||
} |
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
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.
Does this function corresponds to the subroutine
modal_aero_wateruptake_dr
from here.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.
It does. I've added comments to make this clear.