Converting a string to an integer in Fortran 90
I know that IACHAR(s) returns the code for the ASCII character in the first character position of the string s, but I need to convert the entire string to an integer. I also have a few number of strings (around 30 strings, each consists of at most 20 characters). Is there any way to convert each one of them to a unique integer in Fortran 90? You can read a string into an integer variable: module str2int_mod contains elemental subroutine str2int(str,int,stat) implicit none ! Arguments character(len=*),intent(in) :: str integer,intent(out) :: int integer,intent(out) :: stat read(str,*,iostat