Source definition

Dear FLUKA users,
I want to definite a new source of proton, the file named sourceSpectrum.f was used, but there are some problems when compiling, the error was show in attached file, I don’t know FORTRAN, anybody kowns Fortran and how to revise?
BEST REGARDS
Jie WANG

sourceSpectrum.f (8.5 KB)

You need to define ENEPOI,ENEPRO,ENECUM as arrays. You can add the following code in line 29 (start at 7th column):

DIMENSION ENEPOI(1000),ENEPRO(1000),ENECUM(0:1000)

Remove the tab before 1972

Cesc

Dear cesc,
Thanks a lot, some problem have been solved, while there are still some new problem as you can see from attached pictures and what the format of ENDDO or END IF?
BEST REGARD
Jie WANG

The attached pictures

Please upload the source file so we can take a look.

sourceSpectrum.f (8.6 KB)
Here is my source file

Please observe the comment from the previous reply

Once this is fixed, the file compiles. Also, keep in mind you have a certain mess of indices: ENEPOI and ENEPRO indices run from 1 to 1000, yet when reading the spectrum you intent do load ENEPOI(0), out of bounds. Make sure that both DO loops are safe.

Hi Jie,
it’s not clear what you expect from this source routine, which was originally written by someone else to read a spectrum from an existing file SOBP.dat. In fact, the right array definition is:
DIMENSION ENEPOI(0:1000),ENEPRO(0:1000),ENECUM(1000)
However, once the spectrum is read and properly normalized at inizialization, it’s not at all used in the following to sample your primary particle energy.
So, please clarify which kind of proton beam you have in mind.
Francesco

Dear cesc, thanks a lot, it works.

Thank you for your suggestion, the problems have been solved.