I occasionally have problems compiling with /check, when sub arrays are used. In the following example, the 4th argument is declared as integer, dimension(2), but supplied as a part of an integer array iilist(6:7). This all works well (with /debug) unless /check is used. When running the program, there is an error 'Attempt to call a routine with argument number four containing too few argument elements'. I overcame the problem, by declaring the array as variable length then reporting the size of the array, which was always 2. As the dimension was declared 'dimension(: )', I also used an interface declaration in all calling routines.
Is this a bug in /check, not being able to recognise 'iilist(6:7)' is dimension 2 ?
( I'm also getting another 'Error: ALLOCATE was unable to obtain sufficient storage' when trying to allocate an integer*4 array of dimension (5);( 20 bytes! ), after a combined ALLOCATE of 1.58 mb in 4 other arrays, but that is another puzzle )
John
! typical call to routine
call fix_Beam_release_code (0, etype, jk, iilist(6:7))
subroutine fix_Beam_release_code (ftype, etype, jk, end_code)
!
! First declaration
integer*4 ftype, etype, jk(6,2), end_code(2)
!
! Revised declaration
integer*4, intent (in) :: ftype ! format type
integer*4, intent (in) :: etype ! element formulation type
integer*4, dimension(6,2), intent (in) :: jk ! end release code for ftype=5, etype=2
integer*4, dimension(:), intent (inout) :: end_code ! end release code