nco 4.0.7 fails

Developers
2011-04-08
2013-10-17
  • Barry McInnes
    Barry McInnes
    2011-04-08

    On RedHat Enterprise, nco 4.0.0 (netcdf 4.1.1) runs  (see below), but 4.0.7 with netcdf 4.1.2 with the same config, gives the following error

    src/nco/.libs/ncks -O -F -D 9 -v three_dmn_rec_var -d time,1,10,5 http://motherlode.ucar.edu:8080/thredds/dodsC/testdods/in.nc ~/foo.nc
    ncks: INFO DAP access to http://motherlode.ucar.edu:8080/thredds/dodsC/testdods/in.nc failed: Server does not respond, file does not exist, or user does not have read permission
    ncks: INFO Will first attempt to find on local disk and, if unsuccessful, will then attempt retrieve remote file to local client using wget
    ncks: INFO stat() #1 failed: /thredds/dodsC/testdods/in.nc does not exist
    ncks: WARNING not searching for http://motherlode.ucar.edu:8080/thredds/dodsC/testdods/in.nc on remote filesystem, using local file hredds/dodsC/testdods/in.nc instead
    ERROR NC_ENOTNC Not a netCDF file
    HINT: NC_ENOTNC errors will occur when NCO operators linked to the netCDF3 library attempt to read netCDF4 files.  Are your input files netCDF4 format?  (http://nco.sf.net/nco.html#fmt_inq shows how to tell.) If so then installing or re-building a netCDF4-compatible version of NCO should solve this problem.
    nco_err_exit(): ERROR Short NCO-generated message (usually name of function that triggered error): nco_open()
    nco_err_exit(): ERROR Error code is -51. Translation into English with nc_strerror(-51) is "NetCDF: Unknown file format"
    nco_err_exit(): ERROR NCO will now exit with system call exit(EXIT_FAILURE)
    # ncks -O -F -D 9 -v three_dmn_rec_var -d time,1,10,5 http://motherlode.ucar.edu:8080/thredds/dodsC/testdods/in.nc ~/foo.nc
    ncks: CONVENTION File "Conventions" attribute is "CF-1.0"
    Dimension hyperslabber nco_lmt_evl() diagnostics:
    Dimension name = time
    Limit type is zero-based dimension index
    Limit is user-specified
    Limit is record dimension
    Current file is required by specified hyperslab, data will be read
    min_sng = 1
    max_sng = 10
    srd_sng = 5
    min_val = 0
    max_val = 0
    min_idx = 0
    max_idx = 9
    srt = 0
    end = 9
    cnt = 2
    srd = 5

    ncks: nco_fl_out_open() reports sizeof(pid_t) = 4 bytes, pid = 14767, pid_sng_lng = 6 bytes, strlen(pid_sng) = 5 bytes, fl_out_tmp_lng = 31 bytes, strlen(fl_out_tmp) = 30, fl_out_tmp = /root/foo.nc.pid14767.ncks.tmp
    ncks: TIMER Metadata setup and file layout before main loop took    0.12 s
    lat, lon, three_dmn_rec_var, Segmentation fault

     
  • Charlie Zender
    Charlie Zender
    2011-04-08

    i cannot reproduce the problem you are experiencing.
    the command you are testing did fail, in the past, and was used
    by me to the DAP server because it was a DAP server
    problem not an NCO problem per se (because it worked on local
    files and failed on DAP files). the problem was fixed, either
    by changing the DAP server or linking NCO to a newer DAP
    library, i'm not sure which, by february 2011. i cannot explain
    why it fails for you with the newest nco and netcdf.
    except that i have not tried ncetcdf 4.1.2 yet.
    when i do, i will re-test this command.

    nco 4.0.7 on my x86 ubuntu laptop works fine:

    zender@neige:~$ ncks -lbr
    Linked to netCDF library version 4.1.2-beta2-snapshot2010101108, compiled Oct 13 2010 16:34:59
    zender@neige:~$ ncks -O -F -D 9 -v three_dmn_rec_var -d time,1,10,5 http://motherlode.ucar.edu:8080/thredds/dodsC/testdods/in.nc ~/foo.nc
    ncks: INFO nco_fl_mk_lcl() successfully accessed this file using the DAP protocol
    ncks: CONVENTION File "Conventions" attribute is "CF-1.0"
    Dimension hyperslabber nco_lmt_evl() diagnostics:
    Dimension name = time
    Limit type is one-based dimension index
    Limit is user-specified
    Limit is record dimension
    Current file is required by specified hyperslab, data will be read
    min_sng = 1
    max_sng = 10
    srd_sng = 5
    monotonic_direction = decreasing
    min_val = 0
    max_val = 0
    min_idx = 0
    max_idx = 9
    srt = 0
    end = 9
    cnt = 2
    srd = 5
    WRP = NO
    SRD = YES
    no_data = False

    ncks: nco_fl_out_open() reports sizeof(pid_t) = 4 bytes, pid = 357, pid_sng_lng = 4 bytes, strlen(pid_sng) = 3 bytes, fl_out_tmp_lng = 36 bytes, strlen(fl_out_tmp) = 35, fl_out_tmp = /home/zender/foo.nc.pid357.ncks.tmp
    ncks: INFO cvs_vrs_prs() reports dlr_ptr == NULL
    ncks: HINT Make sure CVS export uses -kkv
    ncks: INFO cvs_vrs_prs() reports cvs_nm_ptr == NULL
    ncks: HINT Make sure CVS export uses -kkv
    ncks: INFO nco_aed_prc() examining variable Global
    ncks: TIMER Metadata setup and file layout before main loop took    0.22 s
    lat, lon, three_dmn_rec_var, time, ncks: INFO Moving /home/zender/foo.nc.pid357.ncks.tmp to /home/zender/foo.nc…done
    ncks: TIMER Wallclock-elapsed time for command is    0.23 s
    zender@neige:~$

     
  • Barry McInnes
    Barry McInnes
    2011-04-12

    Thanks for the reply. It works for local tests with slightly different output on Mac and RH Enterprise using netcdf 4.1.2
    Linux 4.0.7

    batchb.psd.esrl.noaa.gov{bmcinnes} 119: src/nco/.libs/ncks -m http://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/ncep.reanalysis.dailyavgs/surface/pres.sfc.1969.nc
    lat: type NC_FLOAT, 1 dimension, 5 attributes, chunked? no, compressed? no, packed? no, ID = 0
    lat RAM size is 73*sizeof(NC_FLOAT) = 73*4 = 292 bytes
    lat dimension 0: lat, size = 73 NC_FLOAT, dim. ID = 1 (CRD)
    lat attribute 0: units, size = 13 NC_CHAR, value = degrees_north
    lat attribute 1: actual_range, size = 2 NC_FLOAT, value = 90, -90
    lat attribute 2: long_name, size = 8 NC_CHAR, value = Latitude
    lat attribute 3: standard_name, size = 8 NC_CHAR, value = latitude
    lat attribute 4: axis, size = 1 NC_CHAR, value = Y

    Mac 10.6.7, nco 4.0.7

    ncks -m  http://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/ncep.reanalysis.dailyavgs/surface/pres.sfc.1969.nc
    lat: type NC_FLOAT, 1 dimension, 5 attributes, chunked? no, compressed? no, packed? no, ID = 0
    lat RAM size is 73*sizeof(NC_FLOAT) = 73*4 = 292 bytes
    lat dimension 0: lat, size = 73 NC_FLOAT, dim. ID = 1 (CRD)
    lat attribute 0: units, size = 13 NC_CHAR, value = degrees_north
    lat attribute 1: actual_range, size = 2 NC_FLOAT, value = 90, -90
    lat attribute 2: long_name, size = 8 NC_CHAR, value = Latitude
    lat attribute 3: standard_name, size = 8 NC_CHAR, value = latitude
    lat attribute 4: axis, size = 1 NC_CHAR, value = Y

    Linux nco 4.0.7

    batchb.psd.esrl.noaa.gov{bmcinnes} 120: ncks -m http://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/ncep.reanalysis.dailyavgs/surface/pres.sfc.1969.nc
    lat: # dim. = 1, NC_FLOAT, # att. = 5, ID = 0
    lat dimension 0: lat, size = 73 NC_FLOAT, dim. ID = 1 (CRD)
    lat RAM size is 73*nco_typ_lng(NC_FLOAT) = 73*4 = 292 bytes
    lat attribute 0: units, size = 13 NC_CHAR, value = degrees_north
    lat attribute 1: actual_range, size = 2 NC_FLOAT, value = 90, -90
    lat attribute 2: long_name, size = 8 NC_CHAR, value = Latitude
    lat attribute 3: standard_name, size = 8 NC_CHAR, value = latitude
    lat attribute 4: axis, size = 1 NC_CHAR, value = Y

     
  • Barry McInnes
    Barry McInnes
    2011-04-12

    The last example  header is incorrect - its should be Linux nco 4.0.0 using netcdf 4.1.1, not nco 4.0.7