summaryrefslogtreecommitdiff
path: root/lib/ps4.f90
diff options
context:
space:
mode:
authorhibby <d@vehibberd.com>2018-02-16 15:17:14 +0000
committerhibby <d@vehibberd.com>2018-02-16 15:17:14 +0000
commit37f727ac0746fd85504aa46c1f023c09b3eff33a (patch)
treec8a7ce04545040a8f161ba279528730bd9a3e6ab /lib/ps4.f90
parentd63dd8d081a6fcd0715cd13f26df59fb831769d2 (diff)
New upstream version 1.8.0+repackupstream/1.8.0+repack
Diffstat (limited to 'lib/ps4.f90')
-rw-r--r--lib/ps4.f9027
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/ps4.f90 b/lib/ps4.f90
new file mode 100644
index 00000000..782ab50d
--- /dev/null
+++ b/lib/ps4.f90
@@ -0,0 +1,27 @@
+subroutine ps4(dat,nfft,s)
+
+ parameter (NMAX=2520+2)
+ parameter (NHMAX=NMAX/2-1)
+ real dat(nfft)
+ real dat2(NMAX)
+ real s(NHMAX)
+ complex c(0:NMAX)
+ equivalence(dat2,c)
+
+ nh=nfft/2
+ do i=1,nh
+ dat2(i)=dat(i)/128.0 !### Why 128 ??
+ enddo
+ do i=nh+1,nfft
+ dat2(i)=0.
+ enddo
+
+ call four2a(c,nfft,1,-1,0)
+
+ fac=1.0/nfft
+ do i=1,nh
+ s(i)=fac*(real(c(i))**2 + aimag(c(i))**2)
+ enddo
+
+ return
+end subroutine ps4