-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpfft2mod.f
2157 lines (2156 loc) · 84.8 KB
/
pfft2mod.f
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
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
!-----------------------------------------------------------------------
!
module pfft2d
!
! Fortran90 interface to 2d parallel PIC Fortran77 library pfft2lib.f
! pfft2mod.f contains interface procedures to perform ffts:
! defines module pfft2d
! fft_init => iwpfft2rinit initializes 2d real to complex fft tables.
! calls WPFFT2RINIT
! fft => iwpfft2r performs 2d scalar real to complex fft and its inverse
! calls WPFFT2R
! fft => iwpfft2r2 performs 2d vector complex to real fft for 2
! component vectors.
! calls WPFFT2R2
! fft => iwpfft2r3 performs 2d vector real to complex fft for 1, 2, or 3
! component vectors and their inverses.
! calls WPFFT2R, WPFFT2R2, or WPFFT2R3
! fft => ipfft2c performs 2d scalar complex to complex fft and its
! inverse.
! calls PFFT2C
! fftn => iwpfft2rn perform 2d vector real to complex fft for n
! component vectors and their inverses.
! calls WPFFT2RN
! fftn => iwp1fft2rn performs 2d real to complex fft for a scalar and n
! component vector and their inverses.
! calls WP2FFT2RN
! fftn => iwp2fft2rn perform 2d real to complex fft for two n component
! vectors and their inverses.
! calls WP2FFT2RN
! fftc_init => ipfft2cinit initializes 2d complex to complex fft tables.
! calls PFFT2C
! fst_init => iwfst2rinit initializes 2d real sine-cosine transform.
! tables.
! calls WPFST2RINIT
! fsst => iwpfsst2r performs 2d scalar real sine-sine transform.
! calls WPFSST2R
! fcct => iwpfcct2r performs 2d scalar real cosine-cosine transform.
! calls WPFCCT2R
! fcst => iwpfcst2r3 performs 2d vector real cosine-sine transforms
! transforms for 2 or 3 component vector arrays.
! calls WPFCST2R2, or WPFCST2R3
! fsct => iwpfsct2r3 perform 2d vector real sine-cosine transforms
! for 2 or 3 component vector arrays.
! calls WPFSCT2R2, or WPFSCT2R3
! fsft => iwpfsft2r performs 2d scalar real sine/periodic transform.
! calls WPFSFT2R
! fcft => iwpfcft2r performs 2d scalar real cosine/periodic transform.
! calls WPFCFT2R
! fcsft => iwpfcsft2r3 performs 2d vector real cosine-sine/periodic
! transforms for 2 or 3 component vector arrays.
! calls WPFCSFT2R2, or WPFCSFT2R3
! fscft => iwpfscft2r3 performs 2d vector real sine-cosine/periodic
! transforms for 2 or 3 component vector arrays.
! calls WPFSCFT2R2, or WPFSCFT2R3
! fdt_init => iwpfdt2rinit initializes 2d real half sine-cosine/periodic
! transform tables.
! calls WFDT2RINIT
! fdsft => iwpfdsft2rx performs 2d scalar real half sine/periodic
! transform.
! calls WPFDSFT2RX
! fdcft => iwpfdcft2rx performs 2d scalar real half cosine/periodic
! transform.
! calls WPFDCFT2RX
! fdcsft => iwpfdcsft2r3 performs 2d vector real half
! cosine-sine/periodic transforms for 2 or 3 component vector
! arrays.
! calls WPFDCSFT2R2, or WPFDCSFT2R3
! fdscft => iwpfdscft2r3 performs 2d vector real half
! sine-cosine/periodic transforms for 2 or 3 component vector
! arrays.
! calls WPFDSCFT2R2, or WPFDSCFT2R3
! written by viktor k. decyk, ucla
! copyright 2000, regents of the university of california
! update: december 12, 2009
!
use globals, only: LINEAR, QUADRATIC
use p0d, only: wtimer
implicit none
private
public :: LINEAR, QUADRATIC
public :: wtimer
public :: fft_init, fft, fftn, fftc_init
public :: fst_init, fsst, fcct, fcst, fsct
public :: fsft, fcft, fcsft, fscft
public :: fdt_init, fdsft, fdcft, fdcsft, fdscft
!
! buffer data for transpose
complex, dimension(:,:,:,:), allocatable :: bs, br
integer :: szbuf = 0
save
!
! define interface to original Fortran77 procedures
!
interface
subroutine PFFT2R(f,g,bs,br,isign,ntpose,mixup,sct,indx,indy,ks&
&trt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp, kyp, kypd, jblok, kblok, nxhyd, nxyhd
real :: f
complex, dimension(nyv,kxp,jblok) :: g
complex, dimension(kxp,kyp,kblok) :: bs
complex, dimension(kxp,kyp,jblok) :: br
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyhd) :: sct
end subroutine
end interface
interface
subroutine PFFT2R2(f,g,bs,br,isign,ntpose,mixup,sct,indx,indy,k&
&strt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp, kyp, kypd, jblok, kblok, nxhyd, nxyhd
real :: f
complex, dimension(2,nyv,kxp,jblok) :: g
complex, dimension(2,kxp,kyp,kblok) :: bs
complex, dimension(2,kxp,kyp,jblok) :: br
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyhd) :: sct
end subroutine
end interface
interface
subroutine PFFT2R3(f,g,bs,br,isign,ntpose,mixup,sct,indx,indy,k&
&strt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp, kyp, kypd, jblok, kblok, nxhyd, nxyhd
real :: f
complex, dimension(3,nyv,kxp,jblok) :: g
complex, dimension(3,kxp,kyp,kblok) :: bs
complex, dimension(3,kxp,kyp,jblok) :: br
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyhd) :: sct
end subroutine
end interface
interface
subroutine PFFT2RX(f,g,isign,ntpose,mixup,sct,indx,indy,kstrt,n&
&xvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp, kyp, kypd, jblok, kblok, nxhyd, nxyhd
real :: f
complex, dimension(nyv,kxp,jblok) :: g
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyhd) :: sct
end subroutine
end interface
interface
subroutine PFFT2RX2(f,g,isign,ntpose,mixup,sct,indx,indy,kstrt,&
&nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp, kyp, kypd, jblok, kblok, nxhyd, nxyhd
real :: f
complex, dimension(2,nyv,kxp,jblok) :: g
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyhd) :: sct
end subroutine
end interface
interface
subroutine PFFT2RX3(f,g,isign,ntpose,mixup,sct,indx,indy,kstrt,&
&nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp, kyp, kypd, jblok, kblok, nxhyd, nxyhd
real :: f
complex, dimension(3,nyv,kxp,jblok) :: g
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyhd) :: sct
end subroutine
end interface
interface
subroutine PFFT2C(f,g,bs,br,isign,ntpose,mixup,sct,indx,indy,ks&
&trt,nxv,nyv,kxp,kyp,kypd,jblok,kblok,nxyd,nxyhd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxv, nyv, kxp, kyp
integer :: kypd, jblok, kblok, nxyd, nxyhd
! complex, dimension(*) :: f
complex :: f
complex, dimension(nyv,kxp,jblok) :: g
complex, dimension (kxp,kyp,kblok) :: bs
complex, dimension (kxp,kyp,jblok) :: br
integer, dimension(nxyd) :: mixup
complex, dimension(nxyhd) :: sct
end subroutine
end interface
interface
subroutine WPFFT2RINIT(mixup,sct,indx,indy,nxhyd,nxyhd)
implicit none
integer :: indx, indy
integer :: nxhyd, nxyhd
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyhd) :: sct
end subroutine
end interface
interface
subroutine WPFFT2R(f,g,bs,br,isign,ntpose,mixup,sct,ttp,indx,in&
&dy,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp, kyp, kypd, jblok, kblok, nxhyd, nxyhd
real :: ttp
real :: f
complex, dimension(nyv,kxp,jblok) :: g
complex, dimension(kxp,kyp,kblok) :: bs
complex, dimension(kxp,kyp,jblok) :: br
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyhd) :: sct
end subroutine
end interface
interface
subroutine WPFFT2RX(f,g,isign,ntpose,mixup,sct,ttp,indx,indy,ks&
&trt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp, kyp, kypd, jblok, kblok, nxhyd, nxyhd
real :: ttp
real :: f
complex, dimension(nyv,kxp,jblok) :: g
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyhd) :: sct
end subroutine
end interface
interface
subroutine WPFFT2R2(f,g,bs,br,isign,ntpose,mixup,sct,ttp,indx,i&
&ndy,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp, kyp, kypd, jblok, kblok, nxhyd, nxyhd
real :: ttp
real :: f
complex, dimension(2,nyv,kxp,jblok) :: g
complex, dimension(2,kxp,kyp,kblok) :: bs
complex, dimension(2,kxp,kyp,jblok) :: br
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyhd) :: sct
end subroutine
end interface
interface
subroutine WPFFT2R3(f,g,bs,br,isign,ntpose,mixup,sct,ttp,indx,i&
&ndy,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp, kyp, kypd, jblok, kblok, nxhyd, nxyhd
real :: ttp
real :: f
complex, dimension(3,nyv,kxp,jblok) :: g
complex, dimension(3,kxp,kyp,kblok) :: bs
complex, dimension(3,kxp,kyp,jblok) :: br
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyhd) :: sct
end subroutine
end interface
interface
subroutine WPFFT2RX2(f,g,isign,ntpose,mixup,sct,ttp,indx,indy,k&
&strt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp, kyp, kypd, jblok, kblok, nxhyd, nxyhd
real :: ttp
real :: f
complex, dimension(2,nyv,kxp,jblok) :: g
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyhd) :: sct
end subroutine
end interface
interface
subroutine WPFFT2RX3(f,g,isign,ntpose,mixup,sct,ttp,indx,indy,k&
&strt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp, kyp, kypd, jblok, kblok, nxhyd, nxyhd
real :: ttp
real :: f
complex, dimension(3,nyv,kxp,jblok) :: g
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyhd) :: sct
end subroutine
end interface
interface
subroutine WPFFT2RN(f,g,bs,br,ss,isign,ntpose,mixup,sct,ttp,ind&
&x,indy,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,ndim,nxhyd,nxyhd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp, kyp, kypd, jblok, kblok, ndim, nxhyd, nxyhd
real :: ttp
real :: f
complex, dimension(ndim,nyv,kxp,jblok) :: g
complex, dimension(ndim,kxp,kyp,kblok) :: bs
complex, dimension(ndim,kxp,kyp,jblok) :: br
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyhd) :: sct
complex, dimension(ndim,nxvh) :: ss
end subroutine
end interface
interface
subroutine WPFFT2RXN(f,g,ss,isign,ntpose,mixup,sct,ttp,indx,ind&
&y,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,ndim,nxhyd,nxyhd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp, kyp, kypd, jblok, kblok, ndim, nxhyd, nxyhd
real :: ttp
real :: f
complex, dimension(ndim,nyv,kxp,jblok) :: g
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyhd) :: sct
complex, dimension(ndim,nxvh) :: ss
end subroutine
end interface
interface
subroutine WP2FFT2RN(f1,f2,g1,g2,bs,br,ss,isign,ntpose,mixup,sc&
&t,ttp,indx,indy,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,ndim1,ndim&
&2,nxhyd,nxyhd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp, kyp, kypd, jblok, kblok, ndim1, ndim2
integer :: nxhyd, nxyhd
real :: ttp
real :: f1, f2
complex, dimension(ndim1,nyv,kxp,jblok) :: g1
complex, dimension(ndim2,nyv,kxp,jblok) :: g2
complex, dimension(ndim1+ndim2,kxp,kyp,kblok) :: bs
complex, dimension(ndim1+ndim2,kxp,kyp,jblok) :: br
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyhd) :: sct
complex, dimension(ndim1+ndim2,nxvh) :: ss
end subroutine
end interface
interface
subroutine WPFST2RINIT(mixup,sctd,indx,indy,nxhyd,nxyd)
implicit none
integer :: indx, indy
integer :: nxhyd, nxyd
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyd) :: sctd
end subroutine
end interface
interface
subroutine WPFSST2R(f,g,bs,br,isign,ntpose,mixup,sctd,ttp,indx,&
&indy,kstrt,nxvh,nyv,kxp2,kyp,kypd,kxp2d,jblok,kblok,nxhyd,nxyd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp2, kyp, kypd, kxp2d, jblok, kblok, nxhyd, nxyd
real :: ttp
real :: f
real, dimension(nyv,kxp2d,jblok) :: g
real, dimension(kxp2+1,kyp+1,kblok) :: bs
real, dimension(kxp2+1,kyp+1,jblok) :: br
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyd) :: sctd
end subroutine
end interface
interface
subroutine WPFSCT2R(f,g,bs,br,isign,ntpose,mixup,sctd,ttp,indx,&
&indy,kstrt,nxvh,nyv,kxp2,kyp,kypd,kxp2d,jblok,kblok,nxhyd,nxyd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp2, kyp, kypd, kxp2d, jblok, kblok, nxhyd, nxyd
real :: ttp
real :: f
real, dimension(nyv,kxp2d,jblok) :: g
real, dimension(kxp2+1,kyp+1,kblok) :: bs
real, dimension(kxp2+1,kyp+1,jblok) :: br
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyd) :: sctd
end subroutine
end interface
interface
subroutine WPFCST2R(f,g,bs,br,isign,ntpose,mixup,sctd,ttp,indx,&
&indy,kstrt,nxvh,nyv,kxp2,kyp,kypd,kxp2d,jblok,kblok,nxhyd,nxyd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp2, kyp, kypd, kxp2d, jblok, kblok, nxhyd, nxyd
real :: ttp
real :: f
real, dimension(nyv,kxp2d,jblok) :: g
real, dimension(kxp2+1,kyp+1,kblok) :: bs
real, dimension(kxp2+1,kyp+1,jblok) :: br
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyd) :: sctd
end subroutine
end interface
interface
subroutine WPFCCT2R(f,g,bs,br,isign,ntpose,mixup,sctd,ttp,indx,&
&indy,kstrt,nxvh,nyv,kxp2,kyp,kypd,kxp2d,jblok,kblok,nxhyd,nxyd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp2, kyp, kypd, kxp2d, jblok, kblok, nxhyd, nxyd
real :: ttp
real :: f
real, dimension(nyv,kxp2d,jblok) :: g
real, dimension(kxp2+1,kyp+1,kblok) :: bs
real, dimension(kxp2+1,kyp+1,jblok) :: br
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyd) :: sctd
end subroutine
end interface
interface
subroutine WPFCST2R2(f,g,bs,br,isign,ntpose,mixup,sctd,ttp,indx&
&,indy,kstrt,nxvh,nyv,kxp2,kyp,kypd,kxp2d,jblok,kblok,nxhyd,nxyd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp2, kyp, kypd, kxp2d, jblok, kblok, nxhyd, nxyd
real :: ttp
real :: f
real, dimension(2,nyv,kxp2d,jblok) :: g
real, dimension(2,kxp2+1,kyp+1,kblok) :: bs
real, dimension(2,kxp2+1,kyp+1,jblok) :: br
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyd) :: sctd
end subroutine
end interface
interface
subroutine WPFSCT2R2(f,g,bs,br,isign,ntpose,mixup,sctd,ttp,indx&
&,indy,kstrt,nxvh,nyv,kxp2,kyp,kypd,kxp2d,jblok,kblok,nxhyd,nxyd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp2, kyp, kypd, kxp2d, jblok, kblok, nxhyd, nxyd
real :: ttp
real :: f
real, dimension(2,nyv,kxp2d,jblok) :: g
real, dimension(2,kxp2+1,kyp+1,kblok) :: bs
real, dimension(2,kxp2+1,kyp+1,jblok) :: br
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyd) :: sctd
end subroutine
end interface
interface
subroutine WPFCST2R3(f,g,bs,br,isign,ntpose,mixup,sctd,ttp,indx&
&,indy,kstrt,nxvh,nyv,kxp2,kyp,kypd,kxp2d,jblok,kblok,nxhyd,nxyd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp2, kyp, kypd, kxp2d, jblok, kblok, nxhyd, nxyd
real :: ttp
real :: f
real, dimension(3,nyv,kxp2d,jblok) :: g
real, dimension(3,kxp2+1,kyp+1,kblok) :: bs
real, dimension(3,kxp2+1,kyp+1,jblok) :: br
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyd) :: sctd
end subroutine
end interface
interface
subroutine WPFSCT2R3(f,g,bs,br,isign,ntpose,mixup,sctd,ttp,indx&
&,indy,kstrt,nxvh,nyv,kxp2,kyp,kypd,kxp2d,jblok,kblok,nxhyd,nxyd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp2, kyp, kypd, kxp2d, jblok, kblok, nxhyd, nxyd
real :: ttp
real :: f
real, dimension(3,nyv,kxp2d,jblok) :: g
real, dimension(3,kxp2+1,kyp+1,kblok) :: bs
real, dimension(3,kxp2+1,kyp+1,jblok) :: br
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyd) :: sctd
end subroutine
end interface
interface
subroutine WPFSFT2R(f,g,bs,br,isign,ntpose,mixup,sctd,ttp,indx,&
&indy,kstrt,nxvh,nyvh,kxp2,kyp,kypd,kxp2d,j2blok,kblok,nxhyd,nxyd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyvh
integer :: kxp2, kyp, kypd, kxp2d, j2blok, kblok, nxhyd, nxyd
real :: ttp
real :: f
complex, dimension(nyvh,kxp2d,j2blok) :: g
real, dimension(kxp2+1,kyp+1,kblok) :: bs
real, dimension(kxp2+1,kyp+1,j2blok) :: br
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyd) :: sctd
end subroutine
end interface
interface
subroutine WPFCFT2R(f,g,bs,br,isign,ntpose,mixup,sctd,ttp,indx,&
&indy,kstrt,nxvh,nyvh,kxp2,kyp,kypd,kxp2d,j2blok,kblok,nxhyd,nxyd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyvh
integer :: kxp2, kyp, kypd, kxp2d, j2blok, kblok, nxhyd, nxyd
real :: ttp
real :: f
complex, dimension(nyvh,kxp2d,j2blok) :: g
real, dimension(kxp2+1,kyp+1,kblok) :: bs
real, dimension(kxp2+1,kyp+1,j2blok) :: br
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyd) :: sctd
end subroutine
end interface
interface
subroutine WPFCSFT2R2(f,g,bs,br,isign,ntpose,mixup,sctd,ttp,ind&
&x,indy,kstrt,nxvh,nyvh,kxp2,kyp,kypd,kxp2d,j2blok,kblok,nxhyd,nxyd&
&)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyvh
integer :: kxp2, kyp, kypd, kxp2d, j2blok, kblok, nxhyd, nxyd
real :: ttp
real :: f
complex, dimension(2,nyvh,kxp2d,j2blok) :: g
real, dimension(2,kxp2+1,kyp+1,kblok) :: bs
real, dimension(2,kxp2+1,kyp+1,j2blok) :: br
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyd) :: sctd
end subroutine
end interface
interface
subroutine WPFSCFT2R2(f,g,bs,br,isign,ntpose,mixup,sctd,ttp,ind&
&x,indy,kstrt,nxvh,nyvh,kxp2,kyp,kypd,kxp2d,j2blok,kblok,nxhyd,nxyd&
&)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyvh
integer :: kxp2, kyp, kypd, kxp2d, j2blok, kblok, nxhyd, nxyd
real :: ttp
real :: f
complex, dimension(2,nyvh,kxp2d,j2blok) :: g
real, dimension(2,kxp2+1,kyp+1,kblok) :: bs
real, dimension(2,kxp2+1,kyp+1,j2blok) :: br
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyd) :: sctd
end subroutine
end interface
interface
subroutine WPFCSFT2R3(f,g,bs,br,isign,ntpose,mixup,sctd,ttp,ind&
&x,indy,kstrt,nxvh,nyvh,kxp2,kyp,kypd,kxp2d,j2blok,kblok,nxhyd,nxyd&
&)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyvh
integer :: kxp2, kyp, kypd, kxp2d, j2blok, kblok, nxhyd, nxyd
real :: ttp
real :: f
complex, dimension(3,nyvh,kxp2d,j2blok) :: g
real, dimension(3,kxp2+1,kyp+1,kblok) :: bs
real, dimension(3,kxp2+1,kyp+1,j2blok) :: br
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyd) :: sctd
end subroutine
end interface
interface
subroutine WPFSCFT2R3(f,g,bs,br,isign,ntpose,mixup,sctd,ttp,ind&
&x,indy,kstrt,nxvh,nyvh,kxp2,kyp,kypd,kxp2d,j2blok,kblok,nxhyd,nxyd&
&)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyvh
integer :: kxp2, kyp, kypd, kxp2d, j2blok, kblok, nxhyd, nxyd
real :: ttp
real :: f
complex, dimension(3,nyvh,kxp2d,j2blok) :: g
real, dimension(3,kxp2+1,kyp+1,kblok) :: bs
real, dimension(3,kxp2+1,kyp+1,j2blok) :: br
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyd) :: sctd
end subroutine
end interface
interface
subroutine WPFDT2RINIT(sctdx,indx,nxd)
implicit none
integer :: indx, nxd
complex, dimension(nxd) :: sctdx
end subroutine
end interface
interface
subroutine WPFDSFT2RX(f,g,bs,br,isign,ntpose,mixup,sctd,sctdx,t&
&tp,indx,indy,kstrt,nxvh,nyvh,kxp2,kyp,kypd,kxp2d,j2blok,kblok,nxhy&
&d,nxyd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyvh
integer :: kxp2, kyp, kypd, kxp2d, j2blok, kblok, nxhyd, nxyd
real :: ttp
real :: f
complex, dimension(nyvh,kxp2d,j2blok) :: g
real, dimension(kxp2+1,kyp+1,kblok) :: bs
real, dimension(kxp2+1,kyp+1,j2blok) :: br
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyd) :: sctd
complex, dimension(2*nxvh) :: sctdx
end subroutine
end interface
interface
subroutine WPFDCFT2RX(f,g,bs,br,isign,ntpose,mixup,sctd,sctdx,t&
&tp,indx,indy,kstrt,nxvh,nyvh,kxp2,kyp,kypd,kxp2d,j2blok,kblok,nxhy&
&d,nxyd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyvh
integer :: kxp2, kyp, kypd, kxp2d, j2blok, kblok, nxhyd, nxyd
real :: ttp
real :: f
complex, dimension(nyvh,kxp2d,j2blok) :: g
real, dimension(kxp2+1,kyp+1,kblok) :: bs
real, dimension(kxp2+1,kyp+1,j2blok) :: br
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyd) :: sctd
complex, dimension(2*nxvh) :: sctdx
end subroutine
end interface
interface
subroutine WPFDCSFT2R2(f,g,bs,br,isign,ntpose,mixup,sctd,sctdx,&
&ttp,indx,indy,kstrt,nxvh,nyvh,kxp2,kyp,kypd,kxp2d,j2blok,kblok,nxh&
&yd,nxyd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyvh
integer :: kxp2, kyp, kypd, kxp2d, j2blok, kblok, nxhyd, nxyd
real :: ttp
real :: f
complex, dimension(2,nyvh,kxp2d,j2blok) :: g
real, dimension(2,kxp2+1,kyp+1,kblok) :: bs
real, dimension(2,kxp2+1,kyp+1,j2blok) :: br
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyd) :: sctd
complex, dimension(2*nxvh) :: sctdx
end subroutine
end interface
interface
subroutine WPFDSCFT2R2(f,g,bs,br,isign,ntpose,mixup,sctd,sctdx,&
&ttp,indx,indy,kstrt,nxvh,nyvh,kxp2,kyp,kypd,kxp2d,j2blok,kblok,nxh&
&yd,nxyd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyvh
integer :: kxp2, kyp, kypd, kxp2d, j2blok, kblok, nxhyd, nxyd
real :: ttp
real :: f
complex, dimension(2,nyvh,kxp2d,j2blok) :: g
real, dimension(2,kxp2+1,kyp+1,kblok) :: bs
real, dimension(2,kxp2+1,kyp+1,j2blok) :: br
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyd) :: sctd
complex, dimension(2*nxvh) :: sctdx
end subroutine
end interface
interface
subroutine WPFDCSFT2R3(f,g,bs,br,isign,ntpose,mixup,sctd,sctdx,&
&ttp,indx,indy,kstrt,nxvh,nyvh,kxp2,kyp,kypd,kxp2d,j2blok,kblok,nxh&
&yd,nxyd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyvh
integer :: kxp2, kyp, kypd, kxp2d, j2blok, kblok, nxhyd, nxyd
real :: ttp
real :: f
complex, dimension(3,nyvh,kxp2d,j2blok) :: g
real, dimension(3,kxp2+1,kyp+1,kblok) :: bs
real, dimension(3,kxp2+1,kyp+1,j2blok) :: br
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyd) :: sctd
complex, dimension(2*nxvh) :: sctdx
end subroutine
end interface
interface
subroutine WPFDSCFT2R3(f,g,bs,br,isign,ntpose,mixup,sctd,sctdx,&
&ttp,indx,indy,kstrt,nxvh,nyvh,kxp2,kyp,kypd,kxp2d,j2blok,kblok,nxh&
&yd,nxyd)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyvh
integer :: kxp2, kyp, kypd, kxp2d, j2blok, kblok, nxhyd, nxyd
real :: ttp
real :: f
complex, dimension(3,nyvh,kxp2d,j2blok) :: g
real, dimension(3,kxp2+1,kyp+1,kblok) :: bs
real, dimension(3,kxp2+1,kyp+1,j2blok) :: br
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyd) :: sctd
complex, dimension(2*nxvh) :: sctdx
end subroutine
end interface
!
! define generic interfaces to Fortran90 library
!
interface fft_init
! module procedure ipfft2rinit
! module procedure ipfft2rxinit
module procedure iwpfft2rinit
end interface
!
interface fft
! module procedure ipfft2r
! module procedure ipfft2r2
! module procedure ipfft2r3
! module procedure ipfft2rx
! module procedure ipfft2rx2
! module procedure ipfft2rx3
module procedure iwpfft2r
module procedure iwpfft2r2
module procedure iwpfft2r3
! module procedure iwpfft2rx
! module procedure iwpfft2rx2
! module procedure iwpfft2rx3
module procedure ipfft2c
end interface
!
interface fftn
module procedure iwpfft2rn
! module procedure iwpfft2rxn
module procedure iwp1fft2rn
module procedure iwp2fft2rn
end interface
!
interface fftc_init
module procedure ipfft2cinit
end interface
!
interface fst_init
module procedure iwpfst2rinit
end interface
!
interface fsst
module procedure iwpfsst2r
end interface
!
interface fcct
module procedure iwpfcct2r
end interface
!
interface fcst
module procedure iwpfcst2r3
end interface
!
interface fsct
module procedure iwpfsct2r3
end interface
!
interface fsft
module procedure iwpfsft2r
end interface
!
interface fcft
module procedure iwpfcft2r
end interface
!
interface fcsft
module procedure iwpfcsft2r3
end interface
!
interface fscft
module procedure iwpfscft2r3
end interface
!
interface fdt_init
module procedure iwpfdt2rinit
end interface
!
interface fdsft
module procedure iwpfdsft2rx
end interface
!
interface fdcft
module procedure iwpfdcft2rx
end interface
!
interface fdcsft
module procedure iwpfdcsft2r3
end interface
!
interface fdscft
module procedure iwpfdscft2r3
end interface
!
! define Fortran90 interface functions to Fortran77 library
!
contains
!
subroutine ipfft2rinit(mixup,sct,indx,indy)
! initialize 2d real to complex fft
implicit none
integer :: indx, indy
integer, dimension(:), pointer :: mixup
complex, dimension(:), pointer :: sct
! local data
integer :: isign = 0, ntpose = 1, kstrt = 1, nxvh = 1, nyv = 1
integer :: kxp = 1, kyp = 1, kypd = 1, jblok = 1, kblok = 1
integer :: nxhyd, nxyhd
real :: f
complex, dimension(1,1,1) :: g, bs, br
nxhyd = size(mixup); nxyhd = size(sct)
call PFFT2R(f,g,bs,br,isign,ntpose,mixup,sct,indx,indy,kstrt,nx&
&vh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd)
end subroutine ipfft2rinit
!
subroutine ipfft2r(f,g,isign,mixup,sct,tfft,indx,indy,kstrt,kyp&
&,inorder)
! perform 2d scalar real to complex fft
implicit none
integer :: isign, indx, indy, kstrt, kyp
integer, optional :: inorder
real :: tfft
real, dimension(:,:,:), pointer :: f
complex, dimension(:,:,:), pointer :: g
integer, dimension(:), pointer :: mixup
complex, dimension(:), pointer :: sct
! local data
integer :: ntpose = 1, nxvh, nyv
integer :: kxp, kypd, jblok, kblok, nxhyd, nxyhd, order
! complex, dimension(size(g,2),kyp,size(f,3)) :: bs
! complex, dimension(size(g,2),kyp,size(g,3)) :: br
real :: tf
double precision :: dtime
nxvh = size(f,1)/2; kypd = size(f,2); kblok = size(f,3)
nyv = size(g,1); kxp = size(g,2); jblok = size(g,3)
nxhyd = size(mixup); nxyhd = size(sct)
order = QUADRATIC
if (present(inorder)) order = inorder
! check if size of buffers has changed
if (szbuf < kxp*kyp) then
if (szbuf /= 0) deallocate(bs,br)
! allocate buffers
allocate(bs(1,kxp,kyp,kblok),br(1,kxp,kyp,jblok))
szbuf = kxp*kyp
endif
! initialize timer
call wtimer(tf,dtime,-1)
if (order==LINEAR) then
call PFFT2R(f(1,1,1),g,bs,br,isign,ntpose,mixup,sct,indx,ind&
&y,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd)
else
call PFFT2R(f(2,2,1),g,bs,br,isign,ntpose,mixup,sct,indx,ind&
&y,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd)
endif
! record time
call wtimer(tf,dtime)
tfft = tfft + tf
end subroutine ipfft2r
!
subroutine ipfft2r2(f,g,mixup,sct,tfft,indx,indy,kstrt,kyp,inor&
&der)
! perform 2d vector real to complex fft for 2 component vectors
implicit none
integer :: indx, indy, kstrt, kyp
integer, optional :: inorder
real :: tfft
real, dimension(:,:,:,:), pointer :: f
complex, dimension(:,:,:,:), pointer :: g
integer, dimension(:), pointer :: mixup
complex, dimension(:), pointer :: sct
! local data
integer :: isign = 1, ntpose = 1, nxvh, nyv
integer :: kxp, kypd, jblok, kblok, nxhyd, nxyhd, order
! complex, dimension(2,size(g,3),kyp,size(f,4)) :: bs
! complex, dimension(2,size(g,3),kyp,size(g,4)) :: br
real :: tf
double precision :: dtime
nxvh = size(f,2)/2; kypd = size(f,3); kblok = size(f,4)
nyv = size(g,2); kxp = size(g,3); jblok = size(g,4)
nxhyd = size(mixup); nxyhd = size(sct)
order = QUADRATIC
if (present(inorder)) order = inorder
! check if size of buffers has changed
if (szbuf < 2*kxp*kyp) then
if (szbuf /= 0) deallocate(bs,br)
! allocate buffers
allocate(bs(2,kxp,kyp,kblok),br(2,kxp,kyp,jblok))
szbuf = 2*kxp*kyp
endif
! initialize timer
call wtimer(tf,dtime,-1)
if (order==LINEAR) then
call PFFT2R2(f(1,1,1,1),g,bs,br,isign,ntpose,mixup,sct,indx,&
&indy,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd)
else
call PFFT2R2(f(1,2,2,1),g,bs,br,isign,ntpose,mixup,sct,indx,&
&indy,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd)
endif
! record time
call wtimer(tf,dtime)
tfft = tfft + tf
end subroutine ipfft2r2
!
subroutine ipfft2r3(f,g,isign,mixup,sct,tfft,indx,indy,kstrt,ky&
&p,inorder)
! perform 2d vector real to complex fft for 3 component vectors
implicit none
integer :: isign, indx, indy, kstrt, kyp
integer, optional :: inorder
real :: tfft
real, dimension(:,:,:,:), pointer :: f
complex, dimension(:,:,:,:), pointer :: g
integer, dimension(:), pointer :: mixup
complex, dimension(:), pointer :: sct
! local data
integer :: ntpose = 1, nxvh, nyv
integer :: kxp, kypd, jblok, kblok, nxhyd, nxyhd, order
! complex, dimension(3,size(g,3),kyp,size(f,4)) :: bs
! complex, dimension(3,size(g,3),kyp,size(g,4)) :: br
real :: tf
double precision :: dtime
nxvh = size(f,2)/2; kypd = size(f,3); kblok = size(f,4)
nyv = size(g,2); kxp = size(g,3); jblok = size(g,4)
nxhyd = size(mixup); nxyhd = size(sct)
order = QUADRATIC
if (present(inorder)) order = inorder
! check if size of buffers has changed
if (szbuf < 3*kxp*kyp) then
if (szbuf /= 0) deallocate(bs,br)
! allocate buffers
allocate(bs(3,kxp,kyp,kblok),br(3,kxp,kyp,jblok))
szbuf = 3*kxp*kyp
endif
! initialize timer
call wtimer(tf,dtime,-1)
if (size(f,1)==2) then
if (order==LINEAR) then
call PFFT2R2(f(1,1,1,1),g,bs,br,isign,ntpose,mixup,sct,in&
&dx,indy,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd)
else
call PFFT2R2(f(1,2,2,1),g,bs,br,isign,ntpose,mixup,sct,in&
&dx,indy,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd)
endif
else if (size(f,1)==3) then
if (order==LINEAR) then
call PFFT2R3(f(1,1,1,1),g,bs,br,isign,ntpose,mixup,sct,in&
&dx,indy,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd)
else
call PFFT2R3(f(1,2,2,1),g,bs,br,isign,ntpose,mixup,sct,in&
&dx,indy,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd)
endif
endif
! record time
call wtimer(tf,dtime)
tfft = tfft + tf
end subroutine ipfft2r3
!
subroutine ipfft2rxinit(mixup,sct,indx,indy)
! initialize optimized 2d real to complex fft
implicit none
integer :: indx, indy
integer, dimension(:), pointer :: mixup
complex, dimension(:), pointer :: sct
! local data
integer :: isign = 0, ntpose = 1, kstrt = 1, nxvh = 1, nyv = 1
integer :: kxp = 1, kyp = 1, kypd = 1
integer :: jblok = 1, kblok = 1
integer :: nxhyd, nxyhd
real :: f
complex, dimension(1,1,1) :: g
nxhyd = size(mixup); nxyhd = size(sct)
call PFFT2RX(f,g,isign,ntpose,mixup,sct,indx,indy,kstrt,nxvh,ny&
&v,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd)
end subroutine ipfft2rxinit
!
subroutine ipfft2rx(f,g,isign,mixup,sct,tfft,indx,indy,kstrt,ky&
&p,inorder)
! perform optimized 2d scalar real to complex fft
implicit none
integer :: isign, indx, indy, kstrt, kyp
integer, optional :: inorder
real :: tfft
real, dimension(:,:,:), pointer :: f
complex, dimension(:,:,:), pointer :: g
integer, dimension(:), pointer :: mixup
complex, dimension(:), pointer :: sct
! local data
integer :: ntpose = 1, nxvh, nyv, kxp, kypd
integer :: jblok, kblok, nxhyd, nxyhd, order
real :: tf
double precision :: dtime
nxvh = size(f,1)/2; kypd = size(f,2); kblok = size(f,3)
nyv = size(g,1); kxp = size(g,2); jblok = size(g,3)
nxhyd = size(mixup); nxyhd = size(sct)
order = QUADRATIC
if (present(inorder)) order = inorder
! initialize timer
call wtimer(tf,dtime,-1)
if (order==LINEAR) then
call PFFT2RX(f(1,1,1),g,isign,ntpose,mixup,sct,indx,indy,kst&
&rt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd)
else
call PFFT2RX(f(2,2,1),g,isign,ntpose,mixup,sct,indx,indy,kst&
&rt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd)
endif
! record time
call wtimer(tf,dtime)
tfft = tfft + tf
end subroutine ipfft2rx
!
subroutine ipfft2rx2(f,g,mixup,sct,tfft,indx,indy,kstrt,kyp,ino&
&rder)
! perform optimized 2d vector real to complex fft for 2 component vector
implicit none
integer :: indx, indy, kstrt, kyp
integer, optional :: inorder
real :: tfft
real, dimension(:,:,:,:), pointer :: f
complex, dimension(:,:,:,:), pointer :: g
integer, dimension(:), pointer :: mixup
complex, dimension(:), pointer :: sct
! local data
integer :: isign = 1, ntpose = 1, nxvh, nyv, kxp
integer :: kypd, jblok, kblok, nxhyd, nxyhd, order
real :: tf
double precision :: dtime
nxvh = size(f,2)/2; kypd = size(f,3); kblok = size(f,4)
nyv = size(g,2); kxp = size(g,3); jblok = size(g,4)
nxhyd = size(mixup); nxyhd = size(sct)
order = QUADRATIC
if (present(inorder)) order = inorder
! initialize timer
call wtimer(tf,dtime,-1)
if (order==LINEAR) then
call PFFT2RX2(f(1,1,1,1),g,isign,ntpose,mixup,sct,indx,indy,&
&kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd)
else
call PFFT2RX2(f(1,2,2,1),g,isign,ntpose,mixup,sct,indx,indy,&
&kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd)
endif
! record time
call wtimer(tf,dtime)