23 REAL(KIND=8),
DIMENSION(:),
ALLOCATABLE :: y0_IC,y0,y0prime,dy0,dy0_bis
24 REAL(KIND=8),
DIMENSION(:),
ALLOCATABLE :: y1,y1prime
25 REAL(KIND=8),
DIMENSION(:),
ALLOCATABLE :: dy,dy_bis
26 REAL(KIND=8),
DIMENSION(:),
ALLOCATABLE :: dy1,dy1_tl,dy1_bis_tl,dy1_ad,dy1_bis_ad
27 REAL(KIND=8) :: t=0.d0
28 REAL(KIND=8) :: norm1,norm2
67 print*,
'Initial values:',y0_ic(0:
ndim)
75 dy=2.d0**(-n)/sqrt(
real(
ndim))
77 print*,
"Perturbation size:",dot_product(dy,dy)
82 CALL step(y0prime,t,
dt,y1prime)
93 print*,
"Resulting difference in trajectory: (epsilon ~ 2^-",n,
")" 94 print*,
"diff: ",dot_product(dy1,dy1)
95 print*,
"tl: ",dot_product(dy1_tl,dy1_tl)
96 print*,
"ratio: ",dot_product(dy1,dy1)/dot_product(dy1_tl,dy1_tl)
121 CALL tl_step(dy0_bis,y0_ic,t,
dt,dy1_bis_tl)
124 CALL ad_step(dy0_bis,y0_ic,t,
dt,dy1_bis_ad)
127 norm1 = dot_product(dy1_tl,dy0_bis)
129 norm2 = dot_product(dy0,dy1_bis_ad)
131 print*,
"<M(TL).x,y> = ", norm1
132 print*,
"<x,M(AD).y> = ", norm2
133 print*,
"Ratio = ", norm1/norm2
136 norm1 = dot_product(dy1_bis_tl,dy0)
138 norm2 = dot_product(dy0_bis,dy1_ad)
140 print*,
"<M(TL).y,x> = ", norm1
141 print*,
"<y,M(AD).x> = ", norm2
142 print*,
"Ratio = ", norm1/norm2
integer ndim
Number of variables (dimension of the model)
subroutine, public step(y, t, dt, res)
Routine to perform an integration step (Heun algorithm). The incremented time is returned.
real(kind=8) function, public gasdev()
Tangent Linear (TL) and Adjoint (AD) model versions of MAOOAM. Integrators module.
subroutine, public ad_step(y, ystar, t, dt, res)
Routine to perform an integration step (Heun algorithm) of the adjoint model. The incremented time is...
subroutine, public init_tltensor
Routine to initialize the TL tensor.
program test_tl_ad
Tests for the Tangent Linear (TL) and Adjoint (AD) model versions of MAOOAM.
The equation tensor for the coupled ocean-atmosphere model with temperature which allows for an exten...
subroutine, public init_adtensor
Routine to initialize the AD tensor.
Module with the integration routines.
The model parameters module.
Utility module containing the stochastic related routines.
Tangent Linear (TL) and Adjoint (AD) model versions of MAOOAM. Tensors definition module...
subroutine, public init_tl_ad_integrator
Routine to initialise the integration buffers.
real(kind=8) dt
Integration time step.
subroutine, public init_integrator
Routine to initialise the integration buffers.
real(kind=8) t_trans
Transient time period.
subroutine, public init_aotensor
Subroutine to initialise the aotensor tensor.
subroutine, public tl_step(y, ystar, t, dt, res)
Routine to perform an integration step (Heun algorithm) of the tangent linear model. The incremented time is returned.