Skip to content

Commit 2d040ca

Browse files
committed
Merge branch 'main' of github.com:MennoVeerman/rte-rrtmgp-cpp into main
2 parents 6d101bf + 751edd6 commit 2d040ca

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src_kernels_cuda_rt/raytracer_kernels_bw.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ void ray_tracer_kernel_bw(
303303
{
304304
extern __shared__ Float shared_arrays[];
305305
Float* mie_cdf_shared = &shared_arrays[0];
306-
Float* mie_phase_ang_shared = &shared_arrays[mie_phase_table_size];
306+
Float* mie_phase_ang_shared = &shared_arrays[mie_cdf_table_size];
307307
Float* bg_tau_cum = &shared_arrays[mie_phase_table_size+mie_cdf_table_size];
308308
if (threadIdx.x==0)
309309
{

src_test/Radiation_solver_bw.cu

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ void Radiation_solver_shortwave::load_mie_tables(
749749
const int n_mie = mie_nc.get_dimension_size("n_ang");
750750
const int n_mie_cdf = mie_nc.get_dimension_size("n_ang_cdf");
751751

752-
Array<Float,3> mie_cdf(mie_nc.get_variable<Float>("phase_cdf", {n_bnd_sw, n_mie_cdf}), {n_mie, 1, n_bnd_sw});
752+
Array<Float,3> mie_cdf(mie_nc.get_variable<Float>("phase_cdf", {n_bnd_sw, n_mie_cdf}), {n_mie_cdf, 1, n_bnd_sw});
753753
Array<Float,4> mie_ang(mie_nc.get_variable<Float>("phase_cdf_angle", {n_bnd_sw, n_re, n_mie_cdf}), {n_mie_cdf, n_re, 1, n_bnd_sw});
754754

755755
Array<Float,4> mie_phase(mie_nc.get_variable<Float>("phase", {n_bnd_sw, n_re, n_mie}), {n_mie, n_re, 1, n_bnd_sw});
@@ -768,10 +768,11 @@ void Radiation_solver_shortwave::load_mie_tables(
768768
const int n_bnd_sw = this->get_n_bnd_gpu();
769769
const int n_re = mie_nc.get_dimension_size("r_eff");
770770
const int n_mie = mie_nc.get_dimension_size("n_ang");
771+
const int n_mie_cdf = mie_nc.get_dimension_size("n_ang_cdf");
771772
const int n_sub = mie_nc.get_dimension_size("sub_band");
772773

773-
Array<Float,3> mie_cdf(mie_nc.get_variable<Float>("phase_cdf", {n_bnd_sw, n_sub, n_mie}), {n_mie, n_sub, n_bnd_sw});
774-
Array<Float,4> mie_ang(mie_nc.get_variable<Float>("phase_cdf_angle", {n_bnd_sw, n_sub, n_re, n_mie}), {n_mie, n_re, n_sub, n_bnd_sw});
774+
Array<Float,3> mie_cdf(mie_nc.get_variable<Float>("phase_cdf", {n_bnd_sw, n_sub, n_mie_cdf}), {n_mie_cdf, n_sub, n_bnd_sw});
775+
Array<Float,4> mie_ang(mie_nc.get_variable<Float>("phase_cdf_angle", {n_bnd_sw, n_sub, n_re, n_mie_cdf}), {n_mie_cdf, n_re, n_sub, n_bnd_sw});
775776

776777
Array<Float,4> mie_phase(mie_nc.get_variable<Float>("phase", {n_bnd_sw, n_sub, n_re, n_mie}), {n_mie, n_re, n_sub, n_bnd_sw});
777778
Array<Float,1> mie_phase_ang(mie_nc.get_variable<Float>("phase_angle", {n_mie}), {n_mie});
@@ -828,7 +829,8 @@ void Radiation_solver_shortwave::solve_gpu(
828829
const int n_gpt = this->kdist_gpu->get_ngpt();
829830
const int n_bnd = this->kdist_gpu->get_nband();
830831

831-
const int n_mie = (switch_cloud_mie) ? this->mie_angs.dim(1) : 0;
832+
const int n_mie = (switch_cloud_mie) ? this->mie_phase_angs.dim(1) : 0;
833+
const int n_mie_cdf = (switch_cloud_mie) ? this->mie_angs.dim(1) : 0;
832834
const int n_re = (switch_cloud_mie) ? this->mie_angs.dim(2) : 0;
833835
const int n_sub = (switch_cloud_mie) ? this->mie_angs.dim(3) : 3;
834836

@@ -1029,8 +1031,8 @@ void Radiation_solver_shortwave::solve_gpu(
10291031

10301032
if (switch_cloud_mie)
10311033
{
1032-
mie_cdfs_sub = mie_cdfs.subset({{ {1, n_mie}, {iwv+1,iwv+1}, {band, band} }});
1033-
mie_angs_sub = mie_angs.subset({{ {1, n_mie}, {1, n_re}, {iwv+1,iwv+1}, {band, band} }});
1034+
mie_cdfs_sub = mie_cdfs.subset({{ {1, n_mie_cdf}, {iwv+1,iwv+1}, {band, band} }});
1035+
mie_angs_sub = mie_angs.subset({{ {1, n_mie_cdf}, {1, n_re}, {iwv+1,iwv+1}, {band, band} }});
10341036
mie_phase_sub = mie_phase.subset({{ {1, n_mie}, {1, n_re}, {iwv+1,iwv+1}, {band, band} }});
10351037
}
10361038

0 commit comments

Comments
 (0)