src/gray_params.f90: replace misused findloc function
This commit is contained in:
parent
4f0e06ea71
commit
1bcc4f968b
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user