[Thread Prev][Thread Next][Index]

Re: [ferret_users] netcdf error code 57



Hi Saurabh,

It sounds as if there was some unexpected state, which resulted in Ferret making an incorrect call to the netCDF library when trying to read data.

If I ran into this error, I would compare the result of "show data" with the output of "ncdump -h".  Does Ferret seem to have initialized the dataset with grids that match the dimensions and axis directions that are shown in the ncdump header?  Also look at the output of "show grid variable" for the variable you are trying to work with, and "show axis" for the axes in that grid and see if they are what you would expect.

It would be interesting to see whether these results are the same when looking at the original file and the file you created when you extracted just the variable into a new file.

Ferret/PyFerret reads in the metadata (dimensions, attributes) from a file and tries to construct grids. Sometimes there is not enough information to do this unambiguously and it makes assumptions.  This is why sometimes we get the error "**ERROR: inconsistent data grids: File needs axis attributes on coordinate variables indicating correct directions" which others have asked about.  I wonder if something similar this has happened with your file, but which did not trigger the inconsistent grids error.

Ansley

On 2/20/2022 10:59 PM, saurabh rathore wrote:
Hi Ryo,
Thank you for your reply just now I ran the code again and saved the NetCDF files and they are looking good without the error. I do not understand was it due to the ferret crashing problem or related to saving the NetCDF but it is solved now. And interestingly after generating the NetCDF file from ferret which shows the error works fine if I extract the variable and save it using CDO. So anyone facing such a problem can do either of these steps

(1) Close ferret and the related linux terminals and relaunch ferret

OR if the problem still persists

(2) Use CDO, extract the variable using "selvar" and save it into NetCDF (cdo -r -f nc4 selvar,variable_name input.nc output.nc)

Cheers, Saurabh

On Mon, Feb 21, 2022 at 7:47 AM Ryo Furue <furue@xxxxxxxxxx> wrote:
Saurabh,

 I am writing this email regarding a problem that I am running into as shown below

**netCDF error
             NetCDF: Start+count exceeds dimension bound (OPeNDAP/netCDF Error code -57)

Is it possible that the netCDF file is corrupted?  My best guess is that there are more gridpoints in the dimension variable than there are in the variable (array).  For example, say, your longitude grid has 100 points but your temperature field has only 50 points in the longitudinal direction . . .

The error message you quote above is from the netCDF library, which occurs when you try to access the index of a variable beyond the maximum.  But, what I don't know is, what makes Ferret do so.

It's not easy for me to test it because the main tools I use to create netCDF files (Ferret and Julia) avoid such inconsistencies in the first place.

Cheers,

Ryo



--


REGARDS

Saurabh Rathore
Research Scholar (PhD.)
Centre For Oceans, Rivers, Atmosphere & Land Science Technology
Indian Institute Of Technology, Kharagpur
contact :- 91- 8345984434

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement