OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
set_quality_data_module.f90
Go to the documentation of this file.
2 
3  implicit none
4 
5  contains
6 
7  subroutine set_quality_data(xsize, ysize)
8 
9  use core_arrays
11 
12  integer , intent(in) :: xsize, ysize
13 
14  integer :: i, j
15 
16  integer, parameter :: marginal = 1, good = 2, very_good = 3, no_confidence = 0
17 
18  integer*1, parameter :: no_cloud_mask = 0, no_cloud = 1, liquid = 2, &
19  ice = 3, unknown = 4, good_retrieval = 8
20 
21  do i = 1, xsize
22  do j = 1, ysize
23 
24  if (cloudsummary(i,j)%cloudmask_determined) then
25 
26  processing_information(i,j)%path_and_outcome = no_cloud
27  processing_information(i,j)%path_and_outcome_16 = no_cloud
28  processing_information(i,j)%path_and_outcome_37 = no_cloud
29  processing_information(i,j)%path_and_outcome_PCL = no_cloud
30  processing_information(i,j)%path_and_outcome_16_PCL = no_cloud
31  processing_information(i,j)%path_and_outcome_37_PCL = no_cloud
32 
33  if(cloudsummary(i,j)%watercloud) then
34  processing_information(i,j)%path_and_outcome = liquid
35  processing_information(i,j)%path_and_outcome_16 = liquid
36  processing_information(i,j)%path_and_outcome_37 = liquid
37  processing_information(i,j)%path_and_outcome_PCL = liquid
38  processing_information(i,j)%path_and_outcome_16_PCL = liquid
39  processing_information(i,j)%path_and_outcome_37_PCL = liquid
40  elseif(cloudsummary(i,j)%icecloud) then
41  processing_information(i,j)%path_and_outcome = ice
42  processing_information(i,j)%path_and_outcome_16 = ice
43  processing_information(i,j)%path_and_outcome_37 = ice
44  processing_information(i,j)%path_and_outcome_PCL = ice
45  processing_information(i,j)%path_and_outcome_16_PCL = ice
46  processing_information(i,j)%path_and_outcome_37_PCL = ice
47  elseif(cloudsummary(i,j)%unknowncloud) then
48  processing_information(i,j)%path_and_outcome = unknown
49  processing_information(i,j)%path_and_outcome_16 = unknown
50  processing_information(i,j)%path_and_outcome_37 = unknown
51  processing_information(i,j)%path_and_outcome_PCL = unknown
52  processing_information(i,j)%path_and_outcome_16_PCL = unknown
53  processing_information(i,j)%path_and_outcome_37_PCL = unknown
54  endif
55  else
56  processing_information(i,j)%path_and_outcome = no_cloud_mask
57  processing_information(i,j)%path_and_outcome_16 = no_cloud_mask
58  processing_information(i,j)%path_and_outcome_37 = no_cloud_mask
59  processing_information(i,j)%path_and_outcome_PCL = no_cloud_mask
60  processing_information(i,j)%path_and_outcome_16_PCL = no_cloud_mask
61  processing_information(i,j)%path_and_outcome_37_PCL = no_cloud_mask
62 
63  endif
64 
65  if (cloudsummary(i,j)%cloudmask_determined .and. &
66  ( cloudsummary(i,j)%ocean_surface .or. &
67  cloudsummary(i,j)%snowice_surface) ) then
68 
69  processing_information(i,j)%path_and_outcome_1621 = no_cloud
70  processing_information(i,j)%path_and_outcome_1621_PCL = no_cloud
71 
72  if(cloudsummary(i,j)%watercloud) then
73  processing_information(i,j)%path_and_outcome_1621 = liquid
74  processing_information(i,j)%path_and_outcome_1621_PCL = liquid
75  elseif(cloudsummary(i,j)%icecloud) then
76  processing_information(i,j)%path_and_outcome_1621 = ice
77  processing_information(i,j)%path_and_outcome_1621_PCL = ice
78  elseif(cloudsummary(i,j)%unknowncloud) then
79  processing_information(i,j)%path_and_outcome_1621 = unknown
80  processing_information(i,j)%path_and_outcome_1621_PCL = unknown
81  endif
82 
83  else
84  processing_information(i,j)%path_and_outcome_1621 = no_cloud_mask
85  processing_information(i,j)%path_and_outcome_1621_PCL = no_cloud_mask
86  endif
87 
88 #ifdef VIIRS_INST
89  if (processing_information(i,j)%spectral_VNSWIR_21 == 0) &
90  processing_information(i,j)%path_and_outcome = no_cloud_mask
91 #endif
92 
93  ! confidence = 11, usefulness = 1
94  if (optical_thickness_final(i,j) > 0. .and. effective_radius_21_final(i,j) > 0.) then
95  processing_information(i,j)%optical_thickness_GC = 7
96  processing_information(i,j)%effective_radius_GC = 7
97  processing_information(i,j)%water_path_GC = 7
98 
99  processing_information(i,j)%path_and_outcome = &
100  processing_information(i,j)%path_and_outcome + good_retrieval
101 
102  else
103  processing_information(i,j)%optical_thickness_GC = 0
104  processing_information(i,j)%effective_radius_GC = 0
105  processing_information(i,j)%water_path_GC = 0
106  endif
107 
108  ! confidence = 11, usefulness = 1
109  if (optical_thickness_final_pcl(i,j) > 0. .and. effective_radius_21_final_pcl(i,j) > 0.) then
110  processing_information(i,j)%optical_thickness_GC = 7
111  processing_information(i,j)%effective_radius_GC = 7
112  processing_information(i,j)%water_path_GC = 7
113 
114  processing_information(i,j)%path_and_outcome_PCL = &
115  processing_information(i,j)%path_and_outcome_PCL + good_retrieval
116  endif
117 
118 
119  ! confidence = 11, usefulness = 1
120  if (optical_thickness_1621_final(i,j) > 0. .and. effective_radius_1621_final(i,j) > 0.) then
121  processing_information(i,j)%optical_thickness_1621_GC = 7
122  processing_information(i,j)%effective_radius_1621_GC = 7
123  processing_information(i,j)%water_path_1621_GC = 7
124 
125  processing_information(i,j)%path_and_outcome_1621 = &
126  processing_information(i,j)%path_and_outcome_1621 + good_retrieval
127  else
128  processing_information(i,j)%optical_thickness_1621_GC = 0
129  processing_information(i,j)%effective_radius_1621_GC = 0
130  processing_information(i,j)%water_path_1621_GC = 0
131  endif
132 
133  ! confidence = 11, usefulness = 1
134  if (optical_thickness_1621_final_pcl(i,j) > 0. .and. effective_radius_1621_final_pcl(i,j) > 0.) then
135  processing_information(i,j)%optical_thickness_1621_GC = 7
136  processing_information(i,j)%effective_radius_1621_GC = 7
137  processing_information(i,j)%water_path_1621_GC = 7
138 
139  processing_information(i,j)%path_and_outcome_1621_PCL = &
140  processing_information(i,j)%path_and_outcome_1621_PCL + good_retrieval
141  endif
142 
143  if (optical_thickness_16_final_pcl(i,j) > 0. .and. effective_radius_16_final_pcl(i,j) > 0.) &
144  processing_information(i,j)%path_and_outcome_16_PCL = &
145  processing_information(i,j)%path_and_outcome_16_PCL + good_retrieval
146  if (optical_thickness_37_final_pcl(i,j) > 0. .and. effective_radius_37_final_pcl(i,j) > 0.) &
147  processing_information(i,j)%path_and_outcome_37_PCL = &
148  processing_information(i,j)%path_and_outcome_37_PCL + good_retrieval
149 
150  if (optical_thickness_16_final(i,j) > 0. .and. effective_radius_16_final(i,j) > 0.) &
151  processing_information(i,j)%path_and_outcome_16 = &
152  processing_information(i,j)%path_and_outcome_16 + good_retrieval
153  if (optical_thickness_37_final(i,j) > 0. .and. effective_radius_37_final(i,j) > 0.) &
154  processing_information(i,j)%path_and_outcome_37 = &
155  processing_information(i,j)%path_and_outcome_37 + good_retrieval
156 
157 
158 
159  if (processing_information(i,j)%optical_thickness_GC /= 0 .and. &
160  processing_information(i,j)%band_used_for_optical_thickness ==1 )then
161  processing_information(i,j)%rayleigh_correction = 1
162  else
163  processing_information(i,j)%rayleigh_correction = 0
164  endif
165 
166 
167 ! initialize the variable first of all. -- GW 4.6.05
168  processing_information(i,j)%multi_layer_cloud = 0
169 
170  if (cloudsummary(i,j)%cloudmask_determined) then
171 
172  if (processing_information(i,j)%path_and_outcome == 1)then ! dec.tree stop
173  processing_information(i,j)%multi_layer_cloud = 1
174 
175  elseif (processing_information(i,j)%path_and_outcome == 2 .or. &
176  processing_information(i,j)%path_and_outcome == 10 ) then ! water cloud
177  if (cloud_layer_flag(i,j) < 2 .or. ml_test_flag(i,j) == 16) then
178  processing_information(i,j)%multi_layer_cloud = 2 ! SL water
179  else
180  processing_information(i,j)%multi_layer_cloud = 3 ! ML water
181  endif
182 
183  elseif(processing_information(i,j)%path_and_outcome == 3 .or. &
184  processing_information(i,j)%path_and_outcome == 11 ) then !ice cloud
185  if (cloud_layer_flag(i,j) < 2 .or. ml_test_flag(i,j) == 16) then
186  processing_information(i,j)%multi_layer_cloud = 4 ! SL ice
187  else
188  processing_information(i,j)%multi_layer_cloud = 5 ! ML ice
189  endif
190 
191  elseif (processing_information(i,j)%path_and_outcome == 4 .or. &
192  processing_information(i,j)%path_and_outcome == 12 ) then ! unknown cloud
193  if (cloud_layer_flag(i,j) < 2 .or. ml_test_flag(i,j) == 16) then
194  processing_information(i,j)%multi_layer_cloud = 6 ! SL unknown
195  else
196  processing_information(i,j)%multi_layer_cloud = 7 ! ML unknown
197  endif
198  endif
199 
200  else
201  processing_information(i,j)%multi_layer_cloud = 0
202  endif
203 
204 ! set the information for CSR QA -- GW. 4.7.05
205  processing_information(i,j)%CSR_flag = 0
206  processing_information(i,j)%CSR_flag = csr_flag_array(i,j)
207 
208 ! set the information for the ML Test QA -- GW. 5.13.09
209  processing_information(i,j)%ml_test_mark = 0
210  processing_information(i,j)%ml_test_mark = ml_test_flag(i,j)
211 
212  enddo
213  enddo
214  end subroutine set_quality_data
215 
216  end module set_quality_data_module
integer *2, dimension(:,:), allocatable effective_radius_16_final_pcl
Definition: core_arrays.f90:47
integer *2, dimension(:,:), allocatable effective_radius_1621_final_pcl
Definition: core_arrays.f90:50
integer(integer_onebyte), dimension(:,:), allocatable cloud_layer_flag
Definition: core_arrays.f90:79
subroutine set_quality_data(xsize, ysize)
real(single), dimension(:,:), allocatable optical_thickness_37_final
Definition: core_arrays.f90:36
integer *2, dimension(:,:), allocatable optical_thickness_37_final_pcl
Definition: core_arrays.f90:45
real(single), dimension(:,:), allocatable effective_radius_37_final
Definition: core_arrays.f90:40
integer *2, dimension(:,:), allocatable effective_radius_21_final_pcl
Definition: core_arrays.f90:48
type(processflag), dimension(:,:), allocatable cloudsummary
Definition: core_arrays.f90:87
real(single), dimension(:), allocatable water_radii
integer *2, dimension(:,:), allocatable optical_thickness_16_final_pcl
Definition: core_arrays.f90:44
integer(integer_onebyte), dimension(:,:), allocatable csr_flag_array
Definition: core_arrays.f90:80
real(single), dimension(:,:), allocatable optical_thickness_final
Definition: core_arrays.f90:34
integer *2, dimension(:,:), allocatable optical_thickness_final_pcl
Definition: core_arrays.f90:43
real(single), dimension(:), allocatable ice_radii
integer *2, dimension(:,:), allocatable effective_radius_37_final_pcl
Definition: core_arrays.f90:49
integer *2, dimension(:,:), allocatable optical_thickness_1621_final_pcl
Definition: core_arrays.f90:46
integer(integer_onebyte), dimension(:,:), allocatable ml_test_flag
Definition: core_arrays.f90:79
integer number_waterradii
real(single), dimension(:,:), allocatable optical_thickness_1621_final
Definition: core_arrays.f90:37
type(qualityanalysis), dimension(:,:), allocatable processing_information
integer number_iceradii
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
real(single), dimension(:,:), allocatable effective_radius_1621_final
Definition: core_arrays.f90:41
real(single), dimension(:,:), allocatable effective_radius_21_final
Definition: core_arrays.f90:39