Skip to content

Commit

Permalink
Fix without moisture.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Lattanzi committed Dec 7, 2023
1 parent 52c1489 commit cb0525c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Source/Initialization/ERF_init_from_input_sounding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,7 @@ init_bx_scalars_from_input_sounding_hse (const amrex::Box &bx,
const Real* z_inp_sound = inputSoundingData.z_inp_sound_d.dataPtr();
const Real* rho_inp_sound = inputSoundingData.rho_inp_sound_d.dataPtr();
const Real* theta_inp_sound = inputSoundingData.theta_inp_sound_d.dataPtr();
#if defined(ERF_USE_MOISTURE)
const Real* qv_inp_sound = inputSoundingData.qv_inp_sound_d.dataPtr();
#elif defined(ERF_USE_WARM_NO_PRECIP)
#if defined(ERF_USE_MOISTURE) || defined(ERF_USE_WARM_NO_PRECIP)
const Real* qv_inp_sound = inputSoundingData.qv_inp_sound_d.dataPtr();
#endif
const int inp_sound_size = inputSoundingData.size();
Expand Down Expand Up @@ -212,7 +210,10 @@ init_bx_scalars_from_input_sounding_hse (const amrex::Box &bx,
state(i, j, k, RhoScalar_comp) = 0;

// Update hse quantities with values calculated from InputSoundingData.calc_rho_p()
qv_k = 0.0;
#if defined(ERF_USE_MOISTURE) || defined(ERF_USE_WARM_NO_PRECIP)
qv_k = interpolate_1d(z_inp_sound, qv_inp_sound, z, inp_sound_size);
#endif
r_hse_arr (i, j, k) = rho_k * (1.0 + qv_k);
p_hse_arr (i, j, k) = getPgivenRTh(rhoTh_k, qv_k); // NOTE WE ONLY USE THE DRY AIR PRESSURE
pi_hse_arr(i, j, k) = getExnergivenRTh(rhoTh_k, l_rdOcp, qv_k);
Expand Down

0 comments on commit cb0525c

Please sign in to comment.