1 |
% $Header$ |
% $Header$ |
2 |
% $Name$ |
% $Name$ |
3 |
|
|
4 |
|
Author: Patrick Heimbach |
5 |
|
|
6 |
{\sf Automatic differentiation} (AD), also referred to as algorithmic |
{\sf Automatic differentiation} (AD), also referred to as algorithmic |
7 |
(or, more loosely, computational) differentiation, involves |
(or, more loosely, computational) differentiation, involves |
8 |
automatically deriving code to calculate |
automatically deriving code to calculate |
693 |
\input{part5/doc_ad_the_model} |
\input{part5/doc_ad_the_model} |
694 |
|
|
695 |
The basic flow is depicted in \ref{fig:adthemodel}. |
The basic flow is depicted in \ref{fig:adthemodel}. |
696 |
If CPP option {\tt ALLOW\_AUTODIFF\_TAMC} is defined, the driver routine |
If CPP option \texttt{ALLOW\_AUTODIFF\_TAMC} is defined, |
697 |
|
the driver routine |
698 |
{\it the\_model\_main}, instead of calling {\it the\_main\_loop}, |
{\it the\_model\_main}, instead of calling {\it the\_main\_loop}, |
699 |
invokes the adjoint of this routine, {\it adthe\_main\_loop}, |
invokes the adjoint of this routine, {\it adthe\_main\_loop} |
700 |
which is the toplevel routine in terms of automatic differentiation. |
(case \texttt{\#define ALLOW\_ADJOINT\_RUN}), or |
701 |
The routine {\it adthe\_main\_loop} has been generated by TAF. |
the tangent linear of this routine {\it g\_the\_main\_loop} |
702 |
|
(case \texttt{\#define ALLOW\_TANGENTLINEAR\_RUN}), |
703 |
|
which are the toplevel routines in terms of automatic differentiation. |
704 |
|
The routines {\it adthe\_main\_loop} or {\it g\_the\_main\_loop} |
705 |
|
are generated by TAF. |
706 |
It contains both the forward integration of the full model, the |
It contains both the forward integration of the full model, the |
707 |
cost function calculation, |
cost function calculation, |
708 |
any additional storing that is required for efficient checkpointing, |
any additional storing that is required for efficient checkpointing, |