CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Main CFD Forum

iteration of loop in FORTRAN language

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   March 15, 2014, 06:30
Default iteration of loop in FORTRAN language
  #1
New Member
 
saida chatti
Join Date: Mar 2014
Posts: 6
Rep Power: 3
saida29 is on a distinguished road
Hello

how I can write in FORTRAN an iterative loop that stops when the convergence condition is satisfied. The convergence condition is: the difference between the two values ​​obtained by two successive iteration (X (iter2)-X (iter1)) is low in the order of [10] [-3].
thank you very much
saida29 is offline   Reply With Quote

Old   March 15, 2014, 11:48
Default
  #2
Senior Member
 
cfdnewbie
Join Date: Mar 2010
Posts: 551
Rep Power: 11
cfdnewbie is on a distinguished road
http://en.wikibooks.org/wiki/Fortran/Fortran_control

This should answer your question!

Last edited by cfdnewbie; March 15, 2014 at 13:27.
cfdnewbie is offline   Reply With Quote

Old   March 15, 2014, 13:22
Default
  #3
New Member
 
saida chatti
Join Date: Mar 2014
Posts: 6
Rep Power: 3
saida29 is on a distinguished road
hello
thank you very much for the reply.
i calculate the velocity. I want to express the difference between two values ​​for two successive iteration if the difference is we stopped the iteration if not the calculated repeats
saida29 is offline   Reply With Quote

Old   March 15, 2014, 13:28
Default
  #4
Senior Member
 
cfdnewbie
Join Date: Mar 2010
Posts: 551
Rep Power: 11
cfdnewbie is on a distinguished road
Well, you have already described the algorithm:
compute the difference, compare it to some threshold and abort the computation or continue...
I'm not sure what it is that confuses you...
cfdnewbie is offline   Reply With Quote

Old   March 15, 2014, 13:49
Default
  #5
New Member
 
saida chatti
Join Date: Mar 2014
Posts: 6
Rep Power: 3
saida29 is on a distinguished road
hello
yes that's what i want to calculate. i don't know how to write that the value of the velocity of the first iteration is the old one and the value of the second iteration is the new one and the convergence this the new - the old
thank you
saida29 is offline   Reply With Quote

Old   March 15, 2014, 14:44
Default
  #6
Senior Member
 
cfdnewbie
Join Date: Mar 2010
Posts: 551
Rep Power: 11
cfdnewbie is on a distinguished road
This is very basic stuff. I suggest you work through something like this: http://www.cs.mtu.edu/~shene/COURSES...S/fortran.html

This will enable you to do want you intend to do!
cfdnewbie is offline   Reply With Quote

Reply

Tags
convergence, fortran, iteration

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Gmsh nishant_hull Open Source Meshers: Gmsh, Netgen, CGNS, ... 23 Today 02:09
How to do a counter to exit loop in scheme language? rayolau Fluent UDF and Scheme Programming 1 May 23, 2013 08:15
CFX11 + Fortran compiler ? Mohan CFX 20 March 30, 2011 18:56
NACA0012 geometry/design software needed Franny Main CFD Forum 13 July 7, 2007 15:57
Creating, loop or iteration using expression edito Jan CFX 3 July 28, 2003 11:01


All times are GMT -4. The time now is 09:34.