@@ -723,8 +723,7 @@ static hid_t nxToHDF5Type(int datatype)
723
723
return NX_ERROR ;
724
724
}
725
725
H5Pset_deflate (cparms ,compress_level );
726
- iRet = H5Dcreate (pFile -> iCurrentG , (char * )name , datatype1 ,
727
- dataspace , cparms );
726
+ iRet = H5Dcreate (pFile -> iCurrentG , (char * )name , datatype1 , dataspace , cparms );
728
727
}
729
728
else if (compress_type == NX_COMP_NONE )
730
729
{
@@ -734,25 +733,33 @@ static hid_t nxToHDF5Type(int datatype)
734
733
iNew = H5Pset_chunk (cparms ,rank ,chunkdims );
735
734
if (iNew < 0 )
736
735
{
737
- NXIReportError (NXpData ,
738
- "ERROR: Size of chunks could not be set!" );
736
+ NXIReportError (NXpData , "ERROR: Size of chunks could not be set!" );
739
737
return NX_ERROR ;
740
738
}
741
- iRet = H5Dcreate (pFile -> iCurrentG , (char * )name , datatype1 ,
742
- dataspace , cparms );
739
+ iRet = H5Dcreate (pFile -> iCurrentG , (char * )name , datatype1 , dataspace , cparms );
743
740
}
744
741
else
745
742
{
746
- iRet = H5Dcreate (pFile -> iCurrentG , (char * )name , datatype1 ,
747
- dataspace , H5P_DEFAULT );
743
+ iRet = H5Dcreate (pFile -> iCurrentG , (char * )name , datatype1 , dataspace , H5P_DEFAULT );
748
744
}
749
745
}
746
+ else if (compress_type == NX_CHUNK )
747
+ {
748
+ cparms = H5Pcreate (H5P_DATASET_CREATE );
749
+ iNew = H5Pset_chunk (cparms ,rank ,chunkdims );
750
+ if (iNew < 0 )
751
+ {
752
+ NXIReportError (NXpData , "ERROR: Size of chunks could not be set!" );
753
+ return NX_ERROR ;
754
+ }
755
+ iRet = H5Dcreate (pFile -> iCurrentG , (char * )name , datatype1 , dataspace , cparms );
756
+
757
+ }
750
758
else
751
759
{
752
760
NXIReportError (NXpData ,
753
761
"HDF5 doesn't support selected compression method! Dataset was saved without compression" );
754
- iRet = H5Dcreate (pFile -> iCurrentG , (char * )name , datatype1 ,
755
- dataspace , H5P_DEFAULT );
762
+ iRet = H5Dcreate (pFile -> iCurrentG , (char * )name , datatype1 , dataspace , H5P_DEFAULT );
756
763
}
757
764
if (iRet < 0 )
758
765
{
0 commit comments