CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > Siemens

common blocks

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

LinkBack Thread Tools Search this Thread Display Modes
Old   November 9, 2004, 09:51
Default common blocks
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, 09:41
Default Re: common blocks
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


Thread Tools Search this Thread
Search this Thread:

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
COMMON blocks for passing arrays -- Please help marcus Siemens 6 May 6, 2006 09:46
sormom.f and common blocks Sheila Siemens 0 March 25, 2005 19:46
common blocks of STAR-CD Mari Siemens 2 January 26, 2005 03:21
how to define own COMMON blocks Mari Siemens 1 January 12, 2005 08:30
Common blocks in VISTUR Celia Siemens 6 December 26, 2004 02:25

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