Skip to content

Commit

Permalink
Add cons lat/lon and docs. (#2082)
Browse files Browse the repository at this point in the history
  • Loading branch information
AMLattanzi authored Jan 23, 2025
1 parent 17f3c5e commit 13dbde9
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 29 deletions.
6 changes: 6 additions & 0 deletions Docs/sphinx_doc/Inputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1530,6 +1530,12 @@ List of Parameters
+================================+==========================+====================+===================================+
| **erf.rad_freq_in_steps** | Number of steps between | int | 1 |
+--------------------------------+--------------------------+--------------------+-----------------------------------+
| **erf.rad_write_fluxes** | Flag to write fluxes | Bool | false |
+--------------------------------+--------------------------+--------------------+-----------------------------------+
| **erf.rad_cons_lat** | Constant latitude | Real | 39.8 |
+--------------------------------+--------------------------+--------------------+-----------------------------------+
| **erf.rad_cons_lon** | Constant longitude | Real | -98.5 |
+--------------------------------+--------------------------+--------------------+-----------------------------------+
| **erf.nswbands** | Number sw bands | int | 14 |
+--------------------------------+--------------------------+--------------------+-----------------------------------+
| **erf.nlwbands** | Number lw bands | int | 16 |
Expand Down
38 changes: 20 additions & 18 deletions Exec/DevTests/Radiation/inputs_radiation
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,25 @@ erf.input_sounding_file = "input_sounding_moist"
erf.init_sounding_ideal = true

# RADIATION INPUTS
erf.rad_freq_in_steps = 1
erf.do_subcol_sampling = true
erf.rad_write_fluxes = false
erf.orbital_year = 2018
erf.co2vmr = 0.00036
erf.o3vmr = 3.0e-8 3.0e-8 3.0e-8 3.0e-8 3.0e-8 3.0e-8 3.0e-8 3.0e-8 3.0e-8 3.0e-8 3.0e-8 3.0e-8 3.0e-8 3.0e-8 4.0e-8 4.25e-8 4.5e-8 4.9e-8 5.4e-8 6.0e-8 6.9e-8 8.0e-8 9.25e-8 1.07e-7 1.25e-7 1.63e-7 2.7e-7 5.4e-7 1.0e-6 1.7e-6 2.6e-6 4.0e-6 5.75e-6 7.5e-6 9.0e-6 9.6e-6 9.34e-6 7.83e-6 5.4e-6 3.3e-6 1.9e-6 9.1e-7
erf.n2ovmr = 3.2e-7
erf.covmr = 1.5e-7
erf.ch4vmr = 1.7e-6
erf.o2vmr = 0.209
erf.n2vmr = 0.7906
erf.nswbands = 14
erf.nlwbands = 16
erf.nswgpts = 224
erf.nlwgpts = 256
erf.rrtmgp_file_path = /home/alattanz/git/data-files
erf.rrtmgp_coeffs_sw = rrtmgp-data-sw-g224-2018-12-04.nc
erf.rrtmgp_coeffs_lw = rrtmgp-data-lw-g256-2018-12-04.nc
erf.rad_freq_in_steps = 1
erf.rad_do_subcol_sampling = true
erf.rad_write_fluxes = false
erf.rad_orbital_year = 2018
erf.rad_cons_lat = 40.0
erf.rad_cons_lon = -99.0
erf.co2vmr = 0.00036
erf.o3vmr = 3.0e-8 3.0e-8 3.0e-8 3.0e-8 3.0e-8 3.0e-8 3.0e-8 3.0e-8 3.0e-8 3.0e-8 3.0e-8 3.0e-8 3.0e-8 3.0e-8 4.0e-8 4.25e-8 4.5e-8 4.9e-8 5.4e-8 6.0e-8 6.9e-8 8.0e-8 9.25e-8 1.07e-7 1.25e-7 1.63e-7 2.7e-7 5.4e-7 1.0e-6 1.7e-6 2.6e-6 4.0e-6 5.75e-6 7.5e-6 9.0e-6 9.6e-6 9.34e-6 7.83e-6 5.4e-6 3.3e-6 1.9e-6 9.1e-7
erf.n2ovmr = 3.2e-7
erf.covmr = 1.5e-7
erf.ch4vmr = 1.7e-6
erf.o2vmr = 0.209
erf.n2vmr = 0.7906
erf.nswbands = 14
erf.nlwbands = 16
erf.nswgpts = 224
erf.nlwgpts = 256
erf.rrtmgp_file_path = /home/alattanz/git/data-files
erf.rrtmgp_coeffs_sw = rrtmgp-data-sw-g224-2018-12-04.nc
erf.rrtmgp_coeffs_lw = rrtmgp-data-lw-g256-2018-12-04.nc
erf.rrtmgp_cloud_optics_sw = rrtmgp-cloud-optics-coeffs-sw.nc
erf.rrtmgp_cloud_optics_lw = rrtmgp-cloud-optics-coeffs-lw.nc
4 changes: 4 additions & 0 deletions Source/Radiation/ERF_Radiation.H
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ private:
amrex::MultiFab* m_lat = nullptr;
amrex::MultiFab* m_lon = nullptr;

// Constant lat/lon if the above MFs are not valid
amrex::Real m_lat_cons = 39.809860;
amrex::Real m_lon_cons = -98.555183;

// Pointer to output data for LSM
amrex::MultiFab* m_lsm_fluxes = nullptr;
amrex::MultiFab* m_lsm_zenith = nullptr;
Expand Down
28 changes: 17 additions & 11 deletions Source/Radiation/ERF_Radiation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,28 @@ Radiation::Radiation (const int& lev,
pp.query("rad_write_fluxes", m_rad_write_fluxes);

// Do MCICA subcolumn sampling
pp.query("do_subcol_sampling", m_do_subcol_sampling);
pp.query("rad_do_subcol_sampling", m_do_subcol_sampling);

// Determine orbital year. If orbital_year is negative, use current year
// from timestamp for orbital year; if positive, use provided orbital year
// for duration of simulation.
m_fixed_orbital_year = pp.query("orbital_year",m_orbital_year);
m_fixed_orbital_year = pp.query("rad_orbital_year", m_orbital_year);

// Get orbital parameters from inputs file
pp.query("orbital_eccentricity", m_orbital_eccen);
pp.query("orbital_obliquity" , m_orbital_obliq);
pp.query("orbital_mvelp" , m_orbital_mvelp);
pp.query("rad_orbital_eccentricity", m_orbital_eccen);
pp.query("rad_orbital_obliquity" , m_orbital_obliq);
pp.query("rad_orbital_mvelp" , m_orbital_mvelp);

// Get a constant lat/lon for idealized simulations
pp.query("rad_cons_lat", m_lat_cons);
pp.query("rad_cons_lon", m_lon_cons);

// Value for prescribing an invariant solar constant (i.e. total solar irradiance at
// TOA). Used for idealized experiments such as RCE. Disabled when value is less than 0.
pp.query("fixed_total_solar_irradiance", m_fixed_total_solar_irradiance);

// Determine whether or not we are using a fixed solar zenith angle (positive value)
pp.query("Fixed Solar Zenith Angle", m_fixed_solar_zenith_angle);
pp.query("fixed_solar_zenith_angle", m_fixed_solar_zenith_angle);

// Get prescribed surface values of greenhouse gases
pp.query("co2vmr", m_co2vmr);
Expand All @@ -71,11 +75,11 @@ Radiation::Radiation (const int& lev,
pp.query("n2vmr" , m_n2vmr );

// Required aerosol optical properties from SPA
pp.query("do_aerosol_rad", m_do_aerosol_rad);
pp.query("rad_do_aerosol", m_do_aerosol_rad);

// Whether we do extra clean/clear sky calculations
pp.query("extra_clnclrsky_diag", m_extra_clnclrsky_diag);
pp.query("extra_clnsky_diag" , m_extra_clnsky_diag);
pp.query("rad_extra_clnclrsky_diag", m_extra_clnclrsky_diag);
pp.query("rad_extra_clnsky_diag" , m_extra_clnsky_diag);

// Parse the band and gauss pt sizes
pp.query("nswbands", m_nswbands);
Expand Down Expand Up @@ -395,6 +399,8 @@ Radiation::mf_to_yakl_buffers ()
int ncol = m_ncol;
int nlay = m_nlay;
Real dz = m_geom.CellSize(2);
Real cons_lat = m_lat_cons;
Real cons_lon = m_lon_cons;
for (MFIter mfi(*m_cons_in); mfi.isValid(); ++mfi) {
const auto& vbx = mfi.validbox();
const int nx = vbx.length(0);
Expand Down Expand Up @@ -462,8 +468,8 @@ Radiation::mf_to_yakl_buffers ()

// 1D data structures
if (k==0) {
lat(icol) = (m_lat) ? lat_arr(i,j,0) : 39.809860;
lon(icol) = (m_lon) ? lon_arr(i,j,0) : -98.555183;
lat(icol) = (m_lat) ? lat_arr(i,j,0) : cons_lat;
lon(icol) = (m_lon) ? lon_arr(i,j,0) : cons_lon;
}

});
Expand Down

0 comments on commit 13dbde9

Please sign in to comment.