A Modular Arbitrary-Order Ocean-Atmosphere Model -- Stochastic implementation
test_memory.f90
Go to the documentation of this file.
1 
2 ! test_memory.f90
3 !
4 !> Small program to test the WL memory module
5 !
6 !> @copyright
7 !> 2018 Jonathan Demaeyer.
8 !> See LICENSE.txt for license information.
9 !
10 !---------------------------------------------------------------------------!
11 
12 PROGRAM test_memory
13  USE params, only: ndim, dt
16  USE aotensor_def, only: init_aotensor
17  USE wl_tensor, only: init_wl_tensor
18  USE memory
19 
20  REAL(KIND=8), DIMENSION(:), ALLOCATABLE :: y,ynew,h
21 
22  REAL(KIND=8) :: t=0.d0
23 
24  CALL init_aotensor ! Initialize the aotensor
25  CALL init_wl_tensor ! Compute the tensor
27  CALL init_memory
28 
29  print*, 'Computing 100 timunits of memory term...'
30 
31  ALLOCATE(y(0:ndim),ynew(0:ndim),h(0:ndim))
32 
33  y=0.d0
34  y(0)=1.d0
35 
36  DO WHILE (t<t_trans_stoch)
37  CALL ss_step(y,y,t,dt,dtn,ynew)
38  y=ynew
39  IF (mod(t,muti)<dt) CALL compute_m3(y,dts,dtsn,.true.,.true.,.true.,muti,h)
40  ENDDO
41 
42  t=0.d0
43 
44  DO WHILE (t<100.)
45  CALL ss_step(y,y,t,dt,dtn,ynew)
46  y=ynew
47  IF (mod(t,muti)<dt) THEN
48  print*,'y',t,y
49  CALL test_m3(y,dts,dtsn,h)
50  ENDIF
51  ENDDO
52 
53 END PROGRAM test_memory
The stochastic models parameters module.
integer ndim
Number of variables (dimension of the model)
Definition: params.f90:85
real(kind=8) muti
Memory update time interval.
subroutine, public ss_step(y, ys, t, dt, dtn, res)
Routine to perform a stochastic integration step of the unresolved uncoupled dynamics (Heun algorithm...
The equation tensor for the coupled ocean-atmosphere model with temperature which allows for an exten...
real(kind=8) t_trans_stoch
Transient time period of the stochastic model evolution.
subroutine, public init_ss_integrator
Subroutine to initialize the uncoupled resolved rk2 integrator.
Module with the stochastic uncoupled resolved nonlinear and tangent linear rk2 dynamics integration r...
subroutine, public test_m3(y, dt, dtn, h_int)
Routine to test the #compute_M3 routine.
Definition: memory.f90:159
real(kind=8) dtn
Square root of the timestep.
The WL tensors used to integrate the model.
Definition: WL_tensor.f90:18
real(kind=8) dtsn
Square root of the intrisic resolved dynamics time step.
subroutine, public init_memory
Subroutine to initialise the memory.
Definition: memory.f90:45
The model parameters module.
Definition: params.f90:18
subroutine, public compute_m3(y, dt, dtn, savey, save_ev, evolve, inter, h_int)
Compute the integrand of at each time in the past and integrate to get the memory term...
Definition: memory.f90:86
Module that compute the memory term of the WL parameterization.
Definition: memory.f90:16
real(kind=8) dt
Integration time step.
Definition: params.f90:77
program test_memory
Small program to test the WL memory module.
Definition: test_memory.f90:12
subroutine, public init_wl_tensor
Subroutine to initialise the WL tensor.
Definition: WL_tensor.f90:94
subroutine, public init_aotensor
Subroutine to initialise the aotensor tensor.
real(kind=8) dts
Intrisic resolved dynamics time step.