diff --git a/src/gray_params.f90 b/src/gray_params.f90 index ea76ff6..afafcae 100644 --- a/src/gray_params.f90 +++ b/src/gray_params.f90 @@ -387,14 +387,14 @@ contains character(len=max_name_size) :: provided(max_lines), name ! parse the configuration - count = 1 + count = 0 call parse_ini(filename, ini_handler, err) if (err /= ERR_SUCCESS) return ! check if all mandatory parameters were given do i = 1, size(mandatory) name = mandatory(i) - if (findloc(provided, trim(name), count) /= 0) cycle + if (any(provided(1:count)==trim(name))) cycle call log_error('mandatory parameter `'//trim(name)//'` is missing!', & mod='gray_params', proc='read_gray_config') err = 1 @@ -415,8 +415,8 @@ contains err = update_parameter(params, section // "." // name, value) ! store the parameter name - provided(count) = section // "." // name count = count + 1 + provided(count) = section // "." // name end function ini_handler end subroutine read_gray_config