OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
get_l1a_open.f
Go to the documentation of this file.
1  subroutine get_l1a_open( infile, prod_ID, npix, nlin, iret )
2 
3 c This routine opens the Level 1A HDF file and reads the attributes
4 
5  character*80 infile,bname
6  integer*4 prod_ID(2), at_id
7  integer*4 npix, nlin
8  integer*4 amode, jd, jdr
9  integer*2 iyr, idy
10  integer sfstart, sffattr, sfrattr
11  data amode/1/, jdr/2450696/
12 
13  prod_id(1) = sfstart(infile, amode)
14  if (prod_id(1).eq.-1) then
15  write(*,*)'Error opening HDF file'
16  iret = -1
17  return
18  endif
19 
20  at_id = sffattr(prod_id, 'Number of Scan Lines')
21  if (at_id.eq.-1) then
22  write(*,*)'Error getting index for Number of Scan Lines'
23  iret = -1
24  return
25  endif
26 
27  iret = sfrattr(prod_id, at_id, nlin)
28  if (iret.eq.-1) then
29  write(*,*)'Error getting value for Number of Scan Lines'
30  return
31  endif
32 
33  at_id = sffattr(prod_id, 'Pixels per Scan Line')
34  if (at_id.eq.-1) then
35  write(*,*)'Error getting index for Pixels per Scan Line'
36  iret = -1
37  return
38  endif
39 
40  iret = sfrattr(prod_id, at_id, npix)
41  if (iret.eq.-1) then
42  write(*,*)'Error getting value for Pixels per Scan Line'
43  return
44  endif
45 
46  at_id = sffattr(prod_id, 'Start Year')
47  if (at_id.eq.-1) then
48  write(*,*)'Error getting index for Start Year'
49  iret = -1
50  return
51  endif
52 
53  iret = sfrattr(prod_id, at_id, iyr)
54  if (iret.eq.-1) then
55  write(*,*)'Error getting value for Start Year'
56  return
57  endif
58 
59  at_id = sffattr(prod_id, 'Start Day')
60  if (at_id.eq.-1) then
61  write(*,*)'Error getting index for Start Day'
62  iret = -1
63  return
64  endif
65 
66  iret = sfrattr(prod_id, at_id, idy)
67  if (iret.eq.-1) then
68  write(*,*)'Error getting value for Start Day'
69  return
70  endif
71 
72  lyr = iyr
73  ldy = idy
74 
75  prod_id(2) = jd(lyr, 1, ldy) - jdr
76 
77  return
78  end
79 
80 
Definition: jd.py:1
subroutine get_l1a_open(infile, amode, prod_ID, isday, nlin, iret)
Definition: get_l1a_open.f:3