Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Averaging data in a time period spread across multiple input files

Help
Joe Hamman
2013-11-13
2013-11-14
  • Joe Hamman
    Joe Hamman
    2013-11-13

    I'm having trouble using ncra across multiple files.

    $ ncra -d time,"1992-05-03","1992-05-07" r21RBR1a.vic.ha.1992-05-* test.nc
    ncra: ERROR No records lay within specified hyperslab
    

    To prove that there is at lease one record that falls within the hyperslab:

    $ ncdump -c -t r21RBR1a.vic.ha.1992-05-05.nc 
    ...
    netcdf r21RBR1a.vic.ha.1992-05-05 {
    dimensions:
        time = UNLIMITED ; // (1 currently)
        depth = 3 ;
        x = 275 ;
        y = 205 ;
    variables:    
    ...
    double time(time) ;
            time:units = "days since 0001-1-1 0:0:0" ;
        time:long_name = "time" ;
        time:dimensions = "1" ;
        time:calendar = "noleap" ;
    ...
    variables: 
        time = "1992-05-06" ;
    

    I've confirmed a few things:

    $ echo $UDUNITS2_XML_PATH
    /app/netcdf/platform/x86_64/udunits-2.1.24_gcc/share/udunits/udunits2.xml
    $ which udunits2
    /app/netcdf/platform/x86_64/udunits-2.1.24_gcc/bin/udunits2
    $ ncks --version
    NCO netCDF Operators version "4.3.1" last modified 2013/04/30 built Jun 26 2013 on spirit07 by netcdf
    ncks version 4.3.1
    

    My initial thought was that I was ncra was having trouble accessing UDUNITS2 but now I'm not sure what's going on. Am I missing something major here? I've gotten this behavior on both RHEL and MacOS 10.8/10.9.

    Reference: http://nco.sourceforge.net/nco.html#UDUnits-Support

    Thanks,

    Joe

     
  • Charlie Zender
    Charlie Zender
    2013-11-13

    Hello Joe,
    I am unable to reproduce the problem you are having.
    See below for diagnostic tests that work (with ncrcat instead of ncra).
    Suggest you:
    1. Upgrade to 4.3.8
    2. Start with one file, make sure it works...
    3. If preceding steps fail, please post a complete bug report.
    Good luck,
    c

    zender@roulee:~/nco/bld$ ncrcat -O -D 0 -v time -d time,1964-03-14,1964-03-16 -p ~/nco/data in.nc ~/foo.nc
    zender@roulee:~/nco/bld$ ncks -u -H ~/foo.nc
    time[0]=2 days since 1964-03-12 12:09:00 -9:00
    time[1]=3 days since 1964-03-12 12:09:00 -9:00

    time[0]=2 vrt_nbr[0] time_bnds[0]=1.5
    time[0]=2 vrt_nbr[1] time_bnds[1]=2.5
    time[1]=3 vrt_nbr[0] time_bnds[2]=2.5
    time[1]=3 vrt_nbr[1] time_bnds[3]=3.5

     
  • Joe Hamman
    Joe Hamman
    2013-11-14

    Thanks Charlie,

    Our sys admin put 4.3.7 on my machine and it seems to be working now. I'm still having this issue with my macports installation (also 4.3.7) but not that I know this works, I'm guessing that's not NCO.

     
  • Charlie Zender
    Charlie Zender
    2013-11-14

    glad it's (partially) working for you now. this is a crucial feature for NCO and we have spent and will spend any amount of time to get it right. be sure your macports has udunits enabled. that could explain the difference.
    cz