Skip to content

Commit

Permalink
warning: comparison of integer expressions of different signedness
Browse files Browse the repository at this point in the history
  • Loading branch information
wkliao committed Dec 4, 2024
1 parent f0ecd92 commit 00f081f
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/cases/var_rd_G_case.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ int e3sm_io_case::run_varn_G_case_rd (e3sm_io_config &cfg,
double **D6_rec_dbl_bufp, /* D6 rec double buffer */
double **D1_fix_dbl_bufp) /* D1 fix double buffer */
{
int ii, i, j, k, err, rank, ncid, *varids;
int i, j, k, err, rank, ncid, *varids;
int nrecs=0, rec_no, my_nreqs;
size_t rec_buflen, nelems[6];
size_t ii, rec_buflen, nelems[6];
double *D1_rec_dbl_buf, *D3_rec_dbl_buf, *D4_rec_dbl_buf, *D5_rec_dbl_buf, *D6_rec_dbl_buf,
*rec_buf_ptr;
int *D1_fix_int_buf, *D2_fix_int_buf, *D3_fix_int_buf, *D4_fix_int_buf, *D5_fix_int_buf;
Expand Down Expand Up @@ -315,47 +315,47 @@ int e3sm_io_case::run_varn_G_case_rd (e3sm_io_config &cfg,
/* int (nCells): maxLevelCell */
if (nelems[0] > 0) {
D1_fix_int_buf = (int *)malloc (nelems[0] * sizeof (int));
for (ii=0; ii<nelems[0]; ii++) D1_fix_int_buf[ii] = rank + ii;
for (ii=0; ii<nelems[0]; ii++) D1_fix_int_buf[ii] = rank + (int)ii;
*D1_fix_int_bufp = D1_fix_int_buf;
} else
D1_fix_int_buf = NULL;

/* int (nEdges): maxLevelEdgeTop and maxLevelEdgeBot */
if (nelems[1] > 0) {
D2_fix_int_buf = (int *)malloc (2 * nelems[1] * sizeof (int));
for (ii= 0; ii<2*nelems[1]; ii++) D2_fix_int_buf[ii] = rank + ii;
for (ii= 0; ii<2*nelems[1]; ii++) D2_fix_int_buf[ii] = rank + (int)ii;
*D2_fix_int_bufp = D2_fix_int_buf;
} else
D2_fix_int_buf = NULL;

/* int (nCells, nVertLevels): cellMask */
if (nelems[2] > 0) {
D3_fix_int_buf = (int *)malloc (nelems[2] * sizeof (int));
for (ii=0; ii<nelems[2]; ii++) D3_fix_int_buf[ii] = rank + ii;
for (ii=0; ii<nelems[2]; ii++) D3_fix_int_buf[ii] = rank + (int)ii;
*D3_fix_int_bufp = D3_fix_int_buf;
} else
D3_fix_int_buf = NULL;

/* int (nEdges, nVertLevels): edgeMask */
if (nelems[3] > 0) {
D4_fix_int_buf = (int *)malloc (nelems[3] * sizeof (int));
for (ii=0; ii<nelems[3]; ii++) D4_fix_int_buf[ii] = rank + ii;
for (ii=0; ii<nelems[3]; ii++) D4_fix_int_buf[ii] = rank + (int)ii;
*D4_fix_int_bufp = D4_fix_int_buf;
} else
D4_fix_int_buf = NULL;

/* int (nVertices, nVertLevels): vertexMask */
if (nelems[4] > 0) {
D5_fix_int_buf = (int *)malloc (nelems[4] * sizeof (int));
for (ii=0; ii<nelems[4]; ii++) D5_fix_int_buf[ii] = rank + ii;
for (ii=0; ii<nelems[4]; ii++) D5_fix_int_buf[ii] = rank + (int)ii;
*D5_fix_int_bufp = D5_fix_int_buf;
} else
D5_fix_int_buf = NULL;

/* double (nCells): bottomDepth */
if (nelems[0] > 0) {
D1_fix_dbl_buf = (double *)malloc (nelems[0] * sizeof (double));
for (ii=0; ii<nelems[0]; ii++) D1_fix_dbl_buf[ii] = rank + ii;
for (ii=0; ii<nelems[0]; ii++) D1_fix_dbl_buf[ii] = rank + (int)ii;
*D1_fix_dbl_bufp = D1_fix_dbl_buf;
} else
D1_fix_dbl_buf = NULL;
Expand All @@ -364,39 +364,39 @@ int e3sm_io_case::run_varn_G_case_rd (e3sm_io_config &cfg,
if (nelems[0] > 0) {
rec_buflen = nelems[0] * nD1_rec_2d_vars;
D1_rec_dbl_buf = (double *)malloc (rec_buflen * sizeof (double));
for (ii=0; ii<rec_buflen; ii++) D1_rec_dbl_buf[ii] = rank + ii;
for (ii=0; ii<rec_buflen; ii++) D1_rec_dbl_buf[ii] = rank + (int)ii;
*D1_rec_dbl_bufp = D1_rec_dbl_buf;
} else
D1_rec_dbl_buf = NULL;

if (nelems[2] > 0) {
rec_buflen = nelems[2] * nD3_rec_3d_vars;
D3_rec_dbl_buf = (double *)malloc (rec_buflen * sizeof (double));
for (ii=0; ii<rec_buflen; ii++) D3_rec_dbl_buf[ii] = rank + ii;
for (ii=0; ii<rec_buflen; ii++) D3_rec_dbl_buf[ii] = rank + (int)ii;
*D3_rec_dbl_bufp = D3_rec_dbl_buf;
} else
D3_rec_dbl_buf = NULL;

if (nelems[3] > 0) {
rec_buflen = nelems[3] * nD4_rec_3d_vars;
D4_rec_dbl_buf = (double *)malloc (rec_buflen * sizeof (double));
for (ii=0; ii<rec_buflen; ii++) D4_rec_dbl_buf[ii] = rank + ii;
for (ii=0; ii<rec_buflen; ii++) D4_rec_dbl_buf[ii] = rank + (int)ii;
*D4_rec_dbl_bufp = D4_rec_dbl_buf;
} else
D4_rec_dbl_buf = NULL;

if (nelems[4] > 0) {
rec_buflen = nelems[4] * nD5_rec_3d_vars;
D5_rec_dbl_buf = (double *)malloc (rec_buflen * sizeof (double));
for (ii=0; ii<rec_buflen; ii++) D5_rec_dbl_buf[ii] = rank + ii;
for (ii=0; ii<rec_buflen; ii++) D5_rec_dbl_buf[ii] = rank + (int)ii;
*D5_rec_dbl_bufp = D5_rec_dbl_buf;
} else
D5_rec_dbl_buf = NULL;

if (nelems[5] > 0) {
rec_buflen = nelems[5] * nD6_rec_3d_vars;
D6_rec_dbl_buf = (double *)malloc (rec_buflen * sizeof (double));
for (ii=0; ii<rec_buflen; ii++) D6_rec_dbl_buf[ii] = rank + ii;
for (ii=0; ii<rec_buflen; ii++) D6_rec_dbl_buf[ii] = rank + (int)ii;
*D6_rec_dbl_bufp = D6_rec_dbl_buf;
} else
D6_rec_dbl_buf = NULL;
Expand Down

0 comments on commit 00f081f

Please sign in to comment.