Help spotting stupid errors
One difficult issue when working with COHERENS is the lack of clear error message.
There has been a tremendous effort in previous developments to help for that fit the log systems, + the debug option help in some cases (but see #30 ).
One thing that could be done, however, now that we've moved towards netcdf for most inputs, is to add systematic checks (or optionnal) for requested files, and any misfits in the dimensions of the provided forcings with clear error message where required. This could be done based on the netcdf library .. for instance :
! Open netCDF file
status = nf90_open(modfiles(io_surcov,1,1)%filename, nf90_nowrite, ncid)
IF (status.NE.nf90_noerr) THEN
print *,'error subroutine usrdef_mpv for file ', modfiles(io_surcov,1,1)%filename
print *, nf90_strerror(status)
ENDIF
! Get Dimensions id
status = nf90_inq_dimid(ncid, 'lon', nnxid)
status = nf90_inquire_dimension(ncid, nnxid, len = nnx)
status = nf90_inq_dimid(ncid, 'lat', nnyid)
status = nf90_inquire_dimension(ncid, nnyid, len = nny)
Here the check has been done only for the file opening, but similar tests based on status
can be done at each step (reading dims, reading vars, etc ...). The function nf90_strerror(status)
directly provide a text message based on the content of the integer variable "status".