added source code
[unres.git] / source / unres / src_MD-M / 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=1,ntyp1
11         if (ucase(nam).eq.restyp(i)) then
12           rescode=i
13           return
14         endif
15       enddo
16
17       else
18
19       do i=1,ntyp1
20         if (nam(1:1).eq.onelet(i)) then
21           rescode=i
22           return  
23         endif  
24       enddo
25
26       endif
27
28       write (iout,10) iseq,nam
29       stop
30    10 format ('**** Error - residue',i4,' has an unresolved name ',a3)
31       end
32