Debian Codegraph @

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

raw
1 /* ./src_f77/dckchb.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 dckchb_(integer *ipar, doublereal *rpar, doublereal *
15 pegmin, doublereal *pegmax, doublereal *condca)
16 {
17 /* Format strings */
18 static char fmt_5[] = "(4x,\002NDEG = \002,i5,/,4x,\002AA = \002,d"
19 "12.5,/,4x,\002BB = \002,d12.5)";
20 static char fmt_10[] = "(/,\002 WARNING IN DCKCHB: NDEG .LT. 0; NO PRECO"
21 "NDG DONE\002,/)";
22 static char fmt_11[] = "(/,\002 WARNING IN DCKCHB: NDEG IS ODD; NO ADAPT"
23 "IVE DONE\002,/)";
24 static char fmt_15[] = "(/,\002 ERROR IN DCKCHB: (AA .LE. 0) OR (AA .GT."
25 " BB)\002)";
26 static char fmt_20[] = "(/,\002 WARNING IN DCKCHB: INITIAL AA,BB CHANGE"
27 "D\002,/)";
28 static char fmt_25[] = "(4x,\002CL = \002,d12.5,/,4x,\002CU ="
29 " \002,d12.5,/,4x,\002CONDCA = \002,d12.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 doublereal aa, bb;
37 static integer nchb, ndeg;
38 extern doublereal d1mach_(integer *);
39 extern /* Subroutine */ int ddpchb_(integer *, doublereal *, doublereal *,
40 integer *, doublereal *, doublereal *, doublereal *, doublereal *
41 , integer *);
42 static integer iadapt, iounit;
43 static doublereal 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 DCKCHB */
55 /* ***REFER TO DPPCG,DPCGCA */
56 /* ***ROUTINES CALLED DDPCHB,D1MACH */
57 /* ***REVISION DATE 870401 (YYMMDD) */
58 /* ***END PROLOGUE DCKCHB */
59
60 /* THIS SUBR OUTPUTS THE POLYNOMIAL INPUT PARAMETERS NDEG, AA, BB. */
61 /* IT THEN CALLS DDPCHB (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
67 /* ***FIRST EXECUTABLE STATEMENT DCKCHB */
68 /* Parameter adjustments */
69 --rpar;
70 --ipar;
71
72 /* Function Body */
73 /* L1: */
74
75 /* *** OUTPUT THE PARAMETERS *** */
76 iounit = ipar[5];
77 ndeg = ipar[34];
78 nchb = ndeg + 1;
79 aa = rpar[32];
80 bb = rpar[33];
81 if (iounit > 0) {
82 io___6.ciunit = iounit;
83 s_wsfe(&io___6);
84 do_fio(&c__1, (char *)&ndeg, (ftnlen)sizeof(integer));
85 do_fio(&c__1, (char *)&aa, (ftnlen)sizeof(doublereal));
86 do_fio(&c__1, (char *)&bb, (ftnlen)sizeof(doublereal));
87 e_wsfe();
88 }
89
90 /* *** CHECK FOR IMPROPER NDEG *** */
91 if (ndeg < 0) {
92 io___7.ciunit = iounit;
93 s_wsfe(&io___7);
94 e_wsfe();
95 }
96 if (nchb % 2 == 0 && nchb >= 0) {
97 io___8.ciunit = iounit;
98 s_wsfe(&io___8);
99 e_wsfe();
100 }
101
102 /* *** CHECK FOR INVALID AA, BB *** */
103 if (aa <= 0. || aa > bb) {
104 io___9.ciunit = iounit;
105 s_wsfe(&io___9);
106 e_wsfe();
107 s_stop("", (ftnlen)0);
108 }
109
110 /* *** DETERMINE PEGMIN, PEGMAX, CONDCA *** */
111 if (ndeg < 0 || nchb % 2 == 0) {
112 *pegmin = d1mach_(&c__2);
113 *pegmax = d1mach_(&c__1);
114 } else {
115 *pegmin = 1.;
116 *pegmax = 1.;
117 }
118 *condca = 1.;
119 errtol = rpar[1];
120 ddpchb_(&c__0, &aa, &bb, &nchb, pegmin, pegmax, condca, &errtol, &iadapt);
121 if (iadapt > 0) {
122 io___12.ciunit = iounit;
123 s_wsfe(&io___12);
124 e_wsfe();
125 }
126
127 /* *** OUTPUT INFO *** */
128 if (iounit > 0) {
129 io___13.ciunit = iounit;
130 s_wsfe(&io___13);
131 do_fio(&c__1, (char *)&(*pegmin), (ftnlen)sizeof(doublereal));
132 do_fio(&c__1, (char *)&(*pegmax), (ftnlen)sizeof(doublereal));
133 do_fio(&c__1, (char *)&(*condca), (ftnlen)sizeof(doublereal));
134 e_wsfe();
135 }
136
137 return 0;
138 } /* dckchb_ */
139