- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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]
コピーされたリンク
3 返答(返信)
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Kurt is correct - you are asking for the User-Defined Derived Type I/O feature which we have not yet implemented.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Steve, Kurt,
I`ve seen this feature in some PDF about the new fortran 2003. But without explicit subroutines.
Oleg.
