From fe213f53ab45572acaddc4113f1bf8070384b868 Mon Sep 17 00:00:00 2001 From: Katherine Rasmussen Date: Thu, 8 Feb 2024 16:01:53 -0800 Subject: [PATCH] Add workaround to an intel bug with associate-stmts --- ...erence_engine_s.f90 => inference_engine_s.F90} | 15 +++++++++++++++ 1 file changed, 15 insertions(+) rename src/inference_engine/{inference_engine_s.f90 => inference_engine_s.F90} (96%) diff --git a/src/inference_engine/inference_engine_s.f90 b/src/inference_engine/inference_engine_s.F90 similarity index 96% rename from src/inference_engine/inference_engine_s.f90 rename to src/inference_engine/inference_engine_s.F90 index 2edbf689a..57af8b2f7 100644 --- a/src/inference_engine/inference_engine_s.f90 +++ b/src/inference_engine/inference_engine_s.F90 @@ -199,6 +199,20 @@ function get_key_value(line) result(value_) character(len=*), intent(in) :: line type(string_t) value_ +#ifdef __INTEL_COMPILER + character(len=:), allocatable :: text_after_colon + integer :: opening_value_quotes, closing_value_quotes + + text_after_colon = line(index(line, ':')+1:) + opening_value_quotes = index(text_after_colon, '"') + closing_value_quotes = opening_value_quotes + index(text_after_colon(opening_value_quotes+1:), '"') + + if (any([opening_value_quotes, closing_value_quotes] == 0)) then + value_ = string_t(trim(adjustl((text_after_colon)))) + else + value_ = string_t(text_after_colon(opening_value_quotes+1:closing_value_quotes-1)) + end if +#else associate(text_after_colon => line(index(line, ':')+1:)) associate(opening_value_quotes => index(text_after_colon, '"')) associate(closing_value_quotes => opening_value_quotes + index(text_after_colon(opening_value_quotes+1:), '"')) @@ -210,6 +224,7 @@ function get_key_value(line) result(value_) end associate end associate end associate +#endif end function end procedure construct_from_json