element2index Function

public function element2index(element_label)

Returns the index of the element in the impurity array with a given name author: P J Knight, CCFE, Culham Science Centre element_label : input string : impurity name This function returns the index of the element in the impurity array with the corresponding name. None

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: element_label

Return Value integer


Contents

Source Code


Source Code

  function element2index(element_label)

    !! Returns the index of the element in the impurity array with
    !! a given name
    !! author: P J Knight, CCFE, Culham Science Centre
    !! element_label : input string : impurity name
    !! This function returns the index of the element
    !! in the impurity array with the corresponding name.
    !! None
    !
    ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

		use error_handling, only: report_error
    implicit none

    integer :: element2index

    !  Arguments

    character(len=*), intent(in) :: element_label

    !  Local variables

    integer :: i

    ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    do i = 1, size(impurity_arr_Label)
       if (element_label == impurity_arr_Label(i)) then
          element2index = i
          return
       end if
    end do

    !  Should only get here if there is a problem

    call report_error(34)

  end function element2index