From d165b34d2ae2ced2c1bc107e234ea7074041c863 Mon Sep 17 00:00:00 2001 From: "Eric.Sinsky" Date: Thu, 12 Dec 2024 20:24:38 +0000 Subject: [PATCH 1/5] Add condition to run mod_icec function --- ush/interp_atmos_master.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ush/interp_atmos_master.sh b/ush/interp_atmos_master.sh index 4c4ee4b03c1..83c375690b1 100755 --- a/ush/interp_atmos_master.sh +++ b/ush/interp_atmos_master.sh @@ -53,7 +53,10 @@ export err=$?; err_chk # trim and mask for all grids for grid in "${grids[@]}"; do trim_rh "${output_file_prefix}_${grid}"; export err=$?; err_chk - mod_icec "${output_file_prefix}_${grid}"; export err=$?; err_chk + count=$($WGRIB2 "${output_file_prefix}_${grid}" -match "LAND|ICEC" |wc -l) + if [ ${count} -eq 2 ]; then + mod_icec "${output_file_prefix}_${grid}"; export err=$?; err_chk + fi done exit 0 From 5064f89a24ebd815d050751bac41adb7e722e9fd Mon Sep 17 00:00:00 2001 From: "Eric.Sinsky" Date: Mon, 16 Dec 2024 13:37:48 +0000 Subject: [PATCH 2/5] Comply with shellnorms --- ush/interp_atmos_master.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ush/interp_atmos_master.sh b/ush/interp_atmos_master.sh index 83c375690b1..de293517246 100755 --- a/ush/interp_atmos_master.sh +++ b/ush/interp_atmos_master.sh @@ -53,7 +53,7 @@ export err=$?; err_chk # trim and mask for all grids for grid in "${grids[@]}"; do trim_rh "${output_file_prefix}_${grid}"; export err=$?; err_chk - count=$($WGRIB2 "${output_file_prefix}_${grid}" -match "LAND|ICEC" |wc -l) + count=$(${WGRIB2} "${output_file_prefix}_${grid}" -match "LAND|ICEC" |wc -l) if [ ${count} -eq 2 ]; then mod_icec "${output_file_prefix}_${grid}"; export err=$?; err_chk fi From dfbbc24550e1c0c5ba9ef69e5d3c46e709866089 Mon Sep 17 00:00:00 2001 From: "Eric.Sinsky" Date: Mon, 16 Dec 2024 14:06:51 +0000 Subject: [PATCH 3/5] Fix shellnorms --- ush/interp_atmos_master.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ush/interp_atmos_master.sh b/ush/interp_atmos_master.sh index de293517246..64f1eacb22e 100755 --- a/ush/interp_atmos_master.sh +++ b/ush/interp_atmos_master.sh @@ -54,7 +54,7 @@ export err=$?; err_chk for grid in "${grids[@]}"; do trim_rh "${output_file_prefix}_${grid}"; export err=$?; err_chk count=$(${WGRIB2} "${output_file_prefix}_${grid}" -match "LAND|ICEC" |wc -l) - if [ ${count} -eq 2 ]; then + if [[ "${count}" -eq 2 ]]; then mod_icec "${output_file_prefix}_${grid}"; export err=$?; err_chk fi done From 0545d7910e16b1cf7a34b956e0872002fb2c5988 Mon Sep 17 00:00:00 2001 From: "Eric.Sinsky" Date: Mon, 23 Dec 2024 17:07:16 +0000 Subject: [PATCH 4/5] Use more descriptive variable name --- ush/interp_atmos_master.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ush/interp_atmos_master.sh b/ush/interp_atmos_master.sh index 64f1eacb22e..1694357178c 100755 --- a/ush/interp_atmos_master.sh +++ b/ush/interp_atmos_master.sh @@ -53,8 +53,8 @@ export err=$?; err_chk # trim and mask for all grids for grid in "${grids[@]}"; do trim_rh "${output_file_prefix}_${grid}"; export err=$?; err_chk - count=$(${WGRIB2} "${output_file_prefix}_${grid}" -match "LAND|ICEC" |wc -l) - if [[ "${count}" -eq 2 ]]; then + var_count=$(${WGRIB2} "${output_file_prefix}_${grid}" -match "LAND|ICEC" |wc -l) + if [[ "${var_count}" -eq 2 ]]; then mod_icec "${output_file_prefix}_${grid}"; export err=$?; err_chk fi done From dbe9c738c5175ea81f3279d1bcbce19fc86dbef5 Mon Sep 17 00:00:00 2001 From: "Eric.Sinsky" Date: Mon, 23 Dec 2024 17:10:13 +0000 Subject: [PATCH 5/5] Add shellcheck disable --- ush/interp_atmos_master.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ush/interp_atmos_master.sh b/ush/interp_atmos_master.sh index 1694357178c..3a3edc470b1 100755 --- a/ush/interp_atmos_master.sh +++ b/ush/interp_atmos_master.sh @@ -53,6 +53,7 @@ export err=$?; err_chk # trim and mask for all grids for grid in "${grids[@]}"; do trim_rh "${output_file_prefix}_${grid}"; export err=$?; err_chk + # shellcheck disable=SC2312 var_count=$(${WGRIB2} "${output_file_prefix}_${grid}" -match "LAND|ICEC" |wc -l) if [[ "${var_count}" -eq 2 ]]; then mod_icec "${output_file_prefix}_${grid}"; export err=$?; err_chk