10 #include "inc_openmp.h" 25 public :: matrix_solver_tridiagonal
27 interface matrix_solver_tridiagonal
28 module procedure matrix_solver_tridiagonal_1d
29 module procedure matrix_solver_tridiagonal_3d
30 end interface matrix_solver_tridiagonal
48 subroutine matrix_solver_tridiagonal_1d( &
57 integer,
intent(in) :: KA
58 real(RP),
intent(in) :: ud(KA)
59 real(RP),
intent(in) :: md(KA)
60 real(RP),
intent(in) :: ld(KA)
61 real(RP),
intent(in) :: iv(KA)
62 real(RP),
intent(out) :: ov(KA)
74 c(k) = ud(k) / ( md(k) - ld(k) * c(k-1) )
75 d(k) = ( iv(k) - ld(k) * d(k-1) ) / ( md(k) - ld(k) * c(k-1) )
81 ov(k) = d(k) - c(k) * ov(k+1)
85 end subroutine matrix_solver_tridiagonal_1d
89 subroutine matrix_solver_tridiagonal_3d( &
100 integer,
intent(in) :: KA
101 integer,
intent(in) :: IA, IS, IE
102 integer,
intent(in) :: JA, JS, JE
103 real(RP),
intent(in) :: ud(KA,IA,JA)
104 real(RP),
intent(in) :: md(KA,IA,JA)
105 real(RP),
intent(in) :: ld(KA,IA,JA)
106 real(RP),
intent(in) :: iv(KA,IA,JA)
107 real(RP),
intent(out) :: ov(KA,IA,JA)
109 real(RP) :: c(KA,IA,JA)
110 real(RP) :: d(KA,IA,JA)
118 c(1,i,j) = ud(1,i,j) / md(1,i,j)
119 d(1,i,j) = iv(1,i,j) / md(1,i,j)
129 c(k,i,j) = ud(k,i,j) &
130 / ( md(k,i,j) - ld(k,i,j) * c(k-1,i,j) )
131 d(k,i,j) = ( iv(k,i,j) - ld(k,i,j) * d(k-1,i,j) ) &
132 / ( md(k,i,j) - ld(k,i,j) * c(k-1,i,j) )
140 ov(ka,i,j) = d(ka,i,j)
147 ov(k,i,j) = d(k,i,j) - c(k,i,j) * ov(k+1,i,j)
153 end subroutine matrix_solver_tridiagonal_3d