Skip to content

Commit

Permalink
Fix bug for avgspr_meta job
Browse files Browse the repository at this point in the history
 On branch feature/gefs_v13_atmos_prep
	modified:   gempak/ush/gefs_avgspr_meta.sh
	modified:   jobs/JGEFS_ATMOS_AVGSPR_GEMPAK_META

Refs: NOAA-EMC#103
  • Loading branch information
XianwuXue-NOAA committed Jan 30, 2023
1 parent 2af3341 commit f92bf3f
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 78 deletions.
107 changes: 41 additions & 66 deletions gempak/ush/gefs_avgspr_meta.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,40 +52,27 @@ for area in natl mpac; do
device="nc | ${metaname}"

for fcsthr in ${fcsthrs}; do
fn=avg
rm -rf $fn
if [[ ${NewCOM:-"YES"} == "YES" ]]; then
INFILE=${COMINavg}/gefs${sGrid}_${PDY}${cyc}f${fcsthr}
else
INFILE=${COMINavg}/ge${fn}${sGrid}_${PDY}${cyc}f${fcsthr}
fi
if [ -r ${INFILE} ]; then
ln -s ${INFILE} $fn
fi

for fn in avg spr; do
if [ -e ${fn} ]; then rm -rf ${fn}; fi
if [[ ${NewCOM:-"YES"} == "YES" ]]; then
INFILE=$[COMIN${fn}]/gefs${sGrid}_${PDY}${cyc}f${fcsthr}
else
INFILE=$[COMIN${avg}]/ge${fn}${sGrid}_${PDY}${cyc}f${fcsthr}
fi
if [ -r ${INFILE} ]; then
ln -s ${INFILE} $fn
fi
done

# fn=avg
# rm -rf $fn
# if [[ ${NewCOM:-"YES"} == "YES" ]]; then
# INFILE=${COMINavg}/gefs${sGrid}_${PDY}${cyc}f${fcsthr}
# else
# INFILE=${COMINavg}/ge${fn}${sGrid}_${PDY}${cyc}f${fcsthr}
# fi
# if [ -r ${INFILE} ]; then
# ln -s ${INFILE} $fn
# fi
#
# fn=spr
# rm -rf $fn
# if [[ ${NewCOM:-"YES"} == "YES" ]]; then
# INFILE=${COMINspr}/gefs${sGrid}_${PDY}${cyc}f${fcsthr}
# else
# INFILE=${COMINspr}/ge${fn}${sGrid}_${PDY}${cyc}f${fcsthr}
# fi
# if [ -r ${INFILE} ]; then
# ln -s ${INFILE} $fn
# fi
fn=spr
rm -rf $fn
if [[ ${NewCOM:-"YES"} == "YES" ]]; then
INFILE=${COMINspr}/gefs${sGrid}_${PDY}${cyc}f${fcsthr}
else
INFILE=${COMINspr}/ge${fn}${sGrid}_${PDY}${cyc}f${fcsthr}
fi
if [ -r ${INFILE} ]; then
ln -s ${INFILE} $fn
fi

cat > cmdfile_meta <<- EOF
GDATTIM = F${fcsthr}
Expand Down Expand Up @@ -268,39 +255,27 @@ for area in nam sam ak; do
device="nc | ${metaname}"

for fcsthr in ${fcsthrs}; do
for fn in avg spr; do
if [ -e ${fn} ]; then rm -rf ${fn}; fi
if [[ ${NewCOM:-"YES"} == "YES" ]]; then
INFILE=$[COMIN${fn}]/gefs${sGrid}_${PDY}${cyc}f${fcsthr}
else
INFILE=$[COMIN${avg}]/ge${fn}${sGrid}_${PDY}${cyc}f${fcsthr}
fi
if [ -r ${INFILE} ]; then
ln -s ${INFILE} $fn
fi
done

# fn=avg
# if [ -e ${fn} ]; then rm -rf ${fn}; fi
# if [[ ${NewCOM:-"YES"} == "YES" ]]; then
# INFILE=${COMINavg}/gefs${sGrid}_${PDY}${cyc}f${fcsthr}
# else
# INFILE=${COMINavg}/ge${fn}${sGrid}_${PDY}${cyc}f${fcsthr}
# fi
# if [ -r ${INFILE} ]; then
# ln -s ${INFILE} $fn
# fi
#
# fn=spr
# if [ -e ${fn} ]; then rm -rf ${fn}; fi
# if [[ ${NewCOM:-"YES"} == "YES" ]]; then
# INFILE=${COMINspr}/gefs${sGrid}_${PDY}${cyc}f${fcsthr}
# else
# INFILE=${COMINspr}/ge${fn}${sGrid}_${PDY}${cyc}f${fcsthr}
# fi
# if [ -r ${INFILE} ]; then
# ln -s ${INFILE} $fn
# fi
fn=avg
if [ -e ${fn} ]; then rm -rf ${fn}; fi
if [[ ${NewCOM:-"YES"} == "YES" ]]; then
INFILE=${COMINavg}/gefs${sGrid}_${PDY}${cyc}f${fcsthr}
else
INFILE=${COMINavg}/ge${fn}${sGrid}_${PDY}${cyc}f${fcsthr}
fi
if [ -r ${INFILE} ]; then
ln -s ${INFILE} $fn
fi

fn=spr
if [ -e ${fn} ]; then rm -rf ${fn}; fi
if [[ ${NewCOM:-"YES"} == "YES" ]]; then
INFILE=${COMINspr}/gefs${sGrid}_${PDY}${cyc}f${fcsthr}
else
INFILE=${COMINspr}/ge${fn}${sGrid}_${PDY}${cyc}f${fcsthr}
fi
if [ -r ${INFILE} ]; then
ln -s ${INFILE} $fn
fi

cat > cmdfile_meta <<- EOF
GAREA = ${garea}
Expand Down
23 changes: 11 additions & 12 deletions jobs/JGEFS_ATMOS_AVGSPR_GEMPAK_META
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,6 @@ export PARMgefs=${PARMgefs:-$HOMEgefs/parm}
export GEMPAKgefs=${GEMPAKgefs:-$HOMEgefs/gempak}
export FIXgempak=${FIXgempak:-$GEMPAKgefs/fix}

##############################################
# Define COM directories
##############################################
# gefs_avgspr_meta.sh overrides COMIN locally to work with datatype.tbl
ver=${ver:-$(echo ${gefs_ver}|cut -c1-5)}
export COMIN=${COMIN:-$(compath.py $envir/com/$NET/${ver})/${RUN}.${PDY}/$cyc}
if [[ ${NewCOM:-"YES"} == "YES" ]]; then
export COMOUT=${COMOUT:-$(compath.py -o $NET/${ver})/${RUN}.${PDY}/${cyc}/avg/$COMPONENT/products/gempak/meta}
else
export COMOUT=${COMOUT:-$(compath.py -o $NET/${ver})/${RUN}.${PDY}/${cyc}/$COMPONENT/gempak/meta}
fi

#############################
# Source relevant config files
#############################
Expand All @@ -90,6 +78,17 @@ for config in $configs; do
done

export COMPONENT=${COMPONENT:-atmos}
##############################################
# Define COM directories
##############################################
# gefs_avgspr_meta.sh overrides COMIN locally to work with datatype.tbl
ver=${ver:-$(echo ${gefs_ver}|cut -c1-5)}
export COMIN=${COMIN:-$(compath.py $envir/com/$NET/${ver})/${RUN}.${PDY}/$cyc}
if [[ ${NewCOM:-"YES"} == "YES" ]]; then
export COMOUT=${COMOUT:-$(compath.py -o $NET/${ver})/${RUN}.${PDY}/${cyc}/avg/$COMPONENT/products/gempak/meta}
else
export COMOUT=${COMOUT:-$(compath.py -o $NET/${ver})/${RUN}.${PDY}/${cyc}/$COMPONENT/gempak/meta}
fi
if [[ $SENDCOM == "YES" && ! -d $COMOUT ]]; then mkdir -p -m 755 $COMOUT; fi

echo "Environment before calling script"
Expand Down

0 comments on commit f92bf3f

Please sign in to comment.