My Project
Functions/Subroutines | Variables
mtridiagonal_scal Module Reference

Functions/Subroutines

subroutine init_tridiagonal_scal (N)
 
subroutine tridiagonal_scal (N, fi, lt, value)
 

Variables

real(sp), dimension(:), allocatable au
 
real(sp), dimension(:), allocatable bu
 
real(sp), dimension(:), allocatable cu
 
real(sp), dimension(:), allocatable du
 

Function/Subroutine Documentation

◆ init_tridiagonal_scal()

subroutine mtridiagonal_scal::init_tridiagonal_scal ( integer, intent(in)  N)

Definition at line 94 of file mod_tridiag.f90.

94 !
95 ! !DESCRIPTION:
96 ! This routines allocates memory necessary to perform the Gaussian
97 ! elimination.
98 !
99 ! !USES:
100  IMPLICIT NONE
101 !
102 ! !INPUT PARAMETERS:
103  integer, intent(in) :: N
104 !
105 ! !REVISION HISTORY:
106 ! Original author(s): Hans Burchard & Karsten Bolding
107 !
108 !EOP
109 !
110 !
111 !-----------------------------------------------------------------------
112 !BOC
113  if(allocated(au))then
114  deallocate(au)
115  deallocate(bu)
116  deallocate(cu)
117  deallocate(du)
118  deallocate(ru)
119  deallocate(qu)
120  endif
121 
122  allocate(au(0:n)) ; au = 0.
123  allocate(bu(0:n)) ; bu = 0.
124  allocate(cu(0:n)) ; cu = 0.
125  allocate(du(0:n)) ; du = 0.
126  allocate(ru(0:n)) ; ru = 0.
127  allocate(qu(0:n)) ; qu = 0.
128 
129  return
integer n
Definition: mod_main.f90:55
Here is the caller graph for this function:

◆ tridiagonal_scal()

subroutine mtridiagonal_scal::tridiagonal_scal ( integer, intent(in)  N,
integer, intent(in)  fi,
integer, intent(in)  lt,
real(sp), dimension(0:n)  value 
)

Definition at line 140 of file mod_tridiag.f90.

140 !
141 ! !DESCRIPTION:
142 ! A linear equation with tridiagonal matrix is solved here. The main
143 ! diagonal is stored on {\tt bu}, the upper diagonal on {\tt au}, and the
144 ! lower diagonal on {\tt cu}, the right hand side is stored on {\tt du}.
145 ! The method used here is the simplified Gauss elimination, also called
146 ! \emph{Thomas algorithm}.
147 !
148 ! !USES:
149  IMPLICIT NONE
150 !
151 ! !INPUT PARAMETERS:
152  integer, intent(in) :: N,fi,lt
153 !
154 ! !OUTPUT PARAMETERS:
155  real(sp) :: value(0:N)
156 !
157 ! !REVISION HISTORY:
158 ! Original author(s): Hans Burchard & Karsten Bolding
159 ! $Log$
160 ! Revision 1.2 2010/07/19 22:34:00 gcowles
161 ! modified to avoid namespace overlap with gotm libraries
162 !
163 ! Revision 1.1.1.1 2010/01/03 19:36:17 jqi
164 !
165 !
166 ! Revision 1.2.2.3 2008/07/16 18:48:53 dstuebe
167 ! added new header and copyright info
168 !
169 ! Revision 1.2.2.2 2008/04/03 17:03:48 dstuebe
170 ! Changed Header
171 !
172 ! Revision 1.2.2.1 2007/12/26 18:02:14 dstuebe
173 ! added cvs keyword tags
174 !
175 ! Revision 1.2 2007/02/28 21:40:05 dstuebe
176 ! Added comments about ICE
177 !
178 ! Revision 1.1.1.1 2007/02/28 19:48:18 dstuebe
179 ! Import of Gao's Ice model
180 !
181 ! Revision 1.1 2006/06/20 00:14:52 gcowles
182 ! *** empty log message ***
183 !
184 ! Revision 1.4 2003/03/28 09:20:36 kbk
185 ! added new copyright to files
186 !
187 ! Revision 1.3 2003/03/28 08:06:33 kbk
188 ! removed tabs
189 !
190 ! Revision 1.2 2003/03/10 08:54:16 gotm
191 ! Improved documentation and cleaned up code
192 !
193 ! Revision 1.1.1.1 2001/02/12 15:55:58 gotm
194 ! initial import into CVS
195 !
196 !EOP
197 !
198 ! !LOCAL VARIABLES:
199  integer :: i
200 !
201 !-----------------------------------------------------------------------
202 !BOC
203  ru(lt)=au(lt)/bu(lt)
204  qu(lt)=du(lt)/bu(lt)
205 
206  do i=lt-1,fi+1,-1
207  ru(i)=au(i)/(bu(i)-cu(i)*ru(i+1))
208  qu(i)=(du(i)-cu(i)*qu(i+1))/(bu(i)-cu(i)*ru(i+1))
209  end do
210 
211  qu(fi)=(du(fi)-cu(fi)*qu(fi+1))/(bu(fi)-cu(fi)*ru(fi+1))
212 
213  value(fi)=qu(fi)
214  do i=fi+1,lt
215  value(i)=qu(i)-ru(i)*value(i-1)
216  end do
217 
218 
219  return
Here is the caller graph for this function:

Variable Documentation

◆ au

real(sp), dimension(:), allocatable mtridiagonal_scal::au

Definition at line 37 of file mod_tridiag.f90.

37  real(sp), dimension(:), allocatable :: au,bu,cu,du

◆ bu

real(sp), dimension(:), allocatable mtridiagonal_scal::bu

Definition at line 37 of file mod_tridiag.f90.

◆ cu

real(sp), dimension(:), allocatable mtridiagonal_scal::cu

Definition at line 37 of file mod_tridiag.f90.

◆ du

real(sp), dimension(:), allocatable mtridiagonal_scal::du

Definition at line 37 of file mod_tridiag.f90.