Module with the stochastic uncoupled resolved nonlinear and tangent linear rk2 dynamics integration routines.
More...
|
subroutine, public | init_ss_integrator |
| Subroutine to initialize the uncoupled resolved rk2 integrator. More...
|
|
subroutine, public | tendencies (t, y, res) |
| Routine computing the tendencies of the uncoupled resolved model. More...
|
|
subroutine, public | tl_tendencies (t, y, ys, res) |
| Tendencies for the tangent linear model of the uncoupled resolved dynamics in point ystar for perturbation deltay. More...
|
|
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 incremented time is returned. More...
|
|
subroutine, public | ss_tl_step (y, ys, t, dt, dtn, res) |
| Routine to perform a stochastic integration step of the unresolved uncoupled tangent linear dynamics (Heun algorithm). The incremented time is returned. More...
|
|
|
real(kind=8), dimension(:), allocatable | dwar |
|
real(kind=8), dimension(:), allocatable | dwor |
| Standard gaussian noise buffers. More...
|
|
real(kind=8), dimension(:), allocatable | anoise |
| Additive noise term. More...
|
|
real(kind=8), dimension(:), allocatable | buf_y1 |
|
real(kind=8), dimension(:), allocatable | buf_f0 |
|
real(kind=8), dimension(:), allocatable | buf_f1 |
| Integration buffers. More...
|
|
Module with the stochastic uncoupled resolved nonlinear and tangent linear rk2 dynamics integration routines.
- Copyright
- 2018 Jonathan Demaeyer. See LICENSE.txt for license information.
subroutine, public rk2_ss_integrator::init_ss_integrator |
( |
| ) |
|
Subroutine to initialize the uncoupled resolved rk2 integrator.
Definition at line 40 of file rk2_ss_integrator.f90.
43 IF (allocstat /= 0) stop
"*** Not enough memory ! ***" 45 ALLOCATE(anoise(0:
ndim),
stat=allocstat)
46 IF (allocstat /= 0) stop
"*** Not enough memory ! ***" 49 IF (allocstat /= 0) stop
"*** Not enough memory ! ***" integer ndim
Number of variables (dimension of the model)
subroutine, public rk2_ss_integrator::ss_step |
( |
real(kind=8), dimension(0:ndim), intent(in) |
y, |
|
|
real(kind=8), dimension(0:ndim), intent(in) |
ys, |
|
|
real(kind=8), intent(inout) |
t, |
|
|
real(kind=8), intent(in) |
dt, |
|
|
real(kind=8), intent(in) |
dtn, |
|
|
real(kind=8), dimension(0:ndim), intent(out) |
res |
|
) |
| |
Routine to perform a stochastic integration step of the unresolved uncoupled dynamics (Heun algorithm). The incremented time is returned.
- Parameters
-
y | Initial point. |
ys | Dummy argument for compatibility. |
t | Actual integration time |
dt | Integration timestep. |
dtn | Stochastic integration timestep (normally square-root of dt). |
res | Final point after the step. |
Definition at line 92 of file rk2_ss_integrator.f90.
92 REAL(KIND=8),
DIMENSION(0:ndim),
INTENT(IN) :: y,ys
93 REAL(KIND=8),
INTENT(INOUT) :: t
94 REAL(KIND=8),
INTENT(IN) :: dt,dtn
95 REAL(KIND=8),
DIMENSION(0:ndim),
INTENT(OUT) :: res
97 CALL stoch_atm_res_vec(dwar)
98 CALL stoch_oc_res_vec(dwor)
99 anoise=(q_ar*dwar+q_or*dwor)*dtn
100 CALL tendencies(t,y,buf_f0)
101 buf_y1 = y+dt*buf_f0+anoise
102 CALL tendencies(t,buf_y1,buf_f1)
103 res=y+0.5*(buf_f0+buf_f1)*dt+anoise
subroutine, public rk2_ss_integrator::ss_tl_step |
( |
real(kind=8), dimension(0:ndim), intent(in) |
y, |
|
|
real(kind=8), dimension(0:ndim), intent(in) |
ys, |
|
|
real(kind=8), intent(inout) |
t, |
|
|
real(kind=8), intent(in) |
dt, |
|
|
real(kind=8), intent(in) |
dtn, |
|
|
real(kind=8), dimension(0:ndim), intent(out) |
res |
|
) |
| |
Routine to perform a stochastic integration step of the unresolved uncoupled tangent linear dynamics (Heun algorithm). The incremented time is returned.
- Parameters
-
y | Initial point. |
ys | point in trajectory to which the tangent space belongs. |
t | Actual integration time |
dt | Integration timestep. |
dtn | Stochastic integration timestep (normally square-root of dt). |
res | Final point after the step. |
Definition at line 117 of file rk2_ss_integrator.f90.
117 REAL(KIND=8),
DIMENSION(0:ndim),
INTENT(IN) :: y,ys
118 REAL(KIND=8),
INTENT(INOUT) :: t
119 REAL(KIND=8),
INTENT(IN) :: dt,dtn
120 REAL(KIND=8),
DIMENSION(0:ndim),
INTENT(OUT) :: res
122 CALL stoch_atm_res_vec(dwar)
123 CALL stoch_oc_res_vec(dwor)
124 anoise=(q_ar*dwar+q_or*dwor)*dtn
125 CALL tl_tendencies(t,y,ys,buf_f0)
126 buf_y1 = y+dt*buf_f0+anoise
127 CALL tl_tendencies(t,buf_y1,ys,buf_f1)
128 res=y+0.5*(buf_f0+buf_f1)*dt+anoise
subroutine, public rk2_ss_integrator::tendencies |
( |
real(kind=8), intent(in) |
t, |
|
|
real(kind=8), dimension(0:ndim), intent(in) |
y, |
|
|
real(kind=8), dimension(0:ndim), intent(out) |
res |
|
) |
| |
Routine computing the tendencies of the uncoupled resolved model.
- Parameters
-
t | Time at which the tendencies have to be computed. Actually not needed for autonomous systems. |
y | Point at which the tendencies have to be computed. |
res | vector to store the result. |
Definition at line 63 of file rk2_ss_integrator.f90.
63 REAL(KIND=8),
INTENT(IN) :: t
64 REAL(KIND=8),
DIMENSION(0:ndim),
INTENT(IN) :: y
65 REAL(KIND=8),
DIMENSION(0:ndim),
INTENT(OUT) :: res
66 CALL sparse_mul3(ss_tensor, y, y, res)
subroutine, public rk2_ss_integrator::tl_tendencies |
( |
real(kind=8), intent(in) |
t, |
|
|
real(kind=8), dimension(0:ndim), intent(in) |
y, |
|
|
real(kind=8), dimension(0:ndim), intent(in) |
ys, |
|
|
real(kind=8), dimension(0:ndim), intent(out) |
res |
|
) |
| |
Tendencies for the tangent linear model of the uncoupled resolved dynamics in point ystar for perturbation deltay.
- Parameters
-
t | time |
y | point of the tangent space at which the tendencies have to be computed. |
ys | point in trajectory to which the tangent space belongs. |
res | vector to store the result. |
Definition at line 76 of file rk2_ss_integrator.f90.
76 REAL(KIND=8),
INTENT(IN) :: t
77 REAL(KIND=8),
DIMENSION(0:ndim),
INTENT(IN) :: y,ys
78 REAL(KIND=8),
DIMENSION(0:ndim),
INTENT(OUT) :: res
79 CALL sparse_mul3(ss_tl_tensor, y, ys, res)
real(kind=8), dimension(:), allocatable rk2_ss_integrator::anoise |
|
private |
Additive noise term.
Definition at line 30 of file rk2_ss_integrator.f90.
30 REAL(KIND=8),
DIMENSION(:),
ALLOCATABLE :: anoise
real(kind=8), dimension(:), allocatable rk2_ss_integrator::buf_f0 |
|
private |
real(kind=8), dimension(:), allocatable rk2_ss_integrator::buf_f1 |
|
private |
real(kind=8), dimension(:), allocatable rk2_ss_integrator::buf_y1 |
|
private |
Definition at line 32 of file rk2_ss_integrator.f90.
32 REAL(KIND=8),
DIMENSION(:),
ALLOCATABLE :: buf_y1,buf_f0,buf_f1
real(kind=8), dimension(:), allocatable rk2_ss_integrator::dwar |
|
private |
real(kind=8), dimension(:), allocatable rk2_ss_integrator::dwor |
|
private |