<div dir="ltr">Just setting up 6.2.1 today, and finding that files that CAN be opened with addfile does not register with isfilepresent. While I could use filexists to duplicate the old functionality of the command, it would be nice to be able to take advantage of the "is this an openable file" check before feeding it to addfile later in my script.<div><br></div><div>Specifically, the files that are causing this issue are ones that are GRIB2 files but do not contain a file extension. While I can give it the appropriate file extension to make addfile work (it checks for 'file_name.grb2' as well as simply 'file_name'), this feature does not seem to exist with isfilepresent and the function returns false for all calls with or without file extensions.</div><div><br></div><div>I feel this isn't the desired implementation of this change to the function, and I think it might be an easy fix. Any insights? I've included some command-line interaction with the file below (specific file doesn't matter, as this issue should be true for any GRIB or GRIB2 file that is on the file system but has no extension).</div><div><br></div><div>Let me know if I can/should provide further evidence, and thanks!</div><div><br></div><div><br></div><div>Kyle</div><div><br></div><div><br></div><div><br></div><div>
<p class="">ncl 0> print(isfilepresent("/cas2/unidata/GRIB/gfs0p5deg/GFS_140909_18_000.grb"))</p>
<p class="">fatal:NetCDF: Unknown file format</p>
<p class="">fatal:Could not open (/cas2/unidata/GRIB/gfs0p5deg/GFS_140909_18_000)</p>
<p class="">(0)<span class="">        </span>False</p>
<p class="">ncl 1> print(isfilepresent("/cas2/unidata/GRIB/gfs0p5deg/GFS_140909_18_000.grb2"))</p>
<p class="">fatal:NetCDF: Unknown file format</p>
<p class="">fatal:Could not open (/cas2/unidata/GRIB/gfs0p5deg/GFS_140909_18_000)</p>
<p class="">(0)<span class="">        </span>False</p>
<p class="">ncl 2> a=addfile("/cas2/unidata/GRIB/gfs0p5deg/GFS_140909_18_000.grb","r") </p>
<p class="">ncl 3> printVarSummary(a)</p>
<p class=""><br></p>
<p class="">Variable: a</p>
<p class="">Type: file</p>
<p class="">File path:<span class="">        </span>/cas2/unidata/GRIB/gfs0p5deg/GFS_140909_18_000</p>
<p class="">Number of global attributes:<span class="">        </span> 0</p>
<p class="">Number of dimensions:<span class="">        </span> 15</p>
<p class="">Number of variables:<span class="">        </span> 108</p>
<p class="">ncl 4> print(isfilepresent("/cas2/unidata/GRIB/gfs0p5deg/GFS_140909_18_000")) </p>
<p class="">fatal:NetCDF: Unknown file format</p>
<p class="">fatal:Could not open (/cas2/unidata/GRIB/gfs0p5deg/GFS_140909_18_000)</p>
<p class="">(0)<span class="">        </span>False</p><div><div dir="ltr">----------------------------------------<div>Kyle S. Griffin</div><div>Department of Atmospheric and Oceanic Sciences</div><div>University of Wisconsin - Madison</div><div>Room 1421</div><div>1225 W Dayton St, Madison, WI 53706</div><div>Email: <a href="mailto:ksgriffin2@wisc.edu" target="_blank">ksgriffin2@wisc.edu</a></div></div></div>
</div></div>