From 8001b51868dda53ca951976edbd35bcc73c5d486 Mon Sep 17 00:00:00 2001 From: gerard ketefian Date: Wed, 22 Mar 2023 15:17:13 -0600 Subject: [PATCH] Rename MET/METplus name-related variables for clarity. --- ...onal_run_met_genensprod_or_ensemblestat.sh | 22 +++---- ...gional_run_met_gridstat_or_pointstat_vx.sh | 22 +++---- ...un_met_gridstat_or_pointstat_vx_ensmean.sh | 22 +++---- ...un_met_gridstat_or_pointstat_vx_ensprob.sh | 22 +++---- scripts/exregional_run_met_pb2nc_obs.sh | 22 +++---- scripts/exregional_run_met_pcpcombine.sh | 22 +++---- ...l_name.sh => get_met_metplus_tool_name.sh} | 65 ++++++++++--------- 7 files changed, 100 insertions(+), 97 deletions(-) rename ush/{set_met_tool_name.sh => get_met_metplus_tool_name.sh} (60%) diff --git a/scripts/exregional_run_met_genensprod_or_ensemblestat.sh b/scripts/exregional_run_met_genensprod_or_ensemblestat.sh index b43694cd37..8812475d43 100755 --- a/scripts/exregional_run_met_genensprod_or_ensemblestat.sh +++ b/scripts/exregional_run_met_genensprod_or_ensemblestat.sh @@ -16,7 +16,7 @@ source_config_for_task "task_run_vx_ensgrid|task_run_post" ${GLOBAL_VAR_DEFNS_FP # #----------------------------------------------------------------------- # -. $USHdir/set_met_tool_name.sh +. $USHdir/get_met_metplus_tool_name.sh . $USHdir/set_vx_params.sh . $USHdir/set_vx_fhr_list.sh # @@ -48,10 +48,10 @@ scrfunc_dir=$( dirname "${scrfunc_fp}" ) # #----------------------------------------------------------------------- # -set_met_tool_name \ - met_tool="${MET_TOOL}" \ - outvarname_met_tool_sc="met_tool_sc" \ - outvarname_met_tool_pc="met_tool_pc" +get_met_metplus_tool_name \ + generic_tool_name="${MET_TOOL}" \ + outvarname_met_tool_name="met_tool_name" \ + outvarname_metplus_tool_name="metplus_tool_name" # #----------------------------------------------------------------------- # @@ -74,7 +74,7 @@ print_info_msg " Entering script: \"${scrfunc_fn}\" In directory: \"${scrfunc_dir}\" -This is the ex-script for the task that runs the METplus ${met_tool_pc} +This is the ex-script for the task that runs the METplus ${metplus_tool_name} tool either to generate ensemble products without performing verification (if running the GenEnsProd tool) or to perform ensemble-based verification (if running the EnsembleStat tool). @@ -239,7 +239,7 @@ ${FCST_INPUT_FN_TEMPLATE}, done OUTPUT_BASE="${vx_output_basedir}${slash_cdate_or_null}" -OUTPUT_DIR="${OUTPUT_BASE}/metprd/${met_tool_pc}" +OUTPUT_DIR="${OUTPUT_BASE}/metprd/${metplus_tool_name}" STAGING_DIR="${OUTPUT_BASE}/stage/${FIELDNAME_IN_MET_FILEDIR_NAMES}" # #----------------------------------------------------------------------- @@ -319,8 +319,8 @@ if [ "${field_is_APCPgt01h}" = "TRUE" ]; then else metplus_config_tmpl_fn="${FIELDNAME_IN_MET_FILEDIR_NAMES}" fi -metplus_config_tmpl_fn="${met_tool_pc}_${metplus_config_tmpl_fn}" -metplus_config_fn="${met_tool_pc}_${FIELDNAME_IN_MET_FILEDIR_NAMES}" +metplus_config_tmpl_fn="${metplus_tool_name}_${metplus_config_tmpl_fn}" +metplus_config_fn="${metplus_tool_name}_${FIELDNAME_IN_MET_FILEDIR_NAMES}" metplus_log_fn="${metplus_config_fn}" # # Add prefixes and suffixes (extensions) to the base file names. @@ -409,7 +409,7 @@ $settings" #----------------------------------------------------------------------- # print_info_msg "$VERBOSE" " -Calling METplus to run MET's ${met_tool_sc} tool for field(s): ${FIELDNAME_IN_MET_FILEDIR_NAMES}" +Calling METplus to run MET's ${met_tool_name} tool for field(s): ${FIELDNAME_IN_MET_FILEDIR_NAMES}" ${METPLUS_PATH}/ush/run_metplus.py \ -c ${METPLUS_CONF}/common.conf \ -c ${metplus_config_fp} || \ @@ -426,7 +426,7 @@ METplus configuration file used is: # print_info_msg " ======================================================================== -METplus ${met_tool_pc} tool completed successfully. +METplus ${metplus_tool_name} tool completed successfully. Exiting script: \"${scrfunc_fn}\" In directory: \"${scrfunc_dir}\" diff --git a/scripts/exregional_run_met_gridstat_or_pointstat_vx.sh b/scripts/exregional_run_met_gridstat_or_pointstat_vx.sh index 51b87b97dc..c7a0f708aa 100755 --- a/scripts/exregional_run_met_gridstat_or_pointstat_vx.sh +++ b/scripts/exregional_run_met_gridstat_or_pointstat_vx.sh @@ -16,7 +16,7 @@ source_config_for_task "task_run_vx_gridstat|task_run_vx_pointstat|task_run_post # #----------------------------------------------------------------------- # -. $USHdir/set_met_tool_name.sh +. $USHdir/get_met_metplus_tool_name.sh . $USHdir/set_vx_params.sh . $USHdir/set_vx_fhr_list.sh # @@ -48,10 +48,10 @@ scrfunc_dir=$( dirname "${scrfunc_fp}" ) # #----------------------------------------------------------------------- # -set_met_tool_name \ - met_tool="${MET_TOOL}" \ - outvarname_met_tool_sc="met_tool_sc" \ - outvarname_met_tool_pc="met_tool_pc" +get_met_metplus_tool_name \ + generic_tool_name="${MET_TOOL}" \ + outvarname_met_tool_name="met_tool_name" \ + outvarname_metplus_tool_name="metplus_tool_name" # #----------------------------------------------------------------------- # @@ -64,7 +64,7 @@ print_info_msg " Entering script: \"${scrfunc_fn}\" In directory: \"${scrfunc_dir}\" -This is the ex-script for the task that runs the METplus ${met_tool_pc} +This is the ex-script for the task that runs the METplus ${metplus_tool_name} tool to perform deterministic verification of the specified field (VAR) for a single forecast. ========================================================================" @@ -221,7 +221,7 @@ elif [ "${grid_or_point}" = "point" ]; then fi OUTPUT_BASE="${vx_output_basedir}${slash_cdate_ensmem_subdir_or_null}" -OUTPUT_DIR="${OUTPUT_BASE}/metprd/${met_tool_pc}" +OUTPUT_DIR="${OUTPUT_BASE}/metprd/${metplus_tool_name}" STAGING_DIR="${OUTPUT_BASE}/stage/${FIELDNAME_IN_MET_FILEDIR_NAMES}" # #----------------------------------------------------------------------- @@ -301,8 +301,8 @@ if [ "${field_is_APCPgt01h}" = "TRUE" ]; then else metplus_config_tmpl_fn="${FIELDNAME_IN_MET_FILEDIR_NAMES}" fi -metplus_config_tmpl_fn="${met_tool_pc}_${metplus_config_tmpl_fn}" -metplus_config_fn="${met_tool_pc}_${FIELDNAME_IN_MET_FILEDIR_NAMES}${USCORE_ENSMEM_NAME_OR_NULL}" +metplus_config_tmpl_fn="${metplus_tool_name}_${metplus_config_tmpl_fn}" +metplus_config_fn="${metplus_tool_name}_${FIELDNAME_IN_MET_FILEDIR_NAMES}${USCORE_ENSMEM_NAME_OR_NULL}" metplus_log_fn="${metplus_config_fn}" # # Add prefixes and suffixes (extensions) to the base file names. @@ -391,7 +391,7 @@ $settings" #----------------------------------------------------------------------- # print_info_msg "$VERBOSE" " -Calling METplus to run MET's ${met_tool_sc} tool for field(s): ${FIELDNAME_IN_MET_FILEDIR_NAMES}" +Calling METplus to run MET's ${met_tool_name} tool for field(s): ${FIELDNAME_IN_MET_FILEDIR_NAMES}" ${METPLUS_PATH}/ush/run_metplus.py \ -c ${METPLUS_CONF}/common.conf \ -c ${metplus_config_fp} || \ @@ -408,7 +408,7 @@ METplus configuration file used is: # print_info_msg " ======================================================================== -METplus ${met_tool_pc} tool completed successfully. +METplus ${metplus_tool_name} tool completed successfully. Exiting script: \"${scrfunc_fn}\" In directory: \"${scrfunc_dir}\" diff --git a/scripts/exregional_run_met_gridstat_or_pointstat_vx_ensmean.sh b/scripts/exregional_run_met_gridstat_or_pointstat_vx_ensmean.sh index 578a52bf8e..25edcef6c6 100755 --- a/scripts/exregional_run_met_gridstat_or_pointstat_vx_ensmean.sh +++ b/scripts/exregional_run_met_gridstat_or_pointstat_vx_ensmean.sh @@ -16,7 +16,7 @@ source_config_for_task "task_run_vx_ensgrid_mean|task_run_vx_enspoint_mean|task_ # #----------------------------------------------------------------------- # -. $USHdir/set_met_tool_name.sh +. $USHdir/get_met_metplus_tool_name.sh . $USHdir/set_vx_params.sh . $USHdir/set_vx_fhr_list.sh # @@ -48,10 +48,10 @@ scrfunc_dir=$( dirname "${scrfunc_fp}" ) # #----------------------------------------------------------------------- # -set_met_tool_name \ - met_tool="${MET_TOOL}" \ - outvarname_met_tool_sc="met_tool_sc" \ - outvarname_met_tool_pc="met_tool_pc" +get_met_metplus_tool_name \ + generic_tool_name="${MET_TOOL}" \ + outvarname_met_tool_name="met_tool_name" \ + outvarname_metplus_tool_name="metplus_tool_name" # #----------------------------------------------------------------------- # @@ -64,7 +64,7 @@ print_info_msg " Entering script: \"${scrfunc_fn}\" In directory: \"${scrfunc_dir}\" -This is the ex-script for the task that runs the METplus ${met_tool_pc} +This is the ex-script for the task that runs the METplus ${metplus_tool_name} tool to perform verification of the specified field (VAR) on the ensemble mean. ========================================================================" @@ -196,7 +196,7 @@ elif [ "${grid_or_point}" = "point" ]; then fi OUTPUT_BASE="${vx_output_basedir}${slash_cdate_or_null}" -OUTPUT_DIR="${OUTPUT_BASE}/metprd/${met_tool_pc}_ensmean" +OUTPUT_DIR="${OUTPUT_BASE}/metprd/${metplus_tool_name}_ensmean" STAGING_DIR="${OUTPUT_BASE}/stage/${FIELDNAME_IN_MET_FILEDIR_NAMES}_ensmean" # #----------------------------------------------------------------------- @@ -285,8 +285,8 @@ if [ "${field_is_APCPgt01h}" = "TRUE" ]; then else metplus_config_tmpl_fn="${FIELDNAME_IN_MET_FILEDIR_NAMES}" fi -metplus_config_tmpl_fn="${met_tool_pc}_ensmean_${metplus_config_tmpl_fn}" -metplus_config_fn="${met_tool_pc}_ensmean_${FIELDNAME_IN_MET_FILEDIR_NAMES}" +metplus_config_tmpl_fn="${metplus_tool_name}_ensmean_${metplus_config_tmpl_fn}" +metplus_config_fn="${metplus_tool_name}_ensmean_${FIELDNAME_IN_MET_FILEDIR_NAMES}" metplus_log_fn="${metplus_config_fn}" # # Add prefixes and suffixes (extensions) to the base file names. @@ -375,7 +375,7 @@ $settings" #----------------------------------------------------------------------- # print_info_msg "$VERBOSE" " -Calling METplus to run MET's ${met_tool_sc} tool for field(s): ${FIELDNAME_IN_MET_FILEDIR_NAMES}" +Calling METplus to run MET's ${met_tool_name} tool for field(s): ${FIELDNAME_IN_MET_FILEDIR_NAMES}" ${METPLUS_PATH}/ush/run_metplus.py \ -c ${METPLUS_CONF}/common.conf \ -c ${metplus_config_fp} || \ @@ -392,7 +392,7 @@ METplus configuration file used is: # print_info_msg " ======================================================================== -METplus ${met_tool_pc} tool completed successfully. +METplus ${metplus_tool_name} tool completed successfully. Exiting script: \"${scrfunc_fn}\" In directory: \"${scrfunc_dir}\" diff --git a/scripts/exregional_run_met_gridstat_or_pointstat_vx_ensprob.sh b/scripts/exregional_run_met_gridstat_or_pointstat_vx_ensprob.sh index 97109ac109..f2701d4303 100755 --- a/scripts/exregional_run_met_gridstat_or_pointstat_vx_ensprob.sh +++ b/scripts/exregional_run_met_gridstat_or_pointstat_vx_ensprob.sh @@ -16,7 +16,7 @@ source_config_for_task "task_run_vx_ensgrid_prob|task_run_vx_enspoint_prob|task_ # #----------------------------------------------------------------------- # -. $USHdir/set_met_tool_name.sh +. $USHdir/get_met_metplus_tool_name.sh . $USHdir/set_vx_params.sh . $USHdir/set_vx_fhr_list.sh # @@ -48,10 +48,10 @@ scrfunc_dir=$( dirname "${scrfunc_fp}" ) # #----------------------------------------------------------------------- # -set_met_tool_name \ - met_tool="${MET_TOOL}" \ - outvarname_met_tool_sc="met_tool_sc" \ - outvarname_met_tool_pc="met_tool_pc" +get_met_metplus_tool_name \ + generic_tool_name="${MET_TOOL}" \ + outvarname_met_tool_name="met_tool_name" \ + outvarname_metplus_tool_name="metplus_tool_name" # #----------------------------------------------------------------------- # @@ -64,7 +64,7 @@ print_info_msg " Entering script: \"${scrfunc_fn}\" In directory: \"${scrfunc_dir}\" -This is the ex-script for the task that runs the METplus ${met_tool_pc} +This is the ex-script for the task that runs the METplus ${metplus_tool_name} tool to perform verification of the specified field (VAR) on the ensemble frequencies/probabilities. ========================================================================" @@ -155,7 +155,7 @@ elif [ "${grid_or_point}" = "point" ]; then fi OUTPUT_BASE="${vx_output_basedir}${slash_cdate_or_null}" -OUTPUT_DIR="${OUTPUT_BASE}/metprd/${met_tool_pc}_ensprob" +OUTPUT_DIR="${OUTPUT_BASE}/metprd/${metplus_tool_name}_ensprob" STAGING_DIR="${OUTPUT_BASE}/stage/${FIELDNAME_IN_MET_FILEDIR_NAMES}_ensprob" # #----------------------------------------------------------------------- @@ -247,8 +247,8 @@ if [ "${field_is_APCPgt01h}" = "TRUE" ]; then else metplus_config_tmpl_fn="${FIELDNAME_IN_MET_FILEDIR_NAMES}" fi -metplus_config_tmpl_fn="${met_tool_pc}_ensprob_${metplus_config_tmpl_fn}" -metplus_config_fn="${met_tool_pc}_ensprob_${FIELDNAME_IN_MET_FILEDIR_NAMES}" +metplus_config_tmpl_fn="${metplus_tool_name}_ensprob_${metplus_config_tmpl_fn}" +metplus_config_fn="${metplus_tool_name}_ensprob_${FIELDNAME_IN_MET_FILEDIR_NAMES}" metplus_log_fn="${metplus_config_fn}" # # Add prefixes and suffixes (extensions) to the base file names. @@ -337,7 +337,7 @@ $settings" #----------------------------------------------------------------------- # print_info_msg "$VERBOSE" " -Calling METplus to run MET's ${met_tool_sc} tool for field(s): ${FIELDNAME_IN_MET_FILEDIR_NAMES}" +Calling METplus to run MET's ${met_tool_name} tool for field(s): ${FIELDNAME_IN_MET_FILEDIR_NAMES}" ${METPLUS_PATH}/ush/run_metplus.py \ -c ${METPLUS_CONF}/common.conf \ -c ${metplus_config_fp} || \ @@ -354,7 +354,7 @@ METplus configuration file used is: # print_info_msg " ======================================================================== -METplus ${met_tool_pc} tool completed successfully. +METplus ${metplus_tool_name} tool completed successfully. Exiting script: \"${scrfunc_fn}\" In directory: \"${scrfunc_dir}\" diff --git a/scripts/exregional_run_met_pb2nc_obs.sh b/scripts/exregional_run_met_pb2nc_obs.sh index 899724e4cb..f6c1c9153b 100755 --- a/scripts/exregional_run_met_pb2nc_obs.sh +++ b/scripts/exregional_run_met_pb2nc_obs.sh @@ -16,7 +16,7 @@ source_config_for_task "task_run_met_pb2nc_obs" ${GLOBAL_VAR_DEFNS_FP} # #----------------------------------------------------------------------- # -. $USHdir/set_met_tool_name.sh +. $USHdir/get_met_metplus_tool_name.sh . $USHdir/set_vx_params.sh . $USHdir/set_vx_fhr_list.sh # @@ -48,10 +48,10 @@ scrfunc_dir=$( dirname "${scrfunc_fp}" ) # #----------------------------------------------------------------------- # -set_met_tool_name \ - met_tool="${MET_TOOL}" \ - outvarname_met_tool_sc="met_tool_sc" \ - outvarname_met_tool_pc="met_tool_pc" +get_met_metplus_tool_name \ + generic_tool_name="${MET_TOOL}" \ + outvarname_met_tool_name="met_tool_name" \ + outvarname_metplus_tool_name="metplus_tool_name" # #----------------------------------------------------------------------- # @@ -64,7 +64,7 @@ print_info_msg " Entering script: \"${scrfunc_fn}\" In directory: \"${scrfunc_dir}\" -This is the ex-script for the task that runs the METplus tool ${met_tool_pc} +This is the ex-script for the task that runs the METplus tool ${metplus_tool_name} to convert NDAS prep buffer observation files to NetCDF format. ========================================================================" # @@ -123,9 +123,9 @@ OBS_INPUT_DIR="${OBS_DIR}" OBS_INPUT_FN_TEMPLATE=$( eval echo ${OBS_NDAS_SFCorUPA_FN_TEMPLATE} ) OUTPUT_BASE="${vx_output_basedir}" -OUTPUT_DIR="${OUTPUT_BASE}/metprd/${met_tool_pc}_obs" +OUTPUT_DIR="${OUTPUT_BASE}/metprd/${metplus_tool_name}_obs" OUTPUT_FN_TEMPLATE="${OBS_INPUT_FN_TEMPLATE}.nc" -STAGING_DIR="${OUTPUT_BASE}/stage/${met_tool_pc}_obs" +STAGING_DIR="${OUTPUT_BASE}/stage/${metplus_tool_name}_obs" # #----------------------------------------------------------------------- # @@ -199,7 +199,7 @@ fi # # First, set the base file names. # -metplus_config_tmpl_fn="${met_tool_pc}_obs" +metplus_config_tmpl_fn="${metplus_tool_name}_obs" # # Note that we append the cycle date to the name of the configuration # file because we are considering only observations when using Pb2NC, so @@ -306,7 +306,7 @@ $settings" #----------------------------------------------------------------------- # print_info_msg "$VERBOSE" " -Calling METplus to run MET's ${met_tool_sc} tool on observations of type: ${OBTYPE}" +Calling METplus to run MET's ${met_tool_name} tool on observations of type: ${OBTYPE}" ${METPLUS_PATH}/ush/run_metplus.py \ -c ${METPLUS_CONF}/common.conf \ -c ${metplus_config_fp} || \ @@ -323,7 +323,7 @@ METplus configuration file used is: # print_info_msg " ======================================================================== -METplus ${met_tool_pc} tool completed successfully. +METplus ${metplus_tool_name} tool completed successfully. Exiting script: \"${scrfunc_fn}\" In directory: \"${scrfunc_dir}\" diff --git a/scripts/exregional_run_met_pcpcombine.sh b/scripts/exregional_run_met_pcpcombine.sh index 0b60c0ca22..4d6d5457f9 100755 --- a/scripts/exregional_run_met_pcpcombine.sh +++ b/scripts/exregional_run_met_pcpcombine.sh @@ -16,7 +16,7 @@ source_config_for_task "task_run_met_pcpcombine|task_run_post" ${GLOBAL_VAR_DEFN # #----------------------------------------------------------------------- # -. $USHdir/set_met_tool_name.sh +. $USHdir/get_met_metplus_tool_name.sh . $USHdir/set_vx_params.sh . $USHdir/set_vx_fhr_list.sh # @@ -48,10 +48,10 @@ scrfunc_dir=$( dirname "${scrfunc_fp}" ) # #----------------------------------------------------------------------- # -set_met_tool_name \ - met_tool="${MET_TOOL}" \ - outvarname_met_tool_sc="met_tool_sc" \ - outvarname_met_tool_pc="met_tool_pc" +get_met_metplus_tool_name \ + generic_tool_name="${MET_TOOL}" \ + outvarname_met_tool_name="met_tool_name" \ + outvarname_metplus_tool_name="metplus_tool_name" # #----------------------------------------------------------------------- # @@ -64,7 +64,7 @@ print_info_msg " Entering script: \"${scrfunc_fn}\" In directory: \"${scrfunc_dir}\" -This is the ex-script for the task that runs the METplus ${met_tool_pc} +This is the ex-script for the task that runs the METplus ${metplus_tool_name} tool to combine hourly accumulated precipitation (APCP) data to generate files containing multi-hour accumulated precipitation (e.g. 3-hour, 6- hour, 24-hour). The input files can come from either observations or @@ -160,7 +160,7 @@ if [ "${obs_or_fcst}" = "obs" ]; then OBS_INPUT_FN_TEMPLATE=$( eval echo ${OBS_CCPA_APCP01h_FN_TEMPLATE} ) OUTPUT_BASE="${vx_output_basedir}" - OUTPUT_DIR="${OUTPUT_BASE}/metprd/${met_tool_pc}_obs" + OUTPUT_DIR="${OUTPUT_BASE}/metprd/${metplus_tool_name}_obs" OUTPUT_FN_TEMPLATE=$( eval echo ${OBS_CCPA_APCPgt01h_FN_TEMPLATE} ) STAGING_DIR="${OUTPUT_BASE}/stage/${FIELDNAME_IN_MET_FILEDIR_NAMES}" @@ -170,7 +170,7 @@ elif [ "${obs_or_fcst}" = "fcst" ]; then FCST_INPUT_FN_TEMPLATE=$( eval echo ${FCST_SUBDIR_TEMPLATE:+${FCST_SUBDIR_TEMPLATE}/}${FCST_FN_TEMPLATE} ) OUTPUT_BASE="${vx_output_basedir}${slash_cdate_ensmem_subdir_or_null}" - OUTPUT_DIR="${OUTPUT_BASE}/metprd/${met_tool_pc}_fcst" + OUTPUT_DIR="${OUTPUT_BASE}/metprd/${metplus_tool_name}_fcst" OUTPUT_FN_TEMPLATE=$( eval echo ${FCST_FN_METPROC_TEMPLATE} ) STAGING_DIR="${OUTPUT_BASE}/stage/${FIELDNAME_IN_MET_FILEDIR_NAMES}" @@ -256,7 +256,7 @@ fi # # First, set the base file names. # -metplus_config_tmpl_fn="${met_tool_pc}_${obs_or_fcst}" +metplus_config_tmpl_fn="${metplus_tool_name}_${obs_or_fcst}" metplus_config_fn="${metplus_config_tmpl_fn}_${FIELDNAME_IN_MET_FILEDIR_NAMES}${USCORE_ENSMEM_NAME_OR_NULL}" metplus_log_fn="${metplus_config_fn}_$CDATE" # @@ -356,7 +356,7 @@ $settings" #----------------------------------------------------------------------- # print_info_msg "$VERBOSE" " -Calling METplus to run MET's ${met_tool_sc} tool for field(s): ${FIELDNAME_IN_MET_FILEDIR_NAMES}" +Calling METplus to run MET's ${met_tool_name} tool for field(s): ${FIELDNAME_IN_MET_FILEDIR_NAMES}" ${METPLUS_PATH}/ush/run_metplus.py \ -c ${METPLUS_CONF}/common.conf \ -c ${metplus_config_fp} || \ @@ -373,7 +373,7 @@ METplus configuration file used is: # print_info_msg " ======================================================================== -METplus ${met_tool_pc} tool completed successfully. +METplus ${metplus_tool_name} tool completed successfully. Exiting script: \"${scrfunc_fn}\" In directory: \"${scrfunc_dir}\" diff --git a/ush/set_met_tool_name.sh b/ush/get_met_metplus_tool_name.sh similarity index 60% rename from ush/set_met_tool_name.sh rename to ush/get_met_metplus_tool_name.sh index aa957911bf..9ecadfbcb8 100644 --- a/ush/set_met_tool_name.sh +++ b/ush/get_met_metplus_tool_name.sh @@ -1,15 +1,17 @@ # #----------------------------------------------------------------------- # -# This file defines a function that uses the specified name of the MET -# METplus tool without separators (e.g. underscores) and in either lower -# or upper case (met_tool) to set its name in "snake case" (i.e. using -# underscores as separators) and "pascal case" (i.e. no separators but -# first letter of each word capitalized.) +# This file defines a function that uses the given generic name of a MET/ +# METplus tool (generic_tool_name; this is a name that does not contain +# any separators like underscores and that may be in upper or lower case) +# to set its name in MET (met_tool_name) and in METplus (metplus_tool_name). +# Note that the tool name in MET is in "snake case" (i.e. uses underscores +# as separators with all lower case) while that in METplus is in "pascal +# case" (i.e. no separators and with first letter of each word capitalized). # #----------------------------------------------------------------------- # -function set_met_tool_name() { +function get_met_metplus_tool_name() { # #----------------------------------------------------------------------- # @@ -29,9 +31,9 @@ function set_met_tool_name() { #----------------------------------------------------------------------- # local valid_args=( \ - "met_tool" \ - "outvarname_met_tool_sc" \ - "outvarname_met_tool_pc" \ + "generic_tool_name" \ + "outvarname_met_tool_name" \ + "outvarname_metplus_tool_name" \ ) process_args valid_args "$@" # @@ -51,8 +53,8 @@ function set_met_tool_name() { # #----------------------------------------------------------------------- # - local _met_tool_sc_ \ - _met_tool_pc_ + local _generic_tool_name_name_ \ + _metplus_tool_name_ # #----------------------------------------------------------------------- # @@ -61,38 +63,39 @@ function set_met_tool_name() { # #----------------------------------------------------------------------- # - met_tool=${met_tool,,} - valid_vals_met_tool=( \ + generic_tool_name=${generic_tool_name,,} + valid_vals_generic_tool_name=( \ "PB2NC" "PCPCOMBINE" "GRIDSTAT" "POINTSTAT" "ENSEMBLESTAT" \ "pb2nc" "pcpcombine" "gridstat" "pointstat" "ensemblestat" \ ) - check_var_valid_value "met_tool" "valid_vals_met_tool" + check_var_valid_value "generic_tool_name" "valid_vals_generic_tool_name" - case "${met_tool}" in + case "${generic_tool_name}" in "pb2nc") - _met_tool_sc_="pb2nc" - _met_tool_pc_="Pb2nc" + _met_tool_name_="pb2nc" + _metplus_tool_name_="Pb2nc" ;; "pcpcombine") - _met_tool_sc_="pcp_combine" - _met_tool_pc_="PcpCombine" + _met_tool_name_="pcp_combine" + _metplus_tool_name_="PcpCombine" ;; "gridstat") - _met_tool_sc_="grid_stat" - _met_tool_pc_="GridStat" + _met_tool_name_="grid_stat" + _metplus_tool_name_="GridStat" ;; "pointstat") - _met_tool_sc_="point_stat" - _met_tool_pc_="PointStat" + _met_tool_name_="point_stat" + _metplus_tool_name_="PointStat" ;; "ensemblestat") - _met_tool_sc_="ensemble_stat" - _met_tool_pc_="EnsembleStat" + _met_tool_name_="ensemble_stat" + _metplus_tool_name_="EnsembleStat" ;; *) print_err_msg_exit "\ -Value specified for met_tool is unupported: - met_tool = \"${met_tool}\"" +Generic name specified for MET/METplus tool (generic_tool_name) is +unupported: + generic_tool_name = \"${generic_tool_name}\"" ;; esac # @@ -102,12 +105,12 @@ Value specified for met_tool is unupported: # #----------------------------------------------------------------------- # - if [ ! -z "${outvarname_met_tool_sc}" ]; then - printf -v ${outvarname_met_tool_sc} "%s" "${_met_tool_sc_}" + if [ ! -z "${outvarname_met_tool_name}" ]; then + printf -v ${outvarname_met_tool_name} "%s" "${_met_tool_name_}" fi - if [ ! -z "${outvarname_met_tool_pc}" ]; then - printf -v ${outvarname_met_tool_pc} "%s" "${_met_tool_pc_}" + if [ ! -z "${outvarname_metplus_tool_name}" ]; then + printf -v ${outvarname_metplus_tool_name} "%s" "${_metplus_tool_name_}" fi # #-----------------------------------------------------------------------