My IDE is Code::Blocks 17.12 with MinGW compiler 6.3.0
I am new in coding with Fortran so I need a help about specific things and tricks in proces of learning so, this is my simple program:
PROGRAM DO_LOOP_ALLOCATION
IMPLICIT NONE
INTEGER :: I, ALLOC_ERR
INTEGER, PARAMETER :: N_NN_DM = 5
INTEGER, PARAMETER :: AN_NN_DM( N_NN_DM ) = [ 3, 3, 3, 3, 3 ]
INTEGER, ALLOCATABLE :: ARRAY_DM( :, : )
DO I = 1, N_NN_DM
IF ( .NOT. ALLOCATED( ARRAY_DM( I, AN_NN_DM( I ) ) ) ) THEN
ALLOCATE( ARRAY_DM( I, AN_NN_DM( I ) ), STAT = ALLOC_ERR )
END IF
IF ( ALLOC_ERR .NE. 0 ) STOP ( "ERROR - MEMEORY ALLOCATION ISSUE !!!" )
END DO
END PROGRAM DO_LOOP_ALLOCATION
In the compiling process I got this error message:
Error: 'array' argument of 'allocated' intrinsic must be ALLOCATABLE
What is wrong with this simple code?