/* Perform I/O. Exit when done. */ for (;;) { int lretval = pg_vara(pg, nc, ncid, varid, mystart, iocount, xtype, is_long, data); if (lretval != NC_NOERR && (retval == NC_NOERR || lretval != NC_ERANGE)) retval = lretval; /* * The following code permutes through the variable s * external start-index space and it s internal address * space. At the UPC, this algorithm is commonly * called "odometer code". */ idim = maxidim; carry: data = (char *)data + (mymap[idim] * mem_type_size); mystart[idim] += mystride[idim]; if (mystart[idim] == stop[idim]) { mystart[idim] = start[idim]; data = (char *)data - (length[idim] * mem_type_size); if (--idim < 0) break; /* normal return */ goto carry; } } /* I/O loop */