Just a remark: It seems that the return value number_of_files is not initialised in the routine files@. It would be nice to set this value to zero just at the beginning of the routine:
program test
IMPLICIT NONE
integer*2 M_1(1000)
integer*4 M_2(1000)
integer*4 nof ! number_of_files
character*120 afile(1000)
character*120 string
string = '*.xxx'
call files@(string,nof,1000L,afile,M_1,M_1,M_1,M_2)
print*,nof
end
Regards - Wilfried