Skip to content

Commit 07db3ac

Browse files
committed
EAMxx: fix some checks for io aliases
1 parent 9be4d16 commit 07db3ac

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

components/eamxx/src/share/io/scorpio_output.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,11 @@ process_requested_fields(const std::string& stream_name)
945945
"Error! Invalid alias request. Should be 'alias:=original'.\n"
946946
" - request: " + name + "\n");
947947
if (tokens.size()==2) {
948+
EKAT_REQUIRE_MSG (m_alias_to_orig.count(tokens[0])==0,
949+
"Error! The same alias has been used multiple times.\n"
950+
" - stream name: " + stream_name + "\n"
951+
" - first alias: " + tokens[0] + ":=" + m_alias_to_orig[tokens[0]] + "\n"
952+
" - second alias: " + tokens[0] + ":=" + tokens[1] + "\n");
948953
m_alias_to_orig[tokens[0]] = tokens[1];
949954
name = tokens[0];
950955
orig_fields.push_back(tokens[1]);
@@ -953,6 +958,11 @@ process_requested_fields(const std::string& stream_name)
953958
}
954959
}
955960

961+
EKAT_REQUIRE_MSG (not has_duplicates(m_fields_names),
962+
"Error! The list of requested output fields contains duplicates.\n"
963+
" - stream name: " + stream_name + "\n"
964+
" - fields names: " + ekat::join(m_fields_names,",") + "\n");
965+
956966
// Due to aliasing, we are not yet able to establish the diags eval order,
957967
// so just create them for now. Once we have all diags, we will resolve aliasing,
958968
// and be able to store diags in the correct order for evaluation

0 commit comments

Comments
 (0)