Skip to content
Snippets Groups Projects
Commit 9afe8a80 authored by Thomas Jahns's avatar Thomas Jahns :cartwheel:
Browse files

Fix implicit conversions in PIO examples.

parent 9c1b9d96
No related branches found
No related tags found
No related merge requests found
......@@ -69,7 +69,7 @@ static void modelRun(MPI_Comm commModel)
{
zaxisID[i] = zaxisCreate ( ZAXIS_PRESSURE, nlev[i] );
zaxisDefLevels ( zaxisID[i], levs );
varSize[i] = nlon * nlat * nlev[i];
varSize[i] = nlon * nlat * (size_t)nlev[i];
}
vlistID = vlistCreate ();
......@@ -130,7 +130,7 @@ static void modelRun(MPI_Comm commModel)
#ifdef USE_MPI
int chunk = varDeco[i].chunkSize;
#else
int chunk = varSize[i];
int chunk = (int)varSize[i];
#endif
for (j = 0; j < chunk; ++j) var[j] = 2.2;
#ifdef USE_MPI
......
......@@ -105,7 +105,7 @@ static void modelRun(MPI_Comm commModel)
{
varID[i][j] = vlistDefVar(vlistID[i], gridID, zaxisID[i][j],
TIME_VARIABLE );
varSize[i][j] = nlon * nlat * nlev[i][j];
varSize[i][j] = nlon * nlat * (size_t)nlev[i][j];
#ifdef USE_MPI
{
int start = uniform_partition_start((int [2]){ 0, varSize[i][j] - 1 },
......@@ -127,10 +127,10 @@ static void modelRun(MPI_Comm commModel)
}
#else
if (maxChunkSize < varSize[i][j])
maxChunkSize = varSize[i][j];
maxChunkSize = (int)varSize[i][j];
#endif
}
var = (double*) malloc(maxChunkSize * sizeof (var[0]));
var = (double *)malloc((size_t)maxChunkSize * sizeof (var[0]));
}
taxisID = taxisCreate ( TAXIS_ABSOLUTE );
for ( i = 0; i < nStreams; i++ )
......@@ -182,7 +182,7 @@ static void modelRun(MPI_Comm commModel)
int start = varDeco[i][j].start;
int chunk = varDeco[i][j].chunkSize;
#else
int start = 0, chunk = varSize[i][j];
int start = 0, chunk = (int)varSize[i][j];
#endif
for(int k = 0; k < chunk; k++)
var[k] = 3.3 * (double)(k + start);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment