Skip to content

Commit

Permalink
More work finishing adding original coords to GToM. Also, adding coor…
Browse files Browse the repository at this point in the history
…dinate conversion where necessary in vector regrid.
  • Loading branch information
oehmke committed Sep 15, 2023
1 parent 58508ba commit e0e175b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/Infrastructure/Mesh/src/ESMCI_Mesh_GToM_Glue.C
Original file line number Diff line number Diff line change
Expand Up @@ -487,10 +487,10 @@ Par::Out() << "GID=" << gid << ", LID=" << lid << std::endl;
MeshDB::iterator ni = mesh.node_begin(), ne = mesh.node_end();

for (; ni != ne; ++ni) {
// Get Cart. coords
// Get Cart. coords pointer
double *c = node_coord->data(*ni);

// Get orig coords
// Get orig coords pointer
double *orig_c;
if (add_orig_coords) {
orig_c=node_orig_coord->data(*ni);
Expand Down Expand Up @@ -527,8 +527,6 @@ Par::Out() << "GID=" << gid << ", LID=" << lid << std::endl;
}
}
}

/// STOPPED HERE, BUT CHECK ABOVE

// Other arrays
for (UInt i = 0; i < arrays.size(); ++i) {
Expand Down
14 changes: 13 additions & 1 deletion src/Infrastructure/Mesh/src/ESMCI_Mesh_Vector_Regrid.C
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void get_vec_dims_for_vectorRegrid(ESMCI::Array &array, int &num_vec_dims, int *
// Class for holding coordinates to make other classes below cleaner
class Coord {
// Data
double c[2]; // Holds lon, lat
double c[2]; // Holds lon, lat in radians

public:

Expand Down Expand Up @@ -261,6 +261,12 @@ void CoordFromId::add(Mesh *mesh, MeshObj::id_type obj_type) {

// Get pointer to coords
double *c = node_coords->data(node);

// If degrees, convert
if (mesh->coordsys == ESMC_COORDSYS_SPH_DEG) {
c[0] *= ESMC_CoordSys_Deg2Rad;
c[1] *= ESMC_CoordSys_Deg2Rad;
}

// Add to list
searchable.push_back(CoordFromIdEntry(id,c[0],c[1]));
Expand Down Expand Up @@ -288,6 +294,12 @@ void CoordFromId::add(Mesh *mesh, MeshObj::id_type obj_type) {

// Get pointer to coords
double *c = elem_coords->data(elem);

// If degrees, convert
if (mesh->coordsys == ESMC_COORDSYS_SPH_DEG) {
c[0] *= ESMC_CoordSys_Deg2Rad;
c[1] *= ESMC_CoordSys_Deg2Rad;
}

// Add to list
searchable.push_back(CoordFromIdEntry(id,c[0],c[1]));
Expand Down

0 comments on commit e0e175b

Please sign in to comment.