#!/bin/ksh

set -x

# Parse the message file or tcvitals and generate vitals.inc:
if [[ "$PARAFLAG" == YES ]] ; then
    $USHhwrf/hwrf_parse_vitals.sh tcvitals "$stormid" "$yyyymmddhh"
else
    $USHhwrf/hwrf_parse_vitals.sh messages "$storm_num" "$mesagdir"
fi

err=$?; echo "err= $err"
if [ ${err} -eq 119 ] 
then
    echo "WARNING: HWRF does not currently run for storms on basin $basin1  ---- exit!!! "
    return $err
fi

# Generate the storm*.holdvars.txt file based on the vitals.inc file
# and paths specified by scripts- and jobs-level pre_master scripts:
$USHhwrf/hwrf_model_config.sh
