METplus Practical Session Guide (July 2019) | METplus Setup > METplus: Initial setup

Prequisites: Software

The following is a full list of software that is required to utilize all the functionality in METplus.
NOTE: We will not by running the cyclone plotter or grid plotting scripts in this tutorial. So the additional libraries mentioned below are not installed.

  • Python 2.7.x
  • Additional Python libraries: - required by the cyclone plotter and grid plotting scripts.
    • numpy
    • matplotlib - not installed, Is is not required for this tutorial.
    • cartopy - not installed, It is not required for this tutorial.
  • MET 8.1 - already installed locally on the tutorial machines.
  • R - used by TCMPRPlotter wrapper, Wraps the MET plot_tcmpr.R script
  • ncap2 - NCO netCDF Operators
  • wgrib2 - only needed for series analysis wrappers (SeriesByLead and SeriesByInit)
  • ncdump - NetCDF binaries
  • convert - Utilitity from ImageMagick software suite

Prequisites: Environment

Before running these instructions, you will need to ensure that you have a few environment variables set up correctly. If they are not set correctly, these instructions will not work properly.

  1. Check that you have METPLUS_TUTORIAL_DIR set correctly:
echo ${METPLUS_TUTORIAL_DIR}

If you don't see a path in your user directory output to the screen, set this environment variable in your user profile before continuing.

METPLUS_TUTORIAL_DIR is the location of all of your tutorial work, including configuration files, output data, and any other notes you'd like to keep.
  1. Check that you have METPLUS_BUILD_BASE, MET_BUILD_BASE, and METPLUS_DATA set correctly:
echo ${METPLUS_BUILD_BASE}
echo ${MET_BUILD_BASE}
echo ${METPLUS_DATA}

If any of these variables are not set, please set them. They will be referenced throughout the tutorial.

METPLUS_BUILD_BASE is the full path to the METplus installation (/path/to/METplus-X.Y)
MET_BUILD_BASE is the full path to the MET installation (/path/to/met-X.Y)
METPLUS_DATA is the location of the sample test data directory
  1. Check that you have loaded the MET module correctly:
which point_stat

You should see the usage statement for Point-Stat. The version number listed should correspond to the version listed in MET_BUILD_BASE. If it does not, you will need to either reload the met module, or add ${MET_BUILD_BASE}/bin to your PATH.

Getting The Software

For this tutorial we'll use the METplus v2.2 release, which has been installed in a common location. We will configure METplus to run the met-8.1 software, which has also been installed in a common location. We will copy the parameter files from the shared METplus location to your own directory so you can modify them without changing the shared installation settings.

Please use the following instructions to setup METplus on your tutorial machine:

  1. Create a directory to store your METplus files (include the version number for traceability):
mkdir -p ${METPLUS_TUTORIAL_DIR}/METplus-2.2
  1. Create a symbolic link so that you can refer to the METplus directory instead of METplus-2.2 (you may need to remove the link if it already exists):
cd ${METPLUS_TUTORIAL_DIR}
ln -s METplus-2.2 METplus
  1. List the contents of the metplus_tutorial directory:
ls -l ${METPLUS_TUTORIAL_DIR}

You should see something similar to this:

lrwxrwxrwx 1 mccabe rap 11     Jul 18 15:34 METplus -> METplus-2.2
drwxrwxr-x 2 mccabe rap 4096 Jul 18 15:34 METplus-2.2
  1. Copy the parm directory from the shared METplus location to your home directory:
cp -r ${METPLUS_BUILD_BASE}/parm ${METPLUS_TUTORIAL_DIR}/METplus/
  1. Create directory to store configuration files you will create:
mkdir ${METPLUS_TUTORIAL_DIR}/METplus/parm/user_config

For reference, the following are instructions to download and install METplus on your own machine.

  • If you wish, download and unpack the release tarball and create a METplus symbolic link:

DO NOT RUN THESE COMMANDS FOR THE TUTORIAL!

cd ${HOME}
wget https://github.com/NCAR/METplus/archive/v2.2.tar.gz
tar -xvzf METplus_v2.2.tar.gz
rm METplus
ln -s METplus-2.2 METplus

Sample Data Input and Location of Output

The Sample Input Data used to run the examples in this tutorial already exist in a shared location. For reference, here are example instructions to obtain the sample input data.

DO NOT RUN THESE COMMANDS FOR THE TUTORIAL!

mkdir -p /d1/METplus-2.2_Data
cd /d1/METplus-2.2_Data
wget https://github.com/NCAR/METplus/releases/download/v2.2/sample_data-grid_to_grid-2.2.tgz
tar -xvzf sample_data-grid_to_grid-2.2.tgz
rm sample_data-grid_to_grid-2.2.tgz

This will create a directory named 'grid_to_grid' under '/d1/METplus_Data' that contains all of the sample input data needed to run the grid_to_grid use cases (found in parm/use_cases/grid_to_grid/examples). Other sample data tarballs are available under 'Assets' on the METplus GitHub releases page.

When running METplus wrapper use cases, all output is placed in the ${METPLUS_TUTORIAL_DIR}/output directory.

When running MET on the command line, all output will be written to ${METPLUS_TUTORIAL_DIR}/output/met_output

Your Runtime Environment

For this tutorial, the MET software is available via a module file. This has already been loaded for all users, so the MET software is available when you login.

The PATH environment variable is set to allow the METplus scripts to be run from any directory.

  1. Edit the .bash_profile file to configure your runtime environment for use with METplus:
vi ${HOME}/.bash_profile

Add the following at the end of the file to set the PATH and METPLUS_PARM_BASE environment variables. Also update LD_LIBRARY_PATH to avoid runtime NetCDF linker errors:

bash:

export PATH=${METPLUS_BUILD_BASE}/ush:${PATH}
export METPLUS_PARM_BASE=${METPLUS_TUTORIAL_DIR}/METplus/parm
export LD_LIBRARY_PATH=/software/depot/met-8.1/external_libs/lib:${LD_LIBRARY_PATH}

csh:

setenv PATH ${METPLUS_BUILD_BASE}/ush:${PATH}
setenv METPLUS_PARM_BASE ${METPLUS_TUTORIAL_DIR}/METplus/parm
setenv LD_LIBRARY_PATH /software/depot/met-8.1/external_libs/lib:${LD_LIBRARY_PATH}

Save and close that file, then source it to apply the settings to the current shell. The next time you login, you do not have to source this file again:

source ${HOME}/.bash_profile

If you did everything correctly, running 'which master_metplus.py' should show you the path to the script in the shared location, ${METPLUS_BUILD_BASE}:

which master_metplus.py