OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
ch_cld_sci.f90
Go to the documentation of this file.
1 subroutine ch_cld_sci( tdat, nv, ubdat, nubyte, i32dat, ni32, &
2  sensor_id, cloud_hgt_file )
3 !
4 ! ch_cld_sci is the entry to start the CHIMAERA processing for the 3-
5 ! line radiance (and other) input data for 1 line of data
6 !
7 ! tdat, nv Float array of all real data and the number of values
8 ! ubdat, nubyte Unsigned byte values for processing and the number of values
9 ! i32dat, ni32 integer values for processing and the number of values
10 ! sensor_id integer sensor identification number from l2gen
11 ! cloud_hgt_file string name of the cloud height file
12 !
13 ! (see below for the unpacking of these values into all inputs)
14 !
15 ! W. Robinson, SAIC, Dec 2018
16 !
17 use ch_xfr
18 implicit none
19 
20 integer :: npix, nlin, nbnd, nbnd_albedo, nlvl_model, scan, st_samp, &
21  g_year, g_day
22 common /dim_ctl/ npix, nlin, nbnd, nbnd_albedo, nlvl_model, scan, st_samp, &
23  g_year, g_day
24 integer :: nv, i,j,k, na, off, nubyte, ni32, sensor_id
25 real, dimension(nv) :: tdat
26 integer, dimension(3) :: dim_3
27 integer*1, dimension(nubyte) :: ubdat
28 integer, dimension(ni32) :: i32dat
29 character(len=500) :: cloud_hgt_file
30 
31 c2_sensor_id = sensor_id ! a global sensor name
32 
33 ! set up the l2gen values that will go into Chimaera
34 if( .not. allocated( c2_refl ) ) then
35  allocate(c2_refl(npix, nlin, nbnd))
36  allocate(c2_bnd_unc(npix, nbnd_albedo, nlin))
37  allocate(c2_spec_unc(nbnd_albedo))
38  allocate(c2_unc_sf(nbnd_albedo))
39  allocate(c2_lat(npix, nlin))
40  allocate(c2_lon(npix, nlin))
41  allocate(c2_senz(npix, nlin))
42  allocate(c2_sena(npix, nlin))
43  allocate(c2_sola(npix, nlin))
44  allocate(c2_solz(npix, nlin))
45  allocate(c2_relaz(npix, nlin))
46  allocate(c2_prof_mixr(npix,nlin,nlvl_model))
47  allocate(c2_prof_t(npix,nlin,nlvl_model))
48  allocate(c2_prof_p(npix,nlin,nlvl_model))
49  allocate(c2_prof_hgt(npix,nlin,nlvl_model))
50  allocate(c2_tsfc(npix,nlin))
51  allocate(c2_psfc(npix,nlin))
52  allocate(c2_wind(npix,nlin))
53  allocate(c2_tot_o3(npix,nlin))
54  allocate(c2_ice_frac(npix,nlin))
55  allocate(c2_snow_frac(npix,nlin))
56  allocate(c2_alt_o3(npix,nlin))
57  allocate(c2_alt_icec(npix,nlin))
58  allocate(c2_sfc_albedo(npix,nlin,5))
59  allocate(c2_sfc_lvl(npix,nlin))
60  allocate(c2_trop_lvl(npix,nlin))
61  allocate(c2_cld_det(npix,nlin))
62  allocate(c2_conf_cld(npix,nlin))
63  allocate(c2_clr_66(npix,nlin))
64  allocate(c2_clr_95(npix,nlin))
65  allocate(c2_clr_99(npix,nlin))
66  allocate(c2_sno_sfc(npix,nlin))
67  allocate(c2_wtr_sfc(npix,nlin))
68  allocate(c2_coast_sfc(npix,nlin))
69  allocate(c2_desert_sfc(npix,nlin))
70  allocate(c2_lnd_sfc(npix,nlin))
71  allocate(c2_night(npix,nlin))
72  allocate(c2_glint(npix,nlin))
73  allocate(c2_ocean_no_snow(npix,nlin))
74  allocate(c2_ocean_snow(npix,nlin))
75  allocate(c2_lnd_no_snow(npix,nlin))
76  allocate(c2_lnd_snow(npix,nlin))
77  allocate(c2_tst_h_138(npix,nlin))
78  allocate(c2_tst_vis_refl(npix,nlin))
79  allocate(c2_tst_vis_ratio(npix,nlin))
80  allocate(c2_vis_cld_250(npix,nlin))
81  allocate(c2_appl_hcld_138(npix,nlin))
82  allocate(c2_appl_vis_refl(npix,nlin))
83  allocate(c2_appl_vis_nir_ratio(npix,nlin))
84  allocate(c2_alt_snowice(npix,nlin))
85  allocate(c2_cmp_there(nbnd))
86  ! for out point diagnostics
87  allocate(prd_out_refl_loc_2100(npix,nlin,10))
88  allocate(prd_out_refl_loc_1600(npix,nlin,10))
89  allocate(prd_out_refl_loc_1621(npix,nlin,10))
90  endif
91 c2_npix = npix
92 c2_nbnd = nbnd
93 c2_nlin = nlin
94 c2_nbnd_albedo = nbnd_albedo
95 c2_nlvl_model = nlvl_model
96 c2_scan = scan
97 c2_st_samp = st_samp
98 c2_g_year = g_year
99 c2_g_day = g_day
100 !
101 ! Start with the L1b information, rads, geoloc, view angles
102 na = npix * nbnd * nlin
103 dim_3(1) = npix
104 dim_3(2) = nbnd
105 dim_3(3) = nlin
106 c2_refl = reshape( tdat(1:na), (/ npix, nbnd, nlin /) )
107 !
108 off = na
109 na = npix * nbnd_albedo * nlin
110 c2_bnd_unc = reshape( tdat(1+off:na+off), (/ npix, nbnd_albedo, nlin /) )
111 !
112 off = off + na
113 na = nbnd_albedo
114 c2_spec_unc = tdat(1+off:na+off)
115 !
116 off = off + na
117 c2_unc_sf = tdat(1+off:na+off)
118 !
119 off = off + na
120 na = npix * nlin
121 c2_lat = reshape( tdat(1+off:na+off), (/ npix, nlin /) )
122 !
123 off = off + na
124 c2_lon = reshape( tdat(1+off:na+off), (/ npix, nlin /) )
125 !
126 off = off + na
127 c2_senz = reshape( tdat(1+off:na+off), (/ npix, nlin /) )
128 !
129 off = off + na
130 c2_sena = reshape( tdat(1+off:na+off), (/ npix, nlin /) )
131 !
132 off = off + na
133 c2_sola = reshape( tdat(1+off:na+off), (/ npix, nlin /) )
134 !
135 off = off + na
136 c2_solz = reshape( tdat(1+off:na+off), (/ npix, nlin /) )
137 !
138 off = off + na
139 c2_relaz = reshape( tdat(1+off:na+off), (/ npix, nlin /) )
140 !
141 ! The met information, profiles, 2D fields
142 off = off + na
143 na = npix * nlin * nlvl_model
144 c2_prof_mixr = reshape( tdat(1+off:na+off), (/npix, nlin,nlvl_model/) )
145 !
146 off = off + na
147 c2_prof_t = reshape( tdat(1+off:na+off), (/npix, nlin,nlvl_model/) )
148 !
149 off = off + na
150 c2_prof_p = reshape( tdat(1+off:na+off), (/npix, nlin,nlvl_model/) )
151 !
152 off = off + na
153 c2_prof_hgt = reshape( tdat(1+off:na+off), (/npix, nlin,nlvl_model/) )
154 !
155 off = off + na
156 na = npix * nlin
157 c2_tsfc = reshape( tdat(1+off:na+off), (/npix, nlin/) )
158 !
159 off = off + na
160 c2_psfc = reshape( tdat(1+off:na+off), (/npix, nlin/) )
161 !
162 off = off + na
163 c2_wind = reshape( tdat(1+off:na+off), (/npix, nlin/) )
164 !
165 off = off + na
166 c2_tot_o3 = reshape( tdat(1+off:na+off), (/npix, nlin/) )
167 !
168 off = off + na
169 c2_ice_frac = reshape( tdat(1+off:na+off), (/npix, nlin/) )
170 !
171 off = off + na
172 c2_snow_frac = reshape( tdat(1+off:na+off), (/npix, nlin/) )
173 !
174 off = off + na
175 c2_alt_o3 = reshape( tdat(1+off:na+off), (/npix, nlin/) )
176 !
177 off = off + na
178 c2_alt_icec = reshape( tdat(1+off:na+off), (/npix, nlin/) )
179 !
180 off = off + na
181 c2_sfc_albedo = reshape( tdat(1+off:na*5+off), (/npix, nlin, 5/))
182 !
183 ! byte met data
184 na = npix * nlin
185 off = 0
186 c2_sfc_lvl = reshape( ubdat(1+off:na+off), (/npix, nlin/) )
187 !
188 off = off + na
189 c2_trop_lvl = reshape( ubdat(1+off:na+off), (/npix, nlin/) )
190 !
191 ! the rest are the cloud mask byte data
192 off = off + na
193 c2_cld_det = reshape( ubdat(1+off:na+off), (/npix, nlin/) )
194 !
195 off = off + na
196 c2_conf_cld = reshape( ubdat(1+off:na+off), (/npix, nlin/) )
197 !
198 off = off + na
199 c2_clr_66 = reshape( ubdat(1+off:na+off), (/npix, nlin/) )
200 !
201 off = off + na
202 c2_clr_95 = reshape( ubdat(1+off:na+off), (/npix, nlin/) )
203 !
204 off = off + na
205 c2_clr_99 = reshape( ubdat(1+off:na+off), (/npix, nlin/) )
206 !
207 off = off + na
208 c2_sno_sfc = reshape( ubdat(1+off:na+off), (/npix, nlin/) )
209 !
210 off = off + na
211 c2_wtr_sfc = reshape( ubdat(1+off:na+off), (/npix, nlin/) )
212 !
213 off = off + na
214 c2_coast_sfc = reshape( ubdat(1+off:na+off), (/npix, nlin/) )
215 !
216 off = off + na
217 c2_desert_sfc = reshape( ubdat(1+off:na+off), (/npix, nlin/) )
218 !
219 off = off + na
220 c2_lnd_sfc = reshape( ubdat(1+off:na+off), (/npix, nlin/) )
221 !
222 off = off + na
223 c2_night = reshape( ubdat(1+off:na+off), (/npix, nlin/) )
224 !
225 off = off + na
226 c2_glint = reshape( ubdat(1+off:na+off), (/npix, nlin/) )
227 !
228 off = off + na
229 c2_ocean_no_snow = reshape( ubdat(1+off:na+off), (/npix, nlin/) )
230 !
231 off = off + na
232 c2_ocean_snow = reshape( ubdat(1+off:na+off), (/npix, nlin/) )
233 !
234 off = off + na
235 c2_lnd_no_snow = reshape( ubdat(1+off:na+off), (/npix, nlin/) )
236 !
237 off = off + na
238 c2_lnd_snow = reshape( ubdat(1+off:na+off), (/npix, nlin/) )
239 !
240 off = off + na
241 c2_tst_h_138 = reshape( ubdat(1+off:na+off), (/npix, nlin/) )
242 !
243 off = off + na
244 c2_tst_vis_refl = reshape( ubdat(1+off:na+off), (/npix, nlin/) )
245 !
246 off = off + na
247 c2_tst_vis_ratio = reshape( ubdat(1+off:na+off), (/npix, nlin/) )
248 !
249 off = off + na
250 c2_vis_cld_250 = reshape( ubdat(1+off:na+off), (/npix, nlin/) )
251 !
252 off = off + na
253 c2_appl_hcld_138 = reshape( ubdat(1+off:na+off), (/npix, nlin/) )
254 !
255 off = off + na
256 c2_appl_vis_refl = reshape( ubdat(1+off:na+off), (/npix, nlin/) )
257 !
258 off = off + na
259 c2_appl_vis_nir_ratio = reshape( ubdat(1+off:na+off), (/npix, nlin/) )
260 !
261 off = off + na
262 c2_cmp_there = ubdat( 1+off:nbnd+off )
263 !
264 !
265 ! do the integer data
266 na = npix * nlin
267 c2_alt_snowice = reshape( i32dat(1:na), (/npix, nlin/) )
268 !
269 ! set a global height file name
270 c2_cloud_hgt_file = cloud_hgt_file
271 !
272 ! Here's what needs to be done:
273 ! - Make local values of the dim sizes from the common values
274 ! - Extract real arrays to correctly allocated science-familliar arrays
275 ! - call modified scienceinterface with the right stuff
276 !i = 1
277 !k = 2
278 ! init the output diagnostics
279 ! WDR this done in general_science_module already prd_out_refl_loc_2100 = -999.
280 ! WDR rewind prd_out_refl_loc_1600 = -999.
281 !prd_out_refl_loc_1600 = -999.
282 !
283 ! we zero out the L1B data and met less the center line for test purposes
284 ! and to see what needs surrounding lines
285 ! WDR out now test done call zero_surround( )
286 !
287 ! OK, segway into the chimaera code
288 call driver_mod_pr06od( )
289  return
290 end subroutine ch_cld_sci
291 
292 !
293 ! so zero_surround will just zero the values in surrounding L1b lines
294 ! (for now) mainly to test that no area data is needed in doing the
295 ! cloud work except for the cloud stuff
296 !
297 subroutine zero_surround( )
299 integer clin
300 ! get the center line
301 clin = c2_nlin / 2 + 1
302 ! reflectance
303 c2_refl(:,:,1:clin - 1) = 0.
304 c2_refl(:,:,clin + 1:c2_nlin ) = 0.
305 ! uncertainty
306 c2_bnd_unc(:,:,1:clin - 1) = 0.
307 c2_bnd_unc(:,:,1:clin + 1:c2_nlin ) = 0.
308 ! lat ** leave out - quite possibly, used for the anc (which is still
309 ! processed in the CHIMAERA code)
310 !c2_lat(:,1:clin - 1) = 0.
311 !c2_lat(:,clin + 1:c2_nlin ) = 0.
312 ! lon
313 !c2_lon(:,1:clin - 1) = 0.
314 !c2_lon(:,clin + 1:c2_nlin ) = 0.
315 ! senz
316 !c2_senz(:,1:clin - 1) = 0.
317 !c2_senz(:,clin + 1:c2_nlin ) = 0.
318 ! sena
319 !c2_sena(:,1:clin - 1) = 0.
320 !c2_sena(:,clin + 1:c2_nlin ) = 0.
321 ! solz
322 !c2_solz(:,1:clin - 1) = 0.
323 !c2_solz(:,clin + 1:c2_nlin ) = 0.
324 ! sola
325 !c2_sola(:,1:clin - 1) = 0.
326 !c2_sola(:,clin + 1:c2_nlin ) = 0.
327 ! relaz
328 !c2_relaz(:,1:clin - 1) = 0.
329 !c2_relaz(:,clin + 1:c2_nlin ) = 0.
330 end subroutine zero_surround
331 
332 subroutine get_cmp_prod( prod_num, prod_array, n_prd )
333 !
334 ! get_cmp_prod will grab the requested product from the CHIMAERA final
335 ! data arrays
336 !
337 ! prod_num integer I The l2gen-defined product ID number
338 ! prod_array real O array to carry out the line of data
339 ! n_prd integer I # of sub-products in this product, ie the product
340 ! has c2_npix pixels and n_prd sub-products
341 !
342 ! W. Robinson, SAIC, 8 Feb 2019
354  integer :: prod_num, n_prd, iprd
355  !real, dimension(c2_npix, n_prd ) :: prod_array
356  real, dimension(n_prd,c2_npix) :: prod_array
357 ! the same catalog #s defined in l2prod.h
358 integer, parameter :: CAT_Cld_p = 469, cat_cld_t = 470, cat_cer_2100 = 445
359 integer, parameter :: CAT_CER_1600 = 446, cat_cot_2100 = 447
360 integer, parameter :: CAT_COT_1600 = 448, cat_cer_1621 = 449
361 integer, parameter :: CAT_COT_1621 = 450, cat_cwp_2100 = 451
362 integer, parameter :: CAT_CWP_1621 = 452, cat_cwp_1600 = 453
363 ! these are used in the byte call get_cmp_byte()
364 !integer, parameter :: CAT_Cld_Sfc_Type = 454, CAT_Cld_Phase_2100 = 455
365 !integer, parameter :: CAT_Cld_Non_Abs_Band = 456, CAT_Cld_Phase_1600 = 457
366 !integer, parameter :: CAT_Cld_Phase_1621 = 458
367 integer, parameter :: CAT_Cld_Top_Refl_650 = 459
368 integer, parameter :: CAT_Cld_Top_Refl_860 = 460, cat_cld_top_refl_1200 = 461
369 integer, parameter :: CAT_Cld_Top_Refl_1600 = 462, cat_cld_top_refl_2100 = 463
370 integer, parameter :: CAT_Surface_Albedo_650 = 464, cat_surface_albedo_860 = 465
371 integer, parameter :: CAT_Surface_Albedo_1200 = 466
372 integer, parameter :: CAT_Surface_Albedo_1600 = 467
373 integer, parameter :: CAT_Surface_Albedo_2100 = 468
374 
375 integer, parameter :: CAT_COT_fail_2100 = 471
376 integer, parameter :: CAT_COT_fail_1600 = 472
377 integer, parameter :: CAT_COT_fail_1621 = 473
378 integer, parameter :: CAT_CER_fail_2100 = 474
379 integer, parameter :: CAT_CER_fail_1600 = 475
380 integer, parameter :: CAT_CER_fail_1621 = 476
381 integer, parameter :: CAT_CMP_fail_pct_2100 = 477
382 integer, parameter :: CAT_CMP_fail_pct_1600 = 478
383 integer, parameter :: CAT_CMP_fail_pct_1621 = 479
384 integer, parameter :: CAT_refl_loc_1600 = 480
385 integer, parameter :: CAT_refl_loc_2100 = 481
386 integer, parameter :: CAT_refl_loc_1621 = 482
387 
388 real, parameter :: bad_float = -32767.
389 !
390 ! for the product type, transfer the center line
391 !
392 select case( prod_num )
393  case( cat_cld_p )
394  prod_array( 1, : ) = cloud_top_pressure( :, c2_nlin / 2 + 1 )
395  case( cat_cld_t )
396  prod_array( 1, : ) = cloud_top_temperature( :, c2_nlin / 2 + 1 )
397  case( cat_cer_2100 )
398  prod_array( 1, : ) = effective_radius_21_final( :, c2_nlin / 2 + 1 )
399  case( cat_cer_1600 )
400  prod_array( 1, : ) = effective_radius_16_final( :, c2_nlin / 2 + 1 )
401  case( cat_cot_2100 )
402  prod_array( 1, : ) = optical_thickness_final( :, c2_nlin / 2 + 1 )
403  case( cat_cot_1600 )
404  prod_array( 1, : ) = optical_thickness_16_final( :, c2_nlin / 2 + 1 )
405  case( cat_cer_1621 )
406  prod_array( 1, : ) = effective_radius_1621_final( :, c2_nlin / 2 + 1 )
407  case( cat_cot_1621 )
408  prod_array( 1, : ) = optical_thickness_1621_final( :, c2_nlin / 2 + 1 )
409  case( cat_cwp_2100 )
410  prod_array( 1, : ) = liquid_water_path( :, c2_nlin / 2 + 1 )
411  case( cat_cwp_1621 )
412  prod_array( 1, : ) = liquid_water_path_1621( :, c2_nlin / 2 + 1 )
413  case( cat_cwp_1600 )
414  prod_array( 1, : ) = liquid_water_path_16( :, c2_nlin / 2 + 1 )
415  case( cat_cld_top_refl_650 )
416  prod_array( 1, : ) = atm_corr_refl( 1, :, c2_nlin / 2 + 1 )
417  case( cat_cld_top_refl_860 )
418  prod_array( 1, : ) = atm_corr_refl( 2, :, c2_nlin / 2 + 1 )
419  case( cat_cld_top_refl_1200 )
420  prod_array( 1, : ) = atm_corr_refl( 3, :, c2_nlin / 2 + 1 )
421  case( cat_cld_top_refl_1600 )
422  prod_array( 1, : ) = atm_corr_refl( 4, :, c2_nlin / 2 + 1 )
423  case( cat_cld_top_refl_2100 )
424  prod_array( 1, : ) = atm_corr_refl( 5, :, c2_nlin / 2 + 1 )
425  case( cat_surface_albedo_650 )
426  prod_array( 1, : ) = 0.001 * surface_albedo( :, c2_nlin / 2 + 1, 1 )
427  case( cat_surface_albedo_860 )
428  prod_array( 1, : ) = 0.001 * surface_albedo( :, c2_nlin / 2 + 1, 2 )
429  case( cat_surface_albedo_1200 )
430  prod_array( 1, : ) = 0.001 * surface_albedo( :, c2_nlin / 2 + 1, 3 )
431  case( cat_surface_albedo_1600 )
432  prod_array( 1, : ) = 0.001 * surface_albedo( :, c2_nlin / 2 + 1, 4 )
433  case( cat_surface_albedo_2100 )
434  prod_array( 1, : ) = 0.001 * surface_albedo( :, c2_nlin / 2 + 1, 5 )
435 
436  case( cat_cot_fail_2100 )
437  prod_array( 1, : ) = failure_metric( :, c2_nlin / 2 + 1 )%tau / 100.
438  case( cat_cot_fail_1600 )
439  prod_array( 1, : ) = failure_metric_16( :, c2_nlin / 2 + 1 )%tau / 100.
440  case( cat_cot_fail_1621 )
441  prod_array( 1, : ) = failure_metric_1621( :, c2_nlin / 2 + 1 )%tau / 100.
442  case( cat_cer_fail_2100 )
443  prod_array( 1, : ) = failure_metric( :, c2_nlin / 2 + 1 )%re / 100.
444  case( cat_cer_fail_1600 )
445  prod_array( 1, : ) = failure_metric_16( :, c2_nlin / 2 + 1 )%re / 100.
446  case( cat_cer_fail_1621 )
447  prod_array( 1, : ) = failure_metric_1621( :, c2_nlin / 2 + 1 )%re / 100.
448  case( cat_cmp_fail_pct_2100 )
449  prod_array( 1, : ) = failure_metric( :, c2_nlin / 2 + 1 )%RSS / 100.
450  case( cat_cmp_fail_pct_1600 )
451  prod_array( 1, : ) = failure_metric_16( :, c2_nlin / 2 + 1 )%RSS / 100.
452  case( cat_cmp_fail_pct_1621 )
453  prod_array( 1, : ) = failure_metric_1621( :, c2_nlin / 2 + 1 )%RSS / 100.
454  case( cat_refl_loc_1600 )
455  do iprd=1,n_prd
456  prod_array( iprd, :) = prd_out_refl_loc_1600( :, c2_nlin / 2 + 1, iprd )
457  end do
458  case( cat_refl_loc_2100 )
459  do iprd=1,n_prd
460  prod_array( iprd, :) = prd_out_refl_loc_2100( :, c2_nlin / 2 + 1, iprd )
461  end do
462  case( cat_refl_loc_1621 )
463  do iprd=1,n_prd
464  prod_array( iprd, :) = prd_out_refl_loc_1621( :, c2_nlin / 2 + 1, iprd )
465  end do
466  case default
467  print*, "Improper product ID, case encountered, ID:", prod_num
468  prod_array = bad_float
469  end select
470 !
471 ! set bad value to obpg standard
472 where(prod_array < -900. )
473  prod_array = bad_float
474 end where
475 return
476 end subroutine get_cmp_prod
477 
478 subroutine get_cmp_byt( prod_num, bprod )
479 !
480 ! get_cmp_byt is for all the flags / indexes of byte size
481 !
482 ! prod_num integer I The l2gen-defined product ID number
483 ! bprod integer*1 O array to carry out the line of data
484 !
485 ! W. Robinson, SAIC, 5 Aug 2019
486 use ch_xfr, only: c2_nlin, c2_npix
488 integer :: prod_num, lin_mid
489 integer*1, dimension(c2_npix) :: bprod
490 integer, parameter :: CAT_Cld_Sfc_Type = 454, cat_cld_phase_2100 = 455
491 integer, parameter :: CAT_Cld_Non_Abs_Band = 456, cat_cld_phase_1600 = 457
492 integer, parameter :: CAT_Cld_Phase_1621 = 458
493 
494 !
495 ! for the product type, transfer the center line
496 
497 lin_mid = c2_nlin / 2 + 1
498 prod_sel: select case( prod_num )
499  case( cat_cld_sfc_type )
500  bprod = 0
501  where(cloudmask(:,lin_mid)%ocean_snow == 1 ) &
502  bprod = 1
503  where(cloudmask(:,lin_mid)%land_no_snow == 1 ) &
504  bprod = 2
505  where(cloudmask(:,lin_mid)%land_snow == 1 ) &
506  bprod = 3
507  case( cat_cld_phase_2100 )
508  bprod = processing_information(:,lin_mid)%path_and_outcome
509  do i = 1, c2_npix
510  bprod(i) = ibclr( bprod(i), 3 )
511  end do
512  case( cat_cld_non_abs_band )
513  bprod = processing_information(:,lin_mid)%band_used_for_optical_thickness
514  case( cat_cld_phase_1600 )
515  bprod = processing_information(:,lin_mid)%path_and_outcome_16
516  do i = 1, c2_npix
517  bprod(i) = ibclr( bprod(i), 3 )
518  end do
519  case( cat_cld_phase_1621 )
520  bprod = processing_information(:,lin_mid)%path_and_outcome_1621
521  do i = 1, c2_npix
522  bprod(i) = ibclr( bprod(i), 3 )
523  end do
524  case default
525  print*, "Improper product ID, case encountered, ID:", prod_num
526  return
527 
528  end select prod_sel
529  return
530 end subroutine get_cmp_byt
Definition: ch_xfr.f90:1
real, dimension(:,:), allocatable c2_alt_icec
Definition: ch_xfr.f90:20
integer *1, dimension(:,:), allocatable c2_trop_lvl
Definition: ch_xfr.f90:24
real, dimension(:,:), allocatable c2_psfc
Definition: ch_xfr.f90:17
integer, dimension(:,:), allocatable c2_alt_snowice
Definition: ch_xfr.f90:25
integer *1, dimension(:,:), allocatable c2_wtr_sfc
Definition: ch_xfr.f90:29
real(single), dimension(:,:), allocatable liquid_water_path
Definition: core_arrays.f90:56
integer c2_g_year
Definition: ch_xfr.f90:44
integer *1, dimension(:,:), allocatable c2_clr_99
Definition: ch_xfr.f90:28
integer c2_nbnd_albedo
Definition: ch_xfr.f90:44
integer refl_abs
Definition: ch_xfr.f90:62
real, dimension(:,:,:), allocatable c2_prof_hgt
Definition: ch_xfr.f90:16
real, dimension(:,:,:), allocatable c2_bnd_unc
Definition: ch_xfr.f90:10
integer *1, dimension(:,:), allocatable c2_sno_sfc
Definition: ch_xfr.f90:29
real, dimension(:,:), allocatable c2_lon
Definition: ch_xfr.f90:12
type(cloudmask_type), dimension(:,:), allocatable cloudmask
integer *1, dimension(:,:), allocatable c2_appl_hcld_138
Definition: ch_xfr.f90:36
real(single), dimension(:,:), allocatable cloud_top_pressure
integer *1, dimension(:,:), allocatable c2_vis_cld_250
Definition: ch_xfr.f90:35
real, dimension(:,:), allocatable c2_sena
Definition: ch_xfr.f90:13
integer *1, dimension(:,:), allocatable c2_tst_h_138
Definition: ch_xfr.f90:34
integer *1, dimension(:,:), allocatable c2_ocean_snow
Definition: ch_xfr.f90:32
integer *1, dimension(:,:), allocatable c2_desert_sfc
Definition: ch_xfr.f90:30
integer tbl_lo_nabs_ice
Definition: ch_xfr.f90:62
real, dimension(:), allocatable c2_unc_sf
Definition: ch_xfr.f90:11
unsigned char * get_cmp_byt(l2str *l2rec, int prodnum)
Definition: get_cmp.c:118
real, dimension(:,:,:), allocatable c2_prof_mixr
Definition: ch_xfr.f90:15
real, dimension(:,:,:), allocatable prd_out_refl_loc_1600
Definition: ch_xfr.f90:60
real, dimension(:,:), allocatable c2_solz
Definition: ch_xfr.f90:13
real, dimension(:,:,:), allocatable c2_sfc_albedo
Definition: ch_xfr.f90:22
real, dimension(:,:,:), allocatable atm_corr_refl
type(failed_type), dimension(:,:), allocatable failure_metric_1621
real, dimension(:,:,:), allocatable surface_albedo
integer *1, dimension(:,:), allocatable c2_night
Definition: ch_xfr.f90:31
real, dimension(:,:), allocatable c2_lat
Definition: ch_xfr.f90:12
integer c2_nlin
Definition: ch_xfr.f90:44
real, dimension(:,:), allocatable c2_tsfc
Definition: ch_xfr.f90:17
type(failed_type), dimension(:,:), allocatable failure_metric_16
integer tbl_hi_nabs_ice
Definition: ch_xfr.f90:62
integer refl_nabs
Definition: ch_xfr.f90:62
integer *1, dimension(:,:), allocatable c2_cld_det
Definition: ch_xfr.f90:27
integer *1, dimension(:,:), allocatable c2_appl_vis_refl
Definition: ch_xfr.f90:37
real, dimension(:,:), allocatable c2_relaz
Definition: ch_xfr.f90:13
real(single), dimension(:,:), allocatable optical_thickness_final
Definition: core_arrays.f90:34
subroutine get_cmp_prod(prod_num, prod_array, n_prd)
Definition: ch_cld_sci.f90:333
integer c2_npix
Definition: ch_xfr.f90:44
real, dimension(:,:), allocatable c2_ice_frac
Definition: ch_xfr.f90:19
type(failed_type), dimension(:,:), allocatable failure_metric
integer *1, dimension(:,:), allocatable c2_tst_vis_refl
Definition: ch_xfr.f90:34
real(single), dimension(:,:), allocatable liquid_water_path_1621
Definition: core_arrays.f90:59
character(len=500) c2_cloud_hgt_file
Definition: ch_xfr.f90:54
subroutine ch_cld_sci(tdat, nv, ubdat, nubyte, i32dat, ni32, sensor_id, cloud_hgt_file)
Definition: ch_cld_sci.f90:3
integer c2_g_day
Definition: ch_xfr.f90:44
integer *1, dimension(:,:), allocatable c2_coast_sfc
Definition: ch_xfr.f90:30
integer c2_sensor_id
Definition: ch_xfr.f90:48
integer *1, dimension(:,:), allocatable c2_glint
Definition: ch_xfr.f90:31
integer *1, dimension(:,:), allocatable c2_lnd_snow
Definition: ch_xfr.f90:33
subroutine zero_surround()
Definition: ch_cld_sci.f90:298
real, dimension(:,:,:), allocatable c2_prof_p
Definition: ch_xfr.f90:16
integer tbl_hi_abs_ice
Definition: ch_xfr.f90:62
real(single), dimension(:,:), allocatable cloud_top_temperature
real, dimension(:,:,:), allocatable prd_out_refl_loc_1621
Definition: ch_xfr.f90:61
integer *1, dimension(:,:), allocatable c2_lnd_sfc
Definition: ch_xfr.f90:31
integer *1, dimension(:,:), allocatable c2_tst_vis_ratio
Definition: ch_xfr.f90:35
integer tbl_lo_abs_ice
Definition: ch_xfr.f90:62
real(single), dimension(:,:), allocatable optical_thickness_1621_final
Definition: core_arrays.f90:37
integer *1, dimension(:,:), allocatable c2_appl_vis_nir_ratio
Definition: ch_xfr.f90:38
integer *1, dimension(:,:), allocatable c2_clr_95
Definition: ch_xfr.f90:28
integer c2_scan
Definition: ch_xfr.f90:44
type(qualityanalysis), dimension(:,:), allocatable processing_information
integer tbl_lo_nabs
Definition: ch_xfr.f90:62
integer *1, dimension(:,:), allocatable c2_lnd_no_snow
Definition: ch_xfr.f90:33
real(single), dimension(:,:), allocatable liquid_water_path_16
Definition: core_arrays.f90:57
integer c2_nlvl_model
Definition: ch_xfr.f90:44
integer *1, dimension(:,:), allocatable c2_ocean_no_snow
Definition: ch_xfr.f90:32
integer *1, dimension(:,:), allocatable c2_sfc_lvl
Definition: ch_xfr.f90:24
real, dimension(:,:), allocatable c2_alt_o3
Definition: ch_xfr.f90:20
real(single), dimension(:,:), allocatable optical_thickness_16_final
Definition: core_arrays.f90:35
real(single), dimension(:,:), allocatable effective_radius_16_final
Definition: core_arrays.f90:38
integer c2_nbnd
Definition: ch_xfr.f90:44
integer tbl_hi_nabs
Definition: ch_xfr.f90:62
integer tbl_lo_abs
Definition: ch_xfr.f90:62
integer *1, dimension(:,:), allocatable c2_clr_66
Definition: ch_xfr.f90:28
integer c2_st_samp
Definition: ch_xfr.f90:44
integer tbl_hi_abs
Definition: ch_xfr.f90:62
real, dimension(:,:), allocatable c2_snow_frac
Definition: ch_xfr.f90:19
real, dimension(:,:), allocatable c2_wind
Definition: ch_xfr.f90:18
real, dimension(:,:), allocatable c2_senz
Definition: ch_xfr.f90:12
real, dimension(:,:,:), allocatable prd_out_refl_loc_2100
Definition: ch_xfr.f90:59
real, dimension(:,:,:), allocatable c2_prof_t
Definition: ch_xfr.f90:15
real(single), dimension(:,:), allocatable effective_radius_1621_final
Definition: core_arrays.f90:41
real, dimension(:,:), allocatable c2_sola
Definition: ch_xfr.f90:13
subroutine driver_mod_pr06od()
real, dimension(:), allocatable c2_spec_unc
Definition: ch_xfr.f90:11
real, dimension(:,:), allocatable c2_tot_o3
Definition: ch_xfr.f90:17
integer *1, dimension(:), allocatable c2_cmp_there
Definition: ch_xfr.f90:41
integer *1, dimension(:,:), allocatable c2_conf_cld
Definition: ch_xfr.f90:27
real, dimension(:,:,:), allocatable c2_refl
Definition: ch_xfr.f90:10
real(single), dimension(:,:), allocatable effective_radius_21_final
Definition: core_arrays.f90:39