Avoid calling get_charges if no coloumb module is defined.
Separate memory log functions for integer(4) and integer(8). This should solve a problem with logging integer(c_intptr) on 32-bit and 64-bit machines.
gfortran does not implement ieee_is_nan (yet) but has nonstandard isnan.