Command Line Interface (CLI)

From COPERT Documentation
Jump to navigation Jump to search

This is a brief introduction on how to use the Command Line Interface (CLI) of COPERT. More information and examples in “COPERT CLI feature documentation” available at https://www.emisia.com/utilities/copert/versions/ (under COPERT version 5.3.23 – May 2020)

Introduction

The Command Line Interface (CLI) follows the development of the COPERT software which means that it will be available to all COPERT users. Therefore, it is advised that users familiarize themselves with the COPERT software before using the CLI interface.

The CLI does not introduce new methodological elements which are described in detail in EEA’s emission inventory guidebook (https://www.eea.europa.eu/publications/emep-eea-guidebook-2019/part-b-sectoral-guidancechapters/1-energy/1-a-combustion/1-a-3-b-i/view). Calculation methodology will follow the COPERT functionalities allowing for emission factor and emission calculation as well as energy consumption calculation. Advanced features of the model can only be run by using the windows version of the tool (more on CLI documentation).

Execution

The CLI feature is integrated in COPERT installation, so no separate installation is required.

The CLI is available on any PC where the COPERT tool is installed. It is called by the Windows command line window. To open the command line window click Start. In the Search or Run line, type cmd (short for command), and press Enter.

CLI Execution Syntax

A specific syntax must be followed to start the procedure. The command line syntax for the simplest COPERT emission calculation is the following (example in Figure 1):

C:\Users> [COP_path] –i [Inp_path] -oEF [Out_Path] (+optional features)

where:

  • [COP_path]: The path of “COPERT.exe” file
  • [Inp_path]: The path of Input file (xlsx or json file type). The file must be already created according to the xlsx Input Structure of COPERT
  • [Out_path]: The path of emissions output file (xlsx or json file type). The output files must not already exist
Figure 1

The program opens a separate CMD window returning control to the user in the launch window (Figure 2).

Figure 2

Optional Features

CLI has specific features available that can be added through the execution syntax:

  • Include the Energy & GHG results and gives information about the origin of each primary fuel (bio/fossil) for all vehicle types: … -oEB [Energy_path]
where [Energy_path] is the path of the energy and GHG output file. This output files must not already exist too
  • Keep the .cop file: … -keep
When you execute COPERT via the CLI all information is temporarily stored in a COPERT file which is deleted after the completion of the calculations. If the user wishes to keep the file for further processing the “ -keep” at the end of the basic command prevents COPERT from deleting the file. The *.cop file is saved to the same folder as the output file (xlsx or json). If there is a *.cop file with the same name an error occurs, and the process is interrupted
  • Omit evaporation calculation: … -noevap
If the user wants to perform multiple runs of the model and wishes to save up time, there is an option to omit evaporation calculations and reduce calculation time by up to 30%. However, his will have an effect on CO2 and energy consumption results, so it is best used only for the evaluation of other pollutants, like NOx, PM, CO
  • Change country name: … [Country_name]
By default, COPERT prepares a country named Greece. By providing a country abbreviation as a switch COPERT can change the country name and use the alternative (e.g. EU27, UK etc.). The list of country names and abbreviations are based on the Alpha-2 code of the ISO 3166 country code. The list of country codes and abbreviations can be found in the “COPERT CLI feature documentation”

An example of CLI execution syntax using all the option features can be seen in Figure 3.

Figure 3

After clicking Enter a separate CMD window is opened with the new selected features (Figure 4)

Figure 4

Advanced Use

For more advanced use (filetype conversion, non-COPERT vehicle categories etc) and software examples the user can refer to “COPERT CLI feature documentation” available at https://www.emisia.com/utilities/copert/versions/ (under COPERT version 5.3.23 – May 2020)