Results 1 to 4 of 4

Thread: Newer Version of Subroutine LEQT1F

  1. #1
    Junior Member
    Join Date
    Apr 2018
    Posts
    2

    Newer Version of Subroutine LEQT1F

    Hello,

    Does any one know the newer version of the Fortran subroutine LEQT1F? I am trying to compile an older Fortran program which has this subroutine. I am using the newer IMSL Fortran library which does not support LEQT1F. A quick search online shows that it is used to solve linear system of equations with Gauss elimination. If you happen to have the documentation for LEQT1F, I would greatly appreciate a link to it.


    Thank You

  2. #2
    Senior Member mecej4's Avatar
    Join Date
    Dec 2009
    Posts
    127
    The routine that you named (LEQT1F) is really old; it was not present in IMSL 4.0, which itself is now two decades old. See http://nhplace.com/kent/Papers/Fortran-to-Lisp.html for a description. There appears to be no exact replacement for LEQT1F in more recent versions of IMSL, but the following code will solve the test problem shown there.

    Code:
    program xlsarg
    use lslrg_int
    use wrrrn_int
    implicit none
    !
    integer, parameter :: IA=3, N=3, NRHS=4
    real :: A(IA,N), B(N,NRHS)
    character(7) :: cname = 'Col. : '
    integer :: i
    !
    A = reshape([33.0,-24.0,-8.0, &
                 16.0, -10.0, -4.0, &
                 72.0, -57.0, -17.0], [N,N])
    B = reshape([1.0, 0.0, 0.0, &
                 0.0, 1.0, 0.0, &
                 0.0, 0.0, 1.0, &
                 -359.0, 281.0, 85.0], [N,NRHS])             
    do i=1,NRHS
       call LSLRG(A,B(:,I),B(:,I))
       write(cname(5:5),'(I1)')i
       call WRRRN(cname,B(:,I),1,N,1)
    end do
    !
    end program

  3. #3
    Junior Member
    Join Date
    Apr 2018
    Posts
    2
    mecej4,

    Thank you for the response and the sample code. I will try implementing LSLRG in my program. I also had another question, if you do not mind answering. I have successfully build the examples provided by ROGUEWAVE using Visual Studio 2015,which are .f90, however when I switch the extension to .for I will get an error saying it can not locate "INCLUDE 'link_fnl_shared_imsl.h'" which worked when the source code was .f90. The reason I ask is that the program I am compiling is in .for and will be used in a Finite Element Program, ABAQUS. Do you think I am better off just switching the older program to .f90?


    Thank You

  4. #4
    Senior Member mecej4's Avatar
    Join Date
    Dec 2009
    Posts
    127
    The answer depends on which compiler, OS and version of IMSL you are using. As long as your source files satisfy the governing rules, you can use fixed format and free format as you please.

    You cannot, in general, change the extension of a Fortran source file from .for to .f90 (or vice versa) and expect it to be acceptable to the compiler. A file with suffix .f or .for is expected to contain fixed format Fortran source. The include '...' line should have blanks in at least the first six columns, in fixed format source.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •