- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Good day,
I would like to find out, is it possible to reload the (un-) formatted write and read statements to a derived type variable? I mean something like this
[fortran]MODULE reloadWrite_module IMPLICIT NONE ! public :: write !(formatted) !public :: write(formatted) ! private :: write_some_formatted ! type :: some integer :: age character(Len=10) :: firstName character(Len=10) :: lastName end type some ! INTERFACE write !(formatted) MODULE PROCEDURE write_some_formatted END INTERFACE ! CONTAINS ! subroutine write_some_formatted(this) implicit none type(some), intent(IN) :: this write( *, 1 ) "person ", "first name is ", this%firstName, "last name is ", this%lastName, "age is ", this%age 1 format ( :, 1X, A,/, 2(2(A),/), A,i3 ) return end subroutine write_some_formatted END MODULE reloadWrite_module[/fortran]
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The 2003 and 2008 Fortran standards include the concept of user-defined derived-type input/output procedures (UDDTIOPs for short). I think this is what you are asking for. One of the Intel people should be able to confirm one way or the other, but I believe that I read in this forum that UDDTIOPs have not yet been implemented in ifort.
-Kurt
-Kurt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Kurt is correct - you are asking for the User-Defined Derived Type I/O feature which we have not yet implemented.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve, Kurt,
I`ve seen this feature in some PDF about the new fortran 2003. But without explicit subroutines.
Oleg.

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