Quantcast
Channel: Intel® Software - Intel® Fortran Compiler for Linux* and macOS*
Viewing all articles
Browse latest Browse all 2746

namelist read for internal file with delim='apostrophe' (?)

$
0
0

There doesn't seem to be any way to set the character delimiter if doing a namelist read from an internal file.  I see from.https://software.intel.com/en-us/node/678700 that the default delimiter is 'none'.  This prevents proper error checking, and seems contrary to Note 10.36 in the J3/10-007 copy of the 2008 standard.  Here's an example:

program abc
  character(len=32) :: fs
  character(len=1) :: xx(8)
  integer :: ios
  namelist /foo/ xx
  fs = "&foo xx = 34 /" ! Assign an integer value to the character variable.
  read(fs, nml=foo, iostat=ios)
  print *, 'xx(1)=', xx(1)
  print *, 'xx(2)=', xx(2)
  print *, 'xx(3)=', xx(3)
  print *, 'ios=', ios
end

Running the example produces this output:

$> ifort --version
ifort (IFORT) 17.0.2 20170213
Copyright (C) 1985-2017 Intel Corporation.  All rights reserved.

$> ifort foo.f90 && ./a.out
 xx(1)=3
 xx(2)=
 xx(3)=
 ios=           0

This is consistent with the Rules for Namelist Reads link given above, but it's sure wierd.

Thread Topic: 

Bug Report

Viewing all articles
Browse latest Browse all 2746

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>