It appears that this bug is triggered by attempting to overwrite an existing NetCDF file. We had previously created an output file of the same name with `ncks`, and nccopy appeared to overwrite it correctly, but instead left us with a mangled file, which should not happen.