<commit_before>#ifdef FLUKA

subroutine check_coupling_integrity
!
!-----------------------------------------------------------------------
!     A.Mereghetti, for the FLUKA Team
!     last modified: 17-07-2013
!     check that an entrance MARKER is followed by an exit one in the
!        accelerator sequence, even though not immediately
!     inserted in main code by the 'fluka' compilation flag
!-----------------------------------------------------------------------

      use floatPrecision
      use mod_fluka
      use crcoall
      use parpro
      use mod_common
      use mod_common_track
      use aperture
      implicit none

!     temporary variables
      integer i1 , i2
      integer ix1, ix2
      integer istart, istop
      logical lerr, lfound, lcurturn

      lerr = .false.

      write(lout,*) ''
      write(lout,10010)
      write(lout,*) ' CALL TO CHECK_COUPLING_INTEGRITY '
      write(lout,*) ' NB: only entrance/exit markers are listed;'
      write(lout,*) '     a single entry is by definition righteous'
      write(lout,10010)
      write(lout,*) ''
      write(lout,*) ''
      write(lout,*) '        keys to FLUKA types:'
      write(lout,*) FLUKA_ELEMENT,' --> simple element'
      write(lout,*) FLUKA_ENTRY,' --> entrance point'
      write(lout,*) FLUKA_EXIT,' --> exit point'
      write(lout,*) ''
      write(lout,*) ''

      i1=1
      do while ( i1.le.iu )
        if(ktrack(i1).ne.1.and.ic(i1).gt.nblo) then
!         SINGLE ELEMENT
          ix1=ic(i1)-nblo
          if ( fluka_type(ix1).eq.FLUKA_ENTRY ) then
            write(lout,*) ''
            write(lout,*) ''
            write(lout,10020) 'entry type', 'name', 'ID SING EL ID struct', 'ID geom'
            write(lout,10030) fluka_type(ix1), bez(ix1), ix1, i1, fluka_geo_index(ix1)
            istart = i1+1
            istop  = iu
            lcurturn = .true.
            lfound = .false.
 1982       continue
            do i2=istart,istop
              if(ktrack(i2).ne.1.and.ic(i2).gt.nblo) then
!               SINGLE ELEMENT
                ix2=ic(i2)-nblo
                if ( fluka_type(ix2).eq.FLUKA_EXIT ) then
                  if(fluka_geo_index(ix1).eq.fluka_geo_index(ix2))then
                    write(lout,10030) fluka_type(ix2), bez(ix2), ix2, i2, fluka_geo_index(ix2)
                    call contour_aperture_markers( i1, i2, .true.  )
                    i1 = i2 + 1
                    lfound = .true.
                    if ( lcurturn ) then
                      exit
                    else
                      goto 1983
                    endif
                  else<commit_msg>fixing header to table listing markers of FLUKA insertions<commit_after>#ifdef FLUKA

subroutine check_coupling_integrity
!
!-----------------------------------------------------------------------
!     A.Mereghetti, for the FLUKA Team
!     last modified: 17-07-2013
!     check that an entrance MARKER is followed by an exit one in the
!        accelerator sequence, even though not immediately
!     inserted in main code by the 'fluka' compilation flag
!-----------------------------------------------------------------------

      use floatPrecision
      use mod_fluka
      use crcoall
      use parpro
      use mod_common
      use mod_common_track
      use aperture
      implicit none

!     temporary variables
      integer i1 , i2
      integer ix1, ix2
      integer istart, istop
      logical lerr, lfound, lcurturn

      lerr = .false.

      write(lout,*) ''
      write(lout,10010)
      write(lout,*) ' CALL TO CHECK_COUPLING_INTEGRITY '
      write(lout,*) ' NB: only entrance/exit markers are listed;'
      write(lout,*) '     a single entry is by definition righteous'
      write(lout,10010)
      write(lout,*) ''
      write(lout,*) ''
      write(lout,*) '        keys to FLUKA types:'
      write(lout,*) FLUKA_ELEMENT,' --> simple element'
      write(lout,*) FLUKA_ENTRY,' --> entrance point'
      write(lout,*) FLUKA_EXIT,' --> exit point'
      write(lout,*) ''
      write(lout,*) ''

      i1=1
      do while ( i1.le.iu )
        if(ktrack(i1).ne.1.and.ic(i1).gt.nblo) then
!         SINGLE ELEMENT
          ix1=ic(i1)-nblo
          if ( fluka_type(ix1).eq.FLUKA_ENTRY ) then
            write(lout,*) ''
            write(lout,*) ''
            write(lout,10020) 'entry type', 'name', 'ID SING EL', 'ID struct', 'ID geom'
            write(lout,10030) fluka_type(ix1), bez(ix1), ix1, i1, fluka_geo_index(ix1)
            istart = i1+1
            istop  = iu
            lcurturn = .true.
            lfound = .false.
 1982       continue
            do i2=istart,istop
              if(ktrack(i2).ne.1.and.ic(i2).gt.nblo) then
!               SINGLE ELEMENT
                ix2=ic(i2)-nblo
                if ( fluka_type(ix2).eq.FLUKA_EXIT ) then
                  if(fluka_geo_index(ix1).eq.fluka_geo_index(ix2))then
                    write(lout,10030) fluka_type(ix2), bez(ix2), ix2, i2, fluka_geo_index(ix2)
                    call contour_aperture_markers( i1, i2, .true.  )
                    i1 = i2 + 1
                    lfound = .true.
                    if ( lcurturn ) then
                      exit
                    else
                      goto 1983
                    endif
                  else
{'fraction_non_alphanumeric': 0.15179584120982986, 'fraction_numerical': 0.030245746691871456, 'mean_word_length': 1.4597861459786146, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '758610', 'n_tokens_mistral': 1776, 'n_tokens_neox': 1657, 'n_words': 393}