32 integer,
parameter :: rk = kind(1.0d0)
34 integer,
intent(in) :: method
35 integer,
intent(in) :: n
36 real(kind=rk),
intent(in) :: epsin
37 real(kind=rk),
dimension(n),
intent(inout) :: x
38 integer,
intent(in) :: mpi_comm,mpi_size
40 real(kind=rk),
dimension(n) :: g,d,gold,w
41 real(kind=rk) :: f,eps,tlev
42 real(kind=rk),
parameter :: one=1.0d0
44 integer :: iprint(2),iflag,icall,i
82 if (iprint(1) .ge. 0)
then
84 write(*,840) n, method, irest
114 CALL cgfam(n,x,f,g,d,gold,iprint,eps,w,iflag,irest,method,finish&
123 IF(iflag.LE.0.OR.icall.GT.10000) go to 50
133 tlev= eps*(one + dabs(f))
140 IF(dabs(g(i)).GT.tlev)
THEN
153 if (iprint(1).ge.0.and.iflag.ge.0)
then
161 820
format (//,
' Conjugate Gradient Minimization Routine', /)
162 840
format (/,
' n =', i6, /,
' method =', i6,/,
' irest =', i6,/)
163 850
format (/,
' Error: negative N value'/)
164 890
format (/,
' f(x*) =', 1pd16.8)
subroutine subroutine_cg(method, n, epsin, x)
Nonlinear Conjugate gradient method as callable subroutine.
subroutine fcn(n, x, f, g)
This is the subroutine which the optimization routines call to get the objective function value and i...