Repository navigation
HERMES_GR_Executables
Once the installation of HERMES_GR is finished, the following executables are available:
| Executable | Description |
|---|---|
hermes_gr |
Main HERMES_GR model. |
hermes_gr_preproc |
Command-line interface for preprocessing emission inventories. |
hermes_sum |
Utility to create a NetCDF file with the sum of a given list of NetCDF files. |
hermes_gr is the executable of the HERMES_GR model.
In order to execute it, the path to the configuration file needs to be provided as follows:
hermes_gr --my-config /home/user/HERMES/HERMES_IN/conf/hermes.conf
# or
hermes_gr -c /home/user/HERMES/HERMES_IN/conf/hermes.confIn order to execute HERMES_GR in parallel, the number of processors should also be defined. In the following example, HERMES_GR is executed using 24 CPUs:
mpirun -np 24 hermes_gr --my-config /home/user/HERMES/HERMES_IN/conf/hermes.conf
# or
mpirun -np 24 hermes_gr -c /home/user/HERMES/HERMES_IN/conf/hermes.confConfiguration options can be passed to HERMES_GR through the configuration file, command-line arguments, or a combination of both. The arguments passed through the command line take priority over the values that appear in the configuration file.
To get more information about the available arguments, call the HERMES_GR help:
hermes_gr --help
# or
hermes_gr -hhermes_gr_preproc allows users to run preprocessing operations directly from the command line. Once HERMES_GR is installed, the hermes_gr_preproc command becomes available in your terminal.
Preprocessing for the following emission inventories is available from the command-line interface. Click the individual emission inventory names for more information about their preprocessing.
| Subcommand | Description |
|---|---|
CAMS_GLOB_SHIP |
Preprocess the CAMS global shipping inventory. |
CAMS_GLOB_ANT |
Preprocess the CAMS global anthropogenic inventory. |
CAMS_GLOB_OCEAN |
Preprocess the CAMS global ocean inventory. |
CAMS_REG_GHG |
Preprocess the CAMS regional greenhouse gas inventory. |
CAMS_REG_AP |
Preprocess the CAMS regional air pollutant inventory. |
EMEP |
Preprocess the EMEP inventory. |
EDGAR |
Preprocess the EDGAR inventory. |
To list all available subcommands:
hermes_gr_preproc -h
# or
hermes_gr_preproc --helpTo see help for a specific subcommand:
hermes_gr_preproc <subcommand> -hFor example:
hermes_gr_preproc CAMS_GLOB_SHIP -hhermes_sum is a HERMES_GR command-line utility used to sum emission variables from several NetCDF files into a single NetCDF output file.
The command is installed together with HERMES_GR and expects two arguments:
-
nc_out: output NetCDF file. -
nc_list: input NetCDF files to sum, passed as a single quoted string with paths separated by spaces.
hermes_sum output.nc "input_1.nc input_2.nc input_3.nc"The input file list must be passed as a single quoted argument. Internally, the CLI expects only two arguments: the output file and one string containing the list of input NetCDF files separated by spaces.
The utility follows this workflow:
- Copy the first input NetCDF file as the base of the output file.
- If
output.ncalready exists, remove it before copying the first input file. - Open the output file in read/write mode.
- Iterate over the remaining input NetCDF files.
- For each variable in each input file:
- Skip auxiliary or coordinate variables such as
time,lat,lon,lev,rlat,rlon,crs,cell_area,TFLAG, andTimes. - If the variable does not exist in the output file, create it and copy its attributes and data.
- If the variable already exists in the output file, add the input values to the values already present in the output file.
- If the input data are masked, masked values from the added files are treated as zero.
- Skip auxiliary or coordinate variables such as
In pseudocode:
output.nc = copy(input_1.nc)
for each file in input_2.nc, input_3.nc, ...:
for each variable:
if variable is coordinate or metadata:
skip
if variable does not exist in output.nc:
create variable and copy data
else:
output[variable] = output[variable] + input[variable]
- All input NetCDF files should use the same grid, dimensions, times, and vertical levels. Coordinates are taken from the first file and are not explicitly validated.
- If a new variable uses dimensions that do not exist in the first file, variable creation can fail.
- Units are not semantically checked. Compatible variables are assumed to be directly summable.
- Auxiliary variables listed as coordinates or metadata are not summed.
- If only one input file is provided, the output will simply be a copy of that file.