A custom user routine has been written to score the averaged track KE and LET in 3D array using comscw.f template along side with with other two subroutines. We used to run these subroutines in FLUKA.org and its GUI flair 2.3. Recently, I’m trying to compile and create an executable on flair 3.1-13 but it outputs the next error:
191 | ke_array(xidx,yidx,zidx) = ke_array(xidx,yidx,zidx) + KE
Error: The function result on the lhs of the assignment at (1) must have the pointer attribute.
Ended: 2021.04.23 12:45:02
Error: compiling file: …/comscw.f
No object generated
Any suggestion to resolve this issue would be appreciated.
can you share the whole user routine?
here you go
comscw.f (9.4 KB)
nlet_array are not not declared as arrays.
Thank you David for clarification,
I’m not an expert in coding but I’ve added the following lines:
then flair has successfully compiled the subroutines and generated executable, when I ran the simulation it finished with error
declaring a dynamic array is not enough, you need to ALLOCATE them as well.
Furthermore it seems the
z1 variables don’t have an assigned value, which also can lead to a crash.
I see your point and in fact what you pointed out is already written within usrini.f routine. The idea is to compile and link the following user routines, usrini.f, comscw.f, and usrout.f. (in this order) to score KE and LET. Again those routines were function previously and wondering why it’s not working anymore.
please find the attachments so that you can examine the problem.usrini_rt_immun.f (7.1 KB) usrout_rt_immun.f (3.0 KB)
you are missing the line
in comscw.f. It is needed if you want to access the variables declared the module.
Yes I added it before but still outputs error code 2
could you share your Flair project file as well?
proton_beam.flair (2.2 KB)
your usrini_rt_immun.f routine is not compatible with FLUKA 4.
You need to change line 37 to:
SUBROUTINE USRINI ( WHAT, SDUM )
line 64 to:
and remove line 75.
Thank you so much sir, problem solved.