      Subroutine mkauth(seqbcd, autsum, ssord, astruc, seqlen)          MKAU001
c                                                                       MKAU002
c     reread the author structure records and create the structure      MKAU003
c                                                                       MKAU004
      include 'sstruc.par'                                              MKAU005
CHECK v.3.2-->                                                          MKAU006
      save hlxch                                                        MKAU007
CHECK v.3.2<--                                                          MKAU008
      character seqbcd(maxres)*6, autsum(maxres)*1, ssord*21            MKAU009
      logical   astruc                                                  MKAU010
      integer   seqlen                                                  MKAU011
      integer   respl                                                   MKAU012
                                                                        MKAU013
      integer   nxsym, stpos, finpos, lstpos, hlxno, hlxcls, nxres,     MKAU014
     &          strno, sense, strpri, hlxcds                            MKAU015
      parameter (hlxcds = 10)                                           MKAU016
      character stres*6, finres*6, autrec*80, strkch*1, shtid*3,        MKAU017
     &          hlxch(hlxcds)*1                                         MKAU018
      data hlxch/'H','J','I','K','G','L','M','N','O','P'/               MKAU019
CHECK v.3.2-->                                                          MKAU020
C      save hlxch                                                       MKAU021
CHECK v.3.2<--                                                          MKAU022
                                                                        MKAU023
      do 100, nxres = 1, seqlen                                         MKAU024
      autsum(nxres) = space                                             MKAU025
  100 continue                                                          MKAU026
                                                                        MKAU027
      if (astruc) then                                                  MKAU028
         Rewind(unit=authfi)                                            MKAU029
         lstpos = 0                                                     MKAU030
  200    continue                                                       MKAU031
         read(authfi,'(a)',end=2000) autrec                             MKAU032
         if (autrec(1:keylen) .eq. hlxkey) then                         MKAU033
            read(autrec,400) hlxno, stres(1:1), stres(2:6), finres(1:1),MKAU034
     &          finres(2:6), hlxcls                                     MKAU035
CHECK v.2.1.4-->                                                        MKAU036
C  400       format(7x,i3,9x,a1,x,a5,5x,a1,x,a5,i2)                     MKAU037
  400       format(7x,i3,9x,a1,1x,a5,5x,a1,1x,a5,i2)                    MKAU038
CHECK v.2.1.4<--                                                        MKAU039
            strkch = hlxch(1)                                           MKAU040
            if (hlxcls .le. hlxcds .and. hlxcls .gt. 0)                 MKAU041
     &         strkch = hlxch(hlxcls)                                   MKAU042
         else                                                           MKAU043
            if (autrec(1:keylen) .eq. shtkey) then                      MKAU044
               read(autrec,600) strno, shtid, stres, finres, sense      MKAU045
CHECK v.2.1.4-->                                                        MKAU046
C  600          format(7x,i3,x,a3,7x,a6,5x,a6,i2)                       MKAU047
  600          format(7x,i3,1x,a3,7x,a6,5x,a6,i2)                       MKAU048
CHECK v.2.1.4<--                                                        MKAU049
               strkch = shtsym                                          MKAU050
            else                                                        MKAU051
               if (autrec(1:keylen) .eq. trnkey) then                   MKAU052
                  read(autrec,800) stres, finres                        MKAU053
  800             format(19x,a6,5x,a6)                                  MKAU054
                  strkch = trnch                                        MKAU055
               else                                                     MKAU056
                  go to 200                                             MKAU057
               end if                                                   MKAU058
            end if                                                      MKAU059
         end if                                                         MKAU060
         stpos = respl(seqbcd, stres, lstpos, seqlen)                   MKAU061
         finpos = respl(seqbcd, finres, lstpos, seqlen)                 MKAU062
         If (finpos .lt. 0 .or. stpos .lt. 0 .or.                       MKAU063
     &      finpos .lt. stpos .or. (strkch .eq. hlxch(1) .and.          MKAU064
     &      (hlxcls .le. 0 .or. hlxcls .gt. hlxcds))) then              MKAU065
            Write(errfi,*)'structure record in error'                   MKAU066
            Write(errfi,*)autrec                                        MKAU067
         else                                                           MKAU068
            strpri = index(ssord,strkch)                                MKAU069
            do 1000, nxsym = stpos, finpos                              MKAU070
            if (index(ssord,autsum(nxsym)) .gt. strpri)                 MKAU071
     &         autsum(nxsym) = strkch                                   MKAU072
 1000       continue                                                    MKAU073
         end if                                                         MKAU074
         go to 200                                                      MKAU075
 2000    continue                                                       MKAU076
      end if                                                            MKAU077
      end                                                               MKAU078
