subroutine sewset (n, itol, rtol, atol, ycur, ewt) !***BEGIN PROLOGUE SEWSET !***SUBSIDIARY !***PURPOSE Set error weight vector. !***TYPE SINGLE PRECISION (SEWSET-S, DEWSET-D) !***AUTHOR Hindmarsh, Alan C., (LLNL) !***DESCRIPTION ! ! This subroutine sets the error weight vector EWT according to ! EWT(i) = RTOL(i)*ABS(YCUR(i)) + ATOL(i), i = 1,...,N, ! with the subscript on RTOL and/or ATOL possibly replaced by 1 above, ! depending on the value of ITOL. ! !***SEE ALSO SLSODE !***ROUTINES CALLED (NONE) !***REVISION HISTORY (YYMMDD) ! 791129 DATE WRITTEN ! 890501 Modified prologue to SLATEC/LDOC format. (FNF) ! 890503 Minor cosmetic changes. (FNF) ! 930809 Renamed to allow single/double precision versions. (ACH) !***END PROLOGUE SEWSET !**End integer n, itol integer i real rtol, atol, ycur, ewt dimension rtol(*), atol(*), ycur(n), ewt(n) ! !***first executable statement sewset go to (10, 20, 30, 40), itol 10 continue do 15 i = 1,n 15 ewt(i) = rtol(1)*abs(ycur(i)) + atol(1) return 20 continue do 25 i = 1,n 25 ewt(i) = rtol(1)*abs(ycur(i)) + atol(i) return 30 continue do 35 i = 1,n 35 ewt(i) = rtol(i)*abs(ycur(i)) + atol(1) return 40 continue do 45 i = 1,n 45 ewt(i) = rtol(i)*abs(ycur(i)) + atol(i) return !----------------------- end of subroutine sewset ---------------------- end