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

INTFLG

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

Reply
 
LinkBack Thread Tools Display Modes
Old   November 26, 2003, 19:29
Default INTFLG
  #1
Juliet
Guest
 
Posts: n/a
Hi,experts can you give me detailed information about INTFLG, how to use it, what is it mean?

thanks a lot Juliet

  Reply With Quote

Old   November 27, 2003, 04:49
Default Re: INTFLG
  #2
Richard
Guest
 
Posts: n/a
INTFLG is an array of 100 integers which is available to all user subroutines. The initial values are 0, but STAR "remembers" any changes you make to these values. Hence you can use INTFLG to pass a message from one subroutine to another, or from one call of a subroutine to the next call of the same subroutine. So, for example, if you wanted a subroutine to do something once only:

if (intflg(1).eq.0) then &nbsp&nbsp do_this_once &nbsp&nbsp intflg(1)=1 end if
  Reply With Quote

Old   November 27, 2003, 19:06
Default Re: INTFLG
  #3
Juliet
Guest
 
Posts: n/a
thank you Richard!

I understand some from you. but it is not very clear now, for example, if i want first call sorsca.f then sorent.f, therefore i should make (if intflg(1) .eq. 0 then(),intflg(1)=1,endif )in sorsca.f, then i make (if intflg(1).eq.1 then (),intflg(1)=2,endif) in sorent.f. is it right? but how to pass some message from one subroutine to another, would you give me some example for intflg? thank you again for your help and your time!

Juliet
  Reply With Quote

Old   November 28, 2003, 04:12
Default Re: INTFLG
  #4
Richard
Guest
 
Posts: n/a
The INTFLG array doesn't "mean" anything by default; it doesn't control which subroutines are called or what order they are called in. You can think of it as scratch space which STAR maintains for you. STAR "promises" to initialise the array to 100*0, to pass it to all user subroutines and to "remember" the changes you make to it. Hence these are flags for you to use as you wish.

Here's a simple example. Suppose you wanted your user subroutine to print a message the first time it is called - useful if you want to be sure it is being used. Here's how you could do it (in BCDEFI, for example):

if (intflg(1).eq.0) then write(*,*) 'In BCDEFI!' write(60,*) 'In BCDEFI!' intflg(1)=1 end if

The choice of which intlfg you use (in the range 1-100) is up to you, but make sure there's no conflict with other intflgs you use elsewhere. Now, other subroutines will see intflg(1)=1 as well, so you could have some code in another subroutine, like this

if (intflg(1).eq.1) then write(*,*) 'BCDEFI has already been called' write(60,*) 'BCDEFI has already been called' end if
  Reply With Quote

Old   November 29, 2003, 00:31
Default Re: INTFLG
  #5
Juliet
Guest
 
Posts: n/a
thank you so much Richard!

now i understand some about it, it looks useful sometimes, so i will try it.i wish i can get more help from you if i have advanced qustion about it after practice

thank you again

regards

Juliet

  Reply With Quote

Old   December 1, 2003, 04:20
Default Re: INTFLG
  #6
Steve
Guest
 
Posts: n/a
Alternatively, just define your own COMMON blocks to share data between routines.
  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
INTFLG CMB CD-adapco 4 November 15, 2004 11:57


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