Results 1 to 5 of 5

Thread: how to compile these Fortran subroutines???

  1. #1
    Join Date
    Aug 2008
    Location
    new jersey
    Beans
    107

    how to compile these Fortran subroutines???

    I have uploaded all the programs and subroutines via a tar file (see attachment). I have problem with compiling two of them which are named chebexc.f and durdec.f respectively.

    These two subroutines were given by one of my research collaborators, which are in a very old fashion. I tried to compile them by G95 and Gfortran, but failed. I even tried G77, ending with the same results.

    I am 100% sure that they are correct. Could anybody try these two subroutines and suggest something? Perhaps you could suggest me some compiler options, such as -fugly or -std=g77 (I tried these two options, but they don't work).
    Attached Files Attached Files
    Last edited by subjugater; May 19th, 2009 at 10:42 PM.

  2. #2
    Join Date
    Jan 2008
    Location
    Auckland, New Zealand
    Beans
    3,129
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: how to compile these Fortran subroutines???

    Could you post the errors you receive when trying to compile them?

  3. #3
    Join Date
    Aug 2008
    Location
    new jersey
    Beans
    107

    Re: how to compile these Fortran subroutines???

    Quote Originally Posted by ad_267 View Post
    Could you post the errors you receive when trying to compile them?
    When I was compiling the subroutine chebexc.f, I got
    kent@kent-desktop:~/study/codes/mextest/ver3$ g95 -c chebexc.f
    In file chebexc.f:452

    TDIFF(2) = 0
    1
    Warning (108 ): Array reference at (1) is out of bounds
    In file chebexc.f:453

    TDIFF(1) = TEXP(2)*SC/2
    1
    Warning (108 ): Array reference at (1) is out of bounds
    In file chebexc.f:498

    TINT(2) = TEXP(1)*SC
    1
    Warning (108 ): Array reference at (1) is out of bounds
    In file chebexc.f:500

    TINT(2) = TEXP(1)*SC
    1
    Warning (108 ): Array reference at (1) is out of bounds
    In file chebexc.f:501

    TINT(3) = TEXP(2)*SC/4
    1
    Warning (108 ): Array reference at (1) is out of bounds
    In file chebexc.f:501

    TINT(3) = TEXP(2)*SC/4
    1
    Warning (108 ): Array reference at (1) is out of bounds
    In file chebexc.f:503

    TINT(2) = TEXP(1)*SC
    1
    Warning (108 ): Array reference at (1) is out of bounds
    In file chebexc.f:504

    TINT(3) = TEXP(2)*SC/4
    1
    Warning (108 ): Array reference at (1) is out of bounds
    kent@kent-desktop:~/study/codes/mextest/ver3$
    When I was compiling the subroutine durdec.f, I got
    kent@kent-desktop:~/study/codes/mextest/ver3$ g95 -c durdec.f
    In file durdec.f:59

    IFAC(3) = 2
    1
    Warning (108 ): Array reference at (1) is out of bounds
    In file durdec.f:62

    IFAC(2) = NF
    1
    Warning (108 ): Array reference at (1) is out of bounds
    In file durdec.f:156

    NF = IFAC(2)
    1
    Warning (108 ): Array reference at (1) is out of bounds
    In file durdec.f:715

    NF = IFAC(2)
    1
    Warning (108 ): Array reference at (1) is out of bounds
    In file durdec.f:149

    CALL DURAB1 (N,C,WSAVE,WSAVE(IW1),WSAVE(IW2))
    1
    In file durdec.f:153

    SUBROUTINE DURAB1 (N,C,CH,WA,IFAC)
    2
    Warning (155): Inconsistent types (REAL(8 )/INTEGER(4)) in actual argument lists at (1) and (2)
    In file durdec.f:31

    CALL DURA1 (N,WSAVE(IW1),WSAVE(IW2))
    1
    In file durdec.f:35

    SUBROUTINE DURA1 (N,WA,IFAC)
    2
    Warning (155): Inconsistent types (REAL(8 )/INTEGER(4)) in actual argument lists at (1) and (2)
    In file durdec.f:708

    CALL DURAF1 (N,C,WSAVE,WSAVE(IW1),WSAVE(IW2))
    1
    In file durdec.f:712

    SUBROUTINE DURAF1 (N,C,CH,WA,IFAC)
    2
    Warning (155): Inconsistent types (REAL(8 )/INTEGER(4)) in actual argument lists at (1) and (2)
    Last edited by subjugater; May 19th, 2009 at 10:58 PM.

  4. #4
    Join Date
    Nov 2004
    Location
    Nyack NY USA
    Beans
    988
    Distro
    Ubuntu Development Release

    Re: how to compile these Fortran subroutines???

    You are only getting warnings from the compiler which should not prevent an object file being created. The type of warning errors you are getting appear due to non-standard fortran such as using pointers for arrays instead of fully declaring them. They should not be serious errors.

    do you actually get an object file after compiling? You should....
    "Linux is evolution, not intelligent design." - Linus Torvalds

  5. #5
    Join Date
    Aug 2008
    Location
    new jersey
    Beans
    107

    Re: how to compile these Fortran subroutines???

    Quote Originally Posted by kleeman View Post
    You are only getting warnings from the compiler which should not prevent an object file being created. The type of warning errors you are getting appear due to non-standard fortran such as using pointers for arrays instead of fully declaring them. They should not be serious errors.

    do you actually get an object file after compiling? You should....
    Thanks for your reply, buddy. I actually got the executable output. But I got some results which does not make sense when running this output.

    Do you know by using any option of G95 compiler I can overcome this difficulty?

    Again, I appreciate.

Bookmarks

Posting Permissions

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