PLaSK library
Loading...
Searching...
No Matches
c1f3kb.c
Go to the documentation of this file.
1/* c1f3kb.f -- translated by f2c (version 20100827).
2 You must link the resulting object file with libf2c:
3 on Microsoft Windows system, link with libf2c.lib;
4 on Linux or Unix systems, link with .../path/to/libf2c.a -lm
5 or, if you install libf2c.a in a standard place, with -lf2c -lm
6 -- in that order, at the end of the command line, as in
7 cc *.o -lf2c -lm
8 Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
9
10 http://www.netlib.org/f2c/libf2c.zip
11*/
12
13#include "f2c.h"
14
15/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
16/* * * */
17/* * copyright (c) 2011 by UCAR * */
18/* * * */
19/* * University Corporation for Atmospheric Research * */
20/* * * */
21/* * all rights reserved * */
22/* * * */
23/* * FFTPACK version 5.1 * */
24/* * * */
25/* * A Fortran Package of Fast Fourier * */
26/* * * */
27/* * Subroutines and Example Programs * */
28/* * * */
29/* * by * */
30/* * * */
31/* * Paul Swarztrauber and Dick Valent * */
32/* * * */
33/* * of * */
34/* * * */
35/* * the National Center for Atmospheric Research * */
36/* * * */
37/* * Boulder, Colorado (80307) U.S.A. * */
38/* * * */
39/* * which is sponsored by * */
40/* * * */
41/* * the National Science Foundation * */
42/* * * */
43/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
44
45/* Subroutine */ int c1f3kb_(integer *ido, integer *l1, integer *na,
46 doublereal *cc, integer *in1, doublereal *ch, integer *in2,
47 doublereal *wa)
48{
49 /* Initialized data */
50
51 static doublereal taur = -.5;
52 static doublereal taui = .866025403784439;
53
54 /* System generated locals */
55 integer cc_dim1, cc_dim2, cc_dim3, cc_offset, ch_dim1, ch_dim2, ch_offset,
56 wa_dim1, wa_offset, i__1, i__2;
57
58 /* Local variables */
59 integer i__, k;
60 doublereal ci2, ci3, di2, di3, cr2, cr3, dr2, dr3, ti2, tr2;
61
62 /* Parameter adjustments */
63 wa_dim1 = *ido;
64 wa_offset = 1 + wa_dim1 * 3;
65 wa -= wa_offset;
66 cc_dim1 = *in1;
67 cc_dim2 = *l1;
68 cc_dim3 = *ido;
69 cc_offset = 1 + cc_dim1 * (1 + cc_dim2 * (1 + cc_dim3));
70 cc -= cc_offset;
71 ch_dim1 = *in2;
72 ch_dim2 = *l1;
73 ch_offset = 1 + ch_dim1 * (1 + (ch_dim2 << 2));
74 ch -= ch_offset;
75
76 /* Function Body */
77
78 if (*ido > 1 || *na == 1) {
79 goto L102;
80 }
81 i__1 = *l1;
82 for (k = 1; k <= i__1; ++k) {
83 tr2 = cc[(k + ((cc_dim3 << 1) + 1) * cc_dim2) * cc_dim1 + 1] + cc[(k
84 + (cc_dim3 * 3 + 1) * cc_dim2) * cc_dim1 + 1];
85 cr2 = cc[(k + (cc_dim3 + 1) * cc_dim2) * cc_dim1 + 1] + taur * tr2;
86 cc[(k + (cc_dim3 + 1) * cc_dim2) * cc_dim1 + 1] += tr2;
87 ti2 = cc[(k + ((cc_dim3 << 1) + 1) * cc_dim2) * cc_dim1 + 2] + cc[(k
88 + (cc_dim3 * 3 + 1) * cc_dim2) * cc_dim1 + 2];
89 ci2 = cc[(k + (cc_dim3 + 1) * cc_dim2) * cc_dim1 + 2] + taur * ti2;
90 cc[(k + (cc_dim3 + 1) * cc_dim2) * cc_dim1 + 2] += ti2;
91 cr3 = taui * (cc[(k + ((cc_dim3 << 1) + 1) * cc_dim2) * cc_dim1 + 1]
92 - cc[(k + (cc_dim3 * 3 + 1) * cc_dim2) * cc_dim1 + 1]);
93 ci3 = taui * (cc[(k + ((cc_dim3 << 1) + 1) * cc_dim2) * cc_dim1 + 2]
94 - cc[(k + (cc_dim3 * 3 + 1) * cc_dim2) * cc_dim1 + 2]);
95 cc[(k + ((cc_dim3 << 1) + 1) * cc_dim2) * cc_dim1 + 1] = cr2 - ci3;
96 cc[(k + (cc_dim3 * 3 + 1) * cc_dim2) * cc_dim1 + 1] = cr2 + ci3;
97 cc[(k + ((cc_dim3 << 1) + 1) * cc_dim2) * cc_dim1 + 2] = ci2 + cr3;
98 cc[(k + (cc_dim3 * 3 + 1) * cc_dim2) * cc_dim1 + 2] = ci2 - cr3;
99/* L101: */
100 }
101 return 0;
102L102:
103 i__1 = *l1;
104 for (k = 1; k <= i__1; ++k) {
105 tr2 = cc[(k + ((cc_dim3 << 1) + 1) * cc_dim2) * cc_dim1 + 1] + cc[(k
106 + (cc_dim3 * 3 + 1) * cc_dim2) * cc_dim1 + 1];
107 cr2 = cc[(k + (cc_dim3 + 1) * cc_dim2) * cc_dim1 + 1] + taur * tr2;
108 ch[(k + (ch_dim2 << 2)) * ch_dim1 + 1] = cc[(k + (cc_dim3 + 1) *
109 cc_dim2) * cc_dim1 + 1] + tr2;
110 ti2 = cc[(k + ((cc_dim3 << 1) + 1) * cc_dim2) * cc_dim1 + 2] + cc[(k
111 + (cc_dim3 * 3 + 1) * cc_dim2) * cc_dim1 + 2];
112 ci2 = cc[(k + (cc_dim3 + 1) * cc_dim2) * cc_dim1 + 2] + taur * ti2;
113 ch[(k + (ch_dim2 << 2)) * ch_dim1 + 2] = cc[(k + (cc_dim3 + 1) *
114 cc_dim2) * cc_dim1 + 2] + ti2;
115 cr3 = taui * (cc[(k + ((cc_dim3 << 1) + 1) * cc_dim2) * cc_dim1 + 1]
116 - cc[(k + (cc_dim3 * 3 + 1) * cc_dim2) * cc_dim1 + 1]);
117 ci3 = taui * (cc[(k + ((cc_dim3 << 1) + 1) * cc_dim2) * cc_dim1 + 2]
118 - cc[(k + (cc_dim3 * 3 + 1) * cc_dim2) * cc_dim1 + 2]);
119 ch[(k + ch_dim2 * 5) * ch_dim1 + 1] = cr2 - ci3;
120 ch[(k + ch_dim2 * 6) * ch_dim1 + 1] = cr2 + ci3;
121 ch[(k + ch_dim2 * 5) * ch_dim1 + 2] = ci2 + cr3;
122 ch[(k + ch_dim2 * 6) * ch_dim1 + 2] = ci2 - cr3;
123/* L103: */
124 }
125 if (*ido == 1) {
126 return 0;
127 }
128 i__1 = *ido;
129 for (i__ = 2; i__ <= i__1; ++i__) {
130 i__2 = *l1;
131 for (k = 1; k <= i__2; ++k) {
132 tr2 = cc[(k + (i__ + (cc_dim3 << 1)) * cc_dim2) * cc_dim1 + 1] +
133 cc[(k + (i__ + cc_dim3 * 3) * cc_dim2) * cc_dim1 + 1];
134 cr2 = cc[(k + (i__ + cc_dim3) * cc_dim2) * cc_dim1 + 1] + taur *
135 tr2;
136 ch[(k + (i__ * 3 + 1) * ch_dim2) * ch_dim1 + 1] = cc[(k + (i__ +
137 cc_dim3) * cc_dim2) * cc_dim1 + 1] + tr2;
138 ti2 = cc[(k + (i__ + (cc_dim3 << 1)) * cc_dim2) * cc_dim1 + 2] +
139 cc[(k + (i__ + cc_dim3 * 3) * cc_dim2) * cc_dim1 + 2];
140 ci2 = cc[(k + (i__ + cc_dim3) * cc_dim2) * cc_dim1 + 2] + taur *
141 ti2;
142 ch[(k + (i__ * 3 + 1) * ch_dim2) * ch_dim1 + 2] = cc[(k + (i__ +
143 cc_dim3) * cc_dim2) * cc_dim1 + 2] + ti2;
144 cr3 = taui * (cc[(k + (i__ + (cc_dim3 << 1)) * cc_dim2) * cc_dim1
145 + 1] - cc[(k + (i__ + cc_dim3 * 3) * cc_dim2) * cc_dim1 +
146 1]);
147 ci3 = taui * (cc[(k + (i__ + (cc_dim3 << 1)) * cc_dim2) * cc_dim1
148 + 2] - cc[(k + (i__ + cc_dim3 * 3) * cc_dim2) * cc_dim1 +
149 2]);
150 dr2 = cr2 - ci3;
151 dr3 = cr2 + ci3;
152 di2 = ci2 + cr3;
153 di3 = ci2 - cr3;
154 ch[(k + (i__ * 3 + 2) * ch_dim2) * ch_dim1 + 2] = wa[i__ +
155 wa_dim1 * 3] * di2 + wa[i__ + wa_dim1 * 5] * dr2;
156 ch[(k + (i__ * 3 + 2) * ch_dim2) * ch_dim1 + 1] = wa[i__ +
157 wa_dim1 * 3] * dr2 - wa[i__ + wa_dim1 * 5] * di2;
158 ch[(k + (i__ * 3 + 3) * ch_dim2) * ch_dim1 + 2] = wa[i__ + (
159 wa_dim1 << 2)] * di3 + wa[i__ + wa_dim1 * 6] * dr3;
160 ch[(k + (i__ * 3 + 3) * ch_dim2) * ch_dim1 + 1] = wa[i__ + (
161 wa_dim1 << 2)] * dr3 - wa[i__ + wa_dim1 * 6] * di3;
162/* L104: */
163 }
164/* L105: */
165 }
166 return 0;
167} /* c1f3kb_ */
168