#!/bin/sh

FUELFUEL="FUELFUEL"
SELSEL="SELSEL"


isph=4
while [ $isph -le 4 ]
  do 

if [ $isph -eq 1 ]; then
  sel="STD"
elif  [ $isph -eq 2 ]; then
  sel="SELE_FD"
elif  [ $isph -eq 3 ]; then
#  sel="SELE_GAP"
  sel="SELE_MWG"
elif  [ $isph -eq 4 ]; then
#  sel="EDF"
  sel="SELE_EDF"
fi

#sel="STD"
#sel="SELE_FD"
#sel="SELE_MWG"
#sel="SELE_EDF"
#########
fuel="UOX"
  cp mydata/rep900HA_mco_template.x2m mydata/rep900HA_mco${fuel}${sel}.x2m 
  cp mydata/rep900HA_mco_template.save mydata/rep900HA_mco${fuel}${sel}.save 
  cp mydata/rep900HA_mco.access mydata/rep900HA_mco${fuel}${sel}.access 
  rm -r mydata/rep900HA_mco${fuel}${sel}_proc
  mkdir mydata/rep900HA_mco${fuel}${sel}_proc
  cp -r mydata/rep900HA_mco_proc/* mydata/rep900HA_mco${fuel}${sel}_proc/. 
  perl -pi -e "s/$FUELFUEL/$fuel/g" mydata/rep900HA_mco${fuel}${sel}.x2m
  perl -pi -e "s/$FUELFUEL/$fuel/g" mydata/rep900HA_mco${fuel}${sel}.save
  perl -pi -e "s/$SELSEL/$sel/g" mydata/rep900HA_mco${fuel}${sel}.x2m
  perl -pi -e "s/$SELSEL/$sel/g" mydata/rep900HA_mco${fuel}${sel}.save
  nohup ./rdragon -p rep900HA_mco${fuel}${sel}.x2m &

fuel="MOX"
  cp mydata/rep900HA_mco_template.x2m mydata/rep900HA_mco${fuel}${sel}.x2m 
  cp mydata/rep900HA_mco_template.save mydata/rep900HA_mco${fuel}${sel}.save 
  cp mydata/rep900HA_mco.access mydata/rep900HA_mco${fuel}${sel}.access 
  rm -r mydata/rep900HA_mco${fuel}${sel}_proc
  mkdir mydata/rep900HA_mco${fuel}${sel}_proc
  cp -r mydata/rep900HA_mco_proc/* mydata/rep900HA_mco${fuel}${sel}_proc/. 
  perl -pi -e "s/$FUELFUEL/$fuel/g" mydata/rep900HA_mco${fuel}${sel}.x2m
  perl -pi -e "s/$FUELFUEL/$fuel/g" mydata/rep900HA_mco${fuel}${sel}.save
  perl -pi -e "s/$SELSEL/$sel/g" mydata/rep900HA_mco${fuel}${sel}.x2m
  perl -pi -e "s/$SELSEL/$sel/g" mydata/rep900HA_mco${fuel}${sel}.save
  nohup ./rdragon -p rep900HA_mco${fuel}${sel}.x2m &
 

  isph=`expr $isph + 1 `
done
