Title                  :PINT.DOC
Keywords               :EELS - planar interface calculations
Computer               :VAX 780
Operating System       :VAX/VMS version 4.7
Programming Language   :FORTRAN 77
Hardware Requirements  :Tektronics 4010 series graphic terminal or emulator
                        desirable but not essential.
Author(s)              :C.A. Walsh - based on a BASIC program written by
                        A. Howie.
Correspondence Address :Microstructural Physics Group, Cavendish Laboratory,
                        Madingley Road, Cambridge, CB3 0HE, England.
 
Documentation:
 
   The program uses the result obtained by Garcia-Molina, Gras-Marti, Howie
and Ritchie (J. Phys. C18 (1985) pp5335) to calculate the energy loss of
electrons travelling parallel to a planar interface. They obtained an
expression for the differential probability dP/(dzdhf), for an electron
travelling in the z direction and losing energy hf. The probability of
losing energy between hf-dhf/2 and hf+dhf/2 after travelling a distance dz
parallel to the interface is given by dP/(dzdhf) x dzdhf. In practise, for a
specimen of thickness T, the calculations are split into x number of steps of
length dz=T/x << plasmon mean free path. This allows multiple scattering to be
taken into account more effectively.
 
   The same result can also be used to calculate the energy loss of electrons
incident at an angle to an interface (see Howie, Milne and Walls,(1985) Inst.
Phys. Conf. Ser. No. 78: Chapter 4, EMAG'85). The calculations are made by
considering the electron path to consist of a series of steps parallel to the
interface. Such calculations are generally made in stages:
 
1. Start with the electron a long way from the interface and bring it in closer
to the interface. Further from the interface the probability of loss is
 smaller,
hence fewer steps and longer step lengths can be used.
 
2. With the electron initially closer to the interface move the electron to the
interface. In this stage a short step length should be used so that the
 distance
between successive steps (in the direction perpendicular to the interface) is
small (1 Angstrom? try for yourself!).
 
3. From the interface into the medium 1. If you wish to compare results with
experimental data to find the best penetration depth, then you can keep
 stopping
at different distances inside the medium. Printed and graphical output are
produced after each stage. N.B. A factor of 2 is already included in the step
length to account for losses incurred during the return path of the electron
out of the medium again. (This is NOT true when the electrons travel parallel
to the interface (THETA=0).).
 
   An example of this is given in the listings at the end of this file showing
the questions asked by the program and answers given by the user. The
 dielectric
data for aluminium that was used is also given and the ouput file showing the
calculated spectra are also shown. No graphical output was obtained.
 
IMPLEMENTATION OF THE PROGRAM.
 
   The program is written in FORTRAN 77. It calls graphics routines from the
library of routines NGRAPH supplied by Nestor Zaluzec. N.B.
_________________________
       N.B.
-------------------------
   This program is written using output unit 6 to write to the terminal/screen.
The graphics routines written by Nestor Zaluzec write to the terminal on unit
7. Hence it will be necessary to change all WRITE statements to the terminal
in either this program and/or in the NGRAPH routines to whatever unit is used
 on
your own computer for output to the terminal.
-------------------------
    END OF N.B.
-------------------------
The following is the compilation and linking procedure used on a VAX system for
this program:
$ FORTRAN PINT
$ FORTRAN/EXTEND NGRAPH
$ LINK PINT,NGRAPH
$ RUN PINT
 
The program then assumes the existance of the file TERMIN.DAT in your
 filespace.
This file is accessed by Nestor Zaluzec's graphics routines and gives details
 of
the graphics terminal type being used and the baud rate. A copy of this file is
given here:
GRAPHICS TERMINAL TYPE:10
BAUD RATE FOR GRAPHICS: 9600
--------------------------------------------------------
TERMINAL DEFINITIONS:
---------------------
0 = TEKTRONICS 4010-1,4014-1 (WITH HARDWARE CURSOR)
1 = TEKTRONICS 4006  ,4010   (NO HARDWARE CURSOR)
2 = LEAR SIEGLER ADM-3,ADM-5 (WITH RETROGRAPHICS RG-512)
3 = PERITEK VCG-512 BIT MAP COLOR GRAPHICS
--------------------------------------------------------
BAUD RATE RANGE FOR GRAPHICS (110 - 19200)
--------------------------------------------------------
N.B. The first two lines are read in using a formatted read statement. Hence,
do not change the number of characters on these two lines if you need to change
the terminal type or baud rate.
 
DIELECTRIC DATA
 
   The program requires dielectric data for the media on either side of
the interface. A limited amount of data is stored inside the program for some
materials. Calculations made using this data are then made at 1eV energy
intervals which will correspond, experimentally, to using 1eV wide energy
channels for the collectin of the spectra. Users can supply their own
 dielectric
data for use by the program. The data must be supplied with a constant energy
interval. The data must be in a file with the following format:
 
First line:  Exactly 24 characters as a title.
Second line: No. of data items   energy interval between succesive items (eV)
Third line:  Energy (eV)  real part of epsilon   imaginary part of epsilon
Fourth line: etc.
 
MISCELLANEOUS INFORMATION
 
1. The calculations are made using 10E6 incident electrons. These are placed
either in the zero loss channel, or as a gaussian distribution about the zero
loss channel with the specified full width half height = 2xstandard deviation.
Spectra written to a file in the format suitable for being read by Nestor
Zaluzec's NELS program include 100 channels corresponding to negative energy
loss.
 
2. The angle of incidence requested by the program is the angle between the
electron beam direction and the plane of the interface. If this angle is set
to zero the electon beam travels parallel to the interface.
 
3. THE INNER POTENTIAL
In the glancing angle configuration, electrons are refracted when they pass
 from
one medium to another. For an incident angle i the refracted angle r is given
 by
                   r x r = i x i  +  V/E
where V is positive and is equal to the inner potential of medium 2 when the
electrons pass from a vacuum (medium 1) into medium 2. If neither media are a
vacuum the refraction of the electrons is ignored in this program. V generally
lies between 5 and 30 eV. A default value of 18 eV is specified in this
 program.
The inner potential is used to recalculate the angle the electron beam makes to
the interface when it passes from medium 2 into medium 1. However, for this to
be done one stage of the calculations must finish with the electron at the
interface.
 
4. When specifying the distance of the electrons from the interface it should
be noted that positive values lie in medium 2 and negative values lie in
medium 1.
 
5. The units of the scattering vectors Ky: A new variable = Kyv/w is used in
 the
program (where v is the electron velocity and h-cross x w is the energy loss.)
The integration in the energy loss calculation is made using this variable. The
required units in whuch RKYMAX and RKYMIN, the maximum and minimum collected
scattering vectors, must be specified are those for which Kyv/w' where
h-cross x w' = e, the electronic charge. In terms of angular scattering this
becomes
   semi-angle = Ky/K = (Kyv/w')/(Kv/w') = (Kyv/w')/2E
where E, v and K are the energy, velocity and wavevector of the incident
electrons. Hence, RKYMAX = Semi-angle (rads) x 2 x E (eV). For 100keV electrons
200 units = 1mrad.
 
6. It should be noted that the integration occurs over Ky only. The integration
over Kx (where x is the direction perpendicular to the interface) has been
implicitly been taken to infinity. Consequently the values of RKYMAX and RKYMIN
do not quite correspond to the upper and lower collection angles in an electron
microscope. In particular, it should be noted that for the case of an electron
travelling through a bulk material the probability of energy loss is
proportional to Im(-1/epsilon)x ln(qv/w) (Landau and Lifschitz,
 'Electrodynamics
of Continuous Media'), where q is the upper cut-off wavenumber, whereas the
expression used in this program yields the result that the energy loss
probability is proportional to Im(-1/epsilon)ln(2qv/w).
 
7. The output from this program consists of the calculated spectrum as number
 of
electrons in each energy channel. The zero loss intensity specified is the
number if electrons left in the zero loss channel. The probability given is
that calculated for the last step. The spectrum gives the final number of
electrons in each energy loss channel.
 
A SAMPLE SET OF DIELECTRIC DATA
 
..Aluminium.............
50 1.0
  1.000 -0.1539D+03  0.3021D+02
  2.000 -0.5424D+02  0.1950D+02
  3.000 -0.2497D+02  0.5258D+01
  4.000 -0.1390D+02  0.2203D+01
  5.000 -0.8617D+01  0.1120D+01
  6.000 -0.5700D+01  0.6208D+00
  7.000 -0.3923D+01  0.3753D+00
  8.000 -0.2762D+01  0.2381D+00
  9.000 -0.1962D+01  0.1560D+00
 10.000 -0.1386D+01  0.1042D+00
 11.000 -0.9562D+00  0.6971D-01
 12.000 -0.6241D+00  0.5190D-01
 13.000 -0.3701D+00  0.4588D-01
 14.000 -0.1712D+00  0.4011D-01
 15.000 -0.7825D-02  0.3834D-01
 16.000  0.1195D+00  0.4174D-01
 17.000  0.2232D+00  0.4013D-01
 18.000  0.3103D+00  0.3885D-01
 19.000  0.3835D+00  0.3745D-01
 20.000  0.4460D+00  0.3582D-01
 21.000  0.4875D+00  0.3438D-01
 22.000  0.5290D+00  0.3294D-01
 23.000  0.5706D+00  0.3151D-01
 24.000  0.6121D+00  0.3007D-01
 25.000  0.6536D+00  0.2863D-01
 26.000  0.6762D+00  0.2730D-01
 27.000  0.6988D+00  0.2597D-01
 28.000  0.7213D+00  0.2463D-01
 29.000  0.7439D+00  0.2330D-01
 30.000  0.7665D+00  0.2197D-01
 31.000  0.7806D+00  0.2117D-01
 32.000  0.7946D+00  0.2037D-01
 33.000  0.8087D+00  0.1957D-01
 34.000  0.8227D+00  0.1877D-01
 35.000  0.8368D+00  0.1797D-01
 36.000  0.8460D+00  0.1744D-01
 37.000  0.8552D+00  0.1691D-01
 38.000  0.8643D+00  0.1639D-01
 39.000  0.8735D+00  0.1586D-01
 40.000  0.8827D+00  0.1533D-01
 41.000  0.8892D+00  0.1487D-01
 42.000  0.8957D+00  0.1441D-01
 43.000  0.9023D+00  0.1396D-01
 44.000  0.9088D+00  0.1350D-01
 45.000  0.9153D+00  0.1304D-01
 46.000  0.9200D+00  0.1271D-01
 47.000  0.9247D+00  0.1238D-01
 48.000  0.9295D+00  0.1204D-01
 49.000  0.9342D+00  0.1171D-01
 50.000  0.9389D+00  0.1138D-01
 
A SAMPLE RUN FOR THE REFLECTION CASE:
 
 GLANCING ANGLE PROGRAM FOR
 VACUUM    0 (MEDIUM 2 ONLY)
 MgO       1
 SILICON   2
 SILICA    3
 CARBON    4
 DIAMOND   5
 ALUMINIUM 6
 ALUMINA   7
 GaAs      8
 GaP       9
 GaP"     10
 DIAMOND" 11
 SILICA"  12
 USER DEFINED DATA  -1
 INPUT MEDIUM 1 AND MEDIUM 2:
-1 0
 FILENAME OF DATA FOR MEDIUM  1:
ALS.DAT
 MEDIUM  2 IS A VACUUM
 DO YOU WANT TO SEE THE DIELECTRIC DATA (Y/N)?
N
 DO YOU WANT TO SEE THE PROBABILITY INFO? (Y/N)
 (Reply no unless you know what you are doing.)
N
 PARAMETER CHECK. PRESS Y IF O.K., OR N IF YOU
 WANT TO ENTER A NEW VALUE.
 ENERGY OF INCIDENT ELECTRONS (KeV) = E =    100.000
Y
 ENERGY OF INCIDENT ELECTRONS (KeV) = E =    100.000
 KYMIN AND KYMAX ARE THE MINIMUM AND MAXIMUM  COLLECTION SEMIANGLES
 WITH A SCALE OF  1 unit = 0.5/E(eV) mrad. For 100keV electrons  200 = 1mrad.
 KYMIN =      0.000
Y
 KYMIN =      0.000
 KYMAX =   1600.000
Y
 KYMAX =   1600.000
 DKY0 is the first step length used in the integration over Ky.
 ALPHA is used to increase the step length with Ky during the integration.
 FIRST STEP DKY0 =      0.100
Y
 FIRST STEP DKY0 =      0.100
 ALPHA = STEP/Ky =      0.500
Y
 ALPHA = STEP/Ky =      0.500
 If you wish to make the calculation non-relativistically, set BETA=0.
 BETA =      0.548
Y
 BETA =      0.548
 INITIAL DISTANCE OF THE ELECTRON FROM THE  INTERFACE (Angstroms) =    100.000
Y
 INITIAL DISTANCE OF THE ELECTRON FROM THE  INTERFACE (Angstroms) =    100.000
 INPUT THETA = ANGLE OF INCIDENCE OF THE ELECTRONS TO THE INTERFACE (radians)
 (CAN BE 0):
0.003
 THETA =      0.003
 INNER POTENTIAL OF MEDIUM 1 =  18.00 eV.
Y
 INNER POTENTIAL OF MEDIUM 1 =  18.00
 DO YOU WANT A GRAPH (Y/N)?
N
 ARE THE PARAMETERS O.K.? (Y/N):
Y
 DO YOU WISH TO SPECIFY THE ENERGY WIDTH OF THE
 INCIDENT BEAM (Y/N)?
Y
 INPUT FULL WIDTH AT HALF HEIGHT OF THE INCIDENT BEAM (eV):
1
  INPUT OUTPUT FILENAME FOR CALCULATED SPECTRA:
ALOUT.DAT
 THE ELECTRON IS NOW AT A DISTANCE OF    100.000 ANGSTROMS FROM THE INTERFACE.
 DO YOU WISH TO CONTINUE (Y/N)?
Y
 FINAL DISTANCE OF THE ELECTRONS FROM THE INTERFACE (ANGSTROMS)=
20
 KYMAX=  1600.000
 O.K.? (Y/N)
Y
 KYMAX=  1600.000
 ANGLE OF ELECTRON PATH TO THE INTERFACE=     0.003 radians.
 INPUT NUMBER OF STEPS INTO WHICH THE ELECTRON PATH IS TO BE DIVIDED:
10
 please wait.......calculation in progress.
 THE ELECTRON IS NOW AT A DISTANCE OF     20.000 ANGSTROMS FROM THE INTERFACE.
 DO YOU WISH TO CONTINUE (Y/N)?
Y
 FINAL DISTANCE OF THE ELECTRONS FROM THE INTERFACE (ANGSTROMS)=
0
 KYMAX=  1600.000
 O.K.? (Y/N)
Y
 KYMAX=  1600.000
 ANGLE OF ELECTRON PATH TO THE INTERFACE=     0.003 radians.
 INPUT NUMBER OF STEPS INTO WHICH THE ELECTRON PATH IS TO BE DIVIDED:
10
 please wait.......calculation in progress.
 THE ELECTRON IS NOW AT A DISTANCE OF      0.000 ANGSTROMS FROM THE INTERFACE.
 DO YOU WISH TO CONTINUE (Y/N)?
Y
 FINAL DISTANCE OF THE ELECTRONS FROM THE INTERFACE (ANGSTROMS)=
-5
 KYMAX=  1600.000
 O.K.? (Y/N)
Y
 KYMAX=  1600.000
 ANGLE OF ELECTRON PATH TO THE INTERFACE=     0.014 radians.
 INPUT NUMBER OF STEPS INTO WHICH THE ELECTRON PATH IS TO BE DIVIDED:
10
 please wait.......calculation in progress.
 THE ELECTRON IS NOW AT A DISTANCE OF     -5.000 ANGSTROMS FROM THE INTERFACE.
 DO YOU WISH TO CONTINUE (Y/N)?
N
 
 
THE OUTPUT FILE PRODUCED BY THE ABOVE PROGRAM RUN:
 
    ZERO LOSS PEAK INTENSITY= 10109.134
      ENERGY PROBABILITY     FINAL
      LOSS   OF LAST STEP   SPECTRUM
      1.000  0.1292D-02   1500.0079
      2.000  0.2862D-02    255.9052
      3.000  0.2516D-02    231.6028
      4.000  0.2825D-02    242.4906
      5.000  0.3512D-02    285.5603
      6.000  0.4632D-02    364.5952
      7.000  0.6912D-02    534.0717
      8.000  0.1243D-01   1021.0975
      9.000  0.3464D-01   5561.1537
     10.000  0.4600D+00  27391.1123
     11.000  0.2045D+00  10718.6308
     12.000  0.1514D-01   2349.7541
     13.000  0.5692D-02   1175.3002
     14.000  0.2989D-02   1044.3196
     15.000  0.1986D-02   1123.4728
     16.000  0.1655D-02   1365.2915
     17.000  0.1286D-02   1885.3434
     18.000  0.1041D-02   3292.3165
     19.000  0.8610D-03  11145.1720
     20.000  0.7197D-03  42450.2752
     21.000  0.6207D-03  24062.5074
     22.000  0.5357D-03   8148.4303
     23.000  0.4626D-03   3287.8088
     24.000  0.3994D-03   2409.4517
     25.000  0.3448D-03   2375.5717
     26.000  0.3043D-03   2735.6897
     27.000  0.2682D-03   3590.6723
     28.000  0.2360D-03   5819.8024
     29.000  0.2073D-03  15463.6870
     30.000  0.1816D-03  49103.3315
     31.000  0.1641D-03  34155.4438
     32.000  0.1481D-03  14986.4219
     33.000  0.1336D-03   6421.7827
     34.000  0.1203D-03   3998.8188
     35.000  0.1083D-03   3589.8275
     36.000  0.9927D-04   3914.2073
     37.000  0.9095D-04   4904.1614
     38.000  0.8335D-04   7465.8988
     39.000  0.7629D-04  16975.8512
     40.000  0.6979D-04  47019.1014
     41.000  0.6425D-04  37180.1564
     42.000  0.5911D-04  19307.5265
     43.000  0.5439D-04   9139.1923
     44.000  0.4999D-04   5345.3286
     45.000  0.4592D-04   4360.3841
     46.000  0.4263D-04   4493.9081
     47.000  0.3956D-04   5390.5201
     48.000  0.3668D-04   7776.5507
     49.000  0.3403D-04  15809.5247
     50.000  0.3155D-04  39351.1456
 Parameters used:
 Media 1 and 2:..Aluminium.............VACUUM
 Reflection case: THETA =   0.003000 radians
     Inner potential    =  18.000000 eV
     Initial distance from interface =     100.00 Angstroms
     Final distance from interface   =      20.00 Angstroms
 Number of steps used =     10
 Minimum scattering angle =     0.0000 mrad
 Maximum scattering angle =     8.0000 mrad
 Beta =     0.5482
 Incident electron energy =   100.0000 keV
 Energy FWHH of zero loss beam =     1.0000 eV
    ZERO LOSS PEAK INTENSITY=   108.317
      ENERGY PROBABILITY     FINAL
      LOSS   OF LAST STEP   SPECTRUM
      1.000  0.4482D-03     16.6065
      2.000  0.1205D-02      3.9167
      3.000  0.1257D-02      3.7336
      4.000  0.1593D-02      4.1015
      5.000  0.2159D-02      5.0301
      6.000  0.3024D-02      6.6432
      7.000  0.4673D-02      9.9798
      8.000  0.8391D-02     19.2006
      9.000  0.2135D-01     98.8373
     10.000  0.2076D+00    496.0777
     11.000  0.5285D+00    350.5868
     12.000  0.2308D-01     78.8898
     13.000  0.7863D-02     37.2522
     14.000  0.4068D-02     34.5248
     15.000  0.2732D-02     38.4986
     16.000  0.2332D-02     48.1337
     17.000  0.1869D-02     67.3689
     18.000  0.1565D-02    115.4255
     19.000  0.1342D-02    346.3256
     20.000  0.1164D-02   1285.4867
     21.000  0.1044D-02   1405.6383
     22.000  0.9372D-03    701.6077
     23.000  0.8412D-03    239.8859
     24.000  0.7546D-03    159.3391
     25.000  0.6767D-03    157.5016
     26.000  0.6215D-03    183.2397
     27.000  0.5699D-03    240.5385
     28.000  0.5213D-03    374.0283
     29.000  0.4759D-03    847.5983
     30.000  0.4333D-03   2475.1503
     31.000  0.4070D-03   3314.3079
     32.000  0.3819D-03   2424.3597
     33.000  0.3579D-03   1161.7719
     34.000  0.3350D-03    568.8990
     35.000  0.3130D-03    463.3257
     36.000  0.2981D-03    492.5145
     37.000  0.2837D-03    604.7317
     38.000  0.2700D-03    864.9973
     39.000  0.2565D-03   1632.7324
     40.000  0.2436D-03   3932.5686
     41.000  0.2327D-03   5797.5903
     42.000  0.2221D-03   5296.9913
     43.000  0.2120D-03   3334.7937
     44.000  0.2020D-03   1755.1708
     45.000  0.1923D-03   1132.6663
     46.000  0.1851D-03   1059.2090
     47.000  0.1780D-03   1206.3395
     48.000  0.1710D-03   1598.7762
     49.000  0.1643D-03   2640.4734
     50.000  0.1577D-03   5438.2855
 Parameters used:
 Media 1 and 2:..Aluminium.............VACUUM
 Reflection case: THETA =   0.003000 radians
     Inner potential    =  18.000000 eV
     Initial distance from interface =      20.00 Angstroms
     Final distance from interface   =       0.00 Angstroms
 Number of steps used =     10
 Minimum scattering angle =     0.0000 mrad
 Maximum scattering angle =     8.0000 mrad
 Beta =     0.5482
 Incident electron energy =   100.0000 keV
 Energy FWHH of zero loss beam =     1.0000 eV
    ZERO LOSS PEAK INTENSITY=    48.132
      ENERGY PROBABILITY     FINAL
      LOSS   OF LAST STEP   SPECTRUM
      1.000  0.2518D-04      7.3960
      2.000  0.6706D-04      1.7806
      3.000  0.6857D-04      1.7058
      4.000  0.8483D-04      1.8819
      5.000  0.1114D-03      2.3151
      6.000  0.1500D-03      3.0634
      7.000  0.2206D-03      4.6048
      8.000  0.3745D-03      8.8448
      9.000  0.9145D-03     45.1784
     10.000  0.9505D-02    227.0718
     11.000  0.1337D-01    167.4173
     12.000  0.9107D-03     37.7720
     13.000  0.8354D-03     18.0945
     14.000  0.2478D-02     19.5403
     15.000  0.4551D-01     34.8126
     16.000  0.4793D-02     27.3620
     17.000  0.1470D-02     33.8005
     18.000  0.7662D-03     56.3234
     19.000  0.4963D-03    164.9234
     20.000  0.3578D-03    608.0609
     21.000  0.2905D-03    694.0019
     22.000  0.2387D-03    357.5462
     23.000  0.1981D-03    125.8178
     24.000  0.1656D-03     99.7879
     25.000  0.1394D-03    158.9804
     26.000  0.1246D-03    156.4820
     27.000  0.1112D-03    141.7431
     28.000  0.9921D-04    197.1828
     29.000  0.8841D-04    426.0785
     30.000  0.7865D-04   1219.7952
     31.000  0.7304D-04   1691.8847
     32.000  0.6779D-04   1285.0553
     33.000  0.6285D-04    643.5295
     34.000  0.5821D-04    370.3551
     35.000  0.5383D-04    464.2263
     36.000  0.5102D-04    517.2145
     37.000  0.4834D-04    467.4153
     38.000  0.4580D-04    514.8103
     39.000  0.4333D-04    881.2480
     40.000  0.4095D-04   2040.8602
     41.000  0.3907D-04   3078.7154
     42.000  0.3723D-04   2914.6082
     43.000  0.3547D-04   1923.7395
     44.000  0.3375D-04   1150.0147
     45.000  0.3207D-04   1076.7891
     46.000  0.3086D-04   1209.7550
     47.000  0.2969D-04   1165.1959
     48.000  0.2851D-04   1148.7031
     49.000  0.2739D-04   1572.4680
     50.000  0.2629D-04   3012.1919
 Parameters used:
 Media 1 and 2:..Aluminium.............VACUUM
 Reflection case: THETA =   0.014000 radians
     Inner potential    =  18.000000 eV
     Initial distance from interface =       0.00 Angstroms
     Final distance from interface   =      -5.00 Angstroms
 Number of steps used =     10
 Minimum scattering angle =     0.0000 mrad
 Maximum scattering angle =     8.0000 mrad
 Beta =     0.5482
 Incident electron energy =   100.0000 keV
 Energy FWHH of zero loss beam =     1.0000 eV