/[MITgcm]/manual/s_examples/tracer_adjsens/doc_ad_examples.tex
ViewVC logotype

Diff of /manual/s_examples/tracer_adjsens/doc_ad_examples.tex

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1 by molod, Tue Jun 27 15:56:51 2006 UTC revision 1.4 by jmc, Tue Aug 31 20:56:18 2010 UTC
# Line 3  Line 3 
3    
4  %**********************************************************************  %**********************************************************************
5  \section{Sensitivity of Air-Sea Exchange to Tracer Injection Site }  \section{Sensitivity of Air-Sea Exchange to Tracer Injection Site }
6  \label{www:tutorials}  %\label{www:tutorials}
7  \label{sect:eg-simple-tracer-adjoint}  \label{sec:eg-simple-tracer-adjoint}
8  \label{sec_ad_setup_ex}  \label{sec_ad_setup_ex}
9  \label{sect:tutorialIII}  \label{sec:tutorialIII}
10  \begin{rawhtml}  \begin{rawhtml}
11  <!-- CMIREDIR:sec_ad_setup_ex: -->  <!-- CMIREDIR:sec_ad_setup_ex: -->
12  \end{rawhtml}  \end{rawhtml}
13    \begin{center}
14    (in directory: {\it verification/tutorial\_tracer\_adjsens/})
15    \end{center}
16  %**********************************************************************  %**********************************************************************
17    
18  MITgcm has been adapted to enable AD using TAMC or TAF.  MITgcm has been adapted to enable AD using TAMC or TAF.
# Line 23  The AD-relevant hooks in the code are sk Line 26  The AD-relevant hooks in the code are sk
26  \ref{fig:adthemodel}, \ref{fig:adthemain}.  \ref{fig:adthemodel}, \ref{fig:adthemain}.
27    
28  \subsection{Overview of the experiment}  \subsection{Overview of the experiment}
29  \label{www:tutorials}  %\label{www:tutorials}
30    
31  We describe an adjoint sensitivity analysis of out-gassing from  We describe an adjoint sensitivity analysis of out-gassing from
32  the ocean into the atmosphere of a carbon-like tracer injected  the ocean into the atmosphere of a carbon-like tracer injected
33  into the ocean interior (see \cite{hil-eta:01}).  into the ocean interior (see \cite{hil-eta:01}).
34    
35  \subsubsection{Passive tracer equation}  \subsubsection{Passive tracer equation}
36  \label{www:tutorials}  %\label{www:tutorials}
37    
38  For this work MITgcm was augmented with a thermodynamically  For this work MITgcm was augmented with a thermodynamically
39  inactive tracer, $C$. Tracer residing in the ocean  inactive tracer, $C$. Tracer residing in the ocean
# Line 65  As source we choose a constant in time i Line 68  As source we choose a constant in time i
68  $ S = 1 \,\, {\rm mol / s}$.  $ S = 1 \,\, {\rm mol / s}$.
69    
70  \subsubsection{Model configuration}  \subsubsection{Model configuration}
71  \label{www:tutorials}  %\label{www:tutorials}
72    
73  The model configuration employed has a constant  The model configuration employed has a constant
74  $4^\circ \times 4^\circ$ resolution horizontal grid and realistic  $4^\circ \times 4^\circ$ resolution horizontal grid and realistic
# Line 77  fresh-water forcing the model reproduces Line 80  fresh-water forcing the model reproduces
80  features of the ocean general circulation.  features of the ocean general circulation.
81    
82  \subsubsection{Out-gassing cost function}  \subsubsection{Out-gassing cost function}
83  \label{www:tutorials}  %\label{www:tutorials}
84    
85  To quantify and understand out-gassing due to injections of $C$  To quantify and understand out-gassing due to injections of $C$
86  in eqn. (\ref{carbon_ddt}),  in eqn. (\ref{carbon_ddt}),
# Line 104  and regions in which $CO_2$ injections w Line 107  and regions in which $CO_2$ injections w
107  sequestered within the ocean.  sequestered within the ocean.
108    
109  \subsection{Code configuration}  \subsection{Code configuration}
110  \label{www:tutorials}  %\label{www:tutorials}
111    
112  The model configuration for this experiment resides under the  The model configuration for this experiment resides under the
113  directory {\it verification/carbon/}.  directory {\it verification/carbon/}.
# Line 180  Below we describe the customizations of Line 183  Below we describe the customizations of
183  specific to this experiment.  specific to this experiment.
184    
185  \subsubsection{File {\it .genmakerc}}  \subsubsection{File {\it .genmakerc}}
186  \label{www:tutorials}  %\label{www:tutorials}
187  This file overwrites default settings of {\it genmake}.  This file overwrites default settings of {\it genmake}.
188  In the present example it is used to switch on the following  In the present example it is used to switch on the following
189  packages which are related to automatic differentiation  packages which are related to automatic differentiation
# Line 190  Other packages which are not needed are Line 193  Other packages which are not needed are
193  \hspace*{4ex} {\tt set DISABLE=( aim obcs zonal\_filt shap\_filt cal exf )}  \hspace*{4ex} {\tt set DISABLE=( aim obcs zonal\_filt shap\_filt cal exf )}
194    
195  \subsubsection{File {\it COST\_CPPOPTIONS.h,  CTRL\_OPTIONS.h}}  \subsubsection{File {\it COST\_CPPOPTIONS.h,  CTRL\_OPTIONS.h}}
196  \label{www:tutorials}  %\label{www:tutorials}
197    
198  These files used to contain package-specific CPP-options  These files used to contain package-specific CPP-options
199  (see Section \ref{???}).  (see Section ref:ask-the-author).
200  For technical reasons those options have been grouped together  For technical reasons those options have been grouped together
201  in the file {\it ECCO\_OPTIONS.h}.  in the file {\it ECCO\_OPTIONS.h}.
202  To retain the modularity, the files have been kept and contain  To retain the modularity, the files have been kept and contain
203  the standard include of the {\it CPP\_OPTIONS.h} file.  the standard include of the {\it CPP\_OPTIONS.h} file.
204    
205  \subsubsection{File {\it CPP\_EEOPTIONS.h}}  \subsubsection{File {\it CPP\_EEOPTIONS.h}}
206  \label{www:tutorials}  %\label{www:tutorials}
207    
208  This file contains 'wrapper'-specific CPP options.  This file contains 'wrapper'-specific CPP options.
209  It only needs to be changed if the code is to be run  It only needs to be changed if the code is to be run
210  in a parallel environment (see Section \ref{???}).  in a parallel environment (see Section ref:ask-the-author).
211    
212  \subsubsection{File {\it CPP\_OPTIONS.h}}  \subsubsection{File {\it CPP\_OPTIONS.h}}
213  \label{www:tutorials}  %\label{www:tutorials}
214    
215  This file contains model-specific CPP options  This file contains model-specific CPP options
216  (see Section \ref{???}).  (see Section ref:ask-the-author).
217  Most options are related to the forward model setup.  Most options are related to the forward model setup.
218  They are identical to the global steady circulation setup of  They are identical to the global steady circulation setup of
219  {\it verification/global\_ocean.90x40x15/}.  {\it verification/global\_ocean.90x40x15/}.
# Line 239  adjoint-generated gradient. Line 242  adjoint-generated gradient.
242  The gradient check package is further described in Section ???.  The gradient check package is further described in Section ???.
243    
244  \subsubsection{File {\it ECCO\_OPTIONS.h}}  \subsubsection{File {\it ECCO\_OPTIONS.h}}
245  \label{www:tutorials}  %\label{www:tutorials}
246    
247  The CPP options of several AD-related packages are grouped  The CPP options of several AD-related packages are grouped
248  in this file:  in this file:
# Line 263  defines TAMC-related features in the cod Line 266  defines TAMC-related features in the cod
266  %  %
267  \hspace*{4ex} {\tt \#define ALLOW\_TAMC\_CHECKPOINTING} \\  \hspace*{4ex} {\tt \#define ALLOW\_TAMC\_CHECKPOINTING} \\
268  enables the checkpointing feature of TAMC  enables the checkpointing feature of TAMC
269  (see Section \ref{???}).  (see Section ref:ask-the-author).
270  In the present example a 3-level checkpointing is implemented.  In the present example a 3-level checkpointing is implemented.
271  The code contains the relevant store directives, common block  The code contains the relevant store directives, common block
272  and tape initializations, storing key computation,  and tape initializations, storing key computation,
# Line 276  in the files {\it checkpoint\_lev3\_dire Line 279  in the files {\it checkpoint\_lev3\_dire
279  %  %
280  \hspace*{4ex} {\tt \#define ALLOW\_AUTODIFF\_MONITOOR} \\  \hspace*{4ex} {\tt \#define ALLOW\_AUTODIFF\_MONITOOR} \\
281  enables the monitoring of intermediate adjoint variables  enables the monitoring of intermediate adjoint variables
282  (see Section \ref{???}). \\  (see Section ref:ask-the-author). \\
283  %  %
284  \hspace*{4ex} {\tt \#define ALLOW\_DIVIDED\_ADJOINT} \\  \hspace*{4ex} {\tt \#define ALLOW\_DIVIDED\_ADJOINT} \\
285  enables adjoint dump and restart  enables adjoint dump and restart
286  (see Section \ref{???}).  (see Section ref:ask-the-author).
287  %  %
288  \item Cost function package: {\it pkg/cost/} \\  \item Cost function package: {\it pkg/cost/} \\
289  This package contains all relevant routines for  This package contains all relevant routines for
290  initializing, accumulating and finalizing the cost function  initializing, accumulating and finalizing the cost function
291  (see Section \ref{???}). \\  (see Section ref:ask-the-author). \\
292  \hspace*{4ex} {\tt \#define ALLOW\_COST} \\  \hspace*{4ex} {\tt \#define ALLOW\_COST} \\
293  enables all general aspects of the cost function handling,  enables all general aspects of the cost function handling,
294  in particular the hooks in the forward code for  in particular the hooks in the forward code for
# Line 322  isopycnal diffusivity \\ Line 325  isopycnal diffusivity \\
325  \end{itemize}  \end{itemize}
326    
327  \subsubsection{File {\it SIZE.h}}  \subsubsection{File {\it SIZE.h}}
328  \label{www:tutorials}  %\label{www:tutorials}
329    
330  The file contains the grid point dimensions of the forward  The file contains the grid point dimensions of the forward
331  model. It is identical to the {\it verification/exp2/}: \\  model. It is identical to the {\it verification/exp2/}: \\
# Line 335  with standard overlap dimensioning Line 338  with standard overlap dimensioning
338  {\tt OLx = OLy = 3}.  {\tt OLx = OLy = 3}.
339    
340  \subsubsection{File {\it adcommon.h}}  \subsubsection{File {\it adcommon.h}}
341  \label{www:tutorials}  %\label{www:tutorials}
342    
343  This file contains common blocks of some adjoint variables  This file contains common blocks of some adjoint variables
344  that are generated by TAMC.  that are generated by TAMC.
# Line 368  The header file is enabled via the CPP-o Line 371  The header file is enabled via the CPP-o
371  {\bf ALLOW\_AUTODIFF\_MONITOR}.  {\bf ALLOW\_AUTODIFF\_MONITOR}.
372    
373  \subsubsection{File {\it tamc.h}}  \subsubsection{File {\it tamc.h}}
374  \label{www:tutorials}  %\label{www:tutorials}
375    
376  This routine contains the dimensions for TAMC checkpointing  This routine contains the dimensions for TAMC checkpointing
377  and some indices relevant for storing ky computations.  and some indices relevant for storing ky computations.
# Line 377  and some indices relevant for storing ky Line 380  and some indices relevant for storing ky
380  %  %
381  \item {\tt \#ifdef ALLOW\_TAMC\_CHECKPOINTING} \\  \item {\tt \#ifdef ALLOW\_TAMC\_CHECKPOINTING} \\
382  3-level checkpointing is enabled, i.e. the timestepping  3-level checkpointing is enabled, i.e. the timestepping
383  is divided into three different levels (see Section \ref{???}).  is divided into three different levels (see Section ref:ask-the-author).
384  The model state of the outermost ({\tt nchklev\_3}) and the  The model state of the outermost ({\tt nchklev\_3}) and the
385  intermediate ({\tt nchklev\_2}) timestepping loop are stored to file  intermediate ({\tt nchklev\_2}) timestepping loop are stored to file
386  (handled in {\it the\_main\_loop}).  (handled in {\it the\_main\_loop}).
# Line 412  The following parameters may be worth de Line 415  The following parameters may be worth de
415  ~  ~
416    
417  \subsubsection{File {\it makefile}}  \subsubsection{File {\it makefile}}
418  \label{www:tutorials}  %\label{www:tutorials}
419    
420  This file contains all relevant parameter flags and  This file contains all relevant parameter flags and
421  lists to run TAMC or TAF.  lists to run TAMC or TAF.
# Line 496  adjoint routines refer to the TAMC defau Line 499  adjoint routines refer to the TAMC defau
499    
500    
501  \subsubsection{The input parameter files}  \subsubsection{The input parameter files}
502  \label{www:tutorials}  %\label{www:tutorials}
503    
504  \paragraph{File {\it data}}  \paragraph{File {\it data}}
505    
# Line 532  surface boundary values (surface wind st Line 535  surface boundary values (surface wind st
535  Contains model state after model spinup.  Contains model state after model spinup.
536    
537  \subsection{Compiling the model and its adjoint}  \subsection{Compiling the model and its adjoint}
538  \label{www:tutorials}  %\label{www:tutorials}
539    
540  The built process of the adjoint model is slightly more  The built process of the adjoint model is slightly more
541  complex than that of compiling the forward code.  complex than that of compiling the forward code.
# Line 654  a more straightforward build process. Line 657  a more straightforward build process.
657  {\small  {\small
658  \[  \[
659  \boxed{  \boxed{
660  \begin{split}  \begin{aligned}
661   ~ & \mbox{\tt cd bin} \\   ~ & \mbox{\tt cd bin} \\
662   ~ & \mbox{\tt ln -s ../verification/my\_experiment/code/.genmakerc .} \\   ~ & \mbox{\tt ln -s ../verification/my\_experiment/code/.genmakerc .} \\
663   ~ & \mbox{\tt ln -s ../verification/my\_experiment/code/*.[Fh] .} \\   ~ & \mbox{\tt ln -s ../verification/my\_experiment/code/*.[Fh] .} \\
# Line 666  a more straightforward build process. Line 669  a more straightforward build process.
669   ~ & \hspace*{6ex} \mbox{\tt                 adrestore small\_f allcode admodeltaf/admodeltamc adchange} \\   ~ & \hspace*{6ex} \mbox{\tt                 adrestore small\_f allcode admodeltaf/admodeltamc adchange} \\
670   ~ & \mbox{\tt cd ../bin} \\   ~ & \mbox{\tt cd ../bin} \\
671   ~ & \mbox{\tt make} \\   ~ & \mbox{\tt make} \\
672  \end{split}  \end{aligned}
673  }  }
674  \]  \]
675  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.22