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 [[abivarname]]. See the doc about link shortcuts at link_shortcuts. If you forget varname, it will be interpreted as a list, containing a list, containing the string varname and not a link !

!variable

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
  • commentdefault
  • commentdims
  • defaultval
  • dimensions
  • excludes
  • menemonics
  • requires
  • text
  • topics
  • varset
  • vartype : to be chosen among integer, real or string

!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.

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 [[abivarname]]. See the doc about link shortcuts at link_shortcuts. If you forget varname, it will be interpreted as a list, containing a list, containing the string varname and not a link !

developers/abivars.yml.1501530426.txt.gz · Last modified: 2017/07/31 21:47 by Xavier Gonze