Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 38 additions & 30 deletions scripts/exglobal_makeprepbufr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -553,44 +553,52 @@ fi # end [ "$DO_QC" = 'YES' ]
## create combined ocean data dump file expected by NSST
if [[ "$MAKE_NSSTBUFR" == 'YES' ]]; then
> nsstbufr
chgrp rstprod nsstbufr
err_ch=$?
if [ $err_ch -eq 0 ]; then
chmod 664 nsstbufr

DTYPS_nsst='sfcshp tesac bathy trkob subpfl saldrn'
DTYPS_nsst='sfcshp tesac bathy trkob subpfl saldrn'

echo "xglm: DTYPS_nsst='$DTYPS_nsst'"
echo "xglm: DTYPS_nsst='$DTYPS_nsst'"

Comment thread
TaylorRoper-NOAA marked this conversation as resolved.
Outdated
for type in $DTYPS_nsst ; do
if [ -f ${tstsp}$type.$tmmark.bufr_d ]; then
file=${tstsp}$type.$tmmark.bufr_d
elif [ -s ${COMSP}$type.$tmmark.bufr_d ]; then
file=${COMSP}$type.$tmmark.bufr_d
fi

for type in $DTYPS_nsst ; do
if [ -f ${tstsp}$type.$tmmark.bufr_d ]; then
file=${tstsp}$type.$tmmark.bufr_d
elif [ -s ${COMSP}$type.$tmmark.bufr_d ]; then
file=${COMSP}$type.$tmmark.bufr_d
if [ -s $file ]; then
cat $file >> nsstbufr
err_cat=$?
if [ $err_cat -ne 0 ]; then
msg="**WARNING: exit status $err_cat from cat of $file to nsstbufr"
$DATA/postmsg "$jlogfile" "$msg"
fi
else
echo $file is empty or does not exist
fi # [ -s $file ]

if [ -s $file ]; then
cat $file >> nsstbufr
err_cat=$?
if [ $err_cat -ne 0 ]; then
msg="**WARNING: exit status $err_cat from cat of $file to nsstbufr"
$DATA/postmsg "$jlogfile" "$msg"
fi
else
echo $file is empty or does not exist
fi # [ -s $file ]

done # for type in $DTYPS_nsst
done # for type in $DTYPS_nsst

cp nsstbufr $COMOUT/${RUN}.${cycle}.nsstbufr
chmod 664 $COMOUT/${RUN}.${cycle}.nsstbufr

cp nsstbufr $COMOUT/${RUN}.${cycle}.nsstbufr
if [ "$CHGRP_RSTPROD" = 'YES' ]; then
chgrp rstprod nsstbufr
chgrp rstprod $COMOUT/${RUN}.${cycle}.nsstbufr
Comment thread
TaylorRoper-NOAA marked this conversation as resolved.
Outdated
chmod 640 $COMOUT/${RUN}.${cycle}.nsstbufr
msg="NOTE: nsstbufr file contains RESTRICTED data, only users in \
err_ch=$?
if [ $err_ch -eq 0 ]; then
chmod 640 nsstbufr
chmod 640 $COMOUT/${RUN}.${cycle}.nsstbufr
msg="NOTE: nsstbufr file contains RESTRICTED data, only users in \
rstprod group have read permission"
$DATA/postmsg "$jlogfile" "$msg"
else
cp /dev/null $COMOUT/${RUN}.${cycle}.nsstbufr
warning=yes
fi # if [ $err_ch -eq 0 ]
$DATA/postmsg "$jlogfile" "$msg"
else
cp /dev/null nsstbufr
cp /dev/null $COMOUT/${RUN}.${cycle}.nsstbufr
Comment thread
TaylorRoper-NOAA marked this conversation as resolved.
Outdated
warning=yes
fi
fi # if [ "CHGRP_RSTPROD" = 'YES' ]

fi # if [[ "$MAKE_NSSTBUFR" == 'YES' ]]

if [ "$warning" = 'yes' ]; then
Expand Down