MetOffice / MetOffice/ngmo-environments
Additional xios patch
- Dominant language
- Python
- Stars
- 12
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
While Scott is on leave, here is the one XIOS patch that I am aware of that is missing here (original link, which requires an account: https://git.nci.org.au/bom/ngm/spack-environments/-/blob/master/repos/bom-ngm/packages/xios/lfric_xios2.2629.patch?ref_type=heads_):
```
--- a/src/node/mesh.cpp (revision 2629)
+++ b/src/node/mesh.cpp (working copy)
@@ -148,8 +148,8 @@
vector CMesh::createHashes (const double longitude, const double latitude)
{
- double minBoundLon = 0. ;
- double maxBoundLon = 360. ;
+ double minBoundLon = -180. ;
+ double maxBoundLon = 180. ;
double minBoundLat = -90. ;
double maxBoundLat = 90. ;
double prec=1e-11 ;
@@ -158,8 +158,6 @@
double lon = longitude;
double lat = latitude;
- if (lon > (360.- prec)) lon = 0.;
-
size_t maxsize_t=numeric_limits::max() ;
if ( (maxBoundLon-minBoundLon)/maxsize_t > precLon) precLon=(maxBoundLon-minBoundLon)/maxsize_t ;
if ( (maxBoundLat-minBoundLat)/maxsize_t > precLat) precLat=(maxBoundLat-minBoundLat)/maxsize_t ;
@@ -855,10 +853,11 @@
}
else
{
- if (mpiRank == (mpiSize - 1) )
+ int tmprem = nbEdgesGlo%mpiSize;
+ if (mpiRank >= tmprem)
{
edge_count = nbEdgesGlo/mpiSize;
- edge_start = mpiRank*(nbEdgesGlo/mpiSize + 1);
+ edge_start = (mpiRank - tmprem)*edge_count + tmprem*(nbEdgesGlo/mpiSize + 1);
}
else
{
@@ -884,6 +883,7 @@
for (int i = 0; i < edge_count; ++i)
{
CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeIdxGlo2FaceIdx.find(i + edge_start);
+ if (it != edgeIdxGlo2FaceIdx.end()) {
int indexGlo = it->first;
vector faces = it->second;
int face1 = faces[0];
@@ -896,7 +896,7 @@
else
{
edge_faces(1, indexGlo - edge_start) = fill_value_edge_faces();
- }
+ }}
}
size_t tmp;
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the XIOS package or patch handling in this repository and compare it with the supplied diff for src/node/mesh.cpp. Use the referenced lfric_xios2.2629.patch as the source of truth; done means the missing patch is incorporated and the environment accepts it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, hpc
- Domain
- build-system, hpc
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100