~alifson/chiralityflow/trunk

« back to all changes in this revision

Viewing changes to vendor/StdHEP/src/stdhep/parsecsv.F

  • Committer: andrew.lifson at lu
  • Date: 2021-09-01 15:34:39 UTC
  • Revision ID: andrew.lifson@thep.lu.se-20210901153439-7fasjhav4cp4m88r
testing a new repository of a madgraph folder

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
      subroutine parsecsv
 
3
C
 
4
C   This routine reads a line from the new, complete, 
 
5
C   mass and width table supplied by PDG.
 
6
C   This routine works with the 2006 table:
 
7
C   FORMAT (BN, E14.0, 1X, 2(E7.0, 1X), E12.0, 1X, 2(E7.0, 1X), A3, 1X, A1, 1X, A4, 1X, 3(A1, 1X), A7, 1X, A4, 1X, 2(A1, 1X), A17, 1X, A)
 
8
C
 
9
      implicit none
 
10
C
 
11
#include "stdlun.inc"
 
12
#include "stdcsv.inc"
 
13
C
 
14
      integer i,frac
 
15
      real top,bottom
 
16
C
 
17
c set everything to zero, just in case
 
18
      mval = 0.
 
19
      wval = 0.
 
20
      mpos = 0.
 
21
      mneg = 0.
 
22
      wpos = 0.
 
23
      wneg = 0.
 
24
      chg = 0
 
25
      pdgid = 0
 
26
      name = ' '
 
27
 
 
28
c make sure this is not an old style file or a comment
 
29
      if (cline(1:1).eq.'M' .or. cline(1:1).eq.'W' 
 
30
     &    .or. cline(1:1).eq.'*') then
 
31
           return
 
32
      endif
 
33
 
 
34
c      write(lnhout,202) cline
 
35
      read(cline(1:14), fmt = '( BN,E14.0)') mval
 
36
      read(cline(16:22), fmt = '( BN,E7.0)') mpos
 
37
      read(cline(24:30), fmt = '( BN,E7.0)') mneg
 
38
c      write(lnhout,101) mval, mpos, mneg
 
39
      read(cline(32:43), fmt = '( BN,E12.0)') wval
 
40
      read(cline(45:51), fmt = '( BN,E7.0)') wpos
 
41
      read(cline(53:59), fmt = '( BN,E7.0)') wneg
 
42
c      write(lnhout,102) wval, wpos, wneg
 
43
      ispin = cline(61:63)
 
44
      gpar = cline(65:65)
 
45
      jspin = cline(67:70)
 
46
      ppar = cline(72:72)
 
47
      cpar = cline(74:74)
 
48
      antip = cline(76:76)
 
49
c      write(lnhout,103) ispin, gpar, jspin, ppar, antip
 
50
      read(cline(78:84), fmt = '( BN,I7)') pdgid
 
51
c      write(lnhout,104) pdgid
 
52
      cchg = cline(86:89)
 
53
      rank = cline(91:91)
 
54
      status = cline(93:93)
 
55
      name = cline(95:111)
 
56
      quarklist = cline(113:128)
 
57
c      write(lnhout,105) cchg, rank, status, name, quarklist
 
58
 
 
59
C translate charge
 
60
      frac=0 
 
61
      do i=1,4
 
62
        if(cchg(i:i).eq.'/') frac=i
 
63
      enddo
 
64
      if( frac.eq.0) then
 
65
          if(cchg.eq.'  ++')then
 
66
             chg = 6
 
67
          elseif(cchg.eq.'  --')then
 
68
             chg = -6
 
69
          elseif(cchg.eq.'   +')then
 
70
             chg = 3
 
71
          elseif(cchg.eq.'   -')then
 
72
             chg = -3
 
73
          elseif(cchg.eq.'   0')then
 
74
             chg = 0
 
75
          else
 
76
           write(lnhout,502) cchg
 
77
          endif
 
78
      else
 
79
          read(cchg(1:frac-1),fmt='(BN,E4.0)') top
 
80
          read(cchg(frac+1:4),fmt='(BN,E4.0)') bottom
 
81
          if(bottom.ne.3)then
 
82
              write(lnhout,501) cchg, top, bottom
 
83
          else
 
84
              chg = top
 
85
          endif
 
86
      endif
 
87
 
 
88
      return
 
89
 
 
90
c 101  format(' mass: ',F15.8,1X,G11.5,1X,G11.5)
 
91
c 102  format('width: ',F15.8,1X,G11.5,1X,G11.5)
 
92
c 103  format('spin/parity: ',5A5)
 
93
c 104  format('PDG ID: ',I10)
 
94
c 105  format('name, etc: ',3A5,A20,A30)
 
95
 202  format('reading : ',A130)
 
96
 501  format('PARSECSV ERROR: failed to properly parse ',A4,
 
97
     &       ' got ',F5.1,' over ',F5.1)
 
98
 502  format('PARSECSV ERROR: failed to properly parse ',A4)
 
99
      end