1 c---------------------------------------------------------------------
2 c---------------------------------------------------------------------
6 c---------------------------------------------------------------------
7 c---------------------------------------------------------------------
9 c---------------------------------------------------------------------
10 c to perform pseudo-time stepping SSOR iterations
11 c for five nonlinear pde's.
12 c---------------------------------------------------------------------
20 c---------------------------------------------------------------------
22 c---------------------------------------------------------------------
26 double precision delunm(5), tv(5,isiz1,isiz2)
29 double precision wtime, timer_read
36 c---------------------------------------------------------------------
37 c begin pseudo-time stepping iterations
38 c---------------------------------------------------------------------
39 tmp = 1.0d+00 / ( omega * ( 2.0d+00 - omega ) )
41 c---------------------------------------------------------------------
42 c initialize a,b,c,d to zero (guarantees that page tables have been
43 c formed, if applicable on given architecture, before timestepping).
44 c---------------------------------------------------------------------
58 c---------------------------------------------------------------------
59 c compute the steady-state residuals
60 c---------------------------------------------------------------------
63 c---------------------------------------------------------------------
64 c compute the L2 norms of newton iteration residuals
65 c---------------------------------------------------------------------
66 call l2norm( isiz1, isiz2, isiz3, nx0, ny0, nz0,
67 > ist, iend, jst, jend,
70 call MPI_BARRIER( MPI_COMM_WORLD, IERROR )
75 c---------------------------------------------------------------------
77 c---------------------------------------------------------------------
81 if (mod ( istep, 20) .eq. 0 .or.
82 > istep .eq. itmax .or.
84 if (niter .gt. 1) write( *, 200) istep
85 200 format(' Time step ', i4)
89 c---------------------------------------------------------------------
90 c perform SSOR iteration
91 c---------------------------------------------------------------------
96 rsd(m,i,j,k) = dt * rsd(m,i,j,k)
103 c---------------------------------------------------------------------
104 c form the lower triangular part of the jacobian matrix
105 c---------------------------------------------------------------------
108 c---------------------------------------------------------------------
109 c perform the lower triangular solution
110 c---------------------------------------------------------------------
111 call blts( isiz1, isiz2, isiz3,
116 > ist, iend, jst, jend,
117 > nx0, ny0, ipt, jpt)
121 c---------------------------------------------------------------------
122 c form the strictly upper triangular part of the jacobian matrix
123 c---------------------------------------------------------------------
126 c---------------------------------------------------------------------
127 c perform the upper triangular solution
128 c---------------------------------------------------------------------
129 call buts( isiz1, isiz2, isiz3,
134 > ist, iend, jst, jend,
135 > nx0, ny0, ipt, jpt)
138 c---------------------------------------------------------------------
139 c update the variables
140 c---------------------------------------------------------------------
146 u( m, i, j, k ) = u( m, i, j, k )
147 > + tmp * rsd( m, i, j, k )
153 c---------------------------------------------------------------------
154 c compute the max-norms of newton iteration corrections
155 c---------------------------------------------------------------------
156 if ( mod ( istep, inorm ) .eq. 0 ) then
157 call l2norm( isiz1, isiz2, isiz3, nx0, ny0, nz0,
158 > ist, iend, jst, jend,
160 c if ( ipr .eq. 1 .and. id .eq. 0 ) then
161 c write (*,1006) ( delunm(m), m = 1, 5 )
162 c else if ( ipr .eq. 2 .and. id .eq. 0 ) then
163 c write (*,'(i5,f15.6)') istep,delunm(5)
167 c---------------------------------------------------------------------
168 c compute the steady-state residuals
169 c---------------------------------------------------------------------
172 c---------------------------------------------------------------------
173 c compute the max-norms of newton iteration residuals
174 c---------------------------------------------------------------------
175 if ( ( mod ( istep, inorm ) .eq. 0 ) .or.
176 > ( istep .eq. itmax ) ) then
177 call l2norm( isiz1, isiz2, isiz3, nx0, ny0, nz0,
178 > ist, iend, jst, jend,
180 c if ( ipr .eq. 1.and.id.eq.0 ) then
181 c write (*,1007) ( rsdnm(m), m = 1, 5 )
185 c---------------------------------------------------------------------
186 c check the newton-iteration residuals against the tolerance levels
187 c---------------------------------------------------------------------
188 if ( ( rsdnm(1) .lt. tolrsd(1) ) .and.
189 > ( rsdnm(2) .lt. tolrsd(2) ) .and.
190 > ( rsdnm(3) .lt. tolrsd(3) ) .and.
191 > ( rsdnm(4) .lt. tolrsd(4) ) .and.
192 > ( rsdnm(5) .lt. tolrsd(5) ) ) then
193 c if (ipr .eq. 1 .and. id.eq.0) then
194 c write (*,1004) istep
202 wtime = timer_read(1)
205 call MPI_ALLREDUCE( wtime,
208 > MPI_DOUBLE_PRECISION,
217 1001 format (1x/5x,'pseudo-time SSOR iteration no.=',i4/)
218 1004 format (1x/1x,'convergence was achieved after ',i4,
219 > ' pseudo-time steps' )
220 1006 format (1x/1x,'RMS-norm of SSOR-iteration correction ',
221 > 'for first pde = ',1pe12.5/,
222 > 1x,'RMS-norm of SSOR-iteration correction ',
223 > 'for second pde = ',1pe12.5/,
224 > 1x,'RMS-norm of SSOR-iteration correction ',
225 > 'for third pde = ',1pe12.5/,
226 > 1x,'RMS-norm of SSOR-iteration correction ',
227 > 'for fourth pde = ',1pe12.5/,
228 > 1x,'RMS-norm of SSOR-iteration correction ',
229 > 'for fifth pde = ',1pe12.5)
230 1007 format (1x/1x,'RMS-norm of steady-state residual for ',
231 > 'first pde = ',1pe12.5/,
232 > 1x,'RMS-norm of steady-state residual for ',
233 > 'second pde = ',1pe12.5/,
234 > 1x,'RMS-norm of steady-state residual for ',
235 > 'third pde = ',1pe12.5/,
236 > 1x,'RMS-norm of steady-state residual for ',
237 > 'fourth pde = ',1pe12.5/,
238 > 1x,'RMS-norm of steady-state residual for ',
239 > 'fifth pde = ',1pe12.5)