Return the index of a colormap by its name. Returns 0 if not found.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Colormaps_info), | intent(in) | :: | this | |||
| character(len=*), | intent(in) | :: | name |
pure function find_index(this, name) result(idx) class(Colormaps_info), intent(in) :: this character(*), intent(in) :: name integer :: idx integer :: i character(colormap_name_length) :: key key = adjustl(trim(name)) idx = 0 do i = 1, size(this%colormaps) if (key == this%colormaps(i)%name) then idx = i exit end if end do end function find_index