Multidimensional Autoregressive module to generate the correlation for the WL parameterization.
More...
|
real(kind=8), dimension(:,:), allocatable, public | q |
| Square root of the noise covariance matrix. More...
|
|
real(kind=8), dimension(:,:), allocatable, public | qred |
| Reduce version of Q. More...
|
|
real(kind=8), dimension(:,:), allocatable, public | rred |
| Covariance matrix of the noise. More...
|
|
real(kind=8), dimension(:,:,:), allocatable, public | w |
| W_i matrix. More...
|
|
real(kind=8), dimension(:,:,:), allocatable, public | wred |
| Reduce W_i matrix. More...
|
|
real(kind=8), dimension(:), allocatable | buf_y |
|
real(kind=8), dimension(:), allocatable | dw |
|
integer, public | ms |
| order of the MAR More...
|
|
Multidimensional Autoregressive module to generate the correlation for the WL parameterization.
- Copyright
- 2018 Jonathan Demaeyer. See LICENSE.txt for license information.
subroutine, public mar::init_mar |
( |
| ) |
|
Subroutine to initialise the MAR.
Definition at line 45 of file MAR.f90.
45 INTEGER :: allocstat,nf,i,info,info2
46 INTEGER,
DIMENSION(3) :: s
48 print*,
'Initializing the MAR integrator...' 50 print*,
'Loading the MAR config from files...' 52 OPEN(20,file=
'MAR_R_params.def',status=
'old')
54 IF (nf /= n_unres) stop
"*** Dimension in files MAR_R_params.def and sf.nml do not correspond ! ***" 55 ALLOCATE(qred(n_unres,n_unres),rred(n_unres,n_unres),wred(ms,n_unres,n_unres),
stat=allocstat)
56 IF (allocstat /= 0) stop
"*** Not enough memory ! ***" 58 IF (allocstat /= 0) stop
"*** Not enough memory ! ***" 60 IF (allocstat /= 0) stop
"*** Not enough memory ! ***" 64 OPEN(20,file=
'MAR_W_params.def',status=
'old')
67 IF (nf /= n_unres) stop
"*** Dimension in files MAR_W_params.def and sf.nml do not correspond ! ***" 68 IF (s(1) /= ms) stop
"*** MAR order in files MAR_R_params.def and MAR_W_params.def do not correspond ! ***" 70 READ(20,*) wred(i,:,:)
75 CALL sqrtm(rred,qred,info,info2)
76 CALL ireduce(q,qred,n_unres,ind,rind)
79 CALL ireduce(w(i,:,:),wred(i,:,:),n_unres,ind,rind)
86 print*,
'MAR of order',ms,
'found!' integer ndim
Number of variables (dimension of the model)
subroutine, public mar::mar_step |
( |
real(kind=8), dimension(0:ndim,ms), intent(inout) |
x | ) |
|
Routine to generate one step of the MAR.
- Parameters
-
x | State vector of the MAR (store the \(y_i\)) |
Definition at line 93 of file MAR.f90.
93 REAL(KIND=8),
DIMENSION(0:ndim,ms),
INTENT(INOUT) :: x
98 buf_y(1:
ndim)=matmul(q,dw)
100 buf_y(1:
ndim)=buf_y(1:
ndim)+matmul(x(1:
ndim,j),w(j,:,:))
102 x=eoshift(x,shift=-1,boundary=buf_y,dim=2)
integer ndim
Number of variables (dimension of the model)
subroutine, public mar::mar_step_red |
( |
real(kind=8), dimension(0:ndim,ms), intent(inout) |
xred | ) |
|
Routine to generate one step of the reduce MAR.
- Parameters
-
xred | State vector of the MAR (store the \(y_i\)) |
Definition at line 110 of file MAR.f90.
110 REAL(KIND=8),
DIMENSION(0:ndim,ms),
INTENT(INOUT) :: xred
115 buf_y(1:n_unres)=matmul(qred,dw(1:n_unres))
117 buf_y(1:n_unres)=buf_y(1:n_unres)+matmul(xred(1:n_unres,j),wred(j,:,:))
119 xred=eoshift(xred,shift=-1,boundary=buf_y,dim=2)
subroutine mar::stoch_vec |
( |
real(kind=8), dimension(ndim), intent(inout) |
dW | ) |
|
|
private |
Definition at line 125 of file MAR.f90.
125 REAL(KIND=8),
DIMENSION(ndim),
INTENT(INOUT) :: dw
integer ndim
Number of variables (dimension of the model)
real(kind=8), dimension(:), allocatable mar::buf_y |
|
private |
Definition at line 34 of file MAR.f90.
34 REAL(KIND=8),
DIMENSION(:),
ALLOCATABLE :: buf_y,dw
real(kind=8), dimension(:), allocatable mar::dw |
|
private |
order of the MAR
Definition at line 36 of file MAR.f90.
real(kind=8), dimension(:,:), allocatable, public mar::q |
Square root of the noise covariance matrix.
Definition at line 29 of file MAR.f90.
29 REAL(KIND=8),
DIMENSION(:,:),
ALLOCATABLE :: q
real(kind=8), dimension(:,:), allocatable, public mar::qred |
Reduce version of Q.
Definition at line 30 of file MAR.f90.
30 REAL(KIND=8),
DIMENSION(:,:),
ALLOCATABLE :: qred
real(kind=8), dimension(:,:), allocatable, public mar::rred |
Covariance matrix of the noise.
Definition at line 31 of file MAR.f90.
31 REAL(KIND=8),
DIMENSION(:,:),
ALLOCATABLE :: rred
real(kind=8), dimension(:,:,:), allocatable, public mar::w |
W_i matrix.
Definition at line 32 of file MAR.f90.
32 REAL(KIND=8),
DIMENSION(:,:,:),
ALLOCATABLE :: w
real(kind=8), dimension(:,:,:), allocatable, public mar::wred |
Reduce W_i matrix.
Definition at line 33 of file MAR.f90.
33 REAL(KIND=8),
DIMENSION(:,:,:),
ALLOCATABLE :: wred