ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
RadConstants Class Reference

#include <ERF_RadConstants.H>

Collaboration diagram for RadConstants:

Public Types

enum  Units {
  inv_cm , meter , nanometer , micrometer ,
  centimeter
}
 

Static Public Member Functions

static void get_solar_band_fraction_irrad (real1d &fractional_irradiance)
 
static void get_ref_total_solar_irrad (real &tsi)
 
static void get_ref_solar_band_irrad (real1d &band_irrad)
 
static void get_number_sw_bands (int &number_of_bands)
 
static void get_lw_spectral_boundaries (real1d &low_boundaries, real1d &high_boundaries, Units units)
 
static void get_lw_spectral_midpoints (real1d &band_midpoints, Units units)
 
static void get_sw_spectral_boundaries (real1d &low_boundaries, real1d &high_boundaries, Units units)
 
static void get_sw_spectral_midpoints (real1d &band_midpoints, Units units)
 
static int rad_gas_index (std::string gasname)
 

Static Public Attributes

static constexpr int nswbands = 14
 
static constexpr int nbndsw = 14
 
static constexpr real wavenum_low []
 
static constexpr real wavenum_high []
 
static constexpr real solar_ref_band_irradiance []
 
static constexpr real icesize_table_min_temp = 180.
 
static constexpr real retab []
 
static constexpr int idx_sw_diag = 10
 
static constexpr int idx_nir_diag = 8
 
static constexpr int idx_uv_diag = 11
 
static constexpr int rrtmg_sw_cloudsim_band = 9
 
static constexpr int nrh = 1000
 
static constexpr int idx_lw_diag = 7
 
static constexpr int rrtmg_lw_cloudsim_band = 6
 
static constexpr int nlwbands = 16
 
static constexpr int nbndlw = 16
 
static constexpr real wavenumber1_longwave []
 
static constexpr real wavenumber2_longwave []
 
static constexpr int nradgas = 8
 
static constexpr const char * gaslist []
 

Member Enumeration Documentation

◆ Units

Enumerator
inv_cm 
meter 
nanometer 
micrometer 
centimeter 
105  {
106  inv_cm,
107  meter,
108  nanometer,
109  micrometer,
110  centimeter
111  };
@ centimeter
Definition: ERF_RadConstants.H:110
@ meter
Definition: ERF_RadConstants.H:107
@ nanometer
Definition: ERF_RadConstants.H:108
@ inv_cm
Definition: ERF_RadConstants.H:106
@ micrometer
Definition: ERF_RadConstants.H:109

Member Function Documentation

◆ get_lw_spectral_boundaries()

static void RadConstants::get_lw_spectral_boundaries ( real1d &  low_boundaries,
real1d &  high_boundaries,
Units  units 
)
inlinestatic
154  {
155  switch (units) {
156  case inv_cm:
157  for(auto i = 0; i < nlwbands; ++i) {
158  low_boundaries(i) = wavenumber1_longwave[i];
159  high_boundaries(i) = wavenumber2_longwave[i];
160  }
161  case meter:
162  for(auto i = 0; i < nlwbands; ++i) {
163  low_boundaries(i) = 1.e-2/wavenumber2_longwave[i];
164  high_boundaries(i) = 1.e-2/wavenumber1_longwave[i];
165  }
166  case nanometer:
167  for(auto i = 0; i < nlwbands; ++i) {
168  low_boundaries(i) = 1.e7/wavenumber2_longwave[i];
169  high_boundaries(i) = 1.e7/wavenumber1_longwave[i];
170  }
171  case micrometer:
172  for(auto i = 0; i < nlwbands; ++i) {
173  low_boundaries(i) = 1.e4/wavenumber2_longwave[i];
174  high_boundaries(i) = 1.e4/wavenumber1_longwave[i];
175  }
176  case centimeter:
177  for(auto i = 0; i < nlwbands; ++i) {
178  low_boundaries(i) = 1./wavenumber2_longwave[i];
179  high_boundaries(i) = 1./wavenumber1_longwave[i];
180  }
181  default:
182  amrex::Print() << "get_lw_spectral_boundaries: spectral units not acceptable\n";
183  }
184  }
static constexpr int nlwbands
Definition: ERF_RadConstants.H:86
static constexpr real wavenumber2_longwave[]
Definition: ERF_RadConstants.H:93
static constexpr real wavenumber1_longwave[]
Definition: ERF_RadConstants.H:89

Referenced by get_lw_spectral_midpoints().

Here is the caller graph for this function:

◆ get_lw_spectral_midpoints()

static void RadConstants::get_lw_spectral_midpoints ( real1d &  band_midpoints,
Units  units 
)
inlinestatic
188  {
189  real1d lower_boundaries("lower_boundaries", nlwbands);
190  real1d upper_boundaries("upper_boundaries", nlwbands);
191  //int iband;
192 
193  // Get band boundaries
194  get_lw_spectral_boundaries(lower_boundaries, upper_boundaries, units);
195 
196  // Get band midpoints
197  for(auto iband = 0; iband < nlwbands; ++iband) {
198  band_midpoints(iband) = 0.5*(lower_boundaries(iband) + upper_boundaries(iband));
199  }
200 
201  }
static void get_lw_spectral_boundaries(real1d &low_boundaries, real1d &high_boundaries, Units units)
Definition: ERF_RadConstants.H:151
Here is the call graph for this function:

◆ get_number_sw_bands()

static void RadConstants::get_number_sw_bands ( int &  number_of_bands)
inlinestatic
145  {
146  number_of_bands = nswbands;
147  }
static constexpr int nswbands
Definition: ERF_RadConstants.H:15

◆ get_ref_solar_band_irrad()

static void RadConstants::get_ref_solar_band_irrad ( real1d &  band_irrad)
inlinestatic
137  {
138  for(auto i = 0; i < nswbands; ++i)
139  band_irrad(i) = solar_ref_band_irradiance[i];
140  }
static constexpr real solar_ref_band_irradiance[]
Definition: ERF_RadConstants.H:34

◆ get_ref_total_solar_irrad()

static void RadConstants::get_ref_total_solar_irrad ( real &  tsi)
inlinestatic
128  {
129  tsi = 0;
130  for(auto i = 0; i < nswbands; ++i)
131  tsi = tsi + solar_ref_band_irradiance[i];
132  }

◆ get_solar_band_fraction_irrad()

static void RadConstants::get_solar_band_fraction_irrad ( real1d &  fractional_irradiance)
inlinestatic
116  {
117  real tsi = 0; // total solar irradiance
118  for(auto i = 0; i < nswbands; ++i)
119  tsi = tsi + solar_ref_band_irradiance[i];
120 
121  for(auto i = 0; i < nswbands; ++i)
122  fractional_irradiance(i) = solar_ref_band_irradiance[i] / tsi;
123  }

◆ get_sw_spectral_boundaries()

static void RadConstants::get_sw_spectral_boundaries ( real1d &  low_boundaries,
real1d &  high_boundaries,
Units  units 
)
inlinestatic
206  {
207  switch (units) {
208  case inv_cm:
209  for(auto i = 0; i < nswbands; ++i) {
210  low_boundaries(i) = wavenum_low[i];
211  high_boundaries(i) = wavenum_high[i];
212  }
213  case meter:
214  for(auto i = 0; i < nswbands; ++i) {
215  low_boundaries(i) = 1.e-2/wavenum_high[i];
216  high_boundaries(i) = 1.e-2/wavenum_low[i];
217  }
218  case nanometer:
219  for(auto i = 0; i < nswbands; ++i) {
220  low_boundaries(i) = 1.e7/wavenum_high[i];
221  high_boundaries(i) = 1.e7/wavenum_low[i];
222  }
223  case micrometer:
224  for(auto i = 0; i < nswbands; ++i) {
225  low_boundaries(i) = 1.e4/wavenum_high[i];
226  high_boundaries(i) = 1.e4/wavenum_low[i];
227  }
228  case centimeter:
229  for(auto i = 0; i < nswbands; ++i) {
230  low_boundaries(i) = 1./wavenum_high[i];
231  high_boundaries(i) = 1./wavenum_low[i];
232  }
233  default:
234  amrex::Print() << "rad_constants.F90: spectral units not acceptable\n";
235  }
236  }
static constexpr real wavenum_high[]
Definition: ERF_RadConstants.H:28
static constexpr real wavenum_low[]
Definition: ERF_RadConstants.H:24

Referenced by EbertCurry::ec_ice_optics_sw(), get_sw_spectral_midpoints(), and Slingo::slingo_liq_optics_sw().

Here is the caller graph for this function:

◆ get_sw_spectral_midpoints()

static void RadConstants::get_sw_spectral_midpoints ( real1d &  band_midpoints,
Units  units 
)
inlinestatic
240  {
241  real1d lower_boundaries("lower_boundaries", nswbands);
242  real1d upper_boundaries("upper_boundaries", nswbands);
243 
244  // Get band boundaries
245  get_sw_spectral_boundaries(lower_boundaries, upper_boundaries, units);
246 
247  //Get band midpoints
248  for(auto iband = 0; iband < nswbands; ++iband) {
249  band_midpoints(iband) = 0.5 * (lower_boundaries(iband) + upper_boundaries(iband));
250  }
251  }
static void get_sw_spectral_boundaries(real1d &low_boundaries, real1d &high_boundaries, Units units)
Definition: ERF_RadConstants.H:205
Here is the call graph for this function:

◆ rad_gas_index()

static int RadConstants::rad_gas_index ( std::string  gasname)
inlinestatic
256  {
257  for(auto igas = 0; igas < nradgas; ++igas) {
258  if (gaslist[igas] == gasname) return igas;
259  }
260  amrex::Abort("rad_gas_index: can not find gas with name " + gasname);
261  return -1;
262  }
static constexpr const char * gaslist[]
Definition: ERF_RadConstants.H:101
static constexpr int nradgas
Definition: ERF_RadConstants.H:100

Referenced by MamConstituents::get_gas_names(), and MamConstituents::rad_cnst_get_gas().

Here is the caller graph for this function:

Member Data Documentation

◆ gaslist

constexpr const char* RadConstants::gaslist[]
staticconstexpr
Initial value:
=
{"H2O","O3", "O2", "CO2", "N2O", "CH4", "CFC11", "CFC12"}

Referenced by rad_gas_index().

◆ icesize_table_min_temp

constexpr real RadConstants::icesize_table_min_temp = 180.
staticconstexpr

Referenced by ice_effective_radius().

◆ idx_lw_diag

constexpr int RadConstants::idx_lw_diag = 7
staticconstexpr

◆ idx_nir_diag

constexpr int RadConstants::idx_nir_diag = 8
staticconstexpr

◆ idx_sw_diag

constexpr int RadConstants::idx_sw_diag = 10
staticconstexpr

◆ idx_uv_diag

constexpr int RadConstants::idx_uv_diag = 11
staticconstexpr

◆ nbndlw

constexpr int RadConstants::nbndlw = 16
staticconstexpr

◆ nbndsw

constexpr int RadConstants::nbndsw = 14
staticconstexpr

◆ nlwbands

constexpr int RadConstants::nlwbands = 16
staticconstexpr

◆ nradgas

constexpr int RadConstants::nradgas = 8
staticconstexpr

Referenced by rad_gas_index().

◆ nrh

constexpr int RadConstants::nrh = 1000
staticconstexpr

◆ nswbands

◆ retab

constexpr real RadConstants::retab[]
staticconstexpr
Initial value:
= { 5.92779, 6.26422, 6.61973, 6.99539, 7.39234,
7.81177, 8.25496, 8.72323, 9.21800, 9.74075, 10.2930,
10.8765, 11.4929, 12.1440, 12.8317, 13.5581, 14.2319,
15.0351, 15.8799, 16.7674, 17.6986, 18.6744, 19.6955,
20.7623, 21.8757, 23.0364, 24.2452, 25.5034, 26.8125,
27.7895, 28.6450, 29.4167, 30.1088, 30.7306, 31.2943,
31.8151, 32.3077, 32.7870, 33.2657, 33.7540, 34.2601,
34.7892, 35.3442, 35.9255, 36.5316, 37.1602, 37.8078,
38.4720, 39.1508, 39.8442, 40.5552, 41.2912, 42.0635,
42.8876, 43.7863, 44.7853, 45.9170, 47.2165, 48.7221,
50.4710, 52.4980, 54.8315, 57.4898, 60.4785, 63.7898,
65.5604, 71.2885, 75.4113, 79.7368, 84.2351, 88.8833,
93.6658, 98.5739, 103.603, 108.752, 114.025, 119.424,
124.954, 130.630, 136.457, 142.446, 148.608, 154.956,
161.503, 168.262, 175.248, 182.473, 189.952, 197.699,
205.728, 214.055, 222.694, 231.661, 240.971, 250.639}

Referenced by ice_effective_radius().

◆ rrtmg_lw_cloudsim_band

constexpr int RadConstants::rrtmg_lw_cloudsim_band = 6
staticconstexpr

◆ rrtmg_sw_cloudsim_band

constexpr int RadConstants::rrtmg_sw_cloudsim_band = 9
staticconstexpr

◆ solar_ref_band_irradiance

constexpr real RadConstants::solar_ref_band_irradiance[]
staticconstexpr
Initial value:
=
{12.11, 20.3600000000001, 23.73,
22.43, 55.63, 102.93, 24.29,
345.74, 218.19, 347.20,
129.49, 50.15, 3.08, 12.89}

Referenced by get_ref_solar_band_irrad(), get_ref_total_solar_irrad(), and get_solar_band_fraction_irrad().

◆ wavenum_high

constexpr real RadConstants::wavenum_high[]
staticconstexpr
Initial value:
=
{3250., 4000., 4650., 5150., 6150., 7700., 8050.,
12850.,16000., 22650., 29000., 38000., 50000., 2600.}

Referenced by get_sw_spectral_boundaries().

◆ wavenum_low

constexpr real RadConstants::wavenum_low[]
staticconstexpr
Initial value:
=
{2600., 3250., 4000., 4650., 5150., 6150., 7700.,
8050., 12850., 16000., 22650., 29000., 38000., 820.}

Referenced by get_sw_spectral_boundaries().

◆ wavenumber1_longwave

constexpr real RadConstants::wavenumber1_longwave[]
staticconstexpr
Initial value:
=
{10., 350., 500., 630., 700., 820., 980., 1080.,
1180., 1390., 1480., 1800., 2080., 2250., 2390., 2600.}

Referenced by get_lw_spectral_boundaries().

◆ wavenumber2_longwave

constexpr real RadConstants::wavenumber2_longwave[]
staticconstexpr
Initial value:
=
{350., 500., 630., 700., 820., 980., 1080., 1180.,
1390., 1480., 1800., 2080., 2250., 2390., 2600., 3250.}

Referenced by get_lw_spectral_boundaries().


The documentation for this class was generated from the following file: