Skip to content

Commit 8b2b2a1

Browse files
committed
EAMxx: Initialize VerticalRemapperMAM4::m_vremap_type in the constructor.
1 parent f5fefe9 commit 8b2b2a1

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

components/eamxx/src/physics/mam/readfiles/vertical_remapper_mam4.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@ namespace scream
1616
{
1717
VerticalRemapperMAM4::
1818
VerticalRemapperMAM4 (const grid_ptr_type& src_grid,
19-
const grid_ptr_type& tgt_grid)
19+
const grid_ptr_type& tgt_grid,
20+
const VertRemapType& vremp_type)
2021
{
2122
// We only go in one direction for simplicity, since we need to setup some
2223
// infrsatructures, and we don't want to setup 2x as many "just in case".
2324
// If you need to remap bwd, just create another remapper with src/tgt grids swapped.
2425
m_bwd_allowed = false;
2526

27+
m_vremap_type=vremp_type;
28+
2629
EKAT_REQUIRE_MSG (src_grid->get_2d_scalar_layout().congruent(tgt_grid->get_2d_scalar_layout()),
2730
"Error! Source and target grid can only differ for their number of level.\n");
2831

@@ -49,11 +52,6 @@ set_target_pressure (const Field& p)
4952
{
5053
m_tgt_pmid=p;
5154
}
52-
void VerticalRemapperMAM4::
53-
set_vremap_type(const VertRemapType& vremp_type)
54-
{
55-
m_vremap_type=vremp_type;
56-
}
5755

5856
void VerticalRemapperMAM4::
5957
apply_vertical_interpolation(const Field& f_src, const Field& f_tgt,

components/eamxx/src/physics/mam/readfiles/vertical_remapper_mam4.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ class VerticalRemapperMAM4 : public AbstractRemapper
2222
};
2323

2424
VerticalRemapperMAM4 (const grid_ptr_type& src_grid,
25-
const grid_ptr_type& tgt_grid);
25+
const grid_ptr_type& tgt_grid,
26+
const VertRemapType& vremp_type);
2627

2728
~VerticalRemapperMAM4 () = default;
2829

2930
void set_source_pressure (const Field& p);
3031
void set_target_pressure (const Field& p);
31-
void set_vremap_type (const VertRemapType& vremp_type);
3232

3333
protected:
3434

components/eamxx/src/share/util/eamxx_data_interpolation.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -499,10 +499,11 @@ setup_vert_remapper (const RemapData& data)
499499
p_data_reader.read_variables();
500500
}
501501
if (m_vr_type==MAM4_PSRef) {
502-
auto vremap = std::make_shared<VerticalRemapperMAM4>(m_grid_after_hremap, m_model_grid);
502+
auto vremap = std::make_shared<VerticalRemapperMAM4>(m_grid_after_hremap, m_model_grid,
503+
VerticalRemapperMAM4::VertRemapType::MAM4_PSRef);
503504
vremap->set_source_pressure (m_helper_pressure_fields["p_data"]);
504505
vremap->set_target_pressure(data.pmid);
505-
vremap->set_vremap_type(VerticalRemapperMAM4::VertRemapType::MAM4_PSRef);
506+
// vremap->set_vremap_type(VerticalRemapperMAM4::VertRemapType::MAM4_PSRef);
506507
m_vert_remapper = vremap;
507508
return;
508509
}
@@ -513,8 +514,9 @@ setup_vert_remapper (const RemapData& data)
513514
auto levs_field = m_grid_after_hremap->create_geometry_data("lev",layout,mbar);
514515
AtmosphereInput p_data_reader (m_time_database.files.front(),m_grid_after_hremap,{levs_field},true);
515516
p_data_reader.read_variables();
516-
auto vremap = std::make_shared<VerticalRemapperMAM4>(m_grid_after_hremap, m_model_grid);
517-
vremap->set_vremap_type (VerticalRemapperMAM4::VertRemapType::MAM4_ZONAL);
517+
auto vremap = std::make_shared<VerticalRemapperMAM4>(m_grid_after_hremap, m_model_grid,
518+
VerticalRemapperMAM4::VertRemapType::MAM4_ZONAL);
519+
// vremap->set_vremap_type (VerticalRemapperMAM4::VertRemapType::MAM4_ZONAL);
518520
vremap->set_source_pressure (levs_field);
519521
vremap->set_target_pressure(data.pmid);
520522
m_vert_remapper = vremap;

0 commit comments

Comments
 (0)