|
[Sponsors] |
![]() |
![]() |
#1 |
Guest
Posts: n/a
|
I am looking for a code to solve a block tridigonal system. In the book of Anderson "computational Fluid Mechanics and Heat tranfer", there is a code in the appedix, but seems it does not work. If anyone knows any info about any code to solve it, pls post it. Thanks a lot.
|
|
![]() |
![]() |
#2 |
Guest
Posts: n/a
|
I guess the code works. I'm sure.
The problem is whether you are good at coding or not. |
|
![]() |
![]() |
#3 |
Guest
Posts: n/a
|
I just found an obvious error in the code. In the subroutine LUDECO, it should be
integer order dimension A(order,1) other than dimension A(order,1) integer order Can you guess? Don't say anything before testing by yourself. |
|
![]() |
![]() |
#4 |
Guest
Posts: n/a
|
(1). order is integer, so it should be iorder. (2). ordsq is order*order, is also integer, so it should be iordsq. (2). So, you can change order to iorder, ordsq to iordsq, and remove integer order, integer ordsq from the code. (3). When writing Fortran code, try to use the original convention. That is i,j,k,l,m,n are reserved for the first character of a integer name. (4). Let me know whether you can get it to work with these changes. I don't have time to check it out myself.
|
|
![]() |
![]() |
#5 |
Guest
Posts: n/a
|
Hmm~~ You became a little angry right??
First, I'm sorry if I made you angry. But, it is obvious that no one in this forum are concerned about whether the code you said works or not. This is not a forum for basic FORTRAN lecture. I know the code may have an error. If it does not work, then just try to use another code or you correct it. The fact that the code have an error is not important at all. Most of people have no problems in solving the problem you stated. |
|
![]() |
![]() |
#6 |
Guest
Posts: n/a
|
pls look the post
http://www.cfd-online.com/Forum/main.cgi?read=15311 one more example. seems you have some connect with the authors of the book or the code. |
|
![]() |
![]() |
#7 |
Guest
Posts: n/a
|
Both of subroutine ludeco and lusolv have the same error. It appears that the code has not been tested in the form as in the book before publication of the book.
|
|
![]() |
![]() |
#8 |
Guest
Posts: n/a
|
From your judgement, there is some possibility that the code contains other errors
|
|
![]() |
![]() |
#9 |
Guest
Posts: n/a
|
Hm.. I don't have any connection with the author. As I said before, whether the code have an error or not is not important. Even middle school student can find the error if he is good at FORTRAN. It does not matter. If Anderson's tridiagonal solver contatins an error, use other program. Anderson's is not a FORTRAN book. The book can contain errors.
|
|
![]() |
![]() |
#10 |
Guest
Posts: n/a
|
Assuming there is a line break in the two statements, both pairs of statements are correct Fortran. From the specification of Fortran:
"The names of variables, arrays, constants, statement functions, intrinsic functions, and dummy procedures have a scope of a program unit." Note this does not say the rest of the program unit after the declaration statement! Only a few Fortran complilers will reject the former pair of statements but one widely used one is gnu's Fortran compiler. I have also come across some HP Fortran compilers with the same problem. I suspect there are others. The source is probably a C mindset in the compiler writer (the main author of g77 quite happily admits to not being a Fortran programmer - this is not meant as a slight on the author by the way since the chances of g77 existing at all if the main author programmed principally in Fortran has got to be about zero!). So my advice would be to change your "Fortran" compiler rather than your CFD book! |
|
![]() |
![]() |
#11 |
Guest
Posts: n/a
|
If you have a Linux system and want (or need) to avoid this bug you can use the older Fortran compiler based on the f2c program which seems to parse Fortran a bit more accurately. Some systems have this older compiler under the name "fort77"
fort77 fortranfile.f -o prog or if this is not there then you can use: f2c fortranfile.f > cfile.c gcc -lf2c cfile.c -o prog Note that you need to include the f2c library when linking. Mixing object code from the two compilers does not work. The names "f77" and "g77" will use the newer compiler. |
|
![]() |
![]() |
#12 |
Guest
Posts: n/a
|
(1). The subroutines appeared in the Appendix B of the book has the opening statement: "The subroutine described here for solving block tridiagonal systems of equations were provided by Sukumar R. Chakravarthy of Rockwell International Science Center." (2). It appears that Mr. Chakravarthy is one of the vendor sponsor of the forum. So, it might be easier to get the answer directly from him. In this way, we might be able to get it settled down once for all. (3). So, if Mr. Chakravarthy is reading this forum, we would like to hear from him about the subroutine errors.
|
|
![]() |
![]() |
#13 |
Guest
Posts: n/a
|
Hi,
The errors in Anderson's book are two subroutines (lusolv,ludeco).If you change those,you will work well. I have tested it. |
|
![]() |
![]() |
#14 |
Guest
Posts: n/a
|
Whether those discussed above are the errors you corrected?
|
|
![]() |
![]() |
#15 |
Guest
Posts: n/a
|
From this site, it appears that you are a student in Civil Engineering. My advise to you is that you need to learn more about scientific attitudes, rather than civil engineering. You may find that will benifit you a lot.
|
|
![]() |
![]() |
#16 |
Guest
Posts: n/a
|
same question as John Calisch's
|
|
![]() |
![]() |
#17 |
Guest
Posts: n/a
|
Thanks for your advice ~
My advice to you is that you need to learn more about CFD and FORTRAN, rather than finding faults with other people's remark. Regards. Seok Koo, Kang. Graduate Student, Civil Engineering, Hanyang University, Seoul, Korea. |
|
![]() |
![]() |
#18 |
Guest
Posts: n/a
|
Yes,only the two subroutines are error
|
|
![]() |
![]() |
#19 |
Guest
Posts: n/a
|
Try the routine listed in the book" Computational Fluid Dynamics for Engineers--Volume I" by Hoffman and Chian...I tried it, it is working...Good luck.
|
|
![]() |
![]() |
#20 |
Guest
Posts: n/a
|
I have started to work on it too.I wanted to ask you if you can email me the original code for further work.You know it's typing is difficult and boring! I will announce you about my work. Thank's in advance!
|
|
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
CFX11 + Fortran compiler ? | Mohan | CFX | 20 | March 30, 2011 19:56 |
Fastest parallel solver for tridiagonal system | Arpiruk | Main CFD Forum | 16 | August 28, 2007 06:14 |
free code about "system identification" | ztdep | Main CFD Forum | 1 | April 14, 2007 21:58 |
Block Tridiagonal Solver | Abdulhafid M. Elfaghi | Main CFD Forum | 2 | December 23, 2006 13:20 |
Code with reliable free surface capability in a rotating system | Subhasish Roy Choudhury | Main CFD Forum | 1 | September 4, 1998 19:47 |