subroutine chain_symmetry(nchain,nres,itype,chain_border,
- & chain_length,npermchain,tabpermchain)
+ & chain_length,npermchain,tabpermchain,nchain_group,nequiv,
+ & iequiv,chaingroup)
c
c Determine chain symmetry. nperm is the number of permutations and
c tabperchain contains the allowed permutations of the chains.
& chain_length(nchain),itemp(maxchain),
& npermchain,tabpermchain(maxchain,maxperm),
& tabperm(maxchain,maxperm),mapchain(maxchain),
- & iequiv(maxchain,maxres),iflag(maxres)
+ & chaingroup(maxchain),iequiv(maxchain,maxres),iflag(maxres)
integer i,j,k,l,ii,nchain_group,nequiv(maxchain),iieq,
& nperm,npermc,ind
+ logical lprn /.false./
if (nchain.eq.1) then
npermchain=1
tabpermchain(1,1)=1
c print*,"npermchain",npermchain," tabpermchain",tabpermchain(1,1)
+ nchain_group=1
+ iequiv(1,1)=1
+ chaingroup(1)=1
return
endif
c
do j=1,nequiv(i)
ind=ind+1
mapchain(ind)=iequiv(j,i)
+ chaingroup(ind)=i
enddo
enddo
write (iout,*) "mapchain"
do i=1,nchain
write (iout,*) i,mapchain(i)
enddo
+ write (iout,*) "chaingroup"
+ do i=1,nchain
+ write (iout,*) i,chaingroup(i)
+ enddo
+ if (npermut.eq.0) then
+ npermchain=1
+ do i=1,nchain
+ tabpermchain(i,1)=i
+ enddo
+ return
+ endif
ii=0
do i=1,nchain_group
call permut(nequiv(i),nperm,tabperm)
enddo
enddo
write(iout,*) "Number of chain permutations",npermchain
+ if (lprn) then
write(iout,*) "Permutations"
do i=1,npermchain
write(iout,'(20i4)') (tabpermchain(j,i),j=1,nchain)
enddo
+ endif
return
end
c---------------------------------------------------------------------