Skip to content

Fix copying of TMolecule#1292

Open
foxtran wants to merge 3 commits intogrimme-lab:mainfrom
foxtran:fix/copy
Open

Fix copying of TMolecule#1292
foxtran wants to merge 3 commits intogrimme-lab:mainfrom
foxtran:fix/copy

Conversation

@foxtran
Copy link
Copy Markdown
Contributor

@foxtran foxtran commented May 21, 2025

By some reason, GCC 12.2 does not copy some data between TMolecule objects and, therefore, there is some trash in output like (it is xtbopt.xyz):
image

This patch fixes it. Not sure that I found all places, but at least GFN2 geometry optimizations work well.

Comment thread src/type/molecule.f90
Call init(self, mol0%at, mol0%sym, mol0%xyz, mol0%chrg, mol0%uhf, &
& mol0%lattice, mol0%pbc)
self%ftype = mol0%ftype
end subroutine copyMolecule
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should merge the TMolecule copy part here with the = assignment and add a deep copy of everything. Then one could still just use the assignment with =

Signed-off-by: Igor S. Gerasimov <foxtranigor@gmail.com>
Signed-off-by: Igor S. Gerasimov <foxtranigor@gmail.com>
Signed-off-by: Igor S. Gerasimov <foxtranigor@gmail.com>
@thfroitzheim
Copy link
Copy Markdown
Member

@foxtran does this still fix a problem? If yes, I would merge it

@foxtran
Copy link
Copy Markdown
Contributor Author

foxtran commented Nov 7, 2025

I would prefer to implement check in LLVM flang firstly to find all problematic places.

@lmseidler
Copy link
Copy Markdown
Member

lmseidler commented Feb 18, 2026

#1380 is not fixed by this although it seems related

edit: def related to gnu-12, gnu-15 works fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants