int calcChunkIx( int[] startIxs)
throws HdfException
{
  int ichunk = 0;
  for (int ii = 0; ii < varRank; ii++) {
    if (startIxs[ii] < 0)
      throwerr("startIxs[%d] == %d is < 0: %d", ii, startIxs[ii]);
    if (startIxs[ii] >= varDims[ii])
      throwerr("startIxs[%d] == %d is >= varDims[%d] == %d",
        ii, startIxs[ii], ii, varDims[ii]);
    if (specChunkDims == null) {
      if (startIxs[ii] != 0)
        throwerr("startIxs != 0 for specChunkDims == null");
    }
    else {
      if (startIxs[ii] % specChunkDims[ii] != 0)
        throwerr("startIxs[%d] == %d is not a multiple of"
          + " specChunkDims[%d] == %d",
          ii, startIxs[ii], ii, specChunkDims[ii]);
      ichunk += (startIxs[ii] / specChunkDims[ii]) * totChunkNums[ii];
    }
  }
  if (ichunk < 0 || ichunk >= hdfChunks.length) throwerr("invalid ichunk");
  return ichunk;
}