Debian Codegraph @

debian/external_deps/fetk/punc/src/cgcode/sckchb.c

raw
1 /* ./src_f77/sckchb.f -- translated by f2c (version 20030320).
2 You must link the resulting object file with the libraries:
3 -lf2c -lm (in that order)
4 */
5
6 #include <punc/vf2c.h>
7
8 /* Table of constant values */
9
10 static integer c__1 = 1;
11 static integer c__2 = 2;
12 static integer c__0 = 0;
13
14 /* Subroutine */ int sckchb_(integer *ipar, real *rpar, real *pegmin, real *
15 pegmax, real *condca)
16 {
17 /* Format strings */
18 static char fmt_5[] = "(4x,\002NDEG = \002,i5,/,4x,\002AA = \002,e"
19 "12.5,/,4x,\002BB = \002,e12.5)";
20 static char fmt_10[] = "(/,\002 WARNING IN SCKCHB: NDEG .LT. 0; NO PRECO"
21 "NDG DONE\002,/)";
22 static char fmt_11[] = "(/,\002 WARNING IN SCKCHB: NDEG IS ODD; NO ADAPT"
23 "IVE DONE\002,/)";
24 static char fmt_15[] = "(/,\002 ERROR IN SCKCHB: (AA .LE. 0) OR (AA .GT."
25 " BB)\002)";
26 static char fmt_20[] = "(/,\002 WARNING IN SCKCHB: INITIAL AA,BB CHANGE"
27 "D\002,/)";
28 static char fmt_25[] = "(4x,\002CL = \002,e12.5,/,4x,\002CU ="
29 " \002,e12.5,/,4x,\002CONDCA = \002,e12.5,/)";
30
31 /* Builtin functions */
32 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
33 /* Subroutine */ int s_stop(char *, ftnlen);
34
35 /* Local variables */
36 static real aa, bb;
37 static integer nchb, ndeg;
38 extern doublereal r1mach_(integer *);
39 static integer iadapt;
40 extern /* Subroutine */ int sdpchb_(integer *, real *, real *, integer *,
41 real *, real *, real *, real *, integer *);
42 static integer iounit;
43 static real errtol;
44
45 /* Fortran I/O blocks */
46 static cilist io___6 = { 0, 0, 0, fmt_5, 0 };
47 static cilist io___7 = { 0, 0, 0, fmt_10, 0 };
48 static cilist io___8 = { 0, 0, 0, fmt_11, 0 };
49 static cilist io___9 = { 0, 0, 0, fmt_15, 0 };
50 static cilist io___12 = { 0, 0, 0, fmt_20, 0 };
51 static cilist io___13 = { 0, 0, 0, fmt_25, 0 };
52
53
54 /* ***BEGIN PROLOGUE SCKCHB */
55 /* ***REFER TO SPPCG,SPCGCA */
56 /* ***ROUTINES CALLED SDPCHB,R1MACH */
57 /* ***REVISION DATE 870401 (YYMMDD) */
58 /* ***END PROLOGUE SCKCHB */
59
60 /* THIS SUBR OUTPUTS THE POLYNOMIAL INPUT PARAMETERS NDEG, AA, BB. */
61 /* IT THEN CALLS SDPCHB (WITH IOUNIT=0) TO GET THE CORRESPONDING */
62 /* MIN AND MAX EGVALS OF C(A)A. FINALLY, THE INITIAL CONDCA IS */
63 /* COMPUTED FOR USE IN THE STOPPING CRITERION. */
64
65 /* *** DECLARATIONS *** */
66 /* CCCCCIMPLICIT DOUBLE PRECISION(A-H,O-Z) */
67
68 /* ***FIRST EXECUTABLE STATEMENT SCKCHB */
69 /* Parameter adjustments */
70 --rpar;
71 --ipar;
72
73 /* Function Body */
74 /* L1: */
75
76 /* *** OUTPUT THE PARAMETERS *** */
77 iounit = ipar[5];
78 ndeg = ipar[34];
79 nchb = ndeg + 1;
80 aa = rpar[32];
81 bb = rpar[33];
82 if (iounit > 0) {
83 io___6.ciunit = iounit;
84 s_wsfe(&io___6);
85 do_fio(&c__1, (char *)&ndeg, (ftnlen)sizeof(integer));
86 do_fio(&c__1, (char *)&aa, (ftnlen)sizeof(real));
87 do_fio(&c__1, (char *)&bb, (ftnlen)sizeof(real));
88 e_wsfe();
89 }
90
91 /* *** CHECK FOR IMPROPER NDEG *** */
92 if (ndeg < 0) {
93 io___7.ciunit = iounit;
94 s_wsfe(&io___7);
95 e_wsfe();
96 }
97 if (nchb % 2 == 0 && nchb >= 0) {
98 io___8.ciunit = iounit;
99 s_wsfe(&io___8);
100 e_wsfe();
101 }
102
103 /* *** CHECK FOR INVALID AA, BB *** */
104 if (aa <= 0.f || aa > bb) {
105 io___9.ciunit = iounit;
106 s_wsfe(&io___9);
107 e_wsfe();
108 s_stop("", (ftnlen)0);
109 }
110
111 /* *** DETERMINE PEGMIN, PEGMAX, CONDCA *** */
112 if (ndeg < 0 || nchb % 2 == 0) {
113 *pegmin = r1mach_(&c__2);
114 *pegmax = r1mach_(&c__1);
115 } else {
116 *pegmin = 1.f;
117 *pegmax = 1.f;
118 }
119 *condca = 1.f;
120 errtol = rpar[1];
121 sdpchb_(&c__0, &aa, &bb, &nchb, pegmin, pegmax, condca, &errtol, &iadapt);
122 if (iadapt > 0) {
123 io___12.ciunit = iounit;
124 s_wsfe(&io___12);
125 e_wsfe();
126 }
127
128 /* *** OUTPUT INFO *** */
129 if (iounit > 0) {
130 io___13.ciunit = iounit;
131 s_wsfe(&io___13);
132 do_fio(&c__1, (char *)&(*pegmin), (ftnlen)sizeof(real));
133 do_fio(&c__1, (char *)&(*pegmax), (ftnlen)sizeof(real));
134 do_fio(&c__1, (char *)&(*condca), (ftnlen)sizeof(real));
135 e_wsfe();
136 }
137
138 return 0;
139 } /* sckchb_ */
140