12abbbebd79107b31d26d941ecca8d96a97e2ca3
[unres.git] / source / unres / src_CSA_DiL / rescode.f
1       integer function rescode(iseq,nam,itype)
2       implicit real*8 (a-h,o-z)
3       include 'DIMENSIONS'
4       include 'COMMON.NAMES'
5       include 'COMMON.IOUNITS'
6       character*3 nam,ucase
7
8       if (itype.eq.0) then
9
10       do i=-ntyp1,ntyp1
11 cc       write(iout,*),i,ucase(nam),restyp(i)
12         if (ucase(nam).eq.restyp(i)) then
13           rescode=i
14           return
15         endif
16       enddo
17
18       else
19
20       do i=-ntyp1,ntyp1
21         if (nam(1:1).eq.onelet(i)) then
22           rescode=i
23           return  
24         endif  
25       enddo
26
27       endif
28
29       write (iout,10) iseq,nam
30       stop
31    10 format ('**** Error - residue',i4,' has an unresolved name ',a3)
32       end
33