#!/bin/sh
#########################################################################
# Usage: ofs_ab2prof.sh                                                 #
#                                                                       #
# Description: This script generate reads observation layer files       #
#              and archive files to generate model layers at observation#
#              points. It also edits  a file containing old observations#
#              model profiles                                           #
#                                                                       #
# History:                                                              #
#    06-16-2005  Dan Iredell                                            #
#########################################################################

#
# Usage: ofs_ab2prof.sh 
#
#  DPFN    layer obs filename
#  POFN    output ctd combined file
#  FLIST   model filenames
#  IHEAD   number of header lines in the archive .b file 
#  KDM     number of vertical levels

set -x
echo "*** Started script $0"


test $POFN && rm -f $POFN

cat > ab2prof.in <<EOF
${DPFN}
${POFN}
${FLIST}
${IHEAD}
${KDM}
EOF

export pgm=ofs_ab2prof
. prep_step
${EXECofs}/ofs_ab2prof < ab2prof.in >> $pgmout 2> errfile
export err=$?; err_chk

echo "*** Finished script $0"

