OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
GeneralAuxType.f90
Go to the documentation of this file.
2 
3 !f90
4 !
5 !description:
6 ! data type declarations and parameters for MODIS retrieval code
7 !
8 !
9 !input parameters: none
10 !
11 !
12 !output parameters: none
13 !revision history:
14 !team-unique header:
15 ! mark gray, lac
16 ! climate and radiation branch
17 ! nasa goddard space flight center
18 ! greenbelt, maryland, u.s.a.
19 
20 
21 !... symbolic names for data types:
22 
23 integer, parameter :: integer_fourbyte= selected_int_kind(9)
24 integer, parameter :: integer_twobyte = selected_int_kind(4)
25 integer, parameter :: integer_onebyte = selected_int_kind(2)
26 integer, parameter :: single = kind(1.0)
27 integer, parameter :: double = kind(1.0d0)
28 integer, parameter :: singlecomplex = kind((1.0,1.0))
29 integer, parameter :: doublecomplex = kind((1.0d0,1.0d0))
30 integer, parameter :: logical = kind(.true.)
31 
32 !... debug variables
33 integer :: iterationx, iterationy
34 integer :: pixx, pixy
36 logical :: debugprn
37 
38 ! metadata variables
40 integer :: im_cloudy_count
44 integer :: im_undet_count
45 
46 integer, parameter :: output_unit = 45
47 
48 !... useful mathematical constants
49 
50 real(single), parameter :: pi=3.141592653589793238462643383279502884197_single
51 real(single), parameter :: pio2=1.57079632679489661923132169163975144209858_single
52 real(single), parameter :: twopi=6.283185307179586476925286766559005768394_single
53 
54 real(double), parameter :: pi_d=3.141592653589793238462643383279502884197_double
55 real(double), parameter :: pio2_d=1.57079632679489661923132169163975144209858_double
56 real(double), parameter :: twopi_d=6.283185307179586476925286766559005768394_double
57 real(double), parameter :: d2r_d = 0.017453292519943295_double
58 
59 real(single), parameter :: missingvalue = -1.0
60 
61 contains
62 
63 logical function real_s_equal(x,y)
64  real :: x, y
65  real_s_equal = (abs(x-y) <= epsilon(x))
66 end function real_s_equal
67 
68 logical function realsingle_s_equal(x,y)
69  real(single) :: x, y
70  realsingle_s_equal = (abs(x-y) <= epsilon(x))
71 end function realsingle_s_equal
72 
73 subroutine realsingle_s_where_equal(x,y)
74  real(single) ,intent(inout) :: x(:)
75  real(single) :: y
76 
77  where( abs(x - y) <= epsilon(y) )
78  x = 1.
79  elsewhere
80  x = 0.
81  endwhere
82 
83 end subroutine realsingle_s_where_equal
84 
85 end module generalauxtype
real(double), parameter d2r_d
real(double), parameter twopi_d
integer, parameter singlecomplex
integer im_water_cloud_count
integer number_of_iterationsx
subroutine realsingle_s_where_equal(x, y)
integer, parameter single
integer, parameter integer_onebyte
real(single), parameter missingvalue
integer im_ice_cloud_count
logical function real_s_equal(x, y)
integer, parameter double
#define pi
Definition: vincenty.c:23
integer im_successful_retrieval_count
integer, parameter integer_twobyte
integer number_of_iterationsy
real(double), parameter pi_d
integer im_cloudy_count
integer, parameter output_unit
real(double), parameter pio2_d
logical function realsingle_s_equal(x, y)
integer total_number_of_pixels
#define abs(a)
Definition: misc.h:90
integer im_undet_count
integer, parameter integer_fourbyte