METplus Practical Session Guide (July 2019) | METplus Setup > METplus: How to Run

Running METplus

Running METplus involves invoking the python script master_metplus.py followed by a list of configuration files using the -c option for each additional conf file.

Reminder: The default set of conf files are always read in and processed in the following order;
metplus_system.conf, metplus_data.conf, metplus_runtime.conf, metplus_logging.conf.

If you have configured METplus correctly and run master_metplus.py without passing in any configuration files, it will generate a usage statement to indicate that other config files are required to perform a useful task. It will generate an error statement if something is amiss.

  1. Review the example.conf configuration file
less ${METPLUS_PARM_BASE}/use_cases/wrappers/examples/example.conf
  1. Call the master_metplus.py script, passing in the example.conf configuration file with the -c command line option. You should see logs output to the screen.
master_metplus.py -c use_cases/wrappers/examples/example.conf

Note: If master_metplus.py can't be found, you may need to add it to the path. Optionally, you can specify the full path to the script.

Note: The environment variable METPLUS_PARM_BASE determines where to look for relative paths to configuration files. If the environment variable is not set, the script will look in the parm directory that is associated with the version of master_metplus.py that is being called. Optionally, you can specify the full path to the configuration files.

OPTIONAL:

master_metplus.py -c ${METPLUS_TUTORIAL_DIR}/METplus/parm/use_cases/wrappers/examples/example.conf
  1. Check the directory specified by the OUTPUT_BASE configuration variable. You should see that files and sub-directories have been created
ls ${METPLUS_TUTORIAL_DIR}/output
  1. Review the master log file to see what was run. Compare the log output to the example.conf configuration file to see how they correspond to each other. The log file will have today's date in the filename
less ${METPLUS_TUTORIAL_DIR}/output/logs/master_metplus.log.`date +%Y%m%d`

You will notice that METplus ran for 4 valid times, processing 4 forecast hours for each valid time. For each run, it used the input template to determine which file to look for.

  1. Now run METplus passing in the example.conf from the previous run AND your newly created configuration file.
master_metplus.py -c use_cases/wrappers/examples/example.conf -c user_config/change_output_base.conf
  1. Check the directory specified by the OUTPUT_BASE configuration variable that you set in the change_output_base.conf configuration file. You should see that files and sub-directories have been created in the new location.
ls ${METPLUS_TUTORIAL_DIR}/output_changed

Remember: Additional conf files are processed after the metplus_config files in the order specified on the command line.
Order matters, since each successive conf file will override any variable defined in a previous conf file.

Note: The processing order allows for structuring your conf files from general (variables shared-by-all) to specific (variables shared-by-few).