!     ================
      program itsumcov
!     ================                                       km 3/2001

!     Purpose : Combine estimates from multivariate part analyses
!               (involving k out of a total of q traits)
!               to an overall, positive (semi-) definite covariance matrix

!     Method  : "Iterative summing of expanded part matrices"
!                E. Mantysaari, EAAP 1999

!     Input 1 : Information on analyses  -
!               Read from file "ITSUM.IN" if found in current directory,
!               otherwise look for command line options; if neither attempt
!               to read information interactively.
!               Layout required for "ITSUM.IN" :
!                 Line 1 - Total no. of traits (q)
!                 Line 2 - Name of file with results from part analyses
!                 Line 3 - Option for form in which estimates of covariance
!                          matrices are given :
!                          UPP for upper triangle
!                          LOW for lower triangle
!                          FULL for full matrix, given linewise
!                 Line 4 - WT if a weighted analysis is required
!                          NOWT if a simple average is to be used
!                 Lines 5 to 4+q : names of the traits (up to 6 characters),
!                          optional

!     Input 2 : File with estimates from individual, k-variate analyses
!               For each analysis, this file must contain the following
!               information :
!                 Line 1 -  No. of traits in part analysis (k)
!                 Line 2 -  Running no.s of these traits 
!                 Line 3 -  Weight for this analysis (omit if unweighted
!                           sum is specified)
!                 Line 4+ - Covariance component estimates : 
!                           Option UPP : give the k(k+1)/2 elements of the 
!                                        UPPER triangle of the estimated 
!                                        covariance matrix in sequence
!                           Option LOW : give the k(k+1)/2 elements of the 
!                                        LOWER triangle of the estimated 
!                                        covariance matrix in sequence
!                           Option FULL : give complete covarince matrix,
!                                        k lines with k estimates each

!      Output 1 : The main output file is "ITSUM.out". It gives the upper
!                 triangle of covraiance and correlation matrices.
!                 It has 8 columns & q(q+1)/2 lines.
!                    Column 1 : Running no. of trait 1
!                    Column 2 : Running no. of trait 2
!                    Column 3 : Covariance between traits 1 & 2 in matrix of
!                               starting values
!                    Column 4 : Covariance between traits 1 & 2 after bending
!                    Column 5 : Covariance between traits 1 & 2 in final matrix
!                    Column 6 : Correlation between traits 1 & 2 in matrix of
!                               starting values
!                    Column 7 : Correlation between traits 1 & 2 after bending
!                    Column 8 : Correlation between traits 1 & 2 in final matrix

!      Output 2 : File "ITSUM.eig" gives the eigenvalues of covariance matrices.
!                 It has q lines and 4 columns
!                    Column 1 : Running no. 
!                    Column 2 : Eigenvalues of matrix of starting values
!                    Column 2 : Eigenvalues of covariance matrix after bending
!                    Column 2 : Eigenvalues of final covariance matrix

!      Output 3 : Files "COV.tex" and ""COR.tex" are only of interest to
!                 LaTeX users which might want to compile the results from
!                 "ITSUMCOV" in a table.
!                    "COV.out" contains the final correlations (lower triangle),
!                              variances (diagonal) and covariances (upper 
!                              triangle) in a q x q table with LaTeX separators.
!                    "COR.out" contrasts the final (lower triangle) and initial
!                              correlations (upper triangle) in a q x q table 
!------------------------------------------------------------------------------

