      PROGRAM ANGLEN                                                    ANGL0001
c ----------------------------------------------------------------------ANGL0002
c                                                                       ANGL0003
c  Windows NT / Win 95 code                                             ANGL0004
c                                                                       ANGL0005
c  Bernhard Rupp 1996 - minor modifications.                            ANGL0006
c                                                                       ANGL0007
c  1.  comment lines restricted to 72 columns                           ANGL0008
c  2.  source code lines numbered                                       ANGL0009
c  3.  to read file name of input file as parameter otherwise ask       ANGL0010
c  4.  taken apart into subroutines                                     ANGL0011
c                                                                       ANGL0012
c       Changes are annotated by WINNT at the beginning of comment linesANGL0013
c                                                                       ANGL0014
C-----------------------------------------------------------------------ANGL0015
C                                                                       ANGL0016
C  ANGLEN.FOR   -   Program to calculate means and standard deviations  ANGL0017
C                   of main-chain bond lengths and bond angles          ANGL0018
C                                                                       ANGL0019
C                   The program reads the protein structure in from the ANGL0020
C                   user-defined .new file and outputs the results to a ANGL0021
C                   .lan file.                                          ANGL0022
C                                                                       ANGL0023
C  Written by R A Laskowski, University College, London, May 1992.      ANGL0024
C                                                                       ANGL0025
C  Original version was part of v.1.0 of the PROCHECK suite of programs.ANGL0026
C  Subsequent amendments have been labelled by CHECK v.m.n--> and       ANGL0027
C  CHECK v.m.n<-- where m.n is the version number corresponding to the  ANGL0028
C  change                                                               ANGL0029
C                                                                       ANGL0030
C  v.2.0.1 - Bug-fix. Problem with certain compilers not liking         ANGL0031
c            uninitialised and unSAVEd variables                        ANGL0032
c            Roman Laskowski 12 Aug 1992                                ANGL0033
C  v.2.1   - Initialisation of uninitialised variables                  ANGL0034
C            Roman Laskowski  8 Jan 1993                                ANGL0035
C  v.2.1.3 - Addition of asterisks to error prints so that can be       ANGL0036
c            plucked out of the log files and displayed by the script   ANGL0037
c            file.                                                      ANGL0038
C            Roman Laskowski 26 Mar 1993                                ANGL0039
C  v.2.2   - Calculation of best-fit planes for planar groups, and RMS  ANGL0040
C            deviations of the atoms from the plane.                    ANGL0041
C            Roman Laskowski 19 Oct 1993                                ANGL0042
C            Write out transformed coords of each planar group to       ANGL0043
c            .pln file                                                  ANGL0044
C            Roman Laskowski  5 Nov 1993                                ANGL0045
C                                                                       ANGL0046
C v.2.3   -  Tiny change so that VAX .COM routines don't show error if  ANGL0047
c            no asterisks found in log file                             ANGL0048
C            Roman Laskowski 14 Nov 1993                                ANGL0049
C                                                                       ANGL0050
C                                                                       ANGL0051
C v.3.0.1 - Bug-fix. Problem picked up on SG compiler, due to 2D array  ANGL0052
C           incorrectly defined as a 1D array.                          ANGL0053
C           Commented out unreferenced label (producing a compiler      ANGL0054
c           warning when compiling on Convex).                          ANGL0055
C           Roman Laskowski 29/30 Mar 1994                              ANGL0056
C                                                                       ANGL0057
C v.3.2   - Write out both residue names to .lan file for all bond      ANGL0058
c           lengths and angles that span two residues so that both are  ANGL0059
c           shown in the Distorted Geometry plots of program bplot.f.   ANGL0060
C           Roman Laskowski 3 May 1994                                  ANGL0061
C           Minor amendments to various statements to make them         ANGL0062
C           acceptable to f2c, and to deal with various uninitialised   ANGL0063
C           variables.(Amendments supplied by Dave Love at Daresbury).  ANGL0064
C           David Love/Roman Laskowski (13 Oct 1994)                    ANGL0065
C                                                                       ANGL0066
WINNT -     the SAVE statement in anglen.inc needed for f2c screws up   ANGL0067
WINNT -     the NT compiler. Unnecessary for MS F90 and removed  B.Rupp ANGL0068
C                                                                       ANGL0069
C----------------------------------------------------------------------+ANGL0070
C                                                                       ANGL0071
C Files                                                                 ANGL0072
C -----                                                                 ANGL0073
C                                                                       ANGL0074
C 1  <filename>.new - Cleaned-up version of the .pdb file holding the   ANGL0075
c                     protein structure in Brookhaven format by-residue ANGL0076
c                     information on the given structure                ANGL0077
C 2  <filename>.lan - Output file holding the means and e.s.d.'s        ANGL0078
C                     of the main-chain bond lengths and bond angles    ANGL0079
C 3  <filename>.pln - Output file holding the transformed coordinates   ANGL0080
C                     of each planar group in the structure             ANGL0081
C                                                                       ANGL0082
C-----------------------------------------------------------------------ANGL0083
C                                                                       ANGL0084
C Subroutine calling tree                                               ANGL0085
C -----------------------                                               ANGL0086
C                                                                       ANGL0087
C MAIN    --> GETCOD  --> GETNAM                                        ANGL0088
C         --> OPNFIL                                                    ANGL0089
C         --> INITS                                                     ANGL0090
C         --> READPR  --> STORAT  --> CALC                              ANGL0091
C                     --> STORPL  --> PLANE   --> GETCOM                ANGL0092
C                                             --> SCPMAT                ANGL0093
C                                             --> JACOBI                ANGL0094
C                                             --> EIGSRT                ANGL0095
C                                 --> GETRMS                            ANGL0096
C                                 --> WRIPLN                            ANGL0097
C                                                                       ANGL0098
C----------------------------------------------------------------------+ANGL0099
      INCLUDE 'anglen.inc'                                              ANGL0100
                                                                        ANGL0101
C---- Read in the code of the Brookhaven file and the structure's       ANGL0102
c     resolution                                                        ANGL0103
      CALL GETCOD                                                       ANGL0104
      IF (IFAIL) GO TO 990                                              ANGL0105
                                                                        ANGL0106
C---- Open data files                                                   ANGL0107
      CALL OPNFIL                                                       ANGL0108
      IF (IFAIL) GO TO 990                                              ANGL0109
                                                                        ANGL0110
C---- Initialise variables                                              ANGL0111
      CALL INITS                                                        ANGL0112
                                                                        ANGL0113
C---- Read through the Brookhaven file                                  ANGL0114
      CALL READPR                                                       ANGL0115
                                                                        ANGL0116
C---- Close any open files                                              ANGL0117
      CLOSE(1)                                                          ANGL0118
      CLOSE(2)                                                          ANGL0119
CHECK v.2.2-->                                                          ANGL0120
      CLOSE(3)                                                          ANGL0121
CHECK v.2.2<--                                                          ANGL0122
                                                                        ANGL0123
 990  CONTINUE                                                          ANGL0124
      IF (IFAIL) THEN                                                   ANGL0125
CHECK v.2.3-->                                                          ANGL0126
C          PRINT*, 'Program terminated with error'                      ANGL0127
C      ELSE                                                             ANGL0128
C          PRINT*, 'Program completed'                                  ANGL0129
          PRINT*, '* Program anglen terminated with error'              ANGL0130
      ELSE                                                              ANGL0131
          PRINT*, '* Program completed'                                 ANGL0132
CHECK v.2.3<--                                                          ANGL0133
      ENDIF                                                             ANGL0134
      END                                                               ANGL0135
