Skip to content

Commit

Permalink
Improve the atmos_awips job for GEFSv13
Browse files Browse the repository at this point in the history
 On branch feature/gefs_v13_atmos_prep
	modified:   jobs/JGEFS_ATMOS_AWIPS
	modified:   scripts/exgefs_atmos_awips.sh
	modified:   ush/gefs_atmos_getsbn.sh

Refs: NOAA-EMC#102
  • Loading branch information
XianwuXue-NOAA committed Jan 26, 2023
1 parent 58f095f commit 86a47f0
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 23 deletions.
13 changes: 9 additions & 4 deletions jobs/JGEFS_ATMOS_AWIPS
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,23 @@ export COMPONENT=${COMPONENT:-atmos}
ver=${ver:-$(echo ${gefs_ver}|cut -c1-5)}
export COMIN=${COMIN:-$(compath.py $envir/com/$NET/${ver})/${RUN}.${PDY}/$cyc}
export COMOUT=${COMOUT:-$(compath.py -o $NET/${ver})/${RUN}.${PDY}/$cyc}
if [[ ${NewCOM:-"YES"} == "YES" ]]; then
export mem_ens="avg"
export COMIN=${COMIN}/${mem_ens}/${COMPONENT}
export COMOUT=${COMOUT}/${mem_ens}
fi
export COMOUTwmo=${COMOUTwmo:-${COMOUT}/${COMPONENT}/wmo}

#############################
# Source relevant config files
#############################
configs="gefs gefs_awips"
config_path=$PARMgefs
for config in $configs; do
. $config_path/$config.parm
config_path=${PARMgefs}
for config in ${configs}; do
. ${config_path}/${config}.parm
export err=$?
if [[ $err != 0 ]]; then
echo "FATAL ERROR in ${.sh.file}: Error while loading parm file $config_path/$config.parm"
echo "FATAL ERROR in ${.sh.file}: Error while loading parm file ${config_path}/${config}.parm"
exit $err
fi
done
Expand Down
30 changes: 26 additions & 4 deletions scripts/exgefs_atmos_awips.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,36 @@ gridp5="-170:221:0.50 75:121:-0.50"

for var in apcp tmax tmin
do
nvar=$(echo $var|tr '[a-z]' '[A-Z]')
if [ ${FORECAST_SEGMENT} = hr ]; then
${USHgefs}/gefs_atmos_getsbn.sh avg ${var} ${nvar} pgrb2sp25 pgrb2s.0p25 0p25 006 240 6 "$gridp25"
if [[ ${NewCOM} == "YES" ]]; then
prdgen_dir="products/0p25s"
prdgen_prefix="0p25s.grb2"
else
prdgen_dir="pgrb2sp25"
prdgen_prefix="pgrb2s.0p25"
fi
${USHgefs}/gefs_atmos_getsbn.sh avg ${var} ${prdgen_dir} ${prdgen_prefix} 006 240 6 "${gridp25}"
export err=$?; if [[ $err != 0 ]]; then exit $err; fi
${USHgefs}/gefs_atmos_getsbn.sh avg ${var} ${nvar} pgrb2ap5 pgrb2a.0p50 0p50 246 384 6 "$gridp5"

if [[ ${NewCOM} == "YES" ]]; then
prdgen_dir="products/0p50a"
prdgen_prefix="0p50a.grb2"
else
prdgen_dir="pgrb2ap5"
prdgen_prefix="pgrb2a.0p50"
fi
${USHgefs}/gefs_atmos_getsbn.sh avg ${var} ${prdgen_dir} ${prdgen_prefix} 246 384 6 "${gridp5}"
export err=$?; if [[ $err != 0 ]]; then exit $err; fi
else
${USHgefs}/gefs_atmos_getsbn.sh avg ${var} ${nvar} pgrb2ap5 pgrb2a.0p50 0p50 390 840 6 "$gridp5"

if [[ ${NewCOM} == "YES" ]]; then
prdgen_dir="products/0p50a"
prdgen_prefix="0p50a.grb2"
else
prdgen_dir="pgrb2ap5"
prdgen_prefix="pgrb2a.0p50"
fi
${USHgefs}/gefs_atmos_getsbn.sh avg ${var} ${prdgen_dir} ${prdgen_prefix} 390 840 6 "${gridp5}"
export err=$?; if [[ $err != 0 ]]; then exit $err; fi
fi
done
Expand Down
37 changes: 22 additions & 15 deletions ush/gefs_atmos_getsbn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,35 @@ echo "#########################################"
echo " "
set -x

mem=$1
var=$2
nvar=$3
type=$4
fntype=$5
gdtype=$6
bhr=$7
ehr=$8
ihr=$9
cutgrid=${10}
mem=${1}
var=${2}
prdgen_dir=${3}
prdgen_prefix=${4}
bhr=${5}
ehr=${6}
ihr=${7}
cutgrid=${8}

nvar=$(echo $var|tr '[a-z]' '[A-Z]')

mkdir $DATA/$var
cd $DATA/$var
# Selecting requested variable

file=grib2.gefs.t${cyc}z.${var}.f${bhr}_${ehr}
hr=$bhr
while (( hr <= $ehr )); do
hr3=`printf %03d $hr`
export pgm="postcheck"
set -x
file_temp=ge${mem}.t${cyc}z.${type}f${hr3}
ln -s ${COMIN}/atmos/${type}/ge${mem}.t${cyc}z.${fntype}.f${hr3} ${file_temp}
file_temp=ge${mem}.t${cyc}z.${prdgen_prefix}f${hr3}
if [[ ${NewCOM} == "YES" ]]; then
CDUMP_ENS="gefs"
else
CDUMP_ENS="ge${mem}"
fi
file_prdgen=${CDUMP_ENS}.t${cyc}z.${prdgen_prefix}.f${hr3}
ln -s ${COMIN}/${prdgen_dir}/${file_prdgen} ${file_temp}
$WGRIB2 ${file_temp} | grep "$nvar" | $WGRIB2 -i ${file_temp} -grib ${file_temp}_$var
cat ${file_temp}_$var >> $file
rm ${file_temp}*
Expand All @@ -72,16 +79,16 @@ $WGRIB2 $file $option1 $option21 $option22 $option23 $option24 \
${file}.conus_notoc

############################################
# Processing GRIB2 GEFS grid 3 for MMEFS
# Processing GRIB2 GEFS grid
############################################
export pgm=${TOCGRIB2}
. prep_step
startmsg

# Processing GEFS (MMEFS) GRIB2
# Processing GEFS GRIB2
export FORT11=${file}.conus_notoc
export FORT51=${file}.conus
$TOCGRIB2 < $PARMgefs/wmo/grib2_awips_gefs_f${bhr}_${ehr}_${var}_conus >> $pgmout 2>errfile
$TOCGRIB2 < ${PARMgefs}/wmo/grib2_awips_gefs_f${bhr}_${ehr}_${var}_conus >> ${pgmout} 2>errfile
export err=$?; err_chk
echo " error from tocgrib2=",$err

Expand Down

0 comments on commit 86a47f0

Please sign in to comment.