Skip to content

Commit cf1bb96

Browse files
committed
initial commit
1 parent 99c83d9 commit cf1bb96

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

src_test/test_rte_rrtmgp_rt.cu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,7 @@ void solve_radiation(int argc, char** argv)
544544
t_lay = t_lay_out;
545545
t_lev = t_lev_out;
546546
gas_concs = gas_concs_out;
547+
aerosol_concs = gas_concs_out;
547548

548549
}
549550

src_tilt/tilt_utils.cpp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,24 @@ void tilt_fields(const int n_z_in, const int n_zh_in, const int n_col_x, const i
569569
t_lev_copy->expand_dims({n_col, n_zh_tilt});
570570
p_lay_copy->expand_dims({n_col, n_z_tilt});
571571
p_lev_copy->expand_dims({n_col, n_zh_tilt});
572+
573+
for (int ilay=0; ilay<n_zh_tilt; ++ilay) {
574+
for (int iy=0; iy<n_col_y; ++iy) {
575+
for (int ix=0; ix<n_col_x; ++ix) {
576+
if (ilay > 0) {
577+
const int curr_idx = ix + iy*n_col_x + ilay*n_col_x*n_col_y;
578+
const int prev_idx = ix + iy*n_col_x + (ilay-1)*n_col_x*n_col_y;
579+
if (p_lev_copy->v()[curr_idx] == p_lev_copy->v()[prev_idx]) {
580+
p_lev_copy->v()[curr_idx] = p_lev_copy->v()[prev_idx] * 0.99999;
581+
}
582+
else if (p_lev_copy->v()[curr_idx] > p_lev_copy->v()[prev_idx])
583+
{
584+
throw std::runtime_error("Pressure INCREASED at layer " + std::to_string(ilay));
585+
}
586+
}
587+
}
588+
}
589+
}
572590
}
573591

574592
void compress_fields(const int compress_lay_start_idx, const int n_col_x, const int n_col_y,
@@ -1019,7 +1037,7 @@ void tica_tilt(
10191037
for (int k = 0; k < num_inputs; ++k)
10201038
{
10211039
int in_idx = (i_lay_in + k);
1022-
avg += var_rel_out[in_idx];
1040+
avg += var_rel_tmp[in_idx];
10231041
}
10241042
var_rel_out[ilay] = avg / num_inputs;
10251043
}

0 commit comments

Comments
 (0)