C+ C NAME: C ArrR4Mean C PURPOSE: C Get average of all elements in real*4 array C CALLING SEQUENCE: function ArrR4Mean(N,A,M) C INPUTS: C N integer abs(N) is # elements in A C if N < 0 then bad values in A are ignored C A(*) real array C OUTPUTS: C M integer number of elements contributing to mean C CALLS: C BadR4 C SEE ALSO: C Array_Info C- integer N real A(*) integer M double precision S !$omp parallel private(bad,I,S) bad = BadR4() S = 0.0d0 M = 0 if (N .lt. 0) then !$omp do schedule(static) do I=1,-N if (A(I) .ne. bad) then S = S+dble(A(I)) M = M+1 end if end do !$omp end do nowait else !$omp do schedule(static) do I=1,N S = S+dble(A(I)) M = M+1 end do !$omp end do nowait end if !$omp end parallel if (M .eq. 0) then ArrR4Mean = bad else ArrR4Mean = sngl(S/M) end if return end