FrontISTR  5.9.0
Large-scale structural analysis program with finit element method
hecmw_precond_SAINV_nn.F90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
2 ! Copyright (c) 2019 FrontISTR Commons
3 ! This software is released under the MIT License, see LICENSE.txt
4 !-------------------------------------------------------------------------------
5 
7  use hecmw_util
10 
11  private
12 
16 
17  integer(4),parameter :: krealp = 8
18 
19  integer(kind=kint) :: NPFIU, NPFIL
20  integer(kind=kint) :: N
21  integer(kind=kint) :: NDOF, NDOF2
22  integer(kind=kint), pointer :: inumFI1L(:) => null()
23  integer(kind=kint), pointer :: inumFI1U(:) => null()
24  integer(kind=kint), pointer :: FI1L(:) => null()
25  integer(kind=kint), pointer :: FI1U(:) => null()
26 
27  integer(kind=kint), pointer :: indexL(:) => null()
28  integer(kind=kint), pointer :: indexU(:) => null()
29  integer(kind=kint), pointer :: itemL(:) => null()
30  integer(kind=kint), pointer :: itemU(:) => null()
31  real(kind=kreal), pointer :: d(:) => null()
32  real(kind=kreal), pointer :: al(:) => null()
33  real(kind=kreal), pointer :: au(:) => null()
34 
35  real(kind=krealp), pointer :: sainvu(:) => null()
36  real(kind=krealp), pointer :: sainvl(:) => null()
37  real(kind=krealp), pointer :: sainvd(:) => null()
38  real(kind=kreal), pointer :: t(:) => null()
39 
40 contains
41 
42  !C***
43  !C*** hecmw_precond_nn_sainv_setup
44  !C***
45  subroutine hecmw_precond_sainv_nn_setup(hecMAT)
46  implicit none
47  type(hecmwst_matrix) :: hecmat
48 
49  integer(kind=kint ) :: precond
50  real(kind=krealp) :: filter
51 
52  n = hecmat%N
53  ndof = hecmat%NDOF
54  ndof2 = ndof*ndof
55  precond = hecmw_mat_get_precond(hecmat)
56 
57  d => hecmat%D
58  au=> hecmat%AU
59  al=> hecmat%AL
60  indexl => hecmat%indexL
61  indexu => hecmat%indexU
62  iteml => hecmat%itemL
63  itemu => hecmat%itemU
64 
65  if (precond.eq.20) call form_ilu1_sainv_nn(hecmat)
66 
67  allocate (sainvd(ndof2*hecmat%NP))
68  allocate (sainvl(ndof2*npfiu))
69  allocate (t(ndof*hecmat%NP))
70  sainvd = 0.0d0
71  sainvl = 0.0d0
72  t = 0.0d0
73 
74  filter= hecmat%Rarray(5)
75 
76  write(*,"(a,F15.8)")"### SAINV FILTER :",filter
77 
78  call hecmw_sainv_nn(hecmat)
79 
80  allocate (sainvu(ndof2*npfiu))
81  sainvu = 0.0d0
82 
83  call hecmw_sainv_make_u_nn(hecmat)
84 
85  end subroutine hecmw_precond_sainv_nn_setup
86 
87  subroutine hecmw_precond_sainv_nn_apply(R, ZP)
88  implicit none
89  real(kind=kreal), intent(inout) :: zp(:)
90  real(kind=kreal), intent(in) :: r(:)
91  integer(kind=kint) :: in, i, j, isl, iel, isu, ieu,idof,jdof
92  real(kind=kreal) :: sw(ndof),x(ndof)
93 
94 #ifndef _OPENACC
95  !$OMP PARALLEL DEFAULT(NONE) &
96  !$OMP&PRIVATE(i,X,SW,j,in,isL,ieL,isU,ieU,idof,jdof) &
97  !$OMP&SHARED(N,SAINVD,SAINVL,SAINVU,inumFI1U,FI1U,inumFI1L,FI1L,R,T,ZP,NDOF,NDOF2)
98 #endif
99 
100 #ifdef _OPENACC
101  !$acc kernels
102  !$acc loop independent
103 #else
104  !$OMP DO
105 #endif
106  !C-- FORWARD
107  do i= 1, n
108  do idof = 1, ndof
109  sw(idof) = 0.0d0
110  end do
111  isl= inumfi1l(i-1)+1
112  iel= inumfi1l(i)
113  do j= isl, iel
114  in= fi1l(j)
115  do idof = 1, ndof
116  x(idof) = r(ndof*(in-1)+idof)
117  end do
118  do idof = 1, ndof
119  do jdof = 1, ndof
120  sw(idof) = sw(idof) + sainvl(ndof2*(j-1)+ndof*(idof-1)+jdof)*x(jdof)
121  end do
122  end do
123  enddo
124  do idof = 1, ndof
125  x(idof) = r(ndof*(i-1)+idof)
126  t(ndof*(i-1)+idof)=x(idof)+sw(idof)
127  end do
128  do idof = 1, ndof
129  do jdof = 1, idof-1
130  t(ndof*(i-1)+idof)=t(ndof*(i-1)+idof)+sainvd(ndof2*(i-1)+ndof*(jdof-1)+idof)*x(jdof)
131  end do
132  t(ndof*(i-1)+idof)=t(ndof*(i-1)+idof)*sainvd(ndof2*(i-1)+ndof*(idof-1)+idof)
133  end do
134  enddo
135 #ifdef _OPENACC
136  !$acc end kernels
137 #else
138  !$OMP END DO
139 #endif
140 
141 #ifdef _OPENACC
142  !$acc kernels
143  !$acc loop independent
144 #else
145  !$OMP DO
146 #endif
147  !C-- BACKWARD
148  do i= 1, n
149  do idof = 1, ndof
150  sw(idof) = 0.0d0
151  end do
152 
153  isu= inumfi1u(i-1) + 1
154  ieu= inumfi1u(i)
155  do j= isu, ieu
156  in= fi1u(j)
157  do idof = 1, ndof
158  x(idof) = t(ndof*(in-1)+idof)
159  end do
160  do idof = 1, ndof
161  do jdof = 1, ndof
162  sw(idof) = sw(idof) + sainvu(ndof2*(j-1)+ndof*(idof-1)+jdof)*x(jdof)
163  end do
164  end do
165  enddo
166 
167  do idof = 1, ndof
168  x(idof) = t(ndof*(i-1)+idof)
169  end do
170  do idof = 1, ndof
171  zp(ndof*(i-1)+idof) = x(idof) + sw(idof)
172  do jdof = ndof, idof+1, -1
173  zp(ndof*(i-1)+idof) = zp(ndof*(i-1)+idof)+sainvd(ndof2*(i-1)+ndof*(idof-1)+jdof)*x(jdof)
174  end do
175  end do
176  enddo
177 #ifdef _OPENACC
178  !$acc end kernels
179 #else
180  !$OMP END DO
181 #endif
182 
183 #ifndef _OPENACC
184  !$OMP END PARALLEL
185 #endif
186 
187  end subroutine hecmw_precond_sainv_nn_apply
188 
189 
190  !C***
191  !C*** hecmw_rif_nn
192  !C***
193  subroutine hecmw_sainv_nn(hecMAT)
194  implicit none
195  type (hecmwst_matrix) :: hecmat
196 
197  integer(kind=kint) :: i, j, k, js, je, in, itr, idof, jdof, iitr
198  real(kind=krealp) :: dd, dtmp(hecmat%NDOF), x(hecmat%NDOF)
199 
200  real(kind=krealp) :: filter
201  real(kind=krealp), allocatable :: zz(:), vv(:)
202 
203  filter= hecmat%Rarray(5)
204 
205  allocate (vv(ndof*hecmat%NP))
206  allocate (zz(ndof*hecmat%NP))
207  do itr=1,n
208  do iitr=1,ndof
209  zz(:) = 0.0d0
210  vv(:) = 0.0d0
211  !{v}=[A]{zi}
212  do idof = 1,ndof
213  zz(ndof*(itr-1)+idof)= sainvd(ndof2*(itr-1)+ndof*(idof-1)+iitr)
214  end do
215  zz(ndof*(itr-1)+iitr)= 1.0d0
216 
217  js= inumfi1l(itr-1) + 1
218  je= inumfi1l(itr )
219  do j= js, je
220  in = fi1l(j)
221  do idof = 1, ndof
222  zz(ndof*(in-1)+idof)=sainvl(ndof2*(j-1)+ndof*(iitr-1)+idof)
223  end do
224  enddo
225 
226  do i= 1, itr
227  do idof = 1,ndof
228  x(idof)=zz(ndof*(i-1)+idof)
229  end do
230  do idof = 1, ndof
231  do jdof = 1, ndof
232  vv(ndof*(i-1)+idof) = vv(ndof*(i-1)+idof) + d(ndof2*(i-1)+ndof*(idof-1)+jdof)*x(jdof)
233  end do
234  end do
235 
236  js= indexl(i-1) + 1
237  je= indexl(i )
238  do j=js,je
239  in = iteml(j)
240  do idof = 1, ndof
241  do jdof = 1, ndof
242  vv(ndof*(in-1)+idof) = vv(ndof*(in-1)+idof) + al(ndof2*(j-1)+ndof*(jdof-1)+idof)*x(jdof)
243  end do
244  end do
245  enddo
246  js= indexu(i-1) + 1
247  je= indexu(i )
248  do j= js, je
249  in = itemu(j)
250  do idof = 1, ndof
251  do jdof = 1, ndof
252  vv(ndof*(in-1)+idof) = vv(ndof*(in-1)+idof) + au(ndof2*(j-1)+ndof*(jdof-1)+idof)*x(jdof)
253  end do
254  end do
255  enddo
256  enddo
257 
258  !{d}={v^t}{z_j}
259  do idof = 1, ndof
260  dtmp(idof)= sainvd(ndof2*(itr-1)+ndof*(idof-1)+idof)
261  end do
262 
263  do i= itr,n
264  do idof = 1,ndof
265  sainvd(ndof2*(i-1)+ndof*(idof-1)+idof) = vv(ndof*(i-1)+idof)
266  do jdof = 1, idof-1
267  sainvd(ndof2*(i-1)+ndof*(idof-1)+idof) = sainvd(ndof2*(i-1)+ndof*(idof-1)+idof) + &
268  & sainvd(ndof2*(i-1)+ndof*(jdof-1)+idof)*vv(ndof*(i-1)+jdof)
269  end do
270  end do
271  js= inumfi1l(i-1) + 1
272  je= inumfi1l(i )
273  do j= js, je
274  in = fi1l(j)
275  do idof = 1,ndof
276  x(idof)=vv(ndof*(in-1)+idof)
277  end do
278  do idof = 1, ndof
279  do jdof = 1, ndof
280  sainvd(ndof2*(i-1)+ndof*(idof-1)+idof) = sainvd(ndof2*(i-1)+ndof*(idof-1)+idof) + &
281  & sainvl(ndof2*(j-1)+ndof*(idof-1)+jdof)*x(jdof)
282  end do
283  end do
284  enddo
285  enddo
286 
287  !Update D
288  dd = 1.0d0/sainvd(ndof2*(itr-1)+ndof*(iitr-1)+iitr)
289  do idof=1,iitr-1
290  sainvd(ndof2*(itr-1)+ndof*(idof-1)+idof) = dtmp(idof)
291  end do
292  ! SAINVD(NDOF2*(itr-1)+NDOF*(iitr-1)+iitr)=dd
293  do idof = iitr+1, ndof
294  sainvd(ndof2*(itr-1)+ndof*(idof-1)+idof) = sainvd(ndof2*(itr-1)+ndof*(idof-1)+idof)*dd
295  end do
296 
297  do i =itr+1,n
298  do idof = 1, ndof
299  sainvd(ndof2*(i-1)+ndof*(idof-1)+idof) = sainvd(ndof2*(i-1)+ndof*(idof-1)+idof)*dd
300  end do
301  enddo
302 
303  !Update Z
304  do k=iitr+1,ndof
305  dd = sainvd(ndof2*(itr-1)+ndof*(k-1)+k)
306  if(abs(dd) > filter)then
307  do jdof = 1, iitr
308  sainvd(ndof2*(itr-1)+ndof*(jdof-1)+k)= sainvd(ndof2*(itr-1)+ndof*(jdof-1)+k) - dd*zz(ndof*(itr-1)+jdof)
309  end do
310  js= inumfi1l(itr-1) + 1
311  je= inumfi1l(itr )
312  do j= js, je
313  in = fi1l(j)
314  do idof = 1, ndof
315  sainvl(ndof2*(j-1)+ndof*(k-1)+idof) = sainvl(ndof2*(j-1)+ndof*(k-1)+idof)-dd*zz(ndof*(in-1)+idof)
316  end do
317  enddo
318  endif
319  end do
320 
321  do i= itr +1,n
322  js= inumfi1l(i-1) + 1
323  je= inumfi1l(i )
324  do idof = 1, ndof
325  dd = sainvd(ndof2*(i-1)+ndof*(idof-1)+idof)
326  if(abs(dd) > filter)then
327  do j= js, je
328  in = fi1l(j)
329  if (in > itr) exit
330  do jdof=1,ndof
331  sainvl(ndof2*(j-1)+ndof*(idof-1)+jdof)=sainvl(ndof2*(j-1)+ndof*(idof-1)+jdof)-dd*zz(ndof*(in-1)+jdof)
332  end do
333  enddo
334  endif
335  end do
336  enddo
337  end do
338  enddo
339  deallocate(vv)
340  deallocate(zz)
341 
342  do i =1,n
343  do idof = 1, ndof
344  sainvd(ndof2*(i-1)+ndof*(idof-1)+idof)=1/sainvd(ndof2*(i-1)+ndof*(idof-1)+idof)
345  do jdof = idof+1, ndof
346  sainvd(ndof2*(i-1)+ndof*(jdof-1)+idof)=sainvd(ndof2*(i-1)+ndof*(idof-1)+jdof)
347  end do
348  end do
349  enddo
350  end subroutine hecmw_sainv_nn
351 
352  subroutine hecmw_sainv_make_u_nn(hecMAT)
353  implicit none
354  type (hecmwst_matrix) :: hecmat
355  integer(kind=kint) i,j,k,n,m,o,idof,jdof
356  integer(kind=kint) is,ie,js,je
357 
358  n = 1
359  do i= 1, hecmat%NP
360  is=inumfi1u(i-1) + 1
361  ie=inumfi1u(i )
362  flag1:do k= is, ie
363  m = fi1u(k)
364  js=inumfi1l(m-1) + 1
365  je=inumfi1l(m )
366  do j= js,je
367  o = fi1l(j)
368  if (o == i)then
369  do idof = 1, ndof
370  do jdof = 1, ndof
371  sainvu(ndof2*(n-1)+ndof*(jdof-1)+idof)=sainvl(ndof2*(j-1)+ndof*(idof-1)+jdof)
372  end do
373  end do
374  n = n + 1
375  cycle flag1
376  endif
377  enddo
378  enddo flag1
379  enddo
380  end subroutine hecmw_sainv_make_u_nn
381 
382  !C***
383  !C*** FORM_ILU1_nn
384  !C*** form ILU(1) matrix
385 
386  !C***
387  !C*** FORM_ILU1_nn
388  !C*** form ILU(1) matrix
389  subroutine form_ilu1_sainv_nn(hecMAT)
390  implicit none
391  type(hecmwst_matrix) :: hecmat
392 
393  integer(kind=kint),allocatable :: iwsl(:), iwsu(:), iw1(:), iw2(:)
394  integer(kind=kint) :: nplf1,npuf1
395  integer(kind=kint) :: i,jj,kk,l,isk,iek,isj,iej
396  integer(kind=kint) :: icou,icou0,icouu,icouu1,icouu2,icouu3,icoul,icoul1,icoul2,icoul3
397  integer(kind=kint) :: j,k,isl,isu
398  !C
399  !C +--------------+
400  !C | find fill-in |
401  !C +--------------+
402  !C===
403 
404  !C
405  !C-- count fill-in
406  allocate (iw1(hecmat%NP) , iw2(hecmat%NP))
407  allocate (inumfi1l(0:hecmat%NP), inumfi1u(0:hecmat%NP))
408 
409  inumfi1l= 0
410  inumfi1u= 0
411 
412  nplf1= 0
413  npuf1= 0
414  do i= 2, hecmat%NP
415  icou= 0
416  iw1= 0
417  iw1(i)= 1
418  do l= indexl(i-1)+1, indexl(i)
419  iw1(iteml(l))= 1
420  enddo
421  do l= indexu(i-1)+1, indexu(i)
422  iw1(itemu(l))= 1
423  enddo
424 
425  isk= indexl(i-1) + 1
426  iek= indexl(i)
427  do k= isk, iek
428  kk= iteml(k)
429  isj= indexu(kk-1) + 1
430  iej= indexu(kk )
431  do j= isj, iej
432  jj= itemu(j)
433  if (iw1(jj).eq.0 .and. jj.lt.i) then
434  inumfi1l(i)= inumfi1l(i)+1
435  iw1(jj)= 1
436  endif
437  if (iw1(jj).eq.0 .and. jj.gt.i) then
438  inumfi1u(i)= inumfi1u(i)+1
439  iw1(jj)= 1
440  endif
441  enddo
442  enddo
443  nplf1= nplf1 + inumfi1l(i)
444  npuf1= npuf1 + inumfi1u(i)
445  enddo
446 
447  !C
448  !C-- specify fill-in
449  allocate (iwsl(0:hecmat%NP), iwsu(0:hecmat%NP))
450  allocate (fi1l(hecmat%NPL+nplf1), fi1u(hecmat%NPU+npuf1))
451 
452  npfiu = hecmat%NPU+npuf1
453  npfil = hecmat%NPL+nplf1
454 
455  fi1l= 0
456  fi1u= 0
457 
458  iwsl= 0
459  iwsu= 0
460  do i= 1, hecmat%NP
461  iwsl(i)= indexl(i)-indexl(i-1) + inumfi1l(i) + iwsl(i-1)
462  iwsu(i)= indexu(i)-indexu(i-1) + inumfi1u(i) + iwsu(i-1)
463  enddo
464 
465  do i= 2, hecmat%NP
466  icoul= 0
467  icouu= 0
468  inumfi1l(i)= inumfi1l(i-1) + inumfi1l(i)
469  inumfi1u(i)= inumfi1u(i-1) + inumfi1u(i)
470  icou= 0
471  iw1= 0
472  iw1(i)= 1
473  do l= indexl(i-1)+1, indexl(i)
474  iw1(iteml(l))= 1
475  enddo
476  do l= indexu(i-1)+1, indexu(i)
477  iw1(itemu(l))= 1
478  enddo
479 
480  isk= indexl(i-1) + 1
481  iek= indexl(i)
482  do k= isk, iek
483  kk= iteml(k)
484  isj= indexu(kk-1) + 1
485  iej= indexu(kk )
486  do j= isj, iej
487  jj= itemu(j)
488  if (iw1(jj).eq.0 .and. jj.lt.i) then
489  icoul = icoul + 1
490  fi1l(icoul+iwsl(i-1)+indexl(i)-indexl(i-1))= jj
491  iw1(jj) = 1
492  endif
493  if (iw1(jj).eq.0 .and. jj.gt.i) then
494  icouu = icouu + 1
495  fi1u(icouu+iwsu(i-1)+indexu(i)-indexu(i-1))= jj
496  iw1(jj) = 1
497  endif
498  enddo
499  enddo
500  enddo
501 
502  isl = 0
503  isu = 0
504  do i= 1, hecmat%NP
505  icoul1= indexl(i) - indexl(i-1)
506  icoul2= inumfi1l(i) - inumfi1l(i-1)
507  icoul3= icoul1 + icoul2
508  icouu1= indexu(i) - indexu(i-1)
509  icouu2= inumfi1u(i) - inumfi1u(i-1)
510  icouu3= icouu1 + icouu2
511  !C
512  !C-- LOWER part
513  icou0= 0
514  do k= indexl(i-1)+1, indexl(i)
515  icou0 = icou0 + 1
516  iw1(icou0)= iteml(k)
517  enddo
518 
519  do k= inumfi1l(i-1)+1, inumfi1l(i)
520  icou0 = icou0 + 1
521  iw1(icou0)= fi1l(icou0+iwsl(i-1))
522  enddo
523 
524  do k= 1, icoul3
525  iw2(k)= k
526  enddo
527  call sainv_sort_nn (iw1, iw2, icoul3, hecmat%NP)
528 
529  do k= 1, icoul3
530  fi1l(k+isl)= iw1(k)
531  enddo
532  !C
533  !C-- UPPER part
534  icou0= 0
535  do k= indexu(i-1)+1, indexu(i)
536  icou0 = icou0 + 1
537  iw1(icou0)= itemu(k)
538  enddo
539 
540  do k= inumfi1u(i-1)+1, inumfi1u(i)
541  icou0 = icou0 + 1
542  iw1(icou0)= fi1u(icou0+iwsu(i-1))
543  enddo
544 
545  do k= 1, icouu3
546  iw2(k)= k
547  enddo
548  call sainv_sort_nn (iw1, iw2, icouu3, hecmat%NP)
549 
550  do k= 1, icouu3
551  fi1u(k+isu)= iw1(k)
552  enddo
553 
554  isl= isl + icoul3
555  isu= isu + icouu3
556  enddo
557 
558  !C===
559  do i= 1, hecmat%NP
560  inumfi1l(i)= iwsl(i)
561  inumfi1u(i)= iwsu(i)
562  enddo
563 
564  deallocate (iw1, iw2)
565  deallocate (iwsl, iwsu)
566  !C===
567  end subroutine form_ilu1_sainv_nn
568 
569  !C
570  !C***
571  !C*** fill_in_S33_SORT
572  !C***
573  !C
574  subroutine sainv_sort_nn(STEM, INUM, N, NP)
575  use hecmw_util
576  implicit none
577  integer(kind=kint) :: n, np
578  integer(kind=kint), dimension(NP) :: stem
579  integer(kind=kint), dimension(NP) :: inum
580  integer(kind=kint), dimension(:), allocatable :: istack
581  integer(kind=kint) :: m,nstack,jstack,l,ir,ip,i,j,k,ss,ii,temp,it
582 
583  allocate (istack(-np:+np))
584 
585  m = 100
586  nstack= np
587 
588  jstack= 0
589  l = 1
590  ir = n
591 
592  ip= 0
593  1 continue
594  ip= ip + 1
595 
596  if (ir-l.lt.m) then
597  do j= l+1, ir
598  ss= stem(j)
599  ii= inum(j)
600 
601  do i= j-1,1,-1
602  if (stem(i).le.ss) goto 2
603  stem(i+1)= stem(i)
604  inum(i+1)= inum(i)
605  end do
606  i= 0
607 
608  2 continue
609  stem(i+1)= ss
610  inum(i+1)= ii
611  end do
612 
613  if (jstack.eq.0) then
614  deallocate (istack)
615  return
616  endif
617 
618  ir = istack(jstack)
619  l = istack(jstack-1)
620  jstack= jstack - 2
621  else
622 
623  k= (l+ir) / 2
624  temp = stem(k)
625  stem(k) = stem(l+1)
626  stem(l+1)= temp
627 
628  it = inum(k)
629  inum(k) = inum(l+1)
630  inum(l+1)= it
631 
632  if (stem(l+1).gt.stem(ir)) then
633  temp = stem(l+1)
634  stem(l+1)= stem(ir)
635  stem(ir )= temp
636  it = inum(l+1)
637  inum(l+1)= inum(ir)
638  inum(ir )= it
639  endif
640 
641  if (stem(l).gt.stem(ir)) then
642  temp = stem(l)
643  stem(l )= stem(ir)
644  stem(ir)= temp
645  it = inum(l)
646  inum(l )= inum(ir)
647  inum(ir)= it
648  endif
649 
650  if (stem(l+1).gt.stem(l)) then
651  temp = stem(l+1)
652  stem(l+1)= stem(l)
653  stem(l )= temp
654  it = inum(l+1)
655  inum(l+1)= inum(l)
656  inum(l )= it
657  endif
658 
659  i= l + 1
660  j= ir
661 
662  ss= stem(l)
663  ii= inum(l)
664 
665  3 continue
666  i= i + 1
667  if (stem(i).lt.ss) goto 3
668 
669  4 continue
670  j= j - 1
671  if (stem(j).gt.ss) goto 4
672 
673  if (j.lt.i) goto 5
674 
675  temp = stem(i)
676  stem(i)= stem(j)
677  stem(j)= temp
678 
679  it = inum(i)
680  inum(i)= inum(j)
681  inum(j)= it
682 
683  goto 3
684 
685  5 continue
686 
687  stem(l)= stem(j)
688  stem(j)= ss
689  inum(l)= inum(j)
690  inum(j)= ii
691 
692  jstack= jstack + 2
693 
694  if (jstack.gt.nstack) then
695  write (*,*) 'NSTACK overflow'
696  stop
697  endif
698 
699  if (ir-i+1.ge.j-1) then
700  istack(jstack )= ir
701  istack(jstack-1)= i
702  ir= j-1
703  else
704  istack(jstack )= j-1
705  istack(jstack-1)= l
706  l= i
707  endif
708 
709  endif
710 
711  goto 1
712 
713  end subroutine sainv_sort_nn
714 
716  implicit none
717 
718  if (associated(sainvd)) deallocate(sainvd)
719  if (associated(sainvl)) deallocate(sainvl)
720  if (associated(sainvu)) deallocate(sainvu)
721  if (associated(inumfi1l)) deallocate(inumfi1l)
722  if (associated(inumfi1u)) deallocate(inumfi1u)
723  if (associated(fi1l)) deallocate(fi1l)
724  if (associated(fi1u)) deallocate(fi1u)
725  nullify(inumfi1l)
726  nullify(inumfi1u)
727  nullify(fi1l)
728  nullify(fi1u)
729  nullify(d)
730  nullify(al)
731  nullify(au)
732  nullify(indexl)
733  nullify(indexu)
734  nullify(iteml)
735  nullify(itemu)
736 
737  end subroutine hecmw_precond_sainv_nn_clear
738 end module hecmw_precond_sainv_nn
integer(kind=kint) function, public hecmw_mat_get_precond(hecMAT)
subroutine, public hecmw_precond_sainv_nn_clear()
subroutine, public hecmw_precond_sainv_nn_apply(R, ZP)
subroutine, public hecmw_precond_sainv_nn_setup(hecMAT)
I/O and Utility.
Definition: hecmw_util_f.F90:7
integer(kind=4), parameter kreal