SUBROUTINE VRSCAL ( * * inputs * : NX, XS, IPOWER, MAMAX, * * inputs/outputs * : A, COVAR) * * Module number: * * Module name: * * Keyphrase: * ---------- * undo the scaling by XS * * Description: * ------------ * convert coefficients and covariance matrix back as if they are using the * original regular polynomials without the scaling factor XS * * FORTRAN name: VRSCAL.FOR * * Keywords of accessed files and tables: * -------------------------------------- * Name I/O Description / Comments * * Subroutines Called: * ------------------- * CDBS: * None * SDAS: * None * Others: * None * * History: * -------- * Version Date Author Description * 1 12-21-88 J.-C. HSU coding *------------------------------------------------------------------------------- * *== input: * --scaling factor of X DOUBLE PRECISION XS(1) * --dimensions of X INTEGER NX, * --polynomial power in each dimension * --of X : IPOWER(1), * --maximum size of the covariance matrix : MAMAX * *== input/output: * --fitting coefficients DOUBLE PRECISION A(1), * --covariance matrix : COVAR(MAMAX, MAMAX) * *== local: * --loop indices INTEGER I, J, IP, IDIM, IFIRST, INUM, MA, MMAX PARAMETER (MMAX = 50) * DOUBLE PRECISION FUNVAL(MMAX) *------------------------------------------------------------------------------ * MA = IPOWER(1) + 1 DO 10 IDIM = 2, NX MA = MA * (IPOWER(IDIM)+1) 10 CONTINUE * * calculate NX dimensional polynomial of XS**IPOWER * calculate the functional value for the first dimension * FUNVAL(1) = 1.0D0 * DO 20 I = 2, IPOWER(1)+1 FUNVAL(I) = XS(1) * FUNVAL(I-1) 20 CONTINUE * * calculate the functional value for the second dimension, if any * I = IPOWER(1) + 1 * DO 50 IDIM = 2, NX IFIRST = 1 INUM = I * DO 40 IP = 2, IPOWER(IDIM)+1 DO 30 J = IFIRST, IFIRST+INUM-1 I = I + 1 FUNVAL(I) = FUNVAL(J) * XS(IDIM) 30 CONTINUE IFIRST = IFIRST + INUM 40 CONTINUE 50 CONTINUE * * now scale A, COVAR by FUNVAL * DO 70 I = 1, MA A(I) = A(I) / FUNVAL(I) DO 60 J = 1, MA COVAR(I,J) = COVAR(I,J) / FUNVAL(I) COVAR(J,I) = COVAR(J,I) / FUNVAL(I) 60 CONTINUE 70 CONTINUE * * and set XS to 1 such that VPNFN2 returns the right values * DO 80 I = 1, NX XS(I) = 1.D0 80 CONTINUE * RETURN END