OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
modis_frontend_module.f90
Go to the documentation of this file.
2 
3  implicit none
4 
5  !include "hdf.f90"
6  !include "dffunc.f90"
7 
8  private
9 
10  integer :: index_solarzenith, index_sensorzenith,&
11  index_relativeazimuth,index_solarzenith_flux
12 
13  real, dimension(:), allocatable :: solarzenith_all, sensorzenith_all, &
14  relativeazimuth_all, solarzenith_flux_all
15 
16 
19 
20 
21 
22  contains
23 
24  subroutine initialize_run( start, edge, stride, &
25  tilesize, &
26  threshold_solar_zenith, &
27  threshold_sensor_zenith, &
28  threshold_relative_azimuth, &
29  status )
30  ! WDR
31  ! tilesize O the size of the data block to process - in case of MODIS,
32  ! AVHRR, it is edge (1) the # pixels?
33  !
34  use core_arrays
37  use names
39  use specific_other
40 
41  implicit none
42 
43 
44  integer, intent (out) :: status, tilesize
45 
46  real, intent(out) :: threshold_solar_zenith, &
47  threshold_sensor_zenith, &
48  threshold_relative_azimuth
49 
50  integer, dimension (2), intent (out) :: start,edge,stride
51 
52  integer :: number_of_bands, index, file_version, localstatus
53 
54 
55 ! function definitions
56  ! WDR integer get_platform_name
57  ! WDR external get_platform_name
58 
59  status = 0
60 
61  ! WDR only set the name to Aqua
62  platform_name = "Aqua"
63  !localstatus = get_platform_name(Alevel1b_name(1), platform_name)
64 
65  call get_channels
66 
67  ! WDR remove these entirely
68  !if (platform_name == "RSP" .or. platform_name == "SSFR") then
69  ! call get_data_dims(Alevel1b_name(1), start, stride, edge)
70  !else
71  ! call get_data_dims(Amod06_name, start, stride, edge)
72  !endif
73 
74  threshold_solar_zenith = set_threshold_solar_zenith
75  threshold_sensor_zenith = set_threshold_sensor_zenith
76  threshold_relative_azimuth = set_threshold_relative_azimuth
77 
78 ! print*, size(Alevel1b_name)
79 
80 #ifdef VIIRS_INST
81  if (modis_mode) then
82  tilesize = set_tilesize_modis
83  number_of_bands = size(set_bands_modis)
84  allocate(bands(number_of_bands))
85  bands(:) = set_bands_modis(:)
86  channel_37um = set_bands_modis(band_0370)
87  channel_11um = set_bands_modis(band_1100)
88  channel_12um = set_bands_modis(band_1200)
89  else
90  tilesize = set_tilesize
91  number_of_bands = size(set_bands)
92  allocate(bands(number_of_bands))
93  bands(:) = set_bands(:)
97  endif
98 #else
99 
100  if (platform_name == "RSP" .or. platform_name == "SSFR") then
101  tilesize = edge(1)
102  else
103  tilesize = set_tilesize
104  endif
105  number_of_bands = size(set_bands)
106  ! WDR re-entrant
107  if( .not. allocated(bands) ) allocate(bands(number_of_bands))
108  bands(:) = set_bands(:)
109 
110 #endif
111 
112  end subroutine initialize_run
113 
114  subroutine check_datasources(status)
115 
117  use names
118  use ch_xfr, only : cm_from_l2
119  implicit none
120 
121  integer, intent(out) :: status
122  integer :: i, allstatus
123 
124  status = 0
125  allstatus = 0
126 
127 ! WDR remove this check
128 ! allstatus = checkfile(Alevel1b_name(1))
129 ! if (allstatus /= success) then
130 ! status = failure
131 ! call local_message_handler ('Error noted: level 1B file. Check input.' ,status, 'check_datasources')
132 ! return
133 ! endif
134 !
135 ! WDR only use work file if instructed
136 ! WDR out forever, I think
137 ! if ( cm_from_l2 .EQ. 0 ) THEN
138 ! allstatus = checkfile(Acloudmask_name)
139 ! if (allstatus /= success) then
140 ! status = failure
141 ! call local_message_handler ('Error noted: cloud mask file. Check input.', status,'check_datasources')
142 ! return
143 ! endif
144 ! END IF
145 ! WDR remove this check
146 ! allstatus = checkfile(Ageolocation_name)
147 ! if (allstatus /= success) then
148 ! status = failure
149 ! call local_message_handler ('Error noted: geolocation file. Check input.' ,status,'check_datasources')
150 ! return
151 ! endif
152 
153 #ifdef GEOS5
154 #ifndef SSFR_INST
155  allstatus = checkfile(ageos3d_name1)
156  if (allstatus /= success) then
157  status = failure
158  call local_message_handler ('Error noted: first GEOS5 3D file. Check input.' ,status, 'check_datasources')
159  return
160  endif
161  allstatus = checkfile(ageos3d_name2)
162  if (allstatus /= success) then
163  status = failure
164  call local_message_handler ('Error noted: second GEOS5 3D file. Check input.' ,status, 'check_datasources')
165  return
166  endif
167 
168  allstatus = checkfile(ageos2d_name1)
169  if (allstatus /= success) then
170  status = failure
171  call local_message_handler ('Error noted: first GEOS5 2D file. Check input.' ,status, 'check_datasources')
172  return
173  endif
174  allstatus = checkfile(ageos2d_name2)
175  if (allstatus /= success) then
176  status = failure
177  call local_message_handler ('Error noted: second GEOS5 2D file. Check input.' ,status, 'check_datasources')
178  return
179  endif
180 #endif
181 #else
182 ! WDR remove this check
183 ! allstatus = checkfile(Agdas_name)
184 ! if (allstatus /= success) then
185 ! status = failure
186 ! call local_message_handler ('Error noted: first GDAS file. Check input.' , status, 'check_datasources')
187 ! return
188 ! endif
189 ! WDR remove this check
190 ! allstatus = checkfile(Agdas_name2)
191 ! if (allstatus /= success) then
192 ! status = failure
193 ! call local_message_handler ('Error noted: second GDAS file. Check input.' ,status, 'check_datasources')
194 ! return
195 ! endif
196 #endif
197 
198 ! WDR remove this check
199 ! allstatus = checkfile(Ancepice_name)
200 ! if (allstatus /= success) then
201 ! status = failure
202 ! call local_message_handler ('Error noted: NCEP Ice file. Check input.' ,status, 'check_datasources')
203 ! return
204 ! endif
205 
206 #ifdef USE_TOAST
207  allstatus = checkfile(aozone_name)
208  if (allstatus /= success) then
209  status = failure
210  call local_message_handler ('Error noted: TOAST ozone file. Check input.' ,status, 'check_datasources')
211  return
212  endif
213 #endif
214 
215 ! WDR remove this check
216 ! allstatus = checkfile(Anise_name)
217 ! if (allstatus /= success) then
218 ! status = failure
219 ! call local_message_handler ('Error noted: NISE file. Check input.' , status, 'check_datasources')
220 ! return
221 ! endif
222 
223 ! WDR remove this check
224 ! allstatus = checkfile(Amod06_name)
225 ! if (allstatus /= success) then
226 ! status = failure
227 ! call local_message_handler ('Error noted: MOD06_L2 file. Check input.' , status, 'check_datasources')
228 ! return
229 ! endif
230  allstatus = checkfile(awater_library)
231  if (allstatus /= success) then
232  status = failure
233  call local_message_handler ('Error noted: Lambertian water library file. Check input.' , status, 'check_datasources')
234  return
235  endif
236 
237  allstatus = checkfile(aice_library)
238  if (allstatus /= success) then
239  status = failure
240  call local_message_handler ('Error noted: Lambertian ice library file. Check input.' ,status, 'check_datasources')
241  return
242  endif
243  allstatus = checkfile(atransmittance_library)
244  if (allstatus /= success) then
245  status = failure
246  call local_message_handler ('Error noted: transmittance file. Check input.' , status, 'check_datasources')
247  return
248  endif
249  allstatus = checkfile(aecosystem_data_name)
250  if (allstatus /= success) then
251  status = failure
252  call local_message_handler ('Error noted: IGBP Ecosystem file. Check input.' ,status, 'check_datasources')
253  return
254  endif
255  allstatus = checkfile(asnowicealbedo_data_name)
256  if (allstatus /= success) then
257  status = failure
258  call local_message_handler ('Error noted: Static SnowIce Albedo file. Check input.' ,status, 'check_datasources')
259  return
260  endif
261  allstatus = checkfile(aphase_library)
262  if (allstatus /= success) then
263  status = failure
264  call local_message_handler ('Error noted: phase library file. Check input.' ,status, 'check_datasources')
265  return
266  endif
267 
268  do i=1, 3
269  allstatus = checkfile(alibnames_water(i))
270  if (allstatus /= success) then
271  status = failure
272  call local_message_handler ('Error noted: Cox-Munk water library file. Check input.' , status, 'check_datasources')
273  return
274  endif
275  allstatus = checkfile(alibnames_water_sdev(i))
276  if (allstatus /= success) then
277  status = failure
278  call local_message_handler ('Error noted: Cox-Munk water sdev library file. Check input.' ,status, 'check_datasources')
279  return
280  endif
281  allstatus = checkfile(alibnames_ice(i))
282  if (allstatus /= success) then
283  status = failure
284  call local_message_handler ('Error noted: Cox-Munk ice library file. Check input.' ,status, 'check_datasources')
285  return
286  endif
287  allstatus = checkfile(alibnames_ice_sdev(i))
288  if (allstatus /= success) then
289  status = failure
290  call local_message_handler ('Error noted: Cox-Munk ice sdev library file. Check input.' ,status, 'check_datasources')
291  return
292  endif
293 
294  end do
295 
296  allstatus = checkfile(aemissivity_name)
297  if (allstatus /= success) then
298  status = failure
299  call local_message_handler ('Error noted: emissivity library file. Check input.' , status, 'check_datasources')
300  return
301  endif
302 
303 
304 ! if (Alevel1b_name(2) /= "none" ) then
305 ! allstatus = checkfile(Alevel1b_name(2))
306 ! if (allstatus /= success) then
307 ! status = failure
308 ! call local_message_handler ('Error noted: additional level 1B file. Check input.' , status, 'check_datasources')
309 ! return
310 ! endif
311 ! endif
312 
313  end subroutine check_datasources
314 
315  integer function checkfile(name)
316 
317  implicit none
318 
319  character(*), intent(in) :: name
320  logical :: exist
321  character(len=11) :: readability
322 
323  checkfile = 0
324 
325  inquire( file = name, &
326  exist= exist, &
327  read = readability)
328 
329  if (.not. exist) then
330  checkfile = 1
331  endif
332  if (readability == 'NO') then
333  checkfile = 2
334  endif
335  end function checkfile
336 
337 
338 
339 ! this subroutine returns the needed array bounds for a resized array
340  subroutine find_bounds(array, min_val, max_val, min_bnd, max_bnd)
341 
342  implicit none
343 
344  real, dimension(:), intent(in) :: array
345  real, intent(in) :: min_val, max_val
346  integer, intent(inout) :: min_bnd, max_bnd
347 
348  integer :: i, n
349 
350  n = size(array)
351 
352  do i=1, n
353  if (array(i) >= min_val) then
354  min_bnd = i-1
355  exit
356  endif
357  end do
358 
359  if (min_bnd < 1) min_bnd = 1
360  if (min_bnd > n) min_bnd = n
361 
362  do i=1, n
363  if (array(i) >= max_val) then
364  max_bnd = i
365  exit
366  endif
367  end do
368 
369  if (max_bnd >= n) max_bnd = n
370  if (max_bnd <= 1) max_bnd = 1
371 
372  end subroutine find_bounds
373 
374 !-----------------------------------------------------------------------
375 !f90 readlibraries
376 !
377 !Description:
378 !
379 ! Read bidirectional reflectance and flux library values for all
380 ! angles, as defined in a library description file. Library arrays
381 ! are allocated as required to read all library data.
382 !
383 !input parameters:
384 !
385 !output parameters:
386 !
387 !revision history:
388 !
389 ! v2.1 July 2002 arrays are now allocated to only include the angles
390 ! needed.
391 !
392 ! v2.0 June 2002 Changed the read routines to work with the HDF
393 ! version of the libraries. -- Gala. wind@climate.gsfc.nasa.gov
394 !
395 ! v1.0 November 2001 Initial work mag gray@climate.gsfc.nasa.gov
396 !
397 !team-unique header:
398 !
399 ! Cloud Retrieval Group, NASA GSFC, Greenbelt, Maryland, USA
400 !
401 !references and credits:
402 !
403 ! Mark Gray
404 ! gray@climate.gsfc.nasa.gov
405 ! EmergentIT
406 ! Code 913, NASA GSFC
407 ! Greenbelt, MD 20771
408 !
409 ! Gala Wind
410 ! wind@climate.gsfc.nasa.gov
411 ! L-3 Comm Analytics
412 ! all same, all same
413 !
414 !design note:
415 !
416 !end
417 !----------------------------------------------------------------------
418 
419  subroutine readlibraries_base(debug,status)
420 
421  use generalauxtype
422  use libraryarrays
428  implicit none
429 
430  logical, intent(in) :: debug
431  integer,intent (out) :: status
432 
433  integer :: file_id, var_id, var_index,i, j
434  integer :: start(6), stride(6), edge(6)
435  character(MAX_SDS_NAME_LEN) :: dummy_name
436  integer :: dummy_type, dummy_num_attr, dummy_rank
437  integer :: dim_sizes(6),dim_sizes4d(4)
438 
439  ! WDR I havd replaced the more extensive sf... HDF 4 I/O with a targeted
440  ! set of c wrappers, removing the need to have the sf library that OCSSW
441  ! doesn't want (not sure why - it looks minimal, anyway...)
442  ! I have ! WDR comments on 1st uses - the rest are just replace
443  integer c_sfstart
444  external c_sfstart
445  integer c_sfselect
446  external c_sfselect
447  integer c_sfn2index
448  external c_sfn2index
449  integer c_sfginfo
450  external c_sfginfo
451  integer c_sfrdata
452  external c_sfrdata
453  integer c_sfendacc
454  external c_sfendacc
455  integer c_sfend
456  external c_sfend
457  integer :: dfacc_read = 1
458 
459  status = 0
460 
461 ! WDR try to read this only if the allocated array is not allocated
462  if( allocated( transmit_correction_table ) ) then
463  status = 0
464  return
465  endif
466 
467 ! read transmittance correction library
468 
469  start = 0
470  stride = 1
471 
472  ! WDR file_id = sfstart(Atransmittance_library, DFACC_READ)
473  file_id = c_sfstart(atransmittance_library, dfacc_read)
474  ! WDR var_id = sfselect(file_id, sfn2index(file_id, "Transmittance"))
475  var_id = c_sfselect(file_id, c_sfn2index(file_id, "Transmittance"))
476 
477  ! WDR status = sfginfo(var_id, dummy_name, dummy_rank, &
478  ! dim_sizes, dummy_type, dummy_num_attr)
479  status = c_sfginfo(var_id, dummy_name, dummy_rank, &
480  dim_sizes, dummy_type, dummy_num_attr)
481 
482  edge(1:4) = dim_sizes(1:4)
483 
484  allocate(transmit_correction_table(edge(1), edge(2), edge(3), edge(4)))
485  allocate(transmit_stddev_table(edge(1), edge(2), edge(3), edge(4)))
486 
487  ! WDR status = sfrdata(var_id, start(1:4),stride(1:4),edge(1:4), transmit_correction_table)
488  status = c_sfrdata(var_id, start(1:4),stride(1:4),edge(1:4), transmit_correction_table)
489  ! WDR status = sfendacc(var_id)
490  status = c_sfendacc(var_id)
491 
492  var_id = c_sfselect(file_id, c_sfn2index(file_id, "Standard_Deviation"))
493  status = c_sfrdata(var_id, start(1:4),stride(1:4),edge(1:4), transmit_stddev_table)
494  status = c_sfendacc(var_id)
495 
496  ! WDR status = sfend(file_id)
497  status = c_sfend(file_id)
498 
499 
500 
501 ! we need to find angle range for the granule, so we can only read a limited amount from the library
502 ! just enough to get the granule processed.
503 
504 ! from the find_granule_angle_range routine we know just how wide the angle space we need.
505 ! it's fixed for sensor zenith and relative azimuth, but not for solar angle. However for MAS<TER>
506 ! the relative azimuth space isn't fixed either and the sensor zenith limits are different.
507 
508 
510 
511 ! start with the ice library first
512  file_id = c_sfstart(aice_library, dfacc_read)
513 
514 ! get the number of wavelengths, we never use them, so we don't need to actually read them.
515  var_id = c_sfselect(file_id, c_sfn2index(file_id, "Wavelengths"))
516  status = c_sfginfo(var_id, dummy_name, dummy_rank, dim_sizes, dummy_type, dummy_num_attr)
517  number_wavelengths = dim_sizes(1)
518  status = c_sfendacc(var_id)
519 
520  start = 0
521  stride = 1
522 
523 ! get the radii
524  var_id = c_sfselect(file_id, c_sfn2index(file_id, "ParticleRadius"))
525  status = c_sfginfo(var_id, dummy_name, dummy_rank, dim_sizes, dummy_type, dummy_num_attr)
526  number_iceradii = dim_sizes(1)
527  allocate (ice_radii(number_iceradii))
528  edge(1) = number_iceradii
529  status = c_sfrdata(var_id, start(1:1), stride(1:1), edge(1:1), ice_radii)
530  status = c_sfendacc(var_id)
531 
532  ! get the taus
533  var_id = c_sfselect(file_id, c_sfn2index(file_id, "OpticalThickness"))
534  status = c_sfginfo(var_id, dummy_name, dummy_rank, dim_sizes, dummy_type, dummy_num_attr)
535  number_taus = dim_sizes(1)
536  allocate (library_taus(number_taus))
537  edge(1) = number_taus
538  status = c_sfrdata(var_id, start(1:1), stride(1:1), edge(1:1), library_taus)
539  status = c_sfendacc(var_id)
540 
541 ! get the full 1D angle arrays, they are small, we'll hang on to them and do resizing after we read them
542 ! in the read_libraries_extra() subroutine
543 
544 ! now get the relative azimuth
545  var_id = c_sfselect(file_id, c_sfn2index(file_id, "ReflectanceRelativeAzimuth"))
546  status = c_sfginfo(var_id, dummy_name, dummy_rank, dim_sizes, dummy_type, dummy_num_attr)
547 
548  index_relativeazimuth = dim_sizes(1)
549  allocate (relativeazimuth_all(index_relativeazimuth))
550  edge(1) = index_relativeazimuth
551  status = c_sfrdata(var_id, start(1:1), stride(1:1), edge(1:1), relativeazimuth_all)
552  status = c_sfendacc(var_id)
553 
554 ! now get the solar zenith
555  var_id = c_sfselect(file_id, c_sfn2index(file_id, "ReflectanceSolarZenith"))
556  status = c_sfginfo(var_id, dummy_name, dummy_rank, dim_sizes, dummy_type, dummy_num_attr)
557 
558  index_solarzenith = dim_sizes(1)
559  allocate (solarzenith_all(index_solarzenith))
560  edge(1) = index_solarzenith
561  status = c_sfrdata(var_id, start(1:1), stride(1:1), edge(1:1), solarzenith_all)
562  status = c_sfendacc(var_id)
563 
564 ! now get the sensor zenith
565  var_id = c_sfselect(file_id, c_sfn2index(file_id, "ReflectanceSensorZenith"))
566  status = c_sfginfo(var_id, dummy_name, dummy_rank, dim_sizes, dummy_type, dummy_num_attr)
567 
568  index_sensorzenith = dim_sizes(1)
569  allocate (sensorzenith_all(index_sensorzenith))
570  edge(1) = index_sensorzenith
571  status = c_sfrdata(var_id, start(1:1), stride(1:1), edge(1:1), sensorzenith_all)
572  status = c_sfendacc(var_id)
573 
574 ! now get the flux angle
575  var_id = c_sfselect(file_id, c_sfn2index(file_id, "FluxSolarZenith"))
576  status = c_sfginfo(var_id, dummy_name, dummy_rank, dim_sizes, dummy_type, dummy_num_attr)
577 
578  index_solarzenith_flux = dim_sizes(1)
579  allocate (solarzenith_flux_all(index_solarzenith))
580  edge(1) = index_solarzenith_flux
581  status = c_sfrdata(var_id, start(1:1), stride(1:1), edge(1:1), solarzenith_flux_all)
582  status = c_sfendacc(var_id)
583 
584 ! Read the 2D arrays
585 
586 
587  start = 0
588  stride = 1
589  edge(1) = number_wavelengths
590  edge(2) = number_iceradii
591 
597 
598  var_id = c_sfselect(file_id, c_sfn2index(file_id, "ExtinctionCoefficient"))
599  status = c_sfrdata(var_id, start(1:2),stride(1:2),edge(1:2), extinction_ice)
600  status = c_sfendacc(var_id)
601 
602  var_id = c_sfselect(file_id, c_sfn2index(file_id, "SingleScatterAlbedo"))
603  status = c_sfrdata(var_id, start(1:2),stride(1:2),edge(1:2), singlescattering_ice)
604  status = c_sfendacc(var_id)
605 
606  var_id = c_sfselect(file_id, c_sfn2index(file_id, "Phase: AsymmetryParameter"))
607  status = c_sfrdata(var_id, start(1:2),stride(1:2),edge(1:2), asymmetry_ice)
608  status = c_sfendacc(var_id)
609 
610  var_id = c_sfselect(file_id, c_sfn2index(file_id, "TruncationFactor"))
611  status = c_sfrdata(var_id, start(1:2),stride(1:2),edge(1:2), truncation_factor_ice)
612  status = c_sfendacc(var_id)
613 
614  var_id = c_sfselect(file_id, c_sfn2index(file_id, "PhaseFuncNormConstant"))
615  status = c_sfrdata(var_id, start(1:2),stride(1:2),edge(1:2), phase_fun_norm_constant_ice)
616  status = c_sfendacc(var_id)
617 
618 ! Read the 3D arrays
619 
620 
621  start = 0
622  stride = 1
623  edge(1) = number_taus
624  edge(2) = number_wavelengths
625  edge(3) = number_iceradii
626 
628  var_id = c_sfselect(file_id, c_sfn2index(file_id, "SphericalAlbedo"))
629  status = c_sfrdata(var_id, start(1:3),stride(1:3),edge(1:3), spherical_albedo_ice)
630  status = c_sfendacc(var_id)
631 
632 
633 ! Read the 4D arrays
634 ! Now we finally read the 6D reflectance array
635 
636 
637  status = c_sfend(file_id)
638 
639 
640 ! Now that we're done with ice, get started with water...
641 
642 ! Read all the water stuff there is to read.
643  file_id = c_sfstart(awater_library, dfacc_read)
644 
645 
646 ! get the radii
647  var_id = c_sfselect(file_id, c_sfn2index(file_id, "ParticleRadius"))
648  status = c_sfginfo(var_id, dummy_name, dummy_rank, dim_sizes, dummy_type, dummy_num_attr)
649  number_waterradii = dim_sizes(1)
650  allocate (water_radii(number_waterradii))
651  edge(1) = number_waterradii
652  status = c_sfrdata(var_id, start(1:1), stride(1:1), edge(1:1), water_radii)
653  status = c_sfendacc(var_id)
654 
655 
656 ! Read the 2D arrays
657 
658 
659  start = 0
660  stride = 1
661  edge(1) = number_wavelengths
662  edge(2) = number_waterradii
663 
669 
670  var_id = c_sfselect(file_id, c_sfn2index(file_id, "ExtinctionCoefficient"))
671  status = c_sfrdata(var_id, start(1:2),stride(1:2),edge(1:2), extinction_water)
672  status = c_sfendacc(var_id)
673 
674  var_id = c_sfselect(file_id, c_sfn2index(file_id, "SingleScatterAlbedo"))
675  status = c_sfrdata(var_id, start(1:2),stride(1:2),edge(1:2), singlescattering_water)
676  status = c_sfendacc(var_id)
677 
678  var_id = c_sfselect(file_id, c_sfn2index(file_id, "Phase: AsymmetryParameter"))
679  status = c_sfrdata(var_id, start(1:2),stride(1:2),edge(1:2), asymmetry_water)
680  status = c_sfendacc(var_id)
681 
682  var_id = c_sfselect(file_id, c_sfn2index(file_id, "TruncationFactor"))
683  status = c_sfrdata(var_id, start(1:2),stride(1:2),edge(1:2), truncation_factor_water)
684  status = c_sfendacc(var_id)
685 
686  var_id = c_sfselect(file_id, c_sfn2index(file_id, "PhaseFuncNormConstant"))
687  status = c_sfrdata(var_id, start(1:2),stride(1:2),edge(1:2), phase_fun_norm_constant_water)
688  status = c_sfendacc(var_id)
689 
690 
691 ! Read the 3D arrays
692 
693 
694  start = 0
695  stride = 1
696  edge(1) = number_taus
697  edge(2) = number_wavelengths
698  edge(3) = number_waterradii
699 
701  var_id = c_sfselect(file_id, c_sfn2index(file_id, "SphericalAlbedo"))
702  status = c_sfrdata(var_id, start(1:3),stride(1:3),edge(1:3), spherical_albedo_water)
703  status = c_sfendacc(var_id)
704 
705 
706 
707  status = c_sfend(file_id)
708 
709 
712 
715 
718 
721 
722 
729 
730  ! WDR re-entrant
731  if( .not. allocated(int_cloud_emissivity_water) ) &
734  if( .not. allocated(int_surface_emissivity_water) ) &
737 
738  if( .not. allocated(int_cloud_emissivity_water_sdev) ) &
741  if( .not. allocated(int_surface_emissivity_water_sdev) ) &
744 
749 
754 
755 
757  allocate(rayleigh_ice(number_iceradii))
758 
759 
760 
761 ! Now for the phase function information
762 
763  file_id = c_sfstart(aphase_library, dfacc_read)
764 
765  start = 0
766  stride = 1
767 
768  ! get the ice phase func info
769  var_id = c_sfselect(file_id, c_sfn2index(file_id, "ScatAnglesIce"))
770  status = c_sfginfo(var_id, dummy_name, dummy_rank, dim_sizes, dummy_type, dummy_num_attr)
771  number_phase_angles_ice = dim_sizes(1)
773  edge(1) = number_phase_angles_ice
774  status = c_sfrdata(var_id, start(1:1), stride(1:1), edge(1:1), phase_angles_ice)
775  status = c_sfendacc(var_id)
776 
777  var_id = c_sfselect(file_id, c_sfn2index(file_id, "ScatAnglesWater"))
778  status = c_sfginfo(var_id, dummy_name, dummy_rank, dim_sizes, dummy_type, dummy_num_attr)
779  number_phase_angles_water = dim_sizes(1)
781  edge(1) = number_phase_angles_water
782  status = c_sfrdata(var_id, start(1:1), stride(1:1), edge(1:1), phase_angles_water)
783  status = c_sfendacc(var_id)
784 
785 
788 
789  start = 0
790  stride = 1
791  edge(1) = number_phase_angles_water
792  edge(2) = number_wavelengths
793  edge(3) = number_waterradii
794 
795 
796  var_id = c_sfselect(file_id, c_sfn2index(file_id, "WaterPhaseFuncVals"))
797  status = c_sfrdata(var_id, start(1:3), stride(1:3), edge(1:3), phase_funcs_water)
798  status = c_sfendacc(var_id)
799 
800 
801  edge(1) = number_phase_angles_ice
802  edge(2) = number_wavelengths
803  edge(3) = number_iceradii
804 
805  var_id = c_sfselect(file_id, c_sfn2index(file_id, "IcePhaseFuncVals"))
806  status = c_sfrdata(var_id, start(1:3), stride(1:3), edge(1:3), phase_funcs_ice)
807  status = c_sfendacc(var_id)
808 
809  status = c_sfend(file_id)
810 
811 ! now for the aerosol and rayleigh property information
812 
817 
818  file_id = c_sfstart(alibnames_ice(1), dfacc_read)
819 
820  start = 0
821  stride = 1
822  edge(1) = number_wavelengths
823 
824  var_id = c_sfselect(file_id, c_sfn2index(file_id, "RayleighOpticalThickness"))
825  status = c_sfrdata(var_id, start(1:1), stride(1:1), edge(1:1), rayleigh_tau)
826  status = c_sfendacc(var_id)
827 
828  var_id = c_sfselect(file_id, c_sfn2index(file_id, "AerosolOpticalThickness"))
829  status = c_sfrdata(var_id, start(1:1), stride(1:1), edge(1:1), aerosol_tau)
830  status = c_sfendacc(var_id)
831 
832  var_id = c_sfselect(file_id, c_sfn2index(file_id, "AerosolAsymParameter"))
833  status = c_sfrdata(var_id, start(1:1), stride(1:1), edge(1:1), aerosol_asym)
834  status = c_sfendacc(var_id)
835 
836  var_id = c_sfselect(file_id, c_sfn2index(file_id, "AerosolSSAlbedo"))
837  status = c_sfrdata(var_id, start(1:1), stride(1:1), edge(1:1), aerosol_ssa)
838  status = c_sfendacc(var_id)
839 
840  status = c_sfend(file_id)
841 
842  call lib_init
843 
844 ! print*, water_radii
845 ! print*, ice_radii
846 
847  end subroutine readlibraries_base
848 
849 
850  subroutine readlibraries_extra(debug,status)
851 
852  use generalauxtype
853  use libraryarrays
859 
860 ! WDR try the setup for the call to mng_msl_init
861  use iso_c_binding
862  implicit none
863  interface
864  function mng_ms_init(fwl, fil, fww1, fww1sd, fiw1, fiw1sd, &
865  fww2, fww2sd, fiw2, fiw2sd, fww3, fww3sd, fiw3, fiw3sd )
866  import
867  character(kind=c_char), intent(in) :: fwl(*)
868  character(kind=c_char), intent(in) :: fil(*)
869  character(kind=c_char), intent(in) :: fww1(*)
870  character(kind=c_char), intent(in) :: fww1sd(*)
871  character(kind=c_char), intent(in) :: fiw1(*)
872  character(kind=c_char), intent(in) :: fiw1sd(*)
873  character(kind=c_char), intent(in) :: fww2(*)
874  character(kind=c_char), intent(in) :: fww2sd(*)
875  character(kind=c_char), intent(in) :: fiw2(*)
876  character(kind=c_char), intent(in) :: fiw2sd(*)
877  character(kind=c_char), intent(in) :: fww3(*)
878  character(kind=c_char), intent(in) :: fww3sd(*)
879  character(kind=c_char), intent(in) :: fiw3(*)
880  character(kind=c_char), intent(in) :: fiw3sd(*)
881  end function mng_ms_init
882  end interface
883 
884  logical, intent(in) :: debug
885  integer,intent (out) :: status
886 
887  integer :: file_id, var_id, var_index,i, j
888  integer :: start(6), stride(6), edge(6)
889  character(MAX_SDS_NAME_LEN) :: dummy_name
890  integer :: dummy_type, dummy_num_attr, dummy_rank
891  integer :: dim_sizes(6),dim_sizes4d(4)
892 
893  real, dimension(:,:,:,:), allocatable :: temp_emis
894 
895  integer :: max_bnd, min_bnd
896  integer :: sensor_min, sensor_max, solar_min, solar_max, sza_min, vza_min, ra_min
897  real, dimension(:,:,:,:), allocatable :: temp_flux, temp_flux2
898 
899  integer :: start_time, end_time, crate, cmax
900 
901  real :: deg_to_rad, cos_vza_min, cos_vza_max, cos_sza_min, cos_sza_max
902  integer :: i1, i2, i3, i4, i5, i6, nws
903 
904  integer c_sfstart
905  external c_sfstart
906  integer c_sfselect
907  external c_sfselect
908  integer c_sfn2index
909  external c_sfn2index
910  integer c_sfginfo
911  external c_sfginfo
912  integer c_sfrdata
913  external c_sfrdata
914  integer c_sfendacc
915  external c_sfendacc
916  integer c_sfend
917  external c_sfend
918  integer :: dfacc_read = 1
919 
920 
921 ! WDR controls for limited reading of the ice... tables
922  integer :: read_tables, ct_tbl_rd = 0
923  real :: last_min_senz = -99999.
924  real :: last_min_solz = -99999.
925  real :: last_min_relaz = -99999.
926  real :: last_max_senz = -99999.
927  real :: last_max_solz = -99999.
928  real :: last_max_relaz = -99999.
929  real :: rng_margin_senz = 3.
930  real :: rng_margin_solz = 5. ! rng_margin_relaz not needed - take full 0-180
931 ! WDR guard to set up the large array manager only once
932  integer :: guard_mng_ms = 0;
933 
934  status = 0
935 
936  deg_to_rad = d2r
937 
938  ! WDR init the large refl table reading
939  if( guard_mng_ms == 0 ) then
940  status = mng_ms_init( trim(awater_library), trim(aice_library), &
947  guard_mng_ms = 1
948  endif
949 
950 ! we need to find angle range for the granule, so we can only read a limited amount from the library
951 ! just enough to get the granule processed.
952 
953 ! from the find_granule_angle_range routine we know just how wide the angle space we need.
954 ! it's fixed for sensor zenith and relative azimuth, but not for solar angle. However for MAS<TER>
955 ! the relative azimuth space isn't fixed either and the sensor zenith limits are different.
956 
957 !!!!!!!!!!! WDR this logic will set the range needed to read the tables
958 ! just 1 time for test granule and also has refresh logic for test purposes
959 !
960 ! here we hard-code the ranges for init test
961 ! TEMP
962 min_rel_azimuth = 0.
963 max_rel_azimuth = 180.
964 !min_solar_zenith = 50. ! WDR these are out for table range with margin
965 !max_solar_zenith = 80.
966 !min_sensor_zenith = 0.
967 !max_sensor_zenith = 66.
968 !
969 ! here is the logic to check to see if a table read is needed
970 if( last_min_senz < -1000. ) then
971  read_tables = 1
972 else
973  if( ( min_rel_azimuth < last_min_relaz ) .or. &
974  ( max_rel_azimuth > last_max_relaz ) .or. &
975  ( min_sensor_zenith < last_min_senz ) .or. &
976  ( max_sensor_zenith > last_max_senz ) .or. &
977  ( min_solar_zenith < last_min_solz ) .or. &
978  ( max_solar_zenith > last_max_solz ) ) then
979  read_tables = 1
980  endif
981 endif
982 
983 if( read_tables /= 1 ) then
984  return
985 endif
986 print*, "Reading trans tables for this line"
987 
988 last_min_relaz = min_rel_azimuth
989 min_rel_azimuth = last_min_relaz
990 last_max_relaz = max_rel_azimuth
991 max_rel_azimuth = last_max_relaz
992 last_min_senz = min_sensor_zenith - rng_margin_senz
993 min_sensor_zenith = last_min_senz
994 last_max_senz = max_sensor_zenith + rng_margin_senz
995 max_sensor_zenith = last_max_senz
996 last_min_solz = min_solar_zenith - rng_margin_solz
997 min_solar_zenith = last_min_solz
998 last_max_solz = max_solar_zenith + rng_margin_solz
999 max_solar_zenith = last_max_solz
1000 read_tables = 0
1001 ct_tbl_rd = ct_tbl_rd + 1
1002 
1003 print*, "Table update # ", ct_tbl_rd
1004 print*, "relaz range: ", min_rel_azimuth, max_rel_azimuth
1005 print*, "solz range: ", min_solar_zenith, max_solar_zenith
1006 print*, "senz range: ", min_sensor_zenith, max_sensor_zenith
1007 
1008 ! start with the ice library first
1009  file_id = c_sfstart(aice_library, dfacc_read)
1010 
1011  start = 0
1012  stride = 1
1013 
1014 
1015 ! now get the relative azimuth and resize it as needed
1016  if (allocated(library_relative_azimuth)) deallocate(library_relative_azimuth)
1017 ! resize the array
1018  call find_bounds(relativeazimuth_all, min_rel_azimuth, max_rel_azimuth, min_bnd, max_bnd)
1019  number_relazimuth = max_bnd - min_bnd + 1
1020 
1021  ra_min = min_bnd
1023  library_relative_azimuth(1:number_relazimuth) = relativeazimuth_all(min_bnd : max_bnd)
1024 
1025 ! now get the solar zenith and resize it as needed
1026  if (allocated(library_solar_zenith)) deallocate(library_solar_zenith)
1027 ! resize the array
1028  cos_sza_max = cos(max_solar_zenith*deg_to_rad)
1029  cos_sza_min = cos(min_solar_zenith*deg_to_rad)
1030 
1031  call find_bounds(solarzenith_all, cos_sza_max, cos_sza_min, min_bnd, max_bnd)
1032  number_solarzenith = max_bnd - min_bnd + 1
1033 
1034  sza_min = min_bnd
1036  library_solar_zenith(1:number_solarzenith) = solarzenith_all(min_bnd : max_bnd)
1037 
1038 ! now get the sensor zenith and resize it as needed
1039  if (allocated(library_sensor_zenith)) deallocate(library_sensor_zenith)
1040 ! resize the array
1041  cos_vza_max = cos(max_sensor_zenith*deg_to_rad)
1042  cos_vza_min = cos(min_sensor_zenith*deg_to_rad)
1043 
1044  call find_bounds(sensorzenith_all, cos_vza_max, cos_vza_min, min_bnd, max_bnd)
1045 
1046  number_sensorzenith = max_bnd - min_bnd + 1
1047  vza_min = min_bnd
1049  library_sensor_zenith(1:number_sensorzenith) = sensorzenith_all(min_bnd : max_bnd)
1050 
1051 ! now get the flux angle and resize it as needed
1052  if (allocated(library_fluxsensorzenith)) deallocate(library_fluxsensorzenith)
1053  if (allocated(library_fluxsolarzenith)) deallocate(library_fluxsolarzenith)
1054 ! resize the array once for solar and once for sensor
1055  call find_bounds(solarzenith_flux_all, cos_vza_max, cos_vza_min, min_bnd, max_bnd)
1056  number_fluxsensorzenith = max_bnd - min_bnd + 1
1057  sensor_min = min_bnd
1058  sensor_max = max_bnd
1060  library_fluxsensorzenith(1:number_fluxsensorzenith) = solarzenith_flux_all(min_bnd : max_bnd)
1061 
1062  call find_bounds(solarzenith_flux_all, cos_sza_max, cos_sza_min, min_bnd, max_bnd)
1063  number_fluxsolarzenith = max_bnd - min_bnd + 1
1064  solar_min = min_bnd
1065  solar_max = max_bnd
1067  library_fluxsolarzenith(1:number_fluxsolarzenith) = solarzenith_flux_all(min_bnd : max_bnd)
1068 
1069 ! Read the 3D arrays
1070 
1071 
1072 ! Read the 4D arrays
1073 
1074  start = 0
1075  stride = 1
1076 
1077  allocate(temp_flux2(number_iceradii, number_wavelengths, number_taus, index_solarzenith_flux))
1078 
1079  if (allocated(flux_up_ice_solar)) deallocate(flux_up_ice_solar)
1080  if (allocated(flux_up_ice_sensor)) deallocate(flux_up_ice_sensor)
1081  if (allocated(flux_down_ice_solar)) deallocate(flux_down_ice_solar)
1082  if (allocated(flux_down_ice_sensor)) deallocate(flux_down_ice_sensor)
1083 
1084 
1089 
1090 ! edge(1) = index_solarzenith_flux
1091 ! edge(2) = number_taus
1092 ! edge(3) = number_wavelengths
1093 ! edge(4) = number_iceradii
1094 
1095  edge(1) = number_iceradii
1096  edge(2) = number_wavelengths
1097  edge(3) = number_taus
1098  edge(4) = index_solarzenith_flux
1099 
1100 
1101 
1102  var_id = c_sfselect(file_id, c_sfn2index(file_id, "ReflectedFlux"))
1103  status = c_sfrdata(var_id, start(1:4),stride(1:4),edge(1:4), temp_flux2)
1104  status = c_sfendacc(var_id)
1105 
1106  allocate(temp_flux(index_solarzenith_flux, number_taus,number_wavelengths,number_iceradii))
1107  do i1=1, index_solarzenith_flux
1108  do i2=1, number_taus
1109  do i3=1, number_wavelengths
1110  do i4=1, number_iceradii
1111 
1112  temp_flux(i1, i2, i3, i4) = temp_flux2(i4, i3, i2, i1)
1113 
1114  end do
1115  end do
1116  end do
1117  end do
1118 
1119 
1120  flux_up_ice_solar(:,:,:,:) = temp_flux(solar_min:solar_max, :,:,:)
1121  flux_up_ice_sensor(:,:,:,:) = temp_flux(sensor_min:sensor_max, :,:,:)
1122 
1123  var_id = c_sfselect(file_id, c_sfn2index(file_id, "TransmittedFlux"))
1124  status = c_sfrdata(var_id, start(1:4),stride(1:4),edge(1:4), temp_flux2)
1125  status = c_sfendacc(var_id)
1126 
1127  do i1=1, index_solarzenith_flux
1128  do i2=1, number_taus
1129  do i3=1, number_wavelengths
1130  do i4=1, number_iceradii
1131 
1132  temp_flux(i1, i2, i3, i4) = temp_flux2(i4, i3, i2, i1)
1133 
1134  end do
1135  end do
1136  end do
1137  end do
1138 
1139 
1140  deallocate(temp_flux2)
1141 
1142  flux_down_ice_solar(:,:,:,:) = temp_flux(solar_min:solar_max, :,:,:)
1143  flux_down_ice_sensor(:,:,:,:) = temp_flux(sensor_min:sensor_max, :,:,:)
1144 
1145  deallocate(temp_flux)
1146 
1147 ! Now we finally read the 6D reflectance array
1148 ! but we don't read the 11um reflectance, as there sure isn't any.
1149 ! we do however need the 11um flux to do emissivity over land surfaces.
1150 
1151 
1152  !edge(6) = number_sensorzenith
1153  !edge(5) = number_solarzenith
1154  !edge(4) = number_relazimuth
1155  !edge(3) = number_taus
1156  !edge(2) = number_wavelengths
1157  !edge(1) = number_iceradii
1158 
1159  !allocate(temp_refl( edge(1), edge(2), edge(3), edge(4), edge(5), edge(6) ))
1160 
1161  !start = 0
1162  !start(6) = vza_min-1
1163  !start(5) = sza_min-1
1164  !start(4) = ra_min-1
1165 
1166  !var_id = c_sfselect(file_id, c_sfn2index(file_id, "MultiScatBDReflectance"))
1167  !status = c_sfrdata(var_id, start,stride,edge, temp_refl)
1168  !status = c_sfendacc(var_id)
1169 
1170 
1171  if (allocated(cloud_emissivity_ice)) deallocate(cloud_emissivity_ice)
1172  if (allocated(surface_emissivity_ice)) deallocate(surface_emissivity_ice)
1173 
1178 
1179 
1180  if (allocated(cloud_emissivity_ice_sdev)) deallocate(cloud_emissivity_ice_sdev)
1181  if (allocated(surface_emissivity_ice_sdev)) deallocate(surface_emissivity_ice_sdev)
1182 
1183 
1188 
1189 
1190 
1191 ! wind speed 3
1192 
1193  allocate(temp_emis( number_iceradii, &
1194  2, &
1195  number_taus + 1, &
1197 
1198 
1199 if (do_cox_munk) then ! DO_COX_MUNK
1200 
1201  do i=1, 3
1202 
1203 
1204  file_id = c_sfstart(alibnames_ice(i), dfacc_read)
1205 
1206  edge(4) = number_sensorzenith
1207  edge(3) = number_taus+1
1208  edge(2) = 2
1209  edge(1) = number_iceradii
1210 
1211  start = 0
1212  start(4) = vza_min-1
1213 
1214  var_id = c_sfselect(file_id, c_sfn2index(file_id, "CloudEmissivity"))
1215  status = c_sfrdata(var_id, start(1:4),stride(1:4),edge(1:4), temp_emis)
1216  status = c_sfendacc(var_id)
1217 
1218 ! cloud_emissivity_ice(:,:,:,:,i) = temp_emis(:,:,:,:)
1219 
1220  do i1=1, number_sensorzenith
1221  do i4=1, number_taus+1
1222  do i5=1, 2
1223  do i6=1, number_iceradii
1224 
1225  cloud_emissivity_ice(i1, i4, i5, i6, i) = temp_emis(i6, i5, i4, i1)
1226 
1227  end do
1228  end do
1229  end do
1230  end do
1231 
1232 
1233  var_id = c_sfselect(file_id, c_sfn2index(file_id, "SurfaceEmissivity"))
1234  status = c_sfrdata(var_id, start(1:4),stride(1:4),edge(1:4), temp_emis)
1235  status = c_sfendacc(var_id)
1236 
1237 ! surface_emissivity_ice(:,:,:,:,i) = temp_emis(:,:,:,:)
1238 
1239  do i1=1, number_sensorzenith
1240  do i4=1, number_taus+1
1241  do i5=1, 2
1242  do i6=1, number_iceradii
1243 
1244  surface_emissivity_ice(i1, i4, i5, i6, i) = temp_emis(i6, i5, i4, i1)
1245 
1246  end do
1247  end do
1248  end do
1249  end do
1250 
1251 
1252 
1253  status = c_sfend(file_id)
1254 
1255  file_id = c_sfstart(alibnames_ice_sdev(i), dfacc_read)
1256 
1257  edge(4) = number_sensorzenith
1258  edge(3) = number_taus+1
1259  edge(2) = 2
1260  edge(1) = number_iceradii
1261 
1262  start = 0
1263  start(4) = vza_min-1
1264 
1265  var_id = c_sfselect(file_id, c_sfn2index(file_id, "CloudEmissivity"))
1266  status = c_sfrdata(var_id, start(1:4),stride(1:4),edge(1:4), temp_emis)
1267  status = c_sfendacc(var_id)
1268 
1269 ! cloud_emissivity_ice_sdev(:,:,:,:,i) = temp_emis(:,:,:,:)
1270 
1271  do i1=1, number_sensorzenith
1272  do i4=1, number_taus+1
1273  do i5=1, 2
1274  do i6=1, number_iceradii
1275 
1276  cloud_emissivity_ice_sdev(i1, i4, i5, i6, i) = temp_emis(i6, i5, i4, i1)
1277 
1278  end do
1279  end do
1280  end do
1281  end do
1282 
1283 
1284 
1285  var_id = c_sfselect(file_id, c_sfn2index(file_id, "SurfaceEmissivity"))
1286  status = c_sfrdata(var_id, start(1:4),stride(1:4),edge(1:4), temp_emis)
1287  status = c_sfendacc(var_id)
1288 
1289 ! surface_emissivity_ice_sdev(:,:,:,:, i) = temp_emis(:,:,:,:)
1290 
1291  do i1=1, number_sensorzenith
1292  do i4=1, number_taus+1
1293  do i5=1, 2
1294  do i6=1, number_iceradii
1295 
1296  surface_emissivity_ice_sdev(i1, i4, i5, i6, i) = temp_emis(i6, i5, i4, i1)
1297 
1298  end do
1299  end do
1300  end do
1301  end do
1302 
1303 
1304  status = c_sfend(file_id)
1305 
1306 
1307 
1308 
1309  end do
1310 
1311 endif ! DO_COX_MUNK
1312 
1313  deallocate(temp_emis)
1314 
1315 ! Now that we're done with ice, get started with water...
1316 
1317 ! Read all the water stuff there is to read.
1318  file_id = c_sfstart(awater_library, dfacc_read)
1319 
1320 
1321 ! Read the 3D arrays
1322 
1323 
1324 
1325 ! Read the 4D arrays
1326 
1327  start = 0
1328  stride = 1
1329 
1330  allocate(temp_flux2(number_waterradii, number_wavelengths, number_taus, index_solarzenith_flux))
1331 
1332  if (allocated(flux_up_water_solar)) deallocate(flux_up_water_solar)
1333  if (allocated(flux_up_water_sensor)) deallocate(flux_up_water_sensor)
1334  if (allocated(flux_down_water_solar)) deallocate(flux_down_water_solar)
1335  if (allocated(flux_down_water_sensor)) deallocate(flux_down_water_sensor)
1336 
1337 
1342 
1343  edge(1) = number_waterradii
1344  edge(2) = number_wavelengths
1345  edge(3) = number_taus
1346  edge(4) = index_solarzenith_flux
1347 
1348 
1349  allocate(temp_flux(index_solarzenith_flux, number_taus,number_wavelengths,number_waterradii))
1350 
1351 
1352  var_id = c_sfselect(file_id, c_sfn2index(file_id, "ReflectedFlux"))
1353  status = c_sfrdata(var_id, start(1:4),stride(1:4),edge(1:4), temp_flux2)
1354  status = c_sfendacc(var_id)
1355 
1356 
1357  do i1=1, index_solarzenith_flux
1358  do i2=1, number_taus
1359  do i3=1, number_wavelengths
1360  do i4=1, number_waterradii
1361 
1362  temp_flux(i1, i2, i3, i4) = temp_flux2(i4, i3, i2, i1)
1363 
1364  end do
1365  end do
1366  end do
1367  end do
1368 
1369  flux_up_water_solar(:,:,:,:) = temp_flux(solar_min:solar_max, :,:,:)
1370  flux_up_water_sensor(:,:,:,:) = temp_flux(sensor_min:sensor_max, :,:,:)
1371 
1372  var_id = c_sfselect(file_id, c_sfn2index(file_id, "TransmittedFlux"))
1373  status = c_sfrdata(var_id, start(1:4),stride(1:4),edge(1:4), temp_flux2)
1374  status = c_sfendacc(var_id)
1375 
1376 
1377  do i1=1, index_solarzenith_flux
1378  do i2=1, number_taus
1379  do i3=1, number_wavelengths
1380  do i4=1, number_waterradii
1381 
1382  temp_flux(i1, i2, i3, i4) = temp_flux2(i4, i3, i2, i1)
1383 
1384  end do
1385  end do
1386  end do
1387  end do
1388 
1389  deallocate(temp_flux2)
1390 
1391 
1392  flux_down_water_solar(:,:,:,:) = temp_flux(solar_min:solar_max, :,:,:)
1393  flux_down_water_sensor(:,:,:,:) = temp_flux(sensor_min:sensor_max, :,:,:)
1394 
1395 
1396  deallocate(temp_flux)
1397 
1398 ! Now we finally read the 6D reflectance array
1399 ! now, this is done on-demand by the dim_mgr
1400  status = c_sfend(file_id)
1401 
1402 
1403  if (allocated(cloud_emissivity_water)) deallocate(cloud_emissivity_water)
1404  if (allocated(surface_emissivity_water)) deallocate(surface_emissivity_water)
1405 
1406 
1407 
1412 
1413  if (allocated(cloud_emissivity_water_sdev)) deallocate(cloud_emissivity_water_sdev)
1419 
1420 
1421 ! wind speed 3
1422 
1423 
1424 ! allocate(temp_refl(number_sensorzenith, number_solarzenith, number_relazimuth, number_taus+1, &
1425 ! number_wavelengths,number_waterradii ))
1426 
1427 ! allocate(temp_emis(number_sensorzenith, number_taus+1, 2, number_waterradii))
1428 
1429 
1430  allocate(temp_emis( number_waterradii, &
1431  2, &
1432  number_taus + 1, &
1434 
1435 
1436 
1437 if (do_cox_munk) then ! DO_COX_MUNK
1438  do i=1, 3
1439 
1440 
1441  file_id = c_sfstart(alibnames_water(i), dfacc_read)
1442 
1443  edge(4) = number_sensorzenith
1444  edge(3) = number_taus+1
1445  edge(2) = 2
1446  edge(1) = number_waterradii
1447 
1448  start = 0
1449  start(4) = vza_min-1
1450 
1451  var_id = c_sfselect(file_id, c_sfn2index(file_id, "CloudEmissivity"))
1452  status = c_sfrdata(var_id, start(1:4),stride(1:4),edge(1:4), temp_emis)
1453  status = c_sfendacc(var_id)
1454 
1455 ! cloud_emissivity_water(:,:,:,:, i) = temp_emis(:,:,:,:)
1456 
1457  do i1=1, number_sensorzenith
1458  do i4=1, number_taus+1
1459  do i5=1, 2
1460  do i6=1, number_waterradii
1461 
1462  cloud_emissivity_water(i1, i4, i5, i6, i) = temp_emis(i6, i5, i4, i1)
1463 
1464  end do
1465  end do
1466  end do
1467  end do
1468 
1469 
1470  var_id = c_sfselect(file_id, c_sfn2index(file_id, "SurfaceEmissivity"))
1471  status = c_sfrdata(var_id, start(1:4),stride(1:4),edge(1:4), temp_emis)
1472  status = c_sfendacc(var_id)
1473 
1474 ! surface_emissivity_water(:,:,:,:, i) = temp_emis(:,:,:,:)
1475 
1476  do i1=1, number_sensorzenith
1477  do i4=1, number_taus+1
1478  do i5=1, 2
1479  do i6=1, number_waterradii
1480 
1481  surface_emissivity_water(i1, i4, i5, i6, i) = temp_emis(i6, i5, i4, i1)
1482 
1483  end do
1484  end do
1485  end do
1486  end do
1487 
1488  status = c_sfend(file_id)
1489 
1490  file_id = c_sfstart(alibnames_water_sdev(i), dfacc_read)
1491 
1492  edge(4) = number_sensorzenith
1493  edge(3) = number_taus+1
1494  edge(2) = 2
1495  edge(1) = number_waterradii
1496 
1497  start = 0
1498  start(4) = vza_min-1
1499 
1500  var_id = c_sfselect(file_id, c_sfn2index(file_id, "CloudEmissivity"))
1501  status = c_sfrdata(var_id, start(1:4),stride(1:4),edge(1:4), temp_emis)
1502  status = c_sfendacc(var_id)
1503 
1504 ! cloud_emissivity_water_sdev(:,:,:,:,i) = temp_emis(:,:,:,:)
1505 
1506  do i1=1, number_sensorzenith
1507  do i4=1, number_taus+1
1508  do i5=1, 2
1509  do i6=1, number_waterradii
1510 
1511  cloud_emissivity_water_sdev(i1, i4, i5, i6, i) = temp_emis(i6, i5, i4, i1)
1512 
1513  end do
1514  end do
1515  end do
1516  end do
1517 
1518  var_id = c_sfselect(file_id, c_sfn2index(file_id, "SurfaceEmissivity"))
1519  status = c_sfrdata(var_id, start(1:4),stride(1:4),edge(1:4), temp_emis)
1520  status = c_sfendacc(var_id)
1521 
1522 ! surface_emissivity_water_sdev(:,:,:,:,i) = temp_emis(:,:,:,:)
1523 
1524  do i1=1, number_sensorzenith
1525  do i4=1, number_taus+1
1526  do i5=1, 2
1527  do i6=1, number_waterradii
1528 
1529  surface_emissivity_water_sdev(i1, i4, i5, i6, i) = temp_emis(i6, i5, i4, i1)
1530 
1531  end do
1532  end do
1533  end do
1534  end do
1535 
1536  status = c_sfend(file_id)
1537 
1538 ! call system_clock(end_time, crate, cmax)
1539 ! print*, "time elapsed: ", end_time - start_time
1540 
1541  end do
1542 endif ! DO_COX_MUNK
1543 
1544 
1545  deallocate(temp_emis)
1546 
1547 
1548 ! print*, "lamb: ", library_reflectance_water( 1, 1, 1, :, 4, 8, 1)
1549 ! print*, "ws3: ",library_reflectance_water( 1, 1, 1, :, 4, 8, 2)
1550 ! print*, "ws7: ",library_reflectance_water( 1, 1, 1, :, 4, 8, 3)
1551 ! print*, "ws15: ",library_reflectance_water( 1, 1, 1, :, 4, 8, 4)
1552 
1553 ! print*, "lamb: ", library_reflectance_ice( 1, 1, 1, :, 4, 6, 1)
1554 ! print*, "ws3: ",library_reflectance_ice( 1, 1, 1, :, 4, 6, 2)
1555 ! print*, "ws7: ",library_reflectance_ice( 1, 1, 1, :, 4, 6, 3)
1556 ! print*, "ws15: ",library_reflectance_ice( 1, 1, 1, :, 4, 6, 4)
1557 
1558 end subroutine readlibraries_extra
1559 
1560  subroutine allocate_model(st_iterX, st_iterY, grid_wid, grid_ht)
1563  use science_parameters, only: model_levels
1564  use generalauxtype
1565 
1566  integer, intent(in) :: st_iterx, st_itery, grid_wid, grid_ht
1567  logical :: do_it
1568  integer :: i, j
1569 
1570 #ifdef GEOS5
1571  do_it = .true.
1572 #else
1573  do_it = .false.
1574  if (iterationx == st_iterx .and. iterationy == st_itery) do_it = .true.
1575 #endif
1576 
1577  if (do_it) then
1578  ! WDR
1579  ! no need to allocate c2_model_info except the contained arrays
1580  ! WDR re-entrant change
1581  if( .not. allocated( c2_model_info%mixr_profile ) ) then
1582  allocate( c2_model_info%mixr_profile(model_levels))
1583  allocate( c2_model_info%temp_profile(model_levels))
1584  allocate( c2_model_info%height_profile(model_levels))
1585  allocate( c2_model_info%pressure_profile(model_levels))
1586  allocate( c2_model_info%o3_profile(model_levels))
1587  endif
1588  if( .not. allocated( model_info ) ) then
1589  allocate(model_info(grid_wid, grid_ht))
1590  do i=1, grid_wid
1591  do j=1, grid_ht
1592 
1593  allocate(model_info(i,j)%mixr_profile(model_levels))
1594  allocate(model_info(i,j)%temp_profile(model_levels))
1595  allocate(model_info(i,j)%height_profile(model_levels))
1596  allocate(model_info(i,j)%pressure_profile(model_levels))
1597 
1598  end do
1599  end do
1600  end if
1601  end if
1602 
1603  end subroutine allocate_model
1604 
1605 
1606 
1607 
1608  subroutine allocate_arrays ( edge, meas_edge, st_iterX, st_iterY, status )
1610  use generalauxtype
1611  use core_arrays
1613  use libraryarrays
1614  use mod06_run_settings
1615  use science_parameters
1616  use specific_other
1617 
1618  implicit none
1619 
1620  integer, dimension(:), intent(in) :: edge, meas_edge
1621  integer, intent (out) :: status
1622  integer, intent(in) :: st_iterx, st_itery
1623 
1624  integer :: checkvariable
1625  integer :: xdimension, meas_xdimension, ydimension, number_of_bands
1626 
1627  integer :: model_layers
1628  integer :: i, j
1629 
1630  logical :: allocation_status, array_size_change
1631 
1632  status = 0
1633  model_layers = model_levels
1634  number_of_bands = size(bands)
1635 
1636 
1637  meas_xdimension = meas_edge(1)
1638  xdimension = edge(1)
1639  ydimension = edge(2)
1640 
1641 ! Use optical_thickness array as a size/allocation test to save time.
1642  allocation_status = allocated(optical_thickness_16_final)
1643 
1644  array_size_change = .false.
1645 
1646  if (allocation_status) then
1647  if (size(optical_thickness_16_final,1) /= xdimension .or. &
1648  size(optical_thickness_16_final,2) /= ydimension .or. &
1649  size(band_measurements, 1) /= meas_xdimension) then
1650  array_size_change = .true.
1651  endif
1652  endif
1653 
1654 #ifdef GEOS5
1655  if (allocated(model_info)) then
1656 
1657  do i=1, grid_xsize
1658  do j=1, grid_ysize
1659 
1660  deallocate(model_info(i,j)%mixr_profile)
1661  deallocate(model_info(i,j)%temp_profile)
1662  deallocate(model_info(i,j)%height_profile)
1663  deallocate(model_info(i,j)%pressure_profile)
1664 
1665  end do
1666  end do
1667 
1668  deallocate(model_info)
1669  endif
1670 #endif
1671 
1672 #ifndef GEOS5
1673  call allocate_model(st_iterx, st_itery, grid_xsize, grid_ysize)
1674 #endif
1675 
1676 ! Core retrieval arrays
1677  if(array_size_change) then
1678 
1679  deallocate(snow_cover)
1680  deallocate(cloud_height_method)
1681  deallocate(irw_temperature)
1682  deallocate(optical_thickness_final, stat = checkvariable)
1683 
1684 #ifndef SEVIRI_INST
1685  deallocate(optical_thickness_1621_final, stat = checkvariable)
1686  deallocate(effective_radius_21_final, stat = checkvariable)
1687  deallocate(effective_radius_1621_final, stat = checkvariable)
1688  deallocate(liquid_water_path_1621, stat = checkvariable)
1689  deallocate(liquid_water_path, stat = checkvariable)
1690 
1691  deallocate(optical_thickness_final_pcl, stat = checkvariable)
1692  deallocate(optical_thickness_1621_final_pcl, stat = checkvariable)
1693  deallocate(effective_radius_21_final_pcl, stat = checkvariable)
1694  deallocate(effective_radius_1621_final_pcl, stat = checkvariable)
1695  deallocate(liquid_water_path_1621_pcl, stat = checkvariable)
1696  deallocate(liquid_water_path_pcl, stat = checkvariable)
1697 
1698  deallocate(optical_thickness_error, stat = checkvariable)
1699  deallocate(effective_radius_21_error, stat = checkvariable)
1700 
1701  deallocate(liquid_water_path_error, stat = checkvariable)
1702  deallocate(optical_thickness_1621_error, stat = checkvariable)
1703  deallocate(effective_radius_1621_error, stat = checkvariable)
1704  deallocate(liquid_water_path_1621_error, stat = checkvariable)
1705 
1706  deallocate(cloud_mask_spi, stat = checkvariable)
1707 
1708  deallocate(failure_metric, stat = checkvariable)
1709  deallocate(failure_metric_1621, stat = checkvariable)
1710 
1711  deallocate(atm_corr_refl, stat = checkvariable)
1712 
1713 #endif
1714 
1715  deallocate(optical_thickness_16_final, stat = checkvariable)
1716  deallocate(optical_thickness_37_final, stat = checkvariable)
1717  deallocate(effective_radius_16_final, stat = checkvariable)
1718  deallocate(effective_radius_37_final, stat = checkvariable)
1719  deallocate(liquid_water_path_16, stat = checkvariable)
1720  deallocate(liquid_water_path_37, stat = checkvariable)
1721 
1722  deallocate(optical_thickness_16_final_pcl, stat = checkvariable)
1723  deallocate(optical_thickness_37_final_pcl, stat = checkvariable)
1724  deallocate(effective_radius_16_final_pcl, stat = checkvariable)
1725  deallocate(effective_radius_37_final_pcl, stat = checkvariable)
1726  deallocate(liquid_water_path_16_pcl, stat = checkvariable)
1727  deallocate(liquid_water_path_37_pcl, stat = checkvariable)
1728 
1729  deallocate(optical_thickness_16_error, stat = checkvariable)
1730  deallocate(optical_thickness_37_error, stat = checkvariable)
1731  deallocate(effective_radius_16_error, stat = checkvariable)
1732  deallocate(effective_radius_37_error, stat = checkvariable)
1733 
1734  deallocate(liquid_water_path_16_error, stat = checkvariable)
1735  deallocate(liquid_water_path_37_error, stat = checkvariable)
1736  deallocate(cloud_layer_flag, stat = checkvariable)
1737  deallocate(ml_test_flag, stat = checkvariable)
1738  deallocate(csr_flag_array, stat = checkvariable)
1739  deallocate(precip_water_094, stat = checkvariable)
1740 
1741 !******************
1742 ! deallocate(clear_sky_btemp)
1743 ! deallocate(clear_sky_rad)
1744 
1745  deallocate(latitude, stat = checkvariable)
1746  deallocate(longitude, stat = checkvariable)
1747  deallocate(sensor_zenith_angle, stat = checkvariable)
1748  deallocate(solar_zenith_angle, stat = checkvariable)
1749  deallocate(relative_azimuth_angle, stat = checkvariable)
1750  deallocate(band_measurements, stat = checkvariable)
1751  deallocate(band_uncertainty, stat = checkvariable)
1752  deallocate(sensor_azimuth_angle, stat = checkvariable)
1753  deallocate(solar_azimuth_angle, stat = checkvariable)
1754 
1755  deallocate(surface_albedo, stat = checkvariable)
1756  deallocate(surface_temperature, stat = checkvariable)
1757  deallocate(surface_emissivity_land, stat = checkvariable)
1758  deallocate(cloud_top_temperature, stat = checkvariable)
1759  deallocate(cloud_top_pressure, stat = checkvariable)
1760  deallocate(cloud_phase_infrared, stat = checkvariable)
1761  deallocate(abovecloud_watervapor, stat = checkvariable)
1762  deallocate(column_ozone, stat = checkvariable)
1763  deallocate(cloudmask, stat = checkvariable)
1764 
1765  deallocate(cloud_mask_spi, stat = checkvariable)
1766 
1767  deallocate(failure_metric_16, stat = checkvariable)
1768  deallocate(failure_metric_37, stat = checkvariable)
1769 
1770  deallocate(cloudsummary, stat = checkvariable)
1771 
1772 
1773  call deallocate_extra
1774  deallocate(processing_information, stat = checkvariable)
1775 
1776  endif
1777 
1778 
1779 #ifndef SEVIRI_INST
1780  if (.not. allocated(optical_thickness_final)) then
1781 
1782 
1783  allocate (optical_thickness_final(xdimension,ydimension), stat = checkvariable)
1784  allocate (optical_thickness_1621_final(xdimension,ydimension), stat = checkvariable)
1785  allocate (effective_radius_21_final(xdimension,ydimension), stat = checkvariable)
1786  allocate (effective_radius_1621_final(xdimension,ydimension), stat = checkvariable)
1787  allocate (liquid_water_path_1621(xdimension,ydimension), stat = checkvariable)
1788  allocate (liquid_water_path(xdimension,ydimension), stat = checkvariable)
1789 
1790  allocate (optical_thickness_final_pcl(xdimension,ydimension), stat = checkvariable)
1791  allocate (optical_thickness_1621_final_pcl(xdimension,ydimension), stat = checkvariable)
1792  allocate (effective_radius_21_final_pcl(xdimension,ydimension), stat = checkvariable)
1793  allocate (effective_radius_1621_final_pcl(xdimension,ydimension), stat = checkvariable)
1794  allocate (liquid_water_path_1621_pcl(xdimension,ydimension), stat = checkvariable)
1795  allocate (liquid_water_path_pcl(xdimension,ydimension), stat = checkvariable)
1796 
1797  allocate (optical_thickness_error(xdimension,ydimension), stat = checkvariable)
1798  allocate (effective_radius_21_error(xdimension,ydimension), stat = checkvariable)
1799  allocate (liquid_water_path_error(xdimension,ydimension), stat = checkvariable)
1800  allocate (optical_thickness_1621_error(xdimension,ydimension), stat = checkvariable)
1801  allocate (effective_radius_1621_error(xdimension,ydimension), stat = checkvariable)
1802  allocate (liquid_water_path_1621_error(xdimension,ydimension), stat = checkvariable)
1803 
1804  allocate(failure_metric(xdimension, ydimension), stat = checkvariable)
1805  allocate(failure_metric_1621(xdimension, ydimension), stat = checkvariable)
1806 
1807  allocate(atm_corr_refl(set_albedo_bands, xdimension, ydimension), stat=checkvariable)
1808  allocate (cloud_mask_spi(2,xdimension,ydimension), stat = checkvariable)
1809  cloud_mask_spi = 0 ! WDR to set to a known
1810 
1811 
1812 #else
1813 
1814  if (.not. allocated(optical_thickness_16_final)) then
1815 
1816 #endif
1817 
1818 
1819  allocate (optical_thickness_16_final(xdimension,ydimension), stat = checkvariable)
1820  allocate (optical_thickness_37_final(xdimension,ydimension), stat = checkvariable)
1821  allocate (effective_radius_16_final(xdimension,ydimension), stat = checkvariable)
1822  allocate (effective_radius_37_final(xdimension,ydimension), stat = checkvariable)
1823  allocate (liquid_water_path_16(xdimension,ydimension), stat = checkvariable)
1824  allocate (liquid_water_path_37(xdimension,ydimension), stat = checkvariable)
1825 
1826  allocate (optical_thickness_16_final_pcl(xdimension,ydimension), stat = checkvariable)
1827  allocate (optical_thickness_37_final_pcl(xdimension,ydimension), stat = checkvariable)
1828  allocate (effective_radius_16_final_pcl(xdimension,ydimension), stat = checkvariable)
1829  allocate (effective_radius_37_final_pcl(xdimension,ydimension), stat = checkvariable)
1830  allocate (liquid_water_path_16_pcl(xdimension,ydimension), stat = checkvariable)
1831  allocate (liquid_water_path_37_pcl(xdimension,ydimension), stat = checkvariable)
1832 
1833  allocate (optical_thickness_16_error(xdimension,ydimension), stat = checkvariable)
1834  allocate (optical_thickness_37_error(xdimension,ydimension), stat = checkvariable)
1835  allocate (effective_radius_16_error(xdimension,ydimension), stat = checkvariable)
1836  allocate (effective_radius_37_error(xdimension,ydimension), stat = checkvariable)
1837  allocate (liquid_water_path_16_error(xdimension,ydimension), stat = checkvariable)
1838  allocate (liquid_water_path_37_error(xdimension,ydimension), stat = checkvariable)
1839  allocate (cloud_layer_flag(xdimension,ydimension), stat = checkvariable)
1840  allocate (ml_test_flag(xdimension,ydimension), stat = checkvariable)
1841  allocate (csr_flag_array(xdimension,ydimension), stat = checkvariable)
1842  allocate(precip_water_094(xdimension,ydimension), stat = checkvariable)
1843  allocate(snow_cover(xdimension,ydimension), stat = checkvariable)
1844 
1845  allocate(failure_metric_16(xdimension, ydimension), stat = checkvariable)
1846  allocate(failure_metric_37(xdimension, ydimension), stat = checkvariable)
1847 
1848 
1849 ! Core input data arrays
1850 
1851  allocate (latitude(xdimension,ydimension), stat = checkvariable)
1852  allocate (longitude(xdimension,ydimension), stat = checkvariable)
1853  allocate (sensor_zenith_angle(xdimension,ydimension), stat = checkvariable)
1854  allocate (solar_zenith_angle(xdimension,ydimension), stat = checkvariable)
1855  allocate (sensor_azimuth_angle(xdimension,ydimension), stat = checkvariable)
1856  allocate (solar_azimuth_angle(xdimension,ydimension), stat = checkvariable)
1857  allocate (relative_azimuth_angle(xdimension,ydimension), stat = checkvariable)
1858 
1859  allocate (band_measurements(meas_xdimension,number_of_bands, ydimension), stat = checkvariable)
1860  allocate (band_uncertainty(meas_xdimension,set_albedo_bands, ydimension), stat = checkvariable)
1861 
1862 
1863 ! Ancillary data array
1864 
1865  allocate (surface_albedo(xdimension,ydimension,set_albedo_bands), stat = checkvariable)
1866  allocate (surface_temperature(xdimension,ydimension), stat = checkvariable)
1867  allocate (cloud_height_method(xdimension,ydimension), stat = checkvariable)
1868  allocate (cloud_phase_infrared(xdimension,ydimension), stat = checkvariable)
1869  allocate (irw_temperature(xdimension,ydimension), stat = checkvariable)
1870  allocate (surface_emissivity_land(xdimension,ydimension, 2), stat = checkvariable)
1871  allocate (cloud_top_temperature(xdimension,ydimension), stat = checkvariable)
1872  allocate (cloud_top_pressure(xdimension,ydimension), stat = checkvariable)
1873  allocate (abovecloud_watervapor(xdimension,ydimension), stat = checkvariable)
1874  allocate (column_ozone(xdimension,ydimension), stat = checkvariable)
1875  column_ozone = 0 ! WDR-UIV
1876  allocate (cloudmask(xdimension,ydimension), stat = checkvariable)
1877  allocate (cloud_mask_spi(2,xdimension,ydimension), stat = checkvariable)
1878  cloud_mask_spi = 0 ! WDR to set to a known
1879 
1880 !******************
1881 ! allocate (clear_sky_btemp(xdimension, ydimension, 2))
1882 ! allocate (clear_sky_rad(xdimension, ydimension, 2))
1883 
1884 
1885 ! QA and Processing arrays
1886 
1887  allocate (cloudsummary(xdimension,ydimension), stat = checkvariable)
1888 
1889 ! atmospheric correction
1890 
1891 ! allocate (transmittance_stddev(xdimension,ydimension,7), stat = checkvariable)
1892 ! allocate (transmittance_twoway(xdimension,ydimension,7), stat = checkvariable)
1893 ! allocate (meandelta_trans(xdimension,ydimension,7), stat = checkvariable)
1894 ! allocate (thermal_correction_twoway(xdimension,ydimension,2), stat = checkvariable)
1895 ! allocate (thermal_correction_oneway(xdimension,ydimension,2), stat = checkvariable)
1896 ! allocate (thermal_correction_bands(2), stat = checkvariable)
1897 
1898  call allocate_extra(xdimension, ydimension)
1899 
1900  allocate (processing_information(xdimension,ydimension), stat = checkvariable)
1901 
1902 
1903  endif
1904 
1905 end subroutine allocate_arrays
1906 
1907 
1908 integer function findpoint( vector, value)
1910 
1911  implicit none
1912 
1913  real(single) ,intent(in) :: vector(:)
1914  real(single) ,intent(in) :: value
1915  integer ::temp(1)
1916 
1917  real(single) ,allocatable :: localvector(:)
1918 
1919  allocate(localvector(size(vector)))
1920 
1921  localvector = vector
1922  call realsingle_s_where_equal(localvector,value)
1923 
1924  temp = maxloc(localvector)
1925  findpoint = temp(1)
1926  deallocate(localvector)
1927 
1928 end function findpoint
1929 
1930 
1931 subroutine init_qualitydata
1934 
1935 ! product quality and retrieval processing QA flags
1936  processing_information(:,:)%optical_thickness_GC = 0_integer_onebyte
1937  processing_information(:,:)%optical_thickness_outofbounds = 0_integer_onebyte
1938  processing_information(:,:)%effective_radius_GC = 0_integer_onebyte
1939  processing_information(:,:)%water_path_GC = 0_integer_onebyte
1940  processing_information(:,:)%rayleigh_correction = 0_integer_onebyte
1941  processing_information(:,:)%path_and_outcome = 0_integer_onebyte
1942  processing_information(:,:)%path_and_outcome_1621 = 0_integer_onebyte
1943 
1944  processing_information(:,:)%path_and_outcome_16 = 0_integer_onebyte
1945  processing_information(:,:)%path_and_outcome_16_PCL = 0_integer_onebyte
1946 
1947  processing_information(:,:)%path_and_outcome_37 = 0_integer_onebyte
1948  processing_information(:,:)%path_and_outcome_37_PCL = 0_integer_onebyte
1949 
1950  processing_information(:,:)%path_and_outcome_PCL = 0_integer_onebyte
1951  processing_information(:,:)%path_and_outcome_1621_PCL = 0_integer_onebyte
1952 
1953  processing_information(:,:)%band_used_for_optical_thickness = 0_integer_onebyte
1954  processing_information(:,:)%optical_thickness_1621_GC = 0_integer_onebyte
1955  processing_information(:,:)%effective_radius_1621_GC = 0_integer_onebyte
1956  processing_information(:,:)%water_path_1621_GC= 0_integer_onebyte
1957  processing_information(:,:)%multi_layer_cloud = 0_integer_onebyte
1958  processing_information(:,:)%CSR_flag = 0_integer_onebyte
1959  processing_information(:,:)%ml_test_mark = 0_integer_onebyte
1960 
1961 #ifdef SEVIRI_INST
1962  processing_information(:,:)%Tc_override = 0_integer_onebyte
1963 #endif
1964 
1965 end subroutine init_qualitydata
1966 
1967 subroutine deallocate_cleanup(status)
1969  use core_arrays
1970  use libraryarrays
1972  use specific_other
1974  use science_parameters
1975 
1976  integer, intent(inout) :: status
1977  integer :: checkvariable
1978 
1979  integer :: i, j
1980 
1981  status = 0
1982 
1983  if (allocated(model_info)) then
1984 
1985  do i=1, grid_xsize
1986  do j=1, grid_ysize
1987 
1988  deallocate(model_info(i,j)%mixr_profile)
1989  deallocate(model_info(i,j)%temp_profile)
1990  deallocate(model_info(i,j)%height_profile)
1991  deallocate(model_info(i,j)%pressure_profile)
1992 
1993  end do
1994  end do
1995 
1996  deallocate(model_info)
1997 
1998  endif
1999 
2000 #ifndef SEVIRI_INST
2001  deallocate(optical_thickness_final, stat = checkvariable)
2002  deallocate(optical_thickness_1621_final, stat = checkvariable)
2003  deallocate(effective_radius_21_final, stat = checkvariable)
2004  deallocate(effective_radius_1621_final, stat = checkvariable)
2005  deallocate(liquid_water_path_1621, stat = checkvariable)
2006  deallocate(liquid_water_path, stat = checkvariable)
2007 
2008  deallocate(optical_thickness_final_pcl, stat = checkvariable)
2009  deallocate(optical_thickness_1621_final_pcl, stat = checkvariable)
2010  deallocate(effective_radius_21_final_pcl, stat = checkvariable)
2011  deallocate(effective_radius_1621_final_pcl, stat = checkvariable)
2012  deallocate(liquid_water_path_1621_pcl, stat = checkvariable)
2013  deallocate(liquid_water_path_pcl, stat = checkvariable)
2014 
2015  deallocate(optical_thickness_error, stat = checkvariable)
2016  deallocate(effective_radius_21_error, stat = checkvariable)
2017 
2018  deallocate(liquid_water_path_error, stat = checkvariable)
2019  deallocate(optical_thickness_1621_error, stat = checkvariable)
2020  deallocate(effective_radius_1621_error, stat = checkvariable)
2021  deallocate(liquid_water_path_1621_error, stat = checkvariable)
2022 
2023  deallocate(cloud_mask_spi, stat = checkvariable)
2024 
2025  deallocate(failure_metric, stat = checkvariable)
2026  deallocate(failure_metric_1621, stat = checkvariable)
2027 
2028  deallocate(atm_corr_refl, stat = checkvariable)
2029 
2030 #endif
2031 
2032 
2033 
2034 ! Core retrieval arrays
2035 
2036  deallocate(optical_thickness_16_final, stat = checkvariable)
2037  deallocate(optical_thickness_37_final, stat = checkvariable)
2038  deallocate(effective_radius_16_final, stat = checkvariable)
2039  deallocate(effective_radius_37_final, stat = checkvariable)
2040 
2041  deallocate(liquid_water_path_16, stat = checkvariable)
2042  deallocate(liquid_water_path_37, stat = checkvariable)
2043 
2044 
2045  deallocate(optical_thickness_16_final_pcl, stat = checkvariable)
2046  deallocate(optical_thickness_37_final_pcl, stat = checkvariable)
2047  deallocate(effective_radius_16_final_pcl, stat = checkvariable)
2048  deallocate(effective_radius_37_final_pcl, stat = checkvariable)
2049  deallocate(liquid_water_path_16_pcl, stat = checkvariable)
2050  deallocate(liquid_water_path_37_pcl, stat = checkvariable)
2051 
2052 
2053 
2054  deallocate(optical_thickness_16_error, stat = checkvariable)
2055  deallocate(optical_thickness_37_error, stat = checkvariable)
2056  deallocate(effective_radius_16_error, stat = checkvariable)
2057  deallocate(effective_radius_37_error, stat = checkvariable)
2058  deallocate(liquid_water_path_16_error, stat = checkvariable)
2059  deallocate(liquid_water_path_37_error, stat = checkvariable)
2060 
2061  deallocate(cloud_layer_flag, stat = checkvariable)
2062  deallocate(ml_test_flag, stat = checkvariable)
2063  deallocate(csr_flag_array, stat = checkvariable)
2064  deallocate(precip_water_094, stat = checkvariable)
2065 
2066  deallocate(failure_metric_16, stat = checkvariable)
2067  deallocate(failure_metric_37, stat = checkvariable)
2068 
2069 ! Core input data arrays
2070  deallocate(latitude, stat = checkvariable)
2071  deallocate(longitude, stat = checkvariable)
2072  deallocate(sensor_zenith_angle, stat = checkvariable)
2073  deallocate(solar_zenith_angle, stat = checkvariable)
2074  deallocate(relative_azimuth_angle, stat = checkvariable)
2075  deallocate(band_measurements, stat = checkvariable)
2076  deallocate(band_uncertainty, stat = checkvariable)
2077  deallocate(sensor_azimuth_angle, stat = checkvariable)
2078  deallocate(solar_azimuth_angle, stat = checkvariable)
2079 
2080  deallocate(surface_albedo, stat = checkvariable)
2081  deallocate(surface_temperature, stat = checkvariable)
2082  deallocate(surface_emissivity_land, stat = checkvariable)
2083  deallocate(cloud_top_temperature, stat = checkvariable)
2084  deallocate(cloud_top_pressure, stat = checkvariable)
2085  deallocate(cloud_phase_infrared, stat = checkvariable)
2086  deallocate(abovecloud_watervapor, stat = checkvariable)
2087  deallocate(column_ozone, stat = checkvariable)
2088  deallocate(cloudmask, stat = checkvariable)
2089  deallocate(cloud_mask_spi, stat = checkvariable)
2090  deallocate(snow_cover, stat = checkvariable)
2091 ! deallocate(model_height_profile, stat = checkvariable)
2092 ! deallocate(model_temp_profile, stat = checkvariable)
2093 ! deallocate(model_water_profile, stat = checkvariable)
2094 
2095 
2096 !***********
2097 ! deallocate(clear_sky_btemp)
2098 ! deallocate(clear_sky_rad)
2099 
2100 ! QA and Processing arrays
2101  deallocate(cloudsummary, stat = checkvariable)
2102  deallocate(processing_information, stat = checkvariable)
2103 
2104 ! atmospheric correction
2105 
2106 ! deallocate(transmittance_stddev, stat = checkvariable)
2107 ! deallocate(transmittance_twoway, stat = checkvariable)
2108 ! deallocate(meandelta_trans, stat = checkvariable)
2109 ! deallocate(thermal_correction_twoway, stat = checkvariable)
2110 ! deallocate(thermal_correction_oneway, stat = checkvariable)
2111 ! deallocate(thermal_correction_bands, stat = checkvariable)
2112 
2113  deallocate(cloud_height_method)
2114  deallocate(irw_temperature)
2115 
2116 ! library arrays
2117 
2118  deallocate(transmit_correction_table)
2119  deallocate(transmit_stddev_table)
2120 
2121  deallocate(ice_radii)
2122  deallocate(library_taus)
2123  deallocate(water_radii)
2124 
2125 ! finally. Let's allocate the arrays we'll need later
2128  deallocate(spherical_albedo_water)
2129 
2130 ! ice arrays, library, not interpolated
2131 
2132 
2135  deallocate(spherical_albedo_ice)
2136 
2137 
2139 
2140 
2141 ! arrays for library interpolation
2146 
2149 
2150  deallocate(int_reflectance_water_wspeed)
2151  deallocate(int_reflectance_ice_wspeed)
2152  deallocate(int_refl_water_sdev_wspeed)
2153  deallocate(int_refl_ice_sdev_wspeed)
2154 
2157 
2158 
2159 
2162 
2163  deallocate(rayleigh_liq, rayleigh_ice)
2164 
2165 ! phase function information
2166  deallocate(phase_angles_water)
2167  deallocate(phase_angles_ice)
2168  deallocate(phase_funcs_water)
2169  deallocate(phase_funcs_ice)
2170 
2171  call deallocate_extra
2172  call lib_clean
2173 
2174  if (no_valid_data == 0) then
2175 
2176  deallocate(library_solar_zenith)
2177  deallocate(library_sensor_zenith)
2178  deallocate(library_relative_azimuth)
2179  deallocate(library_fluxsolarzenith)
2180  deallocate(library_fluxsensorzenith)
2181 
2182  deallocate( solarzenith_all, sensorzenith_all, &
2183  relativeazimuth_all, solarzenith_flux_all)
2184 
2187 
2190 
2193 
2196 
2197  endif
2198 
2199 end subroutine deallocate_cleanup
2200 
2201 
2202 end module modis_frontend_module
integer *2, dimension(:,:), allocatable optical_thickness_37_error
Definition: core_arrays.f90:65
Definition: ch_xfr.f90:1
integer *2, dimension(:,:), allocatable effective_radius_16_final_pcl
Definition: core_arrays.f90:47
integer number_wavelengths
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 the first two or last two tables respectively will be used for the interpolation If there is only one LUT in the set of it will be treated as a constant LUT The manner in which Earth View data is checked for saturation was changed Previously the raw Earth View DNs and Space View DNs were checked against the lookup table values contained in the table dn_sat The change made is to check the raw Earth and Space View DNs to be sure they are less than the maximum saturation value and to check the Space View subtracted Earth View dns against a set of values contained in the new lookup table dn_sat_ev The metadata configuration and ASSOCIATEDINSTRUMENTSHORTNAME from the MOD02HKM product The same metatdata with extensions and were removed from the MOD021KM and MOD02OBC products ASSOCIATEDSENSORSHORTNAME was set to MODIS in all products These changes are reflected in new File Specification which users may consult for exact the pow functions were eliminated in Emissive_Cal and Emissive bands replaced by more efficient code Other calculations throughout the code were also made more efficient Aside from a few round off there was no difference to the product The CPU time decreased by about for a day case and for a night case A minor bug in calculating the uncertainty index for emissive bands was corrected The frame index(0-based) was previously being used the frame number(1-based) should have been used. There were only a few minor changes to the uncertainty index(maximum of 1 digit). 3. Some inefficient arrays(Sigma_RVS_norm_sq) were eliminated and some code lines in Preprocess_L1A_Data were moved into Process_OBCEng_Emiss. There were no changes to the product. Required RAM was reduced by 20 MB. Now
subroutine allocate_extra(xdim, ydim)
real(single), dimension(:,:), allocatable liquid_water_path
Definition: core_arrays.f90:56
real(single), dimension(:,:,:,:,:), allocatable surface_emissivity_water
integer *2, dimension(:,:), allocatable effective_radius_1621_final_pcl
Definition: core_arrays.f90:50
integer *2, dimension(:,:), allocatable liquid_water_path_16_pcl
Definition: core_arrays.f90:52
subroutine, public deallocate_cleanup(status)
integer(integer_onebyte), dimension(:,:), allocatable cloud_layer_flag
Definition: core_arrays.f90:79
float * vector(long nl, long nh)
Definition: nrutil.c:15
real(single), dimension(:,:,:), allocatable int_surface_emissivity_water_sdev
integer *2, dimension(:,:), allocatable effective_radius_16_error
Definition: core_arrays.f90:68
integer, parameter band_1200
real(single), dimension(:,:,:,:,:), allocatable cloud_emissivity_ice
real(single), dimension(:,:), allocatable phase_fun_norm_constant_ice
integer number_fluxsensorzenith
integer *2, dimension(:,:), allocatable liquid_water_path_16_error
Definition: core_arrays.f90:72
real(single), dimension(:,:,:,:,:), allocatable surface_emissivity_water_sdev
subroutine deallocate_extra
type(cloudmask_type), dimension(:,:), allocatable cloudmask
integer *2, dimension(:,:,:), allocatable cloud_mask_spi
real(single), dimension(:,:), allocatable optical_thickness_37_final
Definition: core_arrays.f90:36
real(single), dimension(:,:), allocatable longitude
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
real(single), dimension(:,:), allocatable cloud_top_pressure
real(single), dimension(:,:,:,:,:), allocatable surface_emissivity_ice
real(single), dimension(:,:,:,:), allocatable flux_up_water_solar
integer cm_from_l2
Definition: ch_xfr.f90:53
real(single), dimension(:,:,:,:), allocatable int_surface_emis_ice_wspeed
integer number_phase_angles_water
integer *2, dimension(:,:), allocatable effective_radius_21_final_pcl
Definition: core_arrays.f90:48
real(single), dimension(:,:,:,:), allocatable flux_down_ice_sensor
real(single), dimension(:), allocatable library_relative_azimuth
real(single), dimension(:,:), allocatable phase_fun_norm_constant_water
integer *2, dimension(:,:), allocatable optical_thickness_1621_error
Definition: core_arrays.f90:75
integer *2, dimension(:,:), allocatable liquid_water_path_pcl
Definition: core_arrays.f90:51
real(single), dimension(:,:,:), allocatable int_reflectance_ice
character(len=1000), dimension(3) alibnames_water_sdev
Definition: names.f90:36
real, dimension(:,:), allocatable irw_temperature
real(single), dimension(:,:), allocatable latitude
integer *2, dimension(:,:), allocatable optical_thickness_error
Definition: core_arrays.f90:63
subroutine, public check_datasources(status)
real(single), dimension(:,:,:,:), allocatable int_cloud_emis_water_wspeed
character(len=1000) aphase_library
Definition: names.f90:37
integer, parameter set_albedo_bands
real(single), dimension(:,:,:), allocatable int_fluxdownwater_solar
subroutine, public init_qualitydata
integer function findpoint(vector, value)
real(single), dimension(:,:,:,:), allocatable flux_down_water_solar
real, dimension(:,:,:), allocatable atm_corr_refl
character *15 platform_name
real, dimension(:,:), allocatable sensor_azimuth_angle
integer, parameter band_0370
real(4), parameter set_threshold_relative_azimuth
integer *1, dimension(:,:), allocatable cloud_phase_infrared
integer, parameter band_1100
real(single), dimension(:), allocatable library_solar_zenith
subroutine realsingle_s_where_equal(x, y)
character(len=1000) ageos2d_name1
Definition: names.f90:31
subroutine, public allocate_model(st_iterX, st_iterY, grid_wid, grid_ht)
character(len=1000), dimension(3) alibnames_ice
Definition: names.f90:35
type(failed_type), dimension(:,:), allocatable failure_metric_1621
integer *2, dimension(:,:), allocatable liquid_water_path_error
Definition: core_arrays.f90:71
real, dimension(:,:,:), allocatable surface_albedo
real(single), dimension(:,:), allocatable singlescattering_water
real(single), dimension(:,:,:,:,:), allocatable cloud_emissivity_water_sdev
real(single), dimension(:,:,:), allocatable int_cloud_emissivity_ice
character(len=1000), dimension(3) alibnames_ice_sdev
Definition: names.f90:35
real(single), dimension(:,:,:), allocatable int_cloud_emissivity_water
type(processflag), dimension(:,:), allocatable cloudsummary
Definition: core_arrays.f90:87
real(single), dimension(:), allocatable water_radii
real(single), dimension(:), allocatable aerosol_ssa
integer *2, dimension(:,:), allocatable liquid_water_path_37_error
Definition: core_arrays.f90:73
real(single), dimension(:,:,:,:), allocatable flux_down_ice_solar
real(single), dimension(:), allocatable library_fluxsolarzenith
real(single), dimension(:), allocatable library_taus
real(single), dimension(:,:,:), allocatable int_reflectance_ice_sdev
integer, parameter single
real(single), dimension(:,:,:,:), allocatable int_cloud_emis_water_sdev_wspeed
real(4), parameter set_threshold_sensor_zenith
real(single), dimension(:,:), allocatable asymmetry_ice
real(single), dimension(:,:,:), allocatable int_reflectance_water_sdev
integer, parameter channel_37um
integer *2, dimension(:,:), allocatable optical_thickness_16_final_pcl
Definition: core_arrays.f90:44
character(len=1000) asnowicealbedo_data_name
Definition: names.f90:37
type(failed_type), dimension(:,:), allocatable failure_metric_16
integer number_relazimuth
character(len=1000) aice_library
Definition: names.f90:28
real(single), dimension(:,:,:), allocatable spherical_albedo_water
real(single), dimension(:,:,:,:), allocatable int_cloud_emis_ice_sdev_wspeed
integer(integer_onebyte), dimension(:,:), allocatable csr_flag_array
Definition: core_arrays.f90:80
real, dimension(:,:), allocatable solar_zenith_angle
Definition: core_arrays.f90:6
real(single), dimension(:,:,:,:,:), allocatable surface_emissivity_ice_sdev
real(single), dimension(:,:), allocatable liquid_water_path_37
Definition: core_arrays.f90:58
real(single), dimension(:,:,:), allocatable int_surface_emissivity_ice
real(single), dimension(:,:), allocatable column_ozone
real(single), dimension(:,:), allocatable singlescattering_ice
real(single), dimension(:,:), allocatable extinction_ice
real(single), dimension(:,:,:), allocatable int_fluxdownice_solar
real(single), dimension(:,:,:,:), allocatable int_refl_ice_sdev_wspeed
real(single), dimension(:,:), allocatable optical_thickness_final
Definition: core_arrays.f90:34
character(len=1000) ageos2d_name2
Definition: names.f90:31
real(single), dimension(:,:), allocatable extinction_water
real(single), dimension(:), allocatable library_sensor_zenith
real(single), dimension(:,:,:), allocatable int_surface_emissivity_water
real(single), dimension(:,:,:), allocatable spherical_albedo_ice
real, dimension(:,:,:,:), allocatable transmit_stddev_table
integer *2, dimension(:,:), allocatable optical_thickness_final_pcl
Definition: core_arrays.f90:43
type(failed_type), dimension(:,:), allocatable failure_metric
real(single), dimension(:,:,:), allocatable phase_funcs_ice
real(single), dimension(:,:), allocatable liquid_water_path_1621
Definition: core_arrays.f90:59
real, dimension(:), allocatable rayleigh_liq
real(single), dimension(:), allocatable ice_radii
real, dimension(:,:), allocatable snow_cover
real(single), dimension(:), allocatable aerosol_asym
real(single), dimension(:,:,:,:), allocatable flux_up_water_sensor
real(single), dimension(:,:,:,:), allocatable int_surface_emis_water_wspeed
character(len=1000) ageos3d_name2
Definition: names.f90:31
integer *2, dimension(:,:), allocatable liquid_water_path_1621_error
Definition: core_arrays.f90:77
integer *2, dimension(:,:), allocatable effective_radius_37_final_pcl
Definition: core_arrays.f90:49
real(single), dimension(:,:,:,:), allocatable flux_down_water_sensor
integer *2, dimension(:,:), allocatable optical_thickness_1621_final_pcl
Definition: core_arrays.f90:46
integer function checkfile(name)
real(single), dimension(:,:,:), allocatable int_surface_emissivity_ice_sdev
type(ancillary_type), dimension(:,:), allocatable model_info
integer, parameter set_tilesize
integer number_wind_speed
real(single), dimension(:), allocatable rayleigh_tau
subroutine, public allocate_arrays(edge, meas_edge, st_iterX, st_iterY, status)
character(len=1000) atransmittance_library
Definition: names.f90:37
real, dimension(:,:), allocatable precip_water_094
real(single), dimension(:,:), allocatable cloud_top_temperature
string & trim(string &s, const string &delimiters)
Definition: EnvsatUtil.cpp:29
real(single), dimension(:,:,:), allocatable surface_emissivity_land
integer number_phase_angles_ice
integer, dimension(set_number_of_bands), parameter set_bands
type(ancillary_type) c2_model_info
real(single), dimension(:,:,:), allocatable band_measurements
subroutine, public readlibraries_extra(debug, status)
real, dimension(:,:), allocatable sensor_zenith_angle
integer(integer_onebyte), dimension(:,:), allocatable ml_test_flag
Definition: core_arrays.f90:79
real(single), dimension(:,:), allocatable relative_azimuth_angle
real(single), dimension(:,:,:,:), allocatable int_surface_emis_water_sdev_wspeed
real(single), dimension(:,:,:), allocatable int_fluxupice_sensor
integer, parameter model_levels
real(single), dimension(:,:), allocatable surface_temperature
real(single), dimension(:,:,:), allocatable int_reflectance_water
integer number_waterradii
real(single), dimension(:,:), allocatable optical_thickness_1621_final
Definition: core_arrays.f90:37
Definition: names.f90:1
real(single), dimension(:,:,:,:), allocatable flux_up_ice_solar
instead the metadata field ProcessingEnvinronment is filled in from the output of a call to the POSIX compliant function uname from within the L1B code A small bug in L1B_Tables an incorrect comparison of RVS coefficients for TEBs to RVS coefficients for RSBs was being made This was replaced with a comparison between TEB coefficients This error never resulted in an incorrect RVS correction but did lead to recalculating the coefficients for each detector in a thermal band even if the coefficients were the same for all detectors To reduce to overall size of the reflective LUT HDF fill values were eliminated from all LUTs previously dimensioned where and where NUM_TIMES is the number of time dependent table pieces In Preprocess a small error where the trailing dropped scan counter was incremented when the leading dropped scan counter should have been was fixed This counter is internal only and is not yet used for any chiefly to casting of were added to make it LINUX compatible Output of code run on LINUX machines displays differences of at most scaled integer(SI) from output of code run on IRIX machines. 3. Checking for non-functioning detectors
integer number_solarzenith
integer, parameter channel_11um
real(single), dimension(:,:,:,:,:), allocatable cloud_emissivity_ice_sdev
integer *2, dimension(:,:), allocatable effective_radius_1621_error
Definition: core_arrays.f90:76
type(qualityanalysis), dimension(:,:), allocatable processing_information
integer *2, dimension(:,:), allocatable effective_radius_21_error
Definition: core_arrays.f90:67
integer, parameter channel_12um
real(single), dimension(:,:), allocatable liquid_water_path_16
Definition: core_arrays.f90:57
real(single), dimension(:,:,:), allocatable int_fluxdownwater_sensor
real(single), dimension(:,:), allocatable abovecloud_watervapor
real(single), dimension(:,:,:), allocatable int_cloud_emissivity_ice_sdev
real(single), dimension(:,:), allocatable truncation_factor_ice
type(failed_type), dimension(:,:), allocatable failure_metric_37
integer number_iceradii
real(single), dimension(:,:), allocatable asymmetry_water
character(len=1000) ageos3d_name1
Definition: names.f90:31
real, dimension(:,:,:), allocatable band_uncertainty
real(single), dimension(:,:,:,:), allocatable int_cloud_emis_ice_wspeed
subroutine get_channels
real(single), dimension(:,:,:,:,:), allocatable cloud_emissivity_water
character(len=500) aemissivity_name
Definition: names.f90:44
real(single), dimension(:,:), allocatable optical_thickness_16_final
Definition: core_arrays.f90:35
character(len=1000), dimension(3) alibnames_water
Definition: names.f90:36
real(single), dimension(:,:), allocatable effective_radius_16_final
Definition: core_arrays.f90:38
real(4), parameter set_threshold_solar_zenith
real(single), dimension(:,:,:), allocatable phase_funcs_water
real, dimension(:), allocatable rayleigh_ice
character(len=1000) aecosystem_data_name
Definition: names.f90:37
real(single), dimension(:,:,:), allocatable int_fluxdownice_sensor
real, dimension(:,:), allocatable solar_azimuth_angle
real(single), dimension(:,:,:,:), allocatable int_surface_emis_ice_sdev_wspeed
integer *1, dimension(:,:), allocatable cloud_height_method
real(single), dimension(:,:,:,:), allocatable int_reflectance_water_wspeed
integer *2, dimension(:,:), allocatable optical_thickness_16_error
Definition: core_arrays.f90:64
real(single), dimension(:), allocatable phase_angles_water
real(single), dimension(:,:,:,:), allocatable flux_up_ice_sensor
real(single), dimension(:,:,:,:), allocatable int_refl_water_sdev_wspeed
subroutine local_message_handler(message, severity, functionname)
subroutine, public readlibraries_base(debug, status)
real(single), dimension(:), allocatable phase_angles_ice
real, dimension(:,:,:,:), allocatable transmit_correction_table
integer *2, dimension(:,:), allocatable effective_radius_37_error
Definition: core_arrays.f90:69
subroutine, public initialize_run(start, edge, stride, tilesize, threshold_solar_zenith, threshold_sensor_zenith, threshold_relative_azimuth, status)
character(len=1000) awater_library
Definition: names.f90:28
real(single), dimension(:,:), allocatable effective_radius_1621_final
Definition: core_arrays.f90:41
integer *2, dimension(:,:), allocatable liquid_water_path_37_pcl
Definition: core_arrays.f90:53
real(single), dimension(:,:,:,:), allocatable int_reflectance_ice_wspeed
real(single), dimension(:), allocatable library_fluxsensorzenith
logical, parameter do_cox_munk
integer *2, dimension(:,:), allocatable liquid_water_path_1621_pcl
Definition: core_arrays.f90:54
real(single), dimension(:), allocatable aerosol_tau
integer number_fluxsolarzenith
real(single), dimension(:,:), allocatable truncation_factor_water
real(single), dimension(:,:,:), allocatable int_cloud_emissivity_water_sdev
integer number_sensorzenith
real(single), dimension(:,:,:), allocatable int_fluxupwater_sensor
real(single), dimension(:,:), allocatable effective_radius_21_final
Definition: core_arrays.f90:39
integer number_taus