From 53f37b8bf9a3ef861c026e842c565f7b370a2a06 Mon Sep 17 00:00:00 2001 From: BoiVuong-NOAA Date: Mon, 21 Dec 2020 13:52:42 +0000 Subject: [PATCH 1/2] Updated scripts gfs_v16.0 --- scripts/exgfs_atmos_awips_20km_1p0deg.sh | 2 ++ scripts/exgfs_atmos_grib_awips.sh | 2 ++ ush/scale_dec.sh | 23 +++++++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100755 ush/scale_dec.sh diff --git a/scripts/exgfs_atmos_awips_20km_1p0deg.sh b/scripts/exgfs_atmos_awips_20km_1p0deg.sh index 36c16fdf37..f1d69b3f59 100755 --- a/scripts/exgfs_atmos_awips_20km_1p0deg.sh +++ b/scripts/exgfs_atmos_awips_20km_1p0deg.sh @@ -89,6 +89,7 @@ export opt26=' -set_grib_max_bits 25 -fi -if ' export opt27=":(APCP|ACPCP|PRATE|CPRAT|DZDT):" export opt28=' -new_grid_interpolation budget -fi ' export TRIMRH=${TRIMRH:-$USHgfs/trim_rh.sh} +export SCALEDEC=${SCALDEC:-$USHgfs/scale_dec.sh} ############################################################### # Process GFS GRIB AWIP PRODUCTS IN GRIB2 # @@ -161,6 +162,7 @@ do ;; esac $TRIMRH awps_file_f${fcsthrs}_${GRID} + $SCALEDEC awps_file_f${fcsthrs}_${GRID} $GRB2INDEX awps_file_f${fcsthrs}_${GRID} awps_file_fi${fcsthrs}_${GRID} ########################################################################### diff --git a/scripts/exgfs_atmos_grib_awips.sh b/scripts/exgfs_atmos_grib_awips.sh index 1ccdc34b2b..669598f313 100755 --- a/scripts/exgfs_atmos_grib_awips.sh +++ b/scripts/exgfs_atmos_grib_awips.sh @@ -27,6 +27,7 @@ job_name=`echo $job|sed 's/[jpt]gfs/gfs/'` typeset -Z3 fcsthrs export PS4='gfs_grib_awips:f$fcsthrs:$SECONDS + ' +export SCALEDEC=${SCALDEC:-$USHgfs/scale_dec.sh} #if [ $fhcsthrs -t 100 ]; then # fcsthrs=0$fcsthrs @@ -91,6 +92,7 @@ set -x cp $COMIN/gfs.t${cyc}z.pgrb2b.0p25.f${fcsthrs} tmpfile2b cat tmpfile2 tmpfile2b > tmpfile $WGRIB2 tmpfile | grep -F -f $PARMproduct/gfs_awips_parmlist_g2 | $WGRIB2 -i -grib masterfile tmpfile + $SCALEDEC masterfile $CNVGRIB -g21 masterfile masterfile.grib1 ln -s masterfile.grib1 fort.11 diff --git a/ush/scale_dec.sh b/ush/scale_dec.sh new file mode 100755 index 0000000000..055909b02f --- /dev/null +++ b/ush/scale_dec.sh @@ -0,0 +1,23 @@ +#!/bin/ksh +# +# This script uses WGRIB2 to change binary scale factor +# and Decimal scale factor in GRIB2 file +# +# -set_scaling D B +# D = decimal scaling or the text 'same' with no quotes +# B = binary scaling or the text 'same' with no quotes +# +set -x + +f=$1 + +export WGRIB2=${WGRIB2:-${NWROOT}/grib_util.v1.1.0/exec/wgrib2} + +# export WGRIB2=/gpfs/dell1/nco/ops/nwprod/grib_util.v1.1.0/exec/wgrib2 + +$WGRIB2 $f -not_if ':(TMP|PWAT|WEASD):' -grib $f.new \ + -if ':(TMP|PWAT|WEASD):' -set_grib_type same \ + -set_scaling -1 0 -grib_out $f.new +export err=$?; err_chk +mv $f.new $f +exit 0 From eaa91a7927cc1f59f3709f5c5af401d9e5c20a1c Mon Sep 17 00:00:00 2001 From: BoiVuong-NOAA Date: Tue, 22 Dec 2020 03:54:04 +0000 Subject: [PATCH 2/2] Upaded ush script scale_dec.sh --- ush/scale_dec.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ush/scale_dec.sh b/ush/scale_dec.sh index 055909b02f..8fba2f703b 100755 --- a/ush/scale_dec.sh +++ b/ush/scale_dec.sh @@ -16,8 +16,10 @@ export WGRIB2=${WGRIB2:-${NWROOT}/grib_util.v1.1.0/exec/wgrib2} # export WGRIB2=/gpfs/dell1/nco/ops/nwprod/grib_util.v1.1.0/exec/wgrib2 $WGRIB2 $f -not_if ':(TMP|PWAT|WEASD):' -grib $f.new \ - -if ':(TMP|PWAT|WEASD):' -set_grib_type same \ - -set_scaling -1 0 -grib_out $f.new + -if ':(TMP|PWAT):' -set_grib_type same \ + -set_scaling -1 0 -grib_out $f.new \ + -if ':(WEASD):' -set_grib_type same \ + -set_scaling 0 0 -grib_out $f.new export err=$?; err_chk mv $f.new $f exit 0