diff --git a/Source/Python/Classes/ControlFile.py b/Source/Python/Classes/ControlFile.py index 5783535188a05eb1a78a8b1ec314f72f09505f5f..5a1485902e29ad25df6c4786c50d479e5193fb10 100644 --- a/Source/Python/Classes/ControlFile.py +++ b/Source/Python/Classes/ControlFile.py @@ -228,6 +228,9 @@ class ControlFile(object): Switch to select further parameters for retrievment to support WRF simulations. Default value is 0. + compression : str + Compression type for grib messages. Standard is "grid_simple". + ecfsdir : str Path to the ECMWF storage 'ectmp:/${USER}/econdemand/' @@ -395,6 +398,7 @@ class ControlFile(object): self.prefix = 'EN' self.cwc = 0 self.wrf = 0 + self.compression = 'grid_simple' self.ecfsdir = 'ectmp:/${USER}/econdemand/' self.mailfail = ['${USER}'] self.mailops = ['${USER}'] diff --git a/Source/Python/Classes/EcFlexpart.py b/Source/Python/Classes/EcFlexpart.py index 65ba97f7e4212e4187accda307d79436bee23231..b7e02f608526d642256cc9f5b83ecbe754b3c8d4 100644 --- a/Source/Python/Classes/EcFlexpart.py +++ b/Source/Python/Classes/EcFlexpart.py @@ -1901,6 +1901,16 @@ class EcFlexpart(object): error_msg='RENAMING FOR NEW GRIB2 FORMAT ' 'FILES FAILED!') + if c.compression.lower() != 'grid_simple': + execute_subprocess(['grib_set', '-r', '-s', + 'packingType=' + c.compression, + ofile, ofile + '_2'], + error_msg='GRIB COMPRESSION FAILED!') + + execute_subprocess(['mv', ofile + '_2', ofile], + error_msg='RENAMING FOR NEW GRIB COMPRESSION ' + 'FILES FAILED!') + if c.ectrans and _config.FLAG_ON_ECMWFSERVER: execute_subprocess(['ectrans', '-overwrite', '-gateway', c.gateway, '-remote', c.destination,