/[PAMELA software]/DarthVader/TrackerLevel2/src/F77/filladc.f
ViewVC logotype

Diff of /DarthVader/TrackerLevel2/src/F77/filladc.f

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by mocchiut, Fri May 19 13:15:55 2006 UTC revision 1.3 by pam-fi, Tue Sep 5 12:52:21 2006 UTC
# Line 2  Line 2 
2    
3    
4        include 'commontracker.f'        include 'commontracker.f'
       include 'common_reduction.f'  
5        include 'level0.f'        include 'level0.f'
6          include 'level1.f'
7        include 'calib.f'        include 'calib.f'
8    
9    
10          include 'common_reduction.f'
11    
12    
13        external nvk        external nvk
14        external nst        external nst
15    
# Line 63  C--------------------------------------- Line 66  C---------------------------------------
66            call compdecode(word,flag,tipo,info,errflag)            call compdecode(word,flag,tipo,info,errflag)
67    
68            if(errflag.ne.0.) then            if(errflag.ne.0.) then
69              print*,'filladc --> ERROR on compdecode'              if(debug)print*,'filladc --> ERROR on compdecode'
70              iflag=1              iflag=1
71              return              return
72            endif            endif
# Line 71  C--------------------------------------- Line 74  C---------------------------------------
74            if(flag.eq.1) then    !   flag: fine messaggio (ladder)            if(flag.eq.1) then    !   flag: fine messaggio (ladder)
75    
76              if(info.ne.1.and.info.ne.2.and.info.ne.3) then              if(info.ne.1.and.info.ne.2.and.info.ne.3) then
77                print*,                if(debug)print*,
78       $             'filladc --> wrong end-of-ladder '       $             'filladc --> wrong end-of-ladder '
79       $             //'in COMPRESSED mode'       $             //'in COMPRESSED mode'
80                print*,                if(debug)print*,
81       $             '            info(=ladder) ',info,'  type ',tipo       $             '            info(=ladder) ',info,'  type ',tipo
82                iflag=1                iflag=1
83                return                return
# Line 87  C--------------------------------------- Line 90  C---------------------------------------
90                newVAL=max(0,newVAL)                newVAL=max(0,newVAL)
91                newVAL=min(4095,newVAL)                newVAL=min(4095,newVAL)
92                adc(DSPn,nvk(js),nst(js))=newVAL                adc(DSPn,nvk(js),nst(js))=newVAL
93  ccc   print*,DSPn,nvk(js),nst(js),newval  c$$$              print*,DSPn,nvk(js),nst(js)
94    c$$$     $             ,pedestal_t(DSPn,nvk(js),nst(js)),newval
95    c$$$     $             ,pedestal(DSPn,nvk(js),nst(js))
96              enddo              enddo
97                            
98              if(info.eq.3) goto 1000              if(info.eq.3) goto 1000
# Line 114  c     print*,DSPn,nvk(js),nst(js),newval Line 119  c     print*,DSPn,nvk(js),nst(js),newval
119                  is = iaddr                  is = iaddr
120                  prec_ind = 1                  prec_ind = 1
121                else                else
122                  print*,'filladc --> address '//                  if(debug)print*,'filladc --> address '//
123       $               'out of range - iaddr,is',iaddr,is       $               'out of range - iaddr,is',iaddr,is
124                  iflag=1                  iflag=1
125                  return                  return
# Line 124  c     print*,DSPn,nvk(js),nst(js),newval Line 129  c     print*,DSPn,nvk(js),nst(js),newval
129                if(prec_ind.eq.0) is=is+1                if(prec_ind.eq.0) is=is+1
130                if(info.ge.0.and.info.le.4095) then                if(info.ge.0.and.info.le.4095) then
131                  if(is.gt.3072)then                  if(is.gt.3072)then
132                    print*,                    if(debug)print*,
133       $                 'filladc --> strip out of range - DSPn,is'       $                 'filladc --> strip out of range - DSPn,is'
134       $                 ,DSPn,is       $                 ,DSPn,is
135                    iflag=1                    iflag=1
# Line 137  ccc   print*,DSPn,nvk(is),nst(is),newval Line 142  ccc   print*,DSPn,nvk(is),nst(is),newval
142                                    
143                  oldVAL=newVAL                  oldVAL=newVAL
144                else                else
145                  print*,'filladc --> datum out of range - info',info                  if(debug)
146         $               print*,'filladc --> datum out of range - info',info
147                  iflag=1                  iflag=1
148                  return                  return
149                endif                endif
# Line 177  c     endif Line 183  c     endif
183              enddo              enddo
184              idata = idata+1              idata = idata+1
185              if(datatracker(idata).ne.ior(z'1800',i+3)) then              if(datatracker(idata).ne.ior(z'1800',i+3)) then
186                print*,'filladc --> wrong end-of-ladder in FULL mode'                if(debug)
187                print*,'            word ',datatracker(idata)       $           print*,'filladc --> wrong end-of-ladder in FULL mode'
188                print*,'            should be ',ior(z'1800',i+3)                if(debug)
189         $           print*,'            word ',datatracker(idata)
190                  if(debug)
191         $           print*,'            should be ',ior(z'1800',i+3)
192                iflag=1                iflag=1
193                return                                  return                  
194              endif              endif
# Line 213  C--------------------------------------- Line 222  C---------------------------------------
222        flag=ishft(flag,-12)        flag=ishft(flag,-12)
223    
224        if(flag.ne.0.and.flag.ne.1) then        if(flag.ne.0.and.flag.ne.1) then
225          print*,'compdecode --> error on uncompression: flag=',flag  c        print*,'compdecode --> error on uncompression: flag=',flag
226          errflag=1.          errflag=1.
227        endif        endif
228        if(flag.eq.0) then        ! valore ADC        if(flag.eq.0) then        ! valore ADC
# Line 224  C--------------------------------------- Line 233  C---------------------------------------
233          info=iand(word,z'03ff')          info=iand(word,z'03ff')
234          tipo=iand(word,z'0c00')          tipo=iand(word,z'0c00')
235          if(tipo.ne.0.and.tipo.ne.z'0800') then          if(tipo.ne.0.and.tipo.ne.z'0800') then
236            print*,'compdecode --> error on decompression: tipo=',tipo  c          print*,'compdecode --> error on decompression: tipo=',tipo
237            errflag=1.            errflag=1.
238          endif          endif
239          if(tipo.eq.0) then      ! indirizzo          if(tipo.eq.0) then      ! indirizzo

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.23