I strongly recommend that you add:
Implicit none
Then for each array of each program, the variable declares its type.
Don't use dimensions, and forget the word forever.
An integer array is defined as follows:
Integer:: i(n)
Floating-point number groups are defined as follows:
Real number:: r(n)