PLaSK library
Loading...
Searching...
No Matches
cmf3kb.c
Go to the documentation of this file.
1/* cmf3kb.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 cmf3kb_(integer *lot, integer *ido, integer *l1, integer
46 *na, doublereal *cc, integer *im1, integer *in1, doublereal *ch,
47 integer *im2, integer *in2, 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_dim2, cc_dim3, cc_dim4, cc_offset, ch_dim2, ch_dim3, ch_offset,
56 wa_dim1, wa_offset, i__1, i__2, i__3, i__4;
57
58 /* Local variables */
59 integer i__, k, m1, m2;
60 doublereal ci2, ci3, di2, di3;
61 integer m1d;
62 doublereal cr2, cr3, dr2, dr3, ti2;
63 integer m2s;
64 doublereal tr2;
65
66 /* Parameter adjustments */
67 wa_dim1 = *ido;
68 wa_offset = 1 + wa_dim1 * 3;
69 wa -= wa_offset;
70 cc_dim2 = *in1;
71 cc_dim3 = *l1;
72 cc_dim4 = *ido;
73 cc_offset = 1 + 2 * (1 + cc_dim2 * (1 + cc_dim3 * (1 + cc_dim4)));
74 cc -= cc_offset;
75 ch_dim2 = *in2;
76 ch_dim3 = *l1;
77 ch_offset = 1 + 2 * (1 + ch_dim2 * (1 + (ch_dim3 << 2)));
78 ch -= ch_offset;
79
80 /* Function Body */
81
82 m1d = (*lot - 1) * *im1 + 1;
83 m2s = 1 - *im2;
84 if (*ido > 1 || *na == 1) {
85 goto L102;
86 }
87 i__1 = *l1;
88 for (k = 1; k <= i__1; ++k) {
89 i__2 = m1d;
90 i__3 = *im1;
91 for (m1 = 1; i__3 < 0 ? m1 >= i__2 : m1 <= i__2; m1 += i__3) {
92 tr2 = cc[(m1 + (k + ((cc_dim4 << 1) + 1) * cc_dim3) * cc_dim2 <<
93 1) + 1] + cc[(m1 + (k + (cc_dim4 * 3 + 1) * cc_dim3) *
94 cc_dim2 << 1) + 1];
95 cr2 = cc[(m1 + (k + (cc_dim4 + 1) * cc_dim3) * cc_dim2 << 1) + 1]
96 + taur * tr2;
97 cc[(m1 + (k + (cc_dim4 + 1) * cc_dim3) * cc_dim2 << 1) + 1] +=
98 tr2;
99 ti2 = cc[(m1 + (k + ((cc_dim4 << 1) + 1) * cc_dim3) * cc_dim2 <<
100 1) + 2] + cc[(m1 + (k + (cc_dim4 * 3 + 1) * cc_dim3) *
101 cc_dim2 << 1) + 2];
102 ci2 = cc[(m1 + (k + (cc_dim4 + 1) * cc_dim3) * cc_dim2 << 1) + 2]
103 + taur * ti2;
104 cc[(m1 + (k + (cc_dim4 + 1) * cc_dim3) * cc_dim2 << 1) + 2] +=
105 ti2;
106 cr3 = taui * (cc[(m1 + (k + ((cc_dim4 << 1) + 1) * cc_dim3) *
107 cc_dim2 << 1) + 1] - cc[(m1 + (k + (cc_dim4 * 3 + 1) *
108 cc_dim3) * cc_dim2 << 1) + 1]);
109 ci3 = taui * (cc[(m1 + (k + ((cc_dim4 << 1) + 1) * cc_dim3) *
110 cc_dim2 << 1) + 2] - cc[(m1 + (k + (cc_dim4 * 3 + 1) *
111 cc_dim3) * cc_dim2 << 1) + 2]);
112 cc[(m1 + (k + ((cc_dim4 << 1) + 1) * cc_dim3) * cc_dim2 << 1) + 1]
113 = cr2 - ci3;
114 cc[(m1 + (k + (cc_dim4 * 3 + 1) * cc_dim3) * cc_dim2 << 1) + 1] =
115 cr2 + ci3;
116 cc[(m1 + (k + ((cc_dim4 << 1) + 1) * cc_dim3) * cc_dim2 << 1) + 2]
117 = ci2 + cr3;
118 cc[(m1 + (k + (cc_dim4 * 3 + 1) * cc_dim3) * cc_dim2 << 1) + 2] =
119 ci2 - cr3;
120/* L101: */
121 }
122 }
123 return 0;
124L102:
125 i__3 = *l1;
126 for (k = 1; k <= i__3; ++k) {
127 m2 = m2s;
128 i__2 = m1d;
129 i__1 = *im1;
130 for (m1 = 1; i__1 < 0 ? m1 >= i__2 : m1 <= i__2; m1 += i__1) {
131 m2 += *im2;
132 tr2 = cc[(m1 + (k + ((cc_dim4 << 1) + 1) * cc_dim3) * cc_dim2 <<
133 1) + 1] + cc[(m1 + (k + (cc_dim4 * 3 + 1) * cc_dim3) *
134 cc_dim2 << 1) + 1];
135 cr2 = cc[(m1 + (k + (cc_dim4 + 1) * cc_dim3) * cc_dim2 << 1) + 1]
136 + taur * tr2;
137 ch[(m2 + (k + (ch_dim3 << 2)) * ch_dim2 << 1) + 1] = cc[(m1 + (k
138 + (cc_dim4 + 1) * cc_dim3) * cc_dim2 << 1) + 1] + tr2;
139 ti2 = cc[(m1 + (k + ((cc_dim4 << 1) + 1) * cc_dim3) * cc_dim2 <<
140 1) + 2] + cc[(m1 + (k + (cc_dim4 * 3 + 1) * cc_dim3) *
141 cc_dim2 << 1) + 2];
142 ci2 = cc[(m1 + (k + (cc_dim4 + 1) * cc_dim3) * cc_dim2 << 1) + 2]
143 + taur * ti2;
144 ch[(m2 + (k + (ch_dim3 << 2)) * ch_dim2 << 1) + 2] = cc[(m1 + (k
145 + (cc_dim4 + 1) * cc_dim3) * cc_dim2 << 1) + 2] + ti2;
146 cr3 = taui * (cc[(m1 + (k + ((cc_dim4 << 1) + 1) * cc_dim3) *
147 cc_dim2 << 1) + 1] - cc[(m1 + (k + (cc_dim4 * 3 + 1) *
148 cc_dim3) * cc_dim2 << 1) + 1]);
149 ci3 = taui * (cc[(m1 + (k + ((cc_dim4 << 1) + 1) * cc_dim3) *
150 cc_dim2 << 1) + 2] - cc[(m1 + (k + (cc_dim4 * 3 + 1) *
151 cc_dim3) * cc_dim2 << 1) + 2]);
152 ch[(m2 + (k + ch_dim3 * 5) * ch_dim2 << 1) + 1] = cr2 - ci3;
153 ch[(m2 + (k + ch_dim3 * 6) * ch_dim2 << 1) + 1] = cr2 + ci3;
154 ch[(m2 + (k + ch_dim3 * 5) * ch_dim2 << 1) + 2] = ci2 + cr3;
155 ch[(m2 + (k + ch_dim3 * 6) * ch_dim2 << 1) + 2] = ci2 - cr3;
156/* L103: */
157 }
158 }
159 if (*ido == 1) {
160 return 0;
161 }
162 i__1 = *ido;
163 for (i__ = 2; i__ <= i__1; ++i__) {
164 i__2 = *l1;
165 for (k = 1; k <= i__2; ++k) {
166 m2 = m2s;
167 i__3 = m1d;
168 i__4 = *im1;
169 for (m1 = 1; i__4 < 0 ? m1 >= i__3 : m1 <= i__3; m1 += i__4) {
170 m2 += *im2;
171 tr2 = cc[(m1 + (k + (i__ + (cc_dim4 << 1)) * cc_dim3) *
172 cc_dim2 << 1) + 1] + cc[(m1 + (k + (i__ + cc_dim4 * 3)
173 * cc_dim3) * cc_dim2 << 1) + 1];
174 cr2 = cc[(m1 + (k + (i__ + cc_dim4) * cc_dim3) * cc_dim2 << 1)
175 + 1] + taur * tr2;
176 ch[(m2 + (k + (i__ * 3 + 1) * ch_dim3) * ch_dim2 << 1) + 1] =
177 cc[(m1 + (k + (i__ + cc_dim4) * cc_dim3) * cc_dim2 <<
178 1) + 1] + tr2;
179 ti2 = cc[(m1 + (k + (i__ + (cc_dim4 << 1)) * cc_dim3) *
180 cc_dim2 << 1) + 2] + cc[(m1 + (k + (i__ + cc_dim4 * 3)
181 * cc_dim3) * cc_dim2 << 1) + 2];
182 ci2 = cc[(m1 + (k + (i__ + cc_dim4) * cc_dim3) * cc_dim2 << 1)
183 + 2] + taur * ti2;
184 ch[(m2 + (k + (i__ * 3 + 1) * ch_dim3) * ch_dim2 << 1) + 2] =
185 cc[(m1 + (k + (i__ + cc_dim4) * cc_dim3) * cc_dim2 <<
186 1) + 2] + ti2;
187 cr3 = taui * (cc[(m1 + (k + (i__ + (cc_dim4 << 1)) * cc_dim3)
188 * cc_dim2 << 1) + 1] - cc[(m1 + (k + (i__ + cc_dim4 *
189 3) * cc_dim3) * cc_dim2 << 1) + 1]);
190 ci3 = taui * (cc[(m1 + (k + (i__ + (cc_dim4 << 1)) * cc_dim3)
191 * cc_dim2 << 1) + 2] - cc[(m1 + (k + (i__ + cc_dim4 *
192 3) * cc_dim3) * cc_dim2 << 1) + 2]);
193 dr2 = cr2 - ci3;
194 dr3 = cr2 + ci3;
195 di2 = ci2 + cr3;
196 di3 = ci2 - cr3;
197 ch[(m2 + (k + (i__ * 3 + 2) * ch_dim3) * ch_dim2 << 1) + 2] =
198 wa[i__ + wa_dim1 * 3] * di2 + wa[i__ + wa_dim1 * 5] *
199 dr2;
200 ch[(m2 + (k + (i__ * 3 + 2) * ch_dim3) * ch_dim2 << 1) + 1] =
201 wa[i__ + wa_dim1 * 3] * dr2 - wa[i__ + wa_dim1 * 5] *
202 di2;
203 ch[(m2 + (k + (i__ * 3 + 3) * ch_dim3) * ch_dim2 << 1) + 2] =
204 wa[i__ + (wa_dim1 << 2)] * di3 + wa[i__ + wa_dim1 * 6]
205 * dr3;
206 ch[(m2 + (k + (i__ * 3 + 3) * ch_dim3) * ch_dim2 << 1) + 1] =
207 wa[i__ + (wa_dim1 << 2)] * dr3 - wa[i__ + wa_dim1 * 6]
208 * di3;
209/* L104: */
210 }
211 }
212/* L105: */
213 }
214 return 0;
215} /* cmf3kb_ */
216