forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

MAXVAL with /check-option

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit
View previous topic :: View next topic  
Author Message
Ralf



Joined: 30 Aug 2007
Posts: 50
Location: munich

PostPosted: Wed Feb 28, 2024 9:56 am    Post subject: MAXVAL with /check-option Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7925
Location: Salford, UK

PostPosted: Wed Feb 28, 2024 10:28 am    Post subject: Reply with quote

Ralf

On first testing this does not fail for me. Which version of FTN95 are you using?
Back to top
View user's profile Send private message AIM Address
Ralf



Joined: 30 Aug 2007
Posts: 50
Location: munich

PostPosted: Wed Feb 28, 2024 10:54 am    Post subject: Reply with quote

Version 9.00.0
I compile the example with:
ftn95 /check /64 testmaxval.f95 /link
Back to top
View user's profile Send private message
Ralf



Joined: 30 Aug 2007
Posts: 50
Location: munich

PostPosted: Wed Feb 28, 2024 10:59 am    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7925
Location: Salford, UK

PostPosted: Wed Feb 28, 2024 11:27 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit All times are GMT + 1 Hour
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, 2005 phpBB Group