#!/bin/sh
MACH=`uname -s`
Sysx="`echo $MACH | cut -b -6`"
if [ $Sysx = "CYGWIN" ]; then
   MACH=`uname -o`
elif [ $Sysx = "AIX" ]; then
   MACH=`uname -s`
else
   MACH=`uname -sm | sed 's/[ ]/_/'`
fi
echo $MACH

FUELFUEL="FUELFUEL"
TYPETYPE="TYPETYPE"
RTRT="RTRT"
SPTSPT="SPTSPT"

intp=""
#intp="_nointp"

####################################
####################################
####################################
####################################
####################################
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


rm ${MACH}/_ACompoHetUOX
rm ${MACH}/_ACompoHetMOX
#cp ../Dragon/${MACH}/_ACompoHet_UOX_${sel} ${MACH}/_ACompoHetUOX
#cp ../Dragon/${MACH}/_ACompoHet_MOX_${sel} ${MACH}/_ACompoHetMOX
#cp ../Dragon/${MACH}/_ACompoHet_UOX_STD ${MACH}/_ACompoHUOXS
#cp ../Dragon/${MACH}/_ACompoHet_MOX_STD ${MACH}/_ACompoHMOXS
cp ../Dragon/${MACH}/_ACompoH2A_UOX_${sel} ${MACH}/_ACompoHetUOX
cp ../Dragon/${MACH}/_ACompoH2A_MOX_${sel} ${MACH}/_ACompoHetMOX
#cp ../Dragon/${MACH}/_ACompoH2_UOX_${sel} ${MACH}/_ACompoHetUOX
#cp ../Dragon/${MACH}/_ACompoH2_MOX_${sel} ${MACH}/_ACompoHetMOX
#cp ../Dragon/${MACH}/_ACompoH_UOX_${sel}_0 ${MACH}/_ACompoHetUOX
#cp ../Dragon/${MACH}/_ACompoH_UOX_${sel}_0 ${MACH}/_ACompoHetMOX
#cp ${MACH}/ACPOenrichU0_${sel}_UOX_0_112_122_123 ${MACH}/_ACompoHetUOX 
#cp ${MACH}/ACPOenrichU0_${sel}_MOX_0_112_122_123 ${MACH}/_ACompoHetMOX 




########
########
########
fuel="UOX"
type="Heter0"
rt=0
spt=0
  cp mydata/rep900EnrichCOMPO_template.x2m mydata/rep900EnrichCOMPO.x2m 
  perl -pi -e "s/$FUELFUEL/$fuel/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$TYPETYPE/$type/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$RTRT/$rt/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$SPTSPT/$spt/g" mydata/rep900EnrichCOMPO.x2m
  cp mydata/rep900EnrichCOMPO.x2m mydata/rep900EnrichCOMPO.x2m_${fuel}_${type}${intp} 
  ./rdonjon -p rep900EnrichCOMPO.x2m
  cp ${MACH}/rep900EnrichCOMPO.result ${MACH}/rep900EnrichCOMPO.result_${fuel}_${type}${intp} 
  mv ${MACH}/ACPOenrich ${MACH}/_ACompoHet${fuel}
#########
type="Heter1"
rt=3
spt=2
  cp mydata/rep900EnrichCOMPO_template.x2m mydata/rep900EnrichCOMPO.x2m 
  perl -pi -e "s/$FUELFUEL/$fuel/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$TYPETYPE/$type/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$RTRT/$rt/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$SPTSPT/$spt/g" mydata/rep900EnrichCOMPO.x2m
  cp mydata/rep900EnrichCOMPO.x2m mydata/rep900EnrichCOMPO.x2m_${fuel}_${type}_${rt}${intp}
  ./rdonjon -p rep900EnrichCOMPO.x2m
  cp ${MACH}/rep900EnrichCOMPO.result ${MACH}/rep900EnrichCOMPO.result_${fuel}_${type}_${rt}_${spt}${intp} 
  mv ${MACH}/ACPOenrich ${MACH}/_ACompoHet${fuel}
#########
type="Heter1"
rt=2
spt=2
  cp mydata/rep900EnrichCOMPO_template.x2m mydata/rep900EnrichCOMPO.x2m 
  perl -pi -e "s/$FUELFUEL/$fuel/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$TYPETYPE/$type/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$RTRT/$rt/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$SPTSPT/$spt/g" mydata/rep900EnrichCOMPO.x2m
  cp mydata/rep900EnrichCOMPO.x2m mydata/rep900EnrichCOMPO.x2m_${fuel}_${type}_${rt}${intp}
  ./rdonjon -p rep900EnrichCOMPO.x2m
  cp ${MACH}/rep900EnrichCOMPO.result ${MACH}/rep900EnrichCOMPO.result_${fuel}_${type}_${rt}_${spt}${intp} 
  mv ${MACH}/ACPOenrich ${MACH}/_ACompoHet${fuel}
#########
type="Heter1"
rt=2
spt=1
  cp mydata/rep900EnrichCOMPO_template.x2m mydata/rep900EnrichCOMPO.x2m 
  perl -pi -e "s/$FUELFUEL/$fuel/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$TYPETYPE/$type/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$RTRT/$rt/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$SPTSPT/$spt/g" mydata/rep900EnrichCOMPO.x2m
  cp mydata/rep900EnrichCOMPO.x2m mydata/rep900EnrichCOMPO.x2m_${fuel}_${type}_${rt}${intp}
  ./rdonjon -p rep900EnrichCOMPO.x2m
  cp ${MACH}/rep900EnrichCOMPO.result ${MACH}/rep900EnrichCOMPO.result_${fuel}_${type}_${rt}_${spt}${intp} 
  mv ${MACH}/ACPOenrich ${MACH}/_ACompoHet${fuel}
########
type="Heter1"
rt=3
spt=1
  cp mydata/rep900EnrichCOMPO_template.x2m mydata/rep900EnrichCOMPO.x2m 
  perl -pi -e "s/$FUELFUEL/$fuel/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$TYPETYPE/$type/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$RTRT/$rt/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$SPTSPT/$spt/g" mydata/rep900EnrichCOMPO.x2m
  cp mydata/rep900EnrichCOMPO.x2m mydata/rep900EnrichCOMPO.x2m_${fuel}_${type}_${rt}${intp}
  ./rdonjon -p rep900EnrichCOMPO.x2m
  cp ${MACH}/rep900EnrichCOMPO.result ${MACH}/rep900EnrichCOMPO.result_${fuel}_${type}_${rt}_${spt}${intp} 
  mv ${MACH}/ACPOenrich ${MACH}/_ACompoHet${fuel}

#mv ${MACH}/_ACompoHet${fuel} ${MACH}/ACPOenrichU0_${sel}_${fuel}_0_112_113_122_123${intp}

#########
type="Heter2"
rt=3
spt=2
  cp mydata/rep900EnrichCOMPO_template.x2m mydata/rep900EnrichCOMPO.x2m 
  perl -pi -e "s/$FUELFUEL/$fuel/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$TYPETYPE/$type/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$RTRT/$rt/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$SPTSPT/$spt/g" mydata/rep900EnrichCOMPO.x2m
  cp mydata/rep900EnrichCOMPO.x2m mydata/rep900EnrichCOMPO.x2m_${fuel}_${type}_${rt}${intp}
  ./rdonjon -p rep900EnrichCOMPO.x2m
  cp ${MACH}/rep900EnrichCOMPO.result ${MACH}/rep900EnrichCOMPO.result_${fuel}_${type}_${rt}_${spt}${intp} 
  mv ${MACH}/ACPOenrich ${MACH}/_ACompoHet${fuel}
#########
type="Heter2"
rt=2
spt=2
  cp mydata/rep900EnrichCOMPO_template.x2m mydata/rep900EnrichCOMPO.x2m 
  perl -pi -e "s/$FUELFUEL/$fuel/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$TYPETYPE/$type/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$RTRT/$rt/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$SPTSPT/$spt/g" mydata/rep900EnrichCOMPO.x2m
  cp mydata/rep900EnrichCOMPO.x2m mydata/rep900EnrichCOMPO.x2m_${fuel}_${type}_${rt}${intp}
  ./rdonjon -p rep900EnrichCOMPO.x2m
  cp ${MACH}/rep900EnrichCOMPO.result ${MACH}/rep900EnrichCOMPO.result_${fuel}_${type}_${rt}_${spt}${intp} 
  mv ${MACH}/ACPOenrich ${MACH}/_ACompoHet${fuel}
#########
type="Heter2"
rt=2
spt=1
  cp mydata/rep900EnrichCOMPO_template.x2m mydata/rep900EnrichCOMPO.x2m 
  perl -pi -e "s/$FUELFUEL/$fuel/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$TYPETYPE/$type/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$RTRT/$rt/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$SPTSPT/$spt/g" mydata/rep900EnrichCOMPO.x2m
  cp mydata/rep900EnrichCOMPO.x2m mydata/rep900EnrichCOMPO.x2m_${fuel}_${type}_${rt}${intp}
  ./rdonjon -p rep900EnrichCOMPO.x2m
  cp ${MACH}/rep900EnrichCOMPO.result ${MACH}/rep900EnrichCOMPO.result_${fuel}_${type}_${rt}_${spt}${intp} 
  mv ${MACH}/ACPOenrich ${MACH}/_ACompoHet${fuel}
########
type="Heter2"
rt=3
spt=1
  cp mydata/rep900EnrichCOMPO_template.x2m mydata/rep900EnrichCOMPO.x2m 
  perl -pi -e "s/$FUELFUEL/$fuel/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$TYPETYPE/$type/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$RTRT/$rt/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$SPTSPT/$spt/g" mydata/rep900EnrichCOMPO.x2m
  cp mydata/rep900EnrichCOMPO.x2m mydata/rep900EnrichCOMPO.x2m_${fuel}_${type}_${rt}${intp}
  ./rdonjon -p rep900EnrichCOMPO.x2m
  cp ${MACH}/rep900EnrichCOMPO.result ${MACH}/rep900EnrichCOMPO.result_${fuel}_${type}_${rt}_${spt}${intp} 
  mv ${MACH}/ACPOenrich ${MACH}/_ACompoHet${fuel}

#mv ${MACH}/_ACompoHet${fuel} ${MACH}/ACPOenrich_${sel}_${fuel}_0_1x2-12_13_22_23${intp}
#mv ${MACH}/_ACompoHet${fuel} ${MACH}/ACPOenrsph_${sel}_${fuel}_0_1x2-12_13_22_23${intp}
mv ${MACH}/_ACompoHet${fuel} ${MACH}/ACPOenrsphA_${sel}_${fuel}_0_1x2-12_13_22_23${intp}

########
########
########
fuel="MOX"
type="Heter0"
rt=0
spt=0
  cp mydata/rep900EnrichCOMPO_template.x2m mydata/rep900EnrichCOMPO.x2m 
  perl -pi -e "s/$FUELFUEL/$fuel/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$TYPETYPE/$type/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$RTRT/$rt/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$SPTSPT/$spt/g" mydata/rep900EnrichCOMPO.x2m
  cp mydata/rep900EnrichCOMPO.x2m mydata/rep900EnrichCOMPO.x2m_${fuel}_${type}${intp} 
  ./rdonjon -p rep900EnrichCOMPO.x2m
  cp ${MACH}/rep900EnrichCOMPO.result ${MACH}/rep900EnrichCOMPO.result_${fuel}_${type}${intp} 
  mv ${MACH}/ACPOenrich ${MACH}/_ACompoHet${fuel}
#########
type="Heter1"
rt=3
spt=2
  cp mydata/rep900EnrichCOMPO_template.x2m mydata/rep900EnrichCOMPO.x2m 
  perl -pi -e "s/$FUELFUEL/$fuel/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$TYPETYPE/$type/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$RTRT/$rt/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$SPTSPT/$spt/g" mydata/rep900EnrichCOMPO.x2m
  cp mydata/rep900EnrichCOMPO.x2m mydata/rep900EnrichCOMPO.x2m_${fuel}_${type}_${rt}${intp}
  ./rdonjon -p rep900EnrichCOMPO.x2m
  cp ${MACH}/rep900EnrichCOMPO.result ${MACH}/rep900EnrichCOMPO.result_${fuel}_${type}_${rt}_${spt}${intp} 
  mv ${MACH}/ACPOenrich ${MACH}/_ACompoHet${fuel}
#########
type="Heter1"
rt=2
spt=2
  cp mydata/rep900EnrichCOMPO_template.x2m mydata/rep900EnrichCOMPO.x2m 
  perl -pi -e "s/$FUELFUEL/$fuel/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$TYPETYPE/$type/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$RTRT/$rt/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$SPTSPT/$spt/g" mydata/rep900EnrichCOMPO.x2m
  cp mydata/rep900EnrichCOMPO.x2m mydata/rep900EnrichCOMPO.x2m_${fuel}_${type}_${rt}${intp}
  ./rdonjon -p rep900EnrichCOMPO.x2m
  cp ${MACH}/rep900EnrichCOMPO.result ${MACH}/rep900EnrichCOMPO.result_${fuel}_${type}_${rt}_${spt}${intp} 
  mv ${MACH}/ACPOenrich ${MACH}/_ACompoHet${fuel}
#########
type="Heter1"
rt=2
spt=1
  cp mydata/rep900EnrichCOMPO_template.x2m mydata/rep900EnrichCOMPO.x2m 
  perl -pi -e "s/$FUELFUEL/$fuel/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$TYPETYPE/$type/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$RTRT/$rt/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$SPTSPT/$spt/g" mydata/rep900EnrichCOMPO.x2m
  cp mydata/rep900EnrichCOMPO.x2m mydata/rep900EnrichCOMPO.x2m_${fuel}_${type}_${rt}${intp}
  ./rdonjon -p rep900EnrichCOMPO.x2m
  cp ${MACH}/rep900EnrichCOMPO.result ${MACH}/rep900EnrichCOMPO.result_${fuel}_${type}_${rt}_${spt}${intp} 
  mv ${MACH}/ACPOenrich ${MACH}/_ACompoHet${fuel}
########
type="Heter1"
rt=3
spt=1
  cp mydata/rep900EnrichCOMPO_template.x2m mydata/rep900EnrichCOMPO.x2m 
  perl -pi -e "s/$FUELFUEL/$fuel/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$TYPETYPE/$type/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$RTRT/$rt/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$SPTSPT/$spt/g" mydata/rep900EnrichCOMPO.x2m
  cp mydata/rep900EnrichCOMPO.x2m mydata/rep900EnrichCOMPO.x2m_${fuel}_${type}_${rt}${intp}
  ./rdonjon -p rep900EnrichCOMPO.x2m
  cp ${MACH}/rep900EnrichCOMPO.result ${MACH}/rep900EnrichCOMPO.result_${fuel}_${type}_${rt}_${spt}${intp} 
  mv ${MACH}/ACPOenrich ${MACH}/_ACompoHet${fuel}


#########
type="Heter2"
rt=3
spt=2
  cp mydata/rep900EnrichCOMPO_template.x2m mydata/rep900EnrichCOMPO.x2m 
  perl -pi -e "s/$FUELFUEL/$fuel/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$TYPETYPE/$type/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$RTRT/$rt/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$SPTSPT/$spt/g" mydata/rep900EnrichCOMPO.x2m
  cp mydata/rep900EnrichCOMPO.x2m mydata/rep900EnrichCOMPO.x2m_${fuel}_${type}_${rt}${intp}
  ./rdonjon -p rep900EnrichCOMPO.x2m
  cp ${MACH}/rep900EnrichCOMPO.result ${MACH}/rep900EnrichCOMPO.result_${fuel}_${type}_${rt}_${spt}${intp} 
  mv ${MACH}/ACPOenrich ${MACH}/_ACompoHet${fuel}
#########
type="Heter2"
rt=2
spt=2
  cp mydata/rep900EnrichCOMPO_template.x2m mydata/rep900EnrichCOMPO.x2m 
  perl -pi -e "s/$FUELFUEL/$fuel/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$TYPETYPE/$type/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$RTRT/$rt/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$SPTSPT/$spt/g" mydata/rep900EnrichCOMPO.x2m
  cp mydata/rep900EnrichCOMPO.x2m mydata/rep900EnrichCOMPO.x2m_${fuel}_${type}_${rt}${intp}
  ./rdonjon -p rep900EnrichCOMPO.x2m
  cp ${MACH}/rep900EnrichCOMPO.result ${MACH}/rep900EnrichCOMPO.result_${fuel}_${type}_${rt}_${spt}${intp} 
  mv ${MACH}/ACPOenrich ${MACH}/_ACompoHet${fuel}
#########
type="Heter2"
rt=2
spt=1
  cp mydata/rep900EnrichCOMPO_template.x2m mydata/rep900EnrichCOMPO.x2m 
  perl -pi -e "s/$FUELFUEL/$fuel/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$TYPETYPE/$type/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$RTRT/$rt/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$SPTSPT/$spt/g" mydata/rep900EnrichCOMPO.x2m
  cp mydata/rep900EnrichCOMPO.x2m mydata/rep900EnrichCOMPO.x2m_${fuel}_${type}_${rt}${intp}
  ./rdonjon -p rep900EnrichCOMPO.x2m
  cp ${MACH}/rep900EnrichCOMPO.result ${MACH}/rep900EnrichCOMPO.result_${fuel}_${type}_${rt}_${spt}${intp} 
  mv ${MACH}/ACPOenrich ${MACH}/_ACompoHet${fuel}
########
type="Heter2"
rt=3
spt=1
  cp mydata/rep900EnrichCOMPO_template.x2m mydata/rep900EnrichCOMPO.x2m 
  perl -pi -e "s/$FUELFUEL/$fuel/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$TYPETYPE/$type/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$RTRT/$rt/g" mydata/rep900EnrichCOMPO.x2m
  perl -pi -e "s/$SPTSPT/$spt/g" mydata/rep900EnrichCOMPO.x2m
  cp mydata/rep900EnrichCOMPO.x2m mydata/rep900EnrichCOMPO.x2m_${fuel}_${type}_${rt}${intp}
  ./rdonjon -p rep900EnrichCOMPO.x2m
  cp ${MACH}/rep900EnrichCOMPO.result ${MACH}/rep900EnrichCOMPO.result_${fuel}_${type}_${rt}_${spt}${intp} 
  mv ${MACH}/ACPOenrich ${MACH}/_ACompoHet${fuel}

#mv ${MACH}/_ACompoHet${fuel} ${MACH}/ACPOenrich_${sel}_${fuel}_0_1x2-12_13_22_23${intp}
#mv ${MACH}/_ACompoHet${fuel} ${MACH}/ACPOenrsph_${sel}_${fuel}_0_1x2-12_13_22_23${intp}
mv ${MACH}/_ACompoHet${fuel} ${MACH}/ACPOenrsphA_${sel}_${fuel}_0_1x2-12_13_22_23${intp}


  isph=`expr $isph + 1 `
done
