98 INTEGER(mpi),
PARAMETER ::
nbin=120
99 INTEGER(mpi),
PARAMETER ::
nsampl=120
128 INTEGER(mpi),
INTENT(IN) :: ih
129 REAL(mps),
INTENT(IN) :: xa
130 REAL(mps),
INTENT(IN) :: xb
131 CHARACTER (LEN=*),
INTENT(IN) :: text
135 IF(ih <= 0.OR.ih > numhis)
RETURN
142 IF(xa /= xb)
xl(3,ih)=real(nbin,mps)/(xb-xa)
144 IF(
khist(ih) == 0)
THEN
162 INTEGER(mpi),
INTENT(IN) :: ih
163 CHARACTER (LEN=*),
INTENT(IN) :: text
166 IF(ih <= 0.OR.ih > numhis)
RETURN
169 IF(
khist(ih) == 0)
THEN
189 INTEGER(mpi),
INTENT(IN) :: ih
190 REAL(mps),
INTENT(IN) :: x
192 IF(ih <= 0.OR.ih > numhis)
RETURN
193 IF(
khist(ih) /= 1)
RETURN
194 IF(
jnhist(4,ih) >= 2147483647)
RETURN
196 IF(
jnhist(4,ih) <= nsampl)
THEN
198 IF(
jnhist(4,ih) == nsampl)
THEN
207 i=int(1.0+
xl(3,ih)*(x-
xl(1,ih)),mpi)
212 xl(4,ih)=min(
xl(4,ih),x)
213 xl(5,ih)=max(
xl(5,ih),x)
216 dl(1,ih)=
dl(1,ih)+ x-
xl(6,ih)
217 dl(2,ih)=
dl(2,ih)+(x-
xl(6,ih))**2
229 INTEGER(mpi),
INTENT(IN) :: ih
230 INTEGER(mpi),
INTENT(IN) :: ix
232 IF(ih <= 0.OR.ih > numhis)
RETURN
233 IF(
khist(ih) /= 2)
RETURN
234 IF(
jnhist(1,ih) >= 2147483647)
RETURN
242 i=int(1.0+20.0*log10(real(ix,mps)),mpi)
266 INTEGER(mpi),
INTENT(IN) :: ih
272 IF(ih <= 0.OR.ih > numhis)
RETURN
277 IF(
khist(ihc) /= 0)
THEN
278 IF(
khist(ihc) == 1)
THEN
283 IF(nn /= 0.OR.
khist(ihc) == 3)
THEN
285111
FORMAT(
' ______',2(
'______________________________'))
286 IF(
kvers(ihc) == 1)
THEN
287 WRITE(*,*)
'Histogram',ihc,
': ',
htext(ihc)
289 WRITE(*,*)
'Histogram',ihc,
'/',
kvers(ihc),
': ',
htext(ihc)
291 IF(
khist(ihc) == 1)
THEN
292 WRITE(*,*)
' Out_low inside out_high = ', (
jnhist(j,ihc),j=1,3)
293 ELSE IF(
khist(ihc) == 2)
THEN
294 WRITE(*,*)
' 0_or_negative inside above_10^6 = ', &
297 IF(
khist(ihc) == 3)
THEN
300 IF(
jnhist(2,ihc) /= 0)
THEN
302 IF(
khist(ihc) == 1)
THEN
304 ELSE IF(
khist(ihc) == 2)
THEN
308 IF(
khist(ihc) == 1)
THEN
309 WRITE(*,*)
' Min and Max are',
xl(4,ihc),
xl(5,ihc)
310 IF(
jnhist(2,ihc) > 1)
THEN
311 xmean=real(
xl(6,ihc)+
dl(1,ihc)/real(
jnhist(2,ihc),mps),mps)
312 xcent=0.5*(
xl(1,ihc)+
xl(2,ihc))
313 xsigm=real((
dl(2,ihc)-
dl(1,ihc)**2/real(
jnhist(2,ihc),mps)),mps)
314 xsigm=sqrt(xsigm/real(
jnhist(2,ihc)-1,mps))
315 WRITE(*,*)
' Mean and sigma are', xmean,
' +-',xsigm
317 ELSE IF(
khist(ihc) == 2)
THEN
318 WRITE(*,*)
' Plot of log10 of entries. Min and Max are', &
333 INTEGER(mpi),
INTENT(IN) :: lunw
353 INTEGER(mpi),
INTENT(IN) :: ih
360 IF(ih <= 0.OR.ih > numhis)
RETURN
366 IF(
khist(ihc) /= 0)
THEN
367 IF(
khist(ihc) == 1)
THEN
375 .AND.
xl(1,ihc) ==
xl(2,ihc))
THEN
379 WRITE(
lun,202) nbin,
xl(1,ihc)-0.001,
xl(2,ihc)+0.001
381 WRITE(
lun,202) nbin,
xl(1,ihc),
xl(2,ihc)
384 WRITE(
lun,204)
'bincontent'
391 IF(
khist(ihc) == 1)
THEN
392 WRITE(
lun,205)
xl(4,ihc),
xl(5,ihc)
393 ELSE IF(
khist(ihc) == 2)
THEN
396 IF(
khist(ihc) == 1)
THEN
397 IF(
jnhist(2,ihc) > 1)
THEN
398 xmean=real(
xl(6,ihc)+
dl(1,ihc)/real(
jnhist(2,ihc),mps),mps)
399 xcent=0.5*(
xl(1,ihc)+
xl(2,ihc))
400 xsigm=real((
dl(2,ihc)-
dl(1,ihc)**2/real(
jnhist(2,ihc),mps)),mps)
401 xsigm=sqrt(xsigm/real(
jnhist(2,ihc)-1,mps))
402 WRITE(
lun,206) xmean,xsigm
405 WRITE(
lun,204)
'end of histogram'
410201
FORMAT(
'Histogram ',i4,10x,
'version ',i4,10x,
'type',i2)
411202
FORMAT(10x,
' bins, limits ',i4,2g15.5)
412203
FORMAT(10x,
'out-low inside out-high ',3i10)
414205
FORMAT(
'minmax',2e15.7)
415206
FORMAT(
'meansigma',2e15.7)
421SUBROUTINE hmpmak(inhist,fnhist,jnhist,xl,dl)
433 INTEGER(mpi),
INTENT(OUT) :: inhist(nbin)
434 REAL(mps),
INTENT(IN) :: fnhist(nsampl)
435 INTEGER(mpi),
INTENT(IN OUT) :: jnhist(5)
436 REAL(mps),
INTENT(IN OUT) :: xl(6)
437 REAL(mpd),
INTENT(OUT) :: dl(2)
438 REAL(mps) :: cphist(nsampl)
444 IF(nn == 0.OR.jnhist(5) /= 0)
RETURN
447 CALL heapf(cphist,nn)
448 IF(xl(3) == 0.0)
THEN
449 CALL bintab(cphist,nn,xa,xb)
453 IF(xa /= xb) xl(3)=real(nbin,mps)/(xb-xa)
464 i=int(1.0+xl(3)*(x-xl(1)),mpi)
469 jnhist(j)=jnhist(j)+1
471 inhist(i)=inhist(i)+1
473 dl(2)=dl(2)+(x-xl(6))**2
500 INTEGER(mpi),
INTENT(IN) :: n
501 REAL(mps),
INTENT(IN) :: tab(n)
502 REAL(mps),
INTENT(OUT) :: xa
503 REAL(mps),
INTENT(OUT) :: xb
506 DATA bin/1.0,1.5,2.0,3.0,4.0,5.0,8.0,10.0,15.0,20.0/
518 m1=int(1.0+0.05*real(n),mpi)
519 m2=int(1.0+0.16*real(n),mpi)
520 x1=tab(m1)-4.0*(tab(m2)-tab(m1))
521 IF(x1 < 0.0.AND.tab(1) >= 0.0) x1=tab(1)
522 x2=tab(n+1-m1)+4.0*(tab(n+1-m1)-tab(n+1-m2))
523 IF(x2 > 0.0.AND.tab(n) <= 0.0) x2=tab(n)
526 IF(x1*tab(1) <= 0.0) x1=0.0
527 IF(x2*tab(n) <= 0.0) x2=0.0
529 IF(x1*x2 < 0.0.AND.min(-x1,x2) > 0.6*max(-x1,x2))
THEN
533 ELSE IF(x1*x2 > 0.0.AND. &
534 abs(min(x1,x2)) < 0.4*abs(max(x1,x2)))
THEN
554 iexp=int(101.0+log10(dx)-log10(6.0*bin(i)),mpi)
558 n1=int(abs(x1)/dd,mpi)
560 IF(real(n1,mps)*dd > x1) n1=n1-1
563 n2=int(abs(x2)/dd,mpi)
565 IF(real(n2,mps)*dd < x2) n2=n2+1
573 IF(n2-n1 < 6.AND.n2 /= 0)
THEN
577 IF (nch > 0)
GO TO 10
579 print *,
' BINTAB: break infinite loop ', n1, n2, n, x1, x2, dd
584 xa=sign(real(n1,mps)*dd,x1)
585 xb=sign(real(n2,mps)*dd,x2)
587 IF((x2-x1)/(xb-xa) > rat)
THEN
609 INTEGER(mpi),
INTENT(IN OUT) :: lun
610 INTEGER(mpi),
INTENT(IN) :: n
611 INTEGER(mpi),
INTENT(IN) :: list(n)
612 INTEGER(mpi) :: li(7)
613 DATA li/2,3,4,6,8,9,12/
626 IF(list(i) > lp.OR.list(i) < ln)
GO TO 20
630 WRITE(lun,101) (list(i),i=ia,ib)
632 WRITE(lun,102) (list(i),i=ia,ib)
634 WRITE(lun,103) (list(i),i=ia,ib)
636 WRITE(lun,104) (list(i),i=ia,ib)
638 WRITE(lun,105) (list(i),i=ia,ib)
640 WRITE(lun,106) (list(i),i=ia,ib)
642 WRITE(lun,107) (list(i),i=ia,ib)
693 REAL(mps),
DIMENSION(:,:),
ALLOCATABLE ::
array
694 REAL(mps),
DIMENSION(:,:),
ALLOCATABLE ::
array4
695 REAL(mps),
DIMENSION(:),
ALLOCATABLE ::
array1
708 INTEGER(mpi),
INTENT(IN) :: ig
709 INTEGER(mpi),
INTENT(IN) :: ityp
710 CHARACTER (LEN=*),
INTENT(IN) :: text
732 IF(ig < 1.OR.ig > numgxy)
RETURN
733 IF(ityp < 1.OR.ityp > 5)
RETURN
734 IF(
nstr(ig) == 0)
THEN
770 INTEGER(mpi),
INTENT(IN) :: ig
771 REAL(mps),
INTENT(IN) :: x
772 REAL(mps),
INTENT(IN) :: y
774 IF(ig < 1.OR.ig > numgxy)
RETURN
775 IF(
igtp(ig) < 1.OR.
igtp(ig) > 3)
RETURN
787 INTEGER(mpi),
INTENT(IN) :: ig
788 REAL(mps),
INTENT(IN) :: x
789 REAL(mps),
INTENT(IN) :: y
790 REAL(mps),
INTENT(IN) :: dx
791 REAL(mps),
INTENT(IN) :: dy
793 IF(ig < 1.OR.ig > numgxy)
RETURN
794 IF(
igtp(ig) /= 4)
RETURN
811 INTEGER(mpi),
INTENT(IN) :: ig
812 REAL(mps),
INTENT(IN) :: x
813 REAL(mps),
INTENT(IN) :: y
818 IF(ig < 1.OR.ig > numgxy)
RETURN
819 IF(
igtp(ig) /= 5)
RETURN
822 IF(
nst(1,ig) == 0)
THEN
838 IF(
nst(2,ig) ==
nst(3,ig))
THEN
880 INTEGER(mpi),
INTENT(IN) :: ig
886 IF(ig <= 0.OR.ig > numgxy)
RETURN
892 IF(
igtp(igc) >= 1.AND.
igtp(igc) <= 3)
THEN
894 WRITE(*,*)
'Store ',igc,
': ',
gtext(igc)
895 IF(
jflc(4,igc) == 0)
THEN
896 WRITE(*,*)
' stored n-tuples: ',
jflc(3,igc)
898 WRITE(*,*)
' stored n-tuples, not-stored n-tuples: ', &
908 ELSE IF(
igtp(igc) == 4)
THEN
911 WRITE(*,*)
'Store ',igc,
': ',
gtext(igc)
912 IF(
jflc(4,igc) == 0)
THEN
913 WRITE(*,*)
' stored n-tuples: ',
jflc(3,igc)
915 WRITE(*,*)
' stored n-tuples, not-stored n-tuples: ', &
922 WRITE(*,102) n,(
array4(j,n),j=1,4)
925 ELSE IF(
igtp(igc) == 5)
THEN
929 IF(
nst(1,igc) == 1)
THEN
938 wght=real(n,mps)/real(
nst(3,igc)*
kflc(5,igc),mps)
949 WRITE(*,*)
'Store ',igc,
': ',
gtext(igc)
950 IF(
jflc(4,igc) == 0)
THEN
951 WRITE(*,*)
' stored n-tuples: ',
jflc(3,igc)
953 WRITE(*,*)
' stored n-tuples, not-stored n-tuples: ', &
959 WRITE(*,102) n,(
array4(j,n),j=1,4)
964102
FORMAT(i12,4g15.7)
979 INTEGER(mpi),
INTENT(IN) :: lunw
998 INTEGER(mpi),
INTENT(IN) :: ig
1005 IF(ig <= 0.OR.ig > numgxy)
RETURN
1010 IF(
igtp(igc) == 5)
THEN
1014 IF(
nst(1,igc) == 1)
THEN
1023 wght=real(n,mps)/real(
nst(3,igc)*
kflc(5,igc),mps)
1034 IF(
jflc(3,igc)+
jflc(4,igc) /= 0)
THEN
1039 IF(
igtp(igc) >= 1.AND.
igtp(igc) <= 3)
THEN
1041 WRITE(
lun,204)
'x-y'
1045 ELSE IF(
igtp(igc) == 4.OR.
igtp(igc) == 5)
THEN
1047 WRITE(
lun,204)
'x-y-dx-dy'
1052 WRITE(
lun,204)
'end of xy-data'
1056201
FORMAT(
'XY-Data ',i4,10x,
'version ',i4,10x,
'type',i2)
1057203
FORMAT(10x,
'stored not-stored ',2i10)
1059205
FORMAT(3x,4g15.7)
1067 REAL(
mps),
DIMENSION(:,:),
ALLOCATABLE ::
tk
1068 INTEGER(mpi),
DIMENSION(:),
ALLOCATABLE ::
next
1081 INTEGER(mpi),
INTENT(IN) :: ndim
1093 ALLOCATE (
tk(2,ndim))
1094 ALLOCATE (
next(ndim))
1112 INTEGER(mpi) :: ifre
1114 INTEGER(mpi),
INTENT(INOUT) :: jflc(5)
1115 REAL(mps),
INTENT(IN) :: x
1116 REAL(mps),
INTENT(IN) :: y
1119 IF(ifre == 0.OR.jflc(3) >= jflc(5))
THEN
1123 IF(jflc(1) == 0)
THEN
1142 INTEGER(mpi) :: ifrea
1143 INTEGER(mpi) :: ifreb
1145 INTEGER(mpi),
INTENT(INOUT) :: jflc(5)
1146 REAL(mps),
INTENT(IN) :: four(4)
1153 IF(ifreb == 0.OR.jflc(3) >= 2*jflc(5))
THEN
1157 IF(jflc(1) == 0)
THEN
1181 INTEGER(mpi),
INTENT(IN) :: jflc(5)
1182 INTEGER(mpi),
INTENT(OUT) :: n
1183 REAL(mps),
INTENT(OUT) :: array(2,*)
118710
IF(ind == 0)
RETURN
1189 array(1,n)=
tk(1,ind)
1190 array(2,n)=
tk(2,ind)
1200 INTEGER(mpi) :: ind1
1201 INTEGER(mpi) :: ind2
1203 INTEGER(mpi),
INTENT(IN) :: jflc(5)
1204 INTEGER(mpi),
INTENT(OUT) :: n
1205 REAL(mps),
INTENT(OUT) :: array(4,*)
120910
IF(ind1 == 0)
RETURN
1211 IF(ind2 == 0)
RETURN
1213 array(1,n)=
tk(1,ind1)
1214 array(2,n)=
tk(2,ind1)
1215 array(3,n)=
tk(1,ind2)
1216 array(4,n)=
tk(2,ind2)
1228 INTEGER(mpi),
INTENT(IN) :: jflc(5)
1229 INTEGER(mpi),
INTENT(OUT) :: n
1230 REAL(mps),
INTENT(OUT) :: array(*)
123410
IF(ind == 0)
RETURN
1250 INTEGER(mpi),
INTENT(INOUT) :: jflc(5)
1270 INTEGER(mpi),
INTENT(IN) :: n
1271 REAL(mps),
INTENT(IN OUT) :: x(n)
1272 REAL(mps),
INTENT(OUT) :: xloc
1273 REAL(mps),
INTENT(OUT) :: xsca
1280 xloc=0.5*(x((n+1)/2)+x((n+2)/2))
1285 xsca=1.4826*0.5*(x((n+1)/2)+x((n+2)/2))
subroutine hmplun(lunw)
unit for output
subroutine hmpmak(inhist, fnhist, jnhist, xl, dl)
hist scale from data
subroutine gmpdef(ig, ityp, text)
book, reset XY storage
subroutine gmpxy(ig, x, y)
add (X,Y) pair
subroutine bintab(tab, n, xa, xb)
hist scale from data
subroutine hmpdef(ih, xa, xb, text)
book, reset histogram
subroutine rmesig(x, n, xloc, xsca)
robust mean and sigma
subroutine stmars(ndim)
init/reset storage
subroutine gmplun(lunw)
unit for output
subroutine gmpxyd(ig, x, y, dx, dy)
add (X,Y,DX,DY)
subroutine stmadp(jflc, four)
store double pair
subroutine kprint(lun, list, n)
print integer array
subroutine stmapr(jflc, x, y)
store pair (X,Y)
subroutine hmpwrt(ih)
write histogram text file
subroutine gmpwrt(ig)
write XY text file
subroutine hmpldf(ih, text)
book, reset log histogram
subroutine stmacp(jflc, array, n)
copy (cp) all pairs to array
subroutine gmprnt(ig)
print XY data
subroutine hmpent(ih, x)
entry flt.pt.
subroutine hmplnt(ih, ix)
entry integer
subroutine stmarm(jflc)
remove (rm) stored pairs
subroutine gmpms(ig, x, y)
mean sigma(X) from Y
subroutine stmacp1(jflc, array, n)
copy (cp) all pairs to array1
subroutine hmprnt(ih)
print, content vert
subroutine stmacp4(jflc, array, n)
copy (cp) all pairs to array4
subroutine heapf(a, n)
Heap sort direct (real).
integer(mpi), parameter numgxy
number of XY data plots
integer(mpi), dimension(5, numgxy) kflc
meta data
integer(mpi) lun
unit for output
character(len=60), dimension(numgxy) gtext
text
real(mps), dimension(:,:), allocatable array
X,Y.
real(mps), dimension(:,:), allocatable array4
X,Y,DX,DY.
real(mps), dimension(:), allocatable array1
Y(X)
integer(mpi), dimension(5, numgxy) jflc
meta data
real(mps), dimension(numgxy) y1
first Y (as X) for GMPMS
integer(mpi), dimension(numgxy) igtp
type of XY data
integer(mpi), dimension(numgxy) lvers
version
real(mps), dimension(10, numgxy) xyplws
additional data for GMPMS
integer(mpi), dimension(numgxy) nstr
initialization flag
integer(mpi), dimension(3, numgxy) nst
counters for GMPMS
integer(mpi), parameter nbin
number of bins
integer(mpi), parameter numhis
number of histograms
integer(mpi), parameter nsampl
number of samples for auto scaling
integer(mpi), dimension(numhis) khist
histgram type
real(mps), dimension(6, numhis) xl
histogram binning
integer(mpi) lun
unit for output
character(len=60), dimension(numhis) htext
histogram text
integer(mpi), dimension(numhis) kvers
histogram version
real(mps), dimension(nsampl, numhis) fnhist
initial data for auto scaling
real(mpd), dimension(2, numhis) dl
histogram moments
integer(mpi), dimension(5, numhis) jnhist
histogram statistics
integer(mpi), dimension(nbin, numhis) inhist
histogram (bin) data
integer, parameter mps
single precision
integer(mpi), dimension(:), allocatable next
real(mps), dimension(:,:), allocatable tk
subroutine pfvert(n, x)
Vertical print of floating point data.
subroutine pivert(n, list)
Vertical print of integer data.
subroutine psvert(xa, xb)
Print scale.