diff --git a/gempak/ush/gefs_avgspr_meta.sh b/gempak/ush/gefs_avgspr_meta.sh index 355f24fc2..112f4e76a 100755 --- a/gempak/ush/gefs_avgspr_meta.sh +++ b/gempak/ush/gefs_avgspr_meta.sh @@ -24,7 +24,13 @@ if [[ ${STRICT:-NO} == "YES" ]]; then fi # datatypes.tbl uses COMIN, so have to update it locally -COMIN="$COMIN/$COMPONENT/gempak" +if [[ ${NewCOM:-"YES"} == "YES" ]]; then + COMINavg="${COMIN}/avg/${COMPONENT}/products/gempak" + COMINspr="${COMIN}/spr/${COMPONENT}/products/gempak" +else + COMINavg="${COMIN}/$COMPONENT/gempak" + COMINspr=${COMINavg} +fi mkdir $DATA/gefs_avgspr cd $DATA/gefs_avgspr @@ -48,13 +54,39 @@ for area in natl mpac; do for fcsthr in ${fcsthrs}; do for fn in avg spr; do - rm -rf $fn - INFILE=${COMIN}/ge${fn}${sGrid}_${PDY}${cyc}f${fcsthr} + 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 + cat > cmdfile_meta <<- EOF GDATTIM = F${fcsthr} GAREA = ${garea} @@ -155,16 +187,16 @@ for area in natl mpac; do fi if [ $SENDCOM = "YES" ] ; then - mv ${metaname} ${COMOUT}/$COMPONENT/gempak/meta/ + mv ${metaname} ${COMOUT}/ if [ $SENDDBN = "YES" ] ; then - $DBNROOT/bin/dbn_alert MODEL ${DBN_ALERT_TYPE} $job ${COMOUT}/$COMPONENT/gempak/meta/${metaname} + $DBNROOT/bin/dbn_alert MODEL ${DBN_ALERT_TYPE} $job ${COMOUT}/${metaname} fi fi done # Make metafiles for North and South America...as well as Alaska. -ln -s $COMIN/geavg${sGrid}_${PDY}${cyc}f* ./ +#ln -s $COMIN/geavg${sGrid}_${PDY}${cyc}f* ./ for area in nam sam ak; do if [ ${area} = "nam" ] ; then @@ -237,12 +269,39 @@ for area in nam sam ak; do for fcsthr in ${fcsthrs}; do for fn in avg spr; do - rm -rf $fn - if [ -r $COMIN/ge${fn}${sGrid}_${PDY}${cyc}f${fcsthr} ]; then - ln -s $COMIN/ge${fn}${sGrid}_${PDY}${cyc}f${fcsthr} $fn + 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 + cat > cmdfile_meta <<- EOF GAREA = ${garea} PROJ = ${proj} @@ -341,7 +400,7 @@ for area in nam sam ak; do # ===== - COMINtemp=$COMIN +# COMINtemp=$COMIN export COMIN=./ cp $FIXgempak/datatype${sGrid}.tbl datatype.tbl @@ -417,7 +476,7 @@ for area in nam sam ak; do exit $err fi - export COMIN=$COMINtemp +# export COMIN=$COMINtemp ##################################################### # GEMPAK DOES NOT ALWAYS HAVE A NON ZERO RETURN CODE @@ -435,9 +494,9 @@ for area in nam sam ak; do fi if [ $SENDCOM = "YES" ] ; then - mv ${metaname} ${COMOUT}/$COMPONENT/gempak/meta/ + mv ${metaname} ${COMOUT}/ if [ $SENDDBN = "YES" ] ; then - $DBNROOT/bin/dbn_alert MODEL ${DBN_ALERT_TYPE} $job ${COMOUT}/$COMPONENT/gempak/meta/${metaname} + $DBNROOT/bin/dbn_alert MODEL ${DBN_ALERT_TYPE} $job ${COMOUT}/${metaname} fi fi done diff --git a/jobs/JGEFS_ATMOS_AVGSPR_GEMPAK_META b/jobs/JGEFS_ATMOS_AVGSPR_GEMPAK_META index 759e68218..906e7c75f 100755 --- a/jobs/JGEFS_ATMOS_AVGSPR_GEMPAK_META +++ b/jobs/JGEFS_ATMOS_AVGSPR_GEMPAK_META @@ -69,7 +69,11 @@ export FIXgempak=${FIXgempak:-$GEMPAKgefs/fix} # 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} -export COMOUT=${COMOUT:-$(compath.py -o $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 @@ -86,7 +90,7 @@ for config in $configs; do done export COMPONENT=${COMPONENT:-atmos} -if [[ $SENDCOM == "YES" && ! -d $COMOUT/$COMPONENT/gempak/meta ]]; then mkdir -p -m 755 $COMOUT/$COMPONENT/gempak/meta; fi +if [[ $SENDCOM == "YES" && ! -d $COMOUT ]]; then mkdir -p -m 755 $COMOUT; fi echo "Environment before calling script" env | sort