number_to_symbol Subroutine

public elemental subroutine number_to_symbol(symbol, number)

Convert atomic number to element symbol

Arguments

Type IntentOptional Attributes Name
character(len=2), intent(out) :: symbol

Element symbol

integer, intent(in) :: number

Atomic number


Source Code

elemental subroutine number_to_symbol(symbol, number)

   !> Atomic number
   integer, intent(in) :: number

   !> Element symbol
   character(len=2), intent(out) :: symbol

   if (number <= 0 .or. number > size(pse)) then
      symbol = '--'
   else
      symbol = pse(number)
   endif

end subroutine number_to_symbol