C ==================================================================
C  1. MAKECIF -  uses as input CIF or PDB_file and libraries mon_lib.cif,
C                ener_lib.cif, symlib.blc and creates files:
C                1. with atomic coordinates, symmetry and unit cell
C                   parameters. / file extension "crd"/ 
C                2. with chemical structure description and atomic
C                   scattering structure factors. / file extension "str"/
C                3. with restraints: standard values of bonds, angles, 
C                   torsion angles, chirality centres, plan groups, its
C                   actual values in the structure. / file extension "rst"/
C                4. with Van-der-Waals and H_bond restraints: standard values
C                   of distanceis and its actual values in the structure. /file
C                   extension "vdw"/
C    
C                Program can read additional library of monomers.
C                Program rebuilds missing atoms used information from
C                monomer's library.
C                If the description of a monomer is absent in the library
C                program will try to create library description and write
C                it to special file for further inclusion to the library.
C                Program creates PostScript files with the pictures of new
C                monomers.
C                Program can generate hydrogen atoms.
C 
C
C  2. MODCHECK - reads CIFiles of coordinates and restraints,
C                gives information about restraints (to DOC_file),
C                writes PDB_file or/and CIFile of coordinates.
C
C  3. LIBCHECK - reads library of monomers, gives information about some
C                monomer, creates PostScript file with picture and information
C                about bonds, angles, ...
C                can read additional library, add two libraries and write to
C                a new library file ;
C                can create description of new monomer reading coordinates
C                from PDB file of CIFile.
C
C                In the future: 
C                               generate hydrogen atoms.
C                                  
C  4. EMIN     - energy minimization / or B_factor regularization / 
C                minimizes the energy of structure using the restraints files
C                from program MAKECIF.
C 
C                E_total = E_bond + E_angle + E_tors + E_vdw + E_hb
C                                 
C                          E_bond  = Sum ( Kb * (Bobs     -Bidl)**2    )
C                          E_angle = Sum ( Ka * (ANGLEobs -ANGLEidl)**2)
C                          E_tors  = Sum ( Kt * (PHIobs   -PHIidl)**2  )
C                          E_vdw   = Lennard-Jones 6-12 potential
C                          E_bond  = 10-12 potential
C
C ==================================================================
C ==================================================================
C   
C    
C                   ---     MAKECIF    ---
C                                             /Vers 3.1 11.05.98/
C    
C     MAKECIF -  uses as input CIF or PDB_file and libraries mon_lib.cif,
C                ener_lib.cif, symlib.blc and creates files:
C                1. with atomic coordinates, symmetry and unit cell
C                   parameters. / file extension "crd"/ 
C                2. with chemical structure description and atomic
C                   scattering structure factors. / file extension "str"/
C                3. with restraints: standard values of bonds, angles, 
C                   torsion angles, chirality centres, plan groups, its
C                   actual values in the structure. / file extension "rst"/
C                3. with Van-der-Waals and H_bond restraints: standard values
C                   of distanceis and its actual values in the structure. /file
C                   extension "vdw"/
C    
C                Program can read additional library of monomers.
C                Program rebuilds missing atoms used information from
C                monomer's library.
C                If the description of a monomer is absent in the library
C                program will try to create library description and write
C                it to special file for further inclusion to the library.
C                Program creates PostScript files with the pictures of new
C                monomers.
C                Program can generate hydrogen atoms.
C 
C -------------------------------------------------------
C
C      input:
C 
C         MDOC         -  =999 with  DOC-file: "makecif.doc",  
C                        if = -999 without this file.
C
C                   for subroutine case:
C
C                      MDOC = 999 do not keep old contents
C                      MDOC = 998 keep old contents
C                      MDOC =-999 without DOC-file
C
C     IN_COORD_FILE   - name of input CIF or PDB_file 
C
C     FILE_LIB2       - additional library, " " means without this file
C
C     OUT_FILE_CIF    - name of output CIFiles /without extention/
C                       if = ' ' to use default name: OUT_FILE_CIF = 'new'
C
C     CHECK    <N>/Y  - Y - check atoms in special position, N - not use it.
C
C     HFLAG  <Y>/A/N  - Y - hydrogen atoms where they are
C                       A - with all hydrogen atoms
C                       N - without hydrogen atoms
C
C     LINK   <Y>/N    - Y - use new links between residues.
C
C     CUT     <0>     - distance cut_off, 0 - means without VDW and H-bond
C                       restraints
C  
C     DMIN_SPEC:<0.5> - minimal distance to recognize atom in special 
C                       position, -1 means don't check. 
C
C      output:
C
C         IERR          - signal of error, 0 means OK.
C
C  !!! Possibility HFLAG  = 'A' are not ready yet.
C 
C ------------------------------------------------------------
C
C   Compilation's command for UNIX:
C                             make makecif
C 
C    Program uses the files:  /dic/mon_lib.cif
C                             /dic/ener_lib.cif
C                             /dic/symlib.blc
C                             /dic/ps.resource
C    
C -S-                       
C -------------------------------------------------------
C ==================================================================
C
C                   ---  MODCHECK ---
C                                             /Vers 1.1 14.02.97/
C
C    MODCHECK - reads CIFiles of coordinates and restraints,
C                gives information about restraints (to DOC_file),
C                writes PDB_file or/and CIFile of coordinates.
C
C       It is possible to use subroutine MODCHECK instead of program.
C       Use all subroutines without "main_modcheck.f" which just
C       prepares parameters for subroutine "modcheck".
C
C       SUBROUTINE MODCHECK(MDOC,NAMEC,NAMEO,SLIM,IERR)
C 
C  input parameters:
C
C     MDOC /integer*4/ -  =  999  with  DOC-file: "modcheck.doc",  
C                      if = -999  without this file.
C                              
C     NAMEC /character*80/ - name of input CIFiles / without extention/
C
C     NAMEO /character*80/ - name of output CIFile of coordinates
C                                              / without extention/     
C                            if NAMEO = ' ' without this file.
C     NAMEP /character*80/ - name of output PDB_file of coordinates
C                                              / without extention/     
C                            if NAMEP = ' ' without this file.
C
C     SLIM  /real*4 / - level of messages. if abs(Videal-Vobs)/SIG > SLIM ,
C                   the infomation about restraints will be written to DOC_file.
C
C  output:
C
C     IERR /integer*4/ - signal of error, = 0 means OK.
C
C ---------------------------------------------------------------------
C ==================================================================
C
C                   ---    LIBCHECK    ---
C                                             /Vers 1.2 14.02.97/
C
C     LIBCHECK - reads library of monomers, gives information about some
C                monomer, creates PostScript file with picture and information
C                about bonds, angles, ...
C                can read additional library, add two libraries and write to
C                a new library file ;
C                can create description of new monomer reading coordinates
C                from PDB file of CIFile.
C
C                In the future: 
C                               generate hydrogen atoms.
C                                  
C       It is possible to use subroutine LIBCHECK instead of program.
C       Use all subroutines without "main_libcheck.f" which just
C       prepares parameters for subroutine "libcheck".
C
C        SUBROUTINE LIBCHECK(MDOC,MON,H_FLAG,FILE_L
C     * ,FILE_PDB,FILE_CIF,FILE_O,VANGLE,IERR)
C 
C      input parameters:
C 
C         MDOC         -  =999 with  DOC-file: "libcheck.doc",  
C                        if = -999 without this file.
C                        It must be 999 or -999 !!!!
C
C      MON: < > - give info about this monomer / 3 characters/')
C                 / don't foget about capital letters !!!/ 
C      ANGLE  <0.0> rotation angle for picture ( around X )
C                   Cooordinate system: X from top to bottom of page
C                                       Y from left to right
C
C      FILE_O: < > output file /new library/, " " means without this file
C
C      FILE_L: < > additional library, " " means without this file
C
C      FILE_PDB: < > input PDB_file /coords one monomer/," " means without
C                    this file
C
C      FILE_CIF: < > input CIFile   /coords one monomer/," " means without
C                   this file
C
C      not ready yet:
C
C      H_FLAG: <Y>/A/N - Y - hydrogen atoms where they are
C                        A - with all hydrogen atoms
C                        N - without hydrogen atoms
C
C      output:
C
C         IERR          - signal of error, 0 means OK.
C ---
C      INTEGER*4 IERR,MDOC
C      CHARACTER MON*3,FILE_L*(*),FILE_O*(*)
C      CHARACTER H_FLAG*1,FILE_PDB*(*),FILE_CIF*(*)
C ******
C ---------------------------------------------------------------------
C ==================================================================
C
C                   ---  ENERGY MINIMIZATION ---
C                                             /Vers 1.1 14.02.97/
C
C     EMIN     - energy minimization / or B_factor regularization / 
C                minimizes the energy of structure using the restraints files
C                from program MAKECIF.
C 
C                E_total = E_bond + E_angle + E_tors + E_vdw + E_hb
C                                 
C                          E_bond  = Sum ( Kb * (Bobs     -Bidl)**2    )
C                          E_angle = Sum ( Ka * (ANGLEobs -ANGLEidl)**2)
C                          E_tors  = Sum ( Kt * (PHIobs   -PHIidl)**2  )
C                          E_vdw   = Lennard-Jones 6-12 potential
C                          E_bond  = 10-12 potential
C
C       It is possible to use subroutine EMIN instead of program.
C       Use all subroutines without "main_emin.f" which just
C       prepares parameters for subroutine "emin".
C
C        SUBROUTINE EMIN(MDOC,NAMEC,RNAMER,RNAMEV
C     *     ,NAMEO,RNAMEG,RNAMEI,NCYCLER,SLIMR,REFR,RESOLR,IERR)
C 
C      input parameters:
C
C         MDOC         -  =999 with  DOC-file: "emin.doc",  
C                        if = -999 without this file.
C                        It must be 999 or -999 !!!!
C
C  NAMEC  :    input file of coordinates
C  RNAMER :    input file of restraints / from MAKECIF program/
C  RNAMEV : < > input file /VDW_restraints/  , " " means without this file
C  NAMEO  : <emin.crd> output CIfile /crd/ 
C  RNAMEG : <emin_grd.crd> output file of gradients
C  RNAMEI : <emin_ind.crd> output file of inform. about gradients
C  NCYCLER:  <10> - max number of function calculation
C  REFR   :  <E>/T - E_energy minimization , Thermal factor regularization
C  SLIM   :  <0.0> - level of messages. if abs(Videal-Vobs)/SIG > SLIM ,
C                  the information about restraints will be written to DOC_file
C  RESOL  :   dummy
C
C      output:
C
C         IERR          - signal of error, 0 means OK.
C ---
C      INTEGER     MDOC,IERR,NCYCLER
C      CHARACTER   NAMEC*(*),RNAMER*(*),RNAMEV*(*),REFR*1
C      CHARACTER   NAMEO*(*),RNAMEG*(*),RNAMEI*(*)
C      REAL        SLIMR
C ---
C ---------------------------------------------------------------------
C =====================================================================
C 
C    Independence on operating system:
C
C       There are only 2 subroutineS depended on operating system
C       in the files: make_unix.f and make_linux.f
C
C
C     DISPL    - write message to terminal and stop cursor at the end of line.
C     CLOCK    - get date to --> array IH()
C
C      You need to uncomment corresponding operators in this subroutines.
C      For example:
C
C              SUBROUTINE DISPL(LINE)
C        C
C        C -P- DISPL - write message to terminal and stop cursor 
C        C             at the end of line.
C        C             NOTE : for Linux ( CLN ) cursor will not stop
C        C                    at the end of line.
C        C         
C              CHARACTER LINE*(*)
C              INTEGER*4 NL
C              CALL LENSTR(LINE,NL)
C              IF(NL.GT.79) NL=79
C        CVX   WRITE(*,'(''$'',A)')   LINE(1:NL)
C        CDP   WRITE(*,'('' '',A,$)') LINE(1:NL)
C        CMS   WRITE(*,'('' '',A,\)') LINE(1:NL)
C        CLN   WRITE(*,'('' '',A  )') LINE(1:NL)
C              RETURN
C              END
C
C      CVX - for VMS VAX 
C      CDP - for unix system
C      CMS - for MS-DOS
C      CLN - for Linux 
C
C
C ==================================================================
C
C   Installation.
C
C   Copy file makecif.tar.gz from ftp site
C          ( ftp.yorvic.york.ac.uk 
C            cd pub/alexei/blanc   )
C   and uncompress it (`gunzip makecif.tar.gz')  
C
C   After untaring `makecif.tar' , you will get a makecif directory,
C   with src, dic, and bin subdirectory. To build the executable,
C   go in src and then you have to option
C
C  1. `make makecif', the executable (makecif) will finish up in the bin
C      directory; providing the full pathname (.../makecif/bin/makecif) one 
C      can execute it from anywhere without having to define and environmental
C      variable.
C
C  2. `make libcheck' for libcheck program
C  
C  3. `make modcheck' for modcheck program
C  
C  4. `make emin' for emin program
C  
C   For Linux distribution: 
C
C  1. `make makecif_ln' for makecif program
C
C  2. `make libcheck_ln' for libcheck program
C  
C  3. `make modcheck_ln' for modcheck program
C  
C  4. `make emin_ln' for emin program
C  
C ========================================================












