Commit 11b18235 authored by Dany Dumont's avatar Dany Dumont

Ajout de run_enp.sh comme exemple de script batch

parent 5652bb2b
#!/bin/bash
export EXPDIR=$(pwd)
echo $EXPDIR
if [ $# -ne 1 ]
then
echo ""
echo "Usage: $0 <exp>"
echo ""
echo " <exp> should be one of the following:"
echo " 0910_E1 "
echo " 0910_E2 "
echo " 1011_E1 "
echo " 1011_E2 "
exit
fi
exp=$1
echo " Linking entry parameters and files for $exp"
rm -f *.dat
rm -f gotmrun.mal
rm -f obs.nml
rm -f airsea.mal
ln -sf $exp/enp/*.mal .
ln -sf $exp/*.nml .
ln -sf $exp/*.dat .
ln -sf enp_files/*.dat .
if [ ! airsea.mal ] || [ ! gotmrun.mal ]
then
echo " ERROR : .mal files missing"
exit
else
echo "-----------------------------------------------------"
echo " run_enp.sh"
echo "-----------------------------------------------------"
# Parameters for the forcings
count=1
for file in ecmwf_meteo_*.dat
do
count=`expr 000$count | tail -4c`
#count=`expr 000$count | tail -8c`
echo $count
if [ -f airsea.nml ]
then
rm -f airsea.nml
fi
cat airsea.mal | sed \
-e "s/meteofile/ecmwf_meteo_$count.dat/g" \
> airsea.nml
if [ -f airsea.nml ]
then
echo " airsea.nml created"
fi
if [ -f gotmrun.nml ]
then
rm -f gotmrun.nml
fi
cat gotmrun.mal | sed \
-e "s/experiment_name/$count/g" \
> gotmrun.nml
if [ -f gotmrun.nml ]
then
echo " gotmrun.nml created"
fi
strt=`date +%H:%M:%S`
echo " runnning with "$file
echo " started at "$strt
./gotm_prod_IFORT >& $count.out
end=`date +%H:%M:%S`
echo " ended at "$end
mv $count.nc $exp/enp
mv $count.out $exp/enp/
mv ${count}_fasham.par $exp/enp/
count=`expr $count + 1`
# Uncoment for debugging
if [ `expr $count` == 4 ]
then
echo " Exiting"
exit
fi
done
fi
exit
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment