This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Hello, Running your program with a non existent file did not cause any error message on my end, as the code did not properly catch the errmsg, nor did it terminate on an error status. I made the following modification to your subroutine 'check': subroutine check(status) integer, intent ( in) :: status if(status /= nf90_noerr) then errmsg=trim(nf90_strerror(status)) Print *, "The status is: ", status, "errormsg: ", errmsg stop end if end subroutine check This causes the program to fail with error 2, 'no such file or directory', when running with a non-existent file. I hope this helps, -Ward > Hello: > > Attachment is my program and the data. > > The program was working well before. However, there exist some confusion > about the program recently. When I intended to obtain information > about a non existing file, the program also was excuted successfully > without giving any error message. Additionally, if the target file is > existing, the code works well as before, exporting information to the > file "information_about_nc". You can replace any non existing file in > the line 6 for test. > > PS: My netcdf C API is 4.2.1.1 and fortran API is 4.2. The compilers > are intel fortran and C, packaged by composer_xe_2013.1.117. > > Thanks for any hint > > > Ticket Details =================== Ticket ID: FNY-378971 Department: Support netCDF Priority: Normal Status: Closed