New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
WorkingGroups/TAM/ReferenceManual/NemoTamBasics (diff) – NEMO

Changes between Version 2 and Version 3 of WorkingGroups/TAM/ReferenceManual/NemoTamBasics


Ignore:
Timestamp:
2010-02-22T16:40:05+01:00 (14 years ago)
Author:
avidard
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WorkingGroups/TAM/ReferenceManual/NemoTamBasics

    v2 v3  
     1= TAM what for ? = 
     2The development of tangent and adjoint models is 
     3an important step in addressing sensitivity analysis and variational 
     4data assimilation problems in Oceanography. Sensitivity analysis is the study of how model output varies with changes in model inputs. The sensitivity information 
     5given by the adjoint model is used directly to gain an understanding 
     6of the physical processes. In data assimilation, one considers a cost 
     7function which is a measure of the model-data misfit. The adjoint 
     8sensitivities are used to build the gradient for descent algorithms. 
     9Similarly the tangent model is used in the context 
     10of the incremental algorithms to linearize the 
     11cost function around a background control. 
    112 
    2 Describe here the main principles of TAM :  
     13= Tangent and Adjoint coding techniques =  
     14the original program {{{P}}}, 
     15whatever its size and run time, computes a function 
     16[[Image(ad_1)]] 
     17which is the composition of the elementary functions 
     18computed by each run-time instruction. In other words if 
     19{{{P}}} executes a sequence of elementary statements 
     20[[Image(ad_2.png)]], then {{{P}}} actually evaluates 
     21[[Image(ad_3.png)]] 
     22where each ''f,,k,,'' is the function implemented by ''I,,k,,''. 
     23Therefore one can apply the chain rule of derivative 
     24calculus 
     25to get the Jacobian matrix ''F!''', i.e. the partial 
     26derivatives of each component of ''Y'' with respect to 
     27each component of ''X''. Calling ''X,,0,,=X'' and 
     28''X,,k,,=f,,k,,(X,,{k-1},,)'' the successive values of all 
     29intermediate variables, i.e. the successive '''states''' of 
     30the memory throughout execution of {{{P}}}, we get 
    331 
    4  * what tangent and adjoint models are 
     32[[Image(ad_4.png)]] 
     33 
     34The derivatives ''f!',,k,,'' 
     35of each elementary instruction are easily built, and must 
     36be inserted in the differentiated program so 
     37that each of them has the values ''X,,k-1,,'' directly available 
     38for use. 
     39This process yields analytic derivatives, 
     40that are exact up to numerical accuracy. 
     41 
     42In practice, two sorts of derivatives are of 
     43particular importance in scientific computing: the 
     44tangent (or directional) derivatives, and the 
     45adjoint (or reverse) derivatives. 
     46 
     47The tangent derivative is the product 
     48$\dot{Y} = F'(X) \times \dot{X}$ of the full Jacobian times 
     49a direction $\dot{X}$ in the input space. 
     50>From equation above, we find 
     51 
     52[[Image(ad_5)]] 
     53 
     54which is most cheaply executed from right to left 
     55because matrix {{{x}}} vector products are much cheaper 
     56than matrix {{{x}}} matrix products. 
     57This is also the most convenient execution order because 
     58it uses the intermediate values ''X,,k,,'' in the same order 
     59as the program {{{P}}} builds them. 
     60On the other hand the adjoint derivative is the product 
     61[[Image(ad_6)]] of 
     62the ''transposed'' Jacobian times a weight vector 
     63$\overline{Y}$ in the output space. The 
     64resulting $\overline{X}$ is the gradient of the 
     65dot product $(Y \cdot \overline{Y})$. 
     66>From equation (\ref{eqchainrule}), we find 
     67\begin{equation}\label{eqadjmode} 
     68\overline{X} = F'^{*}(X) \times \overline{Y} = 
     69f'^{*}_1(X_0) \times \dots \times f'^{*}_{p-1}(X_{p-2}) 
     70\times f'^{*}_p(X_{p-1}) \times \overline{Y} 
     71\end{equation} 
     72which is also most cheaply executed from right to left. 
     73However, this uses the intermediate values $X_k$ in the 
     74inverse of their building order in {\tt P}. 
     75 
     76= Potential issues =  
     77 
    578 * the major approximations : non differentiability issues, simplification of the direct model before linearization,  validity of the tangent linear hypothesis over some time window, etc. 
    679 * the validation interface : classical tests for checking the correctness of tangent and adjoint models