Skip to content

Commit c16977a

Browse files
committed
Use altName for dims
1 parent 94a05c4 commit c16977a

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

core/src/Xios.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ void Xios::setupDomains()
504504
// Set domain extents based on model metadata
505505
size_t counter = 0;
506506
for (ModelArray::Dimension dim : ModelArray::typeDimensions[type]) {
507-
const std::string domainName = ModelArray::definedDimensions[dim].name;
507+
const std::string dimName = ModelArray::definedDimensions[dim].altName;
508508
if (counter == 0) {
509509
int ni_glo;
510510
int ni;
@@ -523,8 +523,7 @@ void Xios::setupDomains()
523523
ibegin = CGDEGREE * metadata.getLocalCornerX();
524524
} else {
525525
throw std::runtime_error(
526-
"Xios: Could not set domain extents based on dimension '"
527-
+ ModelArray::definedDimensions.at(dim).name + "'");
526+
"Xios: Could not set domain extents based on dimension '" + dimName + "'");
528527
}
529528
cxios_set_domain_ni_glo(domain, ni_glo);
530529
if (!cxios_is_defined_domain_ni_glo(domain)) {
@@ -550,12 +549,12 @@ void Xios::setupDomains()
550549
throw std::runtime_error(
551550
"Xios: Failed to set local x-indices for domain '" + domainId + "'");
552551
}
553-
cxios_set_domain_dim_i_name(domain, domainName.c_str(), domainName.length());
552+
cxios_set_domain_dim_i_name(domain, dimName.c_str(), dimName.length());
554553
if (!cxios_is_defined_domain_dim_i_name(domain)) {
555554
throw std::runtime_error(
556555
"Xios: Failed to set x-coordinate name for domain '" + domainId + "'");
557556
}
558-
cxios_set_domain_lon_name(domain, domainName.c_str(), domainName.length());
557+
cxios_set_domain_lon_name(domain, dimName.c_str(), dimName.length());
559558
if (!cxios_is_defined_domain_lon_name(domain)) {
560559
throw std::runtime_error(
561560
"Xios: Failed to set longitude name for domain '" + domainId + "'");
@@ -578,8 +577,7 @@ void Xios::setupDomains()
578577
jbegin = CGDEGREE * metadata.getLocalCornerY();
579578
} else {
580579
throw std::runtime_error(
581-
"Xios: Could not set domain extents based on dimension '"
582-
+ ModelArray::definedDimensions.at(dim).name + "'");
580+
"Xios: Could not set domain extents based on dimension '" + dimName + "'");
583581
}
584582
cxios_set_domain_nj_glo(domain, nj_glo);
585583
if (!cxios_is_defined_domain_nj_glo(domain)) {
@@ -605,12 +603,12 @@ void Xios::setupDomains()
605603
throw std::runtime_error(
606604
"Xios: Failed to set local y-indices for domain '" + domainId + "'");
607605
}
608-
cxios_set_domain_dim_j_name(domain, domainName.c_str(), domainName.length());
606+
cxios_set_domain_dim_j_name(domain, dimName.c_str(), dimName.length());
609607
if (!cxios_is_defined_domain_dim_j_name(domain)) {
610608
throw std::runtime_error(
611609
"Xios: Failed to set y-coordinate name for domain '" + domainId + "'");
612610
}
613-
cxios_set_domain_lat_name(domain, domainName.c_str(), domainName.length());
611+
cxios_set_domain_lat_name(domain, dimName.c_str(), dimName.length());
614612
if (!cxios_is_defined_domain_lat_name(domain)) {
615613
throw std::runtime_error(
616614
"Xios: Failed to set latitude name for domain '" + domainId + "'");

0 commit comments

Comments
 (0)