35 REAL(KIND=8),
PARAMETER ::
real_eps = 2.2204460492503131e-16
75 REAL(KIND=8),
DIMENSION(0:ndim),
INTENT(IN) :: ystar
76 TYPE(
coolist),
DIMENSION(ndim) :: jacobian
84 REAL(KIND=8),
DIMENSION(0:ndim),
INTENT(IN) :: ystar
85 REAL(KIND=8),
DIMENSION(ndim,ndim) :: jacobian_mat
100 IF (allocstat /= 0) stop
"*** Not enough memory ! ***" 106 IF (allocstat /= 0) stop
"*** Not enough memory ! ***" 110 IF (allocstat /= 0) stop
"*** Deallocation problem ! ***" 123 SUBROUTINE func(i,j,k,v)
124 INTEGER,
INTENT(IN) :: i,j,k
125 REAL(KIND=8),
INTENT(IN) :: v
128 INTEGER :: i,j,k,n,ne
147 INTEGER,
INTENT(IN) :: i,j,k
148 REAL(KIND=8),
INTENT(IN) :: v
161 INTEGER,
INTENT(IN) :: i,j,k
162 REAL(KIND=8),
INTENT(IN) :: v
164 IF (.NOT.
ALLOCATED(
tltensor)) stop
"*** tl_coeff routine : tensor not yet allocated ***" 165 IF (.NOT.
ALLOCATED(
tltensor(i)%elems)) stop
"*** tl_coeff routine : tensor not yet allocated ***" 196 IF (allocstat /= 0) stop
"*** Not enough memory ! ***" 202 IF (allocstat /= 0) stop
"*** Not enough memory ! ***" 206 IF (allocstat /= 0) stop
"*** Deallocation problem ! ***" 219 SUBROUTINE func(i,j,k,v)
220 INTEGER,
INTENT(IN) :: i,j,k
221 REAL(KIND=8),
INTENT(IN) :: v
224 INTEGER :: i,j,k,n,ne
243 INTEGER,
INTENT(IN) :: i,j,k
244 REAL(KIND=8),
INTENT(IN) :: v
245 IF ((abs(v) .ge.
real_eps).AND.(i /= 0))
THEN 257 INTEGER,
INTENT(IN) :: i,j,k
258 REAL(KIND=8),
INTENT(IN) :: v
260 IF (.NOT.
ALLOCATED(
adtensor)) stop
"*** ad_coeff routine : tensor not yet allocated ***" 261 IF ((abs(v) .ge.
real_eps).AND.(i /=0))
THEN 263 IF (.NOT.
ALLOCATED(
adtensor(k)%elems)) stop
"*** ad_coeff routine : tensor not yet allocated ***" 271 IF (.NOT.
ALLOCATED(
adtensor(j)%elems)) stop
"*** ad_coeff routine : tensor not yet allocated ***" 297 IF (allocstat /= 0) stop
"*** Not enough memory ! ***" 303 IF (allocstat /= 0) stop
"*** Not enough memory ! ***" 307 IF (allocstat /= 0) stop
"*** Deallocation problem ! ***" 320 SUBROUTINE func(i,j,k,v)
321 INTEGER,
INTENT(IN) :: i,j,k
322 REAL(KIND=8),
INTENT(IN) :: v
325 INTEGER :: i,j,k,n,ne
327 IF (.NOT.
ALLOCATED(
tltensor)) stop
"*** compute_adtensor_ref routine : tensor TL should be allocated first***" 346 INTEGER,
INTENT(IN) :: i,j,k
347 REAL(KIND=8),
INTENT(IN) :: v
358 INTEGER,
INTENT(IN) :: i,j,k
359 REAL(KIND=8),
INTENT(IN) :: v
361 IF (.NOT.
ALLOCATED(
adtensor)) stop
"*** ad_coeff_ref routine : tensor not yet allocated ***" 362 IF ((abs(v) .ge.
real_eps).AND.(j /=0))
THEN 363 IF (.NOT.
ALLOCATED(
adtensor(j)%elems)) stop
"*** ad_coeff_ref routine : tensor not yet allocated ***" 383 SUBROUTINE ad(t,ystar,deltay,buf)
384 REAL(KIND=8),
INTENT(IN) :: t
385 REAL(KIND=8),
DIMENSION(0:ndim),
INTENT(IN) :: ystar,deltay
386 REAL(KIND=8),
DIMENSION(0:ndim),
INTENT(OUT) :: buf
395 SUBROUTINE tl(t,ystar,deltay,buf)
396 REAL(KIND=8),
INTENT(IN) :: t
397 REAL(KIND=8),
DIMENSION(0:ndim),
INTENT(IN) :: ystar,deltay
398 REAL(KIND=8),
DIMENSION(0:ndim),
INTENT(OUT) :: buf
real(kind=8) function, dimension(ndim, ndim), public jacobian_mat(ystar)
Compute the Jacobian of MAOOAM in point ystar.
real(kind=8), parameter real_eps
Epsilon to test equality with 0.
integer ndim
Number of variables (dimension of the model)
subroutine compute_tltensor(func)
Routine to compute the TL tensor from the original MAOOAM one.
subroutine, public init_tltensor
Routine to initialize the TL tensor.
subroutine, public simplify(tensor)
Routine to simplify a coolist (sparse tensor). For each index , it upper triangularize the matrix ...
The equation tensor for the coupled ocean-atmosphere model with temperature which allows for an exten...
subroutine, public sparse_mul3(coolist_ijk, arr_j, arr_k, res)
Sparse multiplication of a tensor with two vectors: .
subroutine ad_add_count_ref(i, j, k, v)
Alternate subroutine used to count the number of AD tensor entries from the TL tensor.
subroutine ad_add_count(i, j, k, v)
Subroutine used to count the number of AD tensor entries.
subroutine ad_coeff_ref(i, j, k, v)
Alternate subroutine used to compute the AD tensor entries from the TL tensor.
subroutine tl_add_count(i, j, k, v)
Subroutine used to count the number of TL tensor entries.
subroutine, public jsparse_mul(coolist_ijk, arr_j, jcoo_ij)
Sparse multiplication of two tensors to determine the Jacobian: It's implemented slightly differentl...
subroutine, public ad(t, ystar, deltay, buf)
Tendencies for the AD of MAOOAM in point ystar for perturbation deltay.
Coordinate list. Type used to represent the sparse tensor.
subroutine, public jsparse_mul_mat(coolist_ijk, arr_j, jcoo_ij)
Sparse multiplication of two tensors to determine the Jacobian: It's implemented slightly differentl...
subroutine, public init_adtensor
Routine to initialize the AD tensor.
type(coolist) function, dimension(ndim) jacobian(ystar)
Compute the Jacobian of MAOOAM in point ystar.
subroutine, public init_adtensor_ref
Alternate method to initialize the AD tensor from the TL tensor.
subroutine tl_coeff(i, j, k, v)
Subroutine used to compute the TL tensor entries.
type(coolist), dimension(:), allocatable, public adtensor
Tensor representation of the Adjoint tendencies.
subroutine compute_adtensor(func)
Subroutine to compute the AD tensor from the original MAOOAM one.
subroutine ad_coeff(i, j, k, v)
type(coolist), dimension(:), allocatable, public tltensor
Tensor representation of the Tangent Linear tendencies.
subroutine, public tl(t, ystar, deltay, buf)
Tendencies for the TL of MAOOAM in point ystar for perturbation deltay.
The model parameters module.
Tangent Linear (TL) and Adjoint (AD) model versions of MAOOAM. Tensors definition module...
type(coolist), dimension(:), allocatable, public aotensor
- Tensor representation of the tendencies.
subroutine compute_adtensor_ref(func)
Alternate subroutine to compute the AD tensor from the TL one.
integer, dimension(:), allocatable count_elems
Vector used to count the tensor elements.