OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
getcat.f
Go to the documentation of this file.
1  subroutine getcat(lucat,eptime,maxcat,smaglm,iqlimt,numcat,
2  * idncat,datcat,ierr)
3 
4 c This subroutine reads the island catalog and loads the data into
5 c output arrays. Some arguments are included for compatibility with the
6 c FDF pattern matching code but not actually used. This routine may be
7 c augmented at some later date to filter the islands according to the data
8 c limits but for now it passes all islands in the catalog.
9 
10 c Calling Arguments
11 
12 c Name Type I/O Description
13 c
14 c lucat I*4 I Unit number (not used)
15 c eptime R*8 I Epoch time (not used)
16 c maxcat I*4 I Maximum number of catalog entries
17 c smaglm R*4 I Magnitude limit (not used)
18 c iqlimt I*4 I Catalog quality limits (1=gaclac flag,
19 c 2=west flag)
20 c numcat I*4 O Number of catalog entries
21 c idncat(*) I*4 O ID numbers of catalog entries
22 c datcat(7,*) R*4 O Catalog entries (first three are unit vector
23 c components, fourth is size, last three are
24 c not used)
25 c ierr I*4 O Error code
26 
27 c Subprograms Called:
28 
29 c Program written by: Frederick S. Patt
30 c General Sciences Corporation
31 c June 13, 1994
32 c
33 c Modification History:
34 
35 
36  real*8 eptime
37  real*4 datcat(7,16000)
38  integer*4 idncat(16000),iqlimt(6)
39  character*80 filnm
40 
41  real*8 pi,radeg,re,rem,f,omf2,omegae
42  common /gconst/pi,radeg,re,rem,f,omf2,omegae
43 
44  ierr = 0
45  numcat = 0
46 
47 c Open catalog file
48  if (iqlimt(1).eq.0) then
49  filnm = '$CATALOG/islands.lac'
50  else
51  filnm = '$CATALOG/islands.gac'
52  end if
53  call filenv(filnm,filnm)
54  open(file=filnm,unit=52,status='old',iostat=istat)
55 
56 c Read and convert data
57  dowhile(.true.)
58  read(52,*,end=600) xlon,xlat,wlon,wlat
59  numcat = numcat + 1
60  idncat(numcat) = numcat
61  datcat(1,numcat) = cos(xlon/radeg)*cos(xlat/radeg)
62  datcat(2,numcat) = sin(xlon/radeg)*cos(xlat/radeg)
63  datcat(3,numcat) = sin(xlat/radeg)
64  wlon = wlon*cos(xlat/radeg)
65  datcat(4,numcat) = amax1(wlat,wlon)
66  end do
67 
68  600 close(52)
69  return
70 
71  999 write(*,*) 'Error opening catalog file'
72  return
73  end
74 
subroutine getcat(lucat, eptime, maxcat, smaglm, iqlimt, numcat, idncat, datcat, ierr)
Definition: getcat.f:3
#define real
Definition: DbAlgOcean.cpp:26
subroutine filenv(infil, outfil)
Definition: filenv.f:2
#define re
Definition: l1_czcs_hdf.c:701
#define pi
Definition: vincenty.c:23
#define omf2
Definition: l1_czcs_hdf.c:703
#define f
Definition: l1_czcs_hdf.c:702