PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

FORTRAN 2003 abstract=>concrete class issue

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



Joined: 15 Sep 2004
Posts: 2

PostPosted: Fri May 31, 2013 6:12 am    Post subject: FORTRAN 2003 abstract=>concrete class issue Reply with quote

Hi there. I think I found a compiler bug, perhaps you can confirm. I am using PGI Workstation 13.4, and I'm compiling with the pgfortran program.

I made a simple testing class diagram which exercised most of the functionality I would expect to use, just to learn. (Class diagram here: https://collab.firelab.org/software/projects/orchidee/wiki/Object_Oriented_FORTRAN)

The complete implementation is on github, here: https://github.com/bnordgren/oo-fortran-test

The part that concerns me is when I try to extend an abstract class to make a concrete class:

Code:

type, extends(AbstractCellIterator) :: RowFirstCellIterator
        private
    contains
        procedure :: hasNext => hasnext_rowfirst
        procedure :: next => next_rowfirst
end type


When I run the code, and step into my iter%next() call, I end up in the function "hasnext_rowfirst" instead of "next_rowfirst".

Code:

 Row First Navigation!
 =====================
Breakpoint at 0x402AC9, function walk_path, file test_cell_iterator.f03, line 36
 #36:         if (.not. associated(iter)) then

pgdbg> n
Stopped at 0x402B44, function walk_path, file test_cell_iterator.f03, line 39
 #39:             do while (iter%hasNext())

pgdbg> n
 In hasnext_rowfirst()
Stopped at 0x402B6D, function walk_path, file test_cell_iterator.f03, line 40
 #40:                 print *, "top of loop"

pgdbg> n
 top of loop
Stopped at 0x402BD6, function walk_path, file test_cell_iterator.f03, line 41
 #41:                 cur_coord => (iter%next())

pgdbg> step
Stopped at 0x403A60, function hasnext_rowfirst, file cell_iterator.f03, line 147
 #147:         hasnext_rowfirst = .false.


It's the last line of that debugger that bugs me. Is this a known bug? Did I do something wrong? Is there a workaround? (BTW-gfortran 4.7 seems to work as expected.)

Also, pgfortran reported a syntax error (and terminated with signal 11) until I made this change in grid_coordinates.f03 (https://github.com/bnordgren/oo-fortran-test/commit/74aa5f151bbc622134441fe51aa99409a04ac690)
Back to top
View user's profile
mkcolg



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

PostPosted: Fri Jun 07, 2013 9:05 am    Post subject: Reply with quote

Hi Bryce,

Apologies for the late reply. I passed this on to engineering who agree it's PGI compiler error. We have added a problem report (TPR#19398) and hope to have this fixed in the near future.

Best Regards,
Mat
Back to top
View user's profile
jtull



Joined: 30 Jun 2004
Posts: 445

PostPosted: Wed Aug 07, 2013 2:49 pm    Post subject: TPR 19398 - F2003: incorrect type bound proc gets called Reply with quote

Bryce,

TPR 19398 has been fixed in the current 13.7 release.

Thanks for the report.

dave
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