CHECK v.3.2-->                                                          MKCA001
C      Subroutine mkcadt(mcaaat, atomin, cadsts, seqbcd, chnsz, chnct,  MKCA002
C     +                  seqlen)                                        MKCA003
      Subroutine mkcadt(mcaaat, atomin, cadsts, seqbcd,                 MKCA001
     &                  seqlen)                                         MKCA002
CHECK v.3.2<--                                                          MKCA003
c                                                                       MKCA004
c     generate the calpha distances for I+1 to I+11. take note of nulls MKCA005
c     accross brookhaven chain breaks but not accross disconections at  MKCA006
c     this point                                                        MKCA007
c                                                                       MKCA008
      include 'sstruc.par'                                              MKCA009
CHECK v.3.2-->                                                          MKCA010
C      integer   seqlen, chnct, chnsz(maxchn)                           MKCA011
      integer   seqlen                                                  MKCA012
CHECK v.3.2<--                                                          MKCA013
      real      mcaaat(ncoord,mnchna,maxres), cadsts(11,maxres)         MKCA014
      logical   atomin(mnchna,maxres)                                   MKCA015
      character seqbcd(maxres)*6                                        MKCA016
                                                                        MKCA017
      integer   nxres, nxdist                                           MKCA018
      real      mxdist, adist                                           MKCA019
      parameter (mxdist = 99.9)                                         MKCA020
      real      atdist                                                  MKCA021
                                                                        MKCA022
      do 1000, nxres = 1, seqlen                                        MKCA023
      do 500, nxdist = 1, 11                                            MKCA024
      if (nxres+nxdist .gt. seqlen .or.                                 MKCA025
     &   .not. atomin(calph,nxres)) then                                MKCA026
         cadsts(nxdist,nxres) = -1                                      MKCA027
      else                                                              MKCA028
         if (seqbcd(nxres)(1:1) .ne. seqbcd(nxres+nxdist)(1:1)          MKCA029
     &      .or. .not. atomin(calph,nxres+nxdist)) then                 MKCA030
            cadsts(nxdist,nxres) = -1                                   MKCA031
         else                                                           MKCA032
            adist = atdist(mcaaat(1,calph,nxres),                       MKCA033
     &                     mcaaat(1,calph,nxres+nxdist))                MKCA034
            if (adist .gt. mxdist) adist = mxdist                       MKCA035
            cadsts(nxdist,nxres) = adist                                MKCA036
         end if                                                         MKCA037
      end if                                                            MKCA038
  500 continue                                                          MKCA039
 1000 continue                                                          MKCA040
      END                                                               MKCA041
