Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info
titleQuote of the day

"You’re a man looking at the world through a keyhole,
and you’ve spent your whole life trying to widen that keyhole, to see more, to know more,
and now, on hearing that it can be widened, in ways you can’t imagine you reject the possibility."

The Ancient One - Doctor Strange

...

Children Display

Info

...

code

...

parameters allow to store varaibles and parameters outside of actor code in elegant way.

The IMAS environment has specially dedicated Fortran library - XMLLIB to handle it.

XMLLIB library basics

The main idea of the library

Image Added

Short description of XMLLIB API - main points

Code Block
xml2eg_parse_memory(character(len=*) parameters , type(type_xml2eg_document) xml2eg_document)

This function allows you to read to memory the entire xml file containing the list of parameters.
Parse the "codeparam_string". This means that the data is put into a xml2eg_document.

Code Block
xml2eg_get(type(type_xml2eg_document) xml2eg_document, character(len=*) path, <any type> output_value)

The function allows reading the parameter that is in the path location inside xml file.
Data is extracted from the xml2eg_document file is the output_value variable.

Code Block
xml2eg_free_doc(type(type_xml2eg_document) xml2eg_document)

Cleaning and freeing allocated memory of xml2eg_document object.


Tip

A more detailed description of the XMLLIB library can be found here

Code Block
# clone xmllib library directly from ITER repository
$ git clone ssh://git@git.iter.org/lib/xmllib.git

# OR copy from this location
$ /pfs/work/g2dfigat/tutorials/Poznan-2019-10/xmllib
Code Block
$ cd examples/classic/
$ tree
.
├── input_test_xmllib_pathquery.xml
├── input_test_xmllib_pathquery.xsd
├── Makefile
├── sample_default.xml
├── sample.f90
├── sample.xml
└── sample.xsd

Accessing code parameters from FC2K actor

Code Block
# clone xmllib library directly from ITER repository
$ git clone ssh://git@git.iter.org/imex/fc2k-testing-framework.git

# OR copy from this location
$ /pfs/work/g2dfigat/tutorials/Poznan-2019-10/fc2k-testing-framework
Code Block
$ cd fc2k-testing-framework/primitives_param/fortran/ $ tree . ├── clean.sh ├── Makefile ├── primitives_param.f90 ├── primitivesparam_fc2k.xml ├── primitivesparam_workflow.xml ├── run_test.sh ├── sample_default.xml ├── sample.xml └── sample.xsd