PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Course

can't compile Fortran 2003 handbook example!?

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
Petr Krysl



Joined: 20 Sep 2010
Posts: 3

PostPosted: Wed Sep 22, 2010 8:36 am    Post subject: can't compile Fortran 2003 handbook example!? Reply with quote

Example from page 88:

module passed_object_example
type t
real :: a
procedure(print_me), pointer, pass(arg) :: proc
end type t
contains
subroutine print_me (arg, lun)
type(t), intent(in) :: arg
integer, intent(in) :: lun
write (lun,*) arg%a
end subroutine print_me
subroutine print_my_square (arg, lun)
type(t), intent(in) :: arg
integer, intent(in) :: lun
write (lun,*) arg%a**2
end subroutine print_my_square
end module passed_object_example
program main
use passed_object_example
use iso_fortran_env, only :: output_unit
type(t) :: x
x%a = 2.71828
x%proc => print_me
call x%proc(output_unit)
x%proc => print_my_square
call x%proc(output_unit)
end program main

The compiler command line tool (64-bit Windows 7) says


c:\cygwin\home\pkrysl\f>pgfortran handbook1.f90
NOTE: your trial license will expire in 12 days, 15.5 hours.
PGF90-S-0155-Illegal procedure interface - print_me (handbook1.f90: 4)
0 inform, 0 warnings, 1 severes, 0 fatal for passed_object_example
PGF90-S-0034-Syntax error at or near :: (handbook1.f90: 20)
0 inform, 0 warnings, 1 severes, 0 fatal for main
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6636
Location: The Portland Group Inc.

PostPosted: Fri Sep 24, 2010 9:37 am    Post subject: Reply with quote

Hi Petr,

Sorry for the late reply. I have been out of the office at a conference and wanted to investigate this problem when I got back. However, I see that you sent a report to PGI Customer Service and they have issued a problem report (TPR#17245). I'll let Customer Service take the lead on this error but will try to update this post with any progress.

Thanks,
Mat
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group