User Tools

Site Tools


developers:abivars.yml

This is an old revision of the document!


Specifications for the abinit_vars.yml file

As values in the ~abinit/doc/input_variables/origin_files/abinit_vars.yml file, you can specify numbers, string, arrays, following the standard specification of YAML :

Strings

Pay attention to strings. If it is recognized as string directly, you don't need ticks (' '). Otherwise, you need to put ticks.

For example, if you want to use a link as a value, use a link shortcut like [[abivarname]], but pay attention, sometimes, you will need '[[abivarname]]'. See the doc about link shortcuts at link_shortcuts.

Types

Several “types” are defined to allow sufficient flexibility in the specifications, as follows.

!variable

It is the type that contains the other fields.

  • abivarname : the name of the variable. Note that the name for input variables of the executables anaddb, aim and optic is always finished with @anaddb, @aim or @optic.
  • characteristics : possibly, a specific characteristics of the input variable. To be chosen among the names in ~abinit/doc/input_variables/origin_files/characteristics.yml .
  • commentdefault : possibly, some comment about a default value.
  • commentdims : possibly, some comment about the dimension of an array.
  • defaultval : must be an integer or real value, possibly specified using the types presented below (e.g. !multiplevalue)
  • dimensions : either scalar or a list of dimensions, using YML syntax.
  • excludes : possible excluded values
  • mnemonics : a longer description of the variable role, in a few words
  • requires : the input variable is relevant only if this condition is fulfilled
  • text : free text describing the input variable
  • topics : a string, specified in topics_and_tribes
  • varset : a unique “set of variables” to which the variable belong. To be chosen among the names in ~abinit/doc/input_variables/origin_files/varsets.yml .
  • vartype : to be chosen among integer, real or string

If there is no information of a type for a specific variable, its value must be “null”.

!multiplevalue

This is the equivalent to the X*Y syntax in fortran.

  X*Y

will become

  !multiplevalue
    number : X
    value : Y

If X is null, it means that you want to do *Y (all Y)

!range

  !range
     start: 1
     stop: N

As a default value, it means that the default value is 1,2, … N

!valuewithconditions

This type allows to specify conditions on values:

!valuewithconditions
    defaultval: -[[diemix]]
    '70 < [[iprcel]] and [[iprcel]] < 80': '[[diemix]]'
    '[[iscf]]<10': '[[diemix]]'
    '[[iprcel]]==0': '[[diemix]]'

defaultval is the default value if no condition is fulfilled. As condition, please use strings with the most basic expressions, containing <, < =, >, >=, ==, !=, +, -, *, /, etc to allow for further simple parsing !

As a convention, we use “pythonic” way for expressions, so you can use “or”, “and” and “in” also as [[varname]] in [1,2,5] for example …

!valuewithunit

This type allows to specify values with units:

 !valuewithunit
        units: eV
        value: 100.0

means “100 eV”.

Constraints between variables

In the YML file (and via the GUI), there are some constraints between variables that have been introduced.

You can specifiy “requires: CONDITION” and “excludes: CONDITION” in the YML file (or fill the fields requires and excludes in the GUI).

If a varname has “requires: CONDITION”, it means that the variable is only relevant when CONDITION is fulfilled.

If a varname has as “excludes: CONDITION”, it means that the specification of the variable in the input file forbids the CONDITION to be fulfilled.

developers/abivars.yml.1504156728.txt.gz · Last modified: 2017/08/31 07:18 by Xavier Gonze