SUBROUTINE COVSRT(COVAR,NCVM,MA,LISTA,MFIT) * * Module number: HRS/FOS utility routine * * Module name: * * Keyphrase: * ---------- * Repack covariance matrix * Description: * ------------ * Numerical recipe routine * This routine repacks the covariance matrix COVAR using the * order of parameters in LISTA * * FORTRAN name: covsrt.for * * Keywords of accessed files and tables: * -------------------------------------- * none * * Subroutines Called: * ------------------- * none * * History: * -------- * Version Date Author Description * 1 Sept 87 D. Lindler Modification of Numerical Recipe routine *------------------------------------------------------------------------------- C C INPUT PARAMETERS C C COVAR - input covariance matrix (double precision) C NCVM - dimensions of COVAR (integer) C MA - total number of parameters in fit (integer) C LISTA - list of parameters in fit selected (integer vector) C MFIT - number of parameters selected (integer) C C OUTPUT VARIABLES C C COVAR - repacked covariance matrix C C---------------------------------------------------------------------- DOUBLE PRECISION COVAR,SWAP INTEGER NCVM,MFIT,MA,LISTA,I,J DIMENSION COVAR(NCVM,NCVM),LISTA(MFIT) DO 20 J=1,MA-1 DO 10 I=J+1,MA COVAR(I,J)=0. 10 CONTINUE 20 CONTINUE DO 40 I=1,MFIT-1 DO 30 J=I+1,MFIT IF(LISTA(J).GT.LISTA(I)) THEN COVAR(LISTA(J),LISTA(I))=COVAR(I,J) ELSE COVAR(LISTA(I),LISTA(J))=COVAR(I,J) ENDIF 30 CONTINUE 40 CONTINUE SWAP=COVAR(1,1) DO 50 J=1,MA COVAR(1,J)=COVAR(J,J) COVAR(J,J)=0. 50 CONTINUE COVAR(LISTA(1),LISTA(1))=SWAP DO 60 J=2,MFIT COVAR(LISTA(J),LISTA(J))=COVAR(1,J) 60 CONTINUE DO 80 J=2,MA DO 70 I=1,J-1 COVAR(I,J)=COVAR(J,I) 70 CONTINUE 80 CONTINUE RETURN END