C ==================================================================
C
C                  ---  CONTACT ---    /Vers 1.1; 10.06.99; A.Vagin/ 
C
C  CONTACT - computes inter or/and intra molecular contacts;
C          - computes contacts only for special atoms;
C          - computes contact for potential H-bonds (just only O-O, O-N
C            and N_N contacts);
C          - generates additional symmetry related atoms which are closed
C            to initial molecule and add its to output PDB_file with
C            chaine_id = '*";
C          - can do it only for water molecules (water structure);
C          - checks atoms in special positions.
C ==================================================================
C
C
C   Installation.
C
C   Copy file contact.tar.gz from ftp site: ftp.yorvic.york.ac.uk
C                                          (  user: anonymous
C                                             cd pub/alexei/   )
C   and uncompress it (`gunzip contact.tar.gz')  
C
C   After untaring `contact.tar' ( command: tar xvf contact.tar ) 
C   you will get a contact directory, with src, dic and bin 
C   subdirectory. To build the executable, go in src and then you have 
C   to option
C
C   `make contact', the executable (contact) will finish up in the bin
C      directory; providing the full pathname (.../contact/bin/contact) one 
C      can execute it from anywhere without having to define and environmental
C      variable.
C
C ==================================================================
C ----------------------------------------------------------
C
C                  ---  CONTACT ---    /Vers 1.1; 10.06.99; A.Vagin/ 
C
C  CONTACT - computes inter or/and intra molecular contacts;
C          - computes contacts only for special atoms;
C          - computes contact for potential H-bonds (just only O-O, O-N
C            and N_N contacts);
C          - generates additional symmetry related atoms which are closed
C            to initial molecule and add its to output PDB_file with
C            chaine_id = '*";
C          - can do it only for water molecules (water structure);
C          - checks atoms in special positions.
C
C  Dialogue and Batch  ( < > means default value ): 
C
C    FILE_C:      -  name of input PDB_file of coordinates.
C    CUT:   <3.5> -  distance cut_off.
C    DLIM:  <0.5> -  minimal distance to recognize atom in special position.
C                    if dist (betweem symmetry related atoms) < DLIM then 
C                    atom is in special position.
C    MOD: <S>/I/B/N: S - intra molecular contacts.
C                    I - inter molecular contacts.
C                    B - both  molecular contacts.
C                    N - generate symmetry related atoms around initial molecule
C                        and add its to output file (see alse WAT="S").
C                        if MOD="N" and WAT="S" program set WAT="Y."
C    HBOND: <N>/Y : Y - only potential H-bond contacts ( just contacts between:
C                       O - O , O - N and N - N atoms).
C    WAT: <N>/Y/S : N - without water, Y - with, S - only water structure -
C                       generate symmetry related water molecules around initial
C                       molecule and add its to output file.
C    SPEC: <N>/Y : Y - special contacts between TYPE1 and TYPE2.
C    TYPE1   < >     - type of atom_1, for example "S" means all sulfur atoms.
C    TYPE2   < >     - type of atom_2, " " means all atoms.
C    FILE_O: < >     - output PDB_file of coordinates, " " means without this 
C                      file.
C
C       It is possible to use subroutine CONTACT instead of program.
C       Use all subroutines without "main_contact.f" which just
C       prepares parameters for subroutine "contact".
C
C      SUBROUTINE CONTACT(MDOC,NAMEC,NAMEO,CUT_OFF,DLIM,MOD,WAT,HBOND
C     * ,SPEC,TYPE1,TYPE2,IERR)
C
C     Parameters of subroutine CONTACT: 
C
C  input parameters:
C
C    MDOC         =  999  with  DOC-file: "contact.doc",  
C                 = -999  without this file. Must be equal 999 or -999 !!!
C
C    NAMEC          - name of input PDB_file.
C    CUT_OFF  <3.5> - distance cut_off
C    DLIM:   <0.5>  - minimal distance
C    MOD  <S>/I/B/N : S - intra, I - inter, B - both
C                     N - generate symmetry related atoms around initial
C                         molecule.
C    WAT  <N>/Y/S   - N - without, Y - with, S - only water structure
C    NAMEO < >      - name of output PDB_file, " " means without this file.
C    SPEC: <N>/Y    - Y - special contacts between TYPE1 and TYPE2
C    TYPE1 < >      - type of atom_1.
C    TYPE2 < >      - type of atom_2, < > means all atoms
C
C  output:
C
C    IERR   - output signal of error / = 1 - error , = 0 means OK / 
C ---
C     REAL        CUT_OFF,DLIM
C     INTEGER     MDOC,IERR
C     CHARACTER   NAMEC*80,NAMEO*80,MOD*1,WAT*1,HBOND*1
C     CHARACTER   SPEC*1,TYPE1*4,TYPE2*4
C ---
C      INCLUDE 'atom-com.fh'
C      INCLUDE 'crd-com.fh'
C      INCLUDE 'CIF-com.f'
C ------
C ==================================================================
C
C   Author:      A.A.Vagin
C
C   Reference: 
C                A. A. Vagin, G. N. Murshudov and B. V. Strokopytov
C                BLANC: the program suite for protein crystallography 
C                J. Appl. Cryst. (1998). 31, 98 - 102
C
C================================================================





