Update How to add variables in the schema (pw.x and cp.x ) authored by Pietro Delugas's avatar Pietro Delugas
......@@ -14,6 +14,66 @@ The espressoType is composed by many sub-elements. In order of importance.
the only one which is mandatory is the `input` element. This is because the xml file may actually be used as the input of the calculation and all the other elements which are produced after the program has finished are obviously missing. The file printed as output also includes the starting input element plus all the other elements.
## versioning of the schema.
For the schema versions we are adopting the reverse date convention. For example a version released on May 17th 2019 would have version `17.05.19`.
## How to submit changes.
You can do it in different ways
1. Preferred way is to open an issue and attach your proposal for the modification of the schema version of the schema. This would allow to update the schema collection more chages together avoiding a multiplication of versions.
1. You can as usual make a fork of this repository and submit a merge request. Also in this case maybe the maintainer will try to group modification together though ...
## General rules when adding elements to the schema.
Please don't be too fancy. If you need an elementary type use one of the native xml types:
```
"string": "CHARACTER(len=256)",
"boolean": "LOGICAL",
"double": "REAL(DP)",
"integer": "INTEGER",
"unsignedByte": "INTEGER",
"nonNegativeInteger": "INTEGER",
"positiveInteger": "INTEGER"
```
or one of these types already defined in the schema:
```
"d2vectorType": "REAL(DP), DIMENSION(2)",
"d3vectorType": "REAL(DP), DIMENSION(3)",
"vectorType": "REAL(DP), DIMENSION(:), ALLOCATABLE",
"doubleListType": "REAL(DP), DIMENSION(:), ALLOCATABLE",
"matrixType":"REAL(DP), DIMENSION(:), ALLOCATABLE",
"smearingChoiceType": "CHARACTER(len=256)",
"integerListType": "INTEGER, DIMENSION(:), ALLOCATABLE",
"integerVectorType": "INTEGER, DIMENSION(:), ALLOCATABLE",
"constr_parms_listType": "REAL(DP), DIMENSION(4)",
"d3complexDType": "REAL(DP), DIMENSION(6)",
"disp_x_y_zType": "REAL(DP), DIMENSION(2)",
"cell_dimensionsType": "REAL(DP), DIMENSION(6)",
```
The dictionary report the name of the type and the corresponding conversion to a fortran type.
When you use a type defined in the qes file, be it one of these basic types as well any of the complex ones, be sure when you declare the type to add the `qes:` prefix to it. E.g.:
```
<element type="qes:matrixType" name="stress" minOccurs="0" />
```
when you propose changes take care of backward compatibility, unless for exceptional cases, the newly introduced elements should be optional i.e. the new elements should have "minOccurs=0" in case of new elements of if you add attributes to existing type, declare explitely that the attribute is optional.
for example look at the attribute index in this type
```
<complexType name="atomType">
<simpleContent>
<extension base="qes:d3vectorType">
<attribute type="string" name="name" />
<attribute type="string" name="position" use="optional" />
<attribute type="positiveInteger" name="index" use="optional"/>
</extension>
</simpleContent>
</complexType>
```
## What to do if you want to add a variable to input element.