program test4
! no dimension version with averaging 
 implicit none

 integer, parameter :: n=24
 integer            :: hour
 real               :: pres, temp, rh, u
 integer            :: i
 real*8               :: pres_m, temp_m, rh_m, u_m

  pres_m = 0 ; temp_m = 0 ; rh_m = 0 ; u_m = 0
 open(unit=10, file='SampleData.txt')

  do i=1, n
   read(10,*) hour, pres, temp, rh, u
     pres_m = pres_m + pres
     temp_m = temp_m + temp
     rh_m   = rh_m   + rh
     u_m    = u_m    + u
   
  end do
 
close(10)

   pres_m = pres_m/n
   temp_m = temp_m/n
   rh_m   = rh_m/n
   u_m    = u_m/n
write(*,*)  pres_m, temp_m, rh_m, u_m

end program test4
