Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- Software Development Tools (Compilers, Debuggers, Profilers & Analyzers)
- Intel® Fortran Compiler
- Code not converging, help

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Highlighted
##

Hello, i'm a engineer student and never used fortran before. I'm using it at a class, and we have to solve a 2D transient heat transfer problem. When I run my code, the solution does not converge. I think I am calculating the RMS wrong. Could you give me a hand?

fritoli__giovani

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-01-2019
06:31 AM

24 Views

Code not converging, help

3 Replies

Highlighted
##

gib

New Contributor II

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-02-2019
06:43 PM

24 Views

Probably nobody will be willing to trace through your code to find your problem, and there is a general reluctance to help students with class assignments.

My advice is to learn to use debugging write statements:

write(*,'(a,i6,2e12.3)') 'This is a debugging message about: ivar, avar, bvar: ',ivar,avar,bvar

Inserting such write statements into your code should help you to find where variables are not taking the values that you expect.

Highlighted
##

fritoli__giovani

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-02-2019
07:07 PM

24 Views

Thank you

gib wrote:Probably nobody will be willing to trace through your code to find your problem, and there is a general reluctance to help students with class assignments.

My advice is to learn to use debugging write statements:

write(*,'(a,i6,2e12.3)') 'This is a debugging message about: ivar, avar, bvar: ',ivar,avar,bvar

Inserting such write statements into your code should help you to find where variables are not taking the values that you expect.

Highlighted
##

jimdempseyatthecove

Black Belt

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-03-2019
11:28 AM

24 Views

You have a tolerance (tol) that is fixed, **real**, at 9.0D-3

*** Note, both RMS and tol are declared (in all places) as REAL and not REAL(8) (or DOUBLE PRECISION)

You to not state the typical magnitude(s) of RMS.

REAL (single precision) floating point has 7+fraction digits of precision. Assume for the moment your tolerance is 1.0D-2. This means if your RMS is larger than 99999.nn or so, you may never converge.

I suggest you uncomment the write(*,*) residuo statements, then

a) using a data set that converges, make a run, saving the output.

b) then using a data set that does not converge, make a run, saving the output.

then compare the two outputs. Either the RMS will never converge do to an incorrupt assumption that convergence is at 9.0E-3, or you data is corrupt and producing unusual values.

Jim Dempsey

For more complete information about compiler optimizations, see our Optimization Notice.