Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to calculate monthly average for daily data for an array

Status
Not open for further replies.

ZSH

Technical User
Jul 9, 2016
2
KR
program readtextfile
real, dimension (14244,2) :: A
integer :: row, col, max_row, max_col
max_row=14244
max_col=2

open(2,file='MET0001432_1.txt',status='old')

do row=1,max_row

read(2,*) (A(row,col), col=1,max_col)

!enddo
!print*, A(1,1)
sumj=0.0
start=1
end1=31
J=2
do I=start, end1
sumj=sumj+A(I,J)
enddo
sumf=0.0
start=end1+1
end1=start+27
do I=start,end1
sumf=sumf+A(I,J)
enddo
enddo
print*, sumj, sumf
end
Is this right appraoch to calculate monthly average for daily data.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top