METplus Practical Session Guide (July 2019) | METplus Setup > METplus: User Configuration Settings

Modify your METplus conf files

In this section you will modify the configuration files that will be read for each call to METplus.

The paths in this practical assume:

  • You have copied the parm directory from the shared METplus location into your ${METPLUS_TUTORIAL_DIR}/METplus directory
  • You have added the shared METplus ush directory to your PATH
  • You have set the METPLUS_PARM_BASE environment variable to your copied parm directory
  • You are using the shared installation of MET.

If not, then you need to adjust accordingly.

  1. Try running master_metplus.py. You should see the usage statement output to the screen.
master_metplus.py
  1. Now try to pass in the example.conf configuration file found in your parm directory under use_cases/wrappers/examples
master_metplus.py -c use_cases/wrappers/examples/example.conf

You should see an error message stating that OUTPUT_BASE was not set correctly. You will need to configure the METplus wrappers to be able to run a use case.

The values in the default metplus_system.conf, metplus_data.conf, metplus_runtime.conf, and metplus_logging.conf configuration files are read in first when you run master_metplus.py. The settings in these files can be overridden in the use case conf files and/or a user's custom configuration file.

Some variables in the system conf are set to '/path/to' and must be overridden to run METplus, such as OUTPUT_BASE in metplus_system.conf.

  1. View the metplus_system.conf file and notice how OUTPUT_BASE = /path/to . This implies it is REQUIRED to be overridden to a valid path.
less ${METPLUS_PARM_BASE}/metplus_config/metplus_system.conf

Note: The default installation of METplus has /path/to values for MET_INSTALL_DIR, TMP_DIR, and INPUT_BASE. These values were set in the shared METplus configuration when it was installed. This was done because these settings will likely be set to the same values for all users.

  1. Change directory to your ${METPLUS_PARM_BASE} directory and modify the METplus base configuration files using the editor of your choice (vi listed as an example).
cd ${METPLUS_PARM_BASE}/metplus_config

If METPLUS_PARM_BASE is set correctly, you should now be in ${METPLUS_TUTORIAL_DIR}/METplus/parm/metplus_config

Note: A METplus conf file is not a shell script.
You CAN NOT refer to environment variables as you would in a shell script or command prompt, i.e. ${HOME}.
Instead, you must reference the environment variable $HOME as {ENV[HOME]}

Reminder: Make certain to maintain the KEY = VALUE pairs under their respective current [sections] in the conf file.

  1. Set the [dir] INPUT_BASE variable to the location of the METplus sample data that will be used in the exercises
vi metplus_data.conf
INPUT_BASE = {ENV[METPLUS_DATA]}
  1. Set the [dir] OUTPUT_BASE variable to the location you will write output data
    Set the [dir] MET_INSTALL_DIR variable to the location where MET is installed (this should already be done when METplus was installed in the shared location)
    Set the [dir] TMP_DIR variable to a location you have write permissions
vi metplus_system.conf
OUTPUT_BASE = {ENV[METPLUS_TUTORIAL_DIR]}/output
MET_INSTALL_DIR = {ENV[MET_BUILD_BASE]}
TMP_DIR = {OUTPUT_BASE}/tmp

NOTE: When installing METplus, you will need to set the full path to the non-MET executables in the metplus_system.conf file if they are not found in the user's path. This step was completed when METplus was installed in the shared location.

Creating user conf files

You can create additional configuration files to be read by the METplus wrappers to override variables.

Reminder: When adding variables to be overridden, make sure to place the variable under the appropriate section.
For example, [config], [dir], [exe]. If necessary, refer to the default appropriate parm/metplus_config conf files to determine the [section] that corresponds to the variable you are overriding. The value set will be the last one in the sequence of configuration files. See OUTPUT_BASE/metpus_final.conf to see what values were used for a given METplus run.

  1. Create a new configuration file in your user_config directory and override the [dir] OUTPUT_BASE variable to point to a different location.
cd ${METPLUS_PARM_BASE}/user_config
vi change_output_base.conf

Copy and paste the following text into the file and save it.

[dir]
OUTPUT_BASE = {ENV[METPLUS_TUTORIAL_DIR]}/output_changed

We will test out using these configurations on the next page.