A practical computing algorithm working in real time has been developed for calculations of the reflection high-energy electron diffraction from the molecular beam epitaxy growing surface. The calculations are based on a dynamical diffraction theory in which the electrons are scattered on a potential, which is periodic in the direction perpendicular to the surface. New version program summary Title of program:RHEED_v2 Catalogue identifier:ADUY_v1_1 Program summary URL: http://cpc.cs.qub.ac.uk/summaries/ADUY_v1_1 Program obtainable from: CPC Program Library, Queen's University of Belfast, N. Ireland Catalogue identifier of previous version:ADUY Authors of the original program:A. Daniluk Does the new version supersede the original program:Yes Computer for which the new version is designed and others on which it has been tested: Pentium-based PC Operating systems or monitors under which the new version has been tested: Windows 9x, XP, NT, Linux Programming language used:C++ Memory required to execute with typical data:more than 1 MB Number of bits in a word:64 bits Number of processors used:1 Number of bytes in distributed program, including test data, etc.:1 074 131 No. of lines in distributed program, including test data, etc.:3408 Distribution format:tar.gz Nature of physical problem: Reflection high-energy electron diffraction (RHEED) is a very useful technique for studying the growth and the surface analysis of thin epitaxial structures prepared by the molecular beam epitaxy (MBE). RHEED rocking curves recorded from heteroepitaxial layers are used for the non-destructive evaluation of epilayer thickness and composition with a high degree of accuracy. Rocking curves from such heterostructures are often very complex because the thickness fringes from every layer beat together. Simulations based on dynamical diffraction theory are generally used to interpret the rocking curves of such structures from which very small changes in thickness and composition can be obtained. Rocking curves are also used to determine the level of strain and its relaxation mechanism in a lattice-mismatched system. Method of solution: The new version of the program retains the design and structure of the previous one [A. Daniluk, Comput. Phys. Comm. 166 (2005) 123. [1]]. Reasons for the new version: Responding to the user feedback we presented an extension of the RHEED program that enables computing the crystalline potentials for epitaxial heterostructures and corresponding values of the amplitude of the RHEED intensity oscillations. Summary of revisions: (1) In this paper we show how the dynamical approach may be applied to creation of a practical computing algorithm to calculate of the intensity of the specularly reflected RHEED beam during MBE growth of Pb on Si(111). The structural properties of the Pb Si interface have been [Display omitted] [b] [Display omitted] [Display omitted] meticulously studied by Howes and co-workers [P.B. Howes, K.A. Edwards, D.J. Hughes, J.E. Macdonald, T. Hibma, T. Bootsma, M.A. James, Surf. Sci. Lett. 331 (1995) 646; K.A. Edwards, P.B. Howes, J.E. Macdonald, T. Hibma, T. Bootsma, M.A. James, Surf. Sci. 424 (1999) 169. [2,3]], and Lucas and Loretto [C.A. Lucas, D. Loretto, Surf. Sci. Lett. 344 (1995) 1219. [4]] (X-ray diffraction). The new version of the RHEED program has the same design as the previous one [A. Daniluk, Comput. Phys. Comm. 166 (2005) 123. [1]]. To simulate the structural variations of whole crystalline heterostructure along the surface normal direction the substrate and layers are divided into an assembly of n atomic layers. Each of these layers is further divided into an assembly of i thin slices parallel to the surface and each slice is assumed to have a constant potential normal to the surface as shown in Fig. 1. The Fourier component of the scattering potential of the whole crystalline heterostructure can be determined as a sum of contributions coming from all thin slices of n individual atomic layers. To carry out one-dimensional calculations we used the self-consistent thicknessZi_Substrate(), thicknessZi_Layers(), thicknessZn_Substrate(), thicknessZn_Layers(), crystPotUgSubstrate() and crystPotUgLayers() functions. Fig. 2 presents the crystalline potentials (real part) calculated for some Pb layers on a Si(111) substrate at 70 K. Fig. 3 shows a dynamically calculated one-beam rocking curve for Pb/Si(111). [Display omitted] [Display omitted] (2) The presented algorithm is a generalization of the previous one. By attributing 0 to the numberOfLayers and NLayers constant parameters (Fig. 4) and removing appropriate functions from the main program (Fig. 5), we obtain the same results as in the case of monocrystal [A. Daniluk, Comput. Phys. Comm. 166 (2005) 123. [1]]. Typical running time: The typical running time is machine and user-parameters dependent. Unusual features of the program: The program is presented in the form of a basic unit RHEED_v2.cpp. It is not tied to any specific hardware and systems software platform, and could be compiled using C++ compilers, including C++ Builder, VC++ and g++.