74 real,
private,
allocatable,
dimension(:,:,:) ::
e,
g,
cc 75 real,
private,
allocatable,
dimension(:,:) ::
bb 120 real,
intent(out),
dimension(:,:,:) :: x
121 real,
intent(in),
dimension(:,:,:) :: d
122 real,
optional,
dimension(:,:,:) :: a,b,c
124 real,
dimension(size(x,1),size(x,2),size(x,3)) :: f
130 if(
allocated(
e))
deallocate(
e)
131 if(
allocated(
g))
deallocate(
g)
132 if(
allocated(
bb))
deallocate(
bb)
133 if(
allocated(
cc))
deallocate(
cc)
134 allocate(
e(
size(x,1),
size(x,2),
size(x,3)))
135 allocate(
g(
size(x,1),
size(x,2),
size(x,3)))
136 allocate(
bb(
size(x,1),
size(x,2)))
137 allocate(
cc(
size(x,1),
size(x,2),
size(x,3)))
139 e(:,:,1) = - a(:,:,1)/b(:,:,1)
140 a(:,:,
size(x,3)) = 0.0
143 g(:,:,k) = 1.0/(b(:,:,k)+c(:,:,k)*
e(:,:,k-1))
144 e(:,:,k) = - a(:,:,k)*
g(:,:,k)
153 f(:,:,1) = d(:,:,1)*
bb 155 f(:,:,k) = (d(:,:,k) -
cc(:,:,k)*f(:,:,k-1))*
g(:,:,k)
158 x(:,:,
size(x,3)) = f(:,:,
size(x,3))
159 do k =
size(x,3)-1,1,-1
160 x(:,:,k) =
e(:,:,k)*x(:,:,k+1)+f(:,:,k)
subroutine close_tridiagonal
real, dimension(:,:), allocatable, private bb
real, dimension(:,:,:), allocatable, private e
logical, private init_tridiagonal
subroutine tri_invert(x, d, a, b, c)
real, dimension(:,:,:), allocatable, private g
real, dimension(:,:,:), allocatable, private cc