00001 *DECK INITS 00002 FUNCTION INITS (OS, NOS, ETA) 00003 C***BEGIN PROLOGUE INITS 00004 C***PURPOSE Determine the number of terms needed in an orthogonal 00005 C polynomial series so that it meets a specified accuracy. 00006 C***LIBRARY SLATEC (FNLIB) 00007 C***CATEGORY C3A2 00008 C***TYPE SINGLE PRECISION (INITS-S, INITDS-D) 00009 C***KEYWORDS CHEBYSHEV, FNLIB, INITIALIZE, ORTHOGONAL POLYNOMIAL, 00010 C ORTHOGONAL SERIES, SPECIAL FUNCTIONS 00011 C***AUTHOR Fullerton, W., (LANL) 00012 C***DESCRIPTION 00013 C 00014 C Initialize the orthogonal series, represented by the array OS, so 00015 C that INITS is the number of terms needed to insure the error is no 00016 C larger than ETA. Ordinarily, ETA will be chosen to be one-tenth 00017 C machine precision. 00018 C 00019 C Input Arguments -- 00020 C OS single precision array of NOS coefficients in an orthogonal 00021 C series. 00022 C NOS number of coefficients in OS. 00023 C ETA single precision scalar containing requested accuracy of 00024 C series. 00025 C 00026 C***REFERENCES (NONE) 00027 C***ROUTINES CALLED XERMSG 00028 C***REVISION HISTORY (YYMMDD) 00029 C 770401 DATE WRITTEN 00030 C 890831 Modified array declarations. (WRB) 00031 C 891115 Modified error message. (WRB) 00032 C 891115 REVISION DATE from Version 3.2 00033 C 891214 Prologue converted to Version 4.0 format. (BAB) 00034 C 900315 CALLs to XERROR changed to CALLs to XERMSG. (THJ) 00035 C***END PROLOGUE INITS 00036 REAL OS(*) 00037 C***FIRST EXECUTABLE STATEMENT INITS 00038 IF (NOS .LT. 1) CALL XERMSG ('SLATEC', 'INITS', 00039 + 'Number of coefficients is less than 1', 2, 1) 00040 C 00041 ERR = 0. 00042 DO 10 II = 1,NOS 00043 I = NOS + 1 - II 00044 ERR = ERR + ABS(OS(I)) 00045 IF (ERR.GT.ETA) GO TO 20 00046 10 CONTINUE 00047 C 00048 20 IF (I .EQ. NOS) CALL XERMSG ('SLATEC', 'INITS', 00049 + 'Chebyshev series too short for specified accuracy', 1, 1) 00050 INITS = I 00051 C 00052 RETURN 00053 END