METplus Practical Session Guide (Feb 2019) | Session 1: METplus Setup/Grid-to-Grid > End of Practical Session 1: Additional Exercises

Congratulations! You have completed Session 1!

If you have extra time, you may want to try these additional MET exercises:

  • Run Gen-Vx-Mask to create a mask for Eastern or Western United States using the polyline files in the data/poly directory. Re-run Grid-Stat using the output of Gen-Vx-Mask.
  • Run Gen-Vx-Mask to exercise all the other masking types available.
  • Reconfigure and re-run Grid-Stat with the fourier dictionary defined and the grad output line type enabled.

If you have extra time, you may want to try these additional METplus exercises. The answers are found on the next page.

EXERCISE 1.1: add_rh - Add another field to grid_stat

Instructions: Modify the METplus configuration files to add relative humidity (RH) at pressure levels 500 and 250 (P500 and P250) to the output.

Copy your custom configuration file and rename it to mycustom.add_rh.conf for this exercise.

cp $HOME/METplus/parm/mycustom.conf $HOME/METplus/parm/mycustom.add_rh.conf

Open anom.conf to remind yourself how fields are defined in METplus

less $HOME/METplus/parm/use_cases/grid_to_grid/examples/anom.conf

Open mycustom.add_rh.conf with an editor and add the extra information.

HINT: The variables that you need to add must go under the [config] section.

You should also change OUTPUT_BASE to a new location so you can keep it separate from the other runs.

OUTPUT_BASE = {ENV[HOME]}/metplus_tutorial/output/exercises/add_rh

Rerun master_metplus passing in your new custom config file for this exercise

master_metplus.py -c use_cases/grid_to_grid/examples/anom.conf -c mycustom.add_rh.conf
You should see the relative humidity field appear in the log output from grid_stat. Go to the next page for the solution to see if you were right!

EXERCISE 1.2: log_test - Change the Logging Settings

Instructions: Modify the METplus configuration files to change the logging settings to see what is available.

Copy your custom configuration file and rename it to mycustom.log_test.conf for this exercise.

cp $HOME/METplus/parm/mycustom.conf $HOME/METplus/parm/mycustom.log_test.conf

Open mycustom.log_test.conf with an editor and add the extra information.

You should change OUTPUT_BASE to a new location so you can keep it separate from the other runs.

OUTPUT_BASE = {ENV[HOME]}/metplus_tutorial/output/exercises/log_test

Separate METplus Logs from MET Logs

Setting [config] LOG_MET_OUTPUT_TO_METPLUS to no will create a separate log file for each MET application.

[config]
LOG_MET_OUTPUT_TO_METPLUS = no

For this use case, two log files will be created: master_metplus.log.YYYYMMDD and grid_stat.log_YYYYMMDD

Use Time of Data Instead of Current Time

Setting LOG_TIMESTAMP_USE_DATATIME to yes will use the first time of your data instead of the current time.

[config]
LOG_TIMESTAMP_USE_DATATIME = yes

For this use case, VALID_BEG = 2017061300, so the log files will have the format: master_metplus.log.20170613 instead of using today's date

Change Format of Time in Logfile Names

Setting LOG_TIMESTAMP_TEMPLATE to %Y%m%d%H%M will add hour and minute to the log file time. The default value is %Y%m%d which results in the format YYYYMMDD.

[config]
LOG_TIMESTAMP = %Y%m%d%H%M

For this use case, the log files will have the format: master_metplus.log.YYYYMMDDHH

Rerun master_metplus passing in your new custom config file for this exercise

master_metplus.py -c use_cases/grid_to_grid/examples/anom.conf -c mycustom.log_test.conf

Look at the log output to see how things have changed from these settings

ls $HOME/metplus_tutorial/output/exercises/log_test/logs

Look at metplus_config/metplus_logging.conf to see other logging configurations you can change and test them out!

less $HOME/METplus/parm/metplus_config/metplus_logging.conf
For example, override LOG_METPLUS and add more text to the filename (or even use another METplus config variable).