OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
actrng.f
Go to the documentation of this file.
1  subroutine actrng(nitem, active, irange)
2 c
3 c actrng(nitem, active, irange)
4 c
5 c Purpose: find the active range of a set of flags
6 c
7 c Calling Arguments:
8 c
9 c Name Type I/O Description
10 c -------- ---- --- -----------
11 c nitem I*4 I number of items in active array
12 c active I*4 I array of active flage, 0 = active
13 c irange I*4 O size 2 start, end of active range
14 c
15 c By: W. Robinson, GSC, 1 Apr 93
16 c
17 c Notes: this will find the extremes of the active range, ie, from
18 c the first active to the last active values
19 c
20 c Modification History:
21 c
22  implicit none
23 c
24  integer*4 nitem, active(nitem), irange(2), ilin
25 c
26 c
27 c start, set range to bad, loop and find first and last
28 c
29  irange(1) = -1
30  irange(2) = -1
31 c
32  do ilin = 1, nitem
33 c
34  if( irange(1) .eq. -1 .and.
35  1 active(ilin) .eq. 0 ) irange(1) = ilin
36 c
37  if( active(ilin) .eq. 0 ) irange(2) = ilin
38 c
39  end do
40 c
41  return
42  end
subroutine actrng(nitem, active, irange)
Definition: actrng.f:2