Menu

#105 ncks ignores user-specified chunk size

None
closed-invalid
None
5
2018-03-12
2018-03-10
Rostislav
No

$ ncks --version
NCO netCDF Operators version 4.5.4 built by buildd on lgw01-02 at Jan 28 2016 22:33:25
ncks version "4.5.4"

I want to have a file that is chunked by 2D fields. I do

$ ncks -4 -L9 --cnk_dmn time,1 in200x200.nc in200x200.nc4

The command generates a file with the main variable chunked  like
CO:_ChunkSizes = 80, 114, 114
Is it a bug or a feature?

Thank you!

2 Attachments

Discussion

  • Charlie Zender

    Charlie Zender - 2018-03-12
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,3 @@
    -
     $ ncks --version
     NCO netCDF Operators version 4.5.4 built by buildd on lgw01-02 at Jan 28 2016 22:33:25
     ncks version "4.5.4"
    
    • status: open --> closed-invalid
    • assigned_to: Charlie Zender
    • Group: -->
     
  • Charlie Zender

    Charlie Zender - 2018-03-12

    Maybe it's just a poor API or bad documentation. Thank you for reporting. The rd1 chunk map does what you want:
    ncks -O -4 -L9 --cnk_map rd1 in200x200.nc in200x200.nc4
    To get NCO to use the explicitly set chunk sizes for each dimension, use --cnk_map=dmn
    ncks -O -4 -L9 --cnk_map=dmn --cnk_dmn time,1 in200x200.nc in200x200.nc4
    This also results in the chunking you want.

     
  • Rostislav

    Rostislav - 2018-03-12

    Thank you (also fot the great toolset)! That works.
    I believe that ignoring of an option explicitly specified by a user is an excuse for at least a big warning. Indeed, I would make a program to apply --cnk_map=dmn if any of --cnk_dmn is specified and no cnk_map explicitly requested. If both are specified, then exit with error is a valid option. Then the behaviour of the program would be more understandable...

    BTW, your diff loks like a removal of an empty line. Is it what you intended to do?

     
    • Charlie Zender

      Charlie Zender - 2018-03-12

      I agree. It's not intuitive. We'll try to change it as you suggest. Ignore the diff, I don't know what that's about.

       
  • Rostislav

    Rostislav - 2018-03-12

    :) Thank you!

     

Log in to post a comment.

MongoDB Logo MongoDB