|
[Sponsors] |
November 9, 2004, 10:51 |
common blocks
|
#1 |
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
|
|
November 12, 2004, 10:41 |
Re: common blocks
|
#2 |
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... |
|
|
|
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 |