Debian Codegraph @

debian/external_deps/fetk/punc/src/pmg/src_f77/nsmoothd.f

raw
1 c* ///////////////////////////////////////////////////////////////////////////
2 c* @file nsmoothd.f
3 c* @author Michael Holst
4 c* @brief Generic nonlinear smoothing iteration.
5 c* @version $Id: nsmoothd.f,v 1.2 2010/08/12 05:45:38 fetk Exp $
6 c* @attention
7 c* @verbatim
8 c*
9 c* PMG -- Parallel algebraic MultiGrid
10 c* Copyright (C) 1994-- Michael Holst.
11 c*
12 c* Michael Holst <[email protected]>
13 c* University of California, San Diego
14 c* Department of Mathematics, 5739 AP&M
15 c* 9500 Gilman Drive, Dept. 0112
16 c* La Jolla, CA 92093-0112 USA
17 c* http://math.ucsd.edu/~mholst
18 c*
19 c* This file is part of PMG.
20 c*
21 c* PMG is free software; you can redistribute it and/or modify
22 c* it under the terms of the GNU General Public License as published by
23 c* the Free Software Foundation; either version 2 of the License, or
24 c* (at your option) any later version.
25 c*
26 c* PMG is distributed in the hope that it will be useful,
27 c* but WITHOUT ANY WARRANTY; without even the implied warranty of
28 c* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 c* GNU General Public License for more details.
30 c*
31 c* You should have received a copy of the GNU General Public License
32 c* along with PMG; if not, write to the Free Software
33 c* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
34 c*
35 c* Linking PMG statically or dynamically with other modules is making a
36 c* combined work based on PMG. Thus, the terms and conditions of the GNU
37 c* General Public License cover the whole combination.
38 c*
39 c* SPECIAL GPL EXCEPTION
40 c* In addition, as a special exception, the copyright holders of PMG
41 c* give you permission to combine the PMG program with free software
42 c* programs and libraries that are released under the GNU LGPL or with
43 c* code included in releases of ISIM, PMV, PyMOL, SMOL, VMD, and Vision.
44 c* Such combined software may be linked with PMG and redistributed together
45 c* in original or modified form as mere aggregation without requirement that
46 c* the entire work be under the scope of the GNU General Public License.
47 c* This special exception permission is also extended to any software listed
48 c* in the SPECIAL GPL EXCEPTION clauses by the FEtk and APBS libraries.
49 c*
50 c* Note that people who make modified versions of PMG are not obligated
51 c* to grant this special exception for their modified versions; it is
52 c* their choice whether to do so. The GNU General Public License gives
53 c* permission to release a modified version without this exception; this
54 c* exception also makes it possible to release a modified version which
55 c* carries forward this exception.
56 c*
57 c* @endverbatim
58 c* ///////////////////////////////////////////////////////////////////////////
59
60 subroutine nsmooth(nx,ny,nz,ipc,rpc,ac,cc,fc,x,w1,w2,r,
61 2 itmax,iters,errtol,omega,iresid,iadjoint,meth)
62 c* *********************************************************************
63 c* purpose:
64 c*
65 c* call the appropriate nonlinear smoothing routine.
66 c*
67 c* author: michael holst
68 c* *********************************************************************
69 implicit none
70 integer ipc(*),itmax,iters,iresid,iadjoint,nx,ny,nz,meth
71 double precision omega,errtol
72 double precision rpc(*),ac(nx*ny*nz,*),cc(nx,ny,nz),fc(nx,ny,nz)
73 double precision x(nx,ny,nz),w1(nx,ny,nz),w2(nx,ny,nz)
74 double precision r(nx,ny,nz)
75 c*
76 cmdir 0 0
77 c*
78 c* *** do in one step ***
79 if (meth .eq. 0) then
80 call nwjac(nx,ny,nz,ipc,rpc,ac,cc,fc,x,w1,w2,r,
81 2 itmax,iters,errtol,omega,iresid,iadjoint)
82 elseif (meth .eq. 1) then
83 call ngsrb(nx,ny,nz,ipc,rpc,ac,cc,fc,x,w1,w2,r,
84 2 itmax,iters,errtol,omega,iresid,iadjoint)
85 elseif (meth .eq. 2) then
86 call nsor(nx,ny,nz,ipc,rpc,ac,cc,fc,x,w1,w2,r,
87 2 itmax,iters,errtol,omega,iresid,iadjoint)
88 elseif (meth .eq. 3) then
89 call nrich(nx,ny,nz,ipc,rpc,ac,cc,fc,x,w1,w2,r,
90 2 itmax,iters,errtol,omega,iresid,iadjoint)
91 else
92 print*,'% NSMOOTH: bad smoothing routine specified...'
93 endif
94 c*
95 c* *** return and end ***
96 return
97 end
98