1 / 5

XML2EG (YAXFI)

XML2EG (YAXFI). E. Giovannozzi. Yet Another XML Fortran Interface. It links to the standard XML2LIB library The parsing of the xml file is made by a standard free library. No needs of a schema. Use the overloading capability of FORTRAN to decide the type of a variable

roys
Download Presentation

XML2EG (YAXFI)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. XML2EG(YAXFI) E. Giovannozzi

  2. Yet Another XML Fortran Interface • It links to the standard XML2LIB library • The parsing of the xml file is made by a standard free library. • No needs of a schema. • Use the overloading capability of FORTRAN to decide the type of a variable • Can read a file or a memory location (like codeparam)

  3. XML file example <?xml version="1.0" encoding="UTF-8"?> <parameters> <pluto> <n> 3 </n> <r_real> 4.5 </r_real> <vector_real> 4.5, 56.6, 7.2 </vector_real> <more> <v_int> 1 , 2, 10 </v_int> </more> </pluto> </parameters>

  4. Calling use xml2eg_mdl … type(document) :: doc integer :: n_points real :: a_real real :: vector_real(20) integer :: vint(40) … Or: call xml2eg_parse_file(‘general.xml', doc) Or:call xml2eg_parse_memory(cparameter%parameters, doc) … call xml2eg_get(doc, ‘pluto/n', n_points) call xml2eg_get(doc, ‘pluto/r_real', a_real) call xml2eg_get(doc, 'limiter/vector_real', vector_real) call xml2eg_get(doc, 'limiter/more/v_int', v_int)

  5. Conclusion • The limit are those of the xml2lib library (in terms of thread safety and capability). • The library is mainly for reading parameters. There is a limit on the length of vectors, as it use a string buffer of fixed length (4096 char). • At the moment it does not read vectors of structure (but it can be extended as xml2lib can handle that).

More Related