
#   start 
./cgGS1 
#   energy 
#
cat alapoig.dat > PointAll
cat obenC5 alapoig.dat > C5.input 
#
# call guassian03
#
./subg3 
#
cat C5.output >> C5All
grep  'SCF Done:  E(RHF) ='  C5.output >> EnergyAll
grep  'SCF Done:  E(RHF) ='  C5.output > energy   
tr -s ' ' < energy > entr 
cut -d' ' -f6 entr > energy
cp  energy ala22ener.dat 
#
export num=650
grep -n 'Axes restored to original set' C5.output | head -n 1 >Noline
cut -d':' -f1 Noline > Noli
./num3
export num=$?
export num=$[$num+626]
head -n $num C5.output |tail -22  >gradfile 
cat gradfile >> GradAll
cp  gradfile ala22grad.dat
#
#   projector
./cgGS2r
#   predictor 
./cgGS5 
cat alapoig.dat >> PointAll
#                   GS  cycle 
export status=0
while (test $status -ne 10) do
#   energy and gradient 
cat obenC5 alapoig.dat > C5.input
#
# call gaussian03
#
./subg3
#
cat C5.output >> C5All
grep  'SCF Done:  E(RHF) =' C5.output > energy
cat  energy >>  EnergyAll
tr -s ' ' < energy > entr  
cut -d' ' -f6 entr > energy
cp  energy ala22ener.dat
#
# gradient 
#
export num=650
grep -n 'Axes restored to original set' C5.output | head -n 1 >Noline
cut -d':' -f1 Noline > Noli
./num3
export num=$?
export num=$[$num+626]
head -n $num C5.output |tail -22  >gradfile
cat gradfile >> GradAll
cp  gradfile ala22grad.dat
#
#   new GS point and test
./cgGS3 
export status=$?
#
if (test $status -eq 1) 
then
#   projector
./cgGS2r
#
cat NewP alapoig.dat >> PointAll
#   predictor 
./cgGS5 
export status=$?
fi
done
#                     end GS cycle
#
exit
