Skip to content

Commit b7d91c1

Browse files
committed
EAMxx: default atm proc tendencies calculation to physics grid
Requires a bit more work to provide the ACTUAL name of the physics grid to the atm process
1 parent 7974d3d commit b7d91c1

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

components/eamxx/cime_config/testdefs/testmods_dirs/eamxx/prod/shell_commands

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ $atmchange -b physics::cosp::cosp_frequency=1
2525
$atmchange -b physics::mac_aero_mic::shoc::compute_tendencies=T_mid,qv
2626
$atmchange -b physics::mac_aero_mic::p3::compute_tendencies=T_mid,qv
2727
$atmchange -b physics::rrtmgp::compute_tendencies=T_mid
28-
$atmchange -b homme::compute_tendencies=T_mid,qv@physics_pg2,qc@physics_pg2
28+
$atmchange -b homme::compute_tendencies=T_mid,qv,qc
2929

3030
# Set temperature cut off in dycore threshold to 180K
3131
$atmchange -b vtheta_thresh=180

components/eamxx/src/control/atmosphere_driver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ void AtmosphereDriver::create_fields()
589589
}
590590

591591
// Make atm procs create the proc-level tendency fields (if requested)
592-
m_atm_process_group->setup_step_tendencies();
592+
m_atm_process_group->setup_step_tendencies(m_grids_manager->get_grid("physics")->name());
593593

594594
// Now that all processes have all the required/computed fields/groups, they
595595
// have also created any possible internal field (if needed). Notice that some

components/eamxx/src/share/atm_process/atmosphere_process.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ void AtmosphereProcess::finalize () {
235235
#endif
236236
}
237237

238-
void AtmosphereProcess::setup_step_tendencies () {
238+
void AtmosphereProcess::setup_step_tendencies (const std::string& default_grid) {
239239
using strvec_t = std::vector<std::string>;
240240
auto tend_vec = m_params.get<strvec_t>("compute_tendencies",{});
241241
if (tend_vec.size()==0) {
@@ -253,7 +253,7 @@ void AtmosphereProcess::setup_step_tendencies () {
253253
EKAT_REQUIRE_MSG (tokens.size()==1 || tokens.size()==2,
254254
"Error! Invalid format for tendency calculation request: " + tn + "\n"
255255
" To request tendencies for F, use 'F' or 'F@grid_name' format.\n");
256-
return std::make_pair(tokens[0],tokens.size()==2 ? tokens[1] : "UNSET");
256+
return std::make_pair(tokens[0],tokens.size()==2 ? tokens[1] : default_grid);
257257
};
258258

259259

@@ -262,7 +262,7 @@ void AtmosphereProcess::setup_step_tendencies () {
262262
auto fn = tokens.first;
263263
auto gn = tokens.second;
264264

265-
auto f = gn=="UNSET" ? get_field_out(fn) : get_field_out(fn,gn);
265+
auto f = get_field_out(fn,gn);
266266

267267
const auto& tname = this->name() + "_" + fn + "_tend";
268268

components/eamxx/src/share/atm_process/atmosphere_process.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class AtmosphereProcess : public std::enable_shared_from_this<AtmosphereProcess>
128128
// This method prepares the atm proc for computing the tendency of
129129
// output fields, as prescribed via parameter list
130130
// NOTE: virtual, as AtmProcGroup will override and just call it on stored procs
131-
virtual void setup_step_tendencies ();
131+
virtual void setup_step_tendencies (const std::string& default_grid);
132132

133133
// Note: if we are being subcycled from the outside, the host will set
134134
// do_update=false, and we will not update the timestamp of the AP

components/eamxx/src/share/atm_process/atmosphere_process_group.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,12 @@ void AtmosphereProcessGroup::set_grids (const std::shared_ptr<const GridsManager
176176
m_grids_mgr = grids_manager;
177177
}
178178

179-
void AtmosphereProcessGroup::setup_step_tendencies () {
179+
void AtmosphereProcessGroup::
180+
setup_step_tendencies (const std::string& default_grid) {
180181
for (const auto& atm_proc : m_atm_processes) {
181-
atm_proc->setup_step_tendencies();
182+
atm_proc->setup_step_tendencies(default_grid);
182183
}
183-
AtmosphereProcess::setup_step_tendencies();
184+
AtmosphereProcess::setup_step_tendencies(default_grid);
184185
}
185186

186187
void AtmosphereProcessGroup::

components/eamxx/src/share/atm_process/atmosphere_process_group.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class AtmosphereProcessGroup : public AtmosphereProcess
4646
void set_grids (const std::shared_ptr<const GridsManager> grids_manager);
4747

4848
// Setup the tendencies requests for this group, as well as for all procs in the group
49-
void setup_step_tendencies ();
49+
void setup_step_tendencies (const std::string& default_grid);
5050

5151
// --- Methods specific to AtmosphereProcessGroup --- //
5252
int get_num_processes () const { return m_atm_processes.size(); }

0 commit comments

Comments
 (0)