S114 FORTRAN example for reading ASCII-Files
program s114_data
c ----------------------------------------------
implicit none
INTEGER Z(100)
INTEGER ZB,ZB3,ENUM
INTEGER ZB_12,ZB3_12,DZB3,NAL
INTEGER NZB,NZB3
INTEGER IENUM,I,INDEX
CHARACTER*80 ifilen
LOGICAL BINAC,BINCON
c open file
write (*,*) ' Enter filename :'
read (*,*) ifilen
open(unit=3,file=ifilen,status='old')
IENUM = 0
c start loop over events
1 CONTINUE
cc reset variables
BINCON = .false.
BINAC = .false.
BORDER = .false.
do I=1,100
Z(I) = 0
enddo
ZB_12 = 0
ZB3_12 = 0
INDEX=0
cc read event
read(3,2000,end=1000) ENUM,Z(1),Z(2),Z(3),Z(4),Z(5),
+ Z(6),Z(7),Z(8),Z(9),Z(10),Z(11),Z(12),ZB,ZB3
IENUM = IENUM + 1
cc calculate ZB_12,ZB3_12
do I=1,12
if (Z(I).ge.2) ZB_12 = ZB_12 + Z(I)
if (Z(I).ge.3) ZB3_12 = ZB3_12 + Z(I)
if (Z(I).ne.0) INDEX=I
enddo
cc determination of Z13,... for events with more than 12 fragments
if (INDEX.lt.12) then
if ((ZB_12.ne.ZB).or.(ZB3_12).ne.(ZB3)) BINCON = .true.
else
DZB3 = ZB3-ZB3_12
if (DZB3.ne.0) then
ccc IMF's
WRITE (*,*) 'IMF-RECONSTRUCTION FOR EVENT :',ENUM,' DZB3=',DZB3
IF (DZB3.eq.3) then
if (Z(12).lt.3) BINCON= .true.
Z(13) = 3
INDEX = 13
ELSEIF (DZB3.eq.4) then
if (Z(12).lt.4) BINCON= .true.
Z(13) = 4
INDEX = 13
ELSEIF (DZB3.eq.5) then
if (Z(12).lt.5) BINCON= .true.
Z(13) = 5
INDEX = 13
ELSEIF (DZB3.eq.6) then
IF (Z(12).ge.6) BINAC = .true.
if (Z(12).lt.3) BINCON= .true.
Z(13) = 3
Z(14) = 3
INDEX = 14
ELSEIF (DZB3.eq.7) then
IF (Z(12).ge.7) BINAC = .true.
if (Z(12).lt.4) BINCON= .true.
Z(13) = 4
Z(14) = 3
INDEX = 14
ELSEIF (DZB3.eq.8) then
IF (Z(12).ge.5) BINAC = .true.
if (Z(12).lt.4) BINCON= .true.
Z(13) = 4
Z(14) = 4
INDEX = 14
ELSEIF (DZB3.eq.9) then
IF (Z(12).ge.5) BINAC = .true.
if (Z(12).lt.3) BINCON= .true.
Z(13) = 3
Z(14) = 3
Z(15) = 3
INDEX = 15
ELSEIF (DZB3.gt.9) then
BINAC = .true.
ENDIF
ENDIF
ccc Alpha-particles
NAL = (ZB - ZB_12 - DZB3)/2
do i=1,NAL
INDEX=INDEX+1
Z(INDEX) = 2
enddo
endif
cc now charges of the INDEX fragments stored in Z(1,...,INDEX)
cc calculate nzb,nzb3,nal and check
NZB = 0
NZB3 = 0
do I=1,INDEX
NZB = NZB + Z(I)
if (Z(i).gt.2) NZB3=NZB3+Z(I)
enddo
if ((NZB.ne.ZB).or.(NZB3.ne.ZB3)) BINCON = .true.
cc warnings and errors
if (BINAC) then
write (*,*) ' No unambigous reconstruction possible for event ',ENUM
endif
if (BINCON) then
write (*,*) ' ERROR: INCONSISTENCY IN EVENT ',ENUM
endif
cc ---------------
cc privat analysis
cc ---------------
goto 1
c end loop over events
1000 close(3)
write (*,*) IENUM,' events scanned.'
2000 format(i8,14i4)
2001 format(i8,19i4)
end
Last updated: December 12th, 1995
Andreas Wörner