@@ -60,9 +60,9 @@ void monio::Monio::readState(atlas::FieldSet& localFieldSet,
60
60
atlas::Field globalField = utilsatlas::getGlobalField (localField);
61
61
if (mpiCommunicator_.rank () == mpiRankOwner_) {
62
62
auto & functionSpace = globalField.functionspace ();
63
- auto & grid = atlas::functionspace::NodeColumns (functionSpace). mesh (). grid ( );
63
+ auto grid = utilsatlas::getGridFromFunctionSpace (functionSpace);
64
64
// Initialise file
65
- int variableConvention = initialiseFile (grid. name () , filePath, true );
65
+ int variableConvention = initialiseFile (grid, filePath, true );
66
66
// getFileData returns a copy of FileData (with required LFRic mesh data), so read data
67
67
// is discarded when FileData goes out-of-scope for reading subsequent fields.
68
68
FileData fileData = getFileData (grid.name ());
@@ -120,10 +120,10 @@ void monio::Monio::readIncrements(atlas::FieldSet& localFieldSet,
120
120
atlas::Field globalField = utilsatlas::getGlobalField (localField);
121
121
if (mpiCommunicator_.rank () == mpiRankOwner_) {
122
122
auto & functionSpace = globalField.functionspace ();
123
- auto & grid = atlas::functionspace::NodeColumns (functionSpace). mesh (). grid ( );
123
+ auto grid = utilsatlas::getGridFromFunctionSpace (functionSpace);
124
124
125
125
// Initialise file
126
- int variableConvention = initialiseFile (grid. name () , filePath);
126
+ int variableConvention = initialiseFile (grid, filePath);
127
127
// getFileData returns a copy of FileData (with required LFRic mesh data), so read data
128
128
// is discarded when FileData goes out-of-scope for reading subsequent fields.
129
129
FileData fileData = getFileData (grid.name ());
@@ -172,7 +172,7 @@ void monio::Monio::writeIncrements(const atlas::FieldSet& localFieldSet,
172
172
if (filePath.length () != 0 ) {
173
173
try {
174
174
auto & functionSpace = localFieldSet[0 ].functionspace ();
175
- auto & grid = atlas::functionspace::NodeColumns (functionSpace). mesh (). grid ( );
175
+ auto grid = utilsatlas::getGridFromFunctionSpace (functionSpace);
176
176
FileData fileData = getFileData (grid.name ());
177
177
cleanFileData (fileData); // Remove metadata required for reading, but not for writing.
178
178
if (isLfricConvention == false ) {
@@ -235,7 +235,7 @@ void monio::Monio::writeState(const atlas::FieldSet& localFieldSet,
235
235
if (filePath.length () != 0 ) {
236
236
try {
237
237
auto & functionSpace = localFieldSet[0 ].functionspace ();
238
- auto & grid = atlas::functionspace::NodeColumns (functionSpace). mesh (). grid ( );
238
+ auto grid = utilsatlas::getGridFromFunctionSpace (functionSpace);
239
239
FileData fileData = getFileData (grid.name ());
240
240
cleanFileData (fileData); // Remove metadata required for reading, but not for writing.
241
241
if (isLfricConvention == false ) {
@@ -390,7 +390,7 @@ monio::FileData monio::Monio::getFileData(const std::string& gridName) {
390
390
return FileData (); // This function is called by all PEs. A return is essential.
391
391
}
392
392
393
- void monio::Monio::createLfricAtlasMap (FileData& fileData, const atlas::CubedSphereGrid & grid) {
393
+ void monio::Monio::createLfricAtlasMap (FileData& fileData, const atlas::Grid & grid) {
394
394
oops::Log::trace () << " Monio::createLfricAtlasMap()" << std::endl;
395
395
if (mpiCommunicator_.rank () == mpiRankOwner_) {
396
396
if (fileData.getLfricAtlasMap ().size () == 0 ) {
0 commit comments