From ad17262a09b2e56d671733ed73cd36d1af167210 Mon Sep 17 00:00:00 2001 From: "Xianwu.Xue" Date: Mon, 30 Jan 2023 23:40:01 -0500 Subject: [PATCH] Optimize gempak_meta ush scripts On branch feature/gefs_v13_atmos_prep modified: gempak/ush/gefs_meta_mar_00Z.sh modified: gempak/ush/gefs_meta_mar_12Z.sh Refs: #103 --- gempak/ush/gefs_meta_mar_00Z.sh | 20 ++++++++++++-------- gempak/ush/gefs_meta_mar_12Z.sh | 15 +++++++++------ 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/gempak/ush/gefs_meta_mar_00Z.sh b/gempak/ush/gefs_meta_mar_00Z.sh index ae4951612..733af868f 100755 --- a/gempak/ush/gefs_meta_mar_00Z.sh +++ b/gempak/ush/gefs_meta_mar_00Z.sh @@ -263,27 +263,31 @@ for metaarea in pac atl; do grids=${memberlist} for fn in $(echo $grids); do rm -rf $fn - if [ -r $COMIN/$COMPONENT/gempak/ge${fn}${sGrid}_${PDY}${cyc}f${fcsthr} ]; then - ln -s $COMIN/$COMPONENT/gempak/ge${fn}${sGrid}_${PDY}${cyc}f${fcsthr} $fn + INFILE=${COMIN}/$COMPONENT/gempak/ge${fn}${sGrid}_${PDY}${cyc}f${fcsthr} + if [ -r ${INFILE} ]; then + ln -s ${INFILE} $fn fi done fn=gfs rm -rf ${fn} - if [ -r $COMINsgfs/gfs.${yesterday}/${gfscyc}/gempak/gfs${sGrid}_${yesterday}${gfscyc}f${fcsthrsgfs} ]; then - ln -s $COMINsgfs/gfs.${yesterday}/${gfscyc}/gempak/gfs${sGrid}_${yesterday}${gfscyc}f${fcsthrsgfs} ${fn} + INFILE=${COMINsgfs}/gfs.${yesterday}/${gfscyc}/gempak/gfs${sGrid}_${yesterday}${gfscyc}f${fcsthrsgfs} + if [ -r ${INFILE} ]; then + ln -s ${INFILE} ${fn} fi fn=ecmwf rm -rf ${fn} - if [ -r $COMINecmwf.${ecmwfdate}/gempak/ecmwf_hr_${ecmwfdate}${ecmwfcyc}f${fcsthr} ]; then - ln -s $COMINecmwf.${ecmwfdate}/gempak/ecmwf_hr_${ecmwfdate}${ecmwfcyc}f${fcsthr} ${fn} + INFILE=${COMINecmwf}.${ecmwfdate}/gempak/ecmwf_hr_${ecmwfdate}${ecmwfcyc}f${fcsthr} + if [ -r ${INFILE} ]; then + ln -s ${INFILE} ${fn} fi fn=ukmet rm -rf ${fn} - if [ -r $COMINukmet.${PDY}/gempak/ukmet_hr_${PDY}${cyc}f${fcsthr} ]; then - ln -s $COMINukmet.${PDY}/gempak/ukmet_hr_${PDY}${cyc}f${fcsthr} ${fn} + INFILE=${COMINukmet}.${PDY}/gempak/ukmet_hr_${PDY}${cyc}f${fcsthr} + if [ -r ${INFILE} ]; then + ln -s ${INFILE} ${fn} fi export pgm=gdplot2_nc;. prep_step; startmsg diff --git a/gempak/ush/gefs_meta_mar_12Z.sh b/gempak/ush/gefs_meta_mar_12Z.sh index 0b70a9fd6..5b500c388 100755 --- a/gempak/ush/gefs_meta_mar_12Z.sh +++ b/gempak/ush/gefs_meta_mar_12Z.sh @@ -212,21 +212,24 @@ for metaarea in pac atl; do grids=${memberlist} for fn in $(echo $grids); do rm -rf $fn - if [ -r $COMIN/$COMPONENT/gempak/ge${fn}${sGrid}_${PDY}${cyc}f${fcsthr} ]; then - ln -s $COMIN/$COMPONENT/gempak/ge${fn}${sGrid}_${PDY}${cyc}f${fcsthr} $fn + INFILE=${COMIN}/${COMPONENT}/gempak/ge${fn}${sGrid}_${PDY}${cyc}f${fcsthr} + if [ -r ${INFILE} ]; then + ln -s ${INFILE} $fn fi done fn=gfs rm -rf ${fn} - if [ -r $COMINsgfs/gfs.${PDY}/${cyc}/gempak/gfs${sGrid}_${PDY}${cyc}f${fcsthr} ]; then - ln -s $COMINsgfs/gfs.${PDY}/${cyc}/gempak/gfs${sGrid}_${PDY}${cyc}f${fcsthr} ${fn} + INFILE=${COMINsgfs}/gfs.${PDY}/${cyc}/gempak/gfs${sGrid}_${PDY}${cyc}f${fcsthr} + if [ -r ${INFILE} ]; then + ln -s ${INFILE} ${fn} fi fn=nam rm -rf ${fn} - if [ -r $COMINnam/nam.${PDY}/gempak/nam_${PDY}${cyc}f${fcsthr} ]; then - ln -s $COMINnam/nam.${PDY}/gempak/nam_${PDY}${cyc}f${fcsthr} ${fn} + INFILE=${COMINnam}/nam.${PDY}/gempak/nam_${PDY}${cyc}f${fcsthr} + if [ -r ${INFILE} ]; then + ln -s ${INFILE} ${fn} fi #export pgm=gdplot2_nc;. prep_step; startmsg