From f2af7d35d028545a00b78d9aa2527ddaef55c629 Mon Sep 17 00:00:00 2001 From: Nick Wogan Date: Thu, 30 May 2024 14:46:22 -0700 Subject: [PATCH] workaround compiler bug --- .github/workflows/test.yaml | 2 +- src/equilibrate_yaml.f90 | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 62871d8..1fc010b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -17,7 +17,7 @@ jobs: id: setup-fortran with: compiler: gcc - version: 14 + version: 13 - name: Setup Python uses: actions/setup-python@v3 diff --git a/src/equilibrate_yaml.f90 b/src/equilibrate_yaml.f90 index 4e54337..6ce3a4a 100644 --- a/src/equilibrate_yaml.f90 +++ b/src/equilibrate_yaml.f90 @@ -81,6 +81,7 @@ subroutine unpack_speciesfile(root, filename, sp, err) type(type_error), allocatable :: io_err character(:), allocatable :: tmp_str + character(s_str_len) :: tmp_str1 integer :: i, j, ind !!! atoms !!! @@ -143,17 +144,11 @@ subroutine unpack_speciesfile(root, filename, sp, err) if (allocated(io_err)) then; err = trim(filename)//trim(io_err%message); return; endif key_value_pair => dict%first do while (associated(key_value_pair)) - ind = findloc(sp%atoms_names,trim(key_value_pair%key), 1) + tmp_str1 = trim(key_value_pair%key) + ind = findloc(sp%atoms_names,tmp_str1, 1) if (ind == 0) then err = 'The atom "'// trim(key_value_pair%key)//'" in species "'// & - sp%r(j)%name//'" is not in the list of atoms: ' - do i = 1,size(sp%atoms_names) - if (i == size(sp%atoms_names)) then - err = err//trim(sp%atoms_names(i)) - else - err = err//trim(sp%atoms_names(i))//', ' - endif - enddo + sp%r(j)%name//'" is not in the list of atoms.' return endif key_value_pair =>key_value_pair%next