@@ -1935,6 +1935,10 @@ ERF::Write2DPlotFile (int which, PlotFileType plotfile_type, Vector<std::string>
19351935 // Set all components to zero in case they aren't defined below
19361936 mf[lev].setVal (0.0 );
19371937
1938+ // Expose domain khi and klo at each level
1939+ int klo = geom[lev].Domain ().smallEnd (2 );
1940+ int khi = geom[lev].Domain ().bigEnd (2 );
1941+
19381942 if (containerHasElement (plot_var_names, " z_surf" )) {
19391943#ifdef _OPENMP
19401944#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
@@ -2204,6 +2208,87 @@ ERF::Write2DPlotFile (int which, PlotFileType plotfile_type, Vector<std::string>
22042208 }
22052209 mf_comp++;
22062210 } // z0
2211+
2212+ if (containerHasElement (plot_var_names, " OLR" )) {
2213+ #ifdef _OPENMP
2214+ #pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
2215+ #endif
2216+ if (solverChoice.rad_type != RadiationType::None) {
2217+ for ( MFIter mfi (mf[lev],TilingIfNotGPU ()); mfi.isValid (); ++mfi)
2218+ {
2219+ const Box& bx = mfi.tilebox ();
2220+ const auto & derdat = mf[lev].array (mfi);
2221+ const auto & olr = rad_fluxes[lev]->const_array (mfi);
2222+ ParallelFor (bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
2223+ derdat (i, j, k, mf_comp) = olr (i, j, khi, 2 );
2224+ });
2225+ }
2226+ } else {
2227+ mf[lev].setVal (-999 ,mf_comp,1 ,0 );
2228+ }
2229+ mf_comp++;
2230+ } // OLR
2231+
2232+ if (containerHasElement (plot_var_names, " sens_flux" )) {
2233+ #ifdef _OPENMP
2234+ #pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
2235+ #endif
2236+ if (SFS_hfx3_lev[lev]) {
2237+ for ( MFIter mfi (mf[lev],TilingIfNotGPU ()); mfi.isValid (); ++mfi)
2238+ {
2239+ const Box& bx = mfi.tilebox ();
2240+ const auto & derdat = mf[lev].array (mfi);
2241+ const auto & hfx_arr = SFS_hfx3_lev[lev]->const_array (mfi);
2242+ ParallelFor (bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
2243+ derdat (i, j, k, mf_comp) = hfx_arr (i, j, klo);
2244+ });
2245+ }
2246+ } else {
2247+ mf[lev].setVal (-999 ,mf_comp,1 ,0 );
2248+ }
2249+ mf_comp++;
2250+ } // sens_flux
2251+
2252+ if (containerHasElement (plot_var_names, " laten_flux" )) {
2253+ #ifdef _OPENMP
2254+ #pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
2255+ #endif
2256+ if (SFS_hfx3_lev[lev]) {
2257+ for ( MFIter mfi (mf[lev],TilingIfNotGPU ()); mfi.isValid (); ++mfi)
2258+ {
2259+ const Box& bx = mfi.tilebox ();
2260+ const auto & derdat = mf[lev].array (mfi);
2261+ const auto & qfx_arr = SFS_q1fx3_lev[lev]->const_array (mfi);
2262+ ParallelFor (bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
2263+ derdat (i, j, k, mf_comp) = qfx_arr (i, j, klo);
2264+ });
2265+ }
2266+ } else {
2267+ mf[lev].setVal (-999 ,mf_comp,1 ,0 );
2268+ }
2269+ mf_comp++;
2270+ } // laten_flux
2271+
2272+ if (containerHasElement (plot_var_names, " surf_pres" )) {
2273+ #ifdef _OPENMP
2274+ #pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
2275+ #endif
2276+ bool moist = (solverChoice.moisture_type != MoistureType::None);
2277+ for ( MFIter mfi (mf[lev],TilingIfNotGPU ()); mfi.isValid (); ++mfi)
2278+ {
2279+ const Box& bx = mfi.tilebox ();
2280+ const auto & derdat = mf[lev].array (mfi);
2281+ const auto & cons_arr = vars_new[lev][Vars::cons].const_array (mfi);
2282+ ParallelFor (bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
2283+ auto rt = cons_arr (i,j,klo,RhoTheta_comp);
2284+ auto qv = (moist) ? cons_arr (i,j,klo,RhoQ1_comp)/cons_arr (i,j,klo,Rho_comp)
2285+ : 0.0 ;
2286+ derdat (i, j, k, mf_comp) = getPgivenRTh (rt, qv);
2287+ });
2288+ }
2289+ mf_comp++;
2290+ } // surf_pres
2291+
22072292 } // lev
22082293
22092294 std::string plotfilename;
0 commit comments