[Thread Prev][Thread Next][Index]

Re: [ferret_users] error regarding saving netcdf file with index exceeds dimension Error Code - 40



Hi,

When appending to an existing file, the coordinates of the variable need to match the coordinate variables in the file (except for the time dimension where you can append more timesteps to an existing time axis). The error message is saying that the grid of the data you're trying to write doesn't match what's in the file, in one or more dimensions.  Look at the grid of  your variable temp[gz=zax]  and see if it has the same coordinates as coordinates in the file. 

A good way to check what's going on would be to write your new variable to a new file, and compare the coordinate variables with what's in your file rg-plus-cli.nc

   list/format=cdf/clobber/file=test_file.nc temp[gz=zax]

and look at the ncdump -h of both files. 

By the way, look at the variable name in test_file.nc.  You are writing an _expression_, temp[gz=zax], and so the variable in the file won't be "temp", it'll be some kind of name generated by Ferret.  Better to define a variable with units and a title.  If you are working with a file variable with the name temp, and you want to define a new variable also named temp:


yes? set variable/name=temp_in temp    ! rename the variable (just in this session)
yes? let/title="temperature"/units="Deg C" temp = temp_in[gz=zax]
yes? save...


Ansley


On 1/17/2021 8:42 PM, saurabh rathore wrote:
Dear Ferreters,
G'day

I am encountering an error with Error Code - 40. I have 210 time steps that I want to save in a Netcdf file but I don't know why I am getting this error and I am unable to rectify it. Any help will be appreciated.

NetCDF: Index exceeds dimension bound (OPeNDAP/netCDF Error code - 40)
 failure writing to CDF output file
LIST/FORMAT=CDF/append/file=rg-plus-cli.nc temp[gz=zax]
Command file, command group, or REPEAT execution aborted
Executed by script: *** GO rg-plus-cli.jnl ***

Thanks in advance
Cheers, Saurabh


--


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