C+ C NAME: C ArrR4Total C PURPOSE: C Get sum of all elements in real*4 array C CALLING SEQUENCE: function ArrR4Total(N,A,M) C INPUTS: C N integer # elements in array C If N < 0 then array elements C set to BadR4 are skipped C A(*) real array C OUTPUTS: C R real sum C M integer # elements contributing C to sum (if N > 0 then M=N) C CALLS: C BadR4 C SEE ALSO: C Array_Info C- integer N real A(*) real S bad = BadR4() S = 0 M = 0 if (N .gt. 0) then do I=1,N S = S+A(I) end do M = N else if (N .lt. 0) then do I=1,-N if (A(I) .ne. bad) then S = S+A(I) M = M+1 end if end do end if ArrR4Total = S return end