Skip to content

Commit

Permalink
Merge pull request #225 from NOAA-EMC/update_gfsv16
Browse files Browse the repository at this point in the history
Update gfsv16
  • Loading branch information
yangfanglin authored Dec 22, 2020
2 parents e89045b + eaa91a7 commit 47efddf
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/exgfs_atmos_awips_20km_1p0deg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 #
Expand Down Expand Up @@ -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}

###########################################################################
Expand Down
2 changes: 2 additions & 0 deletions scripts/exgfs_atmos_grib_awips.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
25 changes: 25 additions & 0 deletions ush/scale_dec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/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):' -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

0 comments on commit 47efddf

Please sign in to comment.