INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

How to obtain monthly data for each year from daily data

How to obtain monthly data for each year from daily data

How to obtain monthly data for each year from daily data

(OP)
Hi Programmer

I wrote the program to add daily data to monthly data for 30 years data but my program shows only repeated results of the first year months data for all other years. How I can overcome this problem.
Thank you in advance!


program readtextfile
real, dimension (10958,2) :: A
integer :: row, col, max_row, max_col
max_row=10958
max_col=2

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

do row=1,max_row

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

!enddo
!print*, A(1,1)
do year=1,30
sumj=0.0
start=1
end1=31
J=1
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


summ=0.0
start=end1+1
end1=start+30
do I=start,end1
summ=summ+A(I,J)
enddo

suma=0.0
start=end1+1
end1=start+29
do I=start,end1
suma=suma+A(I,J)
enddo

summy=0.0
start=end1+1
end1=start+30
do I=start,end1
summy=summy+A(I,J)
enddo

sumju=0.0
start=end1+1
end1=start+29
do I=start,end1
sumju=sumju+A(I,J)
enddo

sumjy=0.0
start=end1+1
end1=start+30
do I=start,end1
sumjy=sumjy+A(I,J)
enddo

sumag=0.0
start=end1+1
end1=start+30
do I=start,end1
sumag=sumag+A(I,J)
enddo

sums=0.0
start=end1+1
end1=start+29
do I=start,end1
sums=sums+A(I,J)
enddo

sumo=0.0
start=end1+1
end1=start+30
do I=start,end1
sumo=sumo+A(I,J)
enddo

sumn=0.0
start=end1+1
end1=start+30
do I=start,end1
sumn=sumn+A(I,J)
enddo

sumd=0.0
start=end1+1
end1=start+30
do I=start,end1
sumd=sumd+A(I,J)
enddo

!start=end1+1
!end1=start+30

enddo
print*, sumj, sumf, summ, suma, summy, sumju, sumjy, sumag, '&'
print*, sums, sumo, sumn, sumd
enddo
end

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close