str2int Subroutine

public elemental subroutine str2int(str, int, stat)

Convert a string to integer

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str
integer, intent(out) :: int
integer, intent(out) :: stat

Source Code

   ELEMENTAL SUBROUTINE str2int(str, int, stat)
    !! Convert a string to integer
      CHARACTER(LEN=*), INTENT(in) :: str
      INTEGER, INTENT(OUT)         :: int, stat

      read (str, *, iostat=stat) int
   END SUBROUTINE str2int