-
Notifications
You must be signed in to change notification settings - Fork 0
/
dpush2_f.c
396 lines (322 loc) · 15 KB
/
dpush2_f.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
/* C Library for Skeleton 2-1/2D Darwin PIC Code */
/* Wrappers for calling the Fortran routines from a C main program */
#include <complex.h>
double ranorm_();
double randum_();
void distr2h_(float *part, float *vtx, float *vty, float *vtz,
float *vdx, float *vdy, float *vdz, int *npx, int *npy,
int *idimp, int *nop, int *nx, int *ny, int *ipbc);
void gbpush23l_(float *part, float *fxy, float *bxy, float *qbm,
float *dt, float *dtc, float *ek, int *idimp, int *nop,
int *nx, int *ny, int *nxv, int *nyv, int *ipbc);
void gpost2l_(float *part, float *q, float *qm, int *nop, int *idimp,
int *nxv, int *nyv);
void gjpost2l_(float *part, float *cu, float *qm, float *dt, int *nop,
int *idimp, int *nx, int *ny, int *nxv, int *nyv,
int *ipbc);
void gmjpost2l_(float *part, float *amu, float *qm, int *nop,
int *idimp, int *nxv, int *nyv);
void gdjpost2l_(float *part, float *fxy, float *bxy, float *dcu,
float *amu, float *qm, float *qbm, float *dt,
int *idimp, int *nop, int *nxv, int *nyv);
void gdcjpost2l_(float *part, float *fxy, float *bxy, float *cu,
float *dcu, float *amu, float *qm, float *qbm,
float *dt, int *idimp, int *nop, int *nxv, int *nyv);
void dsortp2yl_(float *parta, float *partb, int *npic, int *idimp,
int *nop, int *ny1);
void bguard2l_(float *bxy, int *nx, int *ny, int *nxe, int *nye);
void acguard2l_(float *cu, int *nx, int *ny, int *nxe, int *nye);
void aguard2l_(float *q, int *nx, int *ny, int *nxe, int *nye);
void amcguard2l_(float *amu, int *nx, int *ny, int *nxe, int *nye,
int *ndim);
void scfguard2l_(float *cus, float *cu, float *q2m0, int *nx, int *ny,
int *nxe, int *nye);
void ascfguard2l_(float *dcu, float *cus, float *q2m0, int *nx, int *ny,
int *nxe, int *nye);
void fwpminmx2_(float *qe, float *qbme, float *wpmax, float *wpmin,
int *nx, int *ny, int *nxe, int *nye);
void pois23_(float complex *q, float complex *fxy, int *isign,
float complex *ffc, float *ax, float *ay, float *affp,
float *we, int *nx, int *ny, int *nxvh, int *nyv,
int *nxhd, int *nyhd);
void cuperp2_(float complex *cu, int *nx, int *ny, int *nxvh, int *nyv);
void bbpois23_(float complex *cu, float complex *bxy,
float complex *ffc, float *ci, float *wm, int *nx,
int *ny, int *nxvh, int *nyv, int *nxhd, int *nyhd);
void baddext2_(float *bxy, float *omx, float *omy, float *omz, int *nx,
int *ny, int *nxe, int *nye);
void dcuperp23_(float complex *dcu, float complex *amu, int *nx,
int *ny, int *nxvh, int *nyv);
void adcuperp23_(float complex *dcu, float complex *amu, int *nx,
int *ny, int *nxvh, int *nyv);
void epois23_(float complex *dcu, float complex *exy, int *isign,
float complex *ffe, float *ax, float *ay, float *affp,
float *wp0, float *ci, float *wf, int *nx, int *ny,
int *nxvh, int *nyv, int *nxhd, int *nyhd);
void addvrfield2_(float *a, float *b, float *c, int *ndim, int *nxe,
int *nye);
void wfft2rinit_(int *mixup, float complex *sct, int *indx, int *indy,
int *nxhyd, int *nxyhd);
void fft2rxx_(float complex *f, int *isign, int *mixup, float complex *sct,
int *indx, int *indy, int *nyi, int *nyp, int *nxhd,
int *nyd, int *nxhyd, int *nxyhd);
void fft2rxy_(float complex *f, int *isign, int *mixup, float complex *sct,
int *indx, int *indy, int *nxi, int *nxp, int *nxhd,
int *nyd, int *nxhyd, int *nxyhd);
void fft2r3x_(float complex *f, int *isign, int *mixup, float complex *sct,
int *indx, int *indy, int *nyi, int *nyp, int *nxhd,
int *nyd, int *nxhyd, int *nxyhd);
void fft2r3y_(float complex *f, int *isign, int *mixup, float complex *sct,
int *indx, int *indy, int *nxi, int *nxp, int *nxhd,
int *nyd, int *nxhyd, int *nxyhd);
void fft2rnx_(float complex *f, float complex *ss, int *isign,
int *mixup, float complex *sct, int *indx, int *indy,
int *nyi, int *nyp, int *nxhd, int *nyd, int *ndim,
int *nxhyd, int *nxyhd);
void fft2rny_(float complex *f, int *isign, int *mixup,
float complex *sct, int *indx, int *indy, int *nxi,
int *nxp, int *nxhd, int *nyd, int *ndim, int *nxhyd,
int *nxyhd);
void wfft2rx_(float complex *f, int *isign, int *mixup,
float complex *sct, int *indx, int *indy, int *nxhd,
int *nyd, int *nxhyd, int *nxyhd);
void wfft2r3_(float complex *f, int *isign, int *mixup,
float complex *sct, int *indx, int *indy, int *nxhd,
int *nyd, int *nxhyd, int *nxyhd);
void wfft2rn_(float complex *f, float complex *ss, int *isign,
int *mixup, float complex *sct, int *indx, int *indy,
int *nxhd, int *nyd, int *ndim, int *nxhyd, int *nxyhd);
void swapc2n_(float *f, float *s, int *isign, int *nxh, int *nyi,
int *nyt, int *nxhd, int *nyd, int *ndim);
/* Interfaces to C */
double ranorm() {
return ranorm_();
}
double randum() {
return randum_();
}
/*--------------------------------------------------------------------*/
void cdistr2h(float part[], float vtx, float vty, float vtz, float vdx,
float vdy, float vdz, int npx, int npy, int idimp, int nop,
int nx, int ny, int ipbc) {
distr2h_(part,&vtx,&vty,&vtz,&vdx,&vdy,&vdz,&npx,&npy,&idimp,&nop,
&nx,&ny,&ipbc);
return;
}
/*--------------------------------------------------------------------*/
void cgbpush23l(float part[], float fxy[], float bxy[], float qbm,
float dt, float dtc, float *ek, int idimp, int nop,
int nx, int ny, int nxv, int nyv, int ipbc) {
gbpush23l_(part,fxy,bxy,&qbm,&dt,&dtc,ek,&idimp,&nop,&nx,&ny,&nxv,
&nyv,&ipbc);
return;
}
/*--------------------------------------------------------------------*/
void cgpost2l(float part[], float q[], float qm, int nop, int idimp,
int nxv, int nyv) {
gpost2l_(part,q,&qm,&nop,&idimp,&nxv,&nyv);
return;
}
/*--------------------------------------------------------------------*/
void cgjpost2l(float part[], float cu[], float qm, float dt, int nop,
int idimp, int nx, int ny, int nxv, int nyv, int ipbc) {
gjpost2l_(part,cu,&qm,&dt,&nop,&idimp,&nx,&ny,&nxv,&nyv,&ipbc);
return;
}
/*--------------------------------------------------------------------*/
void cgmjpost2l(float part[], float amu[], float qm, int nop, int idimp,
int nxv, int nyv) {
gmjpost2l_(part,amu,&qm,&nop,&idimp,&nxv,&nyv);
return;
}
/*--------------------------------------------------------------------*/
void cgdjpost2l(float part[], float fxy[], float bxy[], float dcu[],
float amu[], float qm, float qbm, float dt, int idimp,
int nop, int nxv, int nyv) {
gdjpost2l_(part,fxy,bxy,dcu,amu,&qm,&qbm,&dt,&idimp,&nop,&nxv,&nyv);
return;
}
/*--------------------------------------------------------------------*/
void cgdcjpost2l(float part[], float fxy[], float bxy[], float cu[],
float dcu[], float amu[], float qm, float qbm,
float dt, int idimp, int nop, int nxv, int nyv) {
gdcjpost2l_(part,fxy,bxy,cu,dcu,amu,&qm,&qbm,&dt,&idimp,&nop,&nxv,
&nyv);
return;
}
/*--------------------------------------------------------------------*/
void cdsortp2yl(float parta[], float partb[], int npic[], int idimp,
int nop, int ny1) {
dsortp2yl_(parta,partb,npic,&idimp,&nop,&ny1);
return;
}
/*--------------------------------------------------------------------*/
void cbguard2l(float bxy[], int nx, int ny, int nxe, int nye) {
bguard2l_(bxy,&nx,&ny,&nxe,&nye);
return;
}
/*--------------------------------------------------------------------*/
void cacguard2l(float cu[], int nx, int ny, int nxe, int nye) {
acguard2l_(cu,&nx,&ny,&nxe,&nye);
return;
}
/*--------------------------------------------------------------------*/
void caguard2l(float q[], int nx, int ny, int nxe, int nye) {
aguard2l_(q,&nx,&ny,&nxe,&nye);
return;
}
/*--------------------------------------------------------------------*/
void camcguard2l(float amu[], int nx, int ny, int nxe, int nye,
int ndim) {
amcguard2l_(amu,&nx,&ny,&nxe,&nye,&ndim);
return;
}
/*--------------------------------------------------------------------*/
void cascfguard2l(float dcu[], float cus[], float q2m0, int nx, int ny,
int nxe, int nye) {
ascfguard2l_(dcu,cus,&q2m0,&nx,&ny,&nxe,&nye);
return;
}
/*--------------------------------------------------------------------*/
void cfwpminmx2(float qe[], float qbme, float *wpmax, float *wpmin,
int nx, int ny, int nxe, int nye) {
fwpminmx2_(qe,&qbme,wpmax,wpmin,&nx,&ny,&nxe,&nye);
return;
}
/*--------------------------------------------------------------------*/
void cpois23(float complex q[], float complex fxy[], int isign,
float complex ffc[], float ax, float ay, float affp,
float *we, int nx, int ny, int nxvh, int nyv, int nxhd,
int nyhd) {
pois23_(q,fxy,&isign,ffc,&ax,&ay,&affp,we,&nx,&ny,&nxvh,&nyv,&nxhd,
&nyhd);
return;
}
/*--------------------------------------------------------------------*/
void ccuperp2(float complex cu[], int nx, int ny, int nxvh, int nyv) {
cuperp2_(cu,&nx,&ny,&nxvh,&nyv);
return;
}
/*--------------------------------------------------------------------*/
void cbbpois23(float complex cu[], float complex bxy[],
float complex ffc[], float ci, float *wm, int nx, int ny,
int nxvh, int nyv, int nxhd, int nyhd) {
bbpois23_(cu,bxy,ffc,&ci,wm,&nx,&ny,&nxvh,&nyv,&nxhd,&nyhd);
return;
}
/*--------------------------------------------------------------------*/
void cbaddext2(float bxy[], float omx, float omy, float omz, int nx,
int ny, int nxe, int nye) {
baddext2_(bxy,&omx,&omy,&omz,&nx,&ny,&nxe,&nye);
return;
}
/*--------------------------------------------------------------------*/
void cdcuperp23(float complex dcu[], float complex amu[], int nx,
int ny, int nxvh, int nyv) {
dcuperp23_(dcu,amu,&nx,&ny,&nxvh,&nyv);
return;
}
/*--------------------------------------------------------------------*/
void cadcuperp23(float complex dcu[], float complex amu[], int nx,
int ny, int nxvh, int nyv) {
adcuperp23_(dcu,amu,&nx,&ny,&nxvh,&nyv);
return;
}
/*--------------------------------------------------------------------*/
void cepois23(float complex dcu[], float complex exy[], int isign,
float complex ffe[], float ax, float ay, float affp,
float wp0, float ci, float *wf, int nx, int ny, int nxvh,
int nyv, int nxhd, int nyhd) {
epois23_(dcu,exy,&isign,ffe,&ax,&ay,&affp,&wp0,&ci,wf,&nx,&ny,&nxvh,
&nyv,&nxhd,&nyhd);
return;
}
/*--------------------------------------------------------------------*/
void caddvrfield2(float a[], float b[], float c[], int ndim, int nxe,
int nye) {
addvrfield2_(a,b,c,&ndim,&nxe,&nye);
return;
}
/*--------------------------------------------------------------------*/
void cwfft2rinit(int mixup[], float complex sct[], int indx, int indy,
int nxhyd, int nxyhd) {
wfft2rinit_(mixup,sct,&indx,&indy,&nxhyd,&nxyhd);
return;
}
/*--------------------------------------------------------------------*/
void cfft2rxx(float complex f[], int isign, int mixup[],
float complex sct[], int indx, int indy, int nyi, int nyp,
int nxhd, int nyd, int nxhyd, int nxyhd) {
fft2rxx_(f,&isign, mixup,sct,&indx,&indy,&nyi,&nyp,&nxhd,&nyd,&nxhyd,
&nxyhd);
return;
}
/*--------------------------------------------------------------------*/
void cfft2rxy(float complex f[], int isign, int mixup[],
float complex sct[], int indx, int indy, int nxi, int nxp,
int nxhd, int nyd, int nxhyd, int nxyhd) {
fft2rxy_(f,&isign,mixup,sct,&indx,&indy,&nxi,&nxp,&nxhd,&nyd,&nxhyd,
&nxyhd);
return;
}
/*--------------------------------------------------------------------*/
void cfft2r3x(float complex f[], int isign, int mixup[],
float complex sct[], int indx, int indy, int nyi, int nyp,
int nxhd, int nyd, int nxhyd, int nxyhd) {
fft2r3x_(f,&isign,mixup,sct,&indx,&indy,&nyi,&nyp,&nxhd,&nyd,&nxhyd,
&nxyhd);
return;
}
/*--------------------------------------------------------------------*/
void cfft2r3y(float complex f[], int isign, int mixup[],
float complex sct[], int indx, int indy, int nxi, int nxp,
int nxhd, int nyd, int nxhyd, int nxyhd) {
fft2r3y_(f,&isign, mixup,sct,&indx,&indy,&nxi,&nxp,&nxhd,&nyd,&nxhyd,
&nxyhd);
return;
}
/*--------------------------------------------------------------------*/
void cfft2rnx(float complex f[], float complex ss[], int isign,
int mixup[], float complex sct[], int indx, int indy,
int nyi, int nyp, int nxhd, int nyd, int ndim, int nxhyd,
int nxyhd) {
fft2rnx_(f,ss,&isign,mixup,sct,&indx,&indy,&nyi,&nyp,&nxhd,&nyd,
&ndim,&nxhyd,&nxyhd);
return;
}
/*--------------------------------------------------------------------*/
void cfft2rny(float complex f[], int isign, int mixup[],
float complex sct[], int indx, int indy, int nxi, int nxp,
int nxhd, int nyd, int ndim, int nxhyd, int nxyhd) {
fft2rny_(f,&isign,mixup,sct,&indx,&indy,&nxi,&nxp,&nxhd,&nyd,&ndim,
&nxhyd,&nxyhd);
return;
}
/*--------------------------------------------------------------------*/
void cwfft2rx(float complex f[], int isign, int mixup[],
float complex sct[], int indx, int indy, int nxhd, int nyd,
int nxhyd, int nxyhd) {
wfft2rx_(f,&isign,mixup,sct,&indx,&indy,&nxhd,&nyd,&nxhyd,&nxyhd);
return;
}
/*--------------------------------------------------------------------*/
void cwfft2r3(float complex f[],int isign, int mixup[],
float complex sct[], int indx, int indy, int nxhd, int nyd,
int nxhyd, int nxyhd) {
wfft2r3_(f,&isign,mixup,sct,&indx,&indy,&nxhd,&nyd,&nxhyd,&nxyhd);
return;
}
/*--------------------------------------------------------------------*/
void cwfft2rn(float complex f[], float complex ss[], int isign,
int mixup[], float complex sct[], int indx, int indy,
int nxhd, int nyd, int ndim, int nxhyd, int nxyhd) {
wfft2rn_(f,ss,&isign,mixup,sct,&indx,&indy,&nxhd,&nyd,&ndim,&nxhyd,
&nxyhd);
return;
}
/*--------------------------------------------------------------------*/
void cswapc2n(float f[], float s[], int isign, int nxh, int nyi,
int nyt, int nxhd, int nyd, int ndim) {
swapc2n_(f,s,&isign,&nxh,&nyi,&nyt,&nxhd,&nyd,&ndim);
return;
}