Skip to content
Snippets Groups Projects
Commit b9ce98cd authored by Anne Tipka's avatar Anne Tipka :headphones:
Browse files

added CONTROL file option for grib compression type / set packingType parameter in grib messages

parent 7c4bd597
No related branches found
No related tags found
No related merge requests found
......@@ -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}']
......
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment