[ncl-install] Zero length dimension errors

Mary Haley haley at ucar.edu
Wed Apr 20 08:41:11 MDT 2016


Hi Cindy,

To answer your original question, yes, these kind of questions should
normally be posted to ncl-talk, which has far more subscribers than this
installation list, but I can answer here.

I tried to do an "ncdump" on the NetCDF file you attached, but it told me
it was an unknown file format.

I then did a UNIX "file" on it and it said it was an HDF4 data file:

file test_0001.nc
test_0001.nc: Hierarchical Data Format (version 4) data

I then used an "ncl_filedump" trick to make it think it was opening an HDF
file:

ncl_filedump test_0001.nc.hdf4

I got quite a bit of valid output, but the "ocean_time" dimension was 0,
which is why you are seeing the error about a "zero length dimension"
I think the problem may be with ncgen and your CDL file, because when run
ncgen on it, the ocean_time dimension gets set to zero. This is not allowed
by NCL, to have 0-length dimensions, and hence the error.

Please note that "ncgen" is NOT part of the NCL software package. This is
part of the NCO software suite developed by Charlie Zender at UC-Irvine.

I think you need to look at your CDL file and fix the problem with the
0-length time dimension.

--Mary







On Tue, Apr 19, 2016 at 1:00 PM, Crooks, Cynthia J <cynthia.crooks at bp.com>
wrote:

> I just realized that I probably should have included the cdl file and the
> output nc file.
>
>
>
> Cindy
>
>
>
> *From:* ncl-install-bounces at ucar.edu [mailto:ncl-install-bounces at ucar.edu]
> *On Behalf Of *Crooks, Cynthia J
> *Sent:* Tuesday, April 19, 2016 9:54 AM
> *To:* ncl-install at ucar.edu
> *Subject:* [ncl-install] Zero length dimension errors
>
>
>
> I recently compiled ncl_ncarg-6.3.0 for one of our users.  She has written
> the ncl script below:
>
>
>
> ; NCL script to time interpolate hycom to 1 hour time interval
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>
> ;load "/usr/lib/ncarg/nclscripts/csm/contributed.ncl"
>
>
>
> setfileoption("nc","Format","LargeFile")
>
>
>
> ii=2
>
> fileno_in=sprintf("%04.0f",ii)
>
> iii=ii-1
>
> fileno_out=sprintf("%04.0f",iii)
>
>
>
> file_out = "/lustre04/vol0/crookscj/ncl/reems/test_"+fileno_out+".nc"
>
> file_in =
> "/lustre04/vol0/crookscj/ncl/reems/SV_tides_100m_his_"+fileno_in+".nc"
>
> file_time =
> "/lustre04/vol0/crookscj/ncl/reems/SV_tides_500m_his_"+fileno_in+".nc"
>
>
>
> fin = addfile(file_in,"r")
>
> ftime = addfile(file_time,"r")
>
>
>
> system("ncgen -o "+file_out+" SV_his.cdl")
>
> out = addfile(file_out,"w")
>
>
>
> The script appears to work until the last statement which generates the
> “Zero length dimension” errors.  She has checked the file created by
> “ncgen” and feels it is correct.  She has looked through the FAQ and did
> not find anything she felt was helpful.
>
>
>
> We are wondering if I have missed something in the compile steps or
> setting up the user environment.   I have attached a copy of the script, a
> log file with the error messages and a file with the steps I took to
> compile the software.  I have also attached the lua module file which sets
> the environment.
>
>
>
> I am trying to collect the data and rewrite the script so that everything
> would be contained in the current directory.
>
>
>
> Please let me know if this should be more appropriately posted to ncl-talk.
>
>
>
> Thanks for your help.
>
>
>
> Cindy
>
> _______________________________________________
> ncl-install mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-install
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-install/attachments/20160420/4812d5b4/attachment.html 


More information about the ncl-install mailing list