Skip to content

Commit 68bc366

Browse files
committed
change variables in Fortran APIs to const
1 parent bd7962f commit 68bc366

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/pmpo_c.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ void polympo_getMPCurElmID_f(MPMesh_ptr p_mpmesh,
234234
Kokkos::deep_copy( arrayHost, mpCurElmIDCopy);
235235
}
236236

237-
void polympo_setMPLatLonRotatedFlag_f(MPMesh_ptr p_mpmesh, int isRotateFlag){
237+
void polympo_setMPLatLonRotatedFlag_f(MPMesh_ptr p_mpmesh, const int isRotateFlag){
238238
//chech validity
239239
checkMPMeshValid(p_mpmesh);
240240
((polyMPO::MPMesh*)p_mpmesh)->p_MPs->setRotatedFlag(isRotateFlag>0);
@@ -295,9 +295,9 @@ void polympo_getMPPositions_f(MPMesh_ptr p_mpmesh,
295295
}
296296

297297
void polympo_setMPRotLatLon_f(MPMesh_ptr p_mpmesh,
298-
int numComps,
299-
int numMPs,
300-
double* mpRotLatLonIn){
298+
const int numComps,
299+
const int numMPs,
300+
const double* mpRotLatLonIn){
301301
static int callCount = 0;
302302
PMT_ALWAYS_ASSERT(callCount == 0);
303303
checkMPMeshValid(p_mpmesh);
@@ -308,7 +308,7 @@ void polympo_setMPRotLatLon_f(MPMesh_ptr p_mpmesh,
308308

309309
auto mpRotLatLon = p_MPs->getData<polyMPO::MPF_Cur_Pos_Rot_Lat_Lon>();
310310
auto mpAppID = p_MPs->getData<polyMPO::MPF_MP_APP_ID>();
311-
kkDbl2dViewHostU mpRotLatLonIn_h(mpRotLatLonIn,numComps,numMPs);
311+
kkViewHostU<const double**> mpRotLatLonIn_h(mpRotLatLonIn,numComps,numMPs);
312312
Kokkos::View<double**> mpRotLatLonIn_d("mpRotLatLonDevice",vec2d_nEntries,numMPs);
313313
Kokkos::deep_copy(mpRotLatLonIn_d, mpRotLatLonIn_h);
314314
auto setPos = PS_LAMBDA(const int& elm, const int& mp, const int& mask){
@@ -322,8 +322,8 @@ void polympo_setMPRotLatLon_f(MPMesh_ptr p_mpmesh,
322322
}
323323

324324
void polympo_getMPRotLatLon_f(MPMesh_ptr p_mpmesh,
325-
int numComps,
326-
int numMPs,
325+
const int numComps,
326+
const int numMPs,
327327
double* mpRotLatLonHost){
328328
checkMPMeshValid(p_mpmesh);
329329
auto p_MPs = ((polyMPO::MPMesh*)p_mpmesh)->p_MPs;
@@ -541,7 +541,7 @@ void polympo_getMeshVtxCoords_f(MPMesh_ptr p_mpmesh, const int nVertices, double
541541
}
542542
}
543543

544-
void polympo_setMeshVtxRotLat_f(MPMesh_ptr p_mpmesh, int nVertices, double* latitude){
544+
void polympo_setMeshVtxRotLat_f(MPMesh_ptr p_mpmesh, const int nVertices, const double* latitude){
545545
//chech validity
546546
checkMPMeshValid(p_mpmesh);
547547
auto p_mesh = ((polyMPO::MPMesh*)p_mpmesh)->p_mesh;
@@ -558,7 +558,7 @@ void polympo_setMeshVtxRotLat_f(MPMesh_ptr p_mpmesh, int nVertices, double* lati
558558
Kokkos::deep_copy(coordsArray, h_coordsArray);
559559
}
560560

561-
void polympo_getMeshVtxRotLat_f(MPMesh_ptr p_mpmesh, int nVertices, double* latitude){
561+
void polympo_getMeshVtxRotLat_f(MPMesh_ptr p_mpmesh, const int nVertices, double* latitude){
562562
//chech validity
563563
checkMPMeshValid(p_mpmesh);
564564
auto p_mesh = ((polyMPO::MPMesh*)p_mpmesh)->p_mesh;

src/pmpo_c.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ void polympo_setMPICommunicator_f(MPI_Fint fcomm);//TODO:is MPI_Fint best? or so
2323
void polympo_createMPs_f(MPMesh_ptr p_mpmesh, const int numElms, const int numMPs, int* mpsPerElm, const int* mp2Elm, const int* isMPActive);
2424
void polympo_rebuildMPs_f(MPMesh_ptr p_mpmesh, const int numMPs, const int* allTgtMpElmIn, const int* addedMPMask);
2525
void polympo_getMPCurElmID_f(MPMesh_ptr p_mpmesh, const int numMPs, int* elmIDs);
26-
void polympo_setMPLatLonRotatedFlag_f(MPMesh_ptr p_mpmesh, int isRotateFlag);
26+
void polympo_setMPLatLonRotatedFlag_f(MPMesh_ptr p_mpmesh, const int isRotateFlag);
2727

2828
//MP slices
29-
void polympo_getMPPositions_f(MPMesh_ptr p_mpmesh, const int numComps, const int numMPs, double* mpPositionsIn);
3029
void polympo_setMPPositions_f(MPMesh_ptr p_mpmesh, const int numComps, const int numMPs, const double* mpPositionsIn);
31-
void polympo_setMPRotLatLon_f(MPMesh_ptr p_mpmesh, int numComps, int numMPs, double* mpRotLatLonIn);
32-
void polympo_getMPRotLatLon_f(MPMesh_ptr p_mpmesh, int numComps, int numMPs, double* mpRotLatLonHost);
30+
void polympo_getMPPositions_f(MPMesh_ptr p_mpmesh, const int numComps, const int numMPs, double* mpPositionsIn);
31+
void polympo_setMPRotLatLon_f(MPMesh_ptr p_mpmesh, const int numComps, const int numMPs, const double* mpRotLatLonIn);
32+
void polympo_getMPRotLatLon_f(MPMesh_ptr p_mpmesh, const int numComps, const int numMPs, double* mpRotLatLonHost);
3333
void polympo_setMPVel_f(MPMesh_ptr p_mpmesh, const int size, const double* array);
3434
void polympo_getMPVel_f(MPMesh_ptr p_mpmesh, const int size, double* array);
3535

@@ -53,8 +53,8 @@ void polympo_setMeshElm2ElmConn_f(MPMesh_ptr p_mpmesh, const int maxEdges, const
5353
//Mesh fields
5454
void polympo_setMeshVtxCoords_f(MPMesh_ptr p_mpmesh, const int nVertices, const double* xArray, const double* yArray, const double* zArray);
5555
void polympo_getMeshVtxCoords_f(MPMesh_ptr p_mpmesh, const int nVertices, double* xArray, double* yArray, double* zArray);
56-
void polympo_setMeshVtxRotLat_f(MPMesh_ptr p_mpmesh, int nVertices, double* latitude);
57-
void polympo_getMeshVtxRotLat_f(MPMesh_ptr p_mpmesh, int nVertices, double* latitude);
56+
void polympo_setMeshVtxRotLat_f(MPMesh_ptr p_mpmesh, const int nVertices, const double* latitude);
57+
void polympo_getMeshVtxRotLat_f(MPMesh_ptr p_mpmesh, const int nVertices, double* latitude);
5858
void polympo_setMeshOnSurfVeloIncr_f(MPMesh_ptr p_mpmesh, const int nComps, const int nVertices, const double* array);//vec2d
5959
void polympo_getMeshOnSurfVeloIncr_f(MPMesh_ptr p_mpmesh, const int nComps, const int nVertices, double* array);//vec2d
6060
void polympo_setMeshOnSurfDispIncr_f(MPMesh_ptr p_mpmesh, const int nComps, const int nVertices, const double* array);//vec2d

0 commit comments

Comments
 (0)