A. F. Wright, N. A. Modine, S. M. Foiles, A. E. Mattsson; Sandia National
Laboratories
A. Tackett, R. Hatcher; Vanderbilt University
N. A. W. Holzwarth, Wake Forest University
Electronic-structure calculations based on density-functional theory
(DFT) are widely used to determine and understand the behavior of materials.
While the theoretical foundations underlying DFT and related techniques
are quite well developed, computer codes that implement these techniques
generally do not conform to modern software engineering standards. This
makes them difficult to modify, thereby impeding the implementation and
utilization of new electronic-structure techniques and decreasing the productivity
of researchers. Socorro is our effort to develop a flexible, easily maintained,
open-source electronic-structure code. The code is written mainly in Fortran
90/95 + MPI, and widespread use has been made of object-oriented
features of Fortran 90/95 such as modules, derived types, data-hiding,
and operator overloading. A Socorro module encapsulates a data structure,
whose details are kept private, along with public routines used by code
outside the module to manipulate the data structure. Since outside code
does not depend on details of the module's data structure, the implementation
can be changed independently of the outside code. The flexibility inherent
in this approach is greatly enhanced by the use of a specification- driven
methodology wherein the focus is on careful design of interfaces between
modules.
Socorro is organized as a hierarchy of modules where upper level modules
group and enforce constraints between objects defined within lower level
modules. Details of this structure and how it facilitates extensibility
will be discussed. Considerable effort has also been devoted to maintaining
high performance in an object-oriented framework. The tools that we have
found useful to achieve this include lazy copying, data polymorphism, and
light-weight comparisons.
Socorro is available (under a GNU public license) for use as a platform
on which to develop new electronic-structure techniques and as a high-performance
tool for studying the behavior of complex materials. The current version
of Socorro implements the local-density approximation for exchange and
correlation, three forms of the generalized gradient approximation (PW91,
PBE, and BLYP), molecular dynamics, the dimer method for finding transition
states, and the projector-augmented wave technique.