I have recently learned how to work with basic files in Fortran and I assumed it was as simple as:
open(unit=10,file=\"data.dat\")
read(10,*) some_variable,
Thanks for all your help i did fix the code:
Function Load_Names(Staff_Name(65))!Loads Staff Names
character(len=30) :: Staff_Name(65)
integer :: i = 1
open(unit=10, file="Staff_Names.txt", status='old', action='read')!opens file for reading
do while(i < 66)!Sets Set_Name() equal to the file one string at a time
read(10,*,end=100) Staff_Name(i)
i = i + 1
end do
100 close(10)!closes file
return!returns Value
end Function Load_Names
I needed to change read(10,*)
to read(10,*,END=100)
so it knew what to do when it came to the end the file
as it was in a loop I assume.