When I updated to the latest version of the code, with the new, quick-save file functionality and ran an existing case I got
Code: Select all
NETCDF_CLOSE - error during closing of file, ncid = 0
file:
call from: close_out, close_io.F
The code that triggered this error is at lines 177-180 of ROMS/Utility/close_io.F
Code: Select all
IF (QCK(ng)%ncid.ne.-1) THEN
CALL netcdf_close (ng, iNLM, QCK(ng)%ncid)
END IF
Code: Select all
CASE ('QCKNAME')
label='QCK - nonlinear model quicksave fields'
Npts=load_s1d(Nval, Cval, Cdim, line, label, igrid, &
& Nfiles, QCK)
So, first and foremost, users should always provide names for every different type of file that ROMS can read or write, even if they don't intend to use them. (That way, error messages associated with that file type will show an informative file name rather than a blank.)
But could the code be a bit more tolerant when this is not done? How about the following (and similarly for the other file types):
Code: Select all
IF (QCK(ng)%ncid.gt.0) THEN
CALL netcdf_close (ng, iNLM, QCK(ng)%ncid)
END IF