Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions modules/fileout_netcdf/FONcArray.cc
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,10 @@ void FONcArray::define(int ncid) {
FONcRequestHandler::use_shuffle)
shuffle = 1;

if (NC_SHORT == d_array_type || NC_USHORT == d_array_type || NC_INT == d_array_type ||
NC_UINT == d_array_type || NC_INT64 == d_array_type || NC_UINT64 == d_array_type ||
FONcRequestHandler::no_use_compression_for_float == false) {

int deflate = 1;
int deflate_level = 4;
stax = nc_def_var_deflate(ncid, d_varid, shuffle, deflate, deflate_level);
Expand All @@ -708,6 +712,7 @@ void FONcArray::define(int ncid) {
+ d_varname;
FONcUtils::handle_error(stax, err, __FILE__, __LINE__);
}
}
}

// We find that increasing the chunk cache size only benefits large-size character array for NASA files.
Expand Down
3 changes: 3 additions & 0 deletions modules/fileout_netcdf/FONcNames.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
#define FONC_NC3_CLASSIC_FORMAT false
#define FONC_NC3_CLASSIC_FORMAT_KEY "FONc.NC3ClassicFormat"

#define FONC_NO_COMPRESSION_FLOAT false
#define FONC_NO_COMPRESSION_FLOAT_KEY "FONc.NoCompressionForFloat"

#define FONC_RETURN_AS_NETCDF3 "netcdf"
#define FONC_RETURN_AS_NETCDF4 "netcdf-4"
#define FONC_NC4_CLASSIC_MODEL "NC4_CLASSIC_MODEL"
Expand Down
3 changes: 3 additions & 0 deletions modules/fileout_netcdf/FONcRequestHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ std::string FONcRequestHandler::temp_dir;
bool FONcRequestHandler::byte_to_short;
bool FONcRequestHandler::use_compression;
bool FONcRequestHandler::use_shuffle;
bool FONcRequestHandler::no_use_compression_for_float;
unsigned long long FONcRequestHandler::chunk_size;
bool FONcRequestHandler::classic_model;
bool FONcRequestHandler::reduce_dim;
Expand Down Expand Up @@ -159,6 +160,8 @@ FONcRequestHandler::FONcRequestHandler( const string &name )

read_key_value(FONC_USE_SHUFFLE_KEY, FONcRequestHandler::use_shuffle, FONC_USE_SHUFFLE);

read_key_value(FONC_NO_COMPRESSION_FLOAT_KEY, FONcRequestHandler::no_use_compression_for_float, FONC_NO_COMPRESSION_FLOAT);

read_key_value(FONC_CHUNK_SIZE_KEY, FONcRequestHandler::chunk_size, FONC_CHUNK_SIZE);

read_key_value(FONC_CLASSIC_MODEL_KEY, FONcRequestHandler::classic_model, FONC_CLASSIC_MODEL);
Expand Down
1 change: 1 addition & 0 deletions modules/fileout_netcdf/FONcRequestHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class FONcRequestHandler: public BESRequestHandler {
static bool byte_to_short;
static bool use_compression;
static bool use_shuffle;
static bool no_use_compression_for_float;
static unsigned long long chunk_size;
static bool classic_model;
static bool reduce_dim;
Expand Down