Nitpicky suggestion: Instead of using continue, 

if (outputTimeStepIndex >= 0) {
    inputTimeStepCountForOutputTimeStep[outputTimeStepIndex]++;
}