Skip to content

Commit

Permalink
Minor tweak.
Browse files Browse the repository at this point in the history
  • Loading branch information
phlndrwd committed Jan 26, 2024
1 parent f4d6f5c commit a2f2a0a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/monio/AtlasWriter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -402,15 +402,15 @@ void monio::AtlasWriter::addVariableDimensions(const atlas::Field& field,
std::shared_ptr<monio::Variable> var,
const std::string& vertConfigName) {
std::vector<atlas::idx_t> fieldShape = field.shape();
if (field.metadata().get<bool>("global") == false) {
fieldShape[0] = utilsatlas::getHorizontalSize(field); // If so, get the 2D size of the Field
if (field.metadata().get<bool>("global") == false) { // If so, get the 2D size of the Field
fieldShape[consts::eHorizontal] = utilsatlas::getHorizontalSize(field);
}
// Reversal of dims required for LFRic files. Currently applied to all output files.
std::reverse(fieldShape.begin(), fieldShape.end());
for (auto& dimSize : fieldShape) {
std::string dimName;
if (vertConfigName != "" && metadata.isDimDefined(vertConfigName) &&
dimSize == metadata.getDimension(vertConfigName)) {
dimSize == metadata.getDimension(vertConfigName)) {
dimName = vertConfigName;
} else {
dimName = metadata.getDimensionName(dimSize);
Expand All @@ -425,7 +425,7 @@ void monio::AtlasWriter::addGlobalAttributes(Metadata& metadata, const bool isLf
// Initialise variables
std::string variableConvention =
isLfricConvention == true ? consts::kNamingConventions[consts::eLfricConvention] :
consts::kNamingConventions[consts::eJediConvention];
consts::kNamingConventions[consts::eJediConvention];
// Create attribute objects
std::shared_ptr<monio::AttributeString> namingAttr =
std::make_shared<AttributeString>(std::string(consts::kVariableConventionName),
Expand Down

0 comments on commit a2f2a0a

Please sign in to comment.