#!/bin/sh
# By J. Zeng

usage(){
    cat <<EOF
      This script is used to convert legacy mod_res.tbl file and the
      restore files it references into an equivalent XML file and
      associated attribute files.

      Usage: modres2new <sourcedf> <target>
      - <sourcedf>: the source file (example:  \$GEMTBL/nmap/mod_res.tbl)
      - <target>: the target directory (example:  . [current working directory])
      The converted XML file is ModelFcstGridContours.xml; the attribute files
      have derived unique names ending in ".attr".
EOF
    exit
}

srcpath=$1
tgtpath=$2

if [ $# -lt 2 ];  then
     usage
fi

java -jar ${GEMPAK}/utilities/a2conv/distMod/modresConverter.jar $srcpath $tgtpath

