Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

DTIO error message

$
0
0

I was trying to mimic the example in the F08 standard . . .

Is this bad Fortran code?

module dollar_mod

   implicit none
   private

   type, public :: dollar_type
      real :: amount
   contains
      procedure :: Write_dollar
      generic :: write(formatted) => Write_dollar
   end type dollar_type

!   This works OK instead of "generic"
!   interface write (formatted)
!      procedure :: Write_dollar
!   end interface

   public :: write (formatted)

contains

subroutine Write_dollar &
   (dollar_value, unit, b_edit_descriptor, v_list, iostat, iomsg)

   class (dollar_type), intent(in) :: dollar_value
   integer, intent(in) :: unit
   character (len=*), intent(in) :: b_edit_descriptor
   integer, dimension(:), intent(in) :: v_list
   integer, intent(out) :: iostat
   character (len=*), intent(inout) :: iomsg
   write (unit=unit, fmt="(f9.2)", iostat=iostat) dollar_value%amount

end subroutine Write_dollar

end module dollar_mod

program test_dollar

!   use :: dollar_mod   ! Same error message
   use, non_intrinsic :: dollar_mod, only: dollar_type, write (formatted)
   implicit none

   type (dollar_type), parameter :: wage = dollar_type(15.10)
   write (unit=*, fmt="(DT)") wage

end program test_dollar

===================================================

$ ifort i_bug.f90
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 17.0.1.143 Build 20161005
Copyright (C) 1985-2016 Intel Corporation.  All rights reserved.

i_bug.f90(33): error #6714: There is no visible interface-stmt that defines this generic-spec.
end subroutine Write_dollar
^
compilation aborted for i_bug.f90 (code 1)

Zone: 

Thread Topic: 

Bug Report

Viewing all articles
Browse latest Browse all 5691

Trending Articles



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