summaryrefslogtreecommitdiff
path: root/lib/foldspec9f.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/foldspec9f.f90
parentd63dd8d081a6fcd0715cd13f26df59fb831769d2 (diff)
New upstream version 1.8.0+repackupstream/1.8.0+repack
Diffstat (limited to 'lib/foldspec9f.f90')
-rw-r--r--lib/foldspec9f.f9030
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/foldspec9f.f90 b/lib/foldspec9f.f90
new file mode 100644
index 00000000..a6436eba
--- /dev/null
+++ b/lib/foldspec9f.f90
@@ -0,0 +1,30 @@
+subroutine foldspec9f(s1,nq,jz,ja,jb,s2)
+
+! Fold symbol spectra (quarter-symbol steps) from s1 into s2
+
+ real s1(nq,jz)
+ real s2(240,340) !340 = 4*85
+ integer nsum(340)
+
+ s2=0.
+ nsum=0
+
+ do j=ja,jb
+ k=mod(j-1,340)+1
+ nsum(k)=nsum(k)+1
+ do i=1,NQ
+ s2(i,k)=s2(i,k) + s1(i,j)
+ enddo
+ enddo
+
+ do k=1,340
+ fac=1.0
+ if(nsum(k).gt.0) fac=1.0/nsum(k)
+ s2(1:nq,k)=fac*s2(1:nq,k)
+ enddo
+
+ ave=sum(s2)/(340.0*nq)
+ if(ave.gt.0.0) s2=s2/ave
+
+ return
+end subroutine foldspec9f