A Modular Arbitrary-Order Ocean-Atmosphere Model -- Stochastic implementation
test_inprod_analytic.f90
Go to the documentation of this file.
1 
2 ! test_inprod_analytic.f90
3 !
4 !> Small program to print the inner products.
5 !
6 !> @copyright
7 !> 2015 Lesley De Cruz & Jonathan Demaeyer.
8 !> See LICENSE.txt for license information.
9 !
10 !---------------------------------------------------------------------------!
11 !
12 !> @remark
13 !> Print in the same order as test_inprod.lua
14 !
15 !---------------------------------------------------------------------------!
16 
17 
19 
20  USE params, only: natm, noc, init_params
21  USE inprod_analytic
22  USE util, only: str
23 
24  IMPLICIT NONE
25  INTEGER :: i,j,kk
26  REAL(KIND=8), PARAMETER :: real_eps = 2.2204460492503131e-16
27 
28  CALL init_params ! Iniatialise the parameter
29  CALL init_inprod ! Initialise the inner product tensors
30 
31 
32  do i = 1, natm
33  do j = 1, natm
34  IF( abs(atmos%a(i,j)) .GE. real_eps) write(*,"(A,ES12.5)") "a["//trim(str(i))//"]["//trim(str(j))// "] = ", atmos%a(i,j)
35  IF( abs(atmos%c(i,j)) .GE. real_eps) write(*,"(A,ES12.5)") "c["//trim(str(i))//"]["//trim(str(j))// "] = ", atmos%c(i,j)
36  do kk = 1, natm
37  IF( abs(atmos%b(i,j,kk)) .GE. real_eps) write(*,"(A,ES12.5)") &
38  & "b[" //trim(str(i))//"][" //trim(str(j))//"][" //trim(str(kk))//"] = ", atmos%b(i,j,kk)
39  IF( abs(atmos%g(i,j,kk)) .GE. real_eps) write(*,"(A,ES12.5)") &
40  & "g[" //trim(str(i))//"][" //trim(str(j))//"][" //trim(str(kk))//"] = ", atmos%g(i,j,kk)
41  end do
42  end do
43  do j = 1, noc
44  IF( abs(atmos%d(i,j)) .GE. real_eps) write(*,"(A,ES12.5)") "d[" //trim(str(i))//"][" //trim(str(j))//"] = ", atmos%d(i,j)
45  IF( abs(atmos%s(i,j)) .GE. real_eps) write(*,"(A,ES12.5)") "s[" //trim(str(i))//"][" //trim(str(j))//"] = ", atmos%s(i,j)
46  end do
47  end do
48  do i = 1, noc
49  do j = 1, noc
50  IF( abs(ocean%M(i,j)) .GE. real_eps) write(*,"(A,ES12.5)") "M[" //trim(str(i))//"][" //trim(str(j))//"] = ", ocean%M(i,j)
51  IF( abs(ocean%N(i,j)) .GE. real_eps) write(*,"(A,ES12.5)") "N[" //trim(str(i))//"][" //trim(str(j))//"] = ", ocean%N(i,j)
52  do kk = 1, noc
53  IF( abs(ocean%O(i,j,kk)) .GE. real_eps) write(*,"(A,ES12.5)") &
54  & "O[" //trim(str(i))//"][" //trim(str(j))//"][" //trim(str(kk))//"] = ", ocean%O(i,j,kk)
55  IF( abs(ocean%C(i,j,kk)) .GE. real_eps) write(*,"(A,ES12.5)") &
56  & "C[" //trim(str(i))//"][" //trim(str(j))//"][" //trim(str(kk))//"] = ", ocean%C(i,j,kk)
57  end do
58  end do
59  do j = 1, natm
60  IF( abs(ocean%K(i,j)) .GE. real_eps) write(*,"(A,ES12.5)") "K[" //trim(str(i))//"][" //trim(str(j))//"] = ", ocean%K(i,j)
61  IF( abs(ocean%W(i,j)) .GE. real_eps) write(*,"(A,ES12.5)") "W[" //trim(str(i))//"][" //trim(str(j))//"] = ", ocean%W(i,j)
62  end do
63  end do
64 
65 END PROGRAM inprod_analytic_test
66 
integer noc
Number of oceanic basis functions.
Definition: params.f90:84
Utility module.
Definition: util.f90:12
subroutine, public init_inprod
Initialisation of the inner product.
Inner products between the truncated set of basis functions for the ocean and atmosphere streamfuncti...
character(len=20) function, public str(k)
Convert an integer to string.
Definition: util.f90:31
integer natm
Number of atmospheric basis functions.
Definition: params.f90:83
type(atm_tensors), public atmos
Atmospheric tensors.
The model parameters module.
Definition: params.f90:18
subroutine init_params
Parameters initialisation routine.
Definition: params.f90:138
type(ocean_tensors), public ocean
Oceanic tensors.
program inprod_analytic_test
Small program to print the inner products.