[Octopus-devel] Small code reorganization proposal.

José Rui Faustino Sousa jrfsousa at teor.fis.uc.pt
Tue Apr 24 15:58:52 WEST 2012


Hi All!

I would like to propose removing:

    type(v_ks_t)             :: ks    !< the Kohn-Sham potentials
    type(output_t)           :: outp  !< the output

from the type system_t defined in the file ./src/system/system.F90

And moving the file down in the dependencies chain to just
above ./src/states.

This would also imply moving the subroutine system_h_setup to, say, the
file v_ks.F90 and renaming the actual system directory to, say, ks.

I think this is a good idea mainly because it will make life much easier
for anyone trying to implement any kind of subsystem approaches to DFT,
and also because it creates a clearer picture of the physics behind
everything, creates a natural border for the systems details and will
allow for simpler and cleaner subroutine interfaces.

I have already done it locally and tested it with no problems.

Does anyone see any reason not to do it?

Additionally the ./src/system could be split in ./src/system containing
the actual system.F90 file and future implementations of
subsystems, ./src/eigen containing the eigensolvers, ./src/ks containing
the Kohn-Sham term and ./src/output containing the output routines.

Further on one could create an extra type to hold:

    type(system_t)      :: sys
    type(v_ks_t)        :: ks    !< the Kohn-Sham potentials
    type(hamiltonian_t) :: hm
    type(output_t)      :: outp  !< the output

instead of just adding:

    type(v_ks_t)        :: ks    !< the Kohn-Sham potentials
    type(output_t)      :: outp  !< the output

to ./src/main/run.F90

But these are just embellishments and are not really necessary.

Best regards,
José Rui



More information about the Octopus-devel mailing list