#!/bin/sh
###############################################################################
#                                                                             #
# This script creates the assimilation for OFS_atl model                      #
#                                                                             #
#  inova_v.sh : obtains innovation vector                                     #
#   exported in:                                                              #
#      OBSFILE - observations in layer format                                 #
#      OUTFILE_PRE - pre-fix for output file names                            #
#      OUTFILE_POST - post-fix for output file names                          #
#      OPTION - method to compute perturbation                                #
#                                                                             #
###############################################################################

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

# --------------------------------------------------------------------------- #
# 1.  Set input files
# 1.a  vertical structure information

IU_VERT=14

# 1.a  construct standard input file 

/bin/rm -f inova_v.in
cat > inova_v.in <<EOF
${OBSFILE}
${OUTFILE_PRE}
${OUTFILE_POST}
${OPTION}      method to compute perturbation
${IU_VERT}     unit to read vertical structure data
EOF

# --------------------------------------------------------------------------- #
# 2.  execute inova_v and set up output files
#
export pgm=ofs_inova_v
. prep_step

export XLFUNIT_14=${PARMofs}/${RUN}_${modID}.z2layer.in

startmsg

$EXECofs/ofs_inova_v < inova_v.in >> $pgmout 2> errfile
export err=$?; err_chk

echo "*** Finished script $0"


