Hello guys, I got problem to run the 365days (1year) data. For every data 10min gap. thats mean got 60,000++ data i need to calculate the average temperature. I need to run a program data to read monthly average temperature in 2014 for every month. here my program:
real tair(144,63129)
real winds,windd,solarrad,ave1
integer x
character(10) :: date
character(5) :: time
character (5) :: t
open (unit=3,name=‘prnla.prn’,status=‘unknown’)
open (unit=7,name=‘result’,status=‘new’)
write (7,23)
23 format(7x,‘DAY’,2x,‘DATE’,7x,‘TIME’,3x,‘AIR-TEMP’)
n_y=365
do i=1,n_y
n_d1=144*30
do j=1,n_d1
read (3,30) date,time,tair(i,j),relh,solarrad,winds,windd
30 format (a10,3x,a5,3x,f5.2,3x,f5.2,2x,f6.2,1x,f7.5,1x,f7.3)
ave1=ave1+tair(i,j)/real(n_d1)
write(7,80) i,date,time,tair(i,j)
end do
write(7,88)ave1
80 format(3x,i5,3x,a10,2x,a5,3x,f5.2,3x,f5.2)
88 format (‘Ave1=’,f5.2)
end do
close (3)
close (7)
stop
end
the problem in my coding is the month only running for 30days a month. but cannot read in 31days. so how i wanna doing nested loop for read the 30days and 31 days a month.