I am having a problem getting array elements assigned. I am first trying to set all array elements to zero. The relevant code is:
SUBROUTINE SOLVER(N_COMPS,MAX_PANS,ALPHA,U,N_OUTER,
& VECT_POINTS_PERP,PANEL_VECTA,DIST_POINTS,A,V_PERP,VTAN,
& GAMMA,N_PTS,TOT_PTS)
! IMPLICIT NONE ! INTEGER :: I, J INTEGER, INTENT(IN) :: N_COMPS,MAX_PANS, TOT_PTS
REAL*8 :: A(N_COMPS*(MAX_PANS+1),TOT_PTS-N_COMPS)
REAL*8 :: U_NORM((MAX_PANS*3)+N_COMPS)
! ! Initialise arrays DO I = 1, N_COMPS*(MAX_PANS+1) DO J = 1, TOT_PTS-N_COMPS A(I,J) = 0.0 ENDDO ENDDO
DO I = 1, (MAX_PANS*3)+N_COMPS
U_NORM(I) = 0.0
ENDDO
When I use Checkmate to debug the code, the 'A' array has all elements set to 0.0 correctly, but the 'U_NORM' array has a random assortment of: 0.0, 'Invalid floating point number', 'Undefined', or a very small number (e.g. 2.9e-291).
I cannot see why this is occurring. Can anyone shed any light?