29 const int khi = geom.Domain().bigEnd()[AMREX_SPACEDIM-1];
30 const int Nz = geom.Domain().size()[AMREX_SPACEDIM-1];
31 const amrex::Real dz = geom.CellSize()[AMREX_SPACEDIM-1];
33 const bool use_terrain = (zlevels_stag.size() > 0);
34 const amrex::Real zbot = (use_terrain) ? zlevels_stag[klo] : geom.ProbLo(AMREX_SPACEDIM-1);
35 const amrex::Real ztop = (use_terrain) ? zlevels_stag[khi+1] : geom.ProbHi(AMREX_SPACEDIM-1);
44 amrex::Print() <<
"input_sounding file location : " << input_sounding_file << std::endl;
45 std::ifstream input_sounding_reader(input_sounding_file);
46 if(!input_sounding_reader.is_open()) {
47 amrex::Error(
"Error opening the input_sounding file\n");
51 amrex::Print() <<
"Successfully opened the input_sounding file. Now reading... " << std::endl;
56 amrex::Vector<amrex::Real> z_inp_sound_tmp, theta_inp_sound_tmp, qv_inp_sound_tmp,
57 U_inp_sound_tmp, V_inp_sound_tmp;
60 std::getline(input_sounding_reader, line);
61 std::istringstream iss(line);
67 z_inp_sound_tmp.push_back(zbot);
70 U_inp_sound_tmp.push_back(0);
71 V_inp_sound_tmp.push_back(0);
75 while(std::getline(input_sounding_reader, line)) {
76 std::istringstream iss_z(line);
79 AMREX_ALWAYS_ASSERT(
theta == theta_inp_sound_tmp[0]);
80 AMREX_ALWAYS_ASSERT(
qv*0.001 == qv_inp_sound_tmp[0]);
81 U_inp_sound_tmp[0] =
U;
82 V_inp_sound_tmp[0] =
V;
84 AMREX_ALWAYS_ASSERT(
z > z_inp_sound_tmp[z_inp_sound_tmp.size()-1]);
85 z_inp_sound_tmp.push_back(
z);
86 theta_inp_sound_tmp.push_back(
theta);
87 qv_inp_sound_tmp.push_back(
qv*0.001);
88 U_inp_sound_tmp.push_back(
U);
89 V_inp_sound_tmp.push_back(
V);
96 const int Ninp = z_inp_sound_tmp.size();
102 for (
int k=0; k < Nz; ++k) {
103 z_inp_sound[k+1] = (use_terrain) ? 0.5 * (zlevels_stag[k] + zlevels_stag[k+1])
104 : zbot + (k + 0.5) * dz;
117 amrex::Print() <<
"Successfully read the input_sounding file..." << std::endl;
118 input_sounding_reader.close();
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real interpolate_1d(const amrex::Real *alpha, const amrex::Real *beta, const amrex::Real alpha_interp, const int alpha_size)
Definition: Interpolation_1D.H:12
@ theta
Definition: MM5.H:20
@ U
Definition: IndexDefines.H:64
@ V
Definition: IndexDefines.H:65