[ncl-talk] writing netcdf file creating redundant dimensions
Mary Haley
haley at ucar.edu
Wed Mar 9 13:32:59 MST 2016
Ashish,
All variables in a NetCDF are required to have a name for every dimension.
If you don't provide any names for these dimensions, then NCL will add them
for you, starting with "ncl1", "ncl2", etc.
You didn't include any information on how this file was being written, but
my guess is that you are writing some variables that have no dimension
names. My suggestion is to name the dimension of every single variable you
plan to write to the file, and use consistent names.
I've attached a sample NCL script that writes three variables to a file.
"x" and "y" are arrays with named dimensions, and "z" has none. Note what
happens in the NetCDF file when you write these three variables to the file.
--Mary
On Mon, Mar 7, 2016 at 3:17 PM, Ashish Sharma <asharma7 at nd.edu> wrote:
> Hello,
>
>
> When I write a netcdf file, I am getting a lot of extra dimensions
> generated which are redundant (e.g. ncl3, ncl4, ncl5....and so on).
> How do I get rid of them? See ncdump:
>
> dimensions:
>
> Time = UNLIMITED ; // (3 currently)
>
> south_north = 240 ;
>
> west_east = 432 ;
>
> ncl3 = 3 ;
>
> ncl4 = 240 ;
>
> ncl5 = 3 ;
>
> ncl6 = 432 ;
>
> ncl7 = 3 ;
>
> ncl8 = 240 ;
>
> ncl9 = 432 ;
>
> ncl10 = 3 ;
>
> ncl11 = 240 ;
>
> ncl12 = 432 ;
>
> ncl13 = 3 ;
>
> ncl14 = 240 ;
>
> ncl15 = 432 ;
>
> ncl16 = 3 ;
>
> ncl17 = 240 ;
>
> ncl18 = 432 ;
>
> variables:
>
> float LAT(Time, south_north) ;
>
> LAT:_FillValue = 9.96921e+36f ;
>
> float LON(Time, west_east) ;
>
> LON:_FillValue = 9.96921e+36f ;
>
> float T2_MAX(Time, south_north, west_east) ;
>
> T2_MAX:_FillValue = -9999.f ;
>
> float T2_MIN(Time, south_north, west_east) ;
>
> T2_MIN:_FillValue = -9999.f ;
>
> float PRECIP(Time, south_north, west_east) ;
>
> PRECIP:_FillValue = -9999.f ;
>
> float WIND(Time, south_north, west_east) ;
>
> WIND:_FillValu
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160309/68195d9b/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: writenc.ncl
Type: application/octet-stream
Size: 472 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160309/68195d9b/attachment.obj
More information about the ncl-talk
mailing list