@@ -1084,12 +1084,17 @@ PROGRAM ZCHKEE
10841084 INTEGER INMIN( MAXIN ), INWIN( MAXIN ), INIBL( MAXIN ),
10851085 $ ISHFTS( MAXIN ), IACC22( MAXIN )
10861086 DOUBLE PRECISION ALPHA( NMAX ), BETA( NMAX ), DR( NMAX, 12 ),
1087- $ RESULT( 500 ), RWORK( LWORK ), S( NMAX* NMAX )
1088- COMPLEX * 16 A( NMAX* NMAX, NEED ), B( NMAX* NMAX, 5 ),
1089- $ C( NCMAX* NCMAX, NCMAX* NCMAX ), DC( NMAX, 6 ),
1090- $ TAUA( NMAX ), TAUB( NMAX ), WORK( LWORK ),
1087+ $ RESULT( 500 )
1088+ COMPLEX * 16 DC( NMAX, 6 ), TAUA( NMAX ), TAUB( NMAX ),
10911089 $ X( 5 * NMAX )
10921090* ..
1091+ * .. Allocatable Arrays ..
1092+ INTEGER AllocateStatus
1093+ DOUBLE PRECISION , DIMENSION (:), ALLOCATABLE :: RWORK
1094+ DOUBLE PRECISION , DIMENSION (:,:), ALLOCATABLE :: S
1095+ COMPLEX * 16 , DIMENSION (:), ALLOCATABLE :: WORK
1096+ COMPLEX * 16 , DIMENSION (:,:), ALLOCATABLE :: A, B, C
1097+ * ..
10931098* .. External Functions ..
10941099 LOGICAL LSAMEN
10951100 DOUBLE PRECISION DLAMCH, DSECND
@@ -1130,6 +1135,21 @@ PROGRAM ZCHKEE
11301135 DATA INTSTR / ' 0123456789' /
11311136 DATA IOLDSD / 0 , 0 , 0 , 1 /
11321137* ..
1138+ * .. Allocate memory dynamically ..
1139+ *
1140+ ALLOCATE ( S(NMAX,NMAX), STAT = AllocateStatus )
1141+ IF (AllocateStatus /= 0 ) STOP " *** Not enough memory ***"
1142+ ALLOCATE ( A(NMAX,NMAX), STAT = AllocateStatus )
1143+ IF (AllocateStatus /= 0 ) STOP " *** Not enough memory ***"
1144+ ALLOCATE ( B(NMAX,NMAX), STAT = AllocateStatus )
1145+ IF (AllocateStatus /= 0 ) STOP " *** Not enough memory ***"
1146+ ALLOCATE ( C(NCMAX* NCMAX,NCMAX* NCMAX), STAT = AllocateStatus )
1147+ IF (AllocateStatus /= 0 ) STOP " *** Not enough memory ***"
1148+ ALLOCATE ( RWORK(LWORK), STAT = AllocateStatus )
1149+ IF (AllocateStatus /= 0 ) STOP " *** Not enough memory ***"
1150+ ALLOCATE ( WORK(LWORK), STAT = AllocateStatus )
1151+ IF (AllocateStatus /= 0 ) STOP " *** Not enough memory ***"
1152+ * ..
11331153* .. Executable Statements ..
11341154*
11351155 A = 0.0
@@ -2435,6 +2455,13 @@ PROGRAM ZCHKEE
24352455 WRITE ( NOUT, FMT = 9994 )
24362456 S2 = DSECND( )
24372457 WRITE ( NOUT, FMT = 9993 )S2 - S1
2458+ *
2459+ DEALLOCATE (S, STAT = AllocateStatus)
2460+ DEALLOCATE (A, STAT = AllocateStatus)
2461+ DEALLOCATE (B, STAT = AllocateStatus)
2462+ DEALLOCATE (C, STAT = AllocateStatus)
2463+ DEALLOCATE (RWORK, STAT = AllocateStatus)
2464+ DEALLOCATE (WORK, STAT = AllocateStatus)
24382465*
24392466 9999 FORMAT ( / ' Execution not attempted due to input errors' )
24402467 9997 FORMAT ( / / 1X , A3, ' : NB =' , I4, ' , NBMIN =' , I4, ' , NX =' , I4 )
0 commit comments