OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
viirs_ler_luts.f95
Go to the documentation of this file.
2 
3 !private
4 
5 public :: load_viirs_ler_luts
6 !public :: unload_viirs_ler_luts
7 
8 real, dimension(20800) :: logi0
9 real, dimension(20800) :: z1i0
10 real, dimension(20800) :: z2i0
11 real, dimension(20800) :: ti0
12 real, dimension(260) :: sb
13 real, dimension(160) :: li0r
14 real, dimension(160) :: z1i0r
15 real, dimension(160) :: z2i0r
16 real, dimension(160) :: ti0r
17 real, dimension(2) :: sbr
18 
19 real, dimension(10) :: xxzlog = (/0.0000000, 0.00977964, 0.0395086, 0.0904221, &
20 & 0.164818, 0.266515, 0.401776, 0.581261, &
21 & 0.824689, 1.17436/)
22 ! -- these numbers correspond to satellite zenith angle
23 ! -- node points of 0.,16.,30.,40.,48.,54.,58.,60. degrees
24 real, dimension(8) :: xxlog = (/0.000000,0.0395086,0.143841,0.266515,0.401776, &
25 & 0.531394,0.635031,0.693147/)
26 
27 real, dimension(10) :: xzlog
28 real, dimension(8) :: xlog
29 real, dimension(4,7) :: densol
30 real, dimension(4,5) :: denscn
31 real, dimension(4) :: cthet0
32 real, dimension(4) :: ctheta
33 real, dimension(16) :: cofs
34 integer :: indsol
35 integer :: indscn
36 integer :: iofset
37 real :: p1
38 real :: pr
39 real, dimension(10) :: dum10
40 
41 common /lpoly/ xzlog, xlog, densol, denscn, cthet0, ctheta, cofs, &
43 
44 real :: xlat
45 real :: xlong
46 real :: sza
47 real :: xthet
48 real :: xphi
49 real :: cphi
50 real :: c2phi
51 real :: pteran
52 real :: xnvalm
53 integer :: isnow
54 integer :: partial
55 real :: so2ind
56 real :: resn
57 real :: sens
58 real :: rsens
59 real :: ozbst
60 real :: ref
61 real :: estozn
62 real :: ozcld
63 real :: pcloud
64 real :: prfrac
65 real :: clfrac
66 real :: rayval
67 real :: r412
68 real :: r470
69 real :: sfref412
70 real :: sfref470
71 real :: sfref650
72 real :: qdif412
73 real :: qdif470
74 real :: qdif650
75 real :: stdv
76 
77 common /sample/ xlat,xlong,sza,xthet,xphi,cphi,c2phi,pteran, &
78 & xnvalm(6),isnow,so2ind,resn(5),sens(5), &
82 
83 real, dimension(26) :: realbuf
84 common /bufout/ realbuf
85 
86 common /table/ logi0, z1i0, z2i0, ti0, sb, li0r, z1i0r, z2i0r, ti0r, sbr
87 
88 contains
89 
90 subroutine load_viirs_ler_luts(lut_ler_file, status)
91  implicit none
92 
93  character(len=255), intent(in) :: lut_ler_file
94 
95  real :: xdenom
96  integer :: i, j, k
97  integer :: status
98 
99  open(1000, file=trim(lut_ler_file), form="unformatted", convert="big_endian", &
100  & status="old", iostat=status)
101  if (status /= 0) then
102  print *, "ERROR: Failed to open LER LUT: ", status
103  return
104  end if
105 
106  read (1000, iostat=status) logi0, z1i0, z2i0, ti0, sb
107  read (1000, iostat=status) li0r, z1i0r, z2i0r, ti0r, sbr
108  if (status /= 0) then
109  if (status > 0) then
110  print *, "ERROR: Failed to read LER LUT file: ", status
111  status = -1
112  return
113  end if
114  end if
115 
116  close(1000)
117 
118  xzlog(:) = xxzlog(:)
119  xlog(:) = xxlog(:)
120 
121 ! -- calculate values needed in table interpolation
122  do j = 1, 7
123  do k = j, j + 3
124  xdenom = 1.0
125  do i = j, j + 3
126  if (i .ne. k) xdenom = xdenom * (xzlog(k) - xzlog(i))
127  end do
128  densol(k - j + 1, j) = xdenom
129  end do
130  end do
131  do j = 1, 5
132  do k = j, j + 3
133  xdenom = 1.0
134  do i = j, j + 3
135  if (i .ne. k) xdenom = xdenom * (xlog(k) - xlog(i))
136  end do
137  denscn(k - j + 1, j) = xdenom
138  end do
139  end do
140 
141  return
142 end subroutine load_viirs_ler_luts
143 
144 integer function wrap_total() result(status)
145  implicit none
146 
147  status = 0
148  return
149 
150 end function wrap_total
151 
152 end module viirs_ler_luts
real, dimension(2) sbr
real, dimension(160) li0r
real, dimension(4, 7) densol
real, dimension(160) z1i0r
real, dimension(8) xxlog
an array had not been initialized Several spelling and grammar corrections were which is read from the appropriate MCF the above metadata values were hard coded A problem calculating the average background DN for SWIR bands when the moon is in the space view port was corrected The new algorithm used to calculate the average background DN for all reflective bands when the moon is in the space view port is now the same as the algorithm employed by the thermal bands For non SWIR changes in the averages are typically less than Also for non SWIR the black body DNs remain a backup in case the SV DNs are not available For SWIR the changes in computed averages were larger because the old which used the black body suffered from contamination by the micron leak As a consequence of the if SV DNs are not available for the SWIR the EV pixels will not be the granule time is used to identify the appropriate tables within the set given for one LUT table(e.g. m1) to be used for interpolation. The table values will be linearly interpolated using the tables corresponding to the node times bracketing the granule time. If the granule time falls before the time of the first node or after the time of the last node
real, dimension(260) sb
real, dimension(20800) z1i0
real, dimension(20800) logi0
real, dimension(10) xxzlog
real, dimension(16) cofs
real, dimension(4) ctheta
real, dimension(20800) ti0
real, dimension(10) xzlog
string & trim(string &s, const string &delimiters)
Definition: EnvsatUtil.cpp:29
real, dimension(8) xlog
real, dimension(160) ti0r
subroutine, public load_viirs_ler_luts(lut_ler_file, status)
real, dimension(26) realbuf
real, dimension(4, 5) denscn
real, dimension(4) cthet0
real, dimension(20800) z2i0
integer function wrap_total()
real, dimension(10) dum10
real, dimension(160) z2i0r