PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

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
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 © 2001, 2002 phpBB Group