FV3 Bundle
CRTM_Parameters.f90
Go to the documentation of this file.
1 !
2 ! CRTM_Parameters
3 !
4 ! Module of parameter definitions for the CRTM.
5 !
6 !
7 ! CREATION HISTORY:
8 ! Written by: Paul van Delst, 31-Jul-2000
9 ! paul.vandelst@noaa.gov
10 !
11 
13 
14 
15  ! ---------------------
16  ! Module use statements
17  ! ---------------------
18  USE type_kinds , ONLY: fp
19 
20  ! ------------------
21  ! Default visibility
22  ! ------------------
23  ! Everything PRIVATE by default
24  PRIVATE
25  ! The MAX_N_CHANNELS methods
26  PUBLIC :: crtm_set_max_nchannels ! Subroutine
27  PUBLIC :: crtm_reset_max_nchannels ! Subroutine
28  PUBLIC :: crtm_get_max_nchannels ! Function
29  PUBLIC :: crtm_isset_max_nchannels ! Function
30 
31 
32  !#----------------------------------------------------------------------------#
33  !# -- ALGORITHM INDEPENDENT PARAMETERS -- #
34  !#----------------------------------------------------------------------------#
35 
36  ! ----------------------------------------------------------
37  ! Number of channels (for ALL satellites - really the number
38  ! of satellites x number of channels USED per satellite)
39  !
40  ! This is also the number of lines in the satellite
41  ! information (satinfo) file used in the NCEP GDAS.
42  !
43  ! The number of channels that can be used is determined,
44  ! and SET, during the model initialisation.
45  !
46  ! In this module it is a protected variable in that it can
47  ! only be set, reset, or retrieved via the *_N_CHANNELS
48  ! methods.
49  ! ----------------------------------------------------------
50  INTEGER, PRIVATE, PARAMETER :: reset_value = -1
51  INTEGER, PRIVATE, SAVE :: max_n_channels = reset_value
52 
53 
54  ! -----------------------------------------
55  ! The maximum number of sensors that can be
56  ! specified in a single initialisation call
57  ! -----------------------------------------
58  INTEGER, PUBLIC, PARAMETER :: max_n_sensors = 100
59 
60  ! -----------------------------------------------------
61  ! The maximum number of atmospheric profiles and layers
62  ! accepted. These values are arbitrary. Nothing magical
63  ! -----------------------------------------------------
64  INTEGER, PUBLIC, PARAMETER :: max_n_layers = 200
65 
66 
67  ! -----------------
68  ! Literal constants
69  ! -----------------
70  REAL(fp), PUBLIC, PARAMETER :: zero = 0.0_fp
71  REAL(fp), PUBLIC, PARAMETER :: one = 1.0_fp
72  REAL(fp), PUBLIC, PARAMETER :: two = 2.0_fp
73  REAL(fp), PUBLIC, PARAMETER :: three = 3.0_fp
74  REAL(fp), PUBLIC, PARAMETER :: four = 4.0_fp
75  REAL(fp), PUBLIC, PARAMETER :: five = 5.0_fp
76  REAL(fp), PUBLIC, PARAMETER :: ten = 10.0_fp
77  REAL(fp), PUBLIC, PARAMETER :: point_25 = 0.25_fp
78  REAL(fp), PUBLIC, PARAMETER :: point_5 = 0.5_fp
79  REAL(fp), PUBLIC, PARAMETER :: point_75 = 0.75_fp
80  REAL(fp), PUBLIC, PARAMETER :: onepointfive = 1.5_fp
81 
82 
83  ! --------------------
84  ! PI-related constants
85  ! --------------------
86  REAL(fp), PUBLIC, PARAMETER :: pi = 3.141592653589793238462643383279_fp
87  REAL(fp), PUBLIC, PARAMETER :: twopi = two * pi
88  REAL(fp), PUBLIC, PARAMETER :: degrees_to_radians = pi / 180.0_fp
89  REAL(fp), PUBLIC, PARAMETER :: radians_to_degrees = 180.0_fp / pi
90 
91 
92  ! -------------------------
93  ! Direction flags
94  ! DOWN == From TOA to SFC
95  ! UP == From SFC to TOA
96  ! -------------------------
97  INTEGER, PUBLIC, PARAMETER :: down = 0
98  INTEGER, PUBLIC, PARAMETER :: up = 1
99 
100 
101  ! ------------------------
102  ! Invalid sensor ID values
103  ! ------------------------
104  INTEGER, PUBLIC, PARAMETER :: invalid_ncep_sensor_id = -1
105  INTEGER, PUBLIC, PARAMETER :: invalid_wmo_satellite_id = 1023
106  INTEGER, PUBLIC, PARAMETER :: invalid_wmo_sensor_id = 2047
107 
108 
109  ! -------------------------
110  ! Yes/No, Set/Unset flags
111  ! -------------------------
112  INTEGER, PUBLIC, PARAMETER :: no = 0, yes = 1
113  INTEGER, PUBLIC, PARAMETER :: not_set = 0, set = 1
114 
115  ! Default string length for SensorIDs
116  INTEGER, PUBLIC, PARAMETER :: strlen = 20
117 
118 
119  !#----------------------------------------------------------------------------#
120  !# -- AtmAbsorption PARAMETERS -- #
121  !#----------------------------------------------------------------------------#
122 
123  ! Algorithm IDs
124  INTEGER, PUBLIC, PARAMETER :: odas_algorithm = 1
125  INTEGER, PUBLIC, PARAMETER :: odps_algorithm = 2
126  INTEGER, PUBLIC, PARAMETER :: odssu_algorithm = 3
127 
128  ! Maximum number of absorbers in the gas absorption models
129  ! ---------------------------------------------------------------
130  INTEGER, PUBLIC, PARAMETER :: max_n_absorbers = 7
131 
132  ! ----------------------------------------------
133  ! The minimum absorber amount allowed based upon
134  ! the smallest representable numbers.
135  ! This value is equivalent to TINY(ONE)**0.25
136  ! ----------------------------------------------
137  REAL(fp), PUBLIC, PARAMETER :: minimum_absorber_amount = 1.0e-076_fp ! TEN**(-RANGE(ONE)/4)
138 
139  ! ---------------------------------------
140  ! Numerical limits for the gas absorption
141  ! coefficient reconstruction
142  ! ---------------------------------------
143  ! Numerical limits based on precision
144 ! REAL(fp), PUBLIC, PARAMETER :: LIMIT_EXP = 36.0436_fp ! ABS( LOG( TOLERANCE ) )
145 ! REAL(fp), PUBLIC, PARAMETER :: LIMIT_LOG = 4.5e+15_fp ! EXP( LIMIT_EXP )
146  ! Numerical limits based on experiment.
147  REAL(fp), PUBLIC, PARAMETER :: limit_exp = 20.0_fp
148  REAL(fp), PUBLIC, PARAMETER :: limit_log = 4.8e+08_fp ! EXP( LIMIT_EXP )
149 
150 
151  ! ---------------------------------------
152  ! Top-Of-Atmosphere (TOA) pressure in hPa
153  ! ---------------------------------------
154  REAL(fp), PUBLIC, PARAMETER :: toa_pressure = 0.005_fp
155 
156 
157  ! -------------------------------------------------------
158  ! Reciprocal gravity (scaled by 100 for use with pressure
159  ! in hPa) used in computing integrated absorber amounts
160  ! -------------------------------------------------------
161  REAL(fp), PUBLIC, PARAMETER :: reciprocal_gravity = one / 980.665_fp
162 
163 
164  ! ----------------------------------------------------------
165  ! Cosmic background temperature. Taken from
166  ! Mather,J.C. et. al., 1999, "Calibrator Design for the COBE
167  ! Far-Infrared Absolute Spectrophotometer (FIRAS)"
168  ! Astrophysical Journal, vol 512, pp 511-520
169  ! ----------------------------------------------------------
170  REAL(fp), PUBLIC, PARAMETER :: tspace = 2.7253_fp
171 
172 
173 
174  !#----------------------------------------------------------------------------#
175  !# -- Geometry PARAMETERS -- #
176  !#----------------------------------------------------------------------------#
177 
178  ! -----------------
179  ! Distance defaults
180  ! -----------------
181  REAL(fp), PUBLIC, PARAMETER :: earth_radius = 6370.0_fp ! Mean earth radius
182  REAL(fp), PUBLIC, PARAMETER :: satellite_height = 800.0_fp
183 
184 
185  ! ----------------
186  ! Altitude extrema
187  ! ----------------
188  REAL(fp), PUBLIC, PARAMETER :: min_surface_altitude = -400.0_fp ! Dead sea
189  REAL(fp), PUBLIC, PARAMETER :: max_surface_altitude = 8900.0_fp ! Chomolungma
190 
191 
192  ! -----------------------------------
193  ! Limits on sensor angles.
194  ! - Azimuth angles that are multiples
195  ! of 2pi are not accepted.
196  ! -----------------------------------
197  REAL(fp), PUBLIC, PARAMETER :: max_sensor_scan_angle = 80.0_fp
198  REAL(fp), PUBLIC, PARAMETER :: max_sensor_zenith_angle = 80.0_fp
199  REAL(fp), PUBLIC, PARAMETER :: max_sensor_azimuth_angle = 360.0_fp
200  REAL(fp), PUBLIC, PARAMETER :: max_optran_secant = 2.36620_fp ! = 1/cosd(65.0)
201  ! The maximum angle used to train ODAS transmittance
202  REAL(fp), PUBLIC, PARAMETER :: max_trans_zenith_angle = 63.6122_fp !corresponding to amass 2.25
203 
204  ! -------------------------------------------------
205  ! Limits on source angles.
206  ! - The maximum source zenith angle should
207  ! be determined by the maximum angle secant
208  ! used in generating the gas absorption model
209  ! coefficients, i.e. a secant of 2.25 => 63.6deg.
210  ! Users have requested the Value be 85deg which
211  ! has a secant of ~11.47.
212  ! - Azimuth angles that are multiples
213  ! of 2pi are not accepted.
214  ! -------------------------------------------------
215  REAL(fp), PUBLIC, PARAMETER :: max_source_zenith_angle = 85.0_fp
216  REAL(fp), PUBLIC, PARAMETER :: max_secant_source_zenith = 11.473711738554476_fp
217  REAL(fp), PUBLIC, PARAMETER :: max_source_azimuth_angle = 360.0_fp
218 
219 
220  ! ----------------------------------------
221  ! Default diffusivity angle and secant
222  ! ACOS( 3/5 ) in degrees is (~53.13)
223  ! Used to approximate the downwelling flux
224  ! ----------------------------------------
225  REAL(fp), PUBLIC, PARAMETER :: diffusivity_angle = 53.130102354156_fp
226  REAL(fp), PUBLIC, PARAMETER :: diffusivity_radian = 0.927295218002_fp
227  REAL(fp), PUBLIC, PARAMETER :: secant_diffusivity = five / three
228 
229 
230  ! -----------------------------------------------------------
231  ! Maximum flux angle definitions. Determined by the maximum
232  ! angle secant used in generating the gas absorption model
233  ! coefficients, i.e. a secant of 2.25 => 63.6deg. If the user
234  ! inputs a value larger than this for the Flux_Zenith_Angle,
235  ! the diffusivity angles are used instead
236  ! -----------------------------------------------------------
237  REAL(fp), PUBLIC, PARAMETER :: max_flux_zenith_angle = 63.612200038757_fp
238  REAL(fp), PUBLIC, PARAMETER :: max_secant_flux_zenith = 2.25_fp
239 
240 
241  !#----------------------------------------------------------------------------#
242  !# -- CloudScatter, RTSolution, AtmOptics PARAMETERS -- #
243  !#----------------------------------------------------------------------------#
244  INTEGER, PUBLIC, PARAMETER :: rt_ada = 56
245  INTEGER, PUBLIC, PARAMETER :: rt_soi = 168
246 
247  INTEGER, PUBLIC, PARAMETER :: max_n_clouds = 4 ! Max. number of clouds/profile. Needed for CSV...
248  INTEGER, PUBLIC, PARAMETER :: max_n_aerosols = 20 ! Max. number of aerosols/profile. Needed for ASV
249 
250  REAL(fp), PUBLIC, PARAMETER :: aerosol_content_threshold = 0.000000001_fp
251  REAL(fp), PUBLIC, PARAMETER :: water_content_threshold = 0.000001_fp
252  REAL(fp), PUBLIC, PARAMETER :: optical_depth_threshold = 0.000001_fp
253 
254  REAL(fp), PUBLIC, PARAMETER :: bs_threshold = 1.0e-10_fp ! Was SCATTERING_ALBEDO_THRESHOLD
255  REAL(fp), PUBLIC, PARAMETER :: scattering_albedo_threshold = bs_threshold ! Eventually replace this with BS_THRESHOLD
256 
257 
258  INTEGER, PUBLIC, PARAMETER :: max_n_legendre_terms = 16
259  INTEGER, PUBLIC, PARAMETER :: max_n_phase_elements = 1
260  INTEGER, PUBLIC, PARAMETER :: max_n_streams = 16
261  INTEGER, PUBLIC, PARAMETER :: max_n_angles = 16
262  INTEGER, PUBLIC, PARAMETER :: max_n_stokes = 4
263  INTEGER, PUBLIC, PARAMETER :: max_n_azimuth_fourier = 16 ! maximum number of Fourier components for azimuth angles
264 
265 !### SOI uses HG phase function (modified by Tahara, Feb 2008)
266  LOGICAL, PUBLIC, PARAMETER :: hgphase = .false.
267 ! LOGICAL, PUBLIC, PARAMETER :: HGPHASE = .TRUE.
268 !### SOI uses HG phase function (modified by Tahara, Feb 2008)
269 
270 
271  !#----------------------------------------------------------------------------#
272  !# -- Aircraft/profile pressure difference threshold -- #
273  !#----------------------------------------------------------------------------#
274  REAL(fp), PUBLIC, PARAMETER :: aircraft_pressure_threshold = 0.1_fp
275 
276 
277 CONTAINS
278 
279 
280 !--------------------------------------------------------------------------------
281 !
282 ! NAME:
283 ! CRTM_Set_Max_nChannels
284 !
285 ! PURPOSE:
286 ! Subroutine to set the protected variable MAX_N_CHANNELS value in the
287 ! CRTM_Parameters module. This should *only* be done during the CRTM
288 ! initialisation.
289 !
290 ! CALLING SEQUENCE:
291 ! CALL CRTM_Set_Max_nChannels( Value )
292 !
293 ! INPUT ARGUMENTS:
294 ! Value: The number of channels.
295 ! UNITS: N/A
296 ! TYPE: INTEGER
297 ! DIMENSION: Scalar
298 ! ATTRIBUTES: INTENT(IN)
299 !
300 ! SIDE EFFECTS:
301 ! This subroutines changes the value of the MAX_N_CHANNELS pseudo-parameter
302 ! in the CRTM_Parameters module.
303 !
304 ! CREATION HISTORY:
305 ! Written by: Paul van Delst, CIMSS/SSEC 16-Aug-2001
306 ! paul.vandelst@ssec.wisc.edu
307 !
308 !--------------------------------------------------------------------------------
309 
310  SUBROUTINE crtm_set_max_nchannels( Value )
311  INTEGER, INTENT(IN) :: value
312  max_n_channels = Value
313  END SUBROUTINE crtm_set_max_nchannels
314 
315 
316 !--------------------------------------------------------------------------------
317 !
318 ! NAME:
319 ! CRTM_Reset_Max_nChannels
320 !
321 ! PURPOSE:
322 ! Subroutine to reset the protected variable MAX_N_CHANNELS value in the
323 ! CRTM_Parameters module to an invalid value. This should *only* be done
324 ! during the CRTM destruction.
325 !
326 ! CALLING SEQUENCE:
327 ! CALL CRTM_Reset_Max_nChannels()
328 !
329 ! SIDE EFFECTS:
330 ! This subroutines changes the value of the MAX_N_CHANNELS pseudo-parameter
331 ! in the CRTM_Parameters module.
332 !
333 ! CREATION HISTORY:
334 ! Written by: Paul van Delst, CIMSS/SSEC 16-Aug-2001
335 ! paul.vandelst@ssec.wisc.edu
336 !
337 !--------------------------------------------------------------------------------
338 
339  SUBROUTINE crtm_reset_max_nchannels()
341  END SUBROUTINE crtm_reset_max_nchannels
342 
343 
344 !--------------------------------------------------------------------------------
345 !
346 ! NAME:
347 ! CRTM_Get_Max_nChannels
348 !
349 ! PURPOSE:
350 ! Function to GET the protected variable MAX_N_CHANNELS value stored
351 ! in the CRTM_Parameters module.
352 !
353 ! CALLING SEQUENCE:
354 ! Value = CRTM_Get_Max_nChannels()
355 !
356 ! FUNCTION RESULT:
357 ! Value: The number of channels.
358 ! UNITS: N/A
359 ! TYPE: INTEGER
360 ! DIMENSION: Scalar
361 !
362 ! CREATION HISTORY:
363 ! Written by: Paul van Delst, CIMSS/SSEC 16-Aug-2001
364 ! paul.vandelst@ssec.wisc.edu
365 !
366 !--------------------------------------------------------------------------------
367 
368  FUNCTION crtm_get_max_nchannels() RESULT(Value)
369  INTEGER :: value
370  Value = max_n_channels
371  END FUNCTION crtm_get_max_nchannels
372 
373 
374 !--------------------------------------------------------------------------------
375 !
376 ! NAME:
377 ! CRTM_IsSet_Max_nChannels
378 !
379 ! PURPOSE:
380 ! Function to determie if the MAX_N_CHANNELS protected variable in the
381 ! CRTM_Parameters module has been set to a valid value
382 !
383 ! CALLING SEQUENCE:
384 ! Is_Set = CRTM_IsSet_Max_nChannels()
385 !
386 ! FUNCTION RESULT:
387 ! Is_Set: Logical flag for determining whether or not the
388 ! number of channels has been set.
389 ! If == .TRUE. the MAX_N_CHANNELS protected variable is
390 ! set to a valid value.
391 ! == .FALSE. the MAX_N_CHANNELS protected variable
392 ! value is invalid
393 ! UNITS: N/A
394 ! TYPE: LOGICAL
395 ! DIMENSION: Scalar
396 !
397 ! CREATION HISTORY:
398 ! Written by: Paul van Delst, CIMSS/SSEC 16-Aug-2001
399 ! paul.vandelst@ssec.wisc.edu
400 !
401 !--------------------------------------------------------------------------------
402 
403  FUNCTION crtm_isset_max_nchannels() RESULT(Is_Set)
404  LOGICAL :: is_set
405  is_set = (max_n_channels /= reset_value)
406  END FUNCTION crtm_isset_max_nchannels
407 
408 END MODULE crtm_parameters
real(fp), parameter, public max_sensor_zenith_angle
real(fp), parameter, public point_25
real(fp), parameter, public diffusivity_angle
integer, parameter, public max_n_azimuth_fourier
integer, parameter, public invalid_wmo_sensor_id
real(fp), parameter, public ten
real(fp), parameter, public onepointfive
integer, parameter, public set
integer, parameter, public strlen
real(fp), parameter, public zero
integer, parameter, public no
real(fp), parameter, public tspace
integer, parameter, public max_n_phase_elements
real(fp), parameter, public max_trans_zenith_angle
integer, parameter, public max_n_clouds
real(fp), parameter, public four
integer, parameter, public fp
Definition: Type_Kinds.f90:124
real(fp), parameter, public three
integer, parameter, public up
integer, parameter, public max_n_angles
real(fp), parameter, public radians_to_degrees
real(fp), parameter, public scattering_albedo_threshold
real(fp), parameter, public limit_exp
integer function, public crtm_get_max_nchannels()
real(fp), parameter, public limit_log
real(fp), parameter, public toa_pressure
subroutine, public crtm_reset_max_nchannels()
real(fp), parameter, public optical_depth_threshold
real(fp), parameter, public max_secant_source_zenith
real(fp), parameter, public diffusivity_radian
integer, parameter, public max_n_legendre_terms
integer, parameter, public invalid_wmo_satellite_id
logical, parameter, public hgphase
real(fp), parameter, public earth_radius
real(fp), parameter, public max_sensor_azimuth_angle
real(fp), parameter, public minimum_absorber_amount
real(fp), parameter, public point_75
integer, save, private max_n_channels
real(fp), parameter, public max_source_zenith_angle
real(fp), parameter, public secant_diffusivity
integer, parameter, public max_n_streams
real(fp), parameter, public bs_threshold
integer, parameter, public max_n_stokes
integer, parameter, public max_n_aerosols
real(fp), parameter, public aerosol_content_threshold
real(fp), parameter, public max_source_azimuth_angle
integer, parameter, public not_set
logical function, public crtm_isset_max_nchannels()
real(fp), parameter, public water_content_threshold
real(fp), parameter, public one
real(fp), parameter, public max_flux_zenith_angle
real(fp), parameter, public twopi
integer, parameter, public down
real(fp), parameter, public two
subroutine, public crtm_set_max_nchannels(Value)
integer, parameter, public odssu_algorithm
real(fp), parameter, public max_sensor_scan_angle
real(fp), parameter, public degrees_to_radians
integer, parameter, public odps_algorithm
integer, parameter, public max_n_absorbers
integer, parameter, public odas_algorithm
integer, parameter, public rt_soi
integer, parameter, public max_n_layers
real(fp), parameter, public point_5
real(fp), parameter, public min_surface_altitude
integer, parameter, public rt_ada
real(fp), parameter, public max_surface_altitude
integer, parameter, public invalid_ncep_sensor_id
real(fp), parameter, public reciprocal_gravity
integer, parameter, private reset_value
real(fp), parameter, public max_secant_flux_zenith
real(fp), parameter, public satellite_height
real(fp), parameter, public max_optran_secant
real(fp), parameter, public aircraft_pressure_threshold
real(fp), parameter, public five
integer, parameter, public yes
integer, parameter, public max_n_sensors
real(fp), parameter, public pi