V3FIT
ewset.f
1  SUBROUTINE ewset(n, itol, rtol, atol, ycur, ewt)
2  USE stel_kinds
3  IMPLICIT NONE
4 C-----------------------------------------------
5 C D u m m y A r g u m e n t s
6 C-----------------------------------------------
7  INTEGER n, itol
8  REAL(rprec), DIMENSION(*) :: rtol, atol
9  REAL(rprec), DIMENSION(n) :: ycur, ewt
10 C-----------------------------------------------
11 clll. optimize
12 c-----------------------------------------------------------------------
13 c this subroutine sets the error weight vector ewt according to
14 c ewt(i) = rtol(i)*abs(ycur(i)) + atol(i), i = 1,...,n,
15 c with the subscript on rtol and/or atol possibly replaced by 1 above,
16 c depending on the value of itol.
17 c-----------------------------------------------------------------------
18 c
19  SELECT CASE (itol)
20  CASE DEFAULT
21  ewt = rtol(1)*abs(ycur) + atol(1)
22  RETURN
23  CASE (2)
24  ewt = rtol(1)*abs(ycur) + atol(:n)
25  RETURN
26  CASE (3)
27  ewt = rtol(:n)*abs(ycur) + atol(1)
28  RETURN
29  CASE (4)
30  ewt = rtol(:n)*abs(ycur) + atol(:n)
31  RETURN
32  END SELECT
33 
34  END SUBROUTINE ewset