351 SUBROUTINE zgesvj( JOBA, JOBU, JOBV, M, N, A, LDA, SVA, MV, V,
352 $ LDV, CWORK, LWORK, RWORK, LRWORK, INFO )
360 INTEGER INFO, LDA, LDV, LWORK, LRWORK, M, MV, N
361 CHARACTER*1 JOBA, JOBU, JOBV
364 COMPLEX*16 A( LDA, * ), V( LDV, * ), CWORK( LWORK )
365 DOUBLE PRECISION RWORK( LRWORK ), SVA( N )
371 DOUBLE PRECISION ZERO, HALF, ONE
372 parameter( zero = 0.0d0, half = 0.5d0, one = 1.0d0)
373 COMPLEX*16 CZERO, CONE
374 parameter( czero = (0.0d0, 0.0d0), cone = (1.0d0, 0.0d0) )
376 parameter( nsweep = 30 )
379 COMPLEX*16 AAPQ, OMPQ
380 DOUBLE PRECISION AAPP, AAPP0, AAPQ1, AAQQ, APOAQ, AQOAP, BIG,
381 $ bigtheta, cs, ctol, epsln, mxaapq,
382 $ mxsinj, rootbig, rooteps, rootsfmin, roottol,
383 $ skl, sfmin, small, sn, t, temp1, theta, thsign,
385 INTEGER BLSKIP, EMPTSW, i, ibr, IERR, igl, IJBLSK, ir1,
386 $ iswrot, jbc, jgl, kbl, lkahead, mvl, n2, n34,
387 $ n4, nbl, notrot, p, pskipped, q, rowskip,
388 $ swband, minmn, lwmin, lrwmin
389 LOGICAL APPLV, GOSCALE, LOWER, LQUERY, LSVEC, NOSCALE,
390 $ rotok, rsvec, uctol, upper
394 INTRINSIC abs, max, min, conjg, dble, sign, sqrt
399 DOUBLE PRECISION DZNRM2
401 EXTERNAL zdotc, dznrm2
405 DOUBLE PRECISION DLAMCH
423 lsvec = lsame( jobu,
'U' ) .OR. lsame( jobu,
'F' )
424 uctol = lsame( jobu,
'C' )
425 rsvec = lsame( jobv,
'V' ) .OR. lsame( jobv,
'J' )
426 applv = lsame( jobv,
'A' )
427 upper = lsame( joba,
'U' )
428 lower = lsame( joba,
'L' )
431 IF( minmn.EQ.0 )
THEN
439 lquery = ( lwork.EQ.-1 ) .OR. ( lrwork.EQ.-1 )
440 IF( .NOT.( upper .OR. lower .OR. lsame( joba,
'G' ) ) )
THEN
442 ELSE IF( .NOT.( lsvec .OR.
444 $ lsame( jobu,
'N' ) ) )
THEN
446 ELSE IF( .NOT.( rsvec .OR.
448 $ lsame( jobv,
'N' ) ) )
THEN
450 ELSE IF( m.LT.0 )
THEN
452 ELSE IF( ( n.LT.0 ) .OR. ( n.GT.m ) )
THEN
454 ELSE IF( lda.LT.m )
THEN
456 ELSE IF( mv.LT.0 )
THEN
458 ELSE IF( ( rsvec .AND. ( ldv.LT.n ) ) .OR.
459 $ ( applv .AND. ( ldv.LT.mv ) ) )
THEN
461 ELSE IF( uctol .AND. ( rwork( 1 ).LE.one ) )
THEN
463 ELSE IF( lwork.LT.lwmin .AND. ( .NOT.lquery ) )
THEN
465 ELSE IF( lrwork.LT.lrwmin .AND. ( .NOT.lquery ) )
THEN
473 CALL xerbla(
'ZGESVJ', -info )
475 ELSE IF( lquery )
THEN
477 rwork( 1 ) = real( lrwmin )
483 IF( minmn.EQ.0 )
RETURN
497 IF( lsvec .OR. rsvec .OR. applv )
THEN
498 ctol = sqrt( dble( m ) )
506 epsln = dlamch(
'Epsilon' )
507 rooteps = sqrt( epsln )
508 sfmin = dlamch(
'SafeMinimum' )
509 rootsfmin = sqrt( sfmin )
510 small = sfmin / epsln
511 big = dlamch(
'Overflow' )
513 rootbig = one / rootsfmin
515 bigtheta = one / rooteps
518 roottol = sqrt( tol )
520 IF( dble( m )*epsln.GE.one )
THEN
522 CALL xerbla(
'ZGESVJ', -info )
530 CALL zlaset(
'A', mvl, n, czero, cone, v, ldv )
531 ELSE IF( applv )
THEN
534 rsvec = rsvec .OR. applv
545 skl = one / sqrt( dble( m )*dble( n ) )
554 CALL zlassq( m-p+1, a( p, p ), 1, aapp, aaqq )
555 IF( aapp.GT.big )
THEN
557 CALL xerbla(
'ZGESVJ', -info )
561 IF( ( aapp.LT.( big / aaqq ) ) .AND. noscale )
THEN
565 sva( p ) = aapp*( aaqq*skl )
569 sva( q ) = sva( q )*skl
574 ELSE IF( upper )
THEN
579 CALL zlassq( p, a( 1, p ), 1, aapp, aaqq )
580 IF( aapp.GT.big )
THEN
582 CALL xerbla(
'ZGESVJ', -info )
586 IF( ( aapp.LT.( big / aaqq ) ) .AND. noscale )
THEN
590 sva( p ) = aapp*( aaqq*skl )
594 sva( q ) = sva( q )*skl
604 CALL zlassq( m, a( 1, p ), 1, aapp, aaqq )
605 IF( aapp.GT.big )
THEN
607 CALL xerbla(
'ZGESVJ', -info )
611 IF( ( aapp.LT.( big / aaqq ) ) .AND. noscale )
THEN
615 sva( p ) = aapp*( aaqq*skl )
619 sva( q ) = sva( q )*skl
626 IF( noscale )skl = one
635 IF( sva( p ).NE.zero )aaqq = min( aaqq, sva( p ) )
636 aapp = max( aapp, sva( p ) )
641 IF( aapp.EQ.zero )
THEN
642 IF( lsvec )
CALL zlaset(
'G', m, n, czero, cone, a, lda )
655 IF( lsvec )
CALL zlascl(
'G', 0, 0, sva( 1 ), skl, m, 1,
656 $ a( 1, 1 ), lda, ierr )
657 rwork( 1 ) = one / skl
658 IF( sva( 1 ).GE.sfmin )
THEN
673 sn = sqrt( sfmin / epsln )
674 temp1 = sqrt( big / dble( n ) )
675 IF( ( aapp.LE.sn ) .OR. ( aaqq.GE.temp1 ) .OR.
676 $ ( ( sn.LE.aaqq ) .AND. ( aapp.LE.temp1 ) ) )
THEN
677 temp1 = min( big, temp1 / aapp )
680 ELSE IF( ( aaqq.LE.sn ) .AND. ( aapp.LE.temp1 ) )
THEN
681 temp1 = min( sn / aaqq, big / (aapp*sqrt( dble(n)) ) )
684 ELSE IF( ( aaqq.GE.sn ) .AND. ( aapp.GE.temp1 ) )
THEN
685 temp1 = max( sn / aaqq, temp1 / aapp )
688 ELSE IF( ( aaqq.LE.sn ) .AND. ( aapp.GE.temp1 ) )
THEN
689 temp1 = min( sn / aaqq, big / ( sqrt( dble( n ) )*aapp ) )
698 IF( temp1.NE.one )
THEN
699 CALL dlascl(
'G', 0, 0, one, temp1, n, 1, sva, n, ierr )
702 IF( skl.NE.one )
THEN
703 CALL zlascl( joba, 0, 0, one, skl, m, n, a, lda, ierr )
709 emptsw = ( n*( n-1 ) ) / 2
733 IF( ( nbl*kbl ).NE.n )nbl = nbl + 1
738 rowskip = min( 5, kbl )
749 IF( ( lower .OR. upper ) .AND. ( n.GT.max( 64, 4*kbl ) ) )
THEN
771 CALL zgsvj0( jobv, m-n34, n-n34, a( n34+1, n34+1 ), lda,
772 $ cwork( n34+1 ), sva( n34+1 ), mvl,
773 $ v( n34*q+1, n34+1 ), ldv, epsln, sfmin, tol,
774 $ 2, cwork( n+1 ), lwork-n, ierr )
776 CALL zgsvj0( jobv, m-n2, n34-n2, a( n2+1, n2+1 ), lda,
777 $ cwork( n2+1 ), sva( n2+1 ), mvl,
778 $ v( n2*q+1, n2+1 ), ldv, epsln, sfmin, tol, 2,
779 $ cwork( n+1 ), lwork-n, ierr )
781 CALL zgsvj1( jobv, m-n2, n-n2, n4, a( n2+1, n2+1 ), lda,
782 $ cwork( n2+1 ), sva( n2+1 ), mvl,
783 $ v( n2*q+1, n2+1 ), ldv, epsln, sfmin, tol, 1,
784 $ cwork( n+1 ), lwork-n, ierr )
786 CALL zgsvj0( jobv, m-n4, n2-n4, a( n4+1, n4+1 ), lda,
787 $ cwork( n4+1 ), sva( n4+1 ), mvl,
788 $ v( n4*q+1, n4+1 ), ldv, epsln, sfmin, tol, 1,
789 $ cwork( n+1 ), lwork-n, ierr )
791 CALL zgsvj0( jobv, m, n4, a, lda, cwork, sva, mvl, v,
793 $ epsln, sfmin, tol, 1, cwork( n+1 ), lwork-n,
796 CALL zgsvj1( jobv, m, n2, n4, a, lda, cwork, sva, mvl, v,
797 $ ldv, epsln, sfmin, tol, 1, cwork( n+1 ),
801 ELSE IF( upper )
THEN
804 CALL zgsvj0( jobv, n4, n4, a, lda, cwork, sva, mvl, v,
806 $ epsln, sfmin, tol, 2, cwork( n+1 ), lwork-n,
809 CALL zgsvj0( jobv, n2, n4, a( 1, n4+1 ), lda,
811 $ sva( n4+1 ), mvl, v( n4*q+1, n4+1 ), ldv,
812 $ epsln, sfmin, tol, 1, cwork( n+1 ), lwork-n,
815 CALL zgsvj1( jobv, n2, n2, n4, a, lda, cwork, sva, mvl,
817 $ ldv, epsln, sfmin, tol, 1, cwork( n+1 ),
820 CALL zgsvj0( jobv, n2+n4, n4, a( 1, n2+1 ), lda,
821 $ cwork( n2+1 ), sva( n2+1 ), mvl,
822 $ v( n2*q+1, n2+1 ), ldv, epsln, sfmin, tol, 1,
823 $ cwork( n+1 ), lwork-n, ierr )
831 DO 1993 i = 1, nsweep
849 igl = ( ibr-1 )*kbl + 1
851 DO 1002 ir1 = 0, min( lkahead, nbl-ibr )
855 DO 2001 p = igl, min( igl+kbl-1, n-1 )
859 q = idamax( n-p+1, sva( p ), 1 ) + p - 1
861 CALL zswap( m, a( 1, p ), 1, a( 1, q ), 1 )
862 IF( rsvec )
CALL zswap( mvl, v( 1, p ), 1,
886 IF( ( sva( p ).LT.rootbig ) .AND.
887 $ ( sva( p ).GT.rootsfmin ) )
THEN
888 sva( p ) = dznrm2( m, a( 1, p ), 1 )
892 CALL zlassq( m, a( 1, p ), 1, temp1, aapp )
893 sva( p ) = temp1*sqrt( aapp )
900 IF( aapp.GT.zero )
THEN
904 DO 2002 q = p + 1, min( igl+kbl-1, n )
908 IF( aaqq.GT.zero )
THEN
911 IF( aaqq.GE.one )
THEN
912 rotok = ( small*aapp ).LE.aaqq
913 IF( aapp.LT.( big / aaqq ) )
THEN
914 aapq = ( zdotc( m, a( 1, p ), 1,
915 $ a( 1, q ), 1 ) / aaqq ) / aapp
917 CALL zcopy( m, a( 1, p ), 1,
919 CALL zlascl(
'G', 0, 0, aapp, one,
920 $ m, 1, cwork(n+1), lda, ierr )
921 aapq = zdotc( m, cwork(n+1), 1,
922 $ a( 1, q ), 1 ) / aaqq
925 rotok = aapp.LE.( aaqq / small )
926 IF( aapp.GT.( small / aaqq ) )
THEN
927 aapq = ( zdotc( m, a( 1, p ), 1,
928 $ a( 1, q ), 1 ) / aapp ) / aaqq
930 CALL zcopy( m, a( 1, q ), 1,
932 CALL zlascl(
'G', 0, 0, aaqq,
934 $ cwork(n+1), lda, ierr )
935 aapq = zdotc( m, a(1, p ), 1,
936 $ cwork(n+1), 1 ) / aapp
943 mxaapq = max( mxaapq, -aapq1 )
947 IF( abs( aapq1 ).GT.tol )
THEN
948 ompq = aapq / abs(aapq)
963 theta = -half*abs( aqoap-apoaq )/aapq1
965 IF( abs( theta ).GT.bigtheta )
THEN
970 CALL zrot( m, a(1,p), 1, a(1,q),
972 $ cs, conjg(ompq)*t )
974 CALL zrot( mvl, v(1,p), 1,
975 $ v(1,q), 1, cs, conjg(ompq)*t )
978 sva( q ) = aaqq*sqrt( max( zero,
979 $ one+t*apoaq*aapq1 ) )
980 aapp = aapp*sqrt( max( zero,
981 $ one-t*aqoap*aapq1 ) )
982 mxsinj = max( mxsinj, abs( t ) )
988 thsign = -sign( one, aapq1 )
989 t = one / ( theta+thsign*
990 $ sqrt( one+theta*theta ) )
991 cs = sqrt( one / ( one+t*t ) )
994 mxsinj = max( mxsinj, abs( sn ) )
995 sva( q ) = aaqq*sqrt( max( zero,
996 $ one+t*apoaq*aapq1 ) )
997 aapp = aapp*sqrt( max( zero,
998 $ one-t*aqoap*aapq1 ) )
1000 CALL zrot( m, a(1,p), 1, a(1,q),
1002 $ cs, conjg(ompq)*sn )
1004 CALL zrot( mvl, v(1,p), 1,
1005 $ v(1,q), 1, cs, conjg(ompq)*sn )
1008 cwork(p) = -cwork(q) * ompq
1012 CALL zcopy( m, a( 1, p ), 1,
1014 CALL zlascl(
'G', 0, 0, aapp, one,
1016 $ 1, cwork(n+1), lda,
1018 CALL zlascl(
'G', 0, 0, aaqq, one,
1020 $ 1, a( 1, q ), lda, ierr )
1021 CALL zaxpy( m, -aapq, cwork(n+1), 1,
1023 CALL zlascl(
'G', 0, 0, one, aaqq,
1025 $ 1, a( 1, q ), lda, ierr )
1026 sva( q ) = aaqq*sqrt( max( zero,
1027 $ one-aapq1*aapq1 ) )
1028 mxsinj = max( mxsinj, sfmin )
1035 IF( ( sva( q ) / aaqq )**2.LE.rooteps )
1037 IF( ( aaqq.LT.rootbig ) .AND.
1038 $ ( aaqq.GT.rootsfmin ) )
THEN
1039 sva( q ) = dznrm2( m, a( 1, q ),
1044 CALL zlassq( m, a( 1, q ), 1, t,
1046 sva( q ) = t*sqrt( aaqq )
1049 IF( ( aapp / aapp0 ).LE.rooteps )
THEN
1050 IF( ( aapp.LT.rootbig ) .AND.
1051 $ ( aapp.GT.rootsfmin ) )
THEN
1052 aapp = dznrm2( m, a( 1, p ), 1 )
1056 CALL zlassq( m, a( 1, p ), 1, t,
1058 aapp = t*sqrt( aapp )
1065 IF( ir1.EQ.0 )notrot = notrot + 1
1067 pskipped = pskipped + 1
1071 IF( ir1.EQ.0 )notrot = notrot + 1
1072 pskipped = pskipped + 1
1075 IF( ( i.LE.swband ) .AND.
1076 $ ( pskipped.GT.rowskip ) )
THEN
1077 IF( ir1.EQ.0 )aapp = -aapp
1092 IF( ( ir1.EQ.0 ) .AND. ( aapp.EQ.zero ) )
1093 $ notrot = notrot + min( igl+kbl-1, n ) - p
1104 igl = ( ibr-1 )*kbl + 1
1106 DO 2010 jbc = ibr + 1, nbl
1108 jgl = ( jbc-1 )*kbl + 1
1113 DO 2100 p = igl, min( igl+kbl-1, n )
1116 IF( aapp.GT.zero )
THEN
1120 DO 2200 q = jgl, min( jgl+kbl-1, n )
1123 IF( aaqq.GT.zero )
THEN
1130 IF( aaqq.GE.one )
THEN
1131 IF( aapp.GE.aaqq )
THEN
1132 rotok = ( small*aapp ).LE.aaqq
1134 rotok = ( small*aaqq ).LE.aapp
1136 IF( aapp.LT.( big / aaqq ) )
THEN
1137 aapq = ( zdotc( m, a( 1, p ), 1,
1138 $ a( 1, q ), 1 ) / aaqq ) / aapp
1140 CALL zcopy( m, a( 1, p ), 1,
1142 CALL zlascl(
'G', 0, 0, aapp,
1144 $ cwork(n+1), lda, ierr )
1145 aapq = zdotc( m, cwork(n+1), 1,
1146 $ a( 1, q ), 1 ) / aaqq
1149 IF( aapp.GE.aaqq )
THEN
1150 rotok = aapp.LE.( aaqq / small )
1152 rotok = aaqq.LE.( aapp / small )
1154 IF( aapp.GT.( small / aaqq ) )
THEN
1155 aapq = ( zdotc( m, a( 1, p ), 1,
1156 $ a( 1, q ), 1 ) / max(aaqq,aapp) )
1159 CALL zcopy( m, a( 1, q ), 1,
1161 CALL zlascl(
'G', 0, 0, aaqq,
1163 $ cwork(n+1), lda, ierr )
1164 aapq = zdotc( m, a( 1, p ), 1,
1165 $ cwork(n+1), 1 ) / aapp
1172 mxaapq = max( mxaapq, -aapq1 )
1176 IF( abs( aapq1 ).GT.tol )
THEN
1177 ompq = aapq / abs(aapq)
1187 theta = -half*abs( aqoap-apoaq )/ aapq1
1188 IF( aaqq.GT.aapp0 )theta = -theta
1190 IF( abs( theta ).GT.bigtheta )
THEN
1193 CALL zrot( m, a(1,p), 1, a(1,q),
1195 $ cs, conjg(ompq)*t )
1197 CALL zrot( mvl, v(1,p), 1,
1198 $ v(1,q), 1, cs, conjg(ompq)*t )
1200 sva( q ) = aaqq*sqrt( max( zero,
1201 $ one+t*apoaq*aapq1 ) )
1202 aapp = aapp*sqrt( max( zero,
1203 $ one-t*aqoap*aapq1 ) )
1204 mxsinj = max( mxsinj, abs( t ) )
1209 thsign = -sign( one, aapq1 )
1210 IF( aaqq.GT.aapp0 )thsign = -thsign
1211 t = one / ( theta+thsign*
1212 $ sqrt( one+theta*theta ) )
1213 cs = sqrt( one / ( one+t*t ) )
1215 mxsinj = max( mxsinj, abs( sn ) )
1216 sva( q ) = aaqq*sqrt( max( zero,
1217 $ one+t*apoaq*aapq1 ) )
1218 aapp = aapp*sqrt( max( zero,
1219 $ one-t*aqoap*aapq1 ) )
1221 CALL zrot( m, a(1,p), 1, a(1,q),
1223 $ cs, conjg(ompq)*sn )
1225 CALL zrot( mvl, v(1,p), 1,
1226 $ v(1,q), 1, cs, conjg(ompq)*sn )
1229 cwork(p) = -cwork(q) * ompq
1233 IF( aapp.GT.aaqq )
THEN
1234 CALL zcopy( m, a( 1, p ), 1,
1236 CALL zlascl(
'G', 0, 0, aapp,
1238 $ m, 1, cwork(n+1),lda,
1240 CALL zlascl(
'G', 0, 0, aaqq,
1242 $ m, 1, a( 1, q ), lda,
1244 CALL zaxpy( m, -aapq, cwork(n+1),
1246 CALL zlascl(
'G', 0, 0, one,
1248 $ m, 1, a( 1, q ), lda,
1250 sva( q ) = aaqq*sqrt( max( zero,
1251 $ one-aapq1*aapq1 ) )
1252 mxsinj = max( mxsinj, sfmin )
1254 CALL zcopy( m, a( 1, q ), 1,
1256 CALL zlascl(
'G', 0, 0, aaqq,
1258 $ m, 1, cwork(n+1),lda,
1260 CALL zlascl(
'G', 0, 0, aapp,
1262 $ m, 1, a( 1, p ), lda,
1264 CALL zaxpy( m, -conjg(aapq),
1265 $ cwork(n+1), 1, a( 1, p ), 1 )
1266 CALL zlascl(
'G', 0, 0, one,
1268 $ m, 1, a( 1, p ), lda,
1270 sva( p ) = aapp*sqrt( max( zero,
1271 $ one-aapq1*aapq1 ) )
1272 mxsinj = max( mxsinj, sfmin )
1279 IF( ( sva( q ) / aaqq )**2.LE.rooteps )
1281 IF( ( aaqq.LT.rootbig ) .AND.
1282 $ ( aaqq.GT.rootsfmin ) )
THEN
1283 sva( q ) = dznrm2( m, a( 1, q ),
1288 CALL zlassq( m, a( 1, q ), 1, t,
1290 sva( q ) = t*sqrt( aaqq )
1293 IF( ( aapp / aapp0 )**2.LE.rooteps )
THEN
1294 IF( ( aapp.LT.rootbig ) .AND.
1295 $ ( aapp.GT.rootsfmin ) )
THEN
1296 aapp = dznrm2( m, a( 1, p ), 1 )
1300 CALL zlassq( m, a( 1, p ), 1, t,
1302 aapp = t*sqrt( aapp )
1310 pskipped = pskipped + 1
1315 pskipped = pskipped + 1
1319 IF( ( i.LE.swband ) .AND. ( ijblsk.GE.blskip ) )
1325 IF( ( i.LE.swband ) .AND.
1326 $ ( pskipped.GT.rowskip ) )
THEN
1340 IF( aapp.EQ.zero )notrot = notrot +
1341 $ min( jgl+kbl-1, n ) - jgl + 1
1342 IF( aapp.LT.zero )notrot = 0
1352 DO 2012 p = igl, min( igl+kbl-1, n )
1353 sva( p ) = abs( sva( p ) )
1360 IF( ( sva( n ).LT.rootbig ) .AND. ( sva( n ).GT.rootsfmin ) )
1362 sva( n ) = dznrm2( m, a( 1, n ), 1 )
1366 CALL zlassq( m, a( 1, n ), 1, t, aapp )
1367 sva( n ) = t*sqrt( aapp )
1372 IF( ( i.LT.swband ) .AND. ( ( mxaapq.LE.roottol ) .OR.
1373 $ ( iswrot.LE.n ) ) )swband = i
1375 IF( ( i.GT.swband+1 ) .AND. ( mxaapq.LT.sqrt( dble( n ) )*
1376 $ tol ) .AND. ( dble( n )*mxaapq*mxsinj.LT.tol ) )
THEN
1380 IF( notrot.GE.emptsw )
GO TO 1994
1402 DO 5991 p = 1, n - 1
1403 q = idamax( n-p+1, sva( p ), 1 ) + p - 1
1408 CALL zswap( m, a( 1, p ), 1, a( 1, q ), 1 )
1409 IF( rsvec )
CALL zswap( mvl, v( 1, p ), 1, v( 1, q ), 1 )
1411 IF( sva( p ).NE.zero )
THEN
1413 IF( sva( p )*skl.GT.sfmin )n2 = n2 + 1
1416 IF( sva( n ).NE.zero )
THEN
1418 IF( sva( n )*skl.GT.sfmin )n2 = n2 + 1
1423 IF( lsvec .OR. uctol )
THEN
1426 CALL zlascl(
'G',0,0, sva(p), one, m, 1, a(1,p), m,
1435 temp1 = one / dznrm2( mvl, v( 1, p ), 1 )
1436 CALL zdscal( mvl, temp1, v( 1, p ), 1 )
1441 IF( ( ( skl.GT.one ) .AND. ( sva( 1 ).LT.( big / skl ) ) )
1442 $ .OR. ( ( skl.LT.one ) .AND. ( sva( max( n2, 1 ) ) .GT.
1443 $ ( sfmin / skl ) ) ) )
THEN
1445 sva( p ) = skl*sva( p )
1455 rwork( 2 ) = dble( n4 )
1458 rwork( 3 ) = dble( n2 )
1463 rwork( 4 ) = dble( i )