
#!/usr/bin/sh
# This script executes c programs which will read the profiler data from
# the archive tapes (wrebufr.c) and converts the files into the bit stream 
# expected by the EBUFR software (rdprof.c). These programs were written
# for NCDC processing, so the user should read the inline program documentation
# to see what may need changed for their purposes. When the rdprof program
# is compiled include the object records.o. Since two files are 
# written for each day large quantities of disk are used during this process.
# If disk space is a concern then either process small portions of the tape
# at a time or alter the software to create only one disk file per day. This
# was not done to avoid altering the EBUFR read software called readHeader.
# For March 1, 1992 the 1st file would be 92061.m06 and the 2nd would be
# a92061.m06. Only the 2nd is readable by EBUFR software.
#
# The script will prompt the user for the input parameters. The following
# text describes the input parameters:
#
# The example input would be for writing 6 minute moments for March 1st-31st,
# 1992.
#
#       92061           - the julian dates of the selected data
#       92091
#
#         m06           - the code representing 6 minute moments.
#                               The codes are:
#                                       c06 > control 6 minute
#                                       c60 > control 60 minute
#                                       m06 > moments 6 minute
#                                       m60 > moments 60 minute
#                                       p06 > spectral 6 minute
#                                       s06 > surface 6 minute
#                                       s60 > surface 60 minute
#                                       w60 > winds 60 minute
#
#           0           - the number of days to skip on the tape to 
#                         position the tape for this request. If only
#                         need to start with day 15, skip 14.
# 

echo Enter the beginning year and julian day [yyjjj]
echo -n :
read num1
echo Enter the ending year and julian day [yyjjj]
echo -n :
read num2
echo Enter the data type [w60,s60,s06,m06,m60,p06,c60 or c06]
echo -n :
read dtype
echo Enter the number of days to skip on the tape [if reading day 11, skip 10]
echo -n :
read dskip

while [ $num1 -le $num2 ]
do
    echo $num1'.'$dtype >> arc.log
    num1=`expr $num1 + 1`
done

wrebufr $dskip
rdprof

rm -f arc.log

     



