From c1de9d429b1793e61076ff8c0d7180bb60937a61 Mon Sep 17 00:00:00 2001 From: npaulish Date: Thu, 26 Sep 2024 11:37:03 +0200 Subject: [PATCH 1/3] Explicitly allocate string variables in src/wannier_prog.F90 --- src/wannier_prog.F90 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/wannier_prog.F90 b/src/wannier_prog.F90 index f9163c1e..2a70180e 100644 --- a/src/wannier_prog.F90 +++ b/src/wannier_prog.F90 @@ -95,6 +95,9 @@ program wannier nk => common_data%num_kpts nn => common_data%kmesh_info%nntot + allocate(character(50) :: progname) + allocate(character(50) :: seedname) + allocate(character(50) :: cpstatus) progname = 'wannier90' ! https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91442 call io_commandline(progname, ld, pp, seedname) @@ -110,10 +113,10 @@ program wannier #endif ! open main output file - open (newunit=stdout, file=seedname//'.wout', status="replace") + open (newunit=stdout, file=TRIM(seedname)//'.wout', status="replace") ! open main error file call w90_get_fortran_stderr(stderr) - if (rank == 0) open (newunit=stderr, file=seedname//'.werr', status="replace") + if (rank == 0) open (newunit=stderr, file=TRIM(seedname)//'.werr', status="replace") call io_date(cdate, ctime) if (rank == 0) write (stderr, *) 'Wannier90: Execution started on ', cdate, ' at ', ctime From f20ee86758f5264b08644874ab86bd6d6eb4f07d Mon Sep 17 00:00:00 2001 From: npaulish Date: Thu, 26 Sep 2024 11:38:21 +0200 Subject: [PATCH 2/3] Fix backward compatibility of .chk file * Specify `len=20` when defining `checkpoint` variable in src/readwrite.F90 --- src/readwrite.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/readwrite.F90 b/src/readwrite.F90 index 6b5ecf11..edc17dd7 100644 --- a/src/readwrite.F90 +++ b/src/readwrite.F90 @@ -1896,7 +1896,7 @@ subroutine w90_readwrite_read_chkpt_header(exclude_bands, kmesh_info, kpt_latt, real(kind=dp), intent(in) :: real_lattice(3, 3) character(len=*), intent(in) :: seedname - character(len=*), intent(inout) :: checkpoint + character(len=20), intent(inout) :: checkpoint logical, intent(in) :: ispostw90 ! Are we running postw90? logical, intent(out) :: have_disentangled From 8c0b6fdc2a0e4140343cc482ead2e8a17eadfe70 Mon Sep 17 00:00:00 2001 From: Jerome Jackson <65367597+JeromeCCP9@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:10:51 +0100 Subject: [PATCH 3/3] Update wannier_prog.F90 --- src/wannier_prog.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wannier_prog.F90 b/src/wannier_prog.F90 index 2a70180e..bebb2d30 100644 --- a/src/wannier_prog.F90 +++ b/src/wannier_prog.F90 @@ -95,9 +95,9 @@ program wannier nk => common_data%num_kpts nn => common_data%kmesh_info%nntot - allocate(character(50) :: progname) - allocate(character(50) :: seedname) - allocate(character(50) :: cpstatus) + allocate (character(50) :: progname) + allocate (character(50) :: seedname) + allocate (character(50) :: cpstatus) progname = 'wannier90' ! https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91442 call io_commandline(progname, ld, pp, seedname)