The 'subroutine' in source.f after 'call' how to define? Where to define?

Dear expert
I am a beginner about fluka, when I study the example of source.f file, I can not understand the “call” program.In fortran77 its function is to call subroutines, but in the example the subroutines is not defined anywhere in these example. Is it a flkua built-in subroutine?


or

In addition, could you tell me the function of these code?
LISNUT (IJ) = INDEX ( PRNAME (IJ), ‘NEUTRI’ ) .GT. 0

IF ( IJBEAM .EQ. -2 .AND. LRDBEA ) THEN
Look forward to the help of distinguished experts, thans.
source.f (9.0 KB)

Dear @gao_han,

  1. Yes, those are FLUKA’s built in subroutines. These routines are distributed in a compiled form, so their source code generally is not available.

  2. The line

    LISNUT (IJ) = INDEX ( PRNAME (IJ), ‘NEUTRI’ ) .GT. 0
    

    is a statement function. It is a simplified function only consisting of one expression. In this case it checks if the particle name in NEUTRI or not. See: Statement Function (FORTRAN 77 Language Reference)

  3. The line

    IF ( IJBEAM .EQ. -2 .AND. LRDBEA ) THEN
    

    checks if an isotope source is set on the BEAM card.

Cheers,
David

Dear David
Thank you for your reply. If I want to know the details of these built-in subroutines (such as how to use them and their functions), where can I check them? I can’t find the relevant instructions in the user manual.

Dear @gao_han,

unfortunately these functions / subroutines are not documented in the FLUKA manual.

If you have a specific problem writing a user routine, you can ask for help here on the forum.

Cheers,
David

Dear David
Thanks for your reply, could you please help me explain the following subroutines:
1)DCDION
2)SETION
3)OAUXFI
4)GEOCRS
5)GEOREG
6)GEOHSM
7)SOEVSV
8)STISBM
When I learned to write .f documents, I found that these subroutines often appear. If you can help me understand them, my learning will be easier,I want to know their parameters and functions,I would appreciate it if you could teach me.

Dear @gao_han,

these subroutines (except OAUXFI) are not to be changed by the user, and they are not useful in any other user routine.

OAUXFI is similar to the standard Fortran OPEN command, but it searches different locations relative to the input file, not just the working directory.

Cheers,
David

Thanks for your reply,I don’t have problem