-
Notifications
You must be signed in to change notification settings - Fork 0
/
mpfft2mod.f
1908 lines (1907 loc) · 74.2 KB
/
mpfft2mod.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 mpfft2d
!
! Fortran90 interface to 2d parallel PIC Fortran77 library mpfft2lib.f
! mpfft2mod.f contains multi-tasking interface procedures to perform
! ffts:
! defines module mpfft2d
! fft => impfft2r performs 2d scalar real to complex fft and its inverse
! calls MPFFT2R
! fft => impfft2r2 performs 2d vector complex to real fft for 2
! component vectors.
! calls MPFFT2R2
! fft => impfft2r3 performs 2d vector real to complex fft for 1, 2, or 3
! component vectors and their inverses.
! calls MPFFT2R, MPFFT2R2, or MPFFT2R3
! fftn => impfft2rn perform 2d vector real to complex fft for n
! component vectors and their inverses.
! calls MPFFT2RN
! fftn => imp1fft2rn performs 2d real to complex fft for a scalar and n
! component vector and their inverses.
! calls MP2FFT2RN
! fftn => imp2fft2rn perform 2d real to complex fft for two n component
! vectors and their inverses.
! calls MP2FFT2RN
! fsst => impfsst2r performs 2d scalar real sine-sine transform.
! calls MPFSST2R
! fcct => impfcct2r performs 2d scalar real cosine-cosine transform.
! calls MPFCCT2R
! fcst => impfcst2r3 performs 2d vector real cosine-sine transforms
! transforms for 2 or 3 component vector arrays.
! calls MPFCST2R2, or MPFCST2R3
! fsct => impfsct2r3 perform 2d vector real sine-cosine transforms
! for 2 or 3 component vector arrays.
! calls MPFSCT2R2, or MPFSCT2R3
! fsft => impfsft2r performs 2d scalar real sine/periodic transform.
! calls MPFSFT2R
! fcft => impfcft2r performs 2d scalar real cosine/periodic transform.
! calls MPFCFT2R
! fcsft => impfcsft2r3 performs 2d vector real cosine-sine/periodic
! transforms for 2 or 3 component vector arrays.
! calls MPFCSFT2R2, or MPFCSFT2R3
! fscft => impfscft2r3 performs 2d vector real sine-cosine/periodic
! transforms for 2 or 3 component vector arrays.
! calls MPFSCFT2R2, or MPFSCFT2R3
! fdsft => impfdsft2rx performs 2d scalar real half sine/periodic
! transform.
! calls MPFDSFT2RX
! fdcft => impfdcft2rx performs 2d scalar real half cosine/periodic
! transform.
! calls MPFDCFT2RX
! fdcsft => impfdcsft2r3 performs 2d vector real half
! cosine-sine/periodic transforms for 2 or 3 component vector
! arrays.
! calls MPFDCSFT2R2, or MPFDCSFT2R3
! fdscft => impfdscft2r3 performs 2d vector real half
! sine-cosine/periodic transforms for 2 or 3 component vector
! arrays.
! calls MPFDSCFT2R2, or MPFDSCFT2R3
! written by viktor k. decyk, ucla
! copyright 2000, regents of the university of california
! update: december 12, 2009
!
use globals, only: LINEAR, QUADRATIC
use pfft2d, only: wtimer, fft_init, fftc_init, fst_init, fdt_init
use mp0d, only: ntasks
implicit none
private
public :: LINEAR, QUADRATIC
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 MPFFT2R(f,g,bs,br,isign,ntpose,mixup,sct,ttp,indx,in&
&dy,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd,kxyip,iftas&
&k,nmt,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp, kyp, kypd, jblok, kblok, nxhyd, nxyhd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f
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
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
interface
subroutine MPFFT2R2(f,g,bs,br,isign,ntpose,mixup,sct,ttp,indx,i&
&ndy,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd,kxyip,ifta&
&sk,nmt,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp, kyp, kypd, jblok, kblok, nxhyd, nxyhd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f
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
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
interface
subroutine MPFFT2R3(f,g,bs,br,isign,ntpose,mixup,sct,ttp,indx,i&
&ndy,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd,kxyip,ifta&
&sk,nmt,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp, kyp, kypd, jblok, kblok, nxhyd, nxyhd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f
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
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
interface
subroutine MPFFT2RX(f,g,isign,ntpose,mixup,sct,ttp,indx,indy,ks&
&trt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd,kxyip,iftask,nmt&
&,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp, kyp, kypd, jblok, kblok, nxhyd, nxyhd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f
real :: f
complex, dimension(nyv,kxp,jblok) :: g
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyhd) :: sct
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
interface
subroutine MPFFT2RX2(f,g,isign,ntpose,mixup,sct,ttp,indx,indy,k&
&strt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd,kxyip,iftask,nm&
&t,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp, kyp, kypd, jblok, kblok, nxhyd, nxyhd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f
real :: f
complex, dimension(2,nyv,kxp,jblok) :: g
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyhd) :: sct
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
interface
subroutine MPFFT2RX3(f,g,isign,ntpose,mixup,sct,ttp,indx,indy,k&
&strt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd,kxyip,iftask,nm&
&t,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp, kyp, kypd, jblok, kblok, nxhyd, nxyhd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f
real :: f
complex, dimension(3,nyv,kxp,jblok) :: g
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyhd) :: sct
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
interface
subroutine MPFFT2RN(f,g,bs,br,ss,isign,ntpose,mixup,sct,ttp,ind&
&x,indy,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,ndim,nxhyd,nxyhd,kx&
&yip,iftask,nmt,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp, kyp, kypd, jblok, kblok, ndim, nxhyd, nxyhd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f
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,nmt+1) :: ss
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
interface
subroutine MPFFT2RXN(f,g,ss,isign,ntpose,mixup,sct,ttp,indx,ind&
&y,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,ndim,nxhyd,nxyhd,kxyip,i&
&ftask,nmt,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp, kyp, kypd, jblok, kblok, ndim, nxhyd, nxyhd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f
real :: f
complex, dimension(ndim,nyv,kxp,jblok) :: g
integer, dimension(nxhyd) :: mixup
complex, dimension(nxyhd) :: sct
complex, dimension(ndim,nxvh,nmt+1) :: ss
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
interface
subroutine MP2FFT2RN(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,kxyip,iftask,nmt,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp, kyp, kypd, jblok, kblok, ndim1, ndim2
integer :: nxhyd, nxyhd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f1, f2
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,nmt+1) :: ss
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
interface
subroutine MPFSST2R(f,g,bs,br,isign,ntpose,mixup,sctd,ttp,indx,&
&indy,kstrt,nxvh,nyv,kxp2,kyp,kypd,kxp2d,jblok,kblok,nxhyd,nxyd,kxy&
&ip,iftask,nmt,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp2, kyp, kypd, kxp2d, jblok, kblok, nxhyd, nxyd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f
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
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
interface
subroutine MPFSCT2R(f,g,bs,br,isign,ntpose,mixup,sctd,ttp,indx,&
&indy,kstrt,nxvh,nyv,kxp2,kyp,kypd,kxp2d,jblok,kblok,nxhyd,nxyd,kxy&
&ip,iftask,nmt,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp2, kyp, kypd, kxp2d, jblok, kblok, nxhyd, nxyd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f
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
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
interface
subroutine MPFCST2R(f,g,bs,br,isign,ntpose,mixup,sctd,ttp,indx,&
&indy,kstrt,nxvh,nyv,kxp2,kyp,kypd,kxp2d,jblok,kblok,nxhyd,nxyd,kxy&
&ip,iftask,nmt,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp2, kyp, kypd, kxp2d, jblok, kblok, nxhyd, nxyd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f
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
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
interface
subroutine MPFCCT2R(f,g,bs,br,isign,ntpose,mixup,sctd,ttp,indx,&
&indy,kstrt,nxvh,nyv,kxp2,kyp,kypd,kxp2d,jblok,kblok,nxhyd,nxyd,kxy&
&ip,iftask,nmt,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp2, kyp, kypd, kxp2d, jblok, kblok, nxhyd, nxyd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f
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
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
interface
subroutine MPFCST2R2(f,g,bs,br,isign,ntpose,mixup,sctd,ttp,indx&
&,indy,kstrt,nxvh,nyv,kxp2,kyp,kypd,kxp2d,jblok,kblok,nxhyd,nxyd,kx&
&yip,iftask,nmt,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp2, kyp, kypd, kxp2d, jblok, kblok, nxhyd, nxyd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f
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
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
interface
subroutine MPFSCT2R2(f,g,bs,br,isign,ntpose,mixup,sctd,ttp,indx&
&,indy,kstrt,nxvh,nyv,kxp2,kyp,kypd,kxp2d,jblok,kblok,nxhyd,nxyd,kx&
&yip,iftask,nmt,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp2, kyp, kypd, kxp2d, jblok, kblok, nxhyd, nxyd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f
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
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
interface
subroutine MPFCST2R3(f,g,bs,br,isign,ntpose,mixup,sctd,ttp,indx&
&,indy,kstrt,nxvh,nyv,kxp2,kyp,kypd,kxp2d,jblok,kblok,nxhyd,nxyd,kx&
&yip,iftask,nmt,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp2, kyp, kypd, kxp2d, jblok, kblok, nxhyd, nxyd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f
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
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
interface
subroutine MPFSCT2R3(f,g,bs,br,isign,ntpose,mixup,sctd,ttp,indx&
&,indy,kstrt,nxvh,nyv,kxp2,kyp,kypd,kxp2d,jblok,kblok,nxhyd,nxyd,kx&
&yip,iftask,nmt,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyv
integer :: kxp2, kyp, kypd, kxp2d, jblok, kblok, nxhyd, nxyd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f
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
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
interface
subroutine MPFSFT2R(f,g,bs,br,isign,ntpose,mixup,sctd,ttp,indx,&
&indy,kstrt,nxvh,nyvh,kxp2,kyp,kypd,kxp2d,j2blok,kblok,nxhyd,nxyd,k&
&xyip,iftask,nmt,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyvh
integer :: kxp2, kyp, kypd, kxp2d, j2blok, kblok, nxhyd, nxyd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f
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
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
interface
subroutine MPFCFT2R(f,g,bs,br,isign,ntpose,mixup,sctd,ttp,indx,&
&indy,kstrt,nxvh,nyvh,kxp2,kyp,kypd,kxp2d,j2blok,kblok,nxhyd,nxyd,k&
&xyip,iftask,nmt,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyvh
integer :: kxp2, kyp, kypd, kxp2d, j2blok, kblok, nxhyd, nxyd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f
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
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
interface
subroutine MPFCSFT2R2(f,g,bs,br,isign,ntpose,mixup,sctd,ttp,ind&
&x,indy,kstrt,nxvh,nyvh,kxp2,kyp,kypd,kxp2d,j2blok,kblok,nxhyd,nxyd&
&,kxyip,iftask,nmt,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyvh
integer :: kxp2, kyp, kypd, kxp2d, j2blok, kblok, nxhyd, nxyd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f
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
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
interface
subroutine MPFSCFT2R2(f,g,bs,br,isign,ntpose,mixup,sctd,ttp,ind&
&x,indy,kstrt,nxvh,nyvh,kxp2,kyp,kypd,kxp2d,j2blok,kblok,nxhyd,nxyd&
&,kxyip,iftask,nmt,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyvh
integer :: kxp2, kyp, kypd, kxp2d, j2blok, kblok, nxhyd, nxyd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f
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
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
interface
subroutine MPFCSFT2R3(f,g,bs,br,isign,ntpose,mixup,sctd,ttp,ind&
&x,indy,kstrt,nxvh,nyvh,kxp2,kyp,kypd,kxp2d,j2blok,kblok,nxhyd,nxyd&
&,kxyip,iftask,nmt,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyvh
integer :: kxp2, kyp, kypd, kxp2d, j2blok, kblok, nxhyd, nxyd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f
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
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
interface
subroutine MPFSCFT2R3(f,g,bs,br,isign,ntpose,mixup,sctd,ttp,ind&
&x,indy,kstrt,nxvh,nyvh,kxp2,kyp,kypd,kxp2d,j2blok,kblok,nxhyd,nxyd&
&,kxyip,iftask,nmt,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyvh
integer :: kxp2, kyp, kypd, kxp2d, j2blok, kblok, nxhyd, nxyd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f
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
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
interface
subroutine MPFDSFT2RX(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,kxyip,iftask,nmt,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyvh
integer :: kxp2, kyp, kypd, kxp2d, j2blok, kblok, nxhyd, nxyd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f
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
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
interface
subroutine MPFDCFT2RX(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,kxyip,iftask,nmt,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyvh
integer :: kxp2, kyp, kypd, kxp2d, j2blok, kblok, nxhyd, nxyd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f
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
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
interface
subroutine MPFDCSFT2R2(f,g,bs,br,isign,ntpose,mixup,sctd,sctdx,&
&ttp,indx,indy,kstrt,nxvh,nyvh,kxp2,kyp,kypd,kxp2d,j2blok,kblok,nxh&
&yd,nxyd,kxyip,iftask,nmt,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyvh
integer :: kxp2, kyp, kypd, kxp2d, j2blok, kblok, nxhyd, nxyd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f
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
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
interface
subroutine MPFDSCFT2R2(f,g,bs,br,isign,ntpose,mixup,sctd,sctdx,&
&ttp,indx,indy,kstrt,nxvh,nyvh,kxp2,kyp,kypd,kxp2d,j2blok,kblok,nxh&
&yd,nxyd,kxyip,iftask,nmt,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyvh
integer :: kxp2, kyp, kypd, kxp2d, j2blok, kblok, nxhyd, nxyd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f
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
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
interface
subroutine MPFDCSFT2R3(f,g,bs,br,isign,ntpose,mixup,sctd,sctdx,&
&ttp,indx,indy,kstrt,nxvh,nyvh,kxp2,kyp,kypd,kxp2d,j2blok,kblok,nxh&
&yd,nxyd,kxyip,iftask,nmt,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyvh
integer :: kxp2, kyp, kypd, kxp2d, j2blok, kblok, nxhyd, nxyd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f
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
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
interface
subroutine MPFDSCFT2R3(f,g,bs,br,isign,ntpose,mixup,sctd,sctdx,&
&ttp,indx,indy,kstrt,nxvh,nyvh,kxp2,kyp,kypd,kxp2d,j2blok,kblok,nxh&
&yd,nxyd,kxyip,iftask,nmt,ierr)
implicit none
integer :: isign, ntpose, indx, indy, kstrt, nxvh, nyvh
integer :: kxp2, kyp, kypd, kxp2d, j2blok, kblok, nxhyd, nxyd
integer :: nmt, ierr
real :: ttp
! real, dimension(*) :: f
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
integer, dimension(nmt) :: kxyip, iftask
end subroutine
end interface
!
! define generic interfaces to Fortran90 library
!
interface fft
module procedure impfft2r
module procedure impfft2r2
module procedure impfft2r3
! module procedure impfft2rx
! module procedure impfft2rx2
! module procedure impfft2rx3
end interface
!
interface fftn
module procedure impfft2rn
! module procedure impfft2rxn
module procedure imp1fft2rn
module procedure imp2fft2rn
end interface
!
interface fsst
module procedure impfsst2r
end interface
!
interface fcct
module procedure impfcct2r
end interface
!
interface fcst
module procedure impfcst2r3
end interface
!
interface fsct
module procedure impfsct2r3
end interface
!
interface fsft
module procedure impfsft2r
end interface
!
interface fcft
module procedure impfcft2r
end interface
!
interface fcsft
module procedure impfcsft2r3
end interface
!
interface fscft
module procedure impfscft2r3
end interface
!
interface fdsft
module procedure impfdsft2rx
end interface
!
interface fdcft
module procedure impfdcft2rx
end interface
!
interface fdcsft
module procedure impfdcsft2r3
end interface
!
interface fdscft
module procedure impfdscft2r3
end interface
!
! define Fortran90 interface functions to Fortran77 library
!
contains
!
subroutine impfft2r(f,g,isign,mixup,sct,tfft,indx,indy,kstrt,ky&
&p,inorder)
! perform multi-tasking 2d scalar real to complex fft
implicit none
integer :: isign, indx, indy, kstrt, kyp
integer, optional :: inorder
real, dimension(2) :: tfft
real, dimension(:,:,:), pointer :: f
complex, dimension(:,:,:), pointer :: g
integer, dimension(:), pointer :: mixup
complex, dimension(:), pointer :: sct
! local data
integer :: ntpose = 1, nxvh, nyv, nmt
integer :: kxp, kypd, jblok, kblok, nxhyd, nxyhd, order, ierr
! complex, dimension(size(g,2),kyp,size(f,3)) :: bs
! complex, dimension(size(g,2),kyp,size(g,3)) :: br
integer, dimension(ntasks) :: kxyip, iftask
real :: tf, ttp
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)
nmt = ntasks
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 MPFFT2R(f(1,1,1),g,bs,br,isign,ntpose,mixup,sct,ttp,ind&
&x,indy,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd,kxyip,i&
&ftask,nmt,ierr)
else
call MPFFT2R(f(2,2,1),g,bs,br,isign,ntpose,mixup,sct,ttp,ind&
&x,indy,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd,kxyip,i&
&ftask,nmt,ierr)
endif
if (ierr /= 0) then
call MP_END
call PPEXIT
stop
endif
! record time
call wtimer(tf,dtime)
tfft(1) = tfft(1) + tf
tfft(2) = tfft(2) + ttp
end subroutine impfft2r
!
subroutine impfft2r2(f,g,mixup,sct,tfft,indx,indy,kstrt,kyp,ino&
&rder)
! perform multi-tasking 2d vector real to complex fft
! for 2 component vectors
implicit none
integer :: indx, indy, kstrt, kyp
integer, optional :: inorder
real, dimension(2) :: 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, nmt
integer :: kxp, kypd, jblok, kblok, nxhyd, nxyhd, order, ierr
! complex, dimension(2,size(g,3),kyp,size(f,4)) :: bs
! complex, dimension(2,size(g,3),kyp,size(g,4)) :: br
integer, dimension(ntasks) :: kxyip, iftask
real :: tf, ttp
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)
nmt = ntasks
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 MPFFT2R2(f(1,1,1,1),g,bs,br,isign,ntpose,mixup,sct,ttp,&
&indx,indy,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd,kxyi&
&p,iftask,nmt,ierr)
else
call MPFFT2R2(f(1,2,2,1),g,bs,br,isign,ntpose,mixup,sct,ttp,&
&indx,indy,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd,kxyi&
&p,iftask,nmt,ierr)
endif
if (ierr /= 0) then
call MP_END
call PPEXIT
stop
endif
! record time
call wtimer(tf,dtime)
tfft(1) = tfft(1) + tf
tfft(2) = tfft(2) + ttp
end subroutine impfft2r2
!
subroutine impfft2r3(f,g,isign,mixup,sct,tfft,indx,indy,kstrt,k&
&yp,inorder)
! perform multi-tasking 2d vector real to complex fft
! for 3 component vectors
implicit none
integer :: isign, indx, indy, kstrt, kyp
integer, optional :: inorder
real, dimension(2) :: tfft
real, dimension(:,:,:,:), pointer :: f
complex, dimension(:,:,:,:), pointer :: g
integer, dimension(:), pointer :: mixup
complex, dimension(:), pointer :: sct
! local data
integer :: ntpose = 1, nxvh, nyv, nmt
integer :: kxp, kypd, jblok, kblok, nxhyd, nxyhd, order, ierr
! complex, dimension(3,size(g,3),kyp,size(f,4)) :: bs
! complex, dimension(3,size(g,3),kyp,size(g,4)) :: br
integer, dimension(ntasks) :: kxyip, iftask
real :: tf, ttp
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)
nmt = ntasks
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)
select case(size(f,1))
case (1)
if (order==LINEAR) then
call MPFFT2R(f(1,1,1,1),g,bs,br,isign,ntpose,mixup,sct,tt&
&p,indx,indy,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd,kx&
&yip,iftask,nmt,ierr)
else
call MPFFT2R(f(1,2,2,1),g,bs,br,isign,ntpose,mixup,sct,tt&
&p,indx,indy,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd,kx&
&yip,iftask,nmt,ierr)
endif
case (2)
if (order==LINEAR) then
call MPFFT2R2(f(1,1,1,1),g,bs,br,isign,ntpose,mixup,sct,t&
&tp,indx,indy,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd,k&
&xyip,iftask,nmt,ierr)
else
call MPFFT2R2(f(1,2,2,1),g,bs,br,isign,ntpose,mixup,sct,t&
&tp,indx,indy,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd,k&
&xyip,iftask,nmt,ierr)
endif
case (3)
if (order==LINEAR) then
call MPFFT2R3(f(1,1,1,1),g,bs,br,isign,ntpose,mixup,sct,t&
&tp,indx,indy,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd,k&
&xyip,iftask,nmt,ierr)
else
call MPFFT2R3(f(1,2,2,1),g,bs,br,isign,ntpose,mixup,sct,t&
&tp,indx,indy,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd,k&
&xyip,iftask,nmt,ierr)
endif
end select
if (ierr /= 0) then
call MP_END
call PPEXIT
stop
endif
! record time
call wtimer(tf,dtime)
tfft(1) = tfft(1) + tf
tfft(2) = tfft(2) + ttp
end subroutine impfft2r3
!
subroutine impfft2rx(f,g,isign,mixup,sct,tfft,indx,indy,kstrt,k&
&yp,inorder)
! perform multi-tasking optimized 2d scalar real to complex fft
implicit none
integer :: isign, indx, indy, kstrt, kyp
integer, optional :: inorder
real, dimension(2) :: 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, nmt
integer :: jblok, kblok, nxhyd, nxyhd, order, ierr
integer, dimension(ntasks) :: kxyip, iftask
real :: tf, ttp
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)
nmt = ntasks
order = QUADRATIC
if (present(inorder)) order = inorder
! initialize timer
call wtimer(tf,dtime,-1)
if (order==LINEAR) then
call MPFFT2RX(f(1,1,1),g,isign,ntpose,mixup,sct,ttp,indx,ind&
&y,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd,kxyip,iftask&
&,nmt,ierr)
else
call MPFFT2RX(f(2,2,1),g,isign,ntpose,mixup,sct,ttp,indx,ind&
&y,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd,kxyip,iftask&
&,nmt,ierr)
endif
if (ierr /= 0) then
call MP_END
call PPEXIT
stop
endif
! record time
call wtimer(tf,dtime)
tfft(1) = tfft(1) + tf
tfft(2) = tfft(2) + ttp
end subroutine impfft2rx
!
subroutine impfft2rx2(f,g,mixup,sct,tfft,indx,indy,kstrt,kyp,in&
&order)
! perform multi-tasking optimized 2d vector real to complex fft
! for 2 component vector
implicit none
integer :: indx, indy, kstrt, kyp
integer, optional :: inorder
real, dimension(2) :: 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, nmt
integer :: kypd, jblok, kblok, nxhyd, nxyhd, order, ierr
integer, dimension(ntasks) :: kxyip, iftask
real :: tf, ttp
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)
nmt = ntasks
order = QUADRATIC
if (present(inorder)) order = inorder
! initialize timer
call wtimer(tf,dtime,-1)
if (order==LINEAR) then
call MPFFT2RX2(f(1,1,1,1),g,isign,ntpose,mixup,sct,ttp,indx,&
&indy,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd,kxyip,ift&
&ask,nmt,ierr)
else
call MPFFT2RX2(f(1,2,2,1),g,isign,ntpose,mixup,sct,ttp,indx,&
&indy,kstrt,nxvh,nyv,kxp,kyp,kypd,jblok,kblok,nxhyd,nxyhd,kxyip,ift&
&ask,nmt,ierr)
endif
if (ierr /= 0) then
call MP_END
call PPEXIT
stop
endif
! record time
call wtimer(tf,dtime)
tfft(1) = tfft(1) + tf
tfft(2) = tfft(2) + ttp
end subroutine impfft2rx2
!
subroutine impfft2rx3(f,g,isign,mixup,sct,tfft,indx,indy,kstrt,&
&kyp,inorder)
! perform multi-tasking optimized 2d vector real to complex fft
! for 3 component vector
implicit none
integer :: isign, indx, indy, kstrt, kyp
integer, optional :: inorder
real, dimension(2) :: 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, nmt
integer :: kypd, jblok, kblok, nxhyd, nxyhd, order, ierr
integer, dimension(ntasks) :: kxyip, iftask