Re: [netcdfgroup] ncap2 cannot find file

  • To: netcdfgroup@xxxxxxxxxxxxxxxx
  • Subject: Re: [netcdfgroup] ncap2 cannot find file
  • From: Sourish Basu <Sourish.Basu@xxxxxxxxxxxx>
  • Date: Sun, 24 Mar 2019 21:14:19 -0600
  • Autocrypt: addr=Sourish.Basu@xxxxxxxxxxxx; prefer-encrypt=mutual; keydata= mQINBFZ40gQBEADvGCqRa5XGgaROg6TYUieMAh5GDTy6lclqxdKqu4oYSROUFYkEuT4tOHpV 4k6Ruhg1EYXMl0siTQ4VsTcvaFBR3RLKiOdRxsh4jPVrZI1TWJPJRWlvNg5iPXczTkH3diyA 2Pp4CBNfpw/M5uUHMgfL/A+1AAT0ciMUq9eR5U8bcjvfemg6Js/+tsNOwyHGlZEEXOrod/eb NrqOB1FA0WFHvEkFgJ1Ed/g3ulu0ylel0HoC/rCv0pU/PX+wNqucQbk00xjOw8ts02keX2z+ LQumHPWfSNrQpPh5u4L6XLAcc0RjEig6WkwHJQtjdEIoI+TNXtrDdQ09yrOg1dgQwz/kgnp4 oLBLjs2K3XMymsSorPCcInAoG3kchRadsmv69WX+YxIWPJaKOVrNs5K7Jf0nX9cyGe5Q1XuW 8sbk7IGKux9sy0S9HaYqU/w6HUhGl85522ogCeyZ7xnZoKuPthHGOBULsS8YD7BqYrxgNwnA JsDgefkSqLUiKixie/Tb8V/dSDpFfXEm6/ixNPm6iXZAza8ZVreQqQ3gs44VIHZi1c0qHtC0 kP2dx3IujfkdeUL3g2m84GMHmeG5Q207P50rqWk0kPzHRu5xMDQYICQ4wJwaEo69oM776sQ7 YxRXmFqzo2UX45rTVoq5xaOS0NRFteN4lJDB35911h5El46l+QARAQABtChTb3VyaXNoIEJh c3UgPFNvdXJpc2guQmFzdUBjb2xvcmFkby5lZHU+iQI4BBMBAgAiBQJWeNrBAhsjBgsJCAcD AgYVCAIJCgsEFgIDAQIeAQIXgAAKCRDdna2p+Lv9IC5NEADjZ9A1SZWzlN/trUcRIL9Vt2xZ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3j/9PiE5d ilxww5Df+43memityqJzFoFLgvlftXYsnQ5dsJGXOVhnf5IE+xzWnP/W5qTuDswlV8ZJ4OjT +KiZkePhirXiKLObcwpODZ97VCE0O1DHOWNfuvg6aQd97FHo51wRs2CI5SBa2xbpEhbwKu3p Py11Lkn0NQ/3qPrnKOs4bxb5nn+mUGkLMeQLantWmnWF8r7WxELkf+06jYliG6LTdCmVld6r PqW8E6/KQaZJXjRcbJ01b80IilyFCE9l2uA+ZgVieCHWHFuQ28+yNscvJVEAEQEAAYkCHwQY AQIACQUCVnjSBAIbDAAKCRDdna2p+Lv9IPQUEACPYzMYudTbWC9w615+fpW6kZdWXRByGCqJ G8fM2zkADi521ZH3nzWzdOjAxXZ94ujEUuNMeEBDlk4lmmb1i4jstyRWf5FJBqbGM52PiPMn 5mcI8GzIayvYMugDCoyMH1WGEI3lmQbIAr7kkyjLDbhTa74YmMvzgtmHRgDSHqHqAKCrBKde HqkvxEFu8clL50KRsUm45RU4BOupbzHnw2zxzhEmK1PJaJ5WqCMSX4icftGlkWNEJq3KmmSf JPmIO48ACXneslTzF3hRTslEreAHYvQJprYZDj3Cr1ttftCcrhs7L4Fz64BhYBoye+j78z4A 8EFbaWzGuZt1SRBvd8a2qiq9kj8g2FzzxqXsCluILwN9GNPZbYY2aXPemZcbbUYtqEA4yTRs vVvd68NXxIINTfXDlAYHr1DcCHvwqr+oZuG+J70zl1vVxjCl6BvdsG6VdMM0ag6RGhuRms81 EQj1oyFg3EBFJoJ/6vXV0rTTs+Yw6DsaFlNrM/xnGUf1hD5uh7utRyYfGpLssdJQzn/dVsRU iUPL5w35WZ/za2VJIs7Mv6f9DmxaRd6FrtCmc1GoXYspcj95ytrcFHKi+MviOUkhuEnOz/tB odfNf7h8Mkb5mVHONfWrFdIyF2ZqngD+Lx2YgITXdakyBq9WOFwGoyHblqQbO4PKxD38b7av /A==
Dave,

File locking and/or permissions were the first thing I thought of too.
However, the file is on a local disk on my laptop (so no network
mounts), and I've even tried giving 666 permissions so that everyone can
write to it (even though I'm running ncap2 as myself and I own the
file). I've also copied the file over to my home directory and tried, so
the folder is not write protected. The only thing I can think of is that
this file was made on another system with 'ncea' from NCO 4.6.1 (HDF5
1.8.18), while my laptop has NCO 4.7.7 (HDF5 1.8.20). Is it possible
that this can cause an issue? I can't see why it should, since it was
created with an older version of the respective libraries, but maybe???

I should also say that other NCO utilities work just fine. E.g., I can
extract a variable with

ncks -v ocn_flux_opt -L 6 -4 -h -o guineapig_2.nc guineapig.nc

without any errors and with the expected data in guineapig_2.nc. It's
only ncap2 that is giving me grief.

I'm curious, do you happen to have ncap2 installed? If you issue the
ncap2 command I've been trying, does it yield results?

Thanks,

Sourish

On 3/24/19 7:01 PM, Dave Allured - NOAA Affiliate wrote:
> I missed the attached file, sorry.  I can read it fine using a recent
> version of ncdump with recent netcdf and HDF5 libraries.  This is a
> netcdf4 file made with NCO 4.6.1 and a relatively old netcdf library
> version, old enough that the _NCProperties attribute is absent. 
> Superblock 2 suggests it is probably not a format compatibility
> issue.  My best guess is one of those file lock problems on your system.
>
>
> On Sun, Mar 24, 2019 at 6:40 PM Dave Allured - NOAA Affiliate
> <dave.allured@xxxxxxxx <mailto:dave.allured@xxxxxxxx>> wrote:
>
>     Sourish,
>
>     You are getting this confusing error because the underlying HDF5
>     layer supporting netcdf4 format is currently limited to only
>     pass/fail return codes.  A fail status is returned simply as "HDF
>     error", regardless of the details.  This means that when some
>     program such as ncap2 tries to initially open a netcdf4 file, it
>     can't tell the difference between file not found, and some other
>     format problem, without adding messy and redundant error analysis
>     code.  I wish this situation could be improved.
>
>     Since your file actually exists, try some other methods to see
>     what HDF5 and netcdf might not like.  First see if ncdump works. 
>     You can check the file signature in the first 8 bytes with the
>     "file" command or the simple "od" command.  Then try HDF tools
>     such as h5dump and h5debug.  Make sure your HDF5 tools are
>     relatively recent.  It would be quite helpful to get the HDF5
>     error stack to print under ncap2.  If you figure out how to do
>     that, please let the rest of us know.
>
>     Here are several more probable causes of HDF error on open, with
>     an existing file.
>
>     * The file is network mounted, and you did not disable HDF5 file
>     locking.
>     * The file was created with a later version of HDF5, without the
>     proper backward compatibility setting.
>     * The file or path is read protected.
>     * On Mac OS, the file is in a pseudo locked state due to a recent
>     program crash.
>     * Oh yeah, triple check the file name and path.  This happens more
>     often than we like to admit.
>
>     It is possible that you really have a broken netcdf4 file.  In my
>     experience, such reports are usually one of these other things in
>     disguise.  HTH.
>
>     --Dave
>
>
>     On Sun, Mar 24, 2019 at 4:40 PM Sourish Basu
>     <Sourish.Basu@xxxxxxxxxxxx <mailto:Sourish.Basu@xxxxxxxxxxxx>> wrote:
>
>         Hello all,
>
>         I am trying to add two variables and put the result in a third
>         one with
>         ncap2, and I have this strange error:
>
>         $ ncap2 -L 6 -4 -h -A -s
>         'co2_flux_natural=bio_flux_opt+fire_flux_imp+ocn_flux_opt'
>         guineapig.nc
>         
> <http://secure-web.cisco.com/1a5DHt5xyeGbMJ-4IfzmPiQgs3JfVa7kJK98ONQywupAH9pWGmn9nxoVS0WG-s_fpu7AOjJk9XzK9WfeDO-S3EWcFW0sie8hTW2WWLwt9bGNJqoGHzTtHoGEvW6sEsAy8ult6t18N8SPlnV3duvYmOy4aF-I1dIoueKYouN1eS3C8JECUfUmYQl6NwTzLYgnTYcEaShlWZlaK_iEeUVDZ2WPNx38ZTJd7Syx1vnOVna4WV7lfihDS4BmQP90HRE6b4uwvxHOA2v90ILIY0jUPVl1g9gshn9VG2mbeS0y9fkQqRDnjDiSQK-lLx6uNasSBonywhUO0houaFLvRBi8BbX8cPMC2MKtV-MXULsOyh0JlTPTpdDu_2u3xBwyO6Nxj_ppJOEJ4umzsj0aGcVlYO7yUfUQCPCe9GtQuPE_Li2VHGP2I0E8sykunjiBGWIW8/http%3A%2F%2Fguineapig.nc>
>         ERROR: nco__open() unable to open file "guineapig.nc
>         
> <http://secure-web.cisco.com/1a5DHt5xyeGbMJ-4IfzmPiQgs3JfVa7kJK98ONQywupAH9pWGmn9nxoVS0WG-s_fpu7AOjJk9XzK9WfeDO-S3EWcFW0sie8hTW2WWLwt9bGNJqoGHzTtHoGEvW6sEsAy8ult6t18N8SPlnV3duvYmOy4aF-I1dIoueKYouN1eS3C8JECUfUmYQl6NwTzLYgnTYcEaShlWZlaK_iEeUVDZ2WPNx38ZTJd7Syx1vnOVna4WV7lfihDS4BmQP90HRE6b4uwvxHOA2v90ILIY0jUPVl1g9gshn9VG2mbeS0y9fkQqRDnjDiSQK-lLx6uNasSBonywhUO0houaFLvRBi8BbX8cPMC2MKtV-MXULsOyh0JlTPTpdDu_2u3xBwyO6Nxj_ppJOEJ4umzsj0aGcVlYO7yUfUQCPCe9GtQuPE_Li2VHGP2I0E8sykunjiBGWIW8/http%3A%2F%2Fguineapig.nc>"
>         nco_err_exit(): ERROR Short NCO-generated message (usually name of
>         function that triggered error): nco__open()
>         nco_err_exit(): ERROR Error code is -101. Translation into
>         English with
>         nc_strerror(-101) is "NetCDF: HDF error"
>         nco_err_exit(): ERROR NCO will now exit with system call
>         exit(EXIT_FAILURE)
>
>         Which is extremely strange, because the file guineapig.nc
>         
> <http://secure-web.cisco.com/1a5DHt5xyeGbMJ-4IfzmPiQgs3JfVa7kJK98ONQywupAH9pWGmn9nxoVS0WG-s_fpu7AOjJk9XzK9WfeDO-S3EWcFW0sie8hTW2WWLwt9bGNJqoGHzTtHoGEvW6sEsAy8ult6t18N8SPlnV3duvYmOy4aF-I1dIoueKYouN1eS3C8JECUfUmYQl6NwTzLYgnTYcEaShlWZlaK_iEeUVDZ2WPNx38ZTJd7Syx1vnOVna4WV7lfihDS4BmQP90HRE6b4uwvxHOA2v90ILIY0jUPVl1g9gshn9VG2mbeS0y9fkQqRDnjDiSQK-lLx6uNasSBonywhUO0houaFLvRBi8BbX8cPMC2MKtV-MXULsOyh0JlTPTpdDu_2u3xBwyO6Nxj_ppJOEJ4umzsj0aGcVlYO7yUfUQCPCe9GtQuPE_Li2VHGP2I0E8sykunjiBGWIW8/http%3A%2F%2Fguineapig.nc>
>         *does* exist
>         in the current folder:
>
>         $ ls -l guineapig.nc
>         
> <http://secure-web.cisco.com/1a5DHt5xyeGbMJ-4IfzmPiQgs3JfVa7kJK98ONQywupAH9pWGmn9nxoVS0WG-s_fpu7AOjJk9XzK9WfeDO-S3EWcFW0sie8hTW2WWLwt9bGNJqoGHzTtHoGEvW6sEsAy8ult6t18N8SPlnV3duvYmOy4aF-I1dIoueKYouN1eS3C8JECUfUmYQl6NwTzLYgnTYcEaShlWZlaK_iEeUVDZ2WPNx38ZTJd7Syx1vnOVna4WV7lfihDS4BmQP90HRE6b4uwvxHOA2v90ILIY0jUPVl1g9gshn9VG2mbeS0y9fkQqRDnjDiSQK-lLx6uNasSBonywhUO0houaFLvRBi8BbX8cPMC2MKtV-MXULsOyh0JlTPTpdDu_2u3xBwyO6Nxj_ppJOEJ4umzsj0aGcVlYO7yUfUQCPCe9GtQuPE_Li2VHGP2I0E8sykunjiBGWIW8/http%3A%2F%2Fguineapig.nc>
>         -rw-r--r-- 1 i i 4862322 Mar 24 16:28 guineapig.nc
>         
> <http://secure-web.cisco.com/1a5DHt5xyeGbMJ-4IfzmPiQgs3JfVa7kJK98ONQywupAH9pWGmn9nxoVS0WG-s_fpu7AOjJk9XzK9WfeDO-S3EWcFW0sie8hTW2WWLwt9bGNJqoGHzTtHoGEvW6sEsAy8ult6t18N8SPlnV3duvYmOy4aF-I1dIoueKYouN1eS3C8JECUfUmYQl6NwTzLYgnTYcEaShlWZlaK_iEeUVDZ2WPNx38ZTJd7Syx1vnOVna4WV7lfihDS4BmQP90HRE6b4uwvxHOA2v90ILIY0jUPVl1g9gshn9VG2mbeS0y9fkQqRDnjDiSQK-lLx6uNasSBonywhUO0houaFLvRBi8BbX8cPMC2MKtV-MXULsOyh0JlTPTpdDu_2u3xBwyO6Nxj_ppJOEJ4umzsj0aGcVlYO7yUfUQCPCe9GtQuPE_Li2VHGP2I0E8sykunjiBGWIW8/http%3A%2F%2Fguineapig.nc>
>
>         What is more, I can use ncap2 to perform the exact same
>         operation on
>         some other files without a problem. Which leaves me very
>         confused as to
>         why ncap2 fails and tells me that this file does not exist,
>         when it
>         clearly does and is writable. The guineapig is attached.
>         Anyone has any
>         idea?
>
>         Thanks,
>
>         Sourish
>

Attachment: signature.asc
Description: OpenPGP digital signature

  • 2019 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: