Update ad_code_generation authored by Johanna Fink's avatar Johanna Fink
......@@ -2,10 +2,12 @@
The AD Code of SHEMAT-Suite comprises the differentiated code routines, which are required when compiling in ad-mode for inverse simulations. The AD code needs to be updated when developments and changes were made in SHEMAT-Suite routines.
Some AD files were generated manually. They are in folder */inverse/g_tap*. For example, the routine for `arrays.f90` is derivated manually. Note that these AD-files have to be adapted manually, if any changes are made in the respective forward routines. E.g. if a new array is introduced in `arrays.f90` it has to be added in `/inverse/g_tap/g_arrays.f90`, too!
Some AD files were generated manually. They are in folders */inverse/g_tap* for AD-forward-mode and */inverse/ad_tap* for AD-reverse-mode. For example, the routine for `arrays.f90` is derivated manually. Note that these AD-files have to be adapted manually, if any changes are made in the respective forward routines. E.g. if a new array is introduced in `arrays.f90` it has to be added in `/inverse/g_tap/g_arrays.f90`, too!
Most of the AD routines are generated automatically by the [TAPENADE](http://www-sop.inria.fr/tropics/tapenade.html) automatic differentiation engine. This automatic generation is steered by the cmake file `cmake/AD.cmake`. User directories and property modules which shall be differentiated are defined in `cmake/Sources.cmake`.
The automatic AD code generation with TAPENADE is described in the following paragraph. Note that some manual adaptions might still be necessary at the end.
## Generating automatic AD code:
* Prerequisites:
......
......