check whether the current label is already given
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | label(:) |
holding array of labels with label(n) contains current label |
||
integer, | intent(in) | :: | nLabels |
Number of schemes already existing in the scheme array (they are being added currently, so we only have to compare against the ones coming before the current one, up to nSchemes-1) |
subroutine tem_checkLabel(label, nLabels)
! -------------------------------------------------------------------- !
!> holding array of labels with label(n) contains current label
character(len=*), intent(in) :: label(:)
!> Number of schemes already existing in the scheme array
!! (they are being added currently, so we only have to compare against
!! the ones coming before the current one, up to nSchemes-1)
integer, intent(in) :: nLabels
! -------------------------------------------------------------------- !
integer :: iLabel
! -------------------------------------------------------------------- !
write(logUnit(1),*)' Comparing the labels...'
do ilabel = 1, nLabels - 1
! Check the labels here
if ( trim(label(ilabel)) == trim(label(nLabels)) ) then
write(logUnit(1),*) 'Error: identical label have been encountered.'
write(logUnit(1),*) ' Please specify a unique label for ' &
& // 'multiple tables in the config file.'
write(logUnit(1),*) "Example: scheme = {{ label = 'scheme1' , ... }, "
write(logUnit(1),*) " { label = 'scheme2' , ... }} "
write(logUnit(1),*) " "
write(logUnit(1),*) "Stopping... "
call tem_abort()
end if
end do
end subroutine tem_checkLabel