if [[ ! -d files ]];then 
    mkdir files
fi

for m in enet rf pls pcr;do 
    for i in had ;do
	for y2 in `seq 1970 2000`;do
	    for conf in 95;do
		cp /ROOT/params.txt /ROOT/files/params_${m}_${i}_${y2}_${conf}.txt
		cp /ROOT/run.sh /ROOT/files/run_${m}_${i}_${y2}_${conf}.sh

		sed -i 's/name_reconstruction=/name_reconstruction=AMV1900_noreg_'$m'_'$i'_'$y2'_'$conf'/g' /ROOT/files/params_${m}_${i}_${y2}_${conf}.txt
		sed -i 's/path_mode=/path_mode=\/ROOT\/nasst_'$i'.csv/g' /ROOT/files/params_${m}_${i}_${y2}_${conf}.txt
		sed -i 's/y_start=/y_start=850/g' /ROOT/files/params_${m}_${i}_${y2}_${conf}.txt
		sed -i 's/y_stop=/y_stop='$y2'/g' /ROOT/files/params_${m}_${i}_${y2}_${conf}.txt
		sed -i 's/method=/method='$m'/g' /ROOT/files/params_${m}_${i}_${y2}_${conf}.txt
		sed -i 's/conf=/conf=0.'$conf'/g' /ROOT/files/params_${m}_${i}_${y2}_${conf}.txt
		sed -i 's/reg_px=/reg_px=F'$ce'/g' /ROOT/files/params_${m}_${i}_${y2}_${conf}.txt

		sed -i 's/params.txt/params_'$m'_'$i'_'$y2'_'$conf'.txt/g' /ROOT/files/run_${m}_${i}_${y2}_${conf}.sh

		qsub -q day /ROOT/files/run_${m}_${i}_${y2}_${conf}.sh
	    done
	done
    done
done
