PLaSK library
Loading...
Searching...
No Matches
r1f3kb.c
Go to the documentation of this file.
1/* r1f3kb.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 r1f3kb_(integer *ido, integer *l1, doublereal *cc,
46 integer *in1, doublereal *ch, integer *in2, doublereal *wa1,
47 doublereal *wa2)
48{
49 /* System generated locals */
50 integer cc_dim1, cc_dim2, cc_offset, ch_dim1, ch_dim2, ch_dim3, ch_offset,
51 i__1, i__2;
52
53 /* Builtin functions */
54 double atan(doublereal), cos(doublereal), sin(doublereal);
55
56 /* Local variables */
57 integer i__, k, ic;
58 doublereal arg;
59 integer idp2;
60 doublereal taui, taur;
61
62
63 /* Parameter adjustments */
64 --wa2;
65 --wa1;
66 cc_dim1 = *in1;
67 cc_dim2 = *ido;
68 cc_offset = 1 + cc_dim1 * (1 + (cc_dim2 << 2));
69 cc -= cc_offset;
70 ch_dim1 = *in2;
71 ch_dim2 = *ido;
72 ch_dim3 = *l1;
73 ch_offset = 1 + ch_dim1 * (1 + ch_dim2 * (1 + ch_dim3));
74 ch -= ch_offset;
75
76 /* Function Body */
77 arg = atan(1.) * 8. / 3.;
78 taur = cos(arg);
79 taui = sin(arg);
80 i__1 = *l1;
81 for (k = 1; k <= i__1; ++k) {
82 ch[((k + ch_dim3) * ch_dim2 + 1) * ch_dim1 + 1] = cc[((k * 3 + 1) *
83 cc_dim2 + 1) * cc_dim1 + 1] + cc[(*ido + (k * 3 + 2) *
84 cc_dim2) * cc_dim1 + 1] * 2.;
85 ch[((k + (ch_dim3 << 1)) * ch_dim2 + 1) * ch_dim1 + 1] = cc[((k * 3 +
86 1) * cc_dim2 + 1) * cc_dim1 + 1] + taur * 2. * cc[(*ido + (k *
87 3 + 2) * cc_dim2) * cc_dim1 + 1] - taui * 2. * cc[((k * 3 +
88 3) * cc_dim2 + 1) * cc_dim1 + 1];
89 ch[((k + ch_dim3 * 3) * ch_dim2 + 1) * ch_dim1 + 1] = cc[((k * 3 + 1)
90 * cc_dim2 + 1) * cc_dim1 + 1] + taur * 2. * cc[(*ido + (k * 3
91 + 2) * cc_dim2) * cc_dim1 + 1] + taui * 2. * cc[((k * 3 + 3) *
92 cc_dim2 + 1) * cc_dim1 + 1];
93/* L101: */
94 }
95 if (*ido == 1) {
96 return 0;
97 }
98 idp2 = *ido + 2;
99 i__1 = *l1;
100 for (k = 1; k <= i__1; ++k) {
101 i__2 = *ido;
102 for (i__ = 3; i__ <= i__2; i__ += 2) {
103 ic = idp2 - i__;
104 ch[(i__ - 1 + (k + ch_dim3) * ch_dim2) * ch_dim1 + 1] = cc[(i__ -
105 1 + (k * 3 + 1) * cc_dim2) * cc_dim1 + 1] + (cc[(i__ - 1
106 + (k * 3 + 3) * cc_dim2) * cc_dim1 + 1] + cc[(ic - 1 + (k
107 * 3 + 2) * cc_dim2) * cc_dim1 + 1]);
108 ch[(i__ + (k + ch_dim3) * ch_dim2) * ch_dim1 + 1] = cc[(i__ + (k *
109 3 + 1) * cc_dim2) * cc_dim1 + 1] + (cc[(i__ + (k * 3 + 3)
110 * cc_dim2) * cc_dim1 + 1] - cc[(ic + (k * 3 + 2) *
111 cc_dim2) * cc_dim1 + 1]);
112 ch[(i__ - 1 + (k + (ch_dim3 << 1)) * ch_dim2) * ch_dim1 + 1] =
113 wa1[i__ - 2] * (cc[(i__ - 1 + (k * 3 + 1) * cc_dim2) *
114 cc_dim1 + 1] + taur * (cc[(i__ - 1 + (k * 3 + 3) *
115 cc_dim2) * cc_dim1 + 1] + cc[(ic - 1 + (k * 3 + 2) *
116 cc_dim2) * cc_dim1 + 1]) - taui * (cc[(i__ + (k * 3 + 3) *
117 cc_dim2) * cc_dim1 + 1] + cc[(ic + (k * 3 + 2) * cc_dim2)
118 * cc_dim1 + 1])) - wa1[i__ - 1] * (cc[(i__ + (k * 3 + 1)
119 * cc_dim2) * cc_dim1 + 1] + taur * (cc[(i__ + (k * 3 + 3)
120 * cc_dim2) * cc_dim1 + 1] - cc[(ic + (k * 3 + 2) *
121 cc_dim2) * cc_dim1 + 1]) + taui * (cc[(i__ - 1 + (k * 3 +
122 3) * cc_dim2) * cc_dim1 + 1] - cc[(ic - 1 + (k * 3 + 2) *
123 cc_dim2) * cc_dim1 + 1]));
124 ch[(i__ + (k + (ch_dim3 << 1)) * ch_dim2) * ch_dim1 + 1] = wa1[
125 i__ - 2] * (cc[(i__ + (k * 3 + 1) * cc_dim2) * cc_dim1 +
126 1] + taur * (cc[(i__ + (k * 3 + 3) * cc_dim2) * cc_dim1 +
127 1] - cc[(ic + (k * 3 + 2) * cc_dim2) * cc_dim1 + 1]) +
128 taui * (cc[(i__ - 1 + (k * 3 + 3) * cc_dim2) * cc_dim1 +
129 1] - cc[(ic - 1 + (k * 3 + 2) * cc_dim2) * cc_dim1 + 1]))
130 + wa1[i__ - 1] * (cc[(i__ - 1 + (k * 3 + 1) * cc_dim2) *
131 cc_dim1 + 1] + taur * (cc[(i__ - 1 + (k * 3 + 3) *
132 cc_dim2) * cc_dim1 + 1] + cc[(ic - 1 + (k * 3 + 2) *
133 cc_dim2) * cc_dim1 + 1]) - taui * (cc[(i__ + (k * 3 + 3) *
134 cc_dim2) * cc_dim1 + 1] + cc[(ic + (k * 3 + 2) * cc_dim2)
135 * cc_dim1 + 1]));
136 ch[(i__ - 1 + (k + ch_dim3 * 3) * ch_dim2) * ch_dim1 + 1] = wa2[
137 i__ - 2] * (cc[(i__ - 1 + (k * 3 + 1) * cc_dim2) *
138 cc_dim1 + 1] + taur * (cc[(i__ - 1 + (k * 3 + 3) *
139 cc_dim2) * cc_dim1 + 1] + cc[(ic - 1 + (k * 3 + 2) *
140 cc_dim2) * cc_dim1 + 1]) + taui * (cc[(i__ + (k * 3 + 3) *
141 cc_dim2) * cc_dim1 + 1] + cc[(ic + (k * 3 + 2) * cc_dim2)
142 * cc_dim1 + 1])) - wa2[i__ - 1] * (cc[(i__ + (k * 3 + 1)
143 * cc_dim2) * cc_dim1 + 1] + taur * (cc[(i__ + (k * 3 + 3)
144 * cc_dim2) * cc_dim1 + 1] - cc[(ic + (k * 3 + 2) *
145 cc_dim2) * cc_dim1 + 1]) - taui * (cc[(i__ - 1 + (k * 3 +
146 3) * cc_dim2) * cc_dim1 + 1] - cc[(ic - 1 + (k * 3 + 2) *
147 cc_dim2) * cc_dim1 + 1]));
148 ch[(i__ + (k + ch_dim3 * 3) * ch_dim2) * ch_dim1 + 1] = wa2[i__ -
149 2] * (cc[(i__ + (k * 3 + 1) * cc_dim2) * cc_dim1 + 1] +
150 taur * (cc[(i__ + (k * 3 + 3) * cc_dim2) * cc_dim1 + 1] -
151 cc[(ic + (k * 3 + 2) * cc_dim2) * cc_dim1 + 1]) - taui * (
152 cc[(i__ - 1 + (k * 3 + 3) * cc_dim2) * cc_dim1 + 1] - cc[(
153 ic - 1 + (k * 3 + 2) * cc_dim2) * cc_dim1 + 1])) + wa2[
154 i__ - 1] * (cc[(i__ - 1 + (k * 3 + 1) * cc_dim2) *
155 cc_dim1 + 1] + taur * (cc[(i__ - 1 + (k * 3 + 3) *
156 cc_dim2) * cc_dim1 + 1] + cc[(ic - 1 + (k * 3 + 2) *
157 cc_dim2) * cc_dim1 + 1]) + taui * (cc[(i__ + (k * 3 + 3) *
158 cc_dim2) * cc_dim1 + 1] + cc[(ic + (k * 3 + 2) * cc_dim2)
159 * cc_dim1 + 1]));
160/* L102: */
161 }
162/* L103: */
163 }
164 return 0;
165} /* r1f3kb_ */
166