Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Documentation error

jimdempseyatthecove
Honored Contributor III
745 Views

See:DT Edit Descriptor in User-Defined I/O (intel.com)

The quotation marks are mis-matched:

write (10, '(F10.3, I5, 'DT "sample" (1, 2) )' ) 10.1, 3, obj1, 4.7, 1, obj2

I believe the ' in front of DT should be removed.

Also in PS 2019, the v_list (1, 2) is not passed into the write subroutine.

 

Jim Dempsey

7 Replies
Steve_Lionel
Honored Contributor III
712 Views

You're right - and I'd also claim that the blanks embedded in the DT format shouldn't be there, but I'm not certain. You're also right that the v-list is not passed in. Test case attached.

0 Kudos
FortranFan
Honored Contributor II
640 Views

For whatever it's worth, I agree about the leading apostrophe, it is in error.

 

By the way, latest IFORT 2021.5 as part of oneAPI works as expected with the following simple case:

module m
   type :: t
   end type 
   generic :: write(formatted) => write_t
contains
   subroutine write_t(dtv, lun, iotype, vlist, istat, imsg)
      ! Argument list
      class(t), intent(in)             :: dtv
      integer, intent(in)              :: lun
      character (len=*), intent(in)    :: iotype
      integer, intent(in)              :: vlist(:)
      integer, intent(out)             :: istat
      character (len=*), intent(inout) :: imsg
      ! defined output
      write(unit=lun, fmt=*, iostat=istat) "iotype = ", iotype, "; size(vlist) = ", size(vlist)
      if (size(vlist) > 0) write(unit=lun, fmt=*, iostat=istat) "vlist = ", vlist
   end subroutine write_t
end module
   use m
   type(t) :: foo
   print "(dt 'foo' (1,2))", foo
end
C:\temp>ifort /standard-semantics p.f90
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.5.0 Build 20211109_000000
Copyright (C) 1985-2021 Intel Corporation.  All rights reserved.

Microsoft (R) Incremental Linker Version 14.30.30706.0
Copyright (C) Microsoft Corporation.  All rights reserved.

-out:p.exe
-subsystem:console
p.obj

C:\temp>p.exe
iotype = DTfoo; size(vlist) =  2 vlist =  1 2

 

And I failed to find any prohibition in the standard with the embedded blanks in the DT edit descriptor, I think the above snippet conforms.

0 Kudos
JohnNichols
Valued Contributor III
631 Views
0 Kudos
FortranFan
Honored Contributor II
579 Views

Re: "why not last line dtfoo," look into the standard for the details but in effect it calls for the 'iotype' argument to be passed to the subroutine in uppercase as either "LISTDIRECTED", "NAMELIST", or "DT", the last one being irrespective of the case in the format statement in the caller.

0 Kudos
Steve_Lionel
Honored Contributor III
600 Views

I checked - free form source specifically allows blanks in a format specification.

0 Kudos
Devorah_H_Intel
Moderator
507 Views

@jimdempseyatthecove  - thank you for the report. We have passed it on to the doc team.

0 Kudos
JohnNichols
Valued Contributor III
494 Views

Dear Devorah:  

Your kindly written response to Jim, made me chuckle and then think of the teacher in Anne of Green Gables, blame raising four daughters for that memory.  

Screenshot 2022-03-08 141842.png

 

Did your job description include corralling a bunch of 60 year old high school boys? It should  have.  

 

Good job and  I love the professionalism shown by Intel people.  

 

JMN

Reply