CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Siemens (https://www.cfd-online.com/Forums/siemens/)
-   -   INTFLG (https://www.cfd-online.com/Forums/siemens/54163-intflg.html)

CMB November 12, 2004 05:27

INTFLG
 
Hi could anyone please tell me how to use the intflg(100) array. As far as I understand it helps you determine at what step of the itteration you want your calculations to be done. The question is, that I dont know how to use it. Any help is welcomed Regards CM

Richard November 12, 2004 08:28

Re: INTFLG
 
No, intflg is an array of 100 integers which star initialises to 0. You can change these values to whatever you want in your user subroutines and star will "remember" them: the values will not change unless you change them. So they mean whatever you want them to mean. They're quite useful for remembering something from one call of a subroutine to the next, or for passing a message from one subroutine to another.

CMB November 15, 2004 07:20

Re: INTFLG
 
Hi Richard, thanks for your post. Could you please give me an example, if this is not much to ask. Say if you want something you calculated from posdat and then pass it to SORSCA in one itteration? Hope this is not a problem for you, best regards, CM

Richard November 15, 2004 07:56

Re: INTFLG
 
It's easy really. Suppose you wanted your posdat to tell your sorsca which cell has the highest temperature. You can choose any intflg, so let's choose intflg(1). Then, in your posdat you could have C Loop through all the cells and find the highest temperature tmax=-great do ic=1,ncell

if (t(ic,1).gt.tmax) then

intflg(1)=ic

tmax=t(ic,1)

end if end do and then in your sorsca you have intflg(1) available and ready for use. Of course, you need to be sure that posdat is called before sorsca for this to work, but it is so you're safe. And you can only pass integer values through intflg so, in this example, you'd have to find a different way to actually pass the maximum temperature if you wanted to.

But maybe this example is too specific. Really, there's not much more to it than my first reply: it's an array of integers which are initialised to zero by star and are always available to your user subroutines. You can do whatever you want with them.

CMB November 15, 2004 11:57

Re: INTFLG
 
Thankyou very much Richard,

CM


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