Skip to content

Commit

Permalink
Added SRIM intermediate files, along with scripts to generate multipl…
Browse files Browse the repository at this point in the history
…e instances of SRIM and average the data
  • Loading branch information
hereiam-at-mit-dot-edu committed May 13, 2015
1 parent 4b8d3ed commit 73e3a49
Show file tree
Hide file tree
Showing 113 changed files with 14,712 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#!/bin/bash

## This script reads in SRIM output files, and averages their
##output values. It is used when many, many SRIM simulations are desired,
## and each only runs a few ions, but with a different random seed.

function usage
{
echo "usage: ./AverageOutputs <options>"
echo " -p (string) --prefix (string) Output filename prefix"
echo " -h --help Show this usage statement"
}

## Get the filename prefix from the user

FilePrefix=""

while [ "$1" != "" ]; do
case $1 in
-p | --prefix ) shift
FilePrefix=$1
;;
-h | --help ) usage
exit
;;
* ) usage
exit 1
esac
shift
done

## Go through each .TXT file that matches the user's specified prefix.
## Trim it to the last 100 lines (the actual output). Then read in each
## line, split it into space-separated terms, and keep a running
## average. This effectively keeps a 100xN matrix in memory,
## containing averaged output values aat each distance. Only read the first
## column once, as all files contain identical depth information.

Filename=

## Define variables Data1 through Data100, to hold running totals of
## whatever we are averaging

for i in {1..100}
do
declare Data$i=0
done

FileNumber=0

for Filename in "$FilePrefix"*.TXT; do

echo "Opening "$Filename" for averaging"

## Use 'tail' to trim each file to the last 100 lines

tail -n 102 $Filename > temp.txt

## Trim the last three lines if this is a VACANCY file

if [ "$FilePrefix" == "VACANCY" ]; then
head -n 100 temp.txt > data.txt
elif [ "$FilePrefix" == "RANGE" ]; then
tail -n 100 temp.txt > data.txt
fi

## Open each file line-by-line

i=1

while read line; do
IFS=' ' read -a splitline <<< "$line"
# split(line, splitline, " ")
# echo ${splitline[2]}


## Replce the 'E' in all numbers with a (*10**) for bc -le
D1=$(echo "${splitline[1]})" | sed -r 's/E/*10\^\(/g' | sed -r 's/\+//g')
D2=$(echo "${splitline[2]})" | sed -r 's/E/*10\^\(/g' | sed -r 's/\+//g')
var="Data$i"
if [ "$FilePrefix" == "VACANCY" ]; then
# echo "(("${!var}" * "$FileNumber" + "$D1" + "$D2") / ($FileNumber + 1))"
# echo "(("${!var}" * "$FileNumber" + "$D1" + "$D2") / ($FileNumber + 1))" | bc -l
declare "Data$i"="$(echo "(${!var} * $FileNumber + $D1 + $D2) / ($FileNumber + 1)" | bc -l)"
elif [ "$FilePrefix" == "RANGE" ]; then
declare "Data$i"="$(echo "(${!var} * $FileNumber + ($D1 / 10000000)) / ($FileNumber + 1)" | bc -l)"
fi
i=$((i+1))

done < data.txt

## End the for loop

FileNumber=$((FileNumber+1))

done

## Finally, write out the distance vs. quantity information as a comma separated file.
## Read the distance data (in Angstroms) from the original data.txt file.

rm $FilePrefix-Averaged.csv
i=1
while read line; do
IFS=' ' read -a splitline <<< "$line"
var="Data$i"
Distance=$(echo "${splitline[0]})" | sed -r 's/E/*10\^\(/g' | sed -r 's/\+//g')
Distance="$(echo "${Distance} / 10" | bc -l)"
echo "$Distance ${!var}" >> $FilePrefix-Averaged.csv
i=$((i+1))
done < data.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
====== Fe (3500) into Fe =======
SRIM-2013.00
==================================================
ION and final RECOIL ATOM Distributions
See SRIM Outputs\TDATA.txt for calculation details
==================================================
--------------------------------------------------------------------
Recoil/Damage Calculations made with Kinchin-Pease Estimates
--------------------------------------------------------------------
----------------------------------------------------------------
There are NO RECOILS unless a full TRIM calculation is made.
----------------------------------------------------------------
See file : SRIM Outputs\TDATA.txt for details of calculation
Ion = Fe Energy = 3500 keV
============= TARGET MATERIAL ======================================
Layer 1 : Fe
Layer Width = 2.E+04 A Layer # 1- Density = 8.481E22 atoms/cm3 = 7.865 g/cm3
Layer # 1- Fe = 100 Atomic Percent = 100 Mass Percent
====================================================================
Total Ions calculated =10000.00
Ion Average Range = 107.3E+02 A Straggling = 211.5E+01 A
Ion Lateral Range = 187.5E+01 A Straggling = 234.1E+01 A
Ion Radial Range = 295.3E+01 A Straggling = 153.0E+01 A
====================================================================
Transmitted Ions =; Backscattered Ions =1
(These are not included in Skewne- and Kurtosis below.)

Range Skewne- = -000.9685 &= [-(X-Rp)^3]/[N*Straggle^3]
Range Kurtosis = 004.5458 &= [-(X-Rp)^4]/[N*Straggle^4]
Statistical definitions above are those used in VLSI implant modelling.
====================================================================
=================================================================
Table Distribution Units are >>> (Atoms/cm3) / (Atoms/cm2) <<<
=================================================================
DEPTH Fe Recoil
(Ang.) Ions Distribution
----------- ---------- ------------
200010.E-03 1.0000E+02 0.0000E+00
400010.E-03 0.0000E+00 0.0000E+00
600010.E-03 0.0000E+00 0.0000E+00
800010.E-03 5.0000E+01 0.0000E+00
100001.E-02 5.0000E+01 0.0000E+00
120001.E-02 5.0000E+01 0.0000E+00
140001.E-02 3.0000E+02 0.0000E+00
160001.E-02 1.5000E+02 0.0000E+00
180001.E-02 5.0000E+01 0.0000E+00
200001.E-02 2.5000E+02 0.0000E+00
220001.E-02 3.0000E+02 0.0000E+00
240001.E-02 2.0000E+02 0.0000E+00
260001.E-02 3.5000E+02 0.0000E+00
280001.E-02 2.5000E+02 0.0000E+00
300001.E-02 1.5000E+02 0.0000E+00
320001.E-02 4.5000E+02 0.0000E+00
340001.E-02 5.5000E+02 0.0000E+00
360001.E-02 5.0000E+02 0.0000E+00
380001.E-02 7.5000E+02 0.0000E+00
400001.E-02 6.0000E+02 0.0000E+00
420001.E-02 7.0000E+02 0.0000E+00
440001.E-02 8.0000E+02 0.0000E+00
460001.E-02 5.0000E+02 0.0000E+00
480001.E-02 6.0000E+02 0.0000E+00
500001.E-02 1.1500E+03 0.0000E+00
520001.E-02 1.0500E+03 0.0000E+00
540001.E-02 1.3000E+03 0.0000E+00
560001.E-02 1.7500E+03 0.0000E+00
580001.E-02 9.0000E+02 0.0000E+00
600001.E-02 2.3000E+03 0.0000E+00
620001.E-02 1.9500E+03 0.0000E+00
640001.E-02 2.2000E+03 0.0000E+00
660001.E-02 1.9500E+03 0.0000E+00
680001.E-02 3.1000E+03 0.0000E+00
700001.E-02 3.4000E+03 0.0000E+00
720001.E-02 2.6500E+03 0.0000E+00
740001.E-02 3.2500E+03 0.0000E+00
760001.E-02 4.6500E+03 0.0000E+00
780001.E-02 5.1000E+03 0.0000E+00
800001.E-02 6.1500E+03 0.0000E+00
820001.E-02 5.7500E+03 0.0000E+00
840001.E-02 7.2000E+03 0.0000E+00
860001.E-02 8.4000E+03 0.0000E+00
880001.E-02 9.3000E+03 0.0000E+00
900001.E-02 9.7000E+03 0.0000E+00
920001.E-02 1.0800E+04 0.0000E+00
940001.E-02 1.0550E+04 0.0000E+00
960001.E-02 1.1900E+04 0.0000E+00
980001.E-02 1.3950E+04 0.0000E+00
100000.E-01 1.5250E+04 0.0000E+00
102000.E-01 1.6150E+04 0.0000E+00
104000.E-01 1.8000E+04 0.0000E+00
106000.E-01 1.8450E+04 0.0000E+00
108000.E-01 2.0250E+04 0.0000E+00
110000.E-01 2.0600E+04 0.0000E+00
112000.E-01 2.1100E+04 0.0000E+00
114000.E-01 1.9400E+04 0.0000E+00
116000.E-01 2.2900E+04 0.0000E+00
118000.E-01 2.1650E+04 0.0000E+00
120000.E-01 2.1300E+04 0.0000E+00
122000.E-01 2.1100E+04 0.0000E+00
124000.E-01 2.0350E+04 0.0000E+00
126000.E-01 1.8950E+04 0.0000E+00
128000.E-01 1.6500E+04 0.0000E+00
130000.E-01 1.4450E+04 0.0000E+00
132000.E-01 1.2700E+04 0.0000E+00
134000.E-01 1.0200E+04 0.0000E+00
136000.E-01 8.5500E+03 0.0000E+00
138000.E-01 6.8500E+03 0.0000E+00
140000.E-01 5.4000E+03 0.0000E+00
142000.E-01 3.9000E+03 0.0000E+00
144000.E-01 2.4500E+03 0.0000E+00
146000.E-01 1.7000E+03 0.0000E+00
148000.E-01 8.5000E+02 0.0000E+00
150000.E-01 1.4000E+03 0.0000E+00
152000.E-01 7.0000E+02 0.0000E+00
154000.E-01 5.5000E+02 0.0000E+00
156000.E-01 1.0000E+02 0.0000E+00
158000.E-01 0.0000E+00 0.0000E+00
160000.E-01 5.0000E+01 0.0000E+00
162000.E-01 5.0000E+01 0.0000E+00
164000.E-01 0.0000E+00 0.0000E+00
166000.E-01 0.0000E+00 0.0000E+00
168000.E-01 0.0000E+00 0.0000E+00
170000.E-01 0.0000E+00 0.0000E+00
172000.E-01 0.0000E+00 0.0000E+00
174000.E-01 0.0000E+00 0.0000E+00
176000.E-01 0.0000E+00 0.0000E+00
178000.E-01 0.0000E+00 0.0000E+00
180000.E-01 0.0000E+00 0.0000E+00
182000.E-01 0.0000E+00 0.0000E+00
184000.E-01 0.0000E+00 0.0000E+00
186000.E-01 0.0000E+00 0.0000E+00
188000.E-01 0.0000E+00 0.0000E+00
190000.E-01 0.0000E+00 0.0000E+00
192000.E-01 0.0000E+00 0.0000E+00
194000.E-01 0.0000E+00 0.0000E+00
196000.E-01 0.0000E+00 0.0000E+00
198000.E-01 0.0000E+00 0.0000E+00
200000.E-01 0.0000E+00 0.0000E+00
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
====== Fe (3500) into Fe =======
SRIM-2013.00
==================================================
ION and final RECOIL ATOM Distributions
See SRIM Outputs\TDATA.txt for calculation details
==================================================
--------------------------------------------------------------------
Recoil/Damage Calculations made with Kinchin-Pease Estimates
--------------------------------------------------------------------
----------------------------------------------------------------
There are NO RECOILS unless a full TRIM calculation is made.
----------------------------------------------------------------
See file : SRIM Outputs\TDATA.txt for details of calculation
Ion = Fe Energy = 3500 keV
============= TARGET MATERIAL ======================================
Layer 1 : Fe
Layer Width = 2.E+04 A Layer # 1- Density = 8.481E22 atoms/cm3 = 7.865 g/cm3
Layer # 1- Fe = 100 Atomic Percent = 100 Mass Percent
====================================================================
Total Ions calculated =10000.00
Ion Average Range = 107.6E+02 A Straggling = 206.9E+01 A
Ion Lateral Range = 189.7E+01 A Straggling = 237.5E+01 A
Ion Radial Range = 296.9E+01 A Straggling = 153.5E+01 A
====================================================================
Range Skewne- = -000.8957 &= [-(X-Rp)^3]/[N*Straggle^3]
Range Kurtosis = 004.2190 &= [-(X-Rp)^4]/[N*Straggle^4]
Statistical definitions above are those used in VLSI implant modelling.
====================================================================
=================================================================
Table Distribution Units are >>> (Atoms/cm3) / (Atoms/cm2) <<<
=================================================================
DEPTH Fe Recoil
(Ang.) Ions Distribution
----------- ---------- ------------
200010.E-03 0.0000E+00 0.0000E+00
400010.E-03 5.0000E+01 0.0000E+00
600010.E-03 5.0000E+01 0.0000E+00
800010.E-03 1.0000E+02 0.0000E+00
100001.E-02 0.0000E+00 0.0000E+00
120001.E-02 1.0000E+02 0.0000E+00
140001.E-02 5.0000E+01 0.0000E+00
160001.E-02 0.0000E+00 0.0000E+00
180001.E-02 1.0000E+02 0.0000E+00
200001.E-02 1.0000E+02 0.0000E+00
220001.E-02 5.0000E+01 0.0000E+00
240001.E-02 4.0000E+02 0.0000E+00
260001.E-02 2.0000E+02 0.0000E+00
280001.E-02 2.5000E+02 0.0000E+00
300001.E-02 2.5000E+02 0.0000E+00
320001.E-02 2.5000E+02 0.0000E+00
340001.E-02 1.5000E+02 0.0000E+00
360001.E-02 2.5000E+02 0.0000E+00
380001.E-02 4.0000E+02 0.0000E+00
400001.E-02 3.5000E+02 0.0000E+00
420001.E-02 6.0000E+02 0.0000E+00
440001.E-02 5.5000E+02 0.0000E+00
460001.E-02 1.0500E+03 0.0000E+00
480001.E-02 6.5000E+02 0.0000E+00
500001.E-02 7.5000E+02 0.0000E+00
520001.E-02 1.1500E+03 0.0000E+00
540001.E-02 1.4000E+03 0.0000E+00
560001.E-02 1.8000E+03 0.0000E+00
580001.E-02 1.7500E+03 0.0000E+00
600001.E-02 2.1000E+03 0.0000E+00
620001.E-02 2.4500E+03 0.0000E+00
640001.E-02 2.0500E+03 0.0000E+00
660001.E-02 2.3000E+03 0.0000E+00
680001.E-02 2.7500E+03 0.0000E+00
700001.E-02 3.0500E+03 0.0000E+00
720001.E-02 3.0500E+03 0.0000E+00
740001.E-02 3.9500E+03 0.0000E+00
760001.E-02 4.5000E+03 0.0000E+00
780001.E-02 4.2500E+03 0.0000E+00
800001.E-02 5.7000E+03 0.0000E+00
820001.E-02 6.6500E+03 0.0000E+00
840001.E-02 7.8500E+03 0.0000E+00
860001.E-02 7.5000E+03 0.0000E+00
880001.E-02 8.1000E+03 0.0000E+00
900001.E-02 9.7500E+03 0.0000E+00
920001.E-02 1.1850E+04 0.0000E+00
940001.E-02 1.0200E+04 0.0000E+00
960001.E-02 1.2050E+04 0.0000E+00
980001.E-02 1.3700E+04 0.0000E+00
100000.E-01 1.5000E+04 0.0000E+00
102000.E-01 1.5800E+04 0.0000E+00
104000.E-01 1.7150E+04 0.0000E+00
106000.E-01 1.9650E+04 0.0000E+00
108000.E-01 1.9250E+04 0.0000E+00
110000.E-01 2.1050E+04 0.0000E+00
112000.E-01 2.0550E+04 0.0000E+00
114000.E-01 2.2800E+04 0.0000E+00
116000.E-01 2.0950E+04 0.0000E+00
118000.E-01 2.0150E+04 0.0000E+00
120000.E-01 2.2250E+04 0.0000E+00
122000.E-01 2.1800E+04 0.0000E+00
124000.E-01 1.9500E+04 0.0000E+00
126000.E-01 1.8900E+04 0.0000E+00
128000.E-01 1.7400E+04 0.0000E+00
130000.E-01 1.3950E+04 0.0000E+00
132000.E-01 1.2700E+04 0.0000E+00
134000.E-01 1.2050E+04 0.0000E+00
136000.E-01 1.0400E+04 0.0000E+00
138000.E-01 7.3500E+03 0.0000E+00
140000.E-01 4.0500E+03 0.0000E+00
142000.E-01 3.9000E+03 0.0000E+00
144000.E-01 2.3500E+03 0.0000E+00
146000.E-01 1.3500E+03 0.0000E+00
148000.E-01 1.3000E+03 0.0000E+00
150000.E-01 6.5000E+02 0.0000E+00
152000.E-01 5.5000E+02 0.0000E+00
154000.E-01 2.5000E+02 0.0000E+00
156000.E-01 1.5000E+02 0.0000E+00
158000.E-01 1.0000E+02 0.0000E+00
160000.E-01 5.0000E+01 0.0000E+00
162000.E-01 0.0000E+00 0.0000E+00
164000.E-01 5.0000E+01 0.0000E+00
166000.E-01 0.0000E+00 0.0000E+00
168000.E-01 0.0000E+00 0.0000E+00
170000.E-01 0.0000E+00 0.0000E+00
172000.E-01 0.0000E+00 0.0000E+00
174000.E-01 0.0000E+00 0.0000E+00
176000.E-01 0.0000E+00 0.0000E+00
178000.E-01 0.0000E+00 0.0000E+00
180000.E-01 0.0000E+00 0.0000E+00
182000.E-01 0.0000E+00 0.0000E+00
184000.E-01 0.0000E+00 0.0000E+00
186000.E-01 0.0000E+00 0.0000E+00
188000.E-01 0.0000E+00 0.0000E+00
190000.E-01 0.0000E+00 0.0000E+00
192000.E-01 0.0000E+00 0.0000E+00
194000.E-01 0.0000E+00 0.0000E+00
196000.E-01 0.0000E+00 0.0000E+00
198000.E-01 0.0000E+00 0.0000E+00
200000.E-01 0.0000E+00 0.0000E+00
Loading

0 comments on commit 73e3a49

Please sign in to comment.