Here are the environment variables that are used by ecCodes:

ECCODES_DEFINITION_PATH: Set to the list of directories containing the set of definition files you want to use instead of the default one.

ECCODES_SAMPLES_PATH: Set to the list of directories containing the set of sample files you want to use instead of the default one.

ECCODES_DEBUG: If set to -1, will enable brief debug-level logging messages to be displayed by the library. If set to 1, you will get very verbose output.

ECCODES_FAIL_IF_LOG_MESSAGE: If set to 1, will cause the library to exit when an error or warning is encountered.

ECCODES_IO_BUFFER_SIZE: Defines the size in bytes of the buffer used in the IO calls from Fortran and in the tools.

ECCODES_NO_ABORT: When set to 1 it causes ecCodes not to abort execution on failing asserts.

ECCODES_GRIB_WRITE_ON_FAIL: When set to 1 it will write the last processed GRIB message to a file named $PID_$FILEID_error.grib on failure in a fortran function used without the return code argument.

ECCODES_GRIBEX_MODE_ON: When set to 1 it will enable the GRIBEX compatibility mode and ecCodes will produce GRIB messages readable by GRIBEX.

ECCODES_LOG_STREAM: This controls the output stream for warning/error messages. Accepted values are "stdout" or "stderr" (default is stderr)

ECCODES_BUFRDC_MODE_ON: This is for BUFR decoding functionality. When set to 1 it will enable the BUFRDC compatibility mode (e.g. we tolerate problems like wrong data section length)

ECCODES_BUFR_SET_TO_MISSING_IF_OUT_OF_RANGE:This is for BUFR encoding functionality.  When set to 1 ecCodes will allow out-of-range values (BUFRDC compatibility mode). In this mode encoding does not fail and a missing value is encoded in place of the out-of-range value.

ECCODES_BUFR_MULTI_ELEMENT_CONSTANT_ARRAYS: When decoding compressed BUFR data, ecCodes does not expand elements whose values are constant across all subsets, i.e. it returns a single value rather than an array of constant values. When this environment variable is set to 1, that behaviour is changed so all values are shown. Note: This can increase the output of commands like bufr_dump quite dramatically.

ECCODES_PYTHON_ENABLE_TYPE_CHECKS: This is for the Python3 interface. When set to 1, the types of the arguments passed to ecCodes Python functions are checked.
Note: The type checking can add a significant overhead in cases where ecCodes functions are called many times


If the library is built with only one of the jpeg libraries (jasper or openjpeg) it will work without any environment variable. If ecCodes is built with both, then you have always to link both and you can switch from one to the other with the variable:

ECCODES_GRIB_JPEG=jasper
ECCODES_GRIB_JPEG=openjpeg

This env. variable was only for debugging/development purposes, but it can be used by users. There is also another variable ECCODES_GRIB_DUMP_JPG_FILE=filename which provides a dump of the JPEG image on a separate file, again for debugging purposes.