I have finally found out the issue after a deep look through the code. ![]() Subroutine Bisection(A,B,eps,f,niter,xroot,e0)ĭouble precision A,B,eps,xroot,fuc,fua,e0Ĭ Here the subroutine which uses e0 is called twiceĬ Here is the second print. ![]() I have used Fortran77 for numerical solving for a couple years and never encountered something like this, but it's been nearly 6 months since I don't program anything so maybe I missed an important thing.Ĭ Here is the first print. ![]() Does this mean the subroutine f1 is only called between "out 1" and "out 2"? (it should be called between every "out" print) But we see the first "out 1" print, some "in" prints and then only "out" prints. We expect an "out 1" print, some "in" prints (printed when subroutine f1 is called by subroutine Bisection some times), then "out 2" print (with the new e0 value), some "in" prints, etc. The print statements aren't printed as they should (see output below).in one single iteration, while in theory it should take the program 9 interations to get there. ![]() So the goal of the program is to find the solution of a transcendental equation for some parameter e0 which is updated every step in a for loop and passed to the subroutine. I'm trying to implement a Bisection method subroutine in Fortran to solve a computational science program and Fortran is doing some weird things.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |