I just want to read a two-column text file with variable lines into an array. The first column of the text file is time in the unit of second, and the second is temperature. Jus
Put your subroutine File2Arr inside the module MyData (and remove the use mydata line inside that subroutine). It compiled & ran for me doing that.
Alternatively to adding your subroutine File2Arr to your module MyData, you could put it also directly in your program by using the CONTAINS keyword (here you can also remove the use mydata line in the subroutine).