1 subroutine transit(compo,dt0)
3 double precision a(5,24),b(24),tn(24)
5 dimension maille(2),t(24),puiss(24)
6 dimension text(6),rflu(6)
7 dimension tpar(6),rpar(6)
30 c construction de la matrice (laplacien)
62 a(1,npt)=3./r+1./(r/2.+rext)+ro/dt
75 a(1,i)=2./r+1./(r/2.+rext)+ro/dt
79 a(1,i)=2./r+1./(r/2.+rext)+ro/dt
83 c factorisation de la matrice
88 call dPBTRF( 'L' , N, KD, A, LDAB, INFO )
100 c initialisation de la temperature a t=0
102 CALL cpeRE(compo,CP_TEMPS, ti, npas, 'temperature', 24,
104 IF( info.NE. CPOK )GO TO 9000
106 c initialisation de la temperature de bord a t=0.
108 CALL cpeRE(compo,CP_TEMPS, ti, npas, 'tparoi', 6,
110 IF( info.NE. CPOK )GO TO 9000
112 c initialisation de la resistance thermique de bord a t=0.
114 CALL cpeRE(compo,CP_TEMPS, ti, npas, 'rparoi', 6,
116 IF( info.NE. CPOK )GO TO 9000
118 c boucle temporelle infinie
121 c do while( ti.lT.100. )
124 c lecture de la puissance combustible entre ti et tf
126 CALL cplRE(compo,CP_TEMPS,ti, tf, npas, 'puissa', 24,
127 & nval, puiss , info)
128 IF( info.NE. CPOK )GO TO 9000
130 c lecture de la temperature exterieure entre ti et tf
132 CALL cplRE(compo,CP_TEMPS,ti, tf, npas, 'text', 6,
134 IF( info.NE. CPOK )GO TO 9000
136 c lecture de la resistance exterieure entre ti et tf
138 CALL cplRE(compo,CP_TEMPS,ti, tf, npas, 'rext', 6,
140 IF( info.NE. CPOK )GO TO 9000
142 c calcul du second membre
150 b(npt)=b(npt)+text(j)/(r/2+rflu(j))
154 b(npt)=b(npt)+puiss(npt)
157 c resolution du systeme lineaire
159 call dPBTRs( 'L' , N,kd, nrhs,A,LDAB,b,ldb,INFO )
170 write(6,*)"SOLIDE: temps=",tf
173 c ecriture de la temperature a t=tf
175 CALL cpeRE(compo,CP_TEMPS, tf, npas, 'temperature', 24,
177 IF( info.NE. CPOK )GO TO 9000
179 c ecriture de la temperature de paroi a t=tf
181 CALL cpeRE(compo,CP_TEMPS, tf, npas, 'tparoi', 6,
183 IF( info.NE. CPOK )GO TO 9000
185 c ecriture de la resistance de bord a t=tf
187 CALL cpeRE(compo,CP_TEMPS, tf, npas, 'rparoi', 6,
189 IF( info.NE. CPOK )GO TO 9000
195 CALL cpfin(compo,CP_ARRET, info)
198 SUBROUTINE DPBTRF( UPLO, N, KD, AB, LDAB, INFO )
200 * -- LAPACK routine (version 2.0) --
201 * Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
202 * Courant Institute, Argonne National Lab, and Rice University
205 * .. Scalar Arguments ..
207 INTEGER INFO, KD, LDAB, N
209 * .. Array Arguments ..
210 DOUBLE PRECISION AB( LDAB, * )
216 * DPBTRF computes the Cholesky factorization of a real symmetric
217 * positive definite band matrix A.
219 * The factorization has the form
220 * A = U**T * U, if UPLO = 'U', or
221 * A = L * L**T, if UPLO = 'L',
222 * where U is an upper triangular matrix and L is lower triangular.
227 * UPLO (input) CHARACTER*1
228 * = 'U': Upper triangle of A is stored;
229 * = 'L': Lower triangle of A is stored.
232 * The order of the matrix A. N >= 0.
235 * The number of superdiagonals of the matrix A if UPLO = 'U',
236 * or the number of subdiagonals if UPLO = 'L'. KD >= 0.
238 * AB (input/output) DOUBLE PRECISION array, dimension (LDAB,N)
239 * On entry, the upper or lower triangle of the symmetric band
240 * matrix A, stored in the first KD+1 rows of the array. The
241 * j-th column of A is stored in the j-th column of the array AB
243 * if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j;
244 * if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+kd).
246 * On exit, if INFO = 0, the triangular factor U or L from the
247 * Cholesky factorization A = U**T*U or A = L*L**T of the band
248 * matrix A, in the same storage format as A.
250 * LDAB (input) INTEGER
251 * The leading dimension of the array AB. LDAB >= KD+1.
253 * INFO (output) INTEGER
254 * = 0: successful exit
255 * < 0: if INFO = -i, the i-th argument had an illegal value
256 * > 0: if INFO = i, the leading minor of order i is not
257 * positive definite, and the factorization could not be
263 * The band storage scheme is illustrated by the following example, when
264 * N = 6, KD = 2, and UPLO = 'U':
268 * * * a13 a24 a35 a46 * * u13 u24 u35 u46
269 * * a12 a23 a34 a45 a56 * u12 u23 u34 u45 u56
270 * a11 a22 a33 a44 a55 a66 u11 u22 u33 u44 u55 u66
272 * Similarly, if UPLO = 'L' the format of A is as follows:
276 * a11 a22 a33 a44 a55 a66 l11 l22 l33 l44 l55 l66
277 * a21 a32 a43 a54 a65 * l21 l32 l43 l54 l65 *
278 * a31 a42 a53 a64 * * l31 l42 l53 l64 * *
280 * Array elements marked * are not used by the routine.
283 * Peter Mayes and Giuseppe Radicati, IBM ECSEC, Rome, March 23, 1989
285 * =====================================================================
288 DOUBLE PRECISION ONE, ZERO
289 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
290 INTEGER NBMAX, LDWORK
291 PARAMETER ( NBMAX = 32, LDWORK = NBMAX+1 )
293 * .. Local Scalars ..
294 INTEGER I, I2, I3, IB, II, J, JJ, NB
297 DOUBLE PRECISION WORK( LDWORK, NBMAX )
299 * .. External Functions ..
302 EXTERNAL LSAME, ILAENV
304 * .. External Subroutines ..
305 EXTERNAL DGEMM, DPBTF2, DPOTF2, DSYRK, DTRSM, XERBLA
307 * .. Intrinsic Functions ..
310 * .. Executable Statements ..
312 * Test the input parameters.
315 IF( ( .NOT.LSAME( UPLO, 'U' ) ) .AND.
316 $ ( .NOT.LSAME( UPLO, 'L' ) ) ) THEN
318 ELSE IF( N.LT.0 ) THEN
320 ELSE IF( KD.LT.0 ) THEN
322 ELSE IF( LDAB.LT.KD+1 ) THEN
326 CALL XERBLA( 'DPBTRF', -INFO )
330 * Quick return if possible
335 * Determine the block size for this environment
337 NB = ILAENV( 1, 'DPBTRF', UPLO, N, KD, -1, -1 )
339 * The block size must not exceed the semi-bandwidth KD, and must not
340 * exceed the limit set by the size of the local array WORK.
342 NB = MIN( NB, NBMAX )
344 IF( NB.LE.1 .OR. NB.GT.KD ) THEN
348 CALL DPBTF2( UPLO, N, KD, AB, LDAB, INFO )
353 IF( LSAME( UPLO, 'U' ) ) THEN
355 * Compute the Cholesky factorization of a symmetric band
356 * matrix, given the upper triangle of the matrix in band
359 * Zero the upper triangle of the work array.
367 * Process the band matrix one diagonal block at a time.
370 IB = MIN( NB, N-I+1 )
372 * Factorize the diagonal block
374 CALL DPOTF2( UPLO, IB, AB( KD+1, I ), LDAB-1, II )
381 * Update the relevant part of the trailing submatrix.
382 * If A11 denotes the diagonal block which has just been
383 * factorized, then we need to update the remaining
384 * blocks in the diagram:
390 * The numbers of rows and columns in the partitioning
391 * are IB, I2, I3 respectively. The blocks A12, A22 and
392 * A23 are empty if IB = KD. The upper triangle of A13
393 * lies outside the band.
395 I2 = MIN( KD-IB, N-I-IB+1 )
396 I3 = MIN( IB, N-I-KD+1 )
402 CALL DTRSM( 'Left', 'Upper', 'Transpose',
403 $ 'Non-unit', IB, I2, ONE, AB( KD+1, I ),
404 $ LDAB-1, AB( KD+1-IB, I+IB ), LDAB-1 )
408 CALL DSYRK( 'Upper', 'Transpose', I2, IB, -ONE,
409 $ AB( KD+1-IB, I+IB ), LDAB-1, ONE,
410 $ AB( KD+1, I+IB ), LDAB-1 )
415 * Copy the lower triangle of A13 into the work array.
419 WORK( II, JJ ) = AB( II-JJ+1, JJ+I+KD-1 )
423 * Update A13 (in the work array).
425 CALL DTRSM( 'Left', 'Upper', 'Transpose',
426 $ 'Non-unit', IB, I3, ONE, AB( KD+1, I ),
427 $ LDAB-1, WORK, LDWORK )
432 $ CALL DGEMM( 'Transpose', 'No Transpose', I2, I3,
433 $ IB, -ONE, AB( KD+1-IB, I+IB ),
434 $ LDAB-1, WORK, LDWORK, ONE,
435 $ AB( 1+IB, I+KD ), LDAB-1 )
439 CALL DSYRK( 'Upper', 'Transpose', I3, IB, -ONE,
440 $ WORK, LDWORK, ONE, AB( KD+1, I+KD ),
443 * Copy the lower triangle of A13 back into place.
447 AB( II-JJ+1, JJ+I+KD-1 ) = WORK( II, JJ )
455 * Compute the Cholesky factorization of a symmetric band
456 * matrix, given the lower triangle of the matrix in band
459 * Zero the lower triangle of the work array.
467 * Process the band matrix one diagonal block at a time.
470 IB = MIN( NB, N-I+1 )
472 * Factorize the diagonal block
474 CALL DPOTF2( UPLO, IB, AB( 1, I ), LDAB-1, II )
481 * Update the relevant part of the trailing submatrix.
482 * If A11 denotes the diagonal block which has just been
483 * factorized, then we need to update the remaining
484 * blocks in the diagram:
490 * The numbers of rows and columns in the partitioning
491 * are IB, I2, I3 respectively. The blocks A21, A22 and
492 * A32 are empty if IB = KD. The lower triangle of A31
493 * lies outside the band.
495 I2 = MIN( KD-IB, N-I-IB+1 )
496 I3 = MIN( IB, N-I-KD+1 )
502 CALL DTRSM( 'Right', 'Lower', 'Transpose',
503 $ 'Non-unit', I2, IB, ONE, AB( 1, I ),
504 $ LDAB-1, AB( 1+IB, I ), LDAB-1 )
508 CALL DSYRK( 'Lower', 'No Transpose', I2, IB, -ONE,
509 $ AB( 1+IB, I ), LDAB-1, ONE,
510 $ AB( 1, I+IB ), LDAB-1 )
515 * Copy the upper triangle of A31 into the work array.
518 DO 100 II = 1, MIN( JJ, I3 )
519 WORK( II, JJ ) = AB( KD+1-JJ+II, JJ+I-1 )
523 * Update A31 (in the work array).
525 CALL DTRSM( 'Right', 'Lower', 'Transpose',
526 $ 'Non-unit', I3, IB, ONE, AB( 1, I ),
527 $ LDAB-1, WORK, LDWORK )
532 $ CALL DGEMM( 'No transpose', 'Transpose', I3, I2,
533 $ IB, -ONE, WORK, LDWORK,
534 $ AB( 1+IB, I ), LDAB-1, ONE,
535 $ AB( 1+KD-IB, I+IB ), LDAB-1 )
539 CALL DSYRK( 'Lower', 'No Transpose', I3, IB, -ONE,
540 $ WORK, LDWORK, ONE, AB( 1, I+KD ),
543 * Copy the upper triangle of A31 back into place.
546 DO 120 II = 1, MIN( JJ, I3 )
547 AB( KD+1-JJ+II, JJ+I-1 ) = WORK( II, JJ )
563 SUBROUTINE DPBTRS( UPLO, N, KD, NRHS, AB, LDAB, B, LDB, INFO )
565 * -- LAPACK routine (version 2.0) --
566 * Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
567 * Courant Institute, Argonne National Lab, and Rice University
570 * .. Scalar Arguments ..
572 INTEGER INFO, KD, LDAB, LDB, N, NRHS
574 * .. Array Arguments ..
575 DOUBLE PRECISION AB( LDAB, * ), B( LDB, * )
581 * DPBTRS solves a system of linear equations A*X = B with a symmetric
582 * positive definite band matrix A using the Cholesky factorization
583 * A = U**T*U or A = L*L**T computed by DPBTRF.
588 * UPLO (input) CHARACTER*1
589 * = 'U': Upper triangular factor stored in AB;
590 * = 'L': Lower triangular factor stored in AB.
593 * The order of the matrix A. N >= 0.
596 * The number of superdiagonals of the matrix A if UPLO = 'U',
597 * or the number of subdiagonals if UPLO = 'L'. KD >= 0.
599 * NRHS (input) INTEGER
600 * The number of right hand sides, i.e., the number of columns
601 * of the matrix B. NRHS >= 0.
603 * AB (input) DOUBLE PRECISION array, dimension (LDAB,N)
604 * The triangular factor U or L from the Cholesky factorization
605 * A = U**T*U or A = L*L**T of the band matrix A, stored in the
606 * first KD+1 rows of the array. The j-th column of U or L is
607 * stored in the j-th column of the array AB as follows:
608 * if UPLO ='U', AB(kd+1+i-j,j) = U(i,j) for max(1,j-kd)<=i<=j;
609 * if UPLO ='L', AB(1+i-j,j) = L(i,j) for j<=i<=min(n,j+kd).
611 * LDAB (input) INTEGER
612 * The leading dimension of the array AB. LDAB >= KD+1.
614 * B (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS)
615 * On entry, the right hand side matrix B.
616 * On exit, the solution matrix X.
618 * LDB (input) INTEGER
619 * The leading dimension of the array B. LDB >= max(1,N).
621 * INFO (output) INTEGER
622 * = 0: successful exit
623 * < 0: if INFO = -i, the i-th argument had an illegal value
625 * =====================================================================
627 * .. Local Scalars ..
631 * .. External Functions ..
635 * .. External Subroutines ..
636 EXTERNAL DTBSV, XERBLA
638 * .. Intrinsic Functions ..
641 * .. Executable Statements ..
643 * Test the input parameters.
646 UPPER = LSAME( UPLO, 'U' )
647 IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
649 ELSE IF( N.LT.0 ) THEN
651 ELSE IF( KD.LT.0 ) THEN
653 ELSE IF( NRHS.LT.0 ) THEN
655 ELSE IF( LDAB.LT.KD+1 ) THEN
657 ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
661 CALL XERBLA( 'DPBTRS', -INFO )
665 * Quick return if possible
667 IF( N.EQ.0 .OR. NRHS.EQ.0 )
672 * Solve A*X = B where A = U'*U.
676 * Solve U'*X = B, overwriting B with X.
678 CALL DTBSV( 'Upper', 'Transpose', 'Non-unit', N, KD, AB,
679 $ LDAB, B( 1, J ), 1 )
681 * Solve U*X = B, overwriting B with X.
683 CALL DTBSV( 'Upper', 'No transpose', 'Non-unit', N, KD, AB,
684 $ LDAB, B( 1, J ), 1 )
688 * Solve A*X = B where A = L*L'.
692 * Solve L*X = B, overwriting B with X.
694 CALL DTBSV( 'Lower', 'No transpose', 'Non-unit', N, KD, AB,
695 $ LDAB, B( 1, J ), 1 )
697 * Solve L'*X = B, overwriting B with X.
699 CALL DTBSV( 'Lower', 'Transpose', 'Non-unit', N, KD, AB,
700 $ LDAB, B( 1, J ), 1 )
709 INTEGER FUNCTION ILAENV( ISPEC, NAME, OPTS, N1, N2, N3,
712 * -- LAPACK auxiliary routine (version 2.0) --
713 * Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
714 * Courant Institute, Argonne National Lab, and Rice University
717 * .. Scalar Arguments ..
718 CHARACTER*( * ) NAME, OPTS
719 INTEGER ISPEC, N1, N2, N3, N4
725 * ILAENV is called from the LAPACK routines to choose problem-dependent
726 * parameters for the local environment. See ISPEC for a description of
729 * This version provides a set of parameters which should give good,
730 * but not optimal, performance on many of the currently available
731 * computers. Users are encouraged to modify this subroutine to set
732 * the tuning parameters for their particular machine using the option
733 * and problem size information in the arguments.
735 * This routine will not function correctly if it is converted to all
736 * lower case. Converting it to all upper case is allowed.
741 * ISPEC (input) INTEGER
742 * Specifies the parameter to be returned as the value of
744 * = 1: the optimal blocksize; if this value is 1, an unblocked
745 * algorithm will give the best performance.
746 * = 2: the minimum block size for which the block routine
747 * should be used; if the usable block size is less than
748 * this value, an unblocked routine should be used.
749 * = 3: the crossover point (in a block routine, for N less
750 * than this value, an unblocked routine should be used)
751 * = 4: the number of shifts, used in the nonsymmetric
752 * eigenvalue routines
753 * = 5: the minimum column dimension for blocking to be used;
754 * rectangular blocks must have dimension at least k by m,
755 * where k is given by ILAENV(2,...) and m by ILAENV(5,...)
756 * = 6: the crossover point for the SVD (when reducing an m by n
757 * matrix to bidiagonal form, if max(m,n)/min(m,n) exceeds
758 * this value, a QR factorization is used first to reduce
759 * the matrix to a triangular form.)
760 * = 7: the number of processors
761 * = 8: the crossover point for the multishift QR and QZ methods
762 * for nonsymmetric eigenvalue problems.
764 * NAME (input) CHARACTER*(*)
765 * The name of the calling subroutine, in either upper case or
768 * OPTS (input) CHARACTER*(*)
769 * The character options to the subroutine NAME, concatenated
770 * into a single character string. For example, UPLO = 'U',
771 * TRANS = 'T', and DIAG = 'N' for a triangular routine would
772 * be specified as OPTS = 'UTN'.
778 * Problem dimensions for the subroutine NAME; these may not all
781 * (ILAENV) (output) INTEGER
782 * >= 0: the value of the parameter specified by ISPEC
783 * < 0: if ILAENV = -k, the k-th argument had an illegal value.
788 * The following conventions have been used when calling ILAENV from the
790 * 1) OPTS is a concatenation of all of the character options to
791 * subroutine NAME, in the same order that they appear in the
792 * argument list for NAME, even if they are not used in determining
793 * the value of the parameter specified by ISPEC.
794 * 2) The problem dimensions N1, N2, N3, N4 are specified in the order
795 * that they appear in the argument list for NAME. N1 is used
796 * first, N2 second, and so on, and unused problem dimensions are
797 * passed a value of -1.
798 * 3) The parameter value returned by ILAENV is checked for validity in
799 * the calling subroutine. For example, ILAENV is used to retrieve
800 * the optimal blocksize for STRTRI as follows:
802 * NB = ILAENV( 1, 'STRTRI', UPLO // DIAG, N, -1, -1, -1 )
803 * IF( NB.LE.1 ) NB = MAX( 1, N )
805 * =====================================================================
807 * .. Local Scalars ..
813 INTEGER I, IC, IZ, NB, NBMIN, NX
815 * .. Intrinsic Functions ..
816 INTRINSIC CHAR, ICHAR, INT, MIN, REAL
818 * .. Executable Statements ..
820 GO TO ( 100, 100, 100, 400, 500, 600, 700, 800 ) ISPEC
822 * Invalid value for ISPEC
829 * Convert NAME to upper case if the first character is lower case.
833 IC = ICHAR( SUBNAM( 1:1 ) )
835 IF( IZ.EQ.90 .OR. IZ.EQ.122 ) THEN
837 * ASCII character set
839 IF( IC.GE.97 .AND. IC.LE.122 ) THEN
840 SUBNAM( 1:1 ) = CHAR( IC-32 )
842 IC = ICHAR( SUBNAM( I:I ) )
843 IF( IC.GE.97 .AND. IC.LE.122 )
844 $ SUBNAM( I:I ) = CHAR( IC-32 )
848 ELSE IF( IZ.EQ.233 .OR. IZ.EQ.169 ) THEN
850 * EBCDIC character set
852 IF( ( IC.GE.129 .AND. IC.LE.137 ) .OR.
853 $ ( IC.GE.145 .AND. IC.LE.153 ) .OR.
854 $ ( IC.GE.162 .AND. IC.LE.169 ) ) THEN
855 SUBNAM( 1:1 ) = CHAR( IC+64 )
857 IC = ICHAR( SUBNAM( I:I ) )
858 IF( ( IC.GE.129 .AND. IC.LE.137 ) .OR.
859 $ ( IC.GE.145 .AND. IC.LE.153 ) .OR.
860 $ ( IC.GE.162 .AND. IC.LE.169 ) )
861 $ SUBNAM( I:I ) = CHAR( IC+64 )
865 ELSE IF( IZ.EQ.218 .OR. IZ.EQ.250 ) THEN
867 * Prime machines: ASCII+128
869 IF( IC.GE.225 .AND. IC.LE.250 ) THEN
870 SUBNAM( 1:1 ) = CHAR( IC-32 )
872 IC = ICHAR( SUBNAM( I:I ) )
873 IF( IC.GE.225 .AND. IC.LE.250 )
874 $ SUBNAM( I:I ) = CHAR( IC-32 )
880 SNAME = C1.EQ.'S' .OR. C1.EQ.'D'
881 CNAME = C1.EQ.'C' .OR. C1.EQ.'Z'
882 IF( .NOT.( CNAME .OR. SNAME ) )
888 GO TO ( 110, 200, 300 ) ISPEC
892 * ISPEC = 1: block size
894 * In these examples, separate code is provided for setting NB for
895 * real and complex. We assume that NB will take the same value in
896 * single or double precision.
900 IF( C2.EQ.'GE' ) THEN
901 IF( C3.EQ.'TRF' ) THEN
907 ELSE IF( C3.EQ.'QRF' .OR. C3.EQ.'RQF' .OR. C3.EQ.'LQF' .OR.
914 ELSE IF( C3.EQ.'HRD' ) THEN
920 ELSE IF( C3.EQ.'BRD' ) THEN
926 ELSE IF( C3.EQ.'TRI' ) THEN
933 ELSE IF( C2.EQ.'PO' ) THEN
934 IF( C3.EQ.'TRF' ) THEN
941 ELSE IF( C2.EQ.'SY' ) THEN
942 IF( C3.EQ.'TRF' ) THEN
948 ELSE IF( SNAME .AND. C3.EQ.'TRD' ) THEN
950 ELSE IF( SNAME .AND. C3.EQ.'GST' ) THEN
953 ELSE IF( CNAME .AND. C2.EQ.'HE' ) THEN
954 IF( C3.EQ.'TRF' ) THEN
956 ELSE IF( C3.EQ.'TRD' ) THEN
958 ELSE IF( C3.EQ.'GST' ) THEN
961 ELSE IF( SNAME .AND. C2.EQ.'OR' ) THEN
962 IF( C3( 1:1 ).EQ.'G' ) THEN
963 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
964 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
968 ELSE IF( C3( 1:1 ).EQ.'M' ) THEN
969 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
970 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
975 ELSE IF( CNAME .AND. C2.EQ.'UN' ) THEN
976 IF( C3( 1:1 ).EQ.'G' ) THEN
977 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
978 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
982 ELSE IF( C3( 1:1 ).EQ.'M' ) THEN
983 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
984 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
989 ELSE IF( C2.EQ.'GB' ) THEN
990 IF( C3.EQ.'TRF' ) THEN
1005 ELSE IF( C2.EQ.'PB' ) THEN
1006 IF( C3.EQ.'TRF' ) THEN
1021 ELSE IF( C2.EQ.'TR' ) THEN
1022 IF( C3.EQ.'TRI' ) THEN
1029 ELSE IF( C2.EQ.'LA' ) THEN
1030 IF( C3.EQ.'UUM' ) THEN
1037 ELSE IF( SNAME .AND. C2.EQ.'ST' ) THEN
1038 IF( C3.EQ.'EBZ' ) THEN
1047 * ISPEC = 2: minimum block size
1050 IF( C2.EQ.'GE' ) THEN
1051 IF( C3.EQ.'QRF' .OR. C3.EQ.'RQF' .OR. C3.EQ.'LQF' .OR.
1052 $ C3.EQ.'QLF' ) THEN
1058 ELSE IF( C3.EQ.'HRD' ) THEN
1064 ELSE IF( C3.EQ.'BRD' ) THEN
1070 ELSE IF( C3.EQ.'TRI' ) THEN
1077 ELSE IF( C2.EQ.'SY' ) THEN
1078 IF( C3.EQ.'TRF' ) THEN
1084 ELSE IF( SNAME .AND. C3.EQ.'TRD' ) THEN
1087 ELSE IF( CNAME .AND. C2.EQ.'HE' ) THEN
1088 IF( C3.EQ.'TRD' ) THEN
1091 ELSE IF( SNAME .AND. C2.EQ.'OR' ) THEN
1092 IF( C3( 1:1 ).EQ.'G' ) THEN
1093 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
1094 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
1098 ELSE IF( C3( 1:1 ).EQ.'M' ) THEN
1099 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
1100 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
1105 ELSE IF( CNAME .AND. C2.EQ.'UN' ) THEN
1106 IF( C3( 1:1 ).EQ.'G' ) THEN
1107 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
1108 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
1112 ELSE IF( C3( 1:1 ).EQ.'M' ) THEN
1113 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
1114 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
1125 * ISPEC = 3: crossover point
1128 IF( C2.EQ.'GE' ) THEN
1129 IF( C3.EQ.'QRF' .OR. C3.EQ.'RQF' .OR. C3.EQ.'LQF' .OR.
1130 $ C3.EQ.'QLF' ) THEN
1136 ELSE IF( C3.EQ.'HRD' ) THEN
1142 ELSE IF( C3.EQ.'BRD' ) THEN
1149 ELSE IF( C2.EQ.'SY' ) THEN
1150 IF( SNAME .AND. C3.EQ.'TRD' ) THEN
1153 ELSE IF( CNAME .AND. C2.EQ.'HE' ) THEN
1154 IF( C3.EQ.'TRD' ) THEN
1157 ELSE IF( SNAME .AND. C2.EQ.'OR' ) THEN
1158 IF( C3( 1:1 ).EQ.'G' ) THEN
1159 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
1160 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
1165 ELSE IF( CNAME .AND. C2.EQ.'UN' ) THEN
1166 IF( C3( 1:1 ).EQ.'G' ) THEN
1167 IF( C4.EQ.'QR' .OR. C4.EQ.'RQ' .OR. C4.EQ.'LQ' .OR.
1168 $ C4.EQ.'QL' .OR. C4.EQ.'HR' .OR. C4.EQ.'TR' .OR.
1179 * ISPEC = 4: number of shifts (used by xHSEQR)
1186 * ISPEC = 5: minimum column dimension (not used)
1193 * ISPEC = 6: crossover point for SVD (used by xGELSS and xGESVD)
1195 ILAENV = INT( REAL( MIN( N1, N2 ) )*1.6E0 )
1200 * ISPEC = 7: number of processors (not used)
1207 * ISPEC = 8: crossover point for multishift (used by xHSEQR)
1215 SUBROUTINE DPBTF2( UPLO, N, KD, AB, LDAB, INFO )
1217 * -- LAPACK routine (version 2.0) --
1218 * Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
1219 * Courant Institute, Argonne National Lab, and Rice University
1222 * .. Scalar Arguments ..
1224 INTEGER INFO, KD, LDAB, N
1226 * .. Array Arguments ..
1227 DOUBLE PRECISION AB( LDAB, * )
1233 * DPBTF2 computes the Cholesky factorization of a real symmetric
1234 * positive definite band matrix A.
1236 * The factorization has the form
1237 * A = U' * U , if UPLO = 'U', or
1238 * A = L * L', if UPLO = 'L',
1239 * where U is an upper triangular matrix, U' is the transpose of U, and
1240 * L is lower triangular.
1242 * This is the unblocked version of the algorithm, calling Level 2 BLAS.
1247 * UPLO (input) CHARACTER*1
1248 * Specifies whether the upper or lower triangular part of the
1249 * symmetric matrix A is stored:
1250 * = 'U': Upper triangular
1251 * = 'L': Lower triangular
1254 * The order of the matrix A. N >= 0.
1256 * KD (input) INTEGER
1257 * The number of super-diagonals of the matrix A if UPLO = 'U',
1258 * or the number of sub-diagonals if UPLO = 'L'. KD >= 0.
1260 * AB (input/output) DOUBLE PRECISION array, dimension (LDAB,N)
1261 * On entry, the upper or lower triangle of the symmetric band
1262 * matrix A, stored in the first KD+1 rows of the array. The
1263 * j-th column of A is stored in the j-th column of the array AB
1265 * if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j;
1266 * if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+kd).
1268 * On exit, if INFO = 0, the triangular factor U or L from the
1269 * Cholesky factorization A = U'*U or A = L*L' of the band
1270 * matrix A, in the same storage format as A.
1272 * LDAB (input) INTEGER
1273 * The leading dimension of the array AB. LDAB >= KD+1.
1275 * INFO (output) INTEGER
1276 * = 0: successful exit
1277 * < 0: if INFO = -k, the k-th argument had an illegal value
1278 * > 0: if INFO = k, the leading minor of order k is not
1279 * positive definite, and the factorization could not be
1285 * The band storage scheme is illustrated by the following example, when
1286 * N = 6, KD = 2, and UPLO = 'U':
1288 * On entry: On exit:
1290 * * * a13 a24 a35 a46 * * u13 u24 u35 u46
1291 * * a12 a23 a34 a45 a56 * u12 u23 u34 u45 u56
1292 * a11 a22 a33 a44 a55 a66 u11 u22 u33 u44 u55 u66
1294 * Similarly, if UPLO = 'L' the format of A is as follows:
1296 * On entry: On exit:
1298 * a11 a22 a33 a44 a55 a66 l11 l22 l33 l44 l55 l66
1299 * a21 a32 a43 a54 a65 * l21 l32 l43 l54 l65 *
1300 * a31 a42 a53 a64 * * l31 l42 l53 l64 * *
1302 * Array elements marked * are not used by the routine.
1304 * =====================================================================
1307 DOUBLE PRECISION ONE, ZERO
1308 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
1310 * .. Local Scalars ..
1313 DOUBLE PRECISION AJJ
1315 * .. External Functions ..
1319 * .. External Subroutines ..
1320 EXTERNAL DSCAL, DSYR, XERBLA
1322 * .. Intrinsic Functions ..
1323 INTRINSIC MAX, MIN, SQRT
1325 * .. Executable Statements ..
1327 * Test the input parameters.
1330 UPPER = LSAME( UPLO, 'U' )
1331 IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
1333 ELSE IF( N.LT.0 ) THEN
1335 ELSE IF( KD.LT.0 ) THEN
1337 ELSE IF( LDAB.LT.KD+1 ) THEN
1340 IF( INFO.NE.0 ) THEN
1341 CALL XERBLA( 'DPBTF2', -INFO )
1345 * Quick return if possible
1350 KLD = MAX( 1, LDAB-1 )
1354 * Compute the Cholesky factorization A = U'*U.
1358 * Compute U(J,J) and test for non-positive-definiteness.
1366 * Compute elements J+1:J+KN of row J and update the
1367 * trailing submatrix within the band.
1371 CALL DSCAL( KN, ONE / AJJ, AB( KD, J+1 ), KLD )
1372 CALL DSYR( 'Upper', KN, -ONE, AB( KD, J+1 ), KLD,
1373 $ AB( KD+1, J+1 ), KLD )
1378 * Compute the Cholesky factorization A = L*L'.
1382 * Compute L(J,J) and test for non-positive-definiteness.
1390 * Compute elements J+1:J+KN of column J and update the
1391 * trailing submatrix within the band.
1395 CALL DSCAL( KN, ONE / AJJ, AB( 2, J ), 1 )
1396 CALL DSYR( 'Lower', KN, -ONE, AB( 2, J ), 1,
1397 $ AB( 1, J+1 ), KLD )
1410 LOGICAL FUNCTION LSAME( CA, CB )
1412 * -- LAPACK auxiliary routine (version 2.0) --
1413 * Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
1414 * Courant Institute, Argonne National Lab, and Rice University
1415 * September 30, 1994
1417 * .. Scalar Arguments ..
1424 * LSAME returns .TRUE. if CA is the same letter as CB regardless of
1430 * CA (input) CHARACTER*1
1431 * CB (input) CHARACTER*1
1432 * CA and CB specify the single characters to be compared.
1434 * =====================================================================
1436 * .. Intrinsic Functions ..
1439 * .. Local Scalars ..
1440 INTEGER INTA, INTB, ZCODE
1442 * .. Executable Statements ..
1444 * Test if the characters are equal
1450 * Now test for equivalence if both characters are alphabetic.
1452 ZCODE = ICHAR( 'Z' )
1454 * Use 'Z' rather than 'A' so that ASCII can be detected on Prime
1455 * machines, on which ICHAR returns a value with bit 8 set.
1456 * ICHAR('A') on Prime machines returns 193 which is the same as
1457 * ICHAR('A') on an EBCDIC machine.
1462 IF( ZCODE.EQ.90 .OR. ZCODE.EQ.122 ) THEN
1464 * ASCII is assumed - ZCODE is the ASCII code of either lower or
1467 IF( INTA.GE.97 .AND. INTA.LE.122 ) INTA = INTA - 32
1468 IF( INTB.GE.97 .AND. INTB.LE.122 ) INTB = INTB - 32
1470 ELSE IF( ZCODE.EQ.233 .OR. ZCODE.EQ.169 ) THEN
1472 * EBCDIC is assumed - ZCODE is the EBCDIC code of either lower or
1475 IF( INTA.GE.129 .AND. INTA.LE.137 .OR.
1476 $ INTA.GE.145 .AND. INTA.LE.153 .OR.
1477 $ INTA.GE.162 .AND. INTA.LE.169 ) INTA = INTA + 64
1478 IF( INTB.GE.129 .AND. INTB.LE.137 .OR.
1479 $ INTB.GE.145 .AND. INTB.LE.153 .OR.
1480 $ INTB.GE.162 .AND. INTB.LE.169 ) INTB = INTB + 64
1482 ELSE IF( ZCODE.EQ.218 .OR. ZCODE.EQ.250 ) THEN
1484 * ASCII is assumed, on Prime machines - ZCODE is the ASCII code
1485 * plus 128 of either lower or upper case 'Z'.
1487 IF( INTA.GE.225 .AND. INTA.LE.250 ) INTA = INTA - 32
1488 IF( INTB.GE.225 .AND. INTB.LE.250 ) INTB = INTB - 32
1490 LSAME = INTA.EQ.INTB
1497 SUBROUTINE XERBLA( SRNAME, INFO )
1499 * -- LAPACK auxiliary routine (version 2.0) --
1500 * Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
1501 * Courant Institute, Argonne National Lab, and Rice University
1502 * September 30, 1994
1504 * .. Scalar Arguments ..
1512 * XERBLA is an error handler for the LAPACK routines.
1513 * It is called by an LAPACK routine if an input parameter has an
1514 * invalid value. A message is printed and execution stops.
1516 * Installers may consider modifying the STOP statement in order to
1517 * call system-specific exception-handling facilities.
1522 * SRNAME (input) CHARACTER*6
1523 * The name of the routine which called XERBLA.
1525 * INFO (input) INTEGER
1526 * The position of the invalid parameter in the parameter list
1527 * of the calling routine.
1529 * =====================================================================
1531 * .. Executable Statements ..
1533 WRITE( *, FMT = 9999 )SRNAME, INFO
1537 9999 FORMAT( ' ** On entry to ', A6, ' parameter number ', I2, ' had ',
1538 $ 'an illegal value' )
1543 SUBROUTINE DPOTF2( UPLO, N, A, LDA, INFO )
1545 * -- LAPACK routine (version 2.0) --
1546 * Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
1547 * Courant Institute, Argonne National Lab, and Rice University
1550 * .. Scalar Arguments ..
1552 INTEGER INFO, LDA, N
1554 * .. Array Arguments ..
1555 DOUBLE PRECISION A( LDA, * )
1561 * DPOTF2 computes the Cholesky factorization of a real symmetric
1562 * positive definite matrix A.
1564 * The factorization has the form
1565 * A = U' * U , if UPLO = 'U', or
1566 * A = L * L', if UPLO = 'L',
1567 * where U is an upper triangular matrix and L is lower triangular.
1569 * This is the unblocked version of the algorithm, calling Level 2 BLAS.
1574 * UPLO (input) CHARACTER*1
1575 * Specifies whether the upper or lower triangular part of the
1576 * symmetric matrix A is stored.
1577 * = 'U': Upper triangular
1578 * = 'L': Lower triangular
1581 * The order of the matrix A. N >= 0.
1583 * A (input/output) DOUBLE PRECISION array, dimension (LDA,N)
1584 * On entry, the symmetric matrix A. If UPLO = 'U', the leading
1585 * n by n upper triangular part of A contains the upper
1586 * triangular part of the matrix A, and the strictly lower
1587 * triangular part of A is not referenced. If UPLO = 'L', the
1588 * leading n by n lower triangular part of A contains the lower
1589 * triangular part of the matrix A, and the strictly upper
1590 * triangular part of A is not referenced.
1592 * On exit, if INFO = 0, the factor U or L from the Cholesky
1593 * factorization A = U'*U or A = L*L'.
1595 * LDA (input) INTEGER
1596 * The leading dimension of the array A. LDA >= max(1,N).
1598 * INFO (output) INTEGER
1599 * = 0: successful exit
1600 * < 0: if INFO = -k, the k-th argument had an illegal value
1601 * > 0: if INFO = k, the leading minor of order k is not
1602 * positive definite, and the factorization could not be
1605 * =====================================================================
1608 DOUBLE PRECISION ONE, ZERO
1609 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
1611 * .. Local Scalars ..
1614 DOUBLE PRECISION AJJ
1616 * .. External Functions ..
1618 DOUBLE PRECISION DDOT
1619 EXTERNAL LSAME, DDOT
1621 * .. External Subroutines ..
1622 EXTERNAL DGEMV, DSCAL, XERBLA
1624 * .. Intrinsic Functions ..
1627 * .. Executable Statements ..
1629 * Test the input parameters.
1632 UPPER = LSAME( UPLO, 'U' )
1633 IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
1635 ELSE IF( N.LT.0 ) THEN
1637 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
1640 IF( INFO.NE.0 ) THEN
1641 CALL XERBLA( 'DPOTF2', -INFO )
1645 * Quick return if possible
1652 * Compute the Cholesky factorization A = U'*U.
1656 * Compute U(J,J) and test for non-positive-definiteness.
1658 AJJ = A( J, J ) - DDOT( J-1, A( 1, J ), 1, A( 1, J ), 1 )
1659 IF( AJJ.LE.ZERO ) THEN
1666 * Compute elements J+1:N of row J.
1669 CALL DGEMV( 'Transpose', J-1, N-J, -ONE, A( 1, J+1 ),
1670 $ LDA, A( 1, J ), 1, ONE, A( J, J+1 ), LDA )
1671 CALL DSCAL( N-J, ONE / AJJ, A( J, J+1 ), LDA )
1676 * Compute the Cholesky factorization A = L*L'.
1680 * Compute L(J,J) and test for non-positive-definiteness.
1682 AJJ = A( J, J ) - DDOT( J-1, A( J, 1 ), LDA, A( J, 1 ),
1684 IF( AJJ.LE.ZERO ) THEN
1691 * Compute elements J+1:N of column J.
1694 CALL DGEMV( 'No transpose', N-J, J-1, -ONE, A( J+1, 1 ),
1695 $ LDA, A( J, 1 ), LDA, ONE, A( J+1, J ), 1 )
1696 CALL DSCAL( N-J, ONE / AJJ, A( J+1, J ), 1 )
1711 subroutine dscal(n,da,dx,incx)
1713 c scales a vector by a constant.
1714 c uses unrolled loops for increment equal to one.
1715 c jack dongarra, linpack, 3/11/78.
1716 c modified 3/93 to return if incx .le. 0.
1717 c modified 12/3/93, array(1) declarations changed to array(*)
1719 double precision da,dx(*)
1720 integer i,incx,m,mp1,n,nincx
1722 if( n.le.0 .or. incx.le.0 )return
1723 if(incx.eq.1)go to 20
1725 c code for increment not equal to 1
1728 do 10 i = 1,nincx,incx
1733 c code for increment equal to 1
1739 if( m .eq. 0 ) go to 40
1743 if( n .lt. 5 ) return
1747 dx(i + 1) = da*dx(i + 1)
1748 dx(i + 2) = da*dx(i + 2)
1749 dx(i + 3) = da*dx(i + 3)
1750 dx(i + 4) = da*dx(i + 4)
1754 double precision function ddot(n,dx,incx,dy,incy)
1756 c forms the dot product of two vectors.
1757 c uses unrolled loops for increments equal to one.
1758 c jack dongarra, linpack, 3/11/78.
1759 c modified 12/3/93, array(1) declarations changed to array(*)
1761 double precision dx(*),dy(*),dtemp
1762 integer i,incx,incy,ix,iy,m,mp1,n
1767 if(incx.eq.1.and.incy.eq.1)go to 20
1769 c code for unequal increments or equal increments
1774 if(incx.lt.0)ix = (-n+1)*incx + 1
1775 if(incy.lt.0)iy = (-n+1)*incy + 1
1777 dtemp = dtemp + dx(ix)*dy(iy)
1784 c code for both increments equal to 1
1790 if( m .eq. 0 ) go to 40
1792 dtemp = dtemp + dx(i)*dy(i)
1794 if( n .lt. 5 ) go to 60
1797 dtemp = dtemp + dx(i)*dy(i) + dx(i + 1)*dy(i + 1) +
1798 * dx(i + 2)*dy(i + 2) + dx(i + 3)*dy(i + 3) + dx(i + 4)*dy(i + 4)
1803 SUBROUTINE DTRSM ( SIDE, UPLO, TRANSA, DIAG, M, N, ALPHA, A, LDA,
1805 * .. Scalar Arguments ..
1806 CHARACTER*1 SIDE, UPLO, TRANSA, DIAG
1807 INTEGER M, N, LDA, LDB
1808 DOUBLE PRECISION ALPHA
1809 * .. Array Arguments ..
1810 DOUBLE PRECISION A( LDA, * ), B( LDB, * )
1816 * DTRSM solves one of the matrix equations
1818 * op( A )*X = alpha*B, or X*op( A ) = alpha*B,
1820 * where alpha is a scalar, X and B are m by n matrices, A is a unit, or
1821 * non-unit, upper or lower triangular matrix and op( A ) is one of
1823 * op( A ) = A or op( A ) = A'.
1825 * The matrix X is overwritten on B.
1830 * SIDE - CHARACTER*1.
1831 * On entry, SIDE specifies whether op( A ) appears on the left
1832 * or right of X as follows:
1834 * SIDE = 'L' or 'l' op( A )*X = alpha*B.
1836 * SIDE = 'R' or 'r' X*op( A ) = alpha*B.
1838 * Unchanged on exit.
1840 * UPLO - CHARACTER*1.
1841 * On entry, UPLO specifies whether the matrix A is an upper or
1842 * lower triangular matrix as follows:
1844 * UPLO = 'U' or 'u' A is an upper triangular matrix.
1846 * UPLO = 'L' or 'l' A is a lower triangular matrix.
1848 * Unchanged on exit.
1850 * TRANSA - CHARACTER*1.
1851 * On entry, TRANSA specifies the form of op( A ) to be used in
1852 * the matrix multiplication as follows:
1854 * TRANSA = 'N' or 'n' op( A ) = A.
1856 * TRANSA = 'T' or 't' op( A ) = A'.
1858 * TRANSA = 'C' or 'c' op( A ) = A'.
1860 * Unchanged on exit.
1862 * DIAG - CHARACTER*1.
1863 * On entry, DIAG specifies whether or not A is unit triangular
1866 * DIAG = 'U' or 'u' A is assumed to be unit triangular.
1868 * DIAG = 'N' or 'n' A is not assumed to be unit
1871 * Unchanged on exit.
1874 * On entry, M specifies the number of rows of B. M must be at
1876 * Unchanged on exit.
1879 * On entry, N specifies the number of columns of B. N must be
1881 * Unchanged on exit.
1883 * ALPHA - DOUBLE PRECISION.
1884 * On entry, ALPHA specifies the scalar alpha. When alpha is
1885 * zero then A is not referenced and B need not be set before
1887 * Unchanged on exit.
1889 * A - DOUBLE PRECISION array of DIMENSION ( LDA, k ), where k is m
1890 * when SIDE = 'L' or 'l' and is n when SIDE = 'R' or 'r'.
1891 * Before entry with UPLO = 'U' or 'u', the leading k by k
1892 * upper triangular part of the array A must contain the upper
1893 * triangular matrix and the strictly lower triangular part of
1894 * A is not referenced.
1895 * Before entry with UPLO = 'L' or 'l', the leading k by k
1896 * lower triangular part of the array A must contain the lower
1897 * triangular matrix and the strictly upper triangular part of
1898 * A is not referenced.
1899 * Note that when DIAG = 'U' or 'u', the diagonal elements of
1900 * A are not referenced either, but are assumed to be unity.
1901 * Unchanged on exit.
1904 * On entry, LDA specifies the first dimension of A as declared
1905 * in the calling (sub) program. When SIDE = 'L' or 'l' then
1906 * LDA must be at least max( 1, m ), when SIDE = 'R' or 'r'
1907 * then LDA must be at least max( 1, n ).
1908 * Unchanged on exit.
1910 * B - DOUBLE PRECISION array of DIMENSION ( LDB, n ).
1911 * Before entry, the leading m by n part of the array B must
1912 * contain the right-hand side matrix B, and on exit is
1913 * overwritten by the solution matrix X.
1916 * On entry, LDB specifies the first dimension of B as declared
1917 * in the calling (sub) program. LDB must be at least
1919 * Unchanged on exit.
1922 * Level 3 Blas routine.
1925 * -- Written on 8-February-1989.
1926 * Jack Dongarra, Argonne National Laboratory.
1927 * Iain Duff, AERE Harwell.
1928 * Jeremy Du Croz, Numerical Algorithms Group Ltd.
1929 * Sven Hammarling, Numerical Algorithms Group Ltd.
1932 * .. External Functions ..
1935 * .. External Subroutines ..
1937 * .. Intrinsic Functions ..
1939 * .. Local Scalars ..
1940 LOGICAL LSIDE, NOUNIT, UPPER
1941 INTEGER I, INFO, J, K, NROWA
1942 DOUBLE PRECISION TEMP
1944 DOUBLE PRECISION ONE , ZERO
1945 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
1947 * .. Executable Statements ..
1949 * Test the input parameters.
1951 LSIDE = LSAME( SIDE , 'L' )
1957 NOUNIT = LSAME( DIAG , 'N' )
1958 UPPER = LSAME( UPLO , 'U' )
1961 IF( ( .NOT.LSIDE ).AND.
1962 $ ( .NOT.LSAME( SIDE , 'R' ) ) )THEN
1964 ELSE IF( ( .NOT.UPPER ).AND.
1965 $ ( .NOT.LSAME( UPLO , 'L' ) ) )THEN
1967 ELSE IF( ( .NOT.LSAME( TRANSA, 'N' ) ).AND.
1968 $ ( .NOT.LSAME( TRANSA, 'T' ) ).AND.
1969 $ ( .NOT.LSAME( TRANSA, 'C' ) ) )THEN
1971 ELSE IF( ( .NOT.LSAME( DIAG , 'U' ) ).AND.
1972 $ ( .NOT.LSAME( DIAG , 'N' ) ) )THEN
1974 ELSE IF( M .LT.0 )THEN
1976 ELSE IF( N .LT.0 )THEN
1978 ELSE IF( LDA.LT.MAX( 1, NROWA ) )THEN
1980 ELSE IF( LDB.LT.MAX( 1, M ) )THEN
1984 CALL XERBLA( 'DTRSM ', INFO )
1988 * Quick return if possible.
1993 * And when alpha.eq.zero.
1995 IF( ALPHA.EQ.ZERO )THEN
2004 * Start the operations.
2007 IF( LSAME( TRANSA, 'N' ) )THEN
2009 * Form B := alpha*inv( A )*B.
2013 IF( ALPHA.NE.ONE )THEN
2015 B( I, J ) = ALPHA*B( I, J )
2019 IF( B( K, J ).NE.ZERO )THEN
2021 $ B( K, J ) = B( K, J )/A( K, K )
2023 B( I, J ) = B( I, J ) - B( K, J )*A( I, K )
2030 IF( ALPHA.NE.ONE )THEN
2032 B( I, J ) = ALPHA*B( I, J )
2036 IF( B( K, J ).NE.ZERO )THEN
2038 $ B( K, J ) = B( K, J )/A( K, K )
2040 B( I, J ) = B( I, J ) - B( K, J )*A( I, K )
2048 * Form B := alpha*inv( A' )*B.
2053 TEMP = ALPHA*B( I, J )
2054 DO 110, K = 1, I - 1
2055 TEMP = TEMP - A( K, I )*B( K, J )
2058 $ TEMP = TEMP/A( I, I )
2064 DO 150, I = M, 1, -1
2065 TEMP = ALPHA*B( I, J )
2066 DO 140, K = I + 1, M
2067 TEMP = TEMP - A( K, I )*B( K, J )
2070 $ TEMP = TEMP/A( I, I )
2077 IF( LSAME( TRANSA, 'N' ) )THEN
2079 * Form B := alpha*B*inv( A ).
2083 IF( ALPHA.NE.ONE )THEN
2085 B( I, J ) = ALPHA*B( I, J )
2088 DO 190, K = 1, J - 1
2089 IF( A( K, J ).NE.ZERO )THEN
2091 B( I, J ) = B( I, J ) - A( K, J )*B( I, K )
2096 TEMP = ONE/A( J, J )
2098 B( I, J ) = TEMP*B( I, J )
2103 DO 260, J = N, 1, -1
2104 IF( ALPHA.NE.ONE )THEN
2106 B( I, J ) = ALPHA*B( I, J )
2109 DO 240, K = J + 1, N
2110 IF( A( K, J ).NE.ZERO )THEN
2112 B( I, J ) = B( I, J ) - A( K, J )*B( I, K )
2117 TEMP = ONE/A( J, J )
2119 B( I, J ) = TEMP*B( I, J )
2126 * Form B := alpha*B*inv( A' ).
2129 DO 310, K = N, 1, -1
2131 TEMP = ONE/A( K, K )
2133 B( I, K ) = TEMP*B( I, K )
2136 DO 290, J = 1, K - 1
2137 IF( A( J, K ).NE.ZERO )THEN
2140 B( I, J ) = B( I, J ) - TEMP*B( I, K )
2144 IF( ALPHA.NE.ONE )THEN
2146 B( I, K ) = ALPHA*B( I, K )
2153 TEMP = ONE/A( K, K )
2155 B( I, K ) = TEMP*B( I, K )
2158 DO 340, J = K + 1, N
2159 IF( A( J, K ).NE.ZERO )THEN
2162 B( I, J ) = B( I, J ) - TEMP*B( I, K )
2166 IF( ALPHA.NE.ONE )THEN
2168 B( I, K ) = ALPHA*B( I, K )
2181 SUBROUTINE DTBSV ( UPLO, TRANS, DIAG, N, K, A, LDA, X, INCX )
2182 * .. Scalar Arguments ..
2183 INTEGER INCX, K, LDA, N
2184 CHARACTER*1 DIAG, TRANS, UPLO
2185 * .. Array Arguments ..
2186 DOUBLE PRECISION A( LDA, * ), X( * )
2192 * DTBSV solves one of the systems of equations
2194 * A*x = b, or A'*x = b,
2196 * where b and x are n element vectors and A is an n by n unit, or
2197 * non-unit, upper or lower triangular band matrix, with ( k + 1 )
2200 * No test for singularity or near-singularity is included in this
2201 * routine. Such tests must be performed before calling this routine.
2206 * UPLO - CHARACTER*1.
2207 * On entry, UPLO specifies whether the matrix is an upper or
2208 * lower triangular matrix as follows:
2210 * UPLO = 'U' or 'u' A is an upper triangular matrix.
2212 * UPLO = 'L' or 'l' A is a lower triangular matrix.
2214 * Unchanged on exit.
2216 * TRANS - CHARACTER*1.
2217 * On entry, TRANS specifies the equations to be solved as
2220 * TRANS = 'N' or 'n' A*x = b.
2222 * TRANS = 'T' or 't' A'*x = b.
2224 * TRANS = 'C' or 'c' A'*x = b.
2226 * Unchanged on exit.
2228 * DIAG - CHARACTER*1.
2229 * On entry, DIAG specifies whether or not A is unit
2230 * triangular as follows:
2232 * DIAG = 'U' or 'u' A is assumed to be unit triangular.
2234 * DIAG = 'N' or 'n' A is not assumed to be unit
2237 * Unchanged on exit.
2240 * On entry, N specifies the order of the matrix A.
2241 * N must be at least zero.
2242 * Unchanged on exit.
2245 * On entry with UPLO = 'U' or 'u', K specifies the number of
2246 * super-diagonals of the matrix A.
2247 * On entry with UPLO = 'L' or 'l', K specifies the number of
2248 * sub-diagonals of the matrix A.
2249 * K must satisfy 0 .le. K.
2250 * Unchanged on exit.
2252 * A - DOUBLE PRECISION array of DIMENSION ( LDA, n ).
2253 * Before entry with UPLO = 'U' or 'u', the leading ( k + 1 )
2254 * by n part of the array A must contain the upper triangular
2255 * band part of the matrix of coefficients, supplied column by
2256 * column, with the leading diagonal of the matrix in row
2257 * ( k + 1 ) of the array, the first super-diagonal starting at
2258 * position 2 in row k, and so on. The top left k by k triangle
2259 * of the array A is not referenced.
2260 * The following program segment will transfer an upper
2261 * triangular band matrix from conventional full matrix storage
2266 * DO 10, I = MAX( 1, J - K ), J
2267 * A( M + I, J ) = matrix( I, J )
2271 * Before entry with UPLO = 'L' or 'l', the leading ( k + 1 )
2272 * by n part of the array A must contain the lower triangular
2273 * band part of the matrix of coefficients, supplied column by
2274 * column, with the leading diagonal of the matrix in row 1 of
2275 * the array, the first sub-diagonal starting at position 1 in
2276 * row 2, and so on. The bottom right k by k triangle of the
2277 * array A is not referenced.
2278 * The following program segment will transfer a lower
2279 * triangular band matrix from conventional full matrix storage
2284 * DO 10, I = J, MIN( N, J + K )
2285 * A( M + I, J ) = matrix( I, J )
2289 * Note that when DIAG = 'U' or 'u' the elements of the array A
2290 * corresponding to the diagonal elements of the matrix are not
2291 * referenced, but are assumed to be unity.
2292 * Unchanged on exit.
2295 * On entry, LDA specifies the first dimension of A as declared
2296 * in the calling (sub) program. LDA must be at least
2298 * Unchanged on exit.
2300 * X - DOUBLE PRECISION array of dimension at least
2301 * ( 1 + ( n - 1 )*abs( INCX ) ).
2302 * Before entry, the incremented array X must contain the n
2303 * element right-hand side vector b. On exit, X is overwritten
2304 * with the solution vector x.
2307 * On entry, INCX specifies the increment for the elements of
2308 * X. INCX must not be zero.
2309 * Unchanged on exit.
2312 * Level 2 Blas routine.
2314 * -- Written on 22-October-1986.
2315 * Jack Dongarra, Argonne National Lab.
2316 * Jeremy Du Croz, Nag Central Office.
2317 * Sven Hammarling, Nag Central Office.
2318 * Richard Hanson, Sandia National Labs.
2322 DOUBLE PRECISION ZERO
2323 PARAMETER ( ZERO = 0.0D+0 )
2324 * .. Local Scalars ..
2325 DOUBLE PRECISION TEMP
2326 INTEGER I, INFO, IX, J, JX, KPLUS1, KX, L
2328 * .. External Functions ..
2331 * .. External Subroutines ..
2333 * .. Intrinsic Functions ..
2336 * .. Executable Statements ..
2338 * Test the input parameters.
2341 IF ( .NOT.LSAME( UPLO , 'U' ).AND.
2342 $ .NOT.LSAME( UPLO , 'L' ) )THEN
2344 ELSE IF( .NOT.LSAME( TRANS, 'N' ).AND.
2345 $ .NOT.LSAME( TRANS, 'T' ).AND.
2346 $ .NOT.LSAME( TRANS, 'C' ) )THEN
2348 ELSE IF( .NOT.LSAME( DIAG , 'U' ).AND.
2349 $ .NOT.LSAME( DIAG , 'N' ) )THEN
2351 ELSE IF( N.LT.0 )THEN
2353 ELSE IF( K.LT.0 )THEN
2355 ELSE IF( LDA.LT.( K + 1 ) )THEN
2357 ELSE IF( INCX.EQ.0 )THEN
2361 CALL XERBLA( 'DTBSV ', INFO )
2365 * Quick return if possible.
2370 NOUNIT = LSAME( DIAG, 'N' )
2372 * Set up the start point in X if the increment is not unity. This
2373 * will be ( N - 1 )*INCX too small for descending loops.
2376 KX = 1 - ( N - 1 )*INCX
2377 ELSE IF( INCX.NE.1 )THEN
2381 * Start the operations. In this version the elements of A are
2382 * accessed by sequentially with one pass through A.
2384 IF( LSAME( TRANS, 'N' ) )THEN
2386 * Form x := inv( A )*x.
2388 IF( LSAME( UPLO, 'U' ) )THEN
2392 IF( X( J ).NE.ZERO )THEN
2395 $ X( J ) = X( J )/A( KPLUS1, J )
2397 DO 10, I = J - 1, MAX( 1, J - K ), -1
2398 X( I ) = X( I ) - TEMP*A( L + I, J )
2403 KX = KX + ( N - 1 )*INCX
2407 IF( X( JX ).NE.ZERO )THEN
2411 $ X( JX ) = X( JX )/A( KPLUS1, J )
2413 DO 30, I = J - 1, MAX( 1, J - K ), -1
2414 X( IX ) = X( IX ) - TEMP*A( L + I, J )
2424 IF( X( J ).NE.ZERO )THEN
2427 $ X( J ) = X( J )/A( 1, J )
2429 DO 50, I = J + 1, MIN( N, J + K )
2430 X( I ) = X( I ) - TEMP*A( L + I, J )
2438 IF( X( JX ).NE.ZERO )THEN
2442 $ X( JX ) = X( JX )/A( 1, J )
2444 DO 70, I = J + 1, MIN( N, J + K )
2445 X( IX ) = X( IX ) - TEMP*A( L + I, J )
2455 * Form x := inv( A')*x.
2457 IF( LSAME( UPLO, 'U' ) )THEN
2463 DO 90, I = MAX( 1, J - K ), J - 1
2464 TEMP = TEMP - A( L + I, J )*X( I )
2467 $ TEMP = TEMP/A( KPLUS1, J )
2476 DO 110, I = MAX( 1, J - K ), J - 1
2477 TEMP = TEMP - A( L + I, J )*X( IX )
2481 $ TEMP = TEMP/A( KPLUS1, J )
2490 DO 140, J = N, 1, -1
2493 DO 130, I = MIN( N, J + K ), J + 1, -1
2494 TEMP = TEMP - A( L + I, J )*X( I )
2497 $ TEMP = TEMP/A( 1, J )
2501 KX = KX + ( N - 1 )*INCX
2503 DO 160, J = N, 1, -1
2507 DO 150, I = MIN( N, J + K ), J + 1, -1
2508 TEMP = TEMP - A( L + I, J )*X( IX )
2512 $ TEMP = TEMP/A( 1, J )
2515 IF( ( N - J ).GE.K )
2527 SUBROUTINE DSYR ( UPLO, N, ALPHA, X, INCX, A, LDA )
2528 * .. Scalar Arguments ..
2529 DOUBLE PRECISION ALPHA
2530 INTEGER INCX, LDA, N
2532 * .. Array Arguments ..
2533 DOUBLE PRECISION A( LDA, * ), X( * )
2539 * DSYR performs the symmetric rank 1 operation
2541 * A := alpha*x*x' + A,
2543 * where alpha is a real scalar, x is an n element vector and A is an
2544 * n by n symmetric matrix.
2549 * UPLO - CHARACTER*1.
2550 * On entry, UPLO specifies whether the upper or lower
2551 * triangular part of the array A is to be referenced as
2554 * UPLO = 'U' or 'u' Only the upper triangular part of A
2555 * is to be referenced.
2557 * UPLO = 'L' or 'l' Only the lower triangular part of A
2558 * is to be referenced.
2560 * Unchanged on exit.
2563 * On entry, N specifies the order of the matrix A.
2564 * N must be at least zero.
2565 * Unchanged on exit.
2567 * ALPHA - DOUBLE PRECISION.
2568 * On entry, ALPHA specifies the scalar alpha.
2569 * Unchanged on exit.
2571 * X - DOUBLE PRECISION array of dimension at least
2572 * ( 1 + ( n - 1 )*abs( INCX ) ).
2573 * Before entry, the incremented array X must contain the n
2575 * Unchanged on exit.
2578 * On entry, INCX specifies the increment for the elements of
2579 * X. INCX must not be zero.
2580 * Unchanged on exit.
2582 * A - DOUBLE PRECISION array of DIMENSION ( LDA, n ).
2583 * Before entry with UPLO = 'U' or 'u', the leading n by n
2584 * upper triangular part of the array A must contain the upper
2585 * triangular part of the symmetric matrix and the strictly
2586 * lower triangular part of A is not referenced. On exit, the
2587 * upper triangular part of the array A is overwritten by the
2588 * upper triangular part of the updated matrix.
2589 * Before entry with UPLO = 'L' or 'l', the leading n by n
2590 * lower triangular part of the array A must contain the lower
2591 * triangular part of the symmetric matrix and the strictly
2592 * upper triangular part of A is not referenced. On exit, the
2593 * lower triangular part of the array A is overwritten by the
2594 * lower triangular part of the updated matrix.
2597 * On entry, LDA specifies the first dimension of A as declared
2598 * in the calling (sub) program. LDA must be at least
2600 * Unchanged on exit.
2603 * Level 2 Blas routine.
2605 * -- Written on 22-October-1986.
2606 * Jack Dongarra, Argonne National Lab.
2607 * Jeremy Du Croz, Nag Central Office.
2608 * Sven Hammarling, Nag Central Office.
2609 * Richard Hanson, Sandia National Labs.
2613 DOUBLE PRECISION ZERO
2614 PARAMETER ( ZERO = 0.0D+0 )
2615 * .. Local Scalars ..
2616 DOUBLE PRECISION TEMP
2617 INTEGER I, INFO, IX, J, JX, KX
2618 * .. External Functions ..
2621 * .. External Subroutines ..
2623 * .. Intrinsic Functions ..
2626 * .. Executable Statements ..
2628 * Test the input parameters.
2631 IF ( .NOT.LSAME( UPLO, 'U' ).AND.
2632 $ .NOT.LSAME( UPLO, 'L' ) )THEN
2634 ELSE IF( N.LT.0 )THEN
2636 ELSE IF( INCX.EQ.0 )THEN
2638 ELSE IF( LDA.LT.MAX( 1, N ) )THEN
2642 CALL XERBLA( 'DSYR ', INFO )
2646 * Quick return if possible.
2648 IF( ( N.EQ.0 ).OR.( ALPHA.EQ.ZERO ) )
2651 * Set the start point in X if the increment is not unity.
2654 KX = 1 - ( N - 1 )*INCX
2655 ELSE IF( INCX.NE.1 )THEN
2659 * Start the operations. In this version the elements of A are
2660 * accessed sequentially with one pass through the triangular part
2663 IF( LSAME( UPLO, 'U' ) )THEN
2665 * Form A when A is stored in upper triangle.
2669 IF( X( J ).NE.ZERO )THEN
2672 A( I, J ) = A( I, J ) + X( I )*TEMP
2679 IF( X( JX ).NE.ZERO )THEN
2680 TEMP = ALPHA*X( JX )
2683 A( I, J ) = A( I, J ) + X( IX )*TEMP
2692 * Form A when A is stored in lower triangle.
2696 IF( X( J ).NE.ZERO )THEN
2699 A( I, J ) = A( I, J ) + X( I )*TEMP
2706 IF( X( JX ).NE.ZERO )THEN
2707 TEMP = ALPHA*X( JX )
2710 A( I, J ) = A( I, J ) + X( IX )*TEMP
2724 SUBROUTINE DSYRK ( UPLO, TRANS, N, K, ALPHA, A, LDA,
2726 * .. Scalar Arguments ..
2727 CHARACTER*1 UPLO, TRANS
2728 INTEGER N, K, LDA, LDC
2729 DOUBLE PRECISION ALPHA, BETA
2730 * .. Array Arguments ..
2731 DOUBLE PRECISION A( LDA, * ), C( LDC, * )
2737 * DSYRK performs one of the symmetric rank k operations
2739 * C := alpha*A*A' + beta*C,
2743 * C := alpha*A'*A + beta*C,
2745 * where alpha and beta are scalars, C is an n by n symmetric matrix
2746 * and A is an n by k matrix in the first case and a k by n matrix
2747 * in the second case.
2752 * UPLO - CHARACTER*1.
2753 * On entry, UPLO specifies whether the upper or lower
2754 * triangular part of the array C is to be referenced as
2757 * UPLO = 'U' or 'u' Only the upper triangular part of C
2758 * is to be referenced.
2760 * UPLO = 'L' or 'l' Only the lower triangular part of C
2761 * is to be referenced.
2763 * Unchanged on exit.
2765 * TRANS - CHARACTER*1.
2766 * On entry, TRANS specifies the operation to be performed as
2769 * TRANS = 'N' or 'n' C := alpha*A*A' + beta*C.
2771 * TRANS = 'T' or 't' C := alpha*A'*A + beta*C.
2773 * TRANS = 'C' or 'c' C := alpha*A'*A + beta*C.
2775 * Unchanged on exit.
2778 * On entry, N specifies the order of the matrix C. N must be
2780 * Unchanged on exit.
2783 * On entry with TRANS = 'N' or 'n', K specifies the number
2784 * of columns of the matrix A, and on entry with
2785 * TRANS = 'T' or 't' or 'C' or 'c', K specifies the number
2786 * of rows of the matrix A. K must be at least zero.
2787 * Unchanged on exit.
2789 * ALPHA - DOUBLE PRECISION.
2790 * On entry, ALPHA specifies the scalar alpha.
2791 * Unchanged on exit.
2793 * A - DOUBLE PRECISION array of DIMENSION ( LDA, ka ), where ka is
2794 * k when TRANS = 'N' or 'n', and is n otherwise.
2795 * Before entry with TRANS = 'N' or 'n', the leading n by k
2796 * part of the array A must contain the matrix A, otherwise
2797 * the leading k by n part of the array A must contain the
2799 * Unchanged on exit.
2802 * On entry, LDA specifies the first dimension of A as declared
2803 * in the calling (sub) program. When TRANS = 'N' or 'n'
2804 * then LDA must be at least max( 1, n ), otherwise LDA must
2805 * be at least max( 1, k ).
2806 * Unchanged on exit.
2808 * BETA - DOUBLE PRECISION.
2809 * On entry, BETA specifies the scalar beta.
2810 * Unchanged on exit.
2812 * C - DOUBLE PRECISION array of DIMENSION ( LDC, n ).
2813 * Before entry with UPLO = 'U' or 'u', the leading n by n
2814 * upper triangular part of the array C must contain the upper
2815 * triangular part of the symmetric matrix and the strictly
2816 * lower triangular part of C is not referenced. On exit, the
2817 * upper triangular part of the array C is overwritten by the
2818 * upper triangular part of the updated matrix.
2819 * Before entry with UPLO = 'L' or 'l', the leading n by n
2820 * lower triangular part of the array C must contain the lower
2821 * triangular part of the symmetric matrix and the strictly
2822 * upper triangular part of C is not referenced. On exit, the
2823 * lower triangular part of the array C is overwritten by the
2824 * lower triangular part of the updated matrix.
2827 * On entry, LDC specifies the first dimension of C as declared
2828 * in the calling (sub) program. LDC must be at least
2830 * Unchanged on exit.
2833 * Level 3 Blas routine.
2835 * -- Written on 8-February-1989.
2836 * Jack Dongarra, Argonne National Laboratory.
2837 * Iain Duff, AERE Harwell.
2838 * Jeremy Du Croz, Numerical Algorithms Group Ltd.
2839 * Sven Hammarling, Numerical Algorithms Group Ltd.
2842 * .. External Functions ..
2845 * .. External Subroutines ..
2847 * .. Intrinsic Functions ..
2849 * .. Local Scalars ..
2851 INTEGER I, INFO, J, L, NROWA
2852 DOUBLE PRECISION TEMP
2854 DOUBLE PRECISION ONE , ZERO
2855 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
2857 * .. Executable Statements ..
2859 * Test the input parameters.
2861 IF( LSAME( TRANS, 'N' ) )THEN
2866 UPPER = LSAME( UPLO, 'U' )
2869 IF( ( .NOT.UPPER ).AND.
2870 $ ( .NOT.LSAME( UPLO , 'L' ) ) )THEN
2872 ELSE IF( ( .NOT.LSAME( TRANS, 'N' ) ).AND.
2873 $ ( .NOT.LSAME( TRANS, 'T' ) ).AND.
2874 $ ( .NOT.LSAME( TRANS, 'C' ) ) )THEN
2876 ELSE IF( N .LT.0 )THEN
2878 ELSE IF( K .LT.0 )THEN
2880 ELSE IF( LDA.LT.MAX( 1, NROWA ) )THEN
2882 ELSE IF( LDC.LT.MAX( 1, N ) )THEN
2886 CALL XERBLA( 'DSYRK ', INFO )
2890 * Quick return if possible.
2893 $ ( ( ( ALPHA.EQ.ZERO ).OR.( K.EQ.0 ) ).AND.( BETA.EQ.ONE ) ) )
2896 * And when alpha.eq.zero.
2898 IF( ALPHA.EQ.ZERO )THEN
2900 IF( BETA.EQ.ZERO )THEN
2909 C( I, J ) = BETA*C( I, J )
2914 IF( BETA.EQ.ZERO )THEN
2923 C( I, J ) = BETA*C( I, J )
2931 * Start the operations.
2933 IF( LSAME( TRANS, 'N' ) )THEN
2935 * Form C := alpha*A*A' + beta*C.
2939 IF( BETA.EQ.ZERO )THEN
2943 ELSE IF( BETA.NE.ONE )THEN
2945 C( I, J ) = BETA*C( I, J )
2949 IF( A( J, L ).NE.ZERO )THEN
2950 TEMP = ALPHA*A( J, L )
2952 C( I, J ) = C( I, J ) + TEMP*A( I, L )
2959 IF( BETA.EQ.ZERO )THEN
2963 ELSE IF( BETA.NE.ONE )THEN
2965 C( I, J ) = BETA*C( I, J )
2969 IF( A( J, L ).NE.ZERO )THEN
2970 TEMP = ALPHA*A( J, L )
2972 C( I, J ) = C( I, J ) + TEMP*A( I, L )
2980 * Form C := alpha*A'*A + beta*C.
2987 TEMP = TEMP + A( L, I )*A( L, J )
2989 IF( BETA.EQ.ZERO )THEN
2990 C( I, J ) = ALPHA*TEMP
2992 C( I, J ) = ALPHA*TEMP + BETA*C( I, J )
3001 TEMP = TEMP + A( L, I )*A( L, J )
3003 IF( BETA.EQ.ZERO )THEN
3004 C( I, J ) = ALPHA*TEMP
3006 C( I, J ) = ALPHA*TEMP + BETA*C( I, J )
3018 SUBROUTINE DGEMM ( TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB,
3020 * .. Scalar Arguments ..
3021 CHARACTER*1 TRANSA, TRANSB
3022 INTEGER M, N, K, LDA, LDB, LDC
3023 DOUBLE PRECISION ALPHA, BETA
3024 * .. Array Arguments ..
3025 DOUBLE PRECISION A( LDA, * ), B( LDB, * ), C( LDC, * )
3031 * DGEMM performs one of the matrix-matrix operations
3033 * C := alpha*op( A )*op( B ) + beta*C,
3035 * where op( X ) is one of
3037 * op( X ) = X or op( X ) = X',
3039 * alpha and beta are scalars, and A, B and C are matrices, with op( A )
3040 * an m by k matrix, op( B ) a k by n matrix and C an m by n matrix.
3045 * TRANSA - CHARACTER*1.
3046 * On entry, TRANSA specifies the form of op( A ) to be used in
3047 * the matrix multiplication as follows:
3049 * TRANSA = 'N' or 'n', op( A ) = A.
3051 * TRANSA = 'T' or 't', op( A ) = A'.
3053 * TRANSA = 'C' or 'c', op( A ) = A'.
3055 * Unchanged on exit.
3057 * TRANSB - CHARACTER*1.
3058 * On entry, TRANSB specifies the form of op( B ) to be used in
3059 * the matrix multiplication as follows:
3061 * TRANSB = 'N' or 'n', op( B ) = B.
3063 * TRANSB = 'T' or 't', op( B ) = B'.
3065 * TRANSB = 'C' or 'c', op( B ) = B'.
3067 * Unchanged on exit.
3070 * On entry, M specifies the number of rows of the matrix
3071 * op( A ) and of the matrix C. M must be at least zero.
3072 * Unchanged on exit.
3075 * On entry, N specifies the number of columns of the matrix
3076 * op( B ) and the number of columns of the matrix C. N must be
3078 * Unchanged on exit.
3081 * On entry, K specifies the number of columns of the matrix
3082 * op( A ) and the number of rows of the matrix op( B ). K must
3084 * Unchanged on exit.
3086 * ALPHA - DOUBLE PRECISION.
3087 * On entry, ALPHA specifies the scalar alpha.
3088 * Unchanged on exit.
3090 * A - DOUBLE PRECISION array of DIMENSION ( LDA, ka ), where ka is
3091 * k when TRANSA = 'N' or 'n', and is m otherwise.
3092 * Before entry with TRANSA = 'N' or 'n', the leading m by k
3093 * part of the array A must contain the matrix A, otherwise
3094 * the leading k by m part of the array A must contain the
3096 * Unchanged on exit.
3099 * On entry, LDA specifies the first dimension of A as declared
3100 * in the calling (sub) program. When TRANSA = 'N' or 'n' then
3101 * LDA must be at least max( 1, m ), otherwise LDA must be at
3102 * least max( 1, k ).
3103 * Unchanged on exit.
3105 * B - DOUBLE PRECISION array of DIMENSION ( LDB, kb ), where kb is
3106 * n when TRANSB = 'N' or 'n', and is k otherwise.
3107 * Before entry with TRANSB = 'N' or 'n', the leading k by n
3108 * part of the array B must contain the matrix B, otherwise
3109 * the leading n by k part of the array B must contain the
3111 * Unchanged on exit.
3114 * On entry, LDB specifies the first dimension of B as declared
3115 * in the calling (sub) program. When TRANSB = 'N' or 'n' then
3116 * LDB must be at least max( 1, k ), otherwise LDB must be at
3117 * least max( 1, n ).
3118 * Unchanged on exit.
3120 * BETA - DOUBLE PRECISION.
3121 * On entry, BETA specifies the scalar beta. When BETA is
3122 * supplied as zero then C need not be set on input.
3123 * Unchanged on exit.
3125 * C - DOUBLE PRECISION array of DIMENSION ( LDC, n ).
3126 * Before entry, the leading m by n part of the array C must
3127 * contain the matrix C, except when beta is zero, in which
3128 * case C need not be set on entry.
3129 * On exit, the array C is overwritten by the m by n matrix
3130 * ( alpha*op( A )*op( B ) + beta*C ).
3133 * On entry, LDC specifies the first dimension of C as declared
3134 * in the calling (sub) program. LDC must be at least
3136 * Unchanged on exit.
3139 * Level 3 Blas routine.
3141 * -- Written on 8-February-1989.
3142 * Jack Dongarra, Argonne National Laboratory.
3143 * Iain Duff, AERE Harwell.
3144 * Jeremy Du Croz, Numerical Algorithms Group Ltd.
3145 * Sven Hammarling, Numerical Algorithms Group Ltd.
3148 * .. External Functions ..
3151 * .. External Subroutines ..
3153 * .. Intrinsic Functions ..
3155 * .. Local Scalars ..
3157 INTEGER I, INFO, J, L, NCOLA, NROWA, NROWB
3158 DOUBLE PRECISION TEMP
3160 DOUBLE PRECISION ONE , ZERO
3161 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
3163 * .. Executable Statements ..
3165 * Set NOTA and NOTB as true if A and B respectively are not
3166 * transposed and set NROWA, NCOLA and NROWB as the number of rows
3167 * and columns of A and the number of rows of B respectively.
3169 NOTA = LSAME( TRANSA, 'N' )
3170 NOTB = LSAME( TRANSB, 'N' )
3184 * Test the input parameters.
3187 IF( ( .NOT.NOTA ).AND.
3188 $ ( .NOT.LSAME( TRANSA, 'C' ) ).AND.
3189 $ ( .NOT.LSAME( TRANSA, 'T' ) ) )THEN
3191 ELSE IF( ( .NOT.NOTB ).AND.
3192 $ ( .NOT.LSAME( TRANSB, 'C' ) ).AND.
3193 $ ( .NOT.LSAME( TRANSB, 'T' ) ) )THEN
3195 ELSE IF( M .LT.0 )THEN
3197 ELSE IF( N .LT.0 )THEN
3199 ELSE IF( K .LT.0 )THEN
3201 ELSE IF( LDA.LT.MAX( 1, NROWA ) )THEN
3203 ELSE IF( LDB.LT.MAX( 1, NROWB ) )THEN
3205 ELSE IF( LDC.LT.MAX( 1, M ) )THEN
3209 CALL XERBLA( 'DGEMM ', INFO )
3213 * Quick return if possible.
3215 IF( ( M.EQ.0 ).OR.( N.EQ.0 ).OR.
3216 $ ( ( ( ALPHA.EQ.ZERO ).OR.( K.EQ.0 ) ).AND.( BETA.EQ.ONE ) ) )
3219 * And if alpha.eq.zero.
3221 IF( ALPHA.EQ.ZERO )THEN
3222 IF( BETA.EQ.ZERO )THEN
3231 C( I, J ) = BETA*C( I, J )
3238 * Start the operations.
3243 * Form C := alpha*A*B + beta*C.
3246 IF( BETA.EQ.ZERO )THEN
3250 ELSE IF( BETA.NE.ONE )THEN
3252 C( I, J ) = BETA*C( I, J )
3256 IF( B( L, J ).NE.ZERO )THEN
3257 TEMP = ALPHA*B( L, J )
3259 C( I, J ) = C( I, J ) + TEMP*A( I, L )
3266 * Form C := alpha*A'*B + beta*C
3272 TEMP = TEMP + A( L, I )*B( L, J )
3274 IF( BETA.EQ.ZERO )THEN
3275 C( I, J ) = ALPHA*TEMP
3277 C( I, J ) = ALPHA*TEMP + BETA*C( I, J )
3285 * Form C := alpha*A*B' + beta*C
3288 IF( BETA.EQ.ZERO )THEN
3292 ELSE IF( BETA.NE.ONE )THEN
3294 C( I, J ) = BETA*C( I, J )
3298 IF( B( J, L ).NE.ZERO )THEN
3299 TEMP = ALPHA*B( J, L )
3301 C( I, J ) = C( I, J ) + TEMP*A( I, L )
3308 * Form C := alpha*A'*B' + beta*C
3314 TEMP = TEMP + A( L, I )*B( J, L )
3316 IF( BETA.EQ.ZERO )THEN
3317 C( I, J ) = ALPHA*TEMP
3319 C( I, J ) = ALPHA*TEMP + BETA*C( I, J )
3331 SUBROUTINE DGEMV ( TRANS, M, N, ALPHA, A, LDA, X, INCX,
3333 * .. Scalar Arguments ..
3334 DOUBLE PRECISION ALPHA, BETA
3335 INTEGER INCX, INCY, LDA, M, N
3337 * .. Array Arguments ..
3338 DOUBLE PRECISION A( LDA, * ), X( * ), Y( * )
3344 * DGEMV performs one of the matrix-vector operations
3346 * y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y,
3348 * where alpha and beta are scalars, x and y are vectors and A is an
3354 * TRANS - CHARACTER*1.
3355 * On entry, TRANS specifies the operation to be performed as
3358 * TRANS = 'N' or 'n' y := alpha*A*x + beta*y.
3360 * TRANS = 'T' or 't' y := alpha*A'*x + beta*y.
3362 * TRANS = 'C' or 'c' y := alpha*A'*x + beta*y.
3364 * Unchanged on exit.
3367 * On entry, M specifies the number of rows of the matrix A.
3368 * M must be at least zero.
3369 * Unchanged on exit.
3372 * On entry, N specifies the number of columns of the matrix A.
3373 * N must be at least zero.
3374 * Unchanged on exit.
3376 * ALPHA - DOUBLE PRECISION.
3377 * On entry, ALPHA specifies the scalar alpha.
3378 * Unchanged on exit.
3380 * A - DOUBLE PRECISION array of DIMENSION ( LDA, n ).
3381 * Before entry, the leading m by n part of the array A must
3382 * contain the matrix of coefficients.
3383 * Unchanged on exit.
3386 * On entry, LDA specifies the first dimension of A as declared
3387 * in the calling (sub) program. LDA must be at least
3389 * Unchanged on exit.
3391 * X - DOUBLE PRECISION array of DIMENSION at least
3392 * ( 1 + ( n - 1 )*abs( INCX ) ) when TRANS = 'N' or 'n'
3394 * ( 1 + ( m - 1 )*abs( INCX ) ) otherwise.
3395 * Before entry, the incremented array X must contain the
3397 * Unchanged on exit.
3400 * On entry, INCX specifies the increment for the elements of
3401 * X. INCX must not be zero.
3402 * Unchanged on exit.
3404 * BETA - DOUBLE PRECISION.
3405 * On entry, BETA specifies the scalar beta. When BETA is
3406 * supplied as zero then Y need not be set on input.
3407 * Unchanged on exit.
3409 * Y - DOUBLE PRECISION array of DIMENSION at least
3410 * ( 1 + ( m - 1 )*abs( INCY ) ) when TRANS = 'N' or 'n'
3412 * ( 1 + ( n - 1 )*abs( INCY ) ) otherwise.
3413 * Before entry with BETA non-zero, the incremented array Y
3414 * must contain the vector y. On exit, Y is overwritten by the
3418 * On entry, INCY specifies the increment for the elements of
3419 * Y. INCY must not be zero.
3420 * Unchanged on exit.
3423 * Level 2 Blas routine.
3425 * -- Written on 22-October-1986.
3426 * Jack Dongarra, Argonne National Lab.
3427 * Jeremy Du Croz, Nag Central Office.
3428 * Sven Hammarling, Nag Central Office.
3429 * Richard Hanson, Sandia National Labs.
3433 DOUBLE PRECISION ONE , ZERO
3434 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
3435 * .. Local Scalars ..
3436 DOUBLE PRECISION TEMP
3437 INTEGER I, INFO, IX, IY, J, JX, JY, KX, KY, LENX, LENY
3438 * .. External Functions ..
3441 * .. External Subroutines ..
3443 * .. Intrinsic Functions ..
3446 * .. Executable Statements ..
3448 * Test the input parameters.
3451 IF ( .NOT.LSAME( TRANS, 'N' ).AND.
3452 $ .NOT.LSAME( TRANS, 'T' ).AND.
3453 $ .NOT.LSAME( TRANS, 'C' ) )THEN
3455 ELSE IF( M.LT.0 )THEN
3457 ELSE IF( N.LT.0 )THEN
3459 ELSE IF( LDA.LT.MAX( 1, M ) )THEN
3461 ELSE IF( INCX.EQ.0 )THEN
3463 ELSE IF( INCY.EQ.0 )THEN
3467 CALL XERBLA( 'DGEMV ', INFO )
3471 * Quick return if possible.
3473 IF( ( M.EQ.0 ).OR.( N.EQ.0 ).OR.
3474 $ ( ( ALPHA.EQ.ZERO ).AND.( BETA.EQ.ONE ) ) )
3477 * Set LENX and LENY, the lengths of the vectors x and y, and set
3478 * up the start points in X and Y.
3480 IF( LSAME( TRANS, 'N' ) )THEN
3490 KX = 1 - ( LENX - 1 )*INCX
3495 KY = 1 - ( LENY - 1 )*INCY
3498 * Start the operations. In this version the elements of A are
3499 * accessed sequentially with one pass through A.
3501 * First form y := beta*y.
3503 IF( BETA.NE.ONE )THEN
3505 IF( BETA.EQ.ZERO )THEN
3511 Y( I ) = BETA*Y( I )
3516 IF( BETA.EQ.ZERO )THEN
3523 Y( IY ) = BETA*Y( IY )
3531 IF( LSAME( TRANS, 'N' ) )THEN
3533 * Form y := alpha*A*x + y.
3538 IF( X( JX ).NE.ZERO )THEN
3539 TEMP = ALPHA*X( JX )
3541 Y( I ) = Y( I ) + TEMP*A( I, J )
3548 IF( X( JX ).NE.ZERO )THEN
3549 TEMP = ALPHA*X( JX )
3552 Y( IY ) = Y( IY ) + TEMP*A( I, J )
3561 * Form y := alpha*A'*x + y.
3568 TEMP = TEMP + A( I, J )*X( I )
3570 Y( JY ) = Y( JY ) + ALPHA*TEMP
3578 TEMP = TEMP + A( I, J )*X( IX )
3581 Y( JY ) = Y( JY ) + ALPHA*TEMP
3593 subroutine perma(compo)
3594 include "calcium.hf"
3595 double precision a(5,24),b(24),q(6)
3596 dimension t(24),tn(24)
3597 dimension puissn(24),puiss(24)
3598 dimension text(6),rflu(6),textn(6)
3599 dimension tpar(6),rpar(6),tparn(6)
3619 c construction de la matrice (laplacien)
3651 a(1,npt)=3./r+1./(r/2.+rext)
3664 a(1,i)=2./r+1./(r/2.+rext)
3668 a(1,i)=2./r+1./(r/2.+rext)
3673 c factorisation de la matrice
3678 call dPBTRF( 'L' , N, KD, A, LDAB, INFO )
3697 c initialisation de la temperature a iter=0
3699 CALL cpeRE(compo,CP_ITERATION, ti, iter, 'tempi', 24,
3701 IF( info.EQ.CPSTOP )GO TO 9000
3703 c initialisation de la temperature de bord a iter=0.
3705 CALL cpeRE(compo,CP_ITERATION, ti, iter, 'tpi', 6,
3707 IF( info.EQ.CPSTOP )GO TO 9000
3709 c boucle iterative infinie
3711 do while( iter .lt. 500)
3713 c lecture de la puissance combustible a iter
3715 CALL cplRE(compo,CP_ITERATION,ti, tf, iter, 'puissi', 24,
3716 & nval, puiss , info)
3717 IF( info.EQ.CPSTOP )GO TO 9000
3719 c lecture de la temperature exterieure a iter
3721 CALL cplRE(compo,CP_ITERATION,ti, tf, iter, 'tfi', 6,
3722 & nval, text , info)
3723 IF( info.EQ.CPSTOP )GO TO 9000
3725 c calcul du second membre
3733 b(npt)=b(npt)+text(j)/(r/2+rflu(j))
3737 c resolution du systeme lineaire
3739 call dPBTRs( 'L' , N,kd, nrhs,A,LDAB,b,ldb,INFO )
3751 c ecriture de la temperature a iter+1
3753 CALL cpeRE(compo,CP_ITERATION, ti, iter, 'tempi', 24,
3755 IF( info.NE. CPOK )GO TO 9000
3757 c ecriture de la temperature de paroi a iter+1
3759 CALL cpeRE(compo,CP_ITERATION, ti, iter, 'tpi', 6,
3761 IF( info.NE. CPOK )GO TO 9000
3763 c calcul de convergence
3767 conv1=conv1+(puiss(i)-puissn(i))**2
3768 conv1=conv1+(t(i)-tn(i))**2
3771 conv1=conv1+(tpar(i)-tparn(i))**2
3772 conv1=conv1+(text(i)-textn(i))**2
3776 if(conv1.lt.1.e-3) iconv=1
3778 c ecriture du flag de convergence iconv
3780 write(6,*)"SOLIDE:",iter,iconv
3782 CALL cpeEN(compo,CP_ITERATION,tf, iter , 'iconv', 1,
3784 IF( info.NE. CPOK )GO TO 9000
3786 if(iconv.eq.1)go to 9000
3800 CALL cpfin(compo,CP_ARRET, info)