View previous topic :: View next topic |
Author |
Message |
Ralf
Joined: 30 Aug 2007 Posts: 50 Location: munich
|
Posted: Wed Feb 28, 2024 9:56 am Post subject: MAXVAL with /check-option |
|
|
I got an 'Access-Violation' error with MAXVAL ( or MINVAL) when I compile my code with the /check option (only 64bit). See the following example:
Code: |
program Test_maxval
integer*4,parameter :: size_1_of_array = 5
integer*4,parameter :: size_2_of_array = 10
integer*4,parameter :: max_ref = 10
real*4 :: r_maxval
real*4,ALLOCATABLE,DIMENSION(:,:) :: real_array
integer*4 :: i, ierror
integer*4,dimension(max_ref) :: n_points
ALLOCATE (real_array(size_1_of_array,size_2_of_array),STAT = ierror)
real_array = 1.
real_array(2,3) = 2.
i = 3
n_points = 4
r_maxval = maxval(real_array(1:4,3))
write(*,*)'r_maxval=',r_maxval
stop
end |
|
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7933 Location: Salford, UK
|
Posted: Wed Feb 28, 2024 10:28 am Post subject: |
|
|
Ralf
On first testing this does not fail for me. Which version of FTN95 are you using? |
|
Back to top |
|
|
Ralf
Joined: 30 Aug 2007 Posts: 50 Location: munich
|
Posted: Wed Feb 28, 2024 10:54 am Post subject: |
|
|
Version 9.00.0
I compile the example with:
ftn95 /check /64 testmaxval.f95 /link |
|
Back to top |
|
|
Ralf
Joined: 30 Aug 2007 Posts: 50 Location: munich
|
Posted: Wed Feb 28, 2024 10:59 am Post subject: |
|
|
I am sorry, I posted the wrng version of the example.
relplace the maxval command with:
Code: |
r_maxval = maxval(real_array(1:n_points(i),i))
|
|
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7933 Location: Salford, UK
|
Posted: Wed Feb 28, 2024 11:27 am Post subject: |
|
|
The bounds checking for 64 bits does not work in this context. For the moment it is necessary to add /inhibit_check 20 when using /check.
I will add this to the list of things to investigate. |
|
Back to top |
|
|
|