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

common blocks

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

Reply
 
LinkBack Thread Tools Display Modes
Old   November 9, 2004, 10:51
Default common blocks
  #1
CMB
Guest
 
Posts: n/a
Hi, this is a question that has more to do with fortran than star itself. Some times I use variables that I calculate in POSDAT.f and then use in other subroutines such as SOR*.f. My question is that, when looping the mesh with DO ic=1,nctmax and then reducing the loop for ictid(ic).eq.#. Then calculate a variable(ip) for this cell region. Why is it that if I define the variable I have to give it the size of variable(nctmax) rather than variable(# of cells in ictid(ic).eq.#)? Kind regards CM
  Reply With Quote

Old   November 12, 2004, 10:41
Default Re: common blocks
  #2
4xF
Guest
 
Posts: n/a
Either you do not know which (STAR) cell numbers are belonging to the cell type # and in that case you have to dimension the array to have the size NCTMAX. All elements of the array (if initialised correctly) will be zero except for the cells with cell type #. If you need to have the array dimensioned to your needs (i.e. the same size as the number of cells with cell type #), you need to know the mapping between the cells with cell type #. Since all SOR* subroutines are called on a per cell basis, you will have to loop on the mapping to find out the desired cell to get the source term. Which is much slower than storing data and retrieving it from an array dimensioned to 1:NCTMAX.

Have fun...
  Reply With Quote

Reply

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
COMMON blocks for passing arrays -- Please help marcus CD-adapco 6 May 6, 2006 09:46
sormom.f and common blocks Sheila CD-adapco 0 March 25, 2005 20:46
common blocks of STAR-CD Mari CD-adapco 2 January 26, 2005 04:21
how to define own COMMON blocks Mari CD-adapco 1 January 12, 2005 09:30
Common blocks in VISTUR Celia CD-adapco 6 December 26, 2004 03:25


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