Commit 4f047255dfa2e54606c4919321a0b8306032f857

Authored by dumoda01
1 parent dd570312
Exists in master and in 1 other branch snow

Ajout d'un script nouveau pour lancer des simulations biologiques en mode batch.…

… Ce script est applicable a tous les modeles bio et remplace les script batch_fasham.sh, etc. Ces scripts seront eventuellement retires du depot.
Showing 1 changed file with 103 additions and 0 deletions   Show diff stats
scripts/shell/batch_bio.sh 0 → 100755
... ... @@ -0,0 +1,103 @@
  1 +#!/bin/bash
  2 +
  3 +if [ $# -ne 1 ]
  4 +then
  5 + echo "Usage: $0 <bio_model>"
  6 + echo "Example: ./batch_bio.sh ismer"
  7 + exit
  8 +fi
  9 +
  10 +export EXPDIR=$(pwd)
  11 +echo $EXPDIR
  12 +
  13 +model=$1
  14 +
  15 +biofile=bio_$model
  16 +runfile=gotmrun
  17 +
  18 +if [ ! $biofile.mal ] || [ ! $runfile.mal ]
  19 +then
  20 + echo " ERROR : .mal files missing"
  21 + exit
  22 +else
  23 +
  24 + echo "-----------------------------------------------------"
  25 + echo $0 $1
  26 + echo "-----------------------------------------------------"
  27 +
  28 + # Parameters for the biological model
  29 + # The number of runs will be the product of the number of values
  30 + # for each parameter
  31 + vp="0.02"
  32 + alpha="0.02"
  33 + inib="0.0"
  34 + k1="0.2"
  35 + k2="0.1"
  36 + w_p="-0.38"
  37 +
  38 + #vp="0.02 0.12 0.22 0.32 0.42 0.52 0.62 0.72"
  39 + #alpha="0.02 0.08 0.16 0.22 0.28"
  40 + #inib="0.0 0.0005 0.0010 0.0015 0.0020"
  41 + #w_p="-0.05 -0.25 -0.45"
  42 +
  43 +count=0
  44 +for a in $vp
  45 +do
  46 +for b in $alpha
  47 +do
  48 +for c in $inib
  49 +do
  50 +for d in $w_p
  51 +do
  52 +
  53 +count=`expr $count + 1`
  54 +count=`expr 000$count | tail -5c`
  55 +echo $count
  56 +
  57 +if [ -f bio_$model.nml ]
  58 +then
  59 + rm -f bio_$model.nml
  60 +fi
  61 +
  62 +cat bio_$model.mal | sed \
  63 + -e "s/param1/$a/g" \
  64 + -e "s/param2/$b/g" \
  65 + -e "s/param3/$c/g" \
  66 + -e "s/param4/$d/g" \
  67 + > bio_$model.nml
  68 +
  69 +if [ -f bio_$model.nml ]
  70 +then
  71 + echo " bio_$model.nml created"
  72 +fi
  73 +
  74 +if [ -f $runfile.nml ]
  75 +then
  76 + rm -f $runfile.nml
  77 +fi
  78 +
  79 +cat $runfile.mal | sed \
  80 + -e "s/experiment_name/$count/g" \
  81 + > $runfile.nml
  82 +
  83 +if [ -f $runfile.nml ]
  84 +then
  85 + echo " $runfile.nml created"
  86 +fi
  87 +
  88 +strt=`date +%H:%M:%S`
  89 +echo " started at "$strt
  90 +
  91 +./gotm_prod_IFORT >& $count.out
  92 +
  93 +end=`date +%H:%M:%S`
  94 +echo " ended at "$end
  95 +
  96 +done
  97 +done
  98 +done
  99 +done
  100 +
  101 +fi
  102 +
  103 +exit
... ...