Skip to content

Commit ecbeb58

Browse files
authored
New section on keeping the XML file up to date (#22)
* added documentation about restart task * added section on how to keep XML file up to date * improved explanations
1 parent 44c7b0a commit ecbeb58

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

working_with_github.rst

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,59 @@ changes will be selectively applied to the official repository via the pull
413413
request process.
414414

415415

416+
.. _github_rundat_vars:
417+
418+
Keeping the XML file up to date
419+
===============================
420+
421+
This procedure is only meant for *Contributors*.
422+
423+
ONETEP uses an XML log file to store information about the internal state of the
424+
calculation in an easier to parse way. Currently this is only used in a limited way,
425+
to assist with determining whether a ONETEP calculation can be restarted or continued,
426+
as described in :ref:`restarting_onetep`. A major part of the XML file is used to store
427+
the values of the variables which are declared at the top of ``rundat_mod.F90``. This
428+
information was previously invisible during the calculation unless specific write
429+
statements were present or added to the code. In order to systematise this and to make it
430+
easier to handle the long list of variables declared in ``rundat_mod.F90``, a new module
431+
called ``rundat_new_mod.F90`` was introduced in which those variables are part of a derived
432+
data type, and auxiliary subroutines are available to interact with it. The XML I/O is
433+
mostly handled by ``rundat_xml_mod.F90``. These two files are very long and are actually
434+
auto-generated, so that the developer should never modify them directly (with a small
435+
exception mentioned later in point 4).
436+
437+
The ``rundat_new_mod.F90`` and the ``rundat_xml_mod.F90`` files are auto-generated by a
438+
small program included in the ``rundat_new`` folder (top level with respect to the ONETEP
439+
source distribution). If new variables are added to ``rundat_mod.F90`` or changes are made
440+
to existing variables, the auto-generated code also needs to be updated. To do so, the
441+
following steps should be followed:
442+
443+
1. Ensure that all variables declared in ``rundat_mod.F90`` have matching declarations
444+
in the file ``rundat_vars.F90`` within the folder ``rundat_new``. If some are missing
445+
or need correcting the developer has to do this by hand. Point 3 can help with this.
446+
447+
2. Auto-generate the ``rundat_new_mod.F90`` and the ``rundat_xml_mod.F90`` files by running
448+
the ``make_rundat_new.sh`` script also given in the ``rundat_new`` folder.
449+
``make_rundat_new.sh`` is currently very primitive; if ``gfortran`` is not available
450+
as a compiler this has to be manually corrected in the script.
451+
452+
3. The ``make_rundat_new.sh`` script also generates a comparison table between the
453+
variables listed in ``rundat_mod.F90`` and in ``rundat_vars.F90``. The table is in the
454+
file ``parse_out`` in the ``rundat_new`` folder. This can be useful to figure out which
455+
variables might be missing from ``rundat_vars.F90`` or if some changes have been made
456+
to them.
457+
458+
4. Check if the ``rundat_new_mod.F90`` and the ``rundat_xml_mod.F90`` files comply with
459+
the ONETEP coding standards with respect to maximum code line lenghts. If not, the
460+
offending lines require manual editing to insert line breaks (this will be
461+
fixed/automated in the near future).
462+
463+
At present there is no significant consequence if the variables in the XML file are
464+
not up to date with the ones declared in ``rundat_mod.F90``, unless they are needed for
465+
checkpointing/restarting/continuing ONETEP runs. In any case, it is recommended to follow
466+
the steps explained in the previous paragraph to keep everything up to date and consistent.
467+
468+
416469
.. _github_pull_request:
417470

418471
Creating a pull request

0 commit comments

Comments
 (0)