35 subroutine fft99 (a,work,trigs,ifax,inc,jump,n,lot,isign)
253 integer,
intent(in) :: inc,jump,n,lot,isign
254 integer,
intent(inout) :: ifax(:)
255 real,
intent(in) :: trigs(:)
256 real,
intent(inout) :: a(*),work(*)
301 integer :: nfax, nx, nh, ink, igo, ibase, jbase
302 integer :: i, j, k, l, m, ia, la, ib
308 if (isign.eq.+1)
go to 30
312 if (mod(nfax,2).eq.1)
goto 40
335 call fft99a(a,work,trigs,inc,jump,n,lot)
345 if (igo.eq.60)
go to 60
347 call vpassm (a(ia),a(ia+inc),work(1),work(2),trigs, &
348 ink,2,jump,nx,lot,nh,ifax(k+1),la)
352 call vpassm (work(1),work(2),a(ia),a(ia+inc),trigs, &
353 2,ink,nx,jump,lot,nh,ifax(k+1),la)
359 if (isign.eq.-1)
go to 130
363 if (mod(nfax,2).ne.1)
then 396 call fft99b(work,a,trigs,inc,jump,n,lot)
404 subroutine fft99a (a,work,trigs,inc,jump,n,lot)
405 integer,
intent(in) :: inc,jump,n,lot
406 real,
intent(in) :: trigs(:)
407 real,
intent(inout) :: a(*),work(*)
414 integer :: nh, nx, ink, k, L
415 integer :: ia, ib, ja, jb, iabase, ibbase, jabase, jbbase
452 work(ja)=(a(ia)+a(ib))- &
453 (s*(a(ia)-a(ib))+c*(a(ia+inc)+a(ib+inc)))
454 work(jb)=(a(ia)+a(ib))+ &
455 (s*(a(ia)-a(ib))+c*(a(ia+inc)+a(ib+inc)))
456 work(ja+1)=(c*(a(ia)-a(ib))-s*(a(ia+inc)+a(ib+inc)))+ &
457 (a(ia+inc)-a(ib+inc))
458 work(jb+1)=(c*(a(ia)-a(ib))-s*(a(ia+inc)+a(ib+inc)))- &
459 (a(ia+inc)-a(ib+inc))
472 if (iabase.eq.ibbase)
then 478 work(ja+1)=-2.0*a(ia+inc)
488 subroutine fft99b (work,a,trigs,inc,jump,n,lot)
489 integer,
intent(in) :: inc,jump,n,lot
490 real,
intent(in) :: trigs(:)
491 real,
intent(inout) :: a(*),work(*)
498 integer :: nh, nx, ink, k, L
499 integer :: ia, ib, ja, jb, iabase, ibbase, jabase, jbbase
514 a(ja)=scale*(work(ia)+work(ib))
515 a(jb)=scale*(work(ia)-work(ib))
540 a(ja)=scale*((work(ia)+work(ib)) &
541 +(c*(work(ia+1)+work(ib+1))+s*(work(ia)-work(ib))))
542 a(jb)=scale*((work(ia)+work(ib)) &
543 -(c*(work(ia+1)+work(ib+1))+s*(work(ia)-work(ib))))
544 a(ja+inc)=scale*((c*(work(ia)-work(ib))-s*(work(ia+1)+work(ib+1))) &
545 +(work(ib+1)-work(ia+1)))
546 a(jb+inc)=scale*((c*(work(ia)-work(ib))-s*(work(ia+1)+work(ib+1))) &
547 -(work(ib+1)-work(ia+1)))
560 if (iabase.eq.ibbase)
then 567 a(ja+inc)=-scale*work(ia+1)
577 subroutine fft991(a,work,trigs,ifax,inc,jump,n,lot,isign)
578 integer,
intent(in) :: inc,jump,n,lot,isign
579 integer,
intent(inout) :: ifax(:)
580 real,
intent(in) :: trigs(:)
581 real,
intent(inout) :: a(*),work((n+1)*lot)
629 integer :: nfax, nx, nh, ink, igo, ibase, jbase
630 integer :: i, j, k, l, m, ia, la, ib
637 if (isign.eq.+1)
go to 30
641 if (mod(nfax,2).eq.1)
goto 40
664 call fft99a(a,work,trigs,inc,jump,n,lot)
674 if (igo.eq.60)
go to 60
676 call vpassm (a(ia),a(ia+inc),work(1),work(2),trigs, &
677 ink,2,jump,nx,lot,nh,ifax(k+1),la)
681 call vpassm (work(1),work(2),a(ia),a(ia+inc),trigs, &
682 2,ink,nx,jump,lot,nh,ifax(k+1),la)
688 if (isign.eq.-1)
go to 130
691 if (mod(nfax,2).ne.1)
then 722 call fft99b (work,a,trigs,inc,jump,n,lot)
730 subroutine set99 (trigs, ifax, n)
731 integer,
intent(in) :: n
732 integer,
intent(out) :: ifax(:)
733 real,
intent(out) :: trigs(:)
745 call fax (ifax, n, mode)
747 if (ifax(i+1) .gt. 5 .or. n .le. 4) ifax(1) = -99
748 if (ifax(1) .le. 0 )
then 749 call mpp_error(fatal,
'fft99_mod: in routine set99 -- invalid n')
751 call fftrig (trigs, n, mode)
757 subroutine fax (ifax,n,mode)
758 integer,
intent(out) :: ifax(:)
759 integer,
intent(in) :: n, mode
761 integer :: nn, k, L, inc, nfax, ii, istop, i, item
764 if (iabs(mode).eq.1)
go to 10
765 if (iabs(mode).eq.8)
go to 10
767 if ((nn+nn).eq.n)
go to 10
772 20
if (mod(nn,4).ne.0)
go to 30
776 if (nn.eq.1)
go to 80
779 30
if (mod(nn,2).ne.0)
go to 40
783 if (nn.eq.1)
go to 80
785 40
if (mod(nn,3).ne.0)
go to 50
789 if (nn.eq.1)
go to 80
795 60
if (mod(nn,l).ne.0)
go to 70
799 if (nn.eq.1)
go to 80
808 if (nfax.eq.1)
go to 110
812 if (ifax(i+1).ge.ifax(i))
go to 90
824 subroutine fftrig (trigs,n,mode)
825 real,
intent(out) :: trigs(:)
826 integer,
intent(in) :: n, mode
829 integer :: imode, nn, nh, i, L, la
833 if (imode.gt.1.and.imode.lt.6) nn=n/2
837 angle=0.5*
real(i-1)*del
839 trigs(i+1)=sin(angle)
841 if (imode.eq.1)
return 842 if (imode.eq.8)
return 849 angle=0.5*
real(i-1)*del
850 trigs(la+i)=cos(angle)
851 trigs(la+i+1)=sin(angle)
853 if (imode.le.3)
return 860 trigs(la+i)=2.0*sin(angle)
868 trigs(la+i)=sin(angle)
875 subroutine vpassm (a,b,c,d,trigs,inc1,inc2,inc3,inc4,lot,n,ifac,la)
876 integer,
intent(in) :: inc1, inc2, inc3, inc4, lot, n, ifac, la
877 real,
intent(in) :: a(*),b(*),trigs(*)
878 real,
intent(out) :: c(*),d(*)
898 real :: sin36=0.587785252292473
899 real :: cos36=0.809016994374947
900 real :: sin72=0.951056516295154
901 real :: cos72=0.309016994374947
902 real :: sin60=0.866025403784437
904 integer :: i, j, k, L, m, iink, jink, jump, ibase, jbase, igo, ijk, la1
905 integer :: ia, ja, ib, jb, kb, ic, jc, kc, id, jd, kd, ie, je, ke
906 real :: c1, s1, c2, s2, c3, s3, c4, s4
932 c(ja+j)=a(ia+i)+a(ib+i)
933 d(ja+j)=b(ia+i)+b(ib+i)
934 c(jb+j)=a(ia+i)-a(ib+i)
935 d(jb+j)=b(ia+i)-b(ib+i)
954 c(ja+j)=a(ia+i)+a(ib+i)
955 d(ja+j)=b(ia+i)+b(ib+i)
956 c(jb+j)=c1*(a(ia+i)-a(ib+i))-s1*(b(ia+i)-b(ib+i))
957 d(jb+j)=s1*(a(ia+i)-a(ib+i))+c1*(b(ia+i)-b(ib+i))
982 c(ja+j)=a(ia+i)+(a(ib+i)+a(ic+i))
983 d(ja+j)=b(ia+i)+(b(ib+i)+b(ic+i))
984 c(jb+j)=(a(ia+i)-0.5*(a(ib+i)+a(ic+i)))-(sin60*(b(ib+i)-b(ic+i)))
985 c(jc+j)=(a(ia+i)-0.5*(a(ib+i)+a(ic+i)))+(sin60*(b(ib+i)-b(ic+i)))
986 d(jb+j)=(b(ia+i)-0.5*(b(ib+i)+b(ic+i)))+(sin60*(a(ib+i)-a(ic+i)))
987 d(jc+j)=(b(ia+i)-0.5*(b(ib+i)+b(ic+i)))-(sin60*(a(ib+i)-a(ic+i)))
1009 c(ja+j)=a(ia+i)+(a(ib+i)+a(ic+i))
1010 d(ja+j)=b(ia+i)+(b(ib+i)+b(ic+i))
1012 c1*((a(ia+i)-0.5*(a(ib+i)+a(ic+i)))-(sin60*(b(ib+i)-b(ic+i)))) &
1013 -s1*((b(ia+i)-0.5*(b(ib+i)+b(ic+i)))+(sin60*(a(ib+i)-a(ic+i))))
1015 s1*((a(ia+i)-0.5*(a(ib+i)+a(ic+i)))-(sin60*(b(ib+i)-b(ic+i)))) &
1016 +c1*((b(ia+i)-0.5*(b(ib+i)+b(ic+i)))+(sin60*(a(ib+i)-a(ic+i))))
1018 c2*((a(ia+i)-0.5*(a(ib+i)+a(ic+i)))+(sin60*(b(ib+i)-b(ic+i)))) &
1019 -s2*((b(ia+i)-0.5*(b(ib+i)+b(ic+i)))-(sin60*(a(ib+i)-a(ic+i))))
1021 s2*((a(ia+i)-0.5*(a(ib+i)+a(ic+i)))+(sin60*(b(ib+i)-b(ic+i)))) &
1022 +c2*((b(ia+i)-0.5*(b(ib+i)+b(ic+i)))-(sin60*(a(ib+i)-a(ic+i))))
1049 c(ja+j)=(a(ia+i)+a(ic+i))+(a(ib+i)+a(id+i))
1050 c(jc+j)=(a(ia+i)+a(ic+i))-(a(ib+i)+a(id+i))
1051 d(ja+j)=(b(ia+i)+b(ic+i))+(b(ib+i)+b(id+i))
1052 d(jc+j)=(b(ia+i)+b(ic+i))-(b(ib+i)+b(id+i))
1053 c(jb+j)=(a(ia+i)-a(ic+i))-(b(ib+i)-b(id+i))
1054 c(jd+j)=(a(ia+i)-a(ic+i))+(b(ib+i)-b(id+i))
1055 d(jb+j)=(b(ia+i)-b(ic+i))+(a(ib+i)-a(id+i))
1056 d(jd+j)=(b(ia+i)-b(ic+i))-(a(ib+i)-a(id+i))
1081 c(ja+j)=(a(ia+i)+a(ic+i))+(a(ib+i)+a(id+i))
1082 d(ja+j)=(b(ia+i)+b(ic+i))+(b(ib+i)+b(id+i))
1084 c2*((a(ia+i)+a(ic+i))-(a(ib+i)+a(id+i))) &
1085 -s2*((b(ia+i)+b(ic+i))-(b(ib+i)+b(id+i)))
1087 s2*((a(ia+i)+a(ic+i))-(a(ib+i)+a(id+i))) &
1088 +c2*((b(ia+i)+b(ic+i))-(b(ib+i)+b(id+i)))
1090 c1*((a(ia+i)-a(ic+i))-(b(ib+i)-b(id+i))) &
1091 -s1*((b(ia+i)-b(ic+i))+(a(ib+i)-a(id+i)))
1093 s1*((a(ia+i)-a(ic+i))-(b(ib+i)-b(id+i))) &
1094 +c1*((b(ia+i)-b(ic+i))+(a(ib+i)-a(id+i)))
1096 c3*((a(ia+i)-a(ic+i))+(b(ib+i)-b(id+i))) &
1097 -s3*((b(ia+i)-b(ic+i))-(a(ib+i)-a(id+i)))
1099 s3*((a(ia+i)-a(ic+i))+(b(ib+i)-b(id+i))) &
1100 +c3*((b(ia+i)-b(ic+i))-(a(ib+i)-a(id+i)))
1129 c(ja+j)=a(ia+i)+(a(ib+i)+a(ie+i))+(a(ic+i)+a(id+i))
1130 d(ja+j)=b(ia+i)+(b(ib+i)+b(ie+i))+(b(ic+i)+b(id+i))
1131 c(jb+j)=(a(ia+i)+cos72*(a(ib+i)+a(ie+i))-cos36*(a(ic+i)+a(id+i))) &
1132 -(sin72*(b(ib+i)-b(ie+i))+sin36*(b(ic+i)-b(id+i)))
1133 c(je+j)=(a(ia+i)+cos72*(a(ib+i)+a(ie+i))-cos36*(a(ic+i)+a(id+i))) &
1134 +(sin72*(b(ib+i)-b(ie+i))+sin36*(b(ic+i)-b(id+i)))
1135 d(jb+j)=(b(ia+i)+cos72*(b(ib+i)+b(ie+i))-cos36*(b(ic+i)+b(id+i))) &
1136 +(sin72*(a(ib+i)-a(ie+i))+sin36*(a(ic+i)-a(id+i)))
1137 d(je+j)=(b(ia+i)+cos72*(b(ib+i)+b(ie+i))-cos36*(b(ic+i)+b(id+i))) &
1138 -(sin72*(a(ib+i)-a(ie+i))+sin36*(a(ic+i)-a(id+i)))
1139 c(jc+j)=(a(ia+i)-cos36*(a(ib+i)+a(ie+i))+cos72*(a(ic+i)+a(id+i))) &
1140 -(sin36*(b(ib+i)-b(ie+i))-sin72*(b(ic+i)-b(id+i)))
1141 c(jd+j)=(a(ia+i)-cos36*(a(ib+i)+a(ie+i))+cos72*(a(ic+i)+a(id+i))) &
1142 +(sin36*(b(ib+i)-b(ie+i))-sin72*(b(ic+i)-b(id+i)))
1143 d(jc+j)=(b(ia+i)-cos36*(b(ib+i)+b(ie+i))+cos72*(b(ic+i)+b(id+i))) &
1144 +(sin36*(a(ib+i)-a(ie+i))-sin72*(a(ic+i)-a(id+i)))
1145 d(jd+j)=(b(ia+i)-cos36*(b(ib+i)+b(ie+i))+cos72*(b(ic+i)+b(id+i))) &
1146 -(sin36*(a(ib+i)-a(ie+i))-sin72*(a(ic+i)-a(id+i)))
1174 c(ja+j)=a(ia+i)+(a(ib+i)+a(ie+i))+(a(ic+i)+a(id+i))
1175 d(ja+j)=b(ia+i)+(b(ib+i)+b(ie+i))+(b(ic+i)+b(id+i))
1177 c1*((a(ia+i)+cos72*(a(ib+i)+a(ie+i))-cos36*(a(ic+i)+a(id+i))) &
1178 -(sin72*(b(ib+i)-b(ie+i))+sin36*(b(ic+i)-b(id+i)))) &
1179 -s1*((b(ia+i)+cos72*(b(ib+i)+b(ie+i))-cos36*(b(ic+i)+b(id+i))) &
1180 +(sin72*(a(ib+i)-a(ie+i))+sin36*(a(ic+i)-a(id+i))))
1182 s1*((a(ia+i)+cos72*(a(ib+i)+a(ie+i))-cos36*(a(ic+i)+a(id+i))) &
1183 -(sin72*(b(ib+i)-b(ie+i))+sin36*(b(ic+i)-b(id+i)))) &
1184 +c1*((b(ia+i)+cos72*(b(ib+i)+b(ie+i))-cos36*(b(ic+i)+b(id+i))) &
1185 +(sin72*(a(ib+i)-a(ie+i))+sin36*(a(ic+i)-a(id+i))))
1187 c4*((a(ia+i)+cos72*(a(ib+i)+a(ie+i))-cos36*(a(ic+i)+a(id+i))) &
1188 +(sin72*(b(ib+i)-b(ie+i))+sin36*(b(ic+i)-b(id+i)))) &
1189 -s4*((b(ia+i)+cos72*(b(ib+i)+b(ie+i))-cos36*(b(ic+i)+b(id+i))) &
1190 -(sin72*(a(ib+i)-a(ie+i))+sin36*(a(ic+i)-a(id+i))))
1192 s4*((a(ia+i)+cos72*(a(ib+i)+a(ie+i))-cos36*(a(ic+i)+a(id+i))) &
1193 +(sin72*(b(ib+i)-b(ie+i))+sin36*(b(ic+i)-b(id+i)))) &
1194 +c4*((b(ia+i)+cos72*(b(ib+i)+b(ie+i))-cos36*(b(ic+i)+b(id+i))) &
1195 -(sin72*(a(ib+i)-a(ie+i))+sin36*(a(ic+i)-a(id+i))))
1197 c2*((a(ia+i)-cos36*(a(ib+i)+a(ie+i))+cos72*(a(ic+i)+a(id+i))) &
1198 -(sin36*(b(ib+i)-b(ie+i))-sin72*(b(ic+i)-b(id+i)))) &
1199 -s2*((b(ia+i)-cos36*(b(ib+i)+b(ie+i))+cos72*(b(ic+i)+b(id+i))) &
1200 +(sin36*(a(ib+i)-a(ie+i))-sin72*(a(ic+i)-a(id+i))))
1202 s2*((a(ia+i)-cos36*(a(ib+i)+a(ie+i))+cos72*(a(ic+i)+a(id+i))) &
1203 -(sin36*(b(ib+i)-b(ie+i))-sin72*(b(ic+i)-b(id+i)))) &
1204 +c2*((b(ia+i)-cos36*(b(ib+i)+b(ie+i))+cos72*(b(ic+i)+b(id+i))) &
1205 +(sin36*(a(ib+i)-a(ie+i))-sin72*(a(ic+i)-a(id+i))))
1207 c3*((a(ia+i)-cos36*(a(ib+i)+a(ie+i))+cos72*(a(ic+i)+a(id+i))) &
1208 +(sin36*(b(ib+i)-b(ie+i))-sin72*(b(ic+i)-b(id+i)))) &
1209 -s3*((b(ia+i)-cos36*(b(ib+i)+b(ie+i))+cos72*(b(ic+i)+b(id+i))) &
1210 -(sin36*(a(ib+i)-a(ie+i))-sin72*(a(ic+i)-a(id+i))))
1212 s3*((a(ia+i)-cos36*(a(ib+i)+a(ie+i))+cos72*(a(ic+i)+a(id+i))) &
1213 +(sin36*(b(ib+i)-b(ie+i))-sin72*(b(ic+i)-b(id+i)))) &
1214 +c3*((b(ia+i)-cos36*(b(ib+i)+b(ie+i))+cos72*(b(ic+i)+b(id+i))) &
1215 -(sin36*(a(ib+i)-a(ie+i))-sin72*(a(ic+i)-a(id+i))))
subroutine, public fft991(a, work, trigs, ifax, inc, jump, n, lot, isign)
subroutine fax(ifax, n, mode)
subroutine, public set99(trigs, ifax, n)
subroutine, public fft99(a, work, trigs, ifax, inc, jump, n, lot, isign)
subroutine fft99a(a, work, trigs, inc, jump, n, lot)
subroutine vpassm(a, b, c, d, trigs, inc1, inc2, inc3, inc4, lot, n, ifac, la)
subroutine fftrig(trigs, n, mode)
subroutine fft99b(work, a, trigs, inc, jump, n, lot)
real(fp), parameter, public pi