CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > Siemens

common blocks

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread 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


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


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