Commit 68c282b8 authored by Sebastian Müller's avatar Sebastian Müller 🐈
Browse files

mo_eckhardt_filter: skip mean calc if no values in mask

parent c63da6c0
Pipeline #87736 failed with stages
in 8 minutes and 22 seconds
......@@ -168,12 +168,13 @@ contains
if ( present(mask) ) mask_ = mask
allocate(d7(size(discharge)))
d7(:) = 0.0_dp
do i = 1, size(discharge)
n = max(1,i-3)
m = min(size(discharge),i+3)
! TODO: do we need a threshold for number in mask here?
d7(i) = mean(discharge(n : m), mask=mask_(n : m))
if ( any(mask_(n : m)) ) d7(i) = mean(discharge(n : m), mask=mask_(n : m))
end do
end function weekly_average
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment