batch_npzd.sh 1.18 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
#!/bin/bash

export EXPDIR=$(pwd)
echo $EXPDIR

if [ ! bio_npzd.mal ] || [ ! gotmrun.mal ]
then
  echo " ERROR : .mal files missing"
  exit
else

echo "-----------------------------------------------------"
echo " batch_npzd.sh"
echo "-----------------------------------------------------"

# Parameters for the NPZD model
rmax="0.04"
alpha="0.3"
inib="0.4"
k1="0.1"
w_p="-0.38"

count=0

for a in $rmax
do 
for b in $alpha
do
for c in $inib 
do
for d in $k1 
do
for e in $w_p   
do

count=`expr $count + 1`
count=`expr 00$count | tail -4c`
echo $count
 
if [ -f bio_npzd.nml ]
then
  rm -f bio_npzd.nml
fi

cat bio_npzd.mal | sed \
    -e "s/param1/$a/g" \
    -e "s/param2/$b/g" \
    -e "s/param3/$c/g" \
    -e "s/param4/$d/g" \
    -e "s/param5/$e/g" \
    > bio_npzd.nml

if [ -f bio_npzd.nml ]
then
  echo "   bio_npzd.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 "   started at "$strt

./gotm_prod_IFORT >& $count.out

end=`date +%H:%M:%S`
echo "   ended   at "$end

done
done
done
done
done

fi

exit