|
[Sponsors] |
January 25, 2011, 20:33 |
Fortran programming style
|
#1 |
Member
Shenren Xu
Join Date: Jan 2011
Location: London, U.K.
Posts: 67
Rep Power: 15 |
Hi,
I'm new to writing CFD code in Fortran. I saw two different styles in writing code in Fortran lately and have been wondering what's the pros and cons of both. One of them uses global variables substantially, and when a subroutine is called, there's normally no parameters pass; the other uses local variables, and every time a subroutine is called, a long list of parameters are passed, which is giving me trouble in easily keeping track of the variables being passed and used. Intuitively, I think the 1st approach is better, apparently more readable. I wonder what's your opinion on this, and any suggestion on which style I should adopt when I write my code. Cheers, SX |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
programming language for CFD, C, C++, FORTRAN,.... | hadian | Main CFD Forum | 15 | September 9, 2008 22:19 |
GUI programming with FORTRAN | ztdep | Main CFD Forum | 1 | August 30, 2007 13:22 |
A problem in FORTRAN programming | Behafarid | Main CFD Forum | 6 | August 16, 2006 12:16 |
Fortran programming and 64 bit machine | Q | Main CFD Forum | 4 | November 7, 2005 05:18 |
C++ fortran mixed programming: allocatable array | vito | Main CFD Forum | 1 | April 19, 2005 11:11 |