#!/bin/ksh
######################################################
# Author : Rachid benshila for ESOPA
# Contact : opatlod@lodyc.jussieu.fr
#
# This script to copy  a file from NEMO in the current 
# directory
#
######################################################
d_n=$(dirname $0); b_n=$(basename $0);
d_file=$(dirname $1);b_file=$(basename $1);

nemo_file=`find ${d_n}/../../modeles/NEMO/${d_file} -name ${b_file}`
set -A nemo_tab $nemo_file

if [ ${#nemo_tab[*]} -gt 1 ] ; then
echo 'Multiple occurence found'
echo ${nemo_tab[*]}
echo 'Please specify one directory'
exit
fi
if [ ${#nemo_tab[*]} -eq 0 ] ; then
echo 'No occurence found'
echo 'exiting'
exit
fi
if [ ${#nemo_tab[*]} -eq 1 ] ; then
diff ${b_file} ${nemo_file} 
fi

unset d_n
unset b_n
unset d_file
unset b_file
