Pseudopotential handling in XML

This page contains a real-world example of processing an XML file with my Fortran parser. The example actually reflects one of the motivations for writing the parser in the first place. As summed-up by David Vanderbilt in the fsatom-pp mailing list:
 > my suggestion would be that we pool our efforts to write subroutine
 > packages in both Fortran and C that define the needed data
 > structures, read in and parse the XML file, and assign the data in
 > the data structures.  These subroutines would be "templates" in the
 > sense that they do nothing but "read and die".  But any code
 > developers could then use them to build the input routines that are
 > needed for their own solid-state code.

What follows is a proof-of-concept exhibit for the Fortran side of things.

The read_pseudo routine is built using the SAX (or XPATH) primitives of the XML parser, and a set of handlers tailored to the problem at hand. You can see the typical code idioms in the Examples/sax/pseudo and Examples/xpath/pseudo directories of the xmlf90 distribution, and the source for a prototype implementation of flib_pseudo can be found here.

Work on a pseudopotential XML format for norm-conserving pseudopotentials (used among other codes by Siesta and Abinit) has been going on since the spring, with the initial goal of Siesta-Abinit interoperability. Javier Junquera, Mattieu Verstraete, among others, are involved in the project, and tools will be released soon. This will be one of the first relevant deliverables from the FSAtom workgroup on pseudopotentials. It is hoped that the availability of software tools such as the Fortran XML parser and of prototype implementations will spur progress toward the wider goals of the FSAtom project.