From 896d6645016132085df7d1a66e9c893cd86affb8 Mon Sep 17 00:00:00 2001 From: xyuan Date: Wed, 22 Nov 2023 10:51:05 -0500 Subject: [PATCH] enable radiation to ERF --- Source/Radiation/Cloud_rad_props.cpp | 2 +- Source/Radiation/Init_rrtmgp.cpp | 4 ++-- Source/Radiation/Linear_interpolate.H | 2 +- Source/Radiation/Optics.cpp | 4 ++-- Source/Radiation/Radiation.cpp | 16 ++++++++-------- Source/TimeIntegration/ERF_Advance.cpp | 5 +++++ 6 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Source/Radiation/Cloud_rad_props.cpp b/Source/Radiation/Cloud_rad_props.cpp index 4e77065e7..8a357bb1d 100644 --- a/Source/Radiation/Cloud_rad_props.cpp +++ b/Source/Radiation/Cloud_rad_props.cpp @@ -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); diff --git a/Source/Radiation/Init_rrtmgp.cpp b/Source/Radiation/Init_rrtmgp.cpp index 6c0b7bfd9..adb9ff3d0 100644 --- a/Source/Radiation/Init_rrtmgp.cpp +++ b/Source/Radiation/Init_rrtmgp.cpp @@ -28,9 +28,9 @@ void Rrtmgp::initialize(int num_gas, const std::vector& active_gas_ coefficients_file_lw = rrtmgp_coefficients_file_lw; active_gases = string1d("active_gases", ngas); - for (int igas=0; igas 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)); } diff --git a/Source/Radiation/Optics.cpp b/Source/Radiation/Optics.cpp index 9c13895ae..db8f810fe 100644 --- a/Source/Radiation/Optics.cpp +++ b/Source/Radiation/Optics.cpp @@ -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); diff --git a/Source/Radiation/Radiation.cpp b/Source/Radiation/Radiation.cpp index 2a0025b55..135356fe5 100644 --- a/Source/Radiation/Radiation.cpp +++ b/Source/Radiation/Radiation.cpp @@ -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 "; } diff --git a/Source/TimeIntegration/ERF_Advance.cpp b/Source/TimeIntegration/ERF_Advance.cpp index 621bc96d7..dfad219a9 100644 --- a/Source/TimeIntegration/ERF_Advance.cpp +++ b/Source/TimeIntegration/ERF_Advance.cpp @@ -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) {