[Octopus-devel] [Octopus-notify] svn commit: r8542 - in trunk/src: hamiltonian species system td utils by jrfsousa
xavier at tddft.org
Sat Nov 12 14:47:56 WET 2011
2011/11/11 José Rui Faustino Sousa <jrfsousa at teor.fis.uc.pt>:
>> * Do not change things that are not broken.
> I will try harder... The way the code is written just makes me
> itch... ;-)
What is the problem with the code?
> I am pretty sure you are wrong. Default initialization of type
> components does not imply them having the save attribute.
> OK. Implicit save rules are pretty confusing... :-(
> Default initialization of type components is a good practice especially
> if it involves pointers. And it is already done in the code...
Maybe is a good idea in other language, but with Fortran and the
"save" attribute is a bad idea. It is used in some parts of the code,
but we try to avoid it as much as possible and use it only when is
In fact, it was your default initialization that caused a test to start failing.
> Explicitly declaring the intrinsic procedures used is considered a good
> practice... But if it does not follow octopus coding guidelines I will
> stop using it.
Checking the standard, it seems that "external" is used to overrule an
intrinsic procedure with a user provided version, so the way you are
using it is plainly wrong. In any case, I don't think that adding
something that is redudant is good practice.
> I am implementing on octopus, but I just do not feel comfortable with
> uninitialized variables, divides by zero, etc... It is already hard
> enough to deal with the unknown problems without the interference of
> known ones.
Variables are not uninitialized, most datatypes have an datatype_init
routine that initializes the values. Division by zero is a valid
floating point operation, the problem is if you try to use the result.
In any case, I don't see how these problems affect you.
I think we can improve things if you have suggestions, but first start
contributing your own code. We already had someone that wanted to
change a lot of things in the code "for his work" and that at the end
contributed nothing to the code.
More information about the Octopus-devel