forked from NOAA-EMC/global-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgfs_sndp.sh
executable file
·72 lines (64 loc) · 1.99 KB
/
gfs_sndp.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#! /usr/bin/env bash
################################################################
# Script Name: gfs_sndp.sh
# Script Description: Format GFS BUFR sounding files for AWIPS
# Script History Log:
# 1) 2004-09-10 Steve Gilbert First Implementation
################################################################
source "$HOMEgfs/ush/preamble.sh"
# Create "collectives" consisting of groupings of the soundings
# into files designated by geographical region. Each input
# file gfs_collective*.list (1-9) contains the list of stations to
# put in a particular collective output file.
export m=$1
mkdir $DATA/$m
cd $DATA/$m
cp $FIXbufrsnd/gfs_collective${m}.list $DATA/$m/.
CCCC=KWBC
file_list=gfs_collective${m}.list
if [ $m -le 2 ]
then
WMOHEAD=JUSA4$m
elif [ $m -le 6 ]
then
WMOHEAD=JUSB4$m
else
WMOHEAD=JUSX4$m
fi
for stn in $(cat $file_list)
do
cp ${COMOUT}/bufr.${cycle}/bufr.$stn.$PDY$cyc $DATA/${m}/bufrin
export pgm=tocsbufr
#. prep_step
export FORT11=$DATA/${m}/bufrin
export FORT51=./bufrout
# JY - Turn off the startmsg to reduce the update on jlogfile in this loop
# startmsg
$EXECbufrsnd/tocsbufr << EOF
&INPUT
BULHED="$WMOHEAD",KWBX="$CCCC",
NCEP2STD=.TRUE.,
SEPARATE=.TRUE.,
MAXFILESIZE=600000
/
EOF
# JY export err=$?; err_chk
export err=$?; #err_chk
if [ $err -ne 0 ]
then
echo "ERROR in $pgm"
err_chk
fi
cat $DATA/${m}/bufrout >> $DATA/${m}/gfs_collective$m.fil
rm $DATA/${m}/bufrin
rm $DATA/${m}/bufrout
done
# if test $SENDCOM = 'NO'
if test $SENDCOM = 'YES'
then
if [ $SENDDBN = 'YES' ] ; then
cp $DATA/${m}/gfs_collective$m.fil $pcom/gfs_collective$m.postsnd_$cyc
$DBNROOT/bin/dbn_alert NTC_LOW BUFR $job $pcom/gfs_collective$m.postsnd_$cyc
fi
cp $DATA/${m}/gfs_collective$m.fil ${COMOUT}/bufr.${cycle}/.
fi