METplus: User Configuration Settings
METplus: User Configuration Settings admin Mon, 06/24/2019 - 16:00Modify 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.
- Try running master_metplus.py. You should see the usage statement output to the screen.
- Now try to pass in the example.conf configuration file found in your parm directory under use_cases/wrappers/examples
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.
- 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.
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.
- 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).
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.
- Set the [dir] INPUT_BASE variable to the location of the METplus sample data that will be used in the exercises
- 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
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.
- Create a new configuration file in your user_config directory and override the [dir] OUTPUT_BASE variable to point to a different location.
vi change_output_base.conf
Copy and paste the following text into the file and save it.
OUTPUT_BASE = {ENV[METPLUS_TUTORIAL_DIR]}/output_changed
We will test out using these configurations on the next page.