Skip to content

Commit

Permalink
Merge branch 'develop' into feature_1749_hss
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnHalleyGotway committed Jun 11, 2021
2 parents 37c728f + a70197a commit 7761e94
Show file tree
Hide file tree
Showing 11 changed files with 576 additions and 249 deletions.
466 changes: 330 additions & 136 deletions met/docs/Users_Guide/config_options.rst

Large diffs are not rendered by default.

299 changes: 209 additions & 90 deletions met/docs/Users_Guide/config_options_tc.rst

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions met/docs/Users_Guide/masking.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The usage statement for the Gen-Vx-Mask tool is shown below:
input_grid
mask_file
out_file
[-type str]
-type str
[-input_field string]
[-mask_field string]
[-complement]
Expand All @@ -36,7 +36,7 @@ The usage statement for the Gen-Vx-Mask tool is shown below:
[-v level]
[-compress level]
gen_vx_mask has three required arguments and can take optional ones.
gen_vx_mask has four required arguments and can take optional ones. Note, -type string (masking type) was previously optional but is now required.

Required arguments for gen_vx_mask
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -57,11 +57,11 @@ Required arguments for gen_vx_mask

3. The **out_file** argument is the output NetCDF mask file to be written.

4. The **-type string** is required to set the masking type. The application will give an error message and exit if "-type string" is not specified on the command line. See description of supported types below.

Optional arguments for gen_vx_mask
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

4. The **-type string** option can be used to override the default masking type (poly). See description of supported types below.

5. The **-input_field string** option can be used to read existing mask data from “input_file”.

6. The **-mask_field string** option can be used to define the field from “mask_file” to be used for “data” masking.
Expand Down
4 changes: 2 additions & 2 deletions met/docs/Users_Guide/release-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ MET Version |version| release notes (|release_date|)
* Correct the time offset for tests in unit_plot_data_plane.xml (`#1677 <http://github.com/dtcenter/MET/issues/1677>`_).
* Enhance the sample plotting R-script to read output from different versions of MET (`#1653 <http://github.com/dtcenter/MET/issues/1653>`_).
* Update the default configuration options to compile the development code with the debug (-g) option and the production code without it (`#1788 <http://github.com/dtcenter/MET/issues/1788>`_).
* Update MET to compile using GCC version 10 (`#1552 https://github.com/dtcenter/MET/issues/1552`_).
* Update MET to compile using PGI version 20 (`#1317 https://github.com/dtcenter/MET/issues/1317`_).
* Update MET to compile using GCC version 10 (`#1552 <https://github.com/dtcenter/MET/issues/1552>`_).
* Update MET to compile using PGI version 20 (`#1317 <https://github.com/dtcenter/MET/issues/1317>`_).

* Documentation:

Expand Down
3 changes: 2 additions & 1 deletion met/scripts/examples/test_gen_vx_mask.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ echo "*** Running Gen-Vx-Mask to generate a polyline mask file for the Continent
gen_vx_mask \
../data/sample_fcst/2005080700/wrfprs_ruc13_24.tm00_G212 \
$MET_BASE/poly/CONUS.poly \
${TEST_OUT_DIR}/gen_vx_mask/CONUS_poly.nc -v 2
${TEST_OUT_DIR}/gen_vx_mask/CONUS_poly.nc \
-type poly -v 2

echo
echo "*** Running Gen-Vx-Mask to generate a circle mask file ***"
Expand Down
2 changes: 1 addition & 1 deletion met/scripts/mk/gen_vx_mask.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ gen_vx_mask: ${GEN_VX_MASK_EXEC}
${GEN_VX_MASK_EXEC} \
../data/sample_fcst/2005080700/wrfprs_ruc13_24.tm00_G212 \
../data/poly/CONUS.poly \
${TEST_OUT_DIR}/gen_vx_mask/CONUS_poly.nc -v 2
${TEST_OUT_DIR}/gen_vx_mask/CONUS_poly.nc -type poly -v 2
@
echo
echo "*** Running Gen-Vx-Mask to generate a circle mask file ***"
Expand Down
22 changes: 17 additions & 5 deletions met/src/tools/other/gen_vx_mask/gen_vx_mask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
// 006 07/09/18 Bullock Add shapefile masking type.
// 007 04/08/19 Halley Gotway Add percentile thresholds.
// 008 04/06/20 Halley Gotway Generalize input_grid option.
// 009 06/01/21 Seth Linden Change -type from optional to required
//
////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -138,6 +139,17 @@ void process_command_line(int argc, char **argv) {
mask_filename = cline[1];
out_filename = cline[2];

// Check for the mask type (from -type string)
if(mask_type == MaskType_None) {
mlog << Error << "\n" << program_name << " -> "
<< "the -type command line requirement must be set to a specific masking type!\n"
<< "\t\t \"poly\", \"box\", \"circle\", \"track\", \"grid\", "
<< "\"data\", \"solar_alt\", \"solar_azi\", \"lat\", \"lon\" "
<< "or \"shape\""
<< "\n\n";
exit(1);
}

// List the input files
mlog << Debug(1)
<< "Input Grid:\t\t" << input_gridname << "\n"
Expand Down Expand Up @@ -1340,7 +1352,7 @@ void usage() {
<< "\tinput_grid\n"
<< "\tmask_file\n"
<< "\tout_file\n"
<< "\t[-type string]\n"
<< "\t-type string\n"
<< "\t[-input_field string]\n"
<< "\t[-mask_field string]\n"
<< "\t[-complement]\n"
Expand Down Expand Up @@ -1380,12 +1392,12 @@ void usage() {
<< "\t\t\"out_file\" is the output NetCDF mask file to be "
<< "written (required).\n"

<< "\t\t\"-type string\" overrides the default masking type ("
<< masktype_to_string(default_mask_type) << ") (optional)\n"
<< "\t\t\"-type string\" specify the masking type "
<< "(required).\n"
<< "\t\t \"poly\", \"box\", \"circle\", \"track\", \"grid\", "
<< "\"data\", \"solar_alt\", \"solar_azi\", \"lat\", \"lon\" "
<< "or \"shape\"\n"

<< "\t\t\"-input_field string\" reads existing mask data from "
<< "the \"input_grid\" gridded data file (optional).\n"

Expand Down Expand Up @@ -1446,7 +1458,7 @@ void usage() {
void set_type(const StringArray & a) {
if(type_is_set) {
mlog << Error << "\n" << program_name << " -> "
<< "the -type command line option can only be used once!\n"
<< "the -type command line requirement can only be used once!\n"
<< "To apply multiple masks, run this tool multiple times "
<< "using the output of one run as the input to the next."
<< "\n\n";
Expand Down
7 changes: 4 additions & 3 deletions met/src/tools/other/gen_vx_mask/gen_vx_mask.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// 000 12/09/14 Halley Gotway New
// 001 06/02/16 Halley Gotway Add box masking type.
// 002 11/15/16 Halley Gotway Add solar masking types.
// 003 06/03/21 Seth Linden Changed default mask type to MaskType_None
//
////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -75,7 +76,7 @@ extern const char * masktype_to_string(MaskType);
//
////////////////////////////////////////////////////////////////////////

static const MaskType default_mask_type = MaskType_Poly;
static const MaskType default_mask_type = MaskType_None;
static const double default_mask_val = 1.0;

////////////////////////////////////////////////////////////////////////
Expand All @@ -86,10 +87,10 @@ static const double default_mask_val = 1.0;

// Input data file, mask file, and output NetCDF file
static ConcatString input_gridname, mask_filename, out_filename;

// Optional arguments
static MaskType mask_type = default_mask_type;
static bool type_is_set = false;

// Optional arguments
static ConcatString input_field_str, mask_field_str;
static SetLogic set_logic = SetLogic_None;
static bool complement = false;
Expand Down
10 changes: 5 additions & 5 deletions test/xml/unit_gen_vx_mask.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
&DATA_DIR_MODEL;/grib1/gfs/gfs_2012040900_F012.grib \
&MET_BASE;/poly/CONUS.poly \
&OUTPUT_DIR;/gen_vx_mask/POLY_GFS_LATLON_CONUS_mask.nc \
-v 1
-type poly -v 1
</param>
<output>
<grid_nc>&OUTPUT_DIR;/gen_vx_mask/POLY_GFS_LATLON_CONUS_mask.nc</grid_nc>
Expand All @@ -48,7 +48,7 @@
&DATA_DIR_MODEL;/grib1/gfs/gfs_2012040900_F012_g008.grib \
&MET_BASE;/poly/CONUS.poly \
&OUTPUT_DIR;/gen_vx_mask/POLY_GFS_MERCATOR_CONUS_mask.nc \
-v 1
-type poly -v 1
</param>
<output>
<grid_nc>&OUTPUT_DIR;/gen_vx_mask/POLY_GFS_MERCATOR_CONUS_mask.nc</grid_nc>
Expand All @@ -65,7 +65,7 @@
&DATA_DIR_MODEL;/grib1/nam/nam_2012040900_F012.grib \
&MET_BASE;/poly/CONUS.poly \
&OUTPUT_DIR;/gen_vx_mask/POLY_NAM_LAMBERT_CONUS_mask.nc \
-v 1
-type poly -v 1
</param>
<output>
<grid_nc>&OUTPUT_DIR;/gen_vx_mask/POLY_NAM_LAMBERT_CONUS_mask.nc</grid_nc>
Expand All @@ -82,7 +82,7 @@
&DATA_DIR_MODEL;/grib1/arw-tom-gep0/arw-tom-gep0_2012040900_F012.grib \
&MET_BASE;/poly/NWC.poly \
&OUTPUT_DIR;/gen_vx_mask/POLY_HMT_STEREO_NWC_mask.nc \
-v 1
-type poly -v 1
</param>
<output>
<grid_nc>&OUTPUT_DIR;/gen_vx_mask/POLY_HMT_STEREO_NWC_mask.nc</grid_nc>
Expand All @@ -100,7 +100,7 @@
&DATA_DIR_MODEL;/grib1/gfs/gfs_2012040900_F012.grib \
&MET_BASE;/poly/NAK.poly \
&OUTPUT_DIR;/gen_vx_mask/POLY_GFS_LATLON_NAK_mask.nc \
-v 1
-type poly -v 1
</param>
<output>
<grid_nc>&OUTPUT_DIR;/gen_vx_mask/POLY_GFS_LATLON_NAK_mask.nc</grid_nc>
Expand Down
2 changes: 1 addition & 1 deletion test/xml/unit_met_test_scripts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
&MET_DATA;/sample_fcst/2005080700/wrfprs_ruc13_24.tm00_G212 \
&MET_BASE;/poly/CONUS.poly \
&OUTPUT_DIR;/gen_vx_mask/CONUS_poly.nc \
-v 2
-type poly -v 2
</param>
<output>
<grid_nc>&OUTPUT_DIR;/gen_vx_mask/CONUS_poly.nc</grid_nc>
Expand Down
2 changes: 1 addition & 1 deletion test/xml/unit_ref_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
&DATA_DIR_MODEL;/grib1/ref_config/2011090200/AFWAv3.4_Noahv3.3/postprd/wrfprs_012.tm00 \
&MET_BASE;/poly/CONUS.poly \
&OUTPUT_DIR;/ref_config/gen_vx_mask/CONUS.nc \
-v 2
-type poly -v 2
</param>
<output>
<grid_nc>&OUTPUT_DIR;/ref_config/gen_vx_mask/CONUS.nc</grid_nc>
Expand Down

0 comments on commit 7761e94

Please sign in to comment.