Modify mgdraw.f routine

In the line 224 instruction

               IF (KPART (I) .EQ. 8) THEN

the index I is not defined. You should implement a DO loop with I running from 1 to NP and check if a neutron is there (in case the KPART array contains more than one neutron, you may want to avoid counting the reaction more than once).

As for the KPARTCOUNTS variable (which is automatically defined as integer in view of its initial letter), you just need to initialize it, e.g. through an additional DATA statement at the beginning.

Finally, as already written elsewhere in your code, it’s not IBHEAV(I), rather IBHEAV(KHEAVY(I)) (please note that in this case I should run from 1 to NPHEAV).

1 Like