Merge branch 'master' of mmka.chem.univ.gda.pl:unres
[unres.git] / source / xdrfpdb / src / rescode.f
1       integer function rescode(iseq,nam,ione)
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 (ione.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       else
17
18       do i=1,ntyp1
19         if (nam(1:1).eq.onelet(i)) then
20           rescode=i
21           return  
22         endif  
23       enddo
24
25       endif
26
27       write (iout,10) iseq,nam
28       stop
29    10 format ('**** Error - residue',i4,' has an unresolved name ',a3)
30       end
31