eMinerals site map

Environment from the Molecular Level

A NERC eScience testbed project

FoX: Fortran XML library

Within the eMinerals project, we have spent a lot of time ensuring that much of our data transfer is done using XML. This has numerous advantages, not least of which is the fact that XML toolkits exist for most computer languages and environments, such that data extraction and manipulation is made much easier.

However, most scientific simulation codes, which are the primary producers of data in our case, are written in Fortran, and Fortran has no native XML facilities.

To this end, we have written a set of Fortran libraries which allow one to natively deal with XML from within Fortran programs. These are called FoX (for Fortran XML). They deal with both the input and output of XML data.

SAX - presents a SAX-like interface to an XML file.

DOM - presents a DOM-Core level 2 interface to an XML file.

WXML - deals with XML output, taking care of escaping, matching tags, etc. Almost all of XML 1.1 is supported, with the exception of proper Unicode handling, and portions of the DTD.

Much of our data is marked-up specifically in CML (Chemical Markup Language). We therefore present another interface to the user, built on top of WXML, called WCML. This removes any need for the application user to know about XML or CML syntax at all, and deals only with abstractions such as Molecules or Crystals.

Technical details

FoX is written entirely in standard Fortran 95, and has a fully autoconf-ed build system to make it as easy as possible to incorporate into existing projects.

It has successfully been embedded into SIESTA, DL_POLY_3, CASTEP, METADISE, GULP and work is ongoing with several other codes.

The fully documented current release has output support, and is available from http://www.uszla.me.uk/software/FoX.html

FoX is the work of Toby White, Alberto Garcia & Jon Wakelin.

Further information

Full source code and documentation is available at the FoX homepage.

General references

Papers that describe the work on XML tools for Fortran can be obtained as pdf downloads from the following links:

"Application and Uses of CML within the eMinerals project". TOH White, P Murray-Rust, PA Couch, RP Tyer, RP Bruin, IT Todorov, DJ Wilson, MT Dove, KF Austen.

"JUMBO: An XML infrastructure for eScience." Y Zhang, P Murray-Rust, MT Dove, RC Glen, HS Rzepa, JA Townsend, S Tyrrell, J Wakelin, EG Willighagen. Proceedings of the UK e-Science All Hands Meeting 2004, (ISBN 1-904425-21-6), pp 930–934, 2004


Last edit 11/7/06
Copyright and contact information here