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
19 real,
dimension(10) :: xxzlog = (/0.0000000, 0.00977964, 0.0395086, 0.0904221, &
20 & 0.164818, 0.266515, 0.401776, 0.581261, &
24 real,
dimension(8) :: xxlog = (/0.000000,0.0395086,0.143841,0.266515,0.401776, &
25 & 0.531394,0.635031,0.693147/)
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
39 real,
dimension(10) :: dum10
41 common /lpoly/ xzlog, xlog, densol, denscn, cthet0, ctheta, cofs, &
42 & indsol, indscn, iofset, p1, pr, dum10
77 common /sample/ xlat,xlong,sza,xthet,xphi,cphi,c2phi,pteran, &
78 & xnvalm(6),isnow,so2ind,resn(5),sens(5), &
79 & rsens,ozbst,ref,estozn,ozcld,pcloud,prfrac,clfrac,partial, &
80 & rayval(5),r412,r470,sfref412,sfref470,sfref650,qdif412, &
81 & qdif470,qdif650, stdv
83 real,
dimension(26) :: realbuf
84 common /bufout/ realbuf
86 common /
table/ logi0, z1i0, z2i0, ti0, sb, li0r, z1i0r, z2i0r, ti0r, sbr
95 character(len=255),
intent(in) :: lut_ler_file
101 character(len=255) :: sds_name
102 integer :: sd_id, sds_id, sds_index
103 integer,
dimension(1) :: start1, stride1, dims1
104 integer,
dimension(32):: dimids
105 integer :: rank, dtype, nattrs
112 character(len=255) :: dset_name
113 character(len=255) :: attr_name
114 character(len=255) :: group_name
115 character(len=255) :: err_msg
117 status = nf90_open(
trim(lut_ler_file), nf90_nowrite, nc_id)
118 if (status /= nf90_noerr)
then
119 print *,
"ERROR: Failed to open deepblue lut_nc4 file: ", status
123 group_name =
'LER_TABLES'
124 status = nf90_inq_ncid(nc_id, group_name, grp_id)
125 if (status /= nf90_noerr)
then
126 print *,
"ERROR: Failed to get ID of group "//
trim(group_name)//
": ", status
134 status = nf90_inq_varid(grp_id, dset_name, dset_id)
135 if (status /= nf90_noerr)
then
136 print *,
"ERROR: Failed to get ID of dataset "//
trim(dset_name)//
": ", status
139 status = nf90_inquire_variable(grp_id, dset_id, dimids=dimids)
140 status = nf90_inquire_dimension(grp_id, dimids(1), len = dims1(1))
141 status = nf90_get_var(grp_id, dset_id, logi0, start=start1, &
142 stride=stride1, count=dims1)
143 err_msg = nf90_strerror(status)
144 if (status /= nf90_noerr)
then
145 print *,
"ERROR: Failed to read dataset "//
trim(dset_name)//
": ", status
150 status = nf90_inq_varid(grp_id, dset_name, dset_id)
151 if (status /= nf90_noerr)
then
152 print *,
"ERROR: Failed to get ID of dataset "//
trim(dset_name)//
": ", status
155 status = nf90_inquire_variable(grp_id, dset_id, dimids=dimids)
156 status = nf90_inquire_dimension(grp_id, dimids(1), len = dims1(1))
157 status = nf90_get_var(grp_id, dset_id, z1i0, start=start1, &
158 stride=stride1, count=dims1)
159 err_msg = nf90_strerror(status)
160 if (status /= nf90_noerr)
then
161 print *,
"ERROR: Failed to read dataset "//
trim(dset_name)//
": ", status
166 status = nf90_inq_varid(grp_id, dset_name, dset_id)
167 if (status /= nf90_noerr)
then
168 print *,
"ERROR: Failed to get ID of dataset "//
trim(dset_name)//
": ", status
171 status = nf90_inquire_variable(grp_id, dset_id, dimids=dimids)
172 status = nf90_inquire_dimension(grp_id, dimids(1), len = dims1(1))
173 status = nf90_get_var(grp_id, dset_id, z2i0, start=start1, &
174 stride=stride1, count=dims1)
175 err_msg = nf90_strerror(status)
176 if (status /= nf90_noerr)
then
177 print *,
"ERROR: Failed to read dataset "//
trim(dset_name)//
": ", status
182 status = nf90_inq_varid(grp_id, dset_name, dset_id)
183 if (status /= nf90_noerr)
then
184 print *,
"ERROR: Failed to get ID of dataset "//
trim(dset_name)//
": ", status
187 status = nf90_inquire_variable(grp_id, dset_id, dimids=dimids)
188 status = nf90_inquire_dimension(grp_id, dimids(1), len = dims1(1))
189 status = nf90_get_var(grp_id, dset_id, ti0, start=start1, &
190 stride=stride1, count=dims1)
191 err_msg = nf90_strerror(status)
192 if (status /= nf90_noerr)
then
193 print *,
"ERROR: Failed to read dataset "//
trim(dset_name)//
": ", status
198 status = nf90_inq_varid(grp_id, dset_name, dset_id)
199 if (status /= nf90_noerr)
then
200 print *,
"ERROR: Failed to get ID of dataset "//
trim(dset_name)//
": ", status
203 status = nf90_inquire_variable(grp_id, dset_id, dimids=dimids)
204 status = nf90_inquire_dimension(grp_id, dimids(1), len = dims1(1))
205 status = nf90_get_var(grp_id, dset_id, sb, start=start1, &
206 stride=stride1, count=dims1)
207 err_msg = nf90_strerror(status)
208 if (status /= nf90_noerr)
then
209 print *,
"ERROR: Failed to read dataset "//
trim(dset_name)//
": ", status
214 status = nf90_inq_varid(grp_id, dset_name, dset_id)
215 if (status /= nf90_noerr)
then
216 print *,
"ERROR: Failed to get ID of dataset "//
trim(dset_name)//
": ", status
219 status = nf90_inquire_variable(grp_id, dset_id, dimids=dimids)
220 status = nf90_inquire_dimension(grp_id, dimids(1), len = dims1(1))
221 status = nf90_get_var(grp_id, dset_id, li0r, start=start1, &
222 stride=stride1, count=dims1)
223 err_msg = nf90_strerror(status)
224 if (status /= nf90_noerr)
then
225 print *,
"ERROR: Failed to read dataset "//
trim(dset_name)//
": ", status
230 status = nf90_inq_varid(grp_id, dset_name, dset_id)
231 if (status /= nf90_noerr)
then
232 print *,
"ERROR: Failed to get ID of dataset "//
trim(dset_name)//
": ", status
235 status = nf90_inquire_variable(grp_id, dset_id, dimids=dimids)
236 status = nf90_inquire_dimension(grp_id, dimids(1), len = dims1(1))
237 status = nf90_get_var(grp_id, dset_id, z1i0r, start=start1, &
238 stride=stride1, count=dims1)
239 err_msg = nf90_strerror(status)
240 if (status /= nf90_noerr)
then
241 print *,
"ERROR: Failed to read dataset "//
trim(dset_name)//
": ", status
246 status = nf90_inq_varid(grp_id, dset_name, dset_id)
247 if (status /= nf90_noerr)
then
248 print *,
"ERROR: Failed to get ID of dataset "//
trim(dset_name)//
": ", status
251 status = nf90_inquire_variable(grp_id, dset_id, dimids=dimids)
252 status = nf90_inquire_dimension(grp_id, dimids(1), len = dims1(1))
253 status = nf90_get_var(grp_id, dset_id, z2i0r, start=start1, &
254 stride=stride1, count=dims1)
255 err_msg = nf90_strerror(status)
256 if (status /= nf90_noerr)
then
257 print *,
"ERROR: Failed to read dataset "//
trim(dset_name)//
": ", status
262 status = nf90_inq_varid(grp_id, dset_name, dset_id)
263 if (status /= nf90_noerr)
then
264 print *,
"ERROR: Failed to get ID of dataset "//
trim(dset_name)//
": ", status
267 status = nf90_inquire_variable(grp_id, dset_id, dimids=dimids)
268 status = nf90_inquire_dimension(grp_id, dimids(1), len = dims1(1))
269 status = nf90_get_var(grp_id, dset_id, ti0r, start=start1, &
270 stride=stride1, count=dims1)
271 err_msg = nf90_strerror(status)
272 if (status /= nf90_noerr)
then
273 print *,
"ERROR: Failed to read dataset "//
trim(dset_name)//
": ", status
278 status = nf90_inq_varid(grp_id, dset_name, dset_id)
279 if (status /= nf90_noerr)
then
280 print *,
"ERROR: Failed to get ID of dataset "//
trim(dset_name)//
": ", status
283 status = nf90_inquire_variable(grp_id, dset_id, dimids=dimids)
284 status = nf90_inquire_dimension(grp_id, dimids(1), len = dims1(1))
285 status = nf90_get_var(grp_id, dset_id, sbr, start=start1, &
286 stride=stride1, count=dims1)
287 err_msg = nf90_strerror(status)
288 if (status /= nf90_noerr)
then
289 print *,
"ERROR: Failed to read dataset "//
trim(dset_name)//
": ", status
293 status = nf90_close(nc_id)
294 if (status /= nf90_noerr)
then
295 print *,
"ERROR: Failed to close lut_nc4 file: ", status
307 if (i .ne. k) xdenom = xdenom * (xzlog(k) - xzlog(i))
309 densol(k - j + 1, j) = xdenom
316 if (i .ne. k) xdenom = xdenom * (xlog(k) - xlog(i))
318 denscn(k - j + 1, j) = xdenom