Skip to content

Commit

Permalink
EAMxx: fix several compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bartgol committed Dec 12, 2024
1 parent 1ad10ca commit 058631e
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 0 deletions.
20 changes: 20 additions & 0 deletions components/eamxx/src/share/atm_process/atmosphere_process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,8 @@ get_field_in_impl(const std::string& field_name, const std::string& grid_name) c
" field name: " + field_name + "\n"
" grid name: " + grid_name + "\n");
}
static Field f;
return f;
}

Field& AtmosphereProcess::
Expand All @@ -917,6 +919,8 @@ get_field_in_impl(const std::string& field_name) const {
" atm proc name: " + this->name() + "\n"
" field name: " + field_name + "\n");
}
static Field f;
return f;
}

Field& AtmosphereProcess::
Expand All @@ -932,6 +936,8 @@ get_field_out_impl(const std::string& field_name, const std::string& grid_name)
" field name: " + field_name + "\n"
" grid name: " + grid_name + "\n");
}
static Field f;
return f;
}

Field& AtmosphereProcess::
Expand All @@ -953,6 +959,8 @@ get_field_out_impl(const std::string& field_name) const {
" atm proc name: " + this->name() + "\n"
" field name: " + field_name + "\n");
}
static Field f;
return f;
}

FieldGroup& AtmosphereProcess::
Expand All @@ -968,6 +976,8 @@ get_group_in_impl(const std::string& group_name, const std::string& grid_name) c
" group name: " + group_name + "\n"
" grid name: " + grid_name + "\n");
}
static FieldGroup g("");
return g;
}

FieldGroup& AtmosphereProcess::
Expand All @@ -989,6 +999,8 @@ get_group_in_impl(const std::string& group_name) const {
" atm proc name: " + this->name() + "\n"
" group name: " + group_name + "\n");
}
static FieldGroup g("");
return g;
}

FieldGroup& AtmosphereProcess::
Expand All @@ -1004,6 +1016,8 @@ get_group_out_impl(const std::string& group_name, const std::string& grid_name)
" group name: " + group_name + "\n"
" grid name: " + grid_name + "\n");
}
static FieldGroup g("");
return g;
}

FieldGroup& AtmosphereProcess::
Expand All @@ -1025,6 +1039,8 @@ get_group_out_impl(const std::string& group_name) const {
" atm proc name: " + this->name() + "\n"
" group name: " + group_name + "\n");
}
static FieldGroup g("");
return g;
}

Field& AtmosphereProcess::
Expand All @@ -1040,6 +1056,8 @@ get_internal_field_impl(const std::string& field_name, const std::string& grid_n
" field name: " + field_name + "\n"
" grid name: " + grid_name + "\n");
}
static Field f;
return f;
}

Field& AtmosphereProcess::
Expand All @@ -1061,6 +1079,8 @@ get_internal_field_impl(const std::string& field_name) const {
" atm proc name: " + this->name() + "\n"
" field name: " + field_name + "\n");
}
static Field f;
return f;
}

void AtmosphereProcess
Expand Down
1 change: 1 addition & 0 deletions components/eamxx/src/share/field/field.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ class Field {
get_subview_1 (const get_view_type<data_nd_t<T,N>,HD>&, const int) const {
EKAT_ERROR_MSG ("Error! Cannot subview a rank2 view along the second "
"dimension without losing LayoutRight.\n");
return get_view_type<data_nd_t<T,N-1>,HD>();
}

template<HostOrDevice HD,typename T,int N>
Expand Down
1 change: 1 addition & 0 deletions components/eamxx/src/share/field/field_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,7 @@ auto Field::get_ND_view () const
"MaxRank = 6.\n"
"This should never be called at run time.\n"
"Please contact developer if this functionality is required\n");
return get_view_type<data_nd_t<T,N>,HD>();
}

} // namespace scream
Expand Down
1 change: 1 addition & 0 deletions components/eamxx/src/share/grid/library_grids_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class LibraryGridsManager : public GridsManager
"Error! LibraryGridsManager is not capable of creating remappers.\n"
" - from_grid: " + from_grid->name() + "\n"
" - to_grid: " + to_grid->name() + "\n");
return nullptr;
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ create_src_layout (const FieldLayout& tgt_layout) const
// we cannot infer what the corresponding src layout was.
// This function should never be used for this remapper.
EKAT_ERROR_MSG ("Error! VerticalRemapper does not support creating a src layout from a tgt layout.\n");
return FieldLayout();
}

FieldLayout VerticalRemapper::
Expand Down
2 changes: 2 additions & 0 deletions components/eamxx/src/share/io/scorpio_output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,8 @@ get_field(const std::string& name, const std::string& mode) const
} else {
EKAT_ERROR_MSG ("ERROR::AtmosphereOutput::get_field Field " + name + " not found in " + mode + " field manager or diagnostics list.");
}
static Field f;
return f;
}
/* ---------------------------------------------------------- */
void AtmosphereOutput::set_diagnostics()
Expand Down
1 change: 1 addition & 0 deletions components/eamxx/src/share/io/scream_io_file_specs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ struct StorageSpecs {
default:
EKAT_ERROR_MSG ("Error! Unrecognized/unsupported file storage type.\n");
}
return false;
}

void update_storage (const util::TimeStamp& t) {
Expand Down
1 change: 1 addition & 0 deletions components/eamxx/src/share/io/scream_scorpio_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ int nctype (const std::string& type) {
} else {
EKAT_ERROR_MSG ("Error! Unrecognized/unsupported data type '" + type + "'.\n");
}
return -1;
}

template<typename T>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ PropertyCheck::ResultAndMsg FieldNaNCheck::check() const {
"Internal error in FieldNaNCheck: unsupported field data type.\n"
"You should not have reached this line. Please, contact developers.\n");
}
return ResultAndMsg{};
}

} // namespace scream
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ PropertyCheck::ResultAndMsg FieldWithinIntervalCheck::check() const {
"Internal error in FieldWithinIntervalCheck: unsupported field data type.\n"
"You should not have reached this line. Please, contact developers.\n");
}
return ResultAndMsg{};
}

template<typename ST>
Expand Down
2 changes: 2 additions & 0 deletions components/eamxx/src/share/util/scream_data_type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ inline std::string e2str (const DataType data_type) {
default:
EKAT_ERROR_MSG("Error! Unsupported DataType value.\n");
}
return "";
}

inline int get_type_size (const DataType data_type) {
Expand All @@ -62,6 +63,7 @@ inline int get_type_size (const DataType data_type) {
default:
EKAT_ERROR_MSG("Error! Unsupported DataType value.\n");
}
return -1;
}

} // namespace scream
Expand Down

0 comments on commit 058631e

Please sign in to comment.