You have a syntax error in your declaration of AA. This then causes AA not be declared hence the ‘not public entity’ error.
% pgf90 -c test.f90
PGF90-S-0034-Syntax error at or near identifier aa (test.f90: 3)
0 inform, 0 warnings, 1 severes, 0 fatal for ed
PGF90-S-0084-Illegal use of symbol aa - not public entity of module (test.f90: 7)
0 inform, 0 warnings, 1 severes, 0 fatal for amotrim
To fix:
% cat test.f90
MODULE ed
IMPLICIT NONE
DOUBLE PRECISION :: AA(3)
! or DOUBLE PRECISION, DIMENSION(3) :: AA
END MODULE ed
Subroutine AmoTRIM
USE ed, ONLY : AA
IMPLICIT NONE
END SUBROUTINE AmoTRIM
% pgf90 -c test.f90