865 character(len=*) :: ParticleLine
866 integer :: i, j, fieldwidth, spaces(1:13)
867 character(len=150) :: FindInputFmt1
868 integer :: MomentumCharacters(1:5), LifetimeCharacters, LifetimeDigitsAfterDecimal, SpinCharacters, SpinDigitsAfterDecimal
869 logical :: LifetimeIsExponential, SpinIsExponential
870 character(len=40) :: FormatParts(11)
874 do while (particleline(i:i) .eq.
" ")
876 spaces(1) = spaces(1)+1
880 do while (particleline(i:i) .ne.
" ")
882 fieldwidth = fieldwidth+1
884 spaces(1) = spaces(1) + fieldwidth - 3
888 do while (particleline(i:i) .eq.
" ")
890 spaces(2) = spaces(2)+1
894 do while (particleline(i:i) .ne.
" ")
896 fieldwidth = fieldwidth+1
898 spaces(2) = spaces(2) + fieldwidth - 2
902 do while (particleline(i:i) .eq.
" ")
904 spaces(3) = spaces(3)+1
907 do while (particleline(i:i) .ne.
" ")
909 fieldwidth = fieldwidth+1
911 spaces(3) = spaces(3) + fieldwidth - 2
915 do while (particleline(i:i) .eq.
" ")
917 spaces(4) = spaces(4)+1
920 do while (particleline(i:i) .ne.
" ")
922 fieldwidth = fieldwidth+1
924 spaces(4) = spaces(4) + fieldwidth - 2
928 do while (particleline(i:i) .eq.
" ")
930 spaces(5) = spaces(5)+1
933 do while (particleline(i:i) .ne.
" ")
935 fieldwidth = fieldwidth+1
937 spaces(5) = spaces(5) + fieldwidth - 3
941 do while (particleline(i:i) .eq.
" ")
943 spaces(6) = spaces(6)+1
946 do while (particleline(i:i) .ne.
" ")
948 fieldwidth = fieldwidth+1
950 spaces(6) = spaces(6) + fieldwidth - 3
958 do while (particleline(i:i) .eq.
" ")
960 spaces(j) = spaces(j)+1
962 if (particleline(i:i) .eq.
"-")
then
965 spaces(j) = spaces(j)-1
970 momentumcharacters(j-6) = 1
971 do while (particleline(i:i) .ne.
" ")
973 momentumcharacters(j-6) = momentumcharacters(j-6)+1
982 do while (particleline(i:i) .eq.
" ")
984 spaces(12) = spaces(12)+1
988 lifetimecharacters = 0
989 lifetimedigitsafterdecimal = -1
990 lifetimeisexponential = .false.
991 do while (particleline(i:i) .ne.
" ")
992 if ((lifetimedigitsafterdecimal .ge. 0 .and. .not.lifetimeisexponential) &
993 .or. particleline(i:i) .eq.
".")
then
994 lifetimedigitsafterdecimal = lifetimedigitsafterdecimal+1
996 if (particleline(i:i) .eq.
"E" .or. particleline(i:i) .eq.
"e")
then
997 lifetimeisexponential = .true.
1000 lifetimecharacters = lifetimecharacters+1
1006 do while (particleline(i:i) .eq.
" ")
1008 spaces(13) = spaces(13)+1
1010 if (particleline(i:i) .eq.
"-")
then
1013 spaces(13) = spaces(13)-1
1019 spindigitsafterdecimal = -1
1020 spinisexponential = .false.
1021 do while (particleline(i:i) .ne.
" ")
1022 if (spindigitsafterdecimal .ge. 0 .or. particleline(i:i) .eq.
".")
then
1023 spindigitsafterdecimal = spindigitsafterdecimal+1
1025 if (particleline(i:i) .eq.
"E" .or. particleline(i:i) .eq.
"e")
then
1026 spinisexponential = .true.
1029 spincharacters = spincharacters+1
1037 if (spaces(i).eq.0)
then
1039 if (i.ge.7 .and. i.le.11)
then
1040 momentumcharacters(i-6) = momentumcharacters(i-6)-1
1043 spincharacters = spincharacters-1
1050 if (spaces(1).eq.0)
then
1051 formatparts(1) =
"(I3,"
1053 write(formatparts(1),
"(A,I1,A)")
"(", spaces(1),
"X,I3,"
1056 write(formatparts(2),
"(I1,A)") spaces(2),
"X,I2,"
1058 write(formatparts(3),
"(I1,A,I1,A)") spaces(3),
"X,I2,", spaces(4),
"X,I2,"
1060 write(formatparts(4),
"(I1,A,I1,A)") spaces(5),
"X,I3,", spaces(6),
"X,I3,"
1064 if (momentumcharacters(i-4) .lt. 10)
then
1065 write(formatparts(i),
"(I1,A,I1,A,I1,A)") spaces(i+2),
"X,1PE", momentumcharacters(i-4),
".", momentumcharacters(i-4)-7,
","
1066 elseif (momentumcharacters(i-4) .lt. 17)
then
1067 write(formatparts(i),
"(I1,A,I2,A,I1,A)") spaces(i+2),
"X,1PE", momentumcharacters(i-4),
".", momentumcharacters(i-4)-7,
","
1069 write(formatparts(i),
"(I1,A,I2,A,I2,A)") spaces(i+2),
"X,1PE", momentumcharacters(i-4),
".", momentumcharacters(i-4)-7,
","
1074 if (lifetimeisexponential)
then
1075 if (lifetimecharacters .lt. 10)
then
1076 write(formatparts(10),
"(I1,A,I1,A,I1,A)") &
1077 spaces(12),
"X,1PE",lifetimecharacters,
".",lifetimedigitsafterdecimal,
","
1078 elseif (lifetimedigitsafterdecimal.lt.10)
then
1079 write(formatparts(10),
"(I1,A,I2,A,I1,A)") &
1080 spaces(12),
"X,1PE",lifetimecharacters,
".",lifetimedigitsafterdecimal,
","
1082 write(formatparts(10),
"(I1,A,I2,A,I2,A)") &
1083 spaces(12),
"X,1PE",lifetimecharacters,
".",lifetimedigitsafterdecimal,
","
1086 if (lifetimecharacters .lt. 10)
then
1087 write(formatparts(10),
"(I1,A,I1,A,I1,A)") &
1088 spaces(12),
"X,1F",lifetimecharacters,
".",lifetimedigitsafterdecimal,
","
1089 elseif (lifetimedigitsafterdecimal.lt.10)
then
1090 write(formatparts(10),
"(I1,A,I2,A,I1,A)") &
1091 spaces(12),
"X,1F",lifetimecharacters,
".",lifetimedigitsafterdecimal,
","
1093 write(formatparts(10),
"(I1,A,I2,A,I2,A)") &
1094 spaces(12),
"X,1F",lifetimecharacters,
".",lifetimedigitsafterdecimal,
","
1099 if (spinisexponential)
then
1100 if (spincharacters .lt. 10)
then
1101 write(formatparts(11),
"(I1,A,I1,A,I1,A)") &
1102 spaces(13),
"X,1PE",spincharacters,
".",spindigitsafterdecimal,
")"
1103 elseif (spindigitsafterdecimal.lt.10)
then
1104 write(formatparts(11),
"(I1,A,I2,A,I1,A)") &
1105 spaces(13),
"X,1PE",spincharacters,
".",spindigitsafterdecimal,
")"
1107 write(formatparts(11),
"(I1,A,I2,A,I2,A)") &
1108 spaces(13),
"X,1PE",spincharacters,
".",spindigitsafterdecimal,
")"
1111 if (spincharacters .lt. 10)
then
1112 write(formatparts(11),
"(I1,A,I1,A,I1,A)") &
1113 spaces(13),
"X,1F",spincharacters,
".",spindigitsafterdecimal,
")"
1114 elseif (spindigitsafterdecimal.lt.10)
then
1115 write(formatparts(11),
"(I1,A,I2,A,I1,A)") &
1116 spaces(13),
"X,1F",spincharacters,
".",spindigitsafterdecimal,
")"
1118 write(formatparts(11),
"(I1,A,I2,A,I2,A)") &
1119 spaces(13),
"X,1F",spincharacters,
".",spindigitsafterdecimal,
")"
1127 findinputfmt1 = (trim(formatparts(1)) &
1128 // trim(formatparts(2)) &
1129 // trim(formatparts(3)) &
1130 // trim(formatparts(4)) &
1131 // trim(formatparts(5)) &
1132 // trim(formatparts(6)) &
1133 // trim(formatparts(7)) &
1134 // trim(formatparts(8)) &
1135 // trim(formatparts(9)) &
1136 // trim(formatparts(10)) &
1137 // trim(formatparts(11)))