#! /bin/bash #path to the box model box=/home/valorso/GEK_BOXMOD_FEB_2016_v2/BOXMOD_v3.DYN.c/ if [ $# -ne 2 ] then echo argument missing exit fi [ -e fort.17 ] || echo 'il n y a pas de schema dans ce repertoire' [ -e fort.17 ] || exit echo echo -------------------------------- echo writing files for simulation ... echo -------------------------------- echo ... cat fort.21 fort.17 '>' $1.mech cat fort.21 fort.17 > $1.mech echo ... cp fort.7 $1.dict cp fort.7 $1.dict echo ... cp pvap.dat $1.sat cp pvap.dat $1.sat echo ... cp henry.dep $1.dep cp henry.dep $1.dep mv $1.dep $box'INPUT' echo ... cp fort.55 $1.55 AND cp fort.8 $1.8 cp fort.55 $1.55 cp fort.8 $1.8 echo echo -------------------------------- echo compteur ... echo -------------------------------- cd COMPTEUR rm fort.* cp ../fort.7 ./ ./count cd .. echo echo -------------------------------- echo searching code name of the input formula echo -------------------------------- name=$(./findname) echo code name found : $name echo echo -------------------------------- echo move files ..... echo -------------------------------- echo ... mv $1'.*' $box'CHEMDAT' mv $1.* $box'CHEMDAT' dirsav=$box'CHEMDAT/COMPTEUR/'$2 [ -e $dirsav ] || mkdir $dirsav && echo 'LE REP EXISTE DEJA' echo ... cp COMPTEUR/'X*' $box'CHEMDAT/COMPTEUR/'$2'/' cp COMPTEUR/X* $box'CHEMDAT/COMPTEUR/'$2'/' [ -e indat1.dim ] && cp indat*.dim $box'CHEMDAT/COMPTEUR/'$2'/' echo echo --------------------------------- echo interpreting $1.mech echo --------------------------------- cd $box'CHEMDAT' ./runintp.unix $1 > $1_interp.out echo echo --------------------------------- echo creating $2 repertory for simulation echo --------------------------------- cd .. [ -e $box$2 ] && echo 'le rep existe' || cp -r XXXXX $2 cd $2 echo ... modifying start.unix sed -i s/xxxxx/$1/g start.unix sed -i s/XXXXX/$2/g start.unix echo ... modifying start.key sed -i "s/xxxxx/$name/g" start.key echo #echo enter the initial concentration of the parent species in ppb #read numpp #let numpp2=$numpp*25 #sed -i "s/XX/$numpp2/g" start.key echo ... modifying plot.key sed -i "s/xxxxx/$name/g" plot.key echo echo enter the number of carbon of the parent species read numc let numc2=$numc*4 sed -i "s/XX/$numc2/g" plot.key echo ... done #echo #echo ---------------------------------- #echo launch simulation : #echo ---------------------------------- #echo enter yes to launch the simulation, anything else for no? #read answer #if [ $answer = yes ] # then # ulimit -s unlimited # ./start.unix > simu_$1.out & # echo ... simulation launched ! # else # exit #fi echo echo --------------------------------- echo '/!\' WARNING echo HR and Temp must be set in $box'/LIB/spforcage3.f' echo Zenithal angle must be set in $box'/LIB/spinterp4.f' echo Initial concentrations must be set in $box'/'$2'/start.key' echo Pvap SAR must be set in $box'/PROG/boxmod1_aer2.f' echo Parent species name must be modified in the extracting programs echo