<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Function to determine if a string is numeric in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799312#M36922</link>
    <description>This is standard Fortran?&lt;BR /&gt;&lt;BR /&gt;READ(string, '(F&lt;N&gt;.0)', IOSTAT=e) x&lt;/N&gt;</description>
    <pubDate>Fri, 18 Feb 2011 22:17:07 GMT</pubDate>
    <dc:creator>a_leonard</dc:creator>
    <dc:date>2011-02-18T22:17:07Z</dc:date>
    <item>
      <title>Function to determine if a string is numeric</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799304#M36914</link>
      <description>I am using the function below to determine whether a string is numeric or character. I have discovered that the string "/" will return true. Does anyone know of any other special cases that might not work as expected?&lt;BR /&gt;&lt;BR /&gt; FUNCTION is_numeric(string)&lt;BR /&gt; IMPLICIT NONE&lt;BR /&gt; CHARACTER(len=*), INTENT(IN) :: string&lt;BR /&gt; LOGICAL :: is_numeric&lt;BR /&gt; REAL :: x&lt;BR /&gt; INTEGER :: e&lt;BR /&gt; READ(string,*,IOSTAT=e) x&lt;BR /&gt; is_numeric = e == 0&lt;BR /&gt; END FUNCTION is_numeric&lt;BR /&gt;&lt;BR /&gt;I would have thought that the slash would return a negative (end of record) value.&lt;BR /&gt;&lt;BR /&gt;From "Rules for List-Directed Sequential READ Statements":&lt;P&gt; If a slash ( / ) is encountered during execution, the READ statement is 
terminated, and any remaining input list items are unchanged.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Feb 2011 17:55:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799304#M36914</guid>
      <dc:creator>a_leonard</dc:creator>
      <dc:date>2011-02-18T17:55:49Z</dc:date>
    </item>
    <item>
      <title>Function to determine if a string is numeric</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799305#M36915</link>
      <description>Try:&lt;BR /&gt;&lt;BR /&gt; FUNCTION is_numeric(string)&lt;BR /&gt; IMPLICIT NONE&lt;BR /&gt; CHARACTER(len=*), INTENT(IN) :: string&lt;BR /&gt; LOGICAL :: is_numeric&lt;BR /&gt; REAL :: x&lt;BR /&gt; INTEGER :: e&lt;BR /&gt; is_numeric = .false.&lt;BR /&gt; READ(string,*,IOSTAT=e, ADVANCE='NO', EOR=999) x&lt;BR /&gt; is_numeric = e == 0&lt;BR /&gt;999 CONTINUE&lt;BR /&gt; END FUNCTION is_numeric&lt;BR /&gt;&lt;BR /&gt;What do you expect for a string containing&lt;BR /&gt;&lt;BR /&gt; '1234 abcd'&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey</description>
      <pubDate>Fri, 18 Feb 2011 18:42:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799305#M36915</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2011-02-18T18:42:39Z</dc:date>
    </item>
    <item>
      <title>Function to determine if a string is numeric</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799306#M36916</link>
      <description>An alternative technique:&lt;BR /&gt;&lt;BR /&gt; FUNCTION is_numeric(string)&lt;BR /&gt; USE ieee_arithmetic&lt;BR /&gt; IMPLICIT NONE&lt;BR /&gt; CHARACTER(len=*), INTENT(IN) :: string&lt;BR /&gt; LOGICAL :: is_numeric&lt;BR /&gt; REAL :: x&lt;BR /&gt; INTEGER :: e&lt;BR /&gt; x = FOR_S_NAN&lt;BR /&gt; READ(string,*,IOSTAT=e) x&lt;BR /&gt; is_numeric = ((e == 0) .and. (.NOT. ISNAN(X)))&lt;BR /&gt; END FUNCTION is_numeric&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey</description>
      <pubDate>Fri, 18 Feb 2011 18:52:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799306#M36916</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2011-02-18T18:52:35Z</dc:date>
    </item>
    <item>
      <title>Function to determine if a string is numeric</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799307#M36917</link>
      <description>Do not use list-directed input (format *) for this. Period. It is much more lenient than you want.&lt;BR /&gt;&lt;BR /&gt;You could use I format if it must be an integer, or Fn.0 (where n is the width of the string) if it can be integer or floating.)</description>
      <pubDate>Fri, 18 Feb 2011 18:57:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799307#M36917</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-02-18T18:57:07Z</dc:date>
    </item>
    <item>
      <title>Function to determine if a string is numeric</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799308#M36918</link>
      <description>&lt;P&gt;Why not use VERIFY?&lt;/P&gt;</description>
      <pubDate>Fri, 18 Feb 2011 19:10:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799308#M36918</guid>
      <dc:creator>nvaneck</dc:creator>
      <dc:date>2011-02-18T19:10:30Z</dc:date>
    </item>
    <item>
      <title>Function to determine if a string is numeric</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799309#M36919</link>
      <description>It looks like results of my function when compiled with 11.1 are different than when compiled with 11.0. Strings that are definitely not numeric (abc:1&amp;amp;0) are returning TRUE with IVF 11.0.&lt;BR /&gt;&lt;BR /&gt;After taking the good doctor's advice about list-directed format, my function is now:&lt;BR /&gt;&lt;BR /&gt; FUNCTION is_numeric(string)&lt;BR /&gt; IMPLICIT NONE&lt;BR /&gt; CHARACTER(len=*), INTENT(IN) :: string&lt;BR /&gt; LOGICAL :: is_numeric&lt;BR /&gt; REAL :: x&lt;BR /&gt; INTEGER :: e,n&lt;BR /&gt; CHARACTER(len=12) :: fmt&lt;BR /&gt; &lt;BR /&gt; n=LEN_TRIM(string)&lt;BR /&gt; WRITE(fmt,'("(F",I0,".0)")') n&lt;BR /&gt; READ(string,fmt,IOSTAT=e) x&lt;BR /&gt; is_numeric = e == 0&lt;BR /&gt; END FUNCTION is_numeric&lt;BR /&gt;&lt;BR /&gt;This seems to work fine until it got the string "d1", which it seems to have converted as if it were "0.0D1", which is not what I want.&lt;BR /&gt;&lt;BR /&gt;The following should be recognized as numeric:&lt;BR /&gt;&lt;BR /&gt;1&lt;BR /&gt;1.0&lt;BR /&gt;1.0e0&lt;BR /&gt;&lt;BR /&gt;The following should be recognized as strings&lt;BR /&gt;&lt;BR /&gt;1A&lt;BR /&gt;d1&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 18 Feb 2011 20:21:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799309#M36919</guid>
      <dc:creator>a_leonard</dc:creator>
      <dc:date>2011-02-18T20:21:11Z</dc:date>
    </item>
    <item>
      <title>Function to determine if a string is numeric</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799310#M36920</link>
      <description>Yes, we tightened list-directed input some, including strings that started with D, E or Q, but you can still get into trouble, for example, commas, slashes, 3*4, etc. I'll say it again - DO NOT USE LIST-DIRECTED INPUT FOR VALIDATION. If I had a nickel for every time someone ran into trouble doing this I could retire now.</description>
      <pubDate>Fri, 18 Feb 2011 20:37:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799310#M36920</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-02-18T20:37:05Z</dc:date>
    </item>
    <item>
      <title>Function to determine if a string is numeric</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799311#M36921</link>
      <description>Also, the value 1d1 is 10.0, a valid numeric value, so if you want that rejected, your going to have to do more.&lt;BR /&gt;&lt;BR /&gt;another comment, you can simplify&lt;BR /&gt;&lt;P&gt; n=LEN_TRIM(string)&lt;BR /&gt; WRITE(fmt,'("(F",I0,".0)")') n&lt;BR /&gt; READ(string,fmt,IOSTAT=e) x&lt;/P&gt;&lt;P&gt;replacing it with&lt;/P&gt;&lt;P&gt; n=LEN_TRIM(string)&lt;BR /&gt; READ(string, '(F&lt;N&gt;.0)', IOSTAT=e) x&lt;BR /&gt;&lt;BR /&gt;A question for Steve: while playing with this a little I did a read(*, '(q,A80)') to a character (len=20) variable, and while the length variable was properly filled with the number of characters typed, they were not read into the shorter character variable, it was blanked. So is this proper behavior per the FORTRAN standard, or is it a bug?&lt;/N&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Feb 2011 21:57:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799311#M36921</guid>
      <dc:creator>John_B__Walter</dc:creator>
      <dc:date>2011-02-18T21:57:31Z</dc:date>
    </item>
    <item>
      <title>Function to determine if a string is numeric</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799312#M36922</link>
      <description>This is standard Fortran?&lt;BR /&gt;&lt;BR /&gt;READ(string, '(F&lt;N&gt;.0)', IOSTAT=e) x&lt;/N&gt;</description>
      <pubDate>Fri, 18 Feb 2011 22:17:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799312#M36922</guid>
      <dc:creator>a_leonard</dc:creator>
      <dc:date>2011-02-18T22:17:07Z</dc:date>
    </item>
    <item>
      <title>Function to determine if a string is numeric</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799313#M36923</link>
      <description>John,&lt;BR /&gt;&lt;BR /&gt;That behavior (the shorter variable being blank) is specified by the standard. What happens is that the field width is 80 (you said A80) Since the field width (80) is greater than the width of the variable (20), the rightmost 20 characters of the input field is used. Assuming you typed in fewer than 60 characters, that means that the variable will be assigned blanks.&lt;BR /&gt;&lt;BR /&gt;To correct this, just use A rather than A80.</description>
      <pubDate>Fri, 18 Feb 2011 22:24:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799313#M36923</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-02-18T22:24:50Z</dc:date>
    </item>
    <item>
      <title>Function to determine if a string is numeric</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799314#M36924</link>
      <description>&lt;DIV id="tiny_quote"&gt;
                &lt;DIV style="margin-left: 2px; margin-right: 2px;"&gt;Quoting &lt;A rel="/en-us/services/profile/quick_profile.php?is_paid=&amp;amp;user_id=399560" class="basic" href="https://community.intel.com/en-us/profile/399560/"&gt;a.leonard&lt;/A&gt;&lt;/DIV&gt;
                &lt;DIV style="background-color: #e5e5e5; padding: 5px; border: 1px inset; margin-left: 2px; margin-right: 2px;"&gt;&lt;I&gt;This is standard Fortran?&lt;BR /&gt;&lt;BR /&gt;READ(string, '(F&lt;N&gt;.0)', IOSTAT=e) x&lt;/N&gt;&lt;/I&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No. That's a DEC extension called Variable Format Expression.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Feb 2011 22:25:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799314#M36924</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-02-18T22:25:49Z</dc:date>
    </item>
    <item>
      <title>Function to determine if a string is numeric</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799315#M36925</link>
      <description>&lt;DIV id="tiny_quote"&gt;
                &lt;DIV style="margin-left: 2px; margin-right: 2px;"&gt;Quoting &lt;A rel="/en-us/services/profile/quick_profile.php?is_paid=&amp;amp;user_id=186335" class="basic" href="https://community.intel.com/en-us/profile/186335/"&gt;John B. Walter&lt;/A&gt;&lt;/DIV&gt;
                &lt;DIV style="background-color: #e5e5e5; padding: 5px; border: 1px inset; margin-left: 2px; margin-right: 2px;"&gt;&lt;I&gt;Also, the value 1d1 is 10.0, a valid numeric value, so if you want that rejected, your going to have to do more.&lt;BR /&gt;&lt;BR /&gt;&lt;/I&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm OK with "1E1", "1D1", or even "1Q1" as a number (10.0), but I'm going to say that any string starting with a letter - including E, D, and Q - is not a number, even if the I/O conversion works.&lt;/P&gt;&lt;P&gt;I also don't want to have "+" and "-" be considered numbers because it will completly mess up some logic to parse equations.&lt;/P&gt;&lt;P&gt;I have added logic to check for these "special" situations. There are some others ("1 2 3" is read as 123.0) that look a bit odd to me, but I won't worry about it.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Feb 2011 22:48:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799315#M36925</guid>
      <dc:creator>a_leonard</dc:creator>
      <dc:date>2011-02-18T22:48:55Z</dc:date>
    </item>
    <item>
      <title>Function to determine if a string is numeric</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799316#M36926</link>
      <description>It doesn't look like you're going to find some magic solution.&lt;BR /&gt;&lt;BR /&gt;What you need is entirely dependent on what exactly you have to deal with. For instance, what do you want it to do with embeded spaces? &lt;BR /&gt;&lt;BR /&gt;It begins to look like you might be as well off to examine the string character by character, looping over the position in the string from 1 to the length of the string. If you initiallized is_numeric=.FALSE. before the loop, as soon as you found something that defined the string as not a numeric value you could exit from the loop and return from the function. If you completed the loop without finding a problem you'd set is_numeric=.TRUE. before returning from the function.</description>
      <pubDate>Sat, 19 Feb 2011 01:36:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799316#M36926</guid>
      <dc:creator>John_B__Walter</dc:creator>
      <dc:date>2011-02-19T01:36:53Z</dc:date>
    </item>
    <item>
      <title>Function to determine if a string is numeric</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799317#M36927</link>
      <description>An internal read with a format of (BN,Fn.0) where n is the width of the string, should do for most purposes. This will ignore embedded blanks, however.</description>
      <pubDate>Sat, 19 Feb 2011 01:49:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799317#M36927</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-02-19T01:49:56Z</dc:date>
    </item>
    <item>
      <title>Function to determine if a string is numeric</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799318#M36928</link>
      <description>&lt;P&gt;Use&lt;/P&gt;&lt;P&gt;numeric=verify(string(verify(string,' '):),'0123456789') .eq.0&lt;/P&gt;&lt;P&gt;Or just convert it...&lt;/P&gt;&lt;P&gt;k=iconv8(string,ierr)&lt;/P&gt;&lt;P&gt;INTEGER(8) FUNCTION ICONV8(STRING,IERR)&lt;/P&gt;&lt;P&gt;INTEGER(4) I,J,L&lt;/P&gt;&lt;P&gt;CHARACTER STRING*(*)&lt;/P&gt;&lt;P&gt;LOGICAL IERR,NEG&lt;/P&gt;&lt;P&gt;INTEGER(4),PARAMETER :: MINUS=-3,PLUS=-5,BLANK=-16&lt;/P&gt;&lt;P&gt;ICONV8=0&lt;/P&gt;&lt;P&gt;NEG = .FALSE.&lt;/P&gt;&lt;P&gt;IERR = .FALSE.&lt;/P&gt;&lt;P&gt;L=LEN(STRING)&lt;/P&gt;&lt;P&gt;DO I=1,L&lt;/P&gt;&lt;P&gt;J=ICHAR(STRING(I:I))-48&lt;/P&gt;&lt;P&gt;IF (J .GE. 0 .AND. J .LT. 10) THEN&lt;/P&gt;&lt;P&gt;ICONV8=ICONV8*10+J&lt;/P&gt;&lt;P&gt;ELSEIF (J .EQ. MINUS .AND. ICONV8 .EQ. 0D0 .AND. I.NE.L) THEN&lt;/P&gt;&lt;P&gt;NEG = .TRUE.&lt;/P&gt;&lt;P&gt;ELSEIF (I.EQ.L .OR. ICONV8.GT.0 .OR. (J.NE.BLANK.AND.J.NE.PLUS)) THEN&lt;/P&gt;&lt;P&gt;IERR = .TRUE.&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;ENDIF&lt;/P&gt;&lt;P&gt;END DO&lt;/P&gt;&lt;P&gt;IF (NEG) ICONV8 = -ICONV8&lt;/P&gt;&lt;P&gt;END &lt;/P&gt;</description>
      <pubDate>Sat, 19 Feb 2011 11:36:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799318#M36928</guid>
      <dc:creator>nvaneck</dc:creator>
      <dc:date>2011-02-19T11:36:52Z</dc:date>
    </item>
    <item>
      <title>Function to determine if a string is numeric</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799319#M36929</link>
      <description>I used ICHAR (intrinsic function) to determine if a particular character is a numeric.&lt;BR /&gt;&lt;BR /&gt;Numerals 0 to 9 have the range 32 to 41, I believe. 0 --&amp;gt;32, 9 --&amp;gt;41, etc.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Anything outside that range is Non-numeric.&lt;BR /&gt;By "numeric" did you mean the decimal point, plus and minus signs as well?&lt;BR /&gt;&lt;BR /&gt;So, just scan that string, and check for values inside or outside that range.&lt;BR /&gt;Of course, you have read the string into memory first.&lt;BR /&gt;&lt;BR /&gt;Yours; Bill</description>
      <pubDate>Sat, 19 Feb 2011 15:59:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799319#M36929</guid>
      <dc:creator>WSinc</dc:creator>
      <dc:date>2011-02-19T15:59:19Z</dc:date>
    </item>
    <item>
      <title>Function to determine if a string is numeric</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799320#M36930</link>
      <description>&lt;DIV id="tiny_quote"&gt;&lt;DIV style="margin-left: 2px; margin-right: 2px;"&gt;Quoting &lt;A jquery1298135643250="64" rel="/en-us/services/profile/quick_profile.php?is_paid=&amp;amp;user_id=399560" href="https://community.intel.com/en-us/profile/399560/" class="basic"&gt;a.leonard&lt;/A&gt;&lt;/DIV&gt;&lt;DIV style="margin-left: 2px; margin-right: 2px; background-color: #e5e5e5; border: 1px inset; padding: 5px;"&gt;&lt;I&gt;I'm OK with "1E1", "1D1", or even "1Q1" as a number (10.0), but I'm going to say that any string starting with a letter - including E, D, and Q - is not a number, even if the I/O conversion works.&lt;P&gt;I also don't want to have "+" and "-" be considered numbers because it will completly mess up some logic to parse equations.&lt;/P&gt;&lt;P&gt;I have added logic to check for these "special" situations. There are some others ("1 2 3" is read as 123.0) that look a bit odd to me, but I won't worry about it.&lt;/P&gt;&lt;/I&gt;&lt;/DIV&gt;you can, of course, check for embedded spaces with the intrinsic function scan. something like&lt;BR /&gt; integer I, J, N&lt;BR /&gt; I = verify(string,' ') ! location of first non-space&lt;BR /&gt; N = len_trim(string) ! location of last non-space, equivalent to verify(string,' ',back=.true.)&lt;BR /&gt;J = scan(string(I:N),' ') ! check relevant portion of string for any embedded strings&lt;BR /&gt;! J == 0 if there are no embedded spaces&lt;BR /&gt;&lt;BR /&gt;Of course if the embedded spaces are meaningless, and you want "1 2 3" to be read as "123", then your current read accomplishes that. Your original list directed read would have read it as "1", ignoring everything after the space, or more precisely reading them into subsequent variables if any were present.&lt;BR /&gt;&lt;BR /&gt;But so that Steve doesn't have to say it this time, DON'T USE LIST DIRECTED, the convenience is really not worth the pitfalls that await you, unless you really have nothing better to do than discover errors in your program long after you thought you were done developing it.&lt;/DIV&gt;</description>
      <pubDate>Sat, 19 Feb 2011 17:43:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799320#M36930</guid>
      <dc:creator>John_B__Walter</dc:creator>
      <dc:date>2011-02-19T17:43:01Z</dc:date>
    </item>
    <item>
      <title>Function to determine if a string is numeric</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799321#M36931</link>
      <description>It's easy enough to write a routine similar to the one I listed in a prior response for integers which handles decimal points and exponential notation. I have one if you're interested.</description>
      <pubDate>Sat, 19 Feb 2011 23:40:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Function-to-determine-if-a-string-is-numeric/m-p/799321#M36931</guid>
      <dc:creator>nvaneck</dc:creator>
      <dc:date>2011-02-19T23:40:48Z</dc:date>
    </item>
  </channel>
</rss>

