OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
find_all_segs.f
Go to the documentation of this file.
1  subroutine find_all_segs(ill,ilp,ilf,ist,nsegs,jll,jlp,nj)
2 
3 c This subroutine finds all contiguous segments in a list of segments
4 c from a specified starting point. For each contiguous segment found,
5 c the list is searched for additional contiguous segments until no more
6 c are found or the list is exhausted.
7 
8 c Calling Arguments
9 
10 c Name Type I/O Description
11 c
12 c ill(*) I*4 I Array of segment line numbers
13 c ilp(2,*) I*4 I Array of segment endpoint pixel numbers
14 c ilf(*) I*4 I Array of flags (1=segment already checked)
15 c ist I*4 I Starting point in list
16 c nsegs I*4 I Number of segments in list
17 c jll(*) I*4 I/O Array of contiguous segment line numbers
18 c jlp(2,*) I*4 I/O Array of contiguous segment end pixel numbers
19 c nj I*4 O Number of contiguous segments found
20 
21 c Subprograms Called:
22 
23 c find_segs Find segments in list adjacent to one segment
24 
25 
26 c Program written by: Frederick S. Patt
27 c General Sciences Corporation
28 c April 17, 1994
29 c
30 c Modification History:
31 
32  integer*4 ill(*),ilp(2,*),ilf(*)
33  integer*4 jll(*),jlp(2,*)
34  integer*4 iln(10)
35  logical end
36 
37  ij = 1
38  nj = 1
39 
40  dowhile(ij.le.nj)
41 
42 c Find segments contiguous to each segment
43  call find_segs(ill,ilp,ilf,ist,nsegs,jll(ij),jlp(1,ij),iln,nln)
44 
45 c If more continguous segments found, add to list
46  if(nln.gt.0) then
47  do i=1,nln
48  ilf(iln(i)) = 1
49  nj = nj + 1
50  jll(nj) = ill(iln(i))
51  jlp(1,nj) = ilp(1,iln(i))
52  jlp(2,nj) = ilp(2,iln(i))
53  end do
54  end if
55  ij = ij + 1
56 
57  end do
58 
59  return
60  end
subroutine find_all_segs(ill, ilp, ilf, ist, nsegs, jll, jlp, nj)
Definition: find_all_segs.f:2
subroutine find_segs(ill, ilp, ilf, i1, imax, jll, jlp, iln, nln)
Definition: find_segs.f:2