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

Fortran programming style

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   January 25, 2011, 20:33
Default Fortran programming style
  #1
Member
 
Shenren Xu
Join Date: Jan 2011
Location: London, U.K.
Posts: 67
Rep Power: 15
Shenren_CN is on a distinguished road
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
Shenren_CN is offline   Reply With Quote

 


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 Off
Pingbacks are On
Refbacks are On


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


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