Skip to content

Commit

Permalink
enable radiation to ERF
Browse files Browse the repository at this point in the history
  • Loading branch information
xyuan committed Nov 22, 2023
1 parent d1cad40 commit 896d664
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Source/Radiation/Cloud_rad_props.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void CloudRadProps::initialize() {
ice.read( asm_sw_ice_h, "sw_asm");
ice.read( abs_lw_ice_h, "lw_abs");

g_d_eff = real1d("g_d_eff",n_g_d);
g_d_eff = real1d("g_d_eff",n_g_d);
ext_sw_ice = real2d("ext_sw_ice", n_g_d, nswbands);
ssa_sw_ice = real2d("ssa_sw_ice", n_g_d, nswbands);
asm_sw_ice = real2d("asm_sw_ice", n_g_d, nswbands);
Expand Down
4 changes: 2 additions & 2 deletions Source/Radiation/Init_rrtmgp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ void Rrtmgp::initialize(int num_gas, const std::vector<std::string>& active_gas_
coefficients_file_lw = rrtmgp_coefficients_file_lw;

active_gases = string1d("active_gases", ngas);
for (int igas=0; igas<ngas; igas++)
for (int igas=0; igas<ngas; igas++)
active_gases(igas+1) = active_gas_names[igas];

GasConcs available_gases;
available_gases.init(active_gases, 1, 1);
load_and_init(k_dist_sw, coefficients_file_sw, available_gases);
Expand Down
2 changes: 1 addition & 1 deletion Source/Radiation/Linear_interpolate.H
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class LinInterp
avgdyin = abs(yin(nin)-yin(1))/(nin-1.);
auto ratio = dyinwrap/avgdyin;
if (ratio < 0.9 || ratio > 1.1) {
printf("ratio is too large, dyinwrap= %13.6e, avgdyin= %13.6e, yin(1) = %13.6e, yin(nin)= %13.6e\n",
printf("ratio is too large, dyinwrap= %13.6e, avgdyin= %13.6e, yin(1) = %13.6e, yin(nin)= %13.6e\n",
dyinwrap, avgdyin, yin(1), yin(nin));
}

Expand Down
4 changes: 2 additions & 2 deletions Source/Radiation/Optics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,13 +361,13 @@ void Optics::set_aerosol_optics_sw(int icall, int ncol, int nlev, int nswbands,
yakl::memset(tau_w_g, 0.);
yakl::memset(tau_w_f, 0.);

int1d ic("icount",1);
int1d ic("icount",1);
intHost1d ic_host("ic_host",1);
parallel_for(SimpleBounds<1>(ncol), YAKL_LAMBDA (int i) {
if (night_indices(i) > 0) ++ic(1);
});
ic.deep_copy_to(ic_host);

aero_optics.aer_rad_props_sw(icall, dt,
ic_host(1), night_indices, is_cmip6_volc,
tau, tau_w, tau_w_g, tau_w_f, clear_rh);
Expand Down
16 changes: 8 additions & 8 deletions Source/Radiation/Radiation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,15 @@ void Radiation::initialize(const MultiFab& cons_in, MultiFab& qmoist,
qrsc = real2d("qrsc", ncol, nlev);
qrlc = real2d("qrlc", ncol, nlev);

amrex::Print() << " LW coefficents file: \n"
<< " SW coefficents file: \n"
<< " Frequency (timesteps) of Shortwave Radiation calc: \n "
<< " Frequency (timesteps) of Longwave Radiation calc: \n "
<< " SW/LW calc done every timestep for first N steps. N= \n"
amrex::Print() << " LW coefficents file: \n"
<< " SW coefficents file: \n"
<< " Frequency (timesteps) of Shortwave Radiation calc: \n "
<< " Frequency (timesteps) of Longwave Radiation calc: \n "
<< " SW/LW calc done every timestep for first N steps. N= \n"
<< " Use average zenith angle: \n "
<< " Output spectrally resolved fluxes: \n "
<< " Do aerosol radiative calculations: \n "
<< " Fixed solar consant (disabled with -1): \n "
<< " Output spectrally resolved fluxes: \n "
<< " Do aerosol radiative calculations: \n "
<< " Fixed solar consant (disabled with -1): \n "
<< " Enable temperature warnings: \n ";

}
Expand Down
5 changes: 5 additions & 0 deletions Source/TimeIntegration/ERF_Advance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ ERF::Advance (int lev, Real time, Real dt_lev, int /*iteration*/, int /*ncycle*/
advance_microphysics(lev, S_new, dt_lev);
#endif

#if defined(ERF_USE_MOISTURE)
// Update the microphysics
advance_radiation(lev, S_new, dt_lev);
#endif

#ifdef ERF_USE_PARTICLES
// Update tracer particles on level 0
if (lev == 0 && use_tracer_particles) {
Expand Down

0 comments on commit 896d664

Please sign in to comment.