Closed DanRRRR closed 2 months ago
Hi Dan,
I'm guessing this is a version of the code you've been editing? I'm able to compile the current version on the main branch with these precompiler options. Can you try again with a clean git clone?
It's also worth mentioning that we'd advise users to avoid $(D)PER_PARTICLE_CHARGE_MASS
. Here, mass
and charge
become particle variables which must be passed through MPI boundaries. This offers no benefit to the code, and only slows it down.
Cheers, Stuart
Thanks for response Stuart. I'd be glad not to use this PER_PARTICLE_CHARGE_MASS (it definitely has problems with moving frame, so in this case to run i indeed do not change the defaults in Makefile) but if i stop using it for other cases then besides mass (for which you gave me a hint how to add it few weeks ago) i am losing also charge defined in subr Diagnostics as element of linked list current%charge. Any hints how to fix that?
Also i still manically afraid that downloading clean git clone will somehow by mistake overwrite my older one with all my so painfully made workarounds :(((((. Nothing actually to worry about ? :)
Hi Dan,
I remember the mass
workaround I suggested. The charge
variable should have an equivalent treatment, which is best demonstrated in io/iterators.F90
. The function it_output_real
contains lines like:
charge = current_species%charge
CALL start_particle_list(current_species, current_list, cur)
DO WHILE (ASSOCIATED(cur) .AND. (part_count < npoint_it))
part_count = part_count + 1
#ifdef PER_PARTICLE_CHARGE_MASS
array(part_count) = cur%charge
#else
array(part_count) = charge
#endif
cur => cur%next
END DO
This script is a heavily cut-down version of the real it_output_real
function, but it demonstrates how you might fill an array with charges, whether you use -DPER_PARTICLE_CHARGE_MASS
or not.
Hope this helps, Stuart
Thanks for the hint, will try to implement it
What I am missing if I unlock in Makefile these two lines
DEFINES += $(D)PARTICLE_ID DEFINES += $(D)PER_PARTICLE_CHARGE_MASS
and not adding anything else to the default EPOCH source files try to compile the EPOCH code? I get compilation errors, see below. Shouldn't the EPOCH compile fine in this case?
Of course i can manually add these structures in the DIAGNOSTICS subroutine but i need to check if some annoying run time errors I get sometimes with no reason appear not because of my own additions (to subr DIAGNOSTICS ) but due to these two options. Without these two options the code runs OK