# Chunk size in netcdf files

**URL:** <https://nemo-ocean.discourse.group/t/chunk-size-in-netcdf-files/717>\
**Category:** Uncategorized\
**Tags:** XIOS\
**Created:** [28 June 2024 16:15 UTC](https://nemo-ocean.discourse.group/t/chunk-size-in-netcdf-files/717 "2024-06-28T16:15:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luc](https://avatars.discourse-cdn.com/v4/letter/l/9dc877/32.png) [@Luc](https://nemo-ocean.discourse.group/u/Luc)\
**Post date:** [28 June 2024 16:15 UTC](https://nemo-ocean.discourse.group/t/chunk-size-in-netcdf-files/717/1 "2024-06-28T16:15:25Z")

</div>

Dear all,  
I realize this may be more of a XIOS question than a NEMO one, but maybe somebody knows a simple answer.  
With XIOS 2 (or 2.5), is it possible to choose the chunk size in the netcdf files ?  
By default, the chunksize is equal to the grid size, and I would like to make smaller chunks.  
With XIOS3 it seems possible, [https://sites.nemo-ocean.io/draft-guide/xios3demo.html#chunking-and-compression](https://sites.nemo-ocean.io/draft-guide/xios3demo.html#chunking-and-compression)  
Thanks,  
Luc

---

<div class="post-metadata">

**Author:** ![acc](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@acc](https://nemo-ocean.discourse.group/u/acc)\
**Post date:** [4 July 2024 16:33 UTC](https://nemo-ocean.discourse.group/t/chunk-size-in-netcdf-files/717/2 "2024-07-04T16:33:17Z")

</div>

I don’t think the user had any control over chunksizes in XIOS2. That’s mostly guesswork since it is poorly documented, but the code in `src/io/onetcdf4.cpp` contains the comment:

```auto
            // set chunksize : size of one record
            // but must not be > 2GB (netcdf or HDF5 problem)

```

and the code around that doesn’t appear to offer any choice other than `dimsizes`. It wasn’t so much of an issue with XIOS2 because we tended to use multiple\_file o/p for the larger models and rechunk at the rebuilding stage. It might be worth posting a query (issue) on the xios site: [https://forge.ipsl.jussieu.fr/ioserver/](https://forge.ipsl.jussieu.fr/ioserver/) in case there is more subtlety in the C++ code than I’m seeing.
