Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixes for variable allocation #518

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

npaulish
Copy link
Collaborator

  • Some allocatable string variables are not allocated (progname, seedname and cpstatus in wannier_prog.F90, but there might be more for instance in postw90). With stricter compiler settings (e.g. recommended for debugging in config/make_gfort.inc) this causes an error. The problem is caused by -fno-realloc-lhs flag. If the arrays are explicitly allocated, the code would be more robust.
    *chkpt1 variable used in writing .chk file is declared with undefined length (wannier90_readwrite.F90). Parent variable is cpstatus declared with undefined length in wannier_prog.F90. This breaks backward compatibility with .chk file created with the old version of the code (where len=20). Maybe to ensure backward compatibility it would be better to still use len=20?

 * Specify `len=20` when defining `checkpoint` variable in src/readwrite.F90
@JeromeCCP9 JeromeCCP9 marked this pull request as ready for review September 30, 2024 14:08
@JeromeCCP9
Copy link
Collaborator

Hello Nataliya! I found that your change to readwrite.F90 (setting the length to 20) actually breaks reading old checkpoint files, while the allocate-on-assignment style worked fine. Your change was in the read routine, right? Could it be that we just want to to make a change to the writing routine and only print (up to) 20 chars there instead?

@npaulish
Copy link
Collaborator Author

Thanks Jerome! Sorry for the late reply. Actually once I removed the -fno-realloc-lhs flag from the compiler, as we discussed, I could not reproduce the issue with the checkpoint file anymore. Maybe then there is no need to change the routines?

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.

2 participants