Skip to content

Commit

Permalink
feature 900 single metplus_config.conf file (#901)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgemccabe authored May 3, 2021
1 parent 2460fb4 commit 39cce0c
Show file tree
Hide file tree
Showing 21 changed files with 632 additions and 192 deletions.
6 changes: 3 additions & 3 deletions ci/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ ARG OBTAIN_SOURCE_CODE=clone
RUN if [ ${OBTAIN_SOURCE_CODE} != "none" ]; then \
echo "Installing METplus package and setting default configs"; \
cd METplus; \
sed -i 's|MET_INSTALL_DIR = /path/to|MET_INSTALL_DIR = /usr/local|g' parm/metplus_config/metplus_system.conf; \
sed -i 's|OUTPUT_BASE = /path/to|OUTPUT_BASE = /data/output|g' parm/metplus_config/metplus_system.conf; \
sed -i 's|INPUT_BASE = /path/to|INPUT_BASE = /data/input/METplus_Data|g' parm/metplus_config/metplus_data.conf; \
sed -i 's|MET_INSTALL_DIR = /path/to|MET_INSTALL_DIR = /usr/local|g' parm/metplus_config/*.conf; \
sed -i 's|OUTPUT_BASE = /path/to|OUTPUT_BASE = /data/output|g' parm/metplus_config/*.conf; \
sed -i 's|INPUT_BASE = /path/to|INPUT_BASE = /data/input/METplus_Data|g' parm/metplus_config/*.conf; \
python3 setup.py install; \
fi
2 changes: 1 addition & 1 deletion docs/Contributors_Guide/deprecation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ changed to
WGRIB2

The new variable is set to wgrib2 in the default config file
(parm/metplus_config/metplus_system.conf). If the user is still using
(parm/metplus_config/defaults.conf). If the user is still using
WGRIB2_EXE to set to /usr/local/bin/wgrib2, this value will not be
read and the user will have no way to know that they are setting the
wrong variable and it is using WGRIB2 = wgrib2.
Expand Down
143 changes: 58 additions & 85 deletions docs/Users_Guide/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,59 +115,64 @@ that are required to run.
Getting the METplus Wrappers source code
----------------------------------------

The METplus Wrappers source code is available for download from a public
GitHub repository. You can retrieve the source code through your web
The METplus Wrappers source code is available for download from the public
GitHub repository. The source code can retrieved through a web
browser or the command line.

Get the source code via your Web Browser
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the source code via Web Browser
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you are a new METplus Wrappers user and would like to experiment with
the use cases, you will want to follow these instructions to retrieve
the source code, additional documentation and sample data that
accompanies the use cases:
- On your local host, create a directory where the METplus Wrappers will be
installed

- On your local host (or wherever you wish to install the METplus
Wrappers code) create a directory where you want the code to reside
- Open a web browser and navigate to
https://github.com/dtcenter/METplus/releases/latest to view the
latest stable release.

- Open the browser of your choice and navigate to
https://github.com/dtcenter/METplus. You will see something like the
following:
.. image:: ../_static/metplus_repo_releases_page.png

.. image:: ../_static/metplus_repo.png
- Click on the 'Source code' link (either the *zip* or *tar.gz*) under Assets
and when prompted, save it to the directory.

- Click on the 'releases' link, highlighted by a red circle in the
diagram below:
- Uncompress the source code (on Linux/Unix\ *: gunzip* for zip file or
*tar xvfz* for the tar.gz file)

.. image:: ../_static/metplus_repo_release.png
Get the source code via Command Line
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- You will be redirected to another screen. The latest available
release appears at the top of the screen:
- Open a shell terminal

.. image:: ../_static/metplus_repo_releases_page.png
- Clone the DTCenter/METplus GitHub repository:

- Expand the Assets menu by clicking on the black triangle to the left of the 'Assets' text (below the description of the latest release)
SSH::

- Click on the 'Source code' link (either the *zip* or *tar.gz*) and
when prompted, save it to the directory you created.
git@github.com:dtcenter/metplus

- Uncompress the source code (on Linux/Unix\ *: gunzip* for zip file or
*tar xvfz* for the tar.gz file)
HTTPS::

- Create a directory for the sample data directory for the use case you
are interested in running
https://github.com/dtcenter/metplus

- Click on the sample data link for the use case you will run and when
prompted, save the file to the directory you created above. Sample
data are available for the following use case categories:
Obtain Sample Input Data (optional)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- Create a directory to put the sample input data. This will be the directory
to set for the value of INPUT_BASE in the METplus Configuration.

- Model Applications:
- Visit https://github.com/dtcenter/METplus/releases for a complete list of the latest Model Application .tgz files
- Navigate to the sample input data web URL: https://dtcenter.ucar.edu/dfiles/code/METplus/METplus_Data

- MET Tool Wrapper:
- Visit https://github.com/dtcenter/METplus/release for the latest single MET tool/METplus wrapper use case file
- Click on the vX.Y version directory that corresponds to the release to
install, i.e. v4.0 directory for the v4.0.0 release.

- Click on the sample data tgz file for the desired use case category or
categories run and when prompted, save the file to the directory created
above.

.. note::
Files with the version number in the name,
i.e. sample_data-data_assimilation**-4.0**.tgz, have been updated since the
last major release. Files without the version number in the file name have
not changed since the last major release and could be skipped if the data
was already obtained with the previous release.


METplus Wrappers directory structure
Expand Down Expand Up @@ -297,59 +302,27 @@ shell):
# Add METplus to $PATH
export PATH=~/METplus/ush:$PATH
Set up METplus Wrappers Configuration files
-------------------------------------------

There are four METplus Wrappers configuration files that must be defined
prior to running METplus Wrappers. These configuration files reside in
the METplus_INSTALL_DIRECTORY/METplus/parm/metplus_config

The following configuration files are automatically loaded during a
METplus Wrappers run and do not need to be invoked on the command line.

- metplus_data.conf

- data-relevant settings:

- filename templates

- regular expressions for input or output filenames

- directories where input data are located

- metplus_logging.conf

- set logging levels for METplus and MET output

- turn on/off logging to stdout (screen) or log files

- metplus_runtime.conf

- runtime-related settings:

- location of METplus run_metplus.conf file (the conf
file that is a collection of all the final METplus
configuration files)

- metplus_system.conf

- system-related settings:

- location of METplus source code
Set up the Default METplus Configuration File
---------------------------------------------

- location of MET source and build
The default METplus configurations are found in
*METplus/parm/metplus_config/defaults.conf*.
These settings are automatically loaded at the start of
a METplus Wrappers run and do not need to be invoked on the command line.

- location of other non-MET executables/binaries
These settings include:

- location of METplus parm directory
* Location of MET source and build
* Directories where input data are located
* Logging levels for METplus and MET output
* Location of other non-MET executables/binaries

They must be fully defined by replacing all variables preset to
*</path/to>* with valid path names, or have those variables defined in a
down-stream config file. If configuring METplus Wrappers in a common
location for multiple users, it is recommended that the these four
configuration files are fully defined. Individual users have the option
to make customizations by over-riding any of these values in their own
configuration files.
Values in this file that are set to */path/to*
must be set to a valid path to run METplus Wrappers. These values can either
be set directly in this file or in a user-defined configuration file.
If configuring METplus Wrappers in a common location for multiple users,
it is recommended that these settings are fully defined in the default
configuration file.

Updating Configuration Files - Handling Deprecated Configuration Variables
--------------------------------------------------------------------------
Expand Down Expand Up @@ -636,7 +609,7 @@ The command:
run_metplus.py -c use_cases/met_tool_wrapper/GridStat/GridStat.conf
will run METplus using the defaults set in the config files found in parm/metplus_config. Any variables defined in these three config files can be overridden in the parm/use_cases/GridStat/GridStat.conf file. METplus will run using the values specified in the GridStat.conf file.
will run METplus using the defaults set in parm/metplus_config/defaults.conf. Any variables defined in these three config files can be overridden in the parm/use_cases/GridStat/GridStat.conf file. METplus will run using the values specified in the GridStat.conf file.

**Example 3: Using example configuration to perform a specific evaluation (e.g. Model 1 vs. Obs 1, Model 1 vs. Obs 2, Model 2 vs. Obs 1, etc...):**

Expand All @@ -648,7 +621,7 @@ The command:
-c use_cases/met_tool_wrapper/GridStat/GridStat_forecast.conf \
-c use_cases/met_tool_wrapper/GridStat/GridStat_observation.conf
will run METplus using the defaults set in the config files in parm/metplus_config, where variables can be overridden by parm/use_cases/met_tool_wrapper/GridStat/GridStat.conf, then by parm/use_cases/met_tool_wrapper/GridStat/GridStat_forecast.conf, then by parm/use_cases/met_tool_wrapper/GridStat/GridStat_observation.conf. The order in which conf files are called is important. Variables that are defined in intermediate conf files will be overridden by the same variables set in the conf file following it, or the last conf file. For example, if FCST_VAR1_NAME = TMP in GridStat.conf and FCST_VAR1_NAME = TEMP in GridStat_forecast.conf, the value used will be TEMP because GridStat_forecast.conf was read after GridStat.conf.
will run METplus using the defaults set in parm/metplus_config/defaults.conf, where variables can be overridden by parm/use_cases/met_tool_wrapper/GridStat/GridStat.conf, then by parm/use_cases/met_tool_wrapper/GridStat/GridStat_forecast.conf, then by parm/use_cases/met_tool_wrapper/GridStat/GridStat_observation.conf. The order in which conf files are called is important. Variables that are defined in intermediate conf files will be overridden by the same variables set in the conf file following it, or the last conf file. For example, if FCST_VAR1_NAME = TMP in GridStat.conf and FCST_VAR1_NAME = TEMP in GridStat_forecast.conf, the value used will be TEMP because GridStat_forecast.conf was read after GridStat.conf.

Separating configurations into multiple files can be useful if you want to compare different forecasts or observations in the same way. For example, to compare a different forecast to the observation in this example, copy GridStat_forecast.conf into a directory outside of the METplus repository (i.e. /home/user/METplus_user_config), rename it (i.e. GridStat_myforecast.conf), then change the values to match the new data set (input directory, input filename template, field name, etc.). Then you can run the new use case:

Expand Down
Loading

0 comments on commit 39cce0c

Please sign in to comment.