The only remaining problem is that, I think, the proper logic for choosing between dminim and zminim in the OMM method is based on the supercell (no_u == no_s) and not on whether the gamma point only is used. In other words. dminim will not work if we use a supercell with the gamma point.
There are places where it is obvious where to put a call to "MODP", but in other cases I am not sure.
So pending a possible optimization of this, I am going to merge retaining the "supercell" logic for this in compute_dm and post_scf_work.
It looks good. Indeed more clear.
The only remaining problem is that, I think, the proper logic for choosing between dminim and zminim in the OMM method is based on the supercell (no_u == no_s) and not on whether the gamma point only is used. In other words. dminim will not work if we use a supercell with the gamma point.
There are places where it is obvious where to put a call to "MODP", but in other cases I am not sure.
So pending a possible optimization of this, I am going to merge retaining the "supercell" logic for this in compute_dm and post_scf_work.