#5 bounds attribut should not be treated by ncecat

closed
None
5
2012-05-16
2012-05-16
Brockmann
No

Hi,

I am working with ensemble members output from CMIP5 exercice.
First step is to concatenate the output on a record dimension.

Unfortunately, ncecat at release 4.1.0 does the concatenation
on auxillary bound coordinates.

ncecat -Oh file1.nc file2.nc file3.nc out.nc

Below extract of the result output file:
...
double lon(lon) ;
lon:bounds = "lon_bnds" ;
lon:units = "degrees_east" ;
lon:axis = "X" ;
lon:long_name = "longitude" ;
lon:standard_name = "longitude" ;
double lon_bnds(record, lon, bnds) ;
...

--> the variable lon_bnds should not have been concatenate
along the record dimension. Same for other variables such
as lat_bounds. In fact all, auxillary bounds coordinates should
not be treated by ncecat. Note that ncecat does not process
the coordinate variables such as lon(lon) or lat(lat) as it should.

Let me know if I have missed something about this topic.
Regards

Patrick
--
LSCE/IPSL, Laboratoire CEA-CNRS-UVSQ
Data Analysis and Visualization Engineer
ICMC - IPSL Climate Modelling Centre
--

Discussion

  • Charlie Zender
    Charlie Zender
    2012-05-16

    • assigned_to: nobody --> zender
    • status: open --> closed
     
  • Charlie Zender
    Charlie Zender
    2012-05-16

    Thanks for the suggestion.
    Ask and ye shall receive.
    This required only a three-line patch, now committed to the main trunk.
    Works for me. Please test if possible.
    Will be in next release.
    From the ChangeLog:
    * ncecat no longer glues a record dimension to any auxiliary
    coordinate variables (latixy, longxy, ...) or bounds (lat_bnds,
    lon_bnds, ...). These are variables specified in the "coordinates"
    or "bounds" attribute, respectively. Note that regular (1D)
    coordinate variables (lat, lon, time) may also be listed as
    auxiliary coordinate variables. But ncecat never added a record
    dimension to "normal" 1D coordinates. Thanks to Pat Brock for this
    suggestion.

    zender@roulee:~/nco/src/nco$ ncecat -O -v lat,one -p ~/nco/data in.nc in.nc ~/foo.nc
    zender@roulee:~/nco/src/nco$ ncks ~/foo.nc
    Opened file /home/zender/foo.nc: dimensions = 3, variables = 3, global atts. = 5, ID = 65536, type = NC_FORMAT_CLASSIC
    Record dimension: name = record, size = 2

    Global attribute 0: Conventions, size = 6 NC_CHAR, value = CF-1.0
    Global attribute 1: history, size = 131 NC_CHAR, value = Wed May 16 08:50:27 2012: ncecat -O -v lat,one -p /home/zender/nco/data in.nc in.nc /home/zender/foo.nc
    History global attribute.

    Global attribute 2: julian_day, size = 1 NC_DOUBLE, value = 200000.04
    Global attribute 3: RCS_Header, size = 8 NC_CHAR, value = $Header$
    Global attribute 4: nco_openmp_thread_number, size = 1 NC_INT, value = 1

    lat: type NC_FLOAT, 1 dimension, 3 attributes, chunked? no, compressed? no, packed? no, ID = 0
    lat size (in RAM) is 2*sizeof(NC_FLOAT) = 2*4 = 8 bytes
    lat dimension 0: lat, size = 2 NC_FLOAT, dim. ID = 0 (CRD)
    lat attribute 0: long_name, size = 30 NC_CHAR, value = Latitude (typically midpoints)
    lat attribute 1: units, size = 13 NC_CHAR, value = degrees_north
    lat attribute 2: bounds, size = 7 NC_CHAR, value = lat_bnd

    lat_bnd: type NC_FLOAT, 2 dimensions, 1 attribute, chunked? no, compressed? no, packed? no, ID = 1
    lat_bnd size (in RAM) is 2*2*sizeof(NC_FLOAT) = 4*4 = 16 bytes
    lat_bnd dimension 0: lat, size = 2 NC_FLOAT, dim. ID = 0 (CRD)
    lat_bnd dimension 1: vrt_nbr, size = 2, dim. ID = 1
    lat_bnd attribute 0: purpose, size = 34 NC_CHAR, value = Cell boundaries for lat coordinate

    one: type NC_FLOAT, 1 dimension, 1 attribute, chunked? no, compressed? no, packed? no, ID = 2
    one size (in RAM) is 2*sizeof(NC_FLOAT) = 2*4 = 8 bytes
    one dimension 0: record, size = 2, dim. ID = 2(REC)
    one attribute 0: long_name, size = 3 NC_CHAR, value = one

    lat[0]=-90 degrees_north
    lat[1]=90 degrees_north

    lat[0]=-90 vrt_nbr[0] lat_bnd[0]=-90
    lat[0]=-90 vrt_nbr[1] lat_bnd[1]=0
    lat[1]=90 vrt_nbr[0] lat_bnd[2]=0
    lat[1]=90 vrt_nbr[1] lat_bnd[3]=90

    record[0] one[0]=1
    record[1] one[1]=1

    zender@roulee:~/nco/src/nco$

     
  • Charlie Zender
    Charlie Zender
    2012-11-02

    Note that this is a feature request not a bug because it requests new special treatment of metadata conventions (CF bounds), and NCO has never claimed to fully support CF.