Menu

ncrcat strtol error

Help
2016-03-09
2016-03-10
  • Matthew Thompson

    All,

    I tried to use ncrcat today and it threw an error:

    (1959) $ ncrcat stock-G41-1day-c48.geosgcm_prog.20000415_0000z.nc4 stock-G41-1day-c48.geosgcm_prog.20000415_0600z.nc4 test.nc4
    ncrcat: INFO/WARNING Multi-file concatenator encountered packing attribute scale_factor for variable H. NCO copies the packing attributes from the first file to the output file. The packing attributes from the remaining files must match exactly those in the first file or data from subsequent files will not unpack correctly. Be sure all input files share the same packing attributes. If in doubt, unpack (with ncpdq -U) the input files, then concatenate them, then pack the result (with ncpdq). This message is printed only once per invocation.
    ncrcat: WARNING cvs_vrs_prs() reports nco_sng_ptr == NULL
    nco_sng_cnv_err(): ERROR an NCO function or main program attempted to convert the user-defined string "-Baselibs-" to an integer-type using the standard C-library function "strtol()". This function stopped converting the input string when it encountered the illegal (i.e., non-numeric or non-integer) character '-'. This probably indicates a syntax error by the user. Please check the argument syntax and re-try the command. Exiting...
    nco_err_exit(): ERROR Short NCO-generated message (usually name of function that triggered error): nco_sng_cnv_err()
    nco_err_exit(): ERROR Error code is 0. This indicates an error occurred in NCO code or in a system call, not in the netCDF layer.
    nco_err_exit(): ERROR NCO will now exit with system call exit(EXIT_FAILURE)
    

    Now, I'm confused by the "-Baselibs-" bit. There is no reference to Baselibs at all inside the NC4 files:

    (1980) $ ncdump  stock-G41-1day-c48.geosgcm_prog.20000415_0000z.nc4 | grep -i base
    (1981) $  
    

    Now, ncrcat was compiled inside of GMAO-Baselibs-5_0_0 and the compilation seemed fine. ncks works in a small test of compression and the like.

    Did a directory path get pushed inside ncrcat? If I do strings on the executable, I do see it a couple times. One is the location of my udunits2.xml file and the others seem to be in a copy of the HDF5 Configuration.

    Any ideas?

    Matt

     
  • Matthew Thompson

    Grah. Okay, I know how to work around it. It seems to be an issue with the history global attribute bit. If I add '-h':

    (2011) $ ncrcat -h stock-G41-1day-c48.geosgcm_prog.20000415_0000z.nc4 stock-G41-1day-c48.geosgcm_prog.20000415_0600z.nc4 test.nc4
    ncrcat: INFO/WARNING Multi-file concatenator encountered packing attribute scale_factor for variable H. NCO copies the packing attributes from the first file to the output file. The packing attributes from the remaining files must match exactly those in the first file or data from subsequent files will not unpack correctly. Be sure all input files share the same packing attributes. If in doubt, unpack (with ncpdq -U) the input files, then concatenate them, then pack the result (with ncpdq). This message is printed only once per invocation.
    

    But...why would I trigger it? Is it seeing "GMAO-Baselibs-5_0_0" (probably in the full path to ncrcat/ncra) and trying to do math?

     
  • Charlie Zender

    Charlie Zender - 2016-03-09

    Hi Matthew,
    This is strange, though it's pretty clear that somehow your build environment infected the VERSION token that NCO uses and prints with ncrcat (and other operators) unless the -h option is supplied. I've just renamed that NCO_VERSION to prevent future occurances (in 4.5.6). My guess is that if you re-build 4.5.5 while your VERSION environment variable is empty then these problems will go away.
    cz

     
  • Matthew Thompson

    Huh. I took a look and the config.log doesn't show that:

    PACKAGE_VERSION='4.5.5'
    VERSION='4.5.5'
    #define PACKAGE_VERSION "4.5.5"
    #define VERSION "4.5.5"
    #define MAKEINFO_VERSION ${MAKEINFO_VERSION}
    

    If anything, VERSION should be 5.0.0 if I'm infecting...

    But, long ago I did make a script that tries to "auto-figure-out" the versions of the libraries I'm building and put those values in an etc/ directory file. I wonder if GNU Make is doing its usual magic of exporting only those variables you don't want while making you spend ten days to figure out how to get the one you do want!

     
  • Charlie Zender

    Charlie Zender - 2016-03-10

    well if you have a chance to build the current snapshot please do and let me know if you still get the funny business that started this thread. thanks!
    cz

     

Log in to post a comment.