- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I checked - free form source specifically allows blanks in a format specification.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page