gfxgfx
 
Please login or register.

Login with username, password and session length
 
gfx gfx
gfx
1516 Posts in 502 Topics by 733 Members - Latest Member: tbickel3 October 29, 2020, 12:53:45 AM
*
gfx* Home | Help | Search | Login | Register | gfx
gfx
Absoft User Forum  |  Support  |  General  |  Absoft Debugger shows strange indizes for derived datatypes
gfx
gfxgfx
 

Author Topic: Absoft Debugger shows strange indizes for derived datatypes  (Read 2301 times)

Klemens

  • Newbie
  • *
  • Posts: 10
Absoft Debugger shows strange indizes for derived datatypes
« on: March 24, 2015, 11:56:43 AM »
Hi all,

I am using derived datatypes for storing variables that are central to the program (kind of global variables) in a module like

module general_data

type nc_data
  integer, dimension(:), allocatable:: year
end type nc_data

type (nc_data):: nc

end module general_data

Applying the module in various subroutines, debugger shows quite strange indizes for e.g. nc%year. The debugger does not recognize the actual size of nc%year (after it has been allocated in a subroutine), and clicking on year, array viewer window opens and shows either extremely large indizes or wrong ones and values are wrong, too. Printing the results on the screen is fine.

I know from Visual Fortran, that one had to provide also the name for the module in the debug window, like general_data:nc%year to see  the correct value in the window, but what's the issue with the Absoft Debugger ?

Many thanks for your help in advance !

Klemens

paj

  • Newbie
  • *
  • Posts: 7
Re: Absoft Debugger shows strange indizes for derived datatypes
« Reply #1 on: March 24, 2015, 01:47:42 PM »
Using this program with your module:

program main
use general_data
allocate(nc%year(100))
do i=1,100; nc%year(i)=i; end do
write (*,*) nc%year
end

With Pro Fortran 2015 on Windows, after the DO loop, I was able to view the array without any problems. The dimension bounds and extent were correct and all values displayed correctly.

Can you tell me what OS you are on and what version of Pro Fortran you are using?


Klemens

  • Newbie
  • *
  • Posts: 10
Re: Absoft Debugger shows strange indizes for derived datatypes
« Reply #2 on: March 24, 2015, 02:02:22 PM »
Hi paj,

first thanks for your help !

I am using Absoft 13.0.3 on WIndows 7.

I found that in the main program, the first level is also displayed properly (I made a screenshot, but file is too large for upload here.)
But if I have several level in the derived data type it looks like:

info.var(1).levels(59778464)

in the array viewer. The corresponding value is the value for info.var(1).levels(1) and I get the correct value when I use 'print'.

Cheers,

Klemens

Klemens

  • Newbie
  • *
  • Posts: 10
Re: Absoft Debugger shows strange indizes for derived datatypes
« Reply #3 on: March 24, 2015, 04:31:54 PM »
ok, here is a minimum example:

module mod_test_data

type type_f
  integer:: n_f
  real, dimension(:), allocatable:: f
end type type_f

type type_g
  type(type_f), dimension(:), allocatable:: g
end type type_g

type(type_g):: h

end module mod_test_data

program testtest
use mod_test_data

implicit none

integer:: i, j

if(allocated(h%g)) deallocate(h%g)
allocate(h%g(1:20))
do i = 1, 20
  h%g(i)%n_f = i
  if(allocated(h%g(i)%f)) deallocate(h%g(i)%f)
  allocate(h%g(i)%f(1:h%g(i)%n_f))
  do j = 1, h%g(i)%n_f
    h%g(i)%f(j) = i + j *2
  enddo
enddo

print *, h%g(1)%f(1)

end program 

The print statement at the end prints the correct value (3). But if you use the debugger and open the different flaps to see the respective values, the array viewer shows the value (3) at h%g(1)%f(20). There are also entries for h%g(1)%f(21) to h%g(1)%f(31) (without sense) displayed in the array viewer. What' wrong here ?

Cheers,

Klemens

paj

  • Newbie
  • *
  • Posts: 7
Re: Absoft Debugger shows strange indizes for derived datatypes
« Reply #4 on: March 25, 2015, 11:18:35 AM »
I can duplicate your issue with this example. Incorrect symbol information is being output for nested allocatable elements. I have passed this issue on to the developers.

cag

  • Newbie
  • *
  • Posts: 16
Re: Absoft Debugger shows strange indizes for derived datatypes
« Reply #5 on: September 10, 2015, 11:31:07 AM »
This issue has been addressed on the 15.0.3 service pack for Absoft Pro Fortran 2015.

Absoft User Forum  |  Support  |  General  |  Absoft Debugger shows strange indizes for derived datatypes
 

gfxgfx
gfx gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!