Jumbo90

  1. What is Jumbo90?
  2. How to use Jumbo90
  3. Jumbo covers CML, STMML and basic XML. Below is the full list of subroutine names, followed by the arguments they take. Whenever writing a real*8 or real*4 you can always pass an optional format argument, e.g.

    	
    	call xml_AddAttribute(file, 'martin','height', 32.1285)
    	call xml_AddAttribute(file, 'martin','height', 32.1285, '(f6.2)')
    
    
    would add an "height" attribute with a value of "32.1285" to a "martin" element . In the first case the default format '(f8.3)' would be used, in the second case the user supplied format '(f6.2)' would be used. Many subroutines can take a number of optional arguments (reflecting the CML schema) therefore the longer 'argument=value' format should be use when calling these subroutines, e.g.,
    
    	call xml_OpenFile('myFile.xml', file)
    
    

    Notes:

    Jumbo90 is based on an earlier fortran 77 program called Jumbo77, which was itself based on an existing Java CML parser called JUMBO written by Peter Murray-Rust. Jumbo90 is now built in a modular fashion allowing output of basic XML, STMML and CML. The STMML layer builds on the XML. The CML layer, in turn, builds on the STMML layer. The base XML writing utilities are now provided by FLIB_XMLWRITE, a set of F90 modules written by Alberto Garcia.

  4. Routines
  5. General routines

    1. xml_OpenFile - Mandatory Initialization routine
    2. xml_Close - Mandatory finalization routine, closes channels, etc
    3. str - utility to convert, floats and integers to character strings

    XML routines

    1. xml_NewElement - writes an xml start tag
    2. xml_AddAttribute - adds an attribute to a tag
    3. xml_AddPcdata - adds text to an xml element
    4. xml_EndElement - writes an xml end tag

    STMML routines

    1. stmAddStartTag
    2. stmAddScalar
    3. stmAddArray
    4. stmAddMatrix
    5. stmAddTriangle
    6. stmError
    7. stmMessage
    8. stmWarning

    CMLCore routines

    1. cmlAddMolecule - adds a complete CML <molecule> element
    2. cmlAddAtom - adds a CML <atom> start tag
    3. cmlAddCoordinates - adds coordinate attributes to an <atom> tag
    4. cmlAddCrystal - adds a complete CML <crystal> element
    5. cmlAddMetadata - adds a complete CML <metadata> element
    6. cmlAddLength(length, id, atomRef1, atomRef2, fmt)
    7. cmlAddAngle(angle, id, atomRef1, atomRef2, atomRef3, fmt)
    8. cmlAddTorsion(torsion, id, atomRef1, atomRef2, atomRef3, atomRef4, fmt)
    9. cmlAddEigenvalue(n, dim, eigvec, eigval, id, title, dictRef, fmt)

    CMLComa routines (Condensed Matter)

    1. cmlAddLattice - write a complete lattice element
    2. cmlAddProperty - write a complete property element, containing scalar, array (vector) or matrix value (i.e. it has several interfaces)
    3. cmlAddParameter - adds a complete CML <parameter> element

  6. Subroutine Guide
    1. xml_OpenFile(filename, ind, xf)

      argumentroletypeoptionaldefault
      filenamexml filenamecharacter(len=*)no 
      indcontrols indentation of outputlogicalyes.true.
      xfxml filenametype(xmlf_t)no 
    2. xml_Close(filehandle)

      argumentroletypeoptionaldefault
      xfxml filehandletype(xmlf_t)no 
    3. function str(value, format)

      argumentroletypeoptionaldefault
      valuevalue to convert to stringreal*8, real*4, integerno 
      formatformat for realscharacter(len=*)yesg22.12

    1. xml_NewElement(xf, name)

      argumentroletypeoptionaldefault
      xfxml filehandletype(xmlf_t)no 
      namename of tag to addcharacter(len=*)no 
    2. xml_AddAttribute(xf, name, attname, value)

      argumentroletypeoptionaldefault
      xfxml filehandletype(xmlf_t)no 
      namename of tagcharacter(len=*)no 
      attnameattribute namecharacter(len=*)no 
      valueattribute valuecharacter(len=*) | integer | real*8 | real*4no 
      fmtformat for realscharacter(len=*)yesf8.3
    3. xml_AddPcdata(xf, value)

      argumentroletypeoptionaldefault
      xfxml filehandletype(xmlf_t)no 
      valuestring to addcharacter(len=*) | integer | real*8 | real*4no 
      fmtformat for realscharacter(len=*)yesf8.3
    4. xml_EndElement(xf, name)

      argumentroletypeoptionaldefault
      xfxml filehandletype(xmlf_t)no 
      namename of element to closecharacter(len=*)no 

    1. stmAddStartTag(xf, name, id, title, dictref)

      argumentroletypeoptionaldefault
      xfxml filehandletype(xmlf_t)no 
      nametag namecharacter(len=*)no 
      idunique idcharacter(len=*)yes 
      titletag descriptioncharacter(len=*)yes 
      dictrefdictionary referencecharacter(len=*)yes 
    2. stmAddScalar(xf, value, id, title, dictref, type, fmt)

      argumentroletypeoptionaldefault
      xfxml filehandletype(xmlf_t)no 
      valuethe scalar valuecharacter(len=*) | integer | real*8 | real*4no 
      idunique idcharacter(len=*)yes 
      titletag descriptioncharacter(len=*)yes 
      dictrefdictionary referencecharacter(len=*)yes 
      fmtformat for realscharacter(len=*)yesf8.3
    3. stmAddArray(xf, nvalue, array, id, title, dictref, type|units, delim|fmt)

      argumentroletypeoptionaldefault
      xfxml filehandletype(xmlf_t)no 
      nvaluelength of arrayintegerno 
      arraythe arraycharacter(len=*) | integer | real*8 | real*4no 
      idunique idcharacter(len=*)yes 
      titletag descriptioncharacter(len=*)yes 
      dictrefdictionary referencecharacter(len=*)yes 
      fmtformat for realscharacter(len=*)yesf8.3
    4. stmAddMatrix(xf, nrows, ncols, dim, matrix, id, title, dictref, units, fmt)

      argumentroletypeoptionaldefault
      xfxml filehandletype(xmlf_t)no 
      nrowsnumber of rowsintegerno 
      ncolsnumber of columnsintegerno 
      dimfastest dimensionintegerno 
      matrixthe matrixcharacter(len=*) | integer | real*8 | real*4no 
      idunique idcharacter(len=*)yes 
      titletag descriptioncharacter(len=*)yes 
      dictrefdictionary referencecharacter(len=*)yes 
      fmtformat for realscharacter(len=*)yesf8.3
    5. stmAddTriangle(xf, nvalue, array, id, title, dictref, units, fmt)

      argumentroletypeoptionaldefault
      xfxml filehandletype(xmlf_t)no 
      nvaluelength of arrayintegerno 
      arraythe arraycharacter(len=*) | integer | real*8 | real*4no 
      idunique idcharacter(len=*)yes 
      titletag descriptioncharacter(len=*)yes 
      dictrefdictionary referencecharacter(len=*)yes 
      fmtformat for realscharacter(len=*)yesf8.3
    6. stmAddError(xf, msg, id, title, dictRef)

      argumentroletypeoptionaldefault
      xfxml filehandletype(xmlf_t)no 
      msglength of arraycharacter(len=*)no 
      idunique idcharacter(len=*)yes 
      titletag descriptioncharacter(len=*)yes 
      dictrefdictionary referencecharacter(len=*)yes 
    7. stmAddMessage(xf, msg, id, title, dictRef)

      argumentroletypeoptionaldefault
      xfxml filehandletype(xmlf_t)no 
      msglength of arraycharacter(len=*)no 
      idunique idcharacter(len=*)yes 
      titletag descriptioncharacter(len=*)yes 
      dictrefdictionary referencecharacter(len=*)yes 
    8. stmAddWarning(xf, msg, id, title, dictRef)

      argumentroletypeoptionaldefault
      xfxml filehandletype(xmlf_t)no 
      msglength of arraycharacter(len=*)no 
      idunique idcharacter(len=*)yes 
      titletag descriptioncharacter(len=*)yes 
      dictrefdictionary referencecharacter(len=*)yes 

    1. cmlAddMolecule(xf, natoms, elements, coords, style, id, title, dictref, fmt)

      argumentroletypeoptionaldefault
      xfxml filehandletype(xmlf_t)no 
      natomsnumber of atomsintegerno 
      elements(natoms)list of atomic symbolscharacter(len=2)no 
      coords(3, natoms)atomic coordinatesreal*8 | real*4no 
      styleCML output style (x3 | xFrac | xyz3 | xyzFrac)character(len=*)yesx3
      idunique idcharacter(len=*)yes 
      titletag descriptioncharacter(len=*)yes 
      dictrefdictionary referencecharacter(len=*)yes 
      fmtformat for realscharacter(len=*)yesf8.3
    2. cmlAddAtom(xf, elem, id, charge, hCount, occupancy, fmt)

      argumentroletypeoptionaldefault
      xfxml filehandletype(xmlf_t)no 
      elematomic symbolcharacter(len=2)yes 
      idunique idcharacter(len=*)yes 
      chargeformal chargeintegerno 
      hCounthydrogen countintegerno 
      occupancysite occupancyreal*8 | real*4no 
      fmtformat for occupancycharacter(len=*)yesf8.3
    3. cmlAddCoordinates(xf, x, y, z, style, fmt)

      argumentroletypeoptionaldefault
      xfxml filehandletype(xmlf_t)no 
      xx coordinate in cartesian formatreal*8 | real*4no 
      yy coordinate in cartesian formatreal*8 | real*4no 
      zz coordinate in cartesian formatreal*8 | real*4yes 
      styleCML output style
      (x3 | xFrac | xyz3 | xyzFrac | xy2)
      character(len=*)yesx3
      fmtformat for coordinatescharacter(len=*)yesf8.3
    4. cmlAddcrystal(xf, a, b, c, alpha, beta, gamma, id, title, dictref, lenunits, angunits, fmt)

      argumentroletypeoptionaldefault
      xfxml filehandletype(xmlf_t)no 
      alattice parameter areal*8 | real*4no 
      blattice parameter breal*8 | real*4no 
      clattice parameter creal*8 | real*4no 
      alphalattice angle alphareal*8 | real*4no 
      betalattice angle betareal*8 | real*4no 
      gammalattice angle gammareal*8 | real*4no 
      lenunitsunits for lattice parameterscharacter(len=*)yesangstrom
      angunitsunits for lattice anglescharacter(len=*)yesdegree
      idunique idcharacter(len=*)yes 
      titletag descriptioncharacter(len=*)yes 
      dictrefdictionary referencecharacter(len=*)yes 
      fmtformat for realscharacter(len=*)yesf8.3
    5. cmlAddMetadata(xf, name, content, conv)

      argumentroletypeoptionaldefault
      xfxml filehandletype(xmlf_t)no 
      namename (eg author)character(len=*)no 
      contentvalue (eg Jon Wakelin)character(len=*)no 
      conva conventioncharacter(len=*)yes 
    6. cmlAddLattice(xf, cell, units, title, id, dictref, conv, lattType, spaceType)

      argumentroletypeoptionaldefault
      xfxml filehandletype(xmlf_t)no 
      cell(3,3)the lattice vectorsreal*8 | real*4no 
      unitsunits for lattice vectorscharacter(len=*)yes 
      titletag descriptioncharacter(len=*)yes 
      idunique idcharacter(len=*)yes 
      dictrefdictionary referencecharacter(len=*)yes 
      conva conventioncharacter(len=*)yesf8.3
      lattTypelattice type (primitive |full)character(len=*)yes 
      spaceTypespace type (real | reciprocal) character(len=*)yes 
    7. cmlAddProperty(xf, property, nvalues, ncols, nrows, dim, id, title, conv, dictref, ref, units, fmt)

      argumentroletypeoptionaldefault
      xfxml filehandletype(xmlf_t)no 
      propertya scalar, array or matrix property. Yes it takes all three, but see next three arguments.charcter(len=*) | integer | real*8 | real*4no 
      nvaluenumber of value for vectorintegerno if writing a vector 
      ncolsnumber of rows for matrixintegerno if writing a matrix 
      nrowsnumber of rows for matrixintegerno if writing a matrix 
      dimnumber of the fastest growing dimension in the matrixintegeryes 
      idunique idcharacter(len=*)yes 
      titletag descriptioncharacter(len=*)yes 
      conva conventioncharacter(len=*)yes 
      dictrefdictionary referencecharacter(len=*)yes 
      refrefernce to an atom (via the atom 'id' attribute)character(len=*)yes 
      unitsunits for the propertycharacter(len=*)yes 
      fmtformat for realscharacter(len=*)yesf8.3
    8. cmlAddParameter(xf, value, name, id, title, conv, cons, dictref, ref, role, units, fmt)

      argumentroletypeoptionaldefault
      xfxml filehandletype(xmlf_t)no 
      valuethe parametercharcter(len=*) | integer | real*8 | real*4 | logicalno 
      idunique idcharacter(len=*)yes 
      titletag descriptioncharacter(len=*)yes 
      conva conventioncharacter(len=*)yes 
      consa constraintcharacter(len=*)yes 
      rolethe role of the parametercharacter(len=*)yes 
      dictrefdictionary referencecharacter(len=*)yes 
      refrefernce to an atom (via the atom 'id' attribute)character(len=*)yes 
      unitsunits for the parametercharacter(len=*)yes 
      fmtformat for realscharacter(len=*)yesf8.3
      1. CML output styles for coordinates

        x3      = 3D Cartesian coordinates long format
        xyz3    = 3D Cartesian coordinates short format
        xFrac   = 3D fractional coordinates long format
        xyzFrac = 3D fractional coordinates short format
        xy2     = 2d Cartesian coordinates long format