module myfuncts

contains

subroutine aver2d(a,avg)

real, intent(in) :: a(:,:)

real, intent(out) :: avg
integer lba(2),uba(2)
lba=lbound(a,2)
uba=ubound(a,2)
print *,"2 d u b=",uba
print *,"2 d l b=",lba
avg = sum(a)
print *,"sum=",avg
na=size(a)
print *,"na=",na
avg=avg/real(na)
end subroutine aver2d

subroutine aver1d(a,avg)

real, intent(in) :: a(:)

real, intent(out) :: avg
integer lba,uba
lba=lbound(a,1)
uba=ubound(a,1)
print *,"bounds=",lba,uba

avg = sum(a)
print *,"sum=",avg
na=size(a)
print *,"na=",na
avg=avg/real(na)

end subroutine aver1d

end module
