From 578ed1c8c85d4a231241d449ccb5003501f970f0 Mon Sep 17 00:00:00 2001 From: Junfeng Qiao Date: Fri, 23 Feb 2024 17:47:21 +0100 Subject: [PATCH] Fix bounds error when assigning M matrices With gfortran `-fcheck=bounds` the chkpt distribution raise a runtime error: Array bound mismatch for dimension 1 of array 'm_matrix_local' (12/8) --- .github/workflows/main.yml | 2 +- src/readwrite.F90 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4d850d6f2..48655909d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,7 +30,7 @@ jobs: - name: install dependencies run: | sudo apt-get update - sudo apt-get install \ + sudo apt-get -y install \ gfortran \ libblas-dev \ liblapack-dev \ diff --git a/src/readwrite.F90 b/src/readwrite.F90 index 5465e841a..d46651747 100644 --- a/src/readwrite.F90 +++ b/src/readwrite.F90 @@ -2103,7 +2103,7 @@ subroutine w90_readwrite_chkpt_dist(dis_manifold, wannier_data, u_matrix, u_matr ikl = 1 do ikg = 1, num_kpts if (distk(ikg) == rank) then - m_matrix_local(:, :, :, ikl) = m_matrix(:, :, :, ikg) + m_matrix_local(:num_wann, :num_wann, :, ikl) = m_matrix(:, :, :, ikg) ikl = ikl + 1 endif enddo