Commit 1146a145c59e8fed7fdcef45cf199865025535d6

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

Ajout du repertoire shell et de scripts pour tourner en mode batch

scripts/shell/batch.sh 0 โ†’ 100755
... ... @@ -0,0 +1,72 @@
  1 +#!/bin/bash
  2 +
  3 +export EXPDIR=$(pwd)
  4 +echo $EXPDIR
  5 +
  6 +if [ ! obs.mal ] || [ ! gotmrun.mal ]
  7 +then
  8 + echo " ERROR : .mal files missing"
  9 + exit
  10 +else
  11 +
  12 +echo "-----------------------------------------------------"
  13 +echo " batch_fasham.sh"
  14 +echo "-----------------------------------------------------"
  15 +
  16 +
  17 +# Parameters for the Fasham model
  18 +# The number of runs will be the product of the number of values
  19 +# for each parameter
  20 +
  21 +
  22 +count=0
  23 +
  24 +for file in nprof_*.dat
  25 +do
  26 +
  27 +count=`expr $count + 1`
  28 +count=`expr 000$count | tail -4c`
  29 +#count=`expr 000$count | tail -8c`
  30 +echo $count
  31 +
  32 +if [ -f obs.nml ]
  33 +then
  34 + rm -f obs.nml
  35 +fi
  36 +
  37 +cat obs.mal | sed \
  38 + -e "s/nproffile/$file/g" \
  39 + > obs.nml
  40 +
  41 +if [ -f obs.nml ]
  42 +then
  43 + echo " obs.nml created"
  44 +fi
  45 +
  46 +if [ -f gotmrun.nml ]
  47 +then
  48 + rm -f gotmrun.nml
  49 +fi
  50 +
  51 +cat gotmrun.mal | sed \
  52 + -e "s/experiment_name/$count/g" \
  53 + > gotmrun.nml
  54 +
  55 +if [ -f gotmrun.nml ]
  56 +then
  57 + echo " gotmrun.nml created"
  58 +fi
  59 +
  60 +strt=`date +%H:%M:%S`
  61 +echo " started at "$strt
  62 +
  63 +./gotm_prod_IFORT >& $count.out
  64 +
  65 +end=`date +%H:%M:%S`
  66 +echo " ended at "$end
  67 +
  68 +done
  69 +
  70 +fi
  71 +
  72 +exit
... ...
scripts/shell/batch_fasham.sh 0 โ†’ 100755
... ... @@ -0,0 +1,98 @@
  1 +#!/bin/bash
  2 +
  3 +export EXPDIR=$(pwd)
  4 +echo $EXPDIR
  5 +
  6 +if [ ! bio_fasham.mal ] || [ ! gotmrun.mal ]
  7 +then
  8 + echo " ERROR : .mal files missing"
  9 + exit
  10 +else
  11 +
  12 +echo "-----------------------------------------------------"
  13 +echo " batch_fasham.sh"
  14 +echo "-----------------------------------------------------"
  15 +
  16 +
  17 +# Parameters for the Fasham model
  18 +# The number of runs will be the product of the number of values
  19 +# for each parameter
  20 +
  21 +vp="0.02 0.08 0.24 0.48 0.72"
  22 +alpha="0.01 0.04 0.16 0.32 0.48"
  23 +inib="0.0 0.001 0.01 0.1"
  24 +k1="0.2"
  25 +k2="0.8"
  26 +w_p="-0.38"
  27 +
  28 +
  29 +count=0
  30 +
  31 +for a in $vp
  32 +do
  33 +for b in $alpha
  34 +do
  35 +for c in $inib
  36 +do
  37 +for d in $k1
  38 +do
  39 +for e in $k2
  40 +do
  41 +for f in $w_p
  42 +do
  43 +
  44 +count=`expr $count + 1`
  45 +count=`expr 000$count | tail -8c`
  46 +echo $count
  47 +
  48 +if [ -f bio_fasham.nml ]
  49 +then
  50 + rm -f bio_fasham.nml
  51 +fi
  52 +
  53 +cat bio_fasham.mal | sed \
  54 + -e "s/param1/$a/g" \
  55 + -e "s/param2/$b/g" \
  56 + -e "s/param3/$c/g" \
  57 + -e "s/param4/$d/g" \
  58 + -e "s/param5/$e/g" \
  59 + -e "s/param6/$f/g" \
  60 + > bio_fasham.nml
  61 +
  62 +if [ -f bio_fasham.nml ]
  63 +then
  64 + echo " bio_fasham.nml created"
  65 +fi
  66 +
  67 +if [ -f gotmrun.nml ]
  68 +then
  69 + rm -f gotmrun.nml
  70 +fi
  71 +
  72 +cat gotmrun.mal | sed \
  73 + -e "s/experiment_name/$count/g" \
  74 + > gotmrun.nml
  75 +
  76 +if [ -f gotmrun.nml ]
  77 +then
  78 + echo " gotmrun.nml created"
  79 +fi
  80 +
  81 +strt=`date +%H:%M:%S`
  82 +echo " started at "$strt
  83 +
  84 +./gotm_prod_IFORT >& $count.out
  85 +
  86 +end=`date +%H:%M:%S`
  87 +echo " ended at "$end
  88 +
  89 +done
  90 +done
  91 +done
  92 +done
  93 +done
  94 +done
  95 +
  96 +fi
  97 +
  98 +exit
... ...
scripts/shell/batch_npzd.sh 0 โ†’ 100755
... ... @@ -0,0 +1,88 @@
  1 +#!/bin/bash
  2 +
  3 +export EXPDIR=$(pwd)
  4 +echo $EXPDIR
  5 +
  6 +if [ ! bio_npzd.mal ] || [ ! gotmrun.mal ]
  7 +then
  8 + echo " ERROR : .mal files missing"
  9 + exit
  10 +else
  11 +
  12 +echo "-----------------------------------------------------"
  13 +echo " batch_npzd.sh"
  14 +echo "-----------------------------------------------------"
  15 +
  16 +# Parameters for the NPZD model
  17 +rmax="0.04"
  18 +alpha="0.3"
  19 +inib="0.4"
  20 +k1="0.1"
  21 +w_p="-0.38"
  22 +
  23 +count=0
  24 +
  25 +for a in $rmax
  26 +do
  27 +for b in $alpha
  28 +do
  29 +for c in $inib
  30 +do
  31 +for d in $k1
  32 +do
  33 +for e in $w_p
  34 +do
  35 +
  36 +count=`expr $count + 1`
  37 +count=`expr 00$count | tail -4c`
  38 +echo $count
  39 +
  40 +if [ -f bio_npzd.nml ]
  41 +then
  42 + rm -f bio_npzd.nml
  43 +fi
  44 +
  45 +cat bio_npzd.mal | sed \
  46 + -e "s/param1/$a/g" \
  47 + -e "s/param2/$b/g" \
  48 + -e "s/param3/$c/g" \
  49 + -e "s/param4/$d/g" \
  50 + -e "s/param5/$e/g" \
  51 + > bio_npzd.nml
  52 +
  53 +if [ -f bio_npzd.nml ]
  54 +then
  55 + echo " bio_npzd.nml created"
  56 +fi
  57 +
  58 +if [ -f gotmrun.nml ]
  59 +then
  60 + rm -f gotmrun.nml
  61 +fi
  62 +
  63 +cat gotmrun.mal | sed \
  64 + -e "s/experiment_name/$count/g" \
  65 + > gotmrun.nml
  66 +
  67 +if [ -f gotmrun.nml ]
  68 +then
  69 + echo " gotmrun.nml created"
  70 +fi
  71 +
  72 +strt=`date +%H:%M:%S`
  73 +echo " started at "$strt
  74 +
  75 +./gotm_prod_IFORT >& $count.out
  76 +
  77 +end=`date +%H:%M:%S`
  78 +echo " ended at "$end
  79 +
  80 +done
  81 +done
  82 +done
  83 +done
  84 +done
  85 +
  86 +fi
  87 +
  88 +exit
... ...