PLaSK library
Loading...
Searching...
No Matches
mrfti1.c
Go to the documentation of this file.
1/* mrfti1.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 mrfti1_(integer *n, doublereal *wa, doublereal *fac)
46{
47 /* Initialized data */
48
49 static integer ntryh[4] = { 4,2,3,5 };
50
51 /* System generated locals */
52 integer i__1, i__2, i__3;
53
54 /* Builtin functions */
55 double atan(doublereal), cos(doublereal), sin(doublereal);
56
57 /* Local variables */
58 integer i__, j, k1, l1, l2, ib;
59 doublereal fi;
60 integer ld, ii, nf, ip, nl, is, nq, nr;
61 doublereal arg;
62 integer ido, ipm;
63 doublereal tpi;
64 integer nfm1;
65 doublereal argh;
66 integer ntry;
67 doublereal argld;
68
69 /* Parameter adjustments */
70 --wa;
71 --fac;
72
73 /* Function Body */
74
75 nl = *n;
76 nf = 0;
77 j = 0;
78L101:
79 ++j;
80 if (j - 4 <= 0) {
81 goto L102;
82 } else {
83 goto L103;
84 }
85L102:
86 ntry = ntryh[j - 1];
87 goto L104;
88L103:
89 ntry += 2;
90L104:
91 nq = nl / ntry;
92 nr = nl - ntry * nq;
93 if (nr != 0) {
94 goto L101;
95 } else {
96 goto L105;
97 }
98L105:
99 ++nf;
100 fac[nf + 2] = (doublereal) ntry;
101 nl = nq;
102 if (ntry != 2) {
103 goto L107;
104 }
105 if (nf == 1) {
106 goto L107;
107 }
108 i__1 = nf;
109 for (i__ = 2; i__ <= i__1; ++i__) {
110 ib = nf - i__ + 2;
111 fac[ib + 2] = fac[ib + 1];
112/* L106: */
113 }
114 fac[3] = 2.;
115L107:
116 if (nl != 1) {
117 goto L104;
118 }
119 fac[1] = (doublereal) (*n);
120 fac[2] = (doublereal) nf;
121 tpi = atan(1.) * 8.;
122 argh = tpi / (doublereal) (*n);
123 is = 0;
124 nfm1 = nf - 1;
125 l1 = 1;
126 if (nfm1 == 0) {
127 return 0;
128 }
129 i__1 = nfm1;
130 for (k1 = 1; k1 <= i__1; ++k1) {
131 ip = (integer) fac[k1 + 2];
132 ld = 0;
133 l2 = l1 * ip;
134 ido = *n / l2;
135 ipm = ip - 1;
136 i__2 = ipm;
137 for (j = 1; j <= i__2; ++j) {
138 ld += l1;
139 i__ = is;
140 argld = (doublereal) ld * argh;
141 fi = 0.;
142 i__3 = ido;
143 for (ii = 3; ii <= i__3; ii += 2) {
144 i__ += 2;
145 fi += 1.;
146 arg = fi * argld;
147 wa[i__ - 1] = cos(arg);
148 wa[i__] = sin(arg);
149/* L108: */
150 }
151 is += ido;
152/* L109: */
153 }
154 l1 = l2;
155/* L110: */
156 }
157 return 0;
158} /* mrfti1_ */
159