607 |
[i.e. every hour $ i=0,...,5$ corresponding to |
[i.e. every hour $ i=0,...,5$ corresponding to |
608 |
$ k_{i}^{lev1} = 66, 67, \ldots, 71 $]. |
$ k_{i}^{lev1} = 66, 67, \ldots, 71 $]. |
609 |
Thus, the final state $ v_n = v_{k_{n}^{lev1}} $ is reached |
Thus, the final state $ v_n = v_{k_{n}^{lev1}} $ is reached |
610 |
and the model state of all proceeding timesteps along the last |
and the model state of all proceeding timesteps along the last |
611 |
sub-subsections are available, enabling integration backwards |
sub-subsections are available, enabling integration backwards |
612 |
in time along the last sub-subsection. |
in time along the last sub-subsection. |
613 |
Thus, the adjoint can be computed along this last |
Thus, the adjoint can be computed along this last |
1258 |
the parts of the code that are relevant for automatic |
the parts of the code that are relevant for automatic |
1259 |
differentiation using the software tool TAMC. |
differentiation using the software tool TAMC. |
1260 |
|
|
|
\begin{figure}[b!] |
|
1261 |
\input{part5/doc_ad_the_model} |
\input{part5/doc_ad_the_model} |
|
\caption{~} |
|
|
\label{fig:adthemodel} |
|
|
\end{figure} |
|
1262 |
|
|
1263 |
The basic flow is depicted in \ref{fig:adthemodel}. |
The basic flow is depicted in \ref{fig:adthemodel}. |
1264 |
If the option {\tt ALLOW\_AUTODIFF\_TAMC} is defined, the driver routine |
If the option {\tt ALLOW\_AUTODIFF\_TAMC} is defined, the driver routine |
1295 |
(parameter setting, initialization, accumulation, |
(parameter setting, initialization, accumulation, |
1296 |
final evaluation), are controlled by the package {\it pkg/cost}. |
final evaluation), are controlled by the package {\it pkg/cost}. |
1297 |
|
|
|
\begin{figure}[h!] |
|
1298 |
\input{part5/doc_cost_flow} |
\input{part5/doc_cost_flow} |
|
\caption{~} |
|
|
\label{fig:costflow} |
|
|
\end{figure} |
|
1299 |
|
|
1300 |
\subsubsection{genmake and CPP options} |
\subsubsection{genmake and CPP options} |
1301 |
% |
% |
1426 |
|
|
1427 |
%%%% \end{document} |
%%%% \end{document} |
1428 |
|
|
|
\begin{figure} |
|
1429 |
\input{part5/doc_ad_the_main} |
\input{part5/doc_ad_the_main} |
|
\caption{~} |
|
|
\label{fig:adthemain} |
|
|
\end{figure} |
|
1430 |
|
|
1431 |
\subsection{The control variables (independent variables) |
\subsection{The control variables (independent variables) |
1432 |
\label{section_ctrl}} |
\label{section_ctrl}} |
1446 |
(parameter setting, initialization, perturbation) |
(parameter setting, initialization, perturbation) |
1447 |
are controlled by the package {\it pkg/ctrl}. |
are controlled by the package {\it pkg/ctrl}. |
1448 |
|
|
|
\begin{figure}[h!] |
|
1449 |
\input{part5/doc_ctrl_flow} |
\input{part5/doc_ctrl_flow} |
|
\caption{~} |
|
|
\label{fig:ctrlflow} |
|
|
\end{figure} |
|
1450 |
|
|
1451 |
\subsubsection{genmake and CPP options} |
\subsubsection{genmake and CPP options} |
1452 |
% |
% |
1766 |
with the value of the cost function itself $ {\cal J}(u_{[k]}) $ |
with the value of the cost function itself $ {\cal J}(u_{[k]}) $ |
1767 |
at iteration step $ k $ serve |
at iteration step $ k $ serve |
1768 |
as input to a minimization routine (e.g. quasi-Newton method, |
as input to a minimization routine (e.g. quasi-Newton method, |
1769 |
conjugate gradient, ... \cite{gil_lem:89}) |
conjugate gradient, ... \cite{gil-lem:89}) |
1770 |
to compute an update in the |
to compute an update in the |
1771 |
control variable for iteration step $k+1$ |
control variable for iteration step $k+1$ |
1772 |
\[ |
\[ |
1897 |
Finally, {\it ctrl\_pack} collects all adjoint files |
Finally, {\it ctrl\_pack} collects all adjoint files |
1898 |
and writes them to the compressed vector file |
and writes them to the compressed vector file |
1899 |
{\bf vector\_grad\_$<$k$>$}. |
{\bf vector\_grad\_$<$k$>$}. |
|
|
|
|
\subsection{TLM and ADM generation via TAMC} |
|
|
|
|
|
|
|
|
|
|
|
\subsection{Flow directives and adjoint support routines \label{section_flowdir}} |
|
|
|
|
|
\subsection{Store directives and checkpointing \label{section_checkpointing}} |
|
|
|
|
|
\subsection{Gradient checks \label{section_grdchk}} |
|
|
|
|
|
\subsection{Second derivative generation via TAMC} |
|
|
|
|
|
\section{Example of adjoint code} |
|