Files
lapack/SRC/xerbla_array.f
T
jason 61e82a389d Merged revisions 609-614 via svnmerge from
https://jason@icl.cs.utk.edu/svn/lapack-dev/lapack/branches/SC08-release

........
  r609 | julie | 2008-12-16 17:17:52 -0500 (Tue, 16 Dec 2008) | 1 line
  
  Polish routines to fit the LAPACK framework and allow manpages generation
........
  r610 | langou | 2008-12-19 12:12:38 -0500 (Fri, 19 Dec 2008) | 30 lines
  
  
  bug reported on the forum
  https://icl.cs.utk.edu/lapack-forum/viewtopic.php?f=2&t=854
  
  the complete thread is available at
  http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/635192e11beadb93#
  
  Tobias Burnus also sent us an email:
  
  > Hello,
  > 
  > this was reported at
  > http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/635192e11beadb93#
  > 
  > The problem is the line 47:
  > 
  > 47:       IF( M.EQ.0 .OR. A(M, 1).NE.ZERO .OR. A(M, N).NE.ZERO ) THEN
  > 
  > If M == 0 the one accesses A(0,1) which is invalid as the lower bound is 1
  > and not 0.
  > 
  > Note: Contrary to C there is no left-to-right evaluation of expressions in
  > Fortran; the order is left to the compiler. One might assume that a smart
  > compiler does not evaluate "A(M,1)" if "M==0", however, there is nothing in
  > the standard guarantees this.
  > 
  > If bounds checks are turned on (see post at the URL above), gfortran aborts
  > with an out-of-bounds error.
........
  r611 | julie | 2008-12-19 15:00:58 -0500 (Fri, 19 Dec 2008) | 5 lines
  
  Modify the formatting of the comments.
  Replace Note and Notes section by Further Details
  This allow the manpages to be generated corectly.
........
  r612 | julie | 2008-12-19 16:29:21 -0500 (Fri, 19 Dec 2008) | 3 lines
  
  Reformat the xblas routines comments to be able to generate the manpages
   
........
  r613 | julie | 2008-12-19 16:30:31 -0500 (Fri, 19 Dec 2008) | 1 line
  
  Update version number
........
  r614 | jason | 2008-12-27 09:44:45 -0500 (Sat, 27 Dec 2008) | 13 lines
  
  Fix non-short-circuited tests in ILAxL{C,R}.
  
  Fortran doesn't short-circuit logical operators, so the check that the leading
  dimension /= 0 may not prevent indexing into a 0-length array.
  
  Reported by "hes selex" in
    http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/635192e11beadb93
  and forwarded to the LAPACK maintainers by Tobias Burnus <burnus@net-b.de>.
  
  Chalk up more bugs found by gfortran's diagnostics!
  
  Signed-off-by: Jason Riedy <ejr@cs.berkeley.edu>
  Cc: Tobias Burnus <burnus@net-b.de>
........
2008-12-30 21:27:12 +00:00

75 lines
2.1 KiB
FortranFixed

SUBROUTINE XERBLA_ARRAY(SRNAME_ARRAY, SRNAME_LEN, INFO)
*
* -- LAPACK auxiliary routine (version 3.0) --
* Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
* September 19, 2006
*
IMPLICIT NONE
* .. Scalar Arguments ..
INTEGER SRNAME_LEN, INFO
* ..
* .. Array Arguments ..
CHARACTER(1) SRNAME_ARRAY(SRNAME_LEN)
* ..
*
* Purpose
* =======
*
* XERBLA_ARRAY assists other languages in calling XERBLA, the LAPACK
* and BLAS error handler. Rather than taking a Fortran string argument
* as the function's name, XERBLA_ARRAY takes an array of single
* characters along with the array's length. XERBLA_ARRAY then copies
* up to 32 characters of that array into a Fortran string and passes
* that to XERBLA. If called with a non-positive SRNAME_LEN,
* XERBLA_ARRAY will call XERBLA with a string of all blank characters.
*
* Say some macro or other device makes XERBLA_ARRAY available to C99
* by a name lapack_xerbla and with a common Fortran calling convention.
* Then a C99 program could invoke XERBLA via:
* {
* int flen = strlen(__func__);
* lapack_xerbla(__func__, &flen, &info);
* }
*
* Providing XERBLA_ARRAY is not necessary for intercepting LAPACK
* errors. XERBLA_ARRAY calls XERBLA.
*
* Arguments
* =========
*
* SRNAME_ARRAY (input) CHARACTER(1) array, dimension (SRNAME_LEN)
* The name of the routine which called XERBLA_ARRAY.
*
* SRNAME_LEN (input) INTEGER
* The length of the name in SRNAME_ARRAY.
*
* INFO (input) INTEGER
* The position of the invalid parameter in the parameter list
* of the calling routine.
*
* =====================================================================
*
* ..
* .. Local Scalars ..
INTEGER I
* ..
* .. Local Arrays ..
CHARACTER*32 SRNAME
* ..
* .. Intrinsic Functions ..
INTRINSIC MIN, LEN
* ..
* .. External Functions ..
EXTERNAL XERBLA
* ..
* .. Executable Statements ..
SRNAME = ''
DO I = 1, MIN( SRNAME_LEN, LEN( SRNAME ) )
SRNAME( I:I ) = SRNAME_ARRAY( I )
END DO
CALL XERBLA( SRNAME, INFO )
RETURN
END