ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF.H
Go to the documentation of this file.
1 #ifndef ERF_H_
2 #define ERF_H_
3 
4 #include <string>
5 #include <limits>
6 #include <memory>
7 #include <set>
8 
9 #ifdef _OPENMP
10 #include <omp.h>
11 #endif
12 
13 #include <AMReX_AmrCore.H>
14 #include <AMReX_BCRec.H>
15 #include <AMReX_Print.H>
16 
17 #include <AMReX_ParallelDescriptor.H>
18 #include <AMReX_ParmParse.H>
19 #include <AMReX_MultiFabUtil.H>
20 #include <AMReX_FillPatchUtil.H>
21 #include <AMReX_VisMF.H>
22 #include <AMReX_PhysBCFunct.H>
23 #include <AMReX_YAFluxRegister.H>
24 #include <AMReX_ErrorList.H>
25 #include <AMReX_EBFabFactory.H>
26 #include <AMReX_EBMultiFabUtil.H>
27 #include <AMReX_TableData.H>
28 
29 #include <ERF_EB.H>
31 #include "Prob/ERF_CloudChamber.H"
32 
33 #ifdef ERF_USE_FFT
34 #include <AMReX_FFT_Poisson.H>
35 #endif
36 
37 #ifdef AMREX_MEM_PROFILING
38 #include <AMReX_MemProfiler.H>
39 #endif
40 
41 #include "ERF_ProbCommon.H"
42 
43 #include <ERF_NumericalConstants.H>
44 #include <ERF_IndexDefines.H>
45 #include <ERF_DataStruct.H>
46 #include <ERF_BaseStateParams.H>
47 #include <ERF_TurbPertStruct.H>
48 #include <ERF_InputSoundingData.H>
50 #include <ERF_InputSpongeData.H>
51 #include <ERF_SurfaceLayer.H>
52 #include <ERF_Derive.H>
53 #include <ERF_ReadBndryPlanes.H>
54 #include <ERF_WriteBndryPlanes.H>
55 #include <ERF_MRI.H>
56 #include <ERF_PhysBCFunct.H>
57 #include <ERF_WallScalarBC.H>
58 #include <ERF_FillPatcher.H>
59 #include <ERF_SampleData.H>
60 #include <ERF_StationSampler.H>
61 #include <ERF_ObsNudging.H>
62 #include <ERF_ForestDrag.H>
63 #include <ERF_IBFaceSet.H>
64 #include <ERF_Provenance.H>
65 
66 #ifdef ERF_USE_PARTICLES
67 #include "ERF_ParticleData.H"
68 #endif
69 
72 #include "ERF_LandSurface.H"
73 #include "ERF_Urban.H"
74 #include "ERF_TwoStreamRadiation.H"
75 
76 #ifdef ERF_USE_WINDFARM
77 #include "ERF_WindFarm.H"
78 #endif
79 #include <ERF_SurfaceModel.H>
80 
81 #include <ERF_RadiationModels.H>
82 
83 #ifdef ERF_USE_EAMXX_SHOC
84 #include "ERF_ShocInterface.H"
85 #endif
86 
87 #include "ERF_ShocDriver.H"
89 
90 #include <iostream>
91 
92 #ifdef AMREX_LAZY
93 #include <AMReX_Lazy.H>
94 #endif
95 
96 #ifndef AMREX_USE_MPI
97 using amrex::MPI_COMM_WORLD;
98 using amrex::MPI_Comm;
99 #endif
100 
101 #ifdef ERF_USE_MULTIBLOCK
102 class MultiBlockContainer;
103 #endif
104 
105 // Describes one component of a 2D plotfile; defined in
106 // IO/ERF_Plotfile2DSampledLevel.H, which ERF.H does not need to include.
108 namespace erf_sbm { class SBMStateManager; class SBMTransport; }
109 
110 /**
111  * Enum of possible interpolation types between coarse/fine
112 */
113 AMREX_ENUM(StateInterpType,
114  FullState, Perturbational
115 );
116 
117 /**
118  * Main class in ERF code, instantiated from main.cpp
119 */
120 
121 class ERF
122  : public amrex::AmrCore
123 {
124 public:
125 
126  ////////////////
127  // public member functions
128 
129  // constructor - reads in parameters from inputs file
130  // - sizes multilevel arrays and data structures
131  ERF ();
132  ~ERF () override;
133 
134  void ERF_shared ();
135 
136  // Declare a default move constructor so we ensure the destructor is
137  // not called when we return an object of this class by value
138  ERF (ERF&&) noexcept = delete;
139 
140  // Declare a default move assignment operator
141  ERF& operator= (ERF&& other) noexcept = delete;
142 
143  // Delete the copy constructor
144  ERF (const ERF& other) = delete;
145  //
146  // Delete the copy assignment operator
147  ERF& operator= (const ERF& other) = delete;
148 
149  // Advance solution to final time
150  void Evolve ();
151  double EvolveOneStep (double time, double dt_request);
152 
153  void ConfigureDriverAtmosToOceanCoupling (bool use_coupling_driver,
154  bool use_two_way_coupling,
155  bool use_state_contract);
156  void SetDriverAtmosToOceanStateContract (bool use_state_contract);
157  // Driver currently consumes BoxArray/DistributionMapping only. If we later
158  // need exact copy semantics, promote this to expose IndexType/ngrow
159  // explicitly or return the underlying MultiFab pointer/reference instead.
160  void GetOceanToAtmosSurfaceLayout (amrex::BoxArray& ba,
161  amrex::DistributionMapping& dm);
162  // Returns pointers to level-0 lon_m/lat_m coordinate MultiFabs (populated
163  // by the WRF-grid init paths, e.g. ERF_InitFromWRFInput.cpp/ERF_InitFromMetgrid.cpp)
164  // used to build ocean->atmos remap weights. Sets both to nullptr if
165  // unavailable (e.g. idealized/non-WRF configurations).
166  //
167  // Staggering contract: both MultiFabs carry CELL index type and hold
168  // mass-point values whichever init path filled them -- init_from_wrfinput
169  // reads WRF's XLONG / XLAT and init_from_metgrid reads XLONG_M / XLAT_M.
170  // Ghost cells at the domain boundary are clamped copies of the edge cell,
171  // not extrapolations. These are not corners: a caller building a corner
172  // mesh must derive the corners itself. The name says cell centers so that a
173  // caller written against the old edge-staggered contract fails to compile
174  // instead of silently building its mesh half a cell off.
175  void GetOceanToAtmosCellCenterLonLat (const amrex::MultiFab*& lon_cc,
176  const amrex::MultiFab*& lat_cc) const;
177 
178  // Returns the level-0, current-time land mask (1 = land, 0 = water) used
179  // by the driver to exclude land cells from atmos->ocean remap stencils.
180  // Sets lmask to nullptr if unavailable.
181  void GetLandMask (const amrex::iMultiFab*& lmask) const;
182 
183  // True when a radiation model is *configured* at level 0. A coupling driver
184  // needs this to know whether the SWrad/LWrad lanes it would hand an ocean
185  // model carry real values or just zeros: passing zeros is worse than passing
186  // nothing, because the ocean model then suppresses its own radiative forcing
187  // in favour of them.
188  //
189  // Note this is a configuration predicate, not a data-validity one. rad_fluxes
190  // is allocated and zero-filled as soon as solverChoice.rad_type != None, so
191  // this returns true from level-0 allocation onward - including before the
192  // first AdvanceRadiation, when the fluxes are still exactly zero. A caller
193  // that needs "the lanes hold real radiation" must additionally know that a
194  // radiation step has run.
195  [[nodiscard]] bool HasRadiation () const {
196  return (!rad_fluxes.empty() && rad_fluxes[0] != nullptr);
197  }
198 
199  // Whether ERF can pack cloud fraction on the atmos->ocean Cloud lane. The
200  // pack fills that lane only when moisture is active AND the moisture model
201  // carries cloud liquid or ice, so this mirrors that condition exactly; a
202  // driver that handed the lane over regardless would be passing its own
203  // prefill as though it were an ERF value.
204  //
205  // Like HasRadiation, this is a configuration predicate rather than a
206  // data-validity one: it says the lane will be filled, not that any moisture
207  // step has run yet.
208  [[nodiscard]] bool HasCloudWater () const {
212  }
213 
214  // Which atmos->ocean lanes PackAtmosphericStates actually writes here, as
215  // 0/1 in that routine's slot order: the 9-lane state view when
216  // state_contract, else the 8-lane flux view.
217  //
218  // A lane reported 0 is one the pack leaves untouched, so handing it over
219  // would pass the driver's own prefill off as an atmospheric value.
220  // HasRadiation()/HasCloudWater() answer this for two lanes; this covers all
221  // of them, and lives beside the pack so the gates cannot drift apart.
222  void GetFillableAtmosToOceanLanes (bool state_contract,
223  amrex::Vector<int>& can_fill) const;
224 
225  // weight_mf/index_mf are keyed by WeightFamily slot order
226  // {SCALAR_CENTERED, TAUX_FACE, TAUY_FACE, WIND_FACE_TO_CENTER} as built by
227  // the driver's ERFRemoraMultiBlockContainer::BuildRemapWeights(); each
228  // lane below picks the pair matching its own destination stagger.
229  // dst_mskr/dst_msku/dst_mskv are REMORA wet/dry masks (1 = wet, 0 = land)
230  // on the rho/u-face/v-face destination layouts. dst_msku/dst_mskv are applied
231  // to the TauX/TauY lanes; dst_mskr is applied to the rho-centred *scalar* lanes
232  // (Patm, Tair, cloud, and the scalar flux lanes) but deliberately NOT to
233  // Uwind/Vwind, which are also rho-centred - so the wind lanes carry live
234  // atmospheric values over REMORA land while Patm/Tair carry fallbacks there.
235  // REMORA re-masks on its own side, so this asymmetry is currently harmless.
236  // Pass nullptr to skip masking.
237  void PackAtmosphericStates (amrex::Vector<amrex::MultiFab*>& states, double time,
238  const amrex::Vector<const amrex::MultiFab*>& weight_mf,
239  const amrex::Vector<const amrex::iMultiFab*>& index_mf,
240  int max_stencil_size,
241  const amrex::MultiFab* dst_mskr = nullptr,
242  const amrex::MultiFab* dst_msku = nullptr,
243  const amrex::MultiFab* dst_mskv = nullptr);
244  // Apply ocean-model sea-surface temperature to the ERF lower boundary.
245  //
246  // state[0] carries SST in Kelvin on the layout reported by
247  // GetOceanToAtmosSurfaceLayout. erf_coverage is the per-cell coverage flag on
248  // that same layout: nonzero where the driver's remap found at least one
249  // ocean donor for that ERF cell.
250  //
251  // Coverage is a contract, not a hint. Where erf_coverage is zero the ocean
252  // supplied nothing and state[0] holds the remap's zero fill, which is
253  // indistinguishable from a computed zero; ERF keeps its own wrflowinp SST
254  // there instead. Passing erf_coverage = nullptr therefore means "no cell is
255  // covered", not "every cell is covered" -- a driver that has coverage
256  // information must pass it.
257  void ApplyOceanSurfaceState (const amrex::Vector<amrex::MultiFab*>& state,
258  double time,
259  const amrex::iMultiFab* erf_coverage = nullptr);
260 
261  // Tag cells for refinement
262  void ErrorEst (int lev, amrex::TagBoxArray& tags, amrex::Real time, int ngrow) override;
263 
264  // Tag cells in a given box
265  void read_box_for_refinement (std::string& ref_prefix, int& lev_for_box, amrex::RealBox& real_box);
266  void update_box_for_refinement (std::string& ref_prefix, int& lev_for_box, amrex::RealBox& real_box, const double time);
267 
268  // Refinement criteria for hurricanes
269  void HurricaneTracker (int lev,
270  double time,
271  const amrex::MultiFab& cc_vel,
272  const amrex::Real velmag_threshold,
273  amrex::TagBoxArray* tags = nullptr);
274 
275  bool FindInitialEye (int lev,
276  const amrex::MultiFab& cc_vel,
277  const amrex::Real velmag_threshold,
278  amrex::Real& eye_x, amrex::Real& eye_y);
279 
280  // Hurricane track line output as VTKPolyline
281  amrex::Vector<std::array<amrex::Real, 2>> hurricane_track_xy;
282  amrex::Vector<std::array<amrex::Real, 2>> hurricane_eye_track_xy,
287  amrex::Vector<amrex::MultiFab> weather_forecast_data_1, weather_forecast_data_2;
288  amrex::Vector<amrex::Vector<amrex::MultiFab>> forecast_state_1,
291  amrex::Vector<amrex::MultiFab> surface_state_1,
294 
295  amrex::Vector<amrex::Vector<amrex::MultiFab>> bckgnd_state;
296 
297  std::string MakeVTKFilename (int nstep);
298  std::string MakeVTKFilename_TrackerCircle (int nstep);
299  std::string MakeVTKFilename_EyeTracker_xy (int nstep);
300  std::string MakeFilename_EyeTracker_latlon (int nstep);
301  std::string MakeFilename_EyeTracker_maxvel (int nstep);
302  std::string MakeFilename_EyeTracker_minpressure (int nstep);
303  void WriteVTKPolyline (const std::string& filename,
304  amrex::Vector<std::array<amrex::Real, 2>>& points_xy);
305 
306  void WriteLinePlot (const std::string& filename,
307  amrex::Vector<std::array<amrex::Real, 2>>& points_xy);
308 
310  const amrex::MultiFab& mf_cc_vel);
311 
313  const amrex::Geometry& geom,
314  const amrex::Vector<amrex::MultiFab>& S_data,
315  const amrex::Real& hurricane_eye_latitude,
316  const amrex::Real& hurricane_eye_longitude);
317 
319  const amrex::Geometry& geom,
320  const amrex::MultiFab& mf_cc_vel,
321  const amrex::Vector<amrex::MultiFab>& S_data);
322 
323  void ComputeGlobalMinLocation (const SolverChoice& sc,
324  const amrex::Geometry& geom,
325  const amrex::Vector<amrex::MultiFab>& S_data,
326  amrex::Real* d_val_min_ptr,
327  int* d_i_min_ptr,
328  int* d_j_min_ptr,
329  amrex::Real& global_val_min,
330  int& global_i_min,
331  int& global_j_min);
332 
333  void HurricaneMaxVelTracker (const amrex::Geometry& geom,
334  const amrex::MultiFab& mf_cc_vel,
335  const double& time);
336 
337  void HurricaneMinPressureTracker (MoistureType moisture_type,
338  const amrex::Geometry& geom,
339  const amrex::MultiFab& mf_cons_var,
340  const double& time);
341 
342  void HurricaneTrackerCircle ();
343 
344  void ReadStormTrackerRestart ();
345 
346  // Initialize multilevel data
347  void InitData ();
348 
349  // Initialize multilevel data before MultiBlock
350  void InitData_pre ();
351 
352  // Initialize multilevel data after MultiBlock
353  void InitData_post ();
354 
355  // Interpolate 2D arrays lat_m, lon_m, sinPhi, cosPhi
356  void Interp2DArrays (int lev, const amrex::BoxArray& my_ba2d, const amrex::DistributionMapping& my_dm);
357 
358  // Fill the map factors at lev by interpolation from lev-1
359  void interp_mapfac_from_coarse (int lev);
360 
361  // Fill the surface pressure at lev by interpolation from lev-1
362  void interp_psfc_from_coarse (int lev);
363 
364  // Fill the land mask and the land / soil types at lev by injection from lev-1
365  void interp_land_masks_from_coarse (int lev);
366 
367  // True if this level read its own initialization file, so its map factors
368  // came from that file rather than from its parent
369  bool has_own_init_file (int lev) const;
370 
372 
373  // Compute the divergence -- whether EB, no-terrain, flat terrain or general terrain
374  void compute_divergence (int lev, amrex::MultiFab& rhs,
375  amrex::Array<amrex::MultiFab const*,AMREX_SPACEDIM> rho0_u_const,
376  amrex::MultiFab const& mf_mx, amrex::MultiFab const& mf_my,
377  amrex::MultiFab const& mf_vx, amrex::MultiFab const& mf_uy,
378  amrex::MultiFab const& ax_in, amrex::MultiFab const& ay_in,
379  amrex::MultiFab const& dJ_in,
380  amrex::Geometry const& geom_at_lev);
381 
382  // Project the velocities to be divergence-free -- this is only relevant if anelastic == 1
383  void project_initial_velocity (int lev, double time, double dt);
384  void project_momenta (int lev, double l_time, double l_dt, amrex::Vector<amrex::MultiFab >& vars);
385 
386  // Project the velocities to be divergence-free with a thin body
387  void project_velocity_tb (int lev, double dt, amrex::Vector<amrex::MultiFab >& vars);
388 
389  // Calculate wall distance by solving a Poisson equation
390  void poisson_wall_dist (int lev);
391 
392  void make_subdomains (const amrex::BoxList& ba, amrex::Vector<amrex::BoxArray>& bins);
393 
394 #ifdef ERF_USE_FFT
395  void build_fft_solvers (int lev);
396  void solve_with_fft (int lev, int isub, const amrex::Box& subdomain,
397  amrex::MultiFab& rhs, amrex::MultiFab& p,
398  amrex::Array<amrex::MultiFab,AMREX_SPACEDIM>& fluxes);
399 #endif
400  void solve_with_gmres (int lev, const amrex::Box& subdomain,
401  amrex::MultiFab& rhs, amrex::MultiFab& p,
402  amrex::Array<amrex::MultiFab,AMREX_SPACEDIM>& fluxes,
403  amrex::MultiFab& ax_sub, amrex::MultiFab& ay_sub,
404  amrex::MultiFab& az_sub,
405  amrex::MultiFab& /*dJ_sub*/, amrex::MultiFab& znd_sub);
406 
407  void ImposeBCsOnPhi (int lev, amrex::MultiFab& phi, const amrex::Box& subdomain);
408 
409  // Init (NOT restart or regrid)
410  void init_only (int lev, double time);
411 
412  // Restart
413  void restart ();
414 
415  // Check for NaNs and other bad stuff
416  void check_state_for_nans (amrex::MultiFab const& S);
417  void check_vels_for_nans (amrex::MultiFab const& xvel, amrex::MultiFab const& yvel, amrex::MultiFab const& zvel);
418  void check_for_negative_theta (amrex::MultiFab& S);
419  void check_for_low_temp (amrex::MultiFab& S);
420 
422 
423  // Max of (buoyancy - vertical gradient of perturbational pressure);
424  // this is identically zero if the state is in HSE and buoyancy_type = 1
426 
427  void check_mesh_type (int lev);
428 
429  // Is it time to write a plotfile or checkpoint?
430  // Note that "cur_time" is always in double precision
431  bool writeNow (double cur_time, const int nstep, const int plot_int,
432  const double plot_per, const double dt_0, double& last_file_time);
433 
434  //! True when a level cannot sweep radiation itself -- no box on it holds a whole
435  //! column -- and so takes its radiation fields by interpolation from its parent.
436  [[nodiscard]] bool rad_level_needs_interpolation (int lev) const;
437 
438  //! Fill a newly built level's two-stream SEB state from its parent
439  void fill_seb_from_coarse (int lev);
440 
441  //! With erf.radiation.seb_surface_layer_uses_skin, hand the two-stream surface energy
442  //! balance's skin temperature of level lev to the zlo surface layer before it
443  //! computes its fluxes
444  void set_surface_layer_skin (int lev);
445 
446  //! Start-up checks of the two-stream balance's coupling with the zlo surface layer:
447  //! warnings for a scalar default the surface layer's flux replaces and for rotated
448  //! surface fluxes, aborts for erf.radiation.seb_surface_layer_uses_skin conflicts
449  void check_seb_surface_layer ();
450 
451  //! check_seb_surface_layer has run
453 
454  //! Per level: the "takes its radiation from its parent, no skin coupling" warning
455  //! of set_surface_layer_skin has been printed since the level last coupled
456  amrex::Vector<int> m_skin_uncoupled_warned;
457 
458  //! The zlo surface layer's applied heat and moisture fluxes for the two-stream
459  //! surface energy balance's H and LE, or nullptr where it applies none
460  void seb_surface_layer_fluxes (int lev,
461  const amrex::MultiFab*& sens_flux,
462  const amrex::MultiFab*& laten_flux) const;
463 
464  //! The conservative surface heat and moisture fluxes (z faces) applied to level
465  //! lev, or nullptr where there is none. The sensible_heat_flux/latent_heat_flux
466  //! 2D outputs and the two-stream surface energy balance both read them here.
467  void surface_flux_sources (int lev,
468  const amrex::MultiFab*& sens_flux,
469  const amrex::MultiFab*& laten_flux) const;
470 
471  // Called after every level 0 timestep
472  void post_timestep (int nstep, double time, double dt_lev);
473 
474  // Do whatever writing needs to be done at intermediate times
475  void WriteAtIntermediateTime (int nstep, double time);
476 
477  // Do whatever writing needs to be done after time-stepping is complete
478  void WriteAtFinalTime ();
479 
480  // Diagnostics
481  void sum_integrated_quantities (double time);
482  void sum_derived_quantities (double time);
483  void sum_energy_quantities (double time);
484 
485  void write_1D_profiles (double time);
486  void write_1D_profiles_stag (double time);
487 
488  amrex::Real cloud_fraction (double time);
489 
490  // Fill the physical boundary conditions for cell-centered velocity (diagnostic only)
491  void FillBdyCCVels (amrex::MultiFab& mf_cc_vel, amrex::Geometry& lev_geom);
492 
493  void sample_points (int lev, double time, amrex::IntVect cell, amrex::MultiFab& mf);
494  void sample_lines (int lev, double time, amrex::IntVect cell, amrex::MultiFab& mf);
495 
496  void derive_diag_profiles (double time,
497  amrex::Gpu::HostVector<amrex::Real>& h_avg_u , amrex::Gpu::HostVector<amrex::Real>& h_avg_v,
498  amrex::Gpu::HostVector<amrex::Real>& h_avg_w , amrex::Gpu::HostVector<amrex::Real>& h_avg_rho,
499  amrex::Gpu::HostVector<amrex::Real>& h_avg_th , amrex::Gpu::HostVector<amrex::Real>& h_avg_ksgs,
500  amrex::Gpu::HostVector<amrex::Real>& h_avg_Kmv , amrex::Gpu::HostVector<amrex::Real>& h_avg_Khv,
501  amrex::Gpu::HostVector<amrex::Real>& h_avg_qv , amrex::Gpu::HostVector<amrex::Real>& h_avg_qc,
502  amrex::Gpu::HostVector<amrex::Real>& h_avg_qr ,
503  amrex::Gpu::HostVector<amrex::Real>& h_avg_wqv , amrex::Gpu::HostVector<amrex::Real>& h_avg_wqc,
504  amrex::Gpu::HostVector<amrex::Real>& h_avg_wqr ,
505  amrex::Gpu::HostVector<amrex::Real>& h_avg_qi , amrex::Gpu::HostVector<amrex::Real>& h_avg_qs,
506  amrex::Gpu::HostVector<amrex::Real>& h_avg_qg ,
507  amrex::Gpu::HostVector<amrex::Real>& h_avg_uu , amrex::Gpu::HostVector<amrex::Real>& h_avg_uv,
508  amrex::Gpu::HostVector<amrex::Real>& h_avg_uw,
509  amrex::Gpu::HostVector<amrex::Real>& h_avg_vv , amrex::Gpu::HostVector<amrex::Real>& h_avg_vw,
510  amrex::Gpu::HostVector<amrex::Real>& h_avg_ww,
511  amrex::Gpu::HostVector<amrex::Real>& h_avg_uth , amrex::Gpu::HostVector<amrex::Real>& h_avg_vth,
512  amrex::Gpu::HostVector<amrex::Real>& h_avg_wth, amrex::Gpu::HostVector<amrex::Real>& h_avg_thth,
513  amrex::Gpu::HostVector<amrex::Real>& h_avg_ku, amrex::Gpu::HostVector<amrex::Real>& h_avg_kv,
514  amrex::Gpu::HostVector<amrex::Real>& h_avg_kw,
515  amrex::Gpu::HostVector<amrex::Real>& h_avg_p,
516  amrex::Gpu::HostVector<amrex::Real>& h_avg_pu, amrex::Gpu::HostVector<amrex::Real>& h_avg_pv,
517  amrex::Gpu::HostVector<amrex::Real>& h_avg_pw, amrex::Gpu::HostVector<amrex::Real>& h_avg_wthv);
518  void derive_diag_profiles_stag (double time,
519  amrex::Gpu::HostVector<amrex::Real>& h_avg_u , amrex::Gpu::HostVector<amrex::Real>& h_avg_v,
520  amrex::Gpu::HostVector<amrex::Real>& h_avg_w , amrex::Gpu::HostVector<amrex::Real>& h_avg_rho,
521  amrex::Gpu::HostVector<amrex::Real>& h_avg_th , amrex::Gpu::HostVector<amrex::Real>& h_avg_ksgs,
522  amrex::Gpu::HostVector<amrex::Real>& h_avg_Kmv , amrex::Gpu::HostVector<amrex::Real>& h_avg_Khv,
523  amrex::Gpu::HostVector<amrex::Real>& h_avg_qv , amrex::Gpu::HostVector<amrex::Real>& h_avg_qc,
524  amrex::Gpu::HostVector<amrex::Real>& h_avg_qr ,
525  amrex::Gpu::HostVector<amrex::Real>& h_avg_wqv , amrex::Gpu::HostVector<amrex::Real>& h_avg_wqc,
526  amrex::Gpu::HostVector<amrex::Real>& h_avg_wqr ,
527  amrex::Gpu::HostVector<amrex::Real>& h_avg_qi , amrex::Gpu::HostVector<amrex::Real>& h_avg_qs,
528  amrex::Gpu::HostVector<amrex::Real>& h_avg_qg ,
529  amrex::Gpu::HostVector<amrex::Real>& h_avg_uu , amrex::Gpu::HostVector<amrex::Real>& h_avg_uv,
530  amrex::Gpu::HostVector<amrex::Real>& h_avg_uw,
531  amrex::Gpu::HostVector<amrex::Real>& h_avg_vv , amrex::Gpu::HostVector<amrex::Real>& h_avg_vw,
532  amrex::Gpu::HostVector<amrex::Real>& h_avg_ww,
533  amrex::Gpu::HostVector<amrex::Real>& h_avg_uth , amrex::Gpu::HostVector<amrex::Real>& h_avg_vth,
534  amrex::Gpu::HostVector<amrex::Real>& h_avg_wth, amrex::Gpu::HostVector<amrex::Real>& h_avg_thth,
535  amrex::Gpu::HostVector<amrex::Real>& h_avg_ku, amrex::Gpu::HostVector<amrex::Real>& h_avg_kv,
536  amrex::Gpu::HostVector<amrex::Real>& h_avg_kw,
537  amrex::Gpu::HostVector<amrex::Real>& h_avg_p,
538  amrex::Gpu::HostVector<amrex::Real>& h_avg_pu, amrex::Gpu::HostVector<amrex::Real>& h_avg_pv,
539  amrex::Gpu::HostVector<amrex::Real>& h_avg_pw, amrex::Gpu::HostVector<amrex::Real>& h_avg_wthv);
540 
541  void derive_stress_profiles (amrex::Gpu::HostVector<amrex::Real>& h_avg_tau11, amrex::Gpu::HostVector<amrex::Real>& h_avg_tau12,
542  amrex::Gpu::HostVector<amrex::Real>& h_avg_tau13, amrex::Gpu::HostVector<amrex::Real>& h_avg_tau22,
543  amrex::Gpu::HostVector<amrex::Real>& h_avg_tau23, amrex::Gpu::HostVector<amrex::Real>& h_avg_tau33,
544  amrex::Gpu::HostVector<amrex::Real>& h_avg_hfx3, amrex::Gpu::HostVector<amrex::Real>& h_avg_q1fx3,
545  amrex::Gpu::HostVector<amrex::Real>& h_avg_q2fx3, amrex::Gpu::HostVector<amrex::Real>& h_avg_diss);
546  void derive_stress_profiles_stag (amrex::Gpu::HostVector<amrex::Real>& h_avg_tau11, amrex::Gpu::HostVector<amrex::Real>& h_avg_tau12,
547  amrex::Gpu::HostVector<amrex::Real>& h_avg_tau13, amrex::Gpu::HostVector<amrex::Real>& h_avg_tau22,
548  amrex::Gpu::HostVector<amrex::Real>& h_avg_tau23, amrex::Gpu::HostVector<amrex::Real>& h_avg_tau33,
549  amrex::Gpu::HostVector<amrex::Real>& h_avg_hfx3, amrex::Gpu::HostVector<amrex::Real>& h_avg_q1fx3,
550  amrex::Gpu::HostVector<amrex::Real>& h_avg_q2fx3, amrex::Gpu::HostVector<amrex::Real>& h_avg_diss);
551 
552  void derive_forcing_profiles_stag (amrex::Gpu::HostVector<amrex::Real>& h_avg_ttend, amrex::Gpu::HostVector<amrex::Real>& h_avg_qtend,
553  amrex::Gpu::HostVector<amrex::Real>& h_avg_wsub, amrex::Gpu::HostVector<amrex::Real>& h_avg_thtend,
554  amrex::Gpu::HostVector<amrex::Real>& h_avg_qhtend, amrex::Gpu::HostVector<amrex::Real>& h_avg_tvtend,
555  amrex::Gpu::HostVector<amrex::Real>& h_avg_qvtend, amrex::Gpu::HostVector<amrex::Real>& h_avg_qcvtend,
556  amrex::Gpu::HostVector<amrex::Real>& h_avg_tnudge, amrex::Gpu::HostVector<amrex::Real>& h_avg_qnudge,
557  amrex::Gpu::HostVector<amrex::Real>& h_avg_unudge, amrex::Gpu::HostVector<amrex::Real>& h_avg_vnudge);
558 
559  // Perform the volume-weighted sum
561  volWgtSumMF (int lev, const amrex::MultiFab& mf, int comp,
562  const amrex::MultiFab& dJ, const amrex::MultiFab& mfx, const amrex::MultiFab& mfy,
563  bool finemask, bool local = true);
564 
565  void
566  volWgtColumnSum (int lev, const amrex::MultiFab& mf, int comp,
567  amrex::MultiFab& mf_2d, const amrex::MultiFab& dJ);
568 
569  // Decide if it is time to take an action
570  static bool is_it_time_for_action (int nstep, double time, double dt,
571  int action_interval, double action_per);
572 
573  // Make a new level using provided BoxArray and DistributionMapping and
574  // fill with interpolated coarse level data.
575  // overrides the pure virtual function in AmrCore
576  void MakeNewLevelFromCoarse (int lev, amrex::Real time, const amrex::BoxArray& ba,
577  const amrex::DistributionMapping& dm) override;
578 
579  // Remake an existing level using provided BoxArray and DistributionMapping and
580  // fill with existing fine and coarse data.
581  // overrides the pure virtual function in AmrCore
582  void RemakeLevel (int lev, amrex::Real time, const amrex::BoxArray& ba,
583  const amrex::DistributionMapping& dm) override;
584 
585  // Delete level data
586  // overrides the pure virtual function in AmrCore
587  void ClearLevel (int lev) override;
588 
589  // Make a new level from scratch using provided BoxArray and DistributionMapping.
590  // Only used during initialization.
591  // overrides the pure virtual function in AmrCore
592  void MakeNewLevelFromScratch (int lev, amrex::Real time, const amrex::BoxArray& ba,
593  const amrex::DistributionMapping& dm) override;
594 
595  // compute dt from CFL considerations
596  double estTimeStep (int lev, long& dt_fast_ratio) const;
597 
598  // largest explicit eddy-diffusion rates (1/s) on level lev, momentum and scalars, for the
599  // diffusive time-step check (erf.diffusive_dt_check / erf.diffusive_dt_limit)
600  void ComputeDiffusiveRates (int lev, amrex::Real& rate_mom, amrex::Real& rate_scal) const;
601 
602  // print the largest terrain slope factor alpha = h dx/dz on level lev: always when force is
603  // true (new grids), otherwise only if it changed by more than 1 % since the last report
604  void ReportTerrainSlopeFactor (int lev, bool force);
605 
606 #ifdef ERF_USE_WW3_COUPLING
607  //amrex::Print() << " About to call send_to_ww3 from ERF.H" << std::endl;
608  void send_to_ww3 (int lev);
609  //amrex::Print() << " About to call read_waves from ERF.H" << std::endl;
610  void read_waves (int lev);
611  //void send_to_ww3 (int lev);
612  //void read_waves (int lev);
613 
614  //void send_to_ww3 (int lev);
615 #endif
616 
617  // Interface for advancing the data at one level by one "slow" timestep
618  void advance_dycore (int level,
619  amrex::Vector<amrex::MultiFab>& state_old,
620  amrex::Vector<amrex::MultiFab>& state_new,
621  amrex::MultiFab& xvel_old, amrex::MultiFab& yvel_old, amrex::MultiFab& zvel_old,
622  amrex::MultiFab& xvel_new, amrex::MultiFab& yvel_new, amrex::MultiFab& zvel_new,
623  amrex::MultiFab& source, amrex::MultiFab& xmom_src,
624  amrex::MultiFab& ymom_src, amrex::MultiFab& zmom_src,
625  amrex::MultiFab& buoyancy, amrex::Geometry fine_geom,
626  double dt, double time);
627 
628  void advance_microphysics (int lev,
629  amrex::MultiFab& cons_in,
630  const double& dt_advance,
631  const int& iteration,
632  const double& time);
633 
634  void advance_lsm (int lev,
635  amrex::MultiFab& cons_in,
636  amrex::MultiFab& xvel_in,
637  amrex::MultiFab& yvel_in,
638  const double& time,
639  const double& dt_advance);
640 
641  void advance_urban (int lev,
642  amrex::MultiFab& cons_in,
643  amrex::MultiFab& u_in,
644  amrex::MultiFab& v_in,
645  const amrex::Real& dt_advance,
646  const amrex::Geometry& geom,
647  const amrex::MultiFab* z_phys_nd,
648  amrex::MultiFab& eddyDiffs_in);
649 
650  void advance_radiation (int lev,
651  amrex::MultiFab& cons_in,
652  const double& dt_advance);
653 
654 #ifdef ERF_USE_EAMXX_SHOC
655  void compute_shoc_tendencies (int lev,
656  amrex::MultiFab* cons,
657  amrex::MultiFab* xvel,
658  amrex::MultiFab* yvel,
659  amrex::MultiFab* zvel,
660  amrex::Real* w_subsid,
661  amrex::MultiFab* tau13,
662  amrex::MultiFab* tau23,
663  amrex::MultiFab* hfx3,
664  amrex::MultiFab* qfx3,
665  amrex::MultiFab* eddyDiffs,
666  amrex::MultiFab* z_phys_nd,
667  const double& dt_advance);
668 #endif
669 
670  void compute_native_shoc_tendencies (int lev,
671  amrex::MultiFab* cons,
672  amrex::MultiFab* xvel,
673  amrex::MultiFab* yvel,
674  amrex::MultiFab* zvel,
675  amrex::Real* w_subsid,
676  amrex::MultiFab* tau13,
677  amrex::MultiFab* tau23,
678  amrex::MultiFab* hfx3,
679  amrex::MultiFab* qfx3,
680  amrex::MultiFab* eddyDiffs,
681  amrex::MultiFab* z_phys_nd,
682  const double& dt_advance);
683 
684  void build_fine_mask (int lev, amrex::MultiFab& fine_mask);
685 
686  void MakeHorizontalAverages ();
687  void MakeDiagnosticAverage (amrex::Vector<amrex::Real>& h_havg, amrex::MultiFab& S, int n);
688  void derive_upwp (amrex::Vector<amrex::Real>& h_havg);
689 
690  // Write plotfile to disk
691  bool Write3DPlotFile (int which, PlotFileType plotfile_type, amrex::Vector<std::string> plot_var_names);
692  void Write2DPlotFile (int which, PlotFileType plotfile_type, amrex::Vector<std::string> plot_var_names);
693  void ResetIntervalMeansAfter3DPlotfileBatch (int plotfiles_written,
694  bool interval_diagnostic_consumed);
695  void ResetIntervalMeans ();
696 
697  // Write subvolume of data into a different "plotfile"
698  void WriteSubvolume (int isub, amrex::Vector<std::string> subvol_var_names);
699 
700  void WriteMultiLevelPlotfileWithTerrain (const std::string &plotfilename,
701  int nlevels,
702  const amrex::Vector<const amrex::MultiFab*> &mf,
703  const amrex::Vector<const amrex::MultiFab*> &mf_nd,
704  const amrex::Vector<std::string> &varnames,
705  const amrex::Vector<amrex::Geometry>& my_geom,
706  double time,
707  const amrex::Vector<int> &level_steps,
708  const amrex::Vector<amrex::IntVect>& my_ref_ratio,
709  const std::string &versionName = "HyperCLaw-V1.1",
710  const std::string &levelPrefix = "Level_",
711  const std::string &mfPrefix = "Cell",
712  const amrex::Vector<std::string>& extra_dirs = amrex::Vector<std::string>()) const;
713 
714 
715  void WriteGenericPlotfileHeaderWithTerrain (std::ostream &HeaderFile,
716  int nlevels,
717  const amrex::Vector<amrex::BoxArray> &bArray,
718  const amrex::Vector<std::string> &varnames,
719  const amrex::Vector<amrex::Geometry>& my_geom,
720  double time,
721  const amrex::Vector<int> &level_steps,
722  const amrex::Vector<amrex::IntVect>& my_ref_ratio,
723  const std::string &versionName,
724  const std::string &levelPrefix,
725  const std::string &mfPrefix) const;
726 
727  // Filling the plot variables, and the station sampling that reuses it. Split
728  // out of the plotfile writers so that a station column and the corresponding
729  // plotfile component are produced the same way. Private for the same reason
730  // canonicalizePlot3DVariables above is: this is output machinery rather than
731  // something ERF offers a caller.
732 
733  // Per-level scratch needed to evaluate the 3D plot variables. Held by the
734  // caller so that the work is done once for a set of variables and then
735  // reused for every level that is filled.
737  {
738  amrex::Vector<amrex::MultiFab> mf_cc_vel; // cell-centered velocity, 1 ghost
739  amrex::Vector<amrex::MultiFab> mf_cc_tau; // cell-centered stress tensor
740  amrex::Vector<amrex::MultiFab> mf_cc_fx; // cell-centered SFS fluxes
741  };
742 
743  void FillPlot2DVars (int lev,
744  const amrex::Vector<std::string>& plot_var_names,
745  const amrex::Vector<std::string>& varnames,
746  const amrex::Vector<plotfile2d::Plotfile2DOutputDescriptor>& output_descriptors,
747  amrex::MultiFab& mf_dst,
748  int ncomp_mf);
749 
750  void FillPlot3DVars (int lev,
751  const amrex::Vector<std::string>& plot_var_names,
752  Plot3DScratch& scratch,
753  amrex::MultiFab& mf_dst,
754  int ncomp_mf,
755  amrex::Real tnew);
756 
757  // max_lev caps the levels whose scratch is built, -1 meaning every level: a
758  // caller that reads only the coarse levels should not pay for the fine ones.
759  // sync_solution allows the microphysics average-down, which the plotfile
760  // writer wants but a diagnostic that runs at every step must not do, since
761  // it changes the coarse solution.
762  void BuildPlot3DScratch (const amrex::Vector<std::string>& plot_var_names,
763  Plot3DScratch& scratch,
764  int max_lev = -1,
765  bool sync_solution = true);
766 
767  // Station time-series output
768  void init_stations ();
770  void resolve_station_stencils ();
771  void sample_stations (amrex::Real time);
772  void flush_stations () const;
773  // The nodes a station's terrain elevation is read from, at k = the bottom of
774  // the domain: z_phys_nd, or with immersed-forcing terrain the immersed surface
775  const amrex::MultiFab& station_ground (int lev);
776 
777  // Nudging towards observations at stations
778  void init_obs_nudging ();
779 
780  void erf_enforce_hse (int lev,
781  amrex::MultiFab& dens, amrex::MultiFab& pres, amrex::MultiFab& pi,
782  amrex::MultiFab& th, amrex::MultiFab& qv,
783  std::unique_ptr<amrex::MultiFab>& z_cc);
784 
785 #ifdef ERF_USE_NETCDF
786  //! Write a timestep to 1D vertical column output for coupling
787  void writeToNCColumnFile (int lev,
788  const std::string& colfile_name, amrex::Real xloc, amrex::Real yloc,
789  double time);
790 #endif //ERF_USE_NETCDF
791 
792  void init_from_input_sounding (int lev);
793 
794  /**
795  * The input sounding sampled at the cell centres of level lev. Level 0 is
796  * input_sounding_data itself; a finer level gets its own copy, resampled at
797  * geom[lev] / zlevels_stag[lev], so that its profile index k is its own cell k
798  * and no fine cell blends in the surface line of the sounding.
799  */
800  const InputSoundingData& sounding_at_level (int lev);
801 
802  /**
803  * The large-scale forcing profiles interpolated to the cell centres of level lev.
804  * Level 0 is lsf itself; a finer level gets its own copy, interpolated at
805  * geom[lev] / zlevels_stag[lev] against sounding_at_level(lev), so that its profile
806  * index k is its own cell k.
807  */
808  const LargeScaleForcingData& lsf_at_level (int lev);
809 
810  void init_immersed_forcing (int lev);
811 
812  // Immersed-boundary surface energy balance (Source/ImmersedBoundarySEB)
813  void init_ibseb ();
814  void ibseb_check_refined_levels () const;
816  void ibseb_check_two_stream_provider () const;
817  [[nodiscard]] bool ibseb_after_radiation () const {
818  return ibseb_params.enable && ibseb_params.radiation == "two_stream";
819  }
820  void ibseb_set_two_stream_sun (int lev, amrex::Real time);
821  void ibseb_write_checkpoint (const std::string& checkpointname, int lev) const;
822  void ibseb_report (int nstep, amrex::Real time);
823  amrex::Real ibseb_bulk_richardson_height (int lev, const amrex::MultiFab& cons,
824  const amrex::MultiFab& xvel, const amrex::MultiFab& yvel);
825  void ibseb_advance (int lev, amrex::Real time, amrex::Real dt_lev, const amrex::MultiFab& cons,
826  const amrex::MultiFab& xvel, const amrex::MultiFab& yvel, const amrex::MultiFab& zvel);
827 
828  void input_sponge (int lev);
829 
830  void init_from_hse (int lev);
831 
832  void init_thin_body (int lev, const amrex::BoxArray& ba, const amrex::DistributionMapping& dm);
833 
834  void FillForecastStateMultiFabs (const int lev,
835  const std::string& filename,
836  const std::unique_ptr<amrex::MultiFab>& z_phys_nd,
837  amrex::Vector<amrex::Vector<amrex::MultiFab>>& forecast_state);
838 
839  void FillSurfaceStateMultiFabs (const int lev,
840  const std::string& filename,
841  amrex::Vector<amrex::MultiFab>& surface_state);
842 
843 
844  void WeatherDataInterpolation (const int nlevs,
845  const double time,
846  amrex::Vector<std::unique_ptr<amrex::MultiFab>>& z_phys_nd,
847  bool regrid_forces_file_read);
848 
849  void SurfaceDataInterpolation (const int nlevs,
850  const double time,
851  amrex::Vector<std::unique_ptr<amrex::MultiFab>>& z_phys_nd,
852  bool regrid_forces_file_read);
853 
855  amrex::MultiFab& mf_cc_pert,
856  amrex::MultiFab& cons_pert,
857  amrex::MultiFab& xvel_pert,
858  amrex::MultiFab& yvel_pert,
859  amrex::MultiFab& zvel_pert);
860 
861  void create_random_perturbations (const int lev,
862  amrex::MultiFab& mf_cc_pert);
863 
864  void apply_gaussian_smoothing_to_perturbations (const int lev,
865  amrex::MultiFab& mf_cc_pert);
866 
867  void ComputeAndWriteEnsemblePerturbations (const int da_iter);
868 
869  void PerformDataAssimilation (int da_iter);
870 
871  void SetDirsForPlotfilesAndCheckpointsForDA (const int da_iter, const int ens_no);
872 
873  void GetEnsembleCheckpointName (int da_iter, int ens_no);
874 
875  void init_custom (int lev);
876 
877 #ifdef ERF_USE_MULTIBLOCK
878  // constructor used when ERF is created by a multiblock driver
879  // calls AmrCore constructor -> AmrMesh constructor
880  ERF (const amrex::RealBox& rb, int max_level_in,
881  const amrex::Vector<int>& n_cell_in, int coord,
882  const amrex::Vector<amrex::IntVect>& ref_ratio,
883  const amrex::Array<int,AMREX_SPACEDIM>& is_per,
884  std::string prefix);
885 
886  // Advance a block specified number of time steps
887  void Evolve_MB (int MBstep, int max_block_step);
888 
889  // Set parmparse prefix for MultiBlock
890  void SetParmParsePrefix (std::string name) { pp_prefix = name; }
891 
892  // Set 'this' from multiblock container
893  void SetMultiBlockPointer (MultiBlockContainer *mbc) { m_mbc = mbc; }
894 
895  // Public data copy for MB
896  std::vector<amrex::Box> domain_p;
897 
898  // Primary solution data data containers
899  amrex::Vector<amrex::Vector<amrex::MultiFab> > vars_new;
900  amrex::Vector<amrex::Vector<amrex::MultiFab> > vars_old;
901 
902  // Pressure gradient at each level
903  amrex::Vector<amrex::Vector<amrex::MultiFab> > gradp;
904 
905  // Velocity time averaged field
906  amrex::Vector<std::unique_ptr<amrex::MultiFab>> vel_t_avg;
907  amrex::Vector<double> t_avg_cnt;
908 
909  // Interval first and second moments used by mean/fluctuation plot fields
910  amrex::Vector<std::unique_ptr<amrex::MultiFab>> interval_means;
911  amrex::Vector<double> t_mean_cnt;
912  // The configured time reset is one global, one-shot event. Keep this
913  // separate from the per-level accumulation storage so regridding a level
914  // cannot re-arm an event that has already happened.
916 #endif
917 
918  std::string pp_prefix {"erf"};
919 
920  // The inputs table as the user wrote it, captured at the top of
921  // ReadParameters before anything in ERF can add to it. ParmParse::queryAdd
922  // inserts the default it was handed whenever a key is absent, so by the time
923  // initialization is under way the table no longer distinguishes a key the
924  // user typed from a key some other query defaulted (see
925  // has_surface_layer_inputs).
926  std::set<std::string> user_specified_inputs;
927 
928  void fill_from_bndryregs (const amrex::Vector<amrex::MultiFab*>& mfs,
929  double time);
930 
931 #ifdef ERF_USE_NETCDF
932  // Version in which we always set the velocity values but don't set theta
933  void fill_from_realbdy (const amrex::Vector<amrex::MultiFab*>& mfs,
934  double time,
935  bool cons_only,
936  int icomp_cons,
937  int ncomp_cons,
938  amrex::IntVect ngvect_cons,
939  amrex::IntVect ngvect_vels);
940 #endif
941 
942 #ifdef ERF_USE_NETCDF
943  // Read a wrfinput file at this level.
944  //
945  // With read_atmos_state = true (the default) this reads the full state: the
946  // atmospheric fields (U, V, W, THM, the density triple and the moisture species)
947  // as well as the surface fields, and it remaps the state onto the ERF vertical
948  // grid, builds the base state and reads the boundary data.
949  //
950  // With read_atmos_state = false only the surface fields are read -- terrain,
951  // surface pressure, surface and skin temperatures, the land/soil masks, the map
952  // factors, the lat/lon fields and the LSM variables -- and the terrain and metric
953  // terms are built from them. The atmospheric state is left untouched for the
954  // caller to fill by interpolation from the coarse level (see the
955  // erf.interp_atmos_from_coarse path in MakeNewLevelFromCoarse), which is also
956  // responsible for calling rebuild_base_state_from_wrfinput afterwards.
957  void init_from_wrfinput (int lev, amrex::MultiFab& mf_PSFC, bool read_atmos_state = true);
958  void init_from_metgrid (int lev);
959  void init_from_ncfile (int lev);
960 
961  // Rebuild the WRF base state on the grids of base_state_mf at this level, using the
962  // level-0 reference parameters (wrf_bsp) and this level's z_phys_cc. This is the same
963  // construction init_from_wrfinput performs at initialization, factored out so that a
964  // level remade by a regrid gets the same base state rather than one interpolated from
965  // its parent. Requires z_phys_cc[lev] and wrf_bsp to be valid.
966  void rebuild_base_state_from_wrfinput (int lev, amrex::MultiFab& base_state_mf);
967 
968  // Re-read the six reference parameters that define the WRF base state from the level-0
969  // wrfinput file. These are read at initialization but are not part of the checkpoint,
970  // so on restart wrf_bsp would otherwise be left unset -- and the first regrid that has
971  // to rebuild a base state would abort in init_base_state_from_wrfinput.
972  void restore_base_state_params_on_restart ();
973 #endif // ERF_USE_NETCDF
974 
975 #ifdef ERF_USE_WINDFARM
976  void init_windfarm (int lev);
977  void advance_windfarm (const amrex::Geometry& a_geom,
978  const double& dt_advance,
979  amrex::MultiFab& cons_in,
980  amrex::MultiFab& U_old,
981  amrex::MultiFab& V_old,
982  amrex::MultiFab& W_old,
983  amrex::MultiFab& mf_vars_windfarm,
984  const amrex::MultiFab& mf_Nturb,
985  const amrex::MultiFab& mf_SMark,
986  const double& time);
987 #endif
988 
989  void MakeEBGeometry ();
990  void make_eb_box ();
992 
993  // more flexible version of AverageDown() that lets you average down across multiple levels
994  void AverageDownTo (int crse_lev,
995  int scomp,
996  int ncomp,
997  bool do_perturbational_and_momenta = true); // NOLINT
998 
999  /*! \brief Conservation-preserving fine-to-coarse average of RhoTheta and
1000  * the active moist conserved components using detJ/mfac weighting, reusing
1001  * AverageDownTo with perturbational-state and momentum handling disabled. */
1002  void AverageDownMoistStateTo (int crse_lev);
1003 
1004  // Write checkpoint file to disk
1005  void WriteCheckpointFile () const;
1006 
1007  // Read checkpoint file from disk
1008  void ReadCheckpointFile ();
1009 
1010  // Read only velocities from checkpoint file
1011  void ReadVelsOnlyFromCheckpointFile (int lev_to_fill, std::string& chkfile);
1012 
1013  // read checkpoint file from disk -- called after instantiating m_SurfaceLayer
1015 
1016  void fill_terrain_surface (int lev, amrex::MultiFab& z_phys, double elapsed_time);
1017  void init_zphys (int lev, double elapsed_time);
1018  void remake_zphys (int lev, amrex::Real time, std::unique_ptr<amrex::MultiFab>& temp_zphys_nd);
1019  void update_terrain_arrays (int lev);
1020  void make_terrain_blanking (int lev);
1021 
1025 
1026  // Coupled sea-surface temperature and its per-cell coverage flag, on the
1027  // layout reported by GetOceanToAtmosSurfaceLayout. Allocated on the first
1028  // ApplyOceanSurfaceState call and handed to the SurfaceLayer as borrowed
1029  // pointers, so ERF must outlive the SurfaceLayer's use of them. Level 0
1030  // only: the coupler exchanges on the base grid.
1031  std::unique_ptr<amrex::MultiFab> m_coupled_sst;
1032  std::unique_ptr<amrex::iMultiFab> m_coupled_sst_valid;
1033 
1034  // One-shot latch so a misconfigured deck says so once rather than every step.
1036  // The coupled-SST diagnostics run on the first ApplyOceanSurfaceState call,
1037  // then only at erf.v >= 2.
1039  // Out-of-range report: the worst extremes and NaN count already reported;
1040  // at erf.v >= 2 it repeats only when a later call is worse. Start at the bounds.
1043  amrex::Long m_warned_coupled_sst_nan = 0;
1044 
1045 private:
1046 
1047  ///////////////////////////
1048  // private member functions
1049  ///////////////////////////
1050 
1051  // read in some parameters from inputs file
1052  void ReadParameters ();
1053  void ParameterSanityChecks ();
1054 
1055  [[nodiscard]] bool has_surface_layer_inputs (const std::string& prefix) const;
1056 
1057  // set covered coarse cells/faces to be the average of overlying fine cells/faces
1058  void AverageDown ();
1059 
1060  void update_diffusive_arrays (int lev, const amrex::BoxArray& ba, const amrex::DistributionMapping& dm);
1061 
1062  void make_flux_register (int lev);
1063 
1064  void Construct_ERFFillPatchers (int lev);
1065 
1066  void Define_ERFFillPatchers (int lev);
1067 
1068  void init1DArrays ();
1069 
1070  void init_bcs ();
1071  void init_phys_bcs (bool& read_prim_theta);
1072 
1073  void init_stuff (int lev, const amrex::BoxArray& ba, const amrex::DistributionMapping& dm,
1074  amrex::Vector<amrex::MultiFab>& lev_new, amrex::Vector<amrex::MultiFab>& lev_old,
1075  amrex::MultiFab& tmp_base_state,
1076  std::unique_ptr<amrex::MultiFab>& tmp_zphys_nd);
1077 
1078  // Initialize the Turbulent perturbation
1079  void turbPert_update (const int lev, const double dt);
1080  void turbPert_amplitude (const int lev);
1081  void turbPert_amplitude_w (const int lev);
1082 
1083  // Initialize the integrator object
1084  void initialize_integrator (int lev, amrex::MultiFab& cons_mf, amrex::MultiFab& vel_mf);
1085 
1086  // Create the physbcs objects
1087  void make_physbcs (int lev);
1088 
1089  // (Re)build the land surface model on this level's current grids
1090  void make_lsm_at_level (int lev, bool from_regrid = false,
1091  int source_lev = -1, bool source_is_raw_input = false,
1092  bool initialize_now = false);
1093 
1094  // Initialize the microphysics object
1095  void initializeMicrophysics (const int&);
1096 
1097 #ifdef ERF_USE_WINDFARM
1098  // Initialize the windfarm object
1099  void initializeWindFarm (const int&);
1100 #endif
1101 
1102  // Initialize embedded boundary geometries
1103  void initializeEB ();
1104 
1105  // Compute a vector of new MultiFabs by copying from valid region and filling ghost cells
1106  //
1107  // NOTE: FillPatch takes in an empty MF, and returns cell-centered + velocities (not momenta)
1108  //
1109  // This one works only at level = 0 (base state does not change)
1110  void FillPatchCrseLevel (int lev, double time,
1111  const amrex::Vector<amrex::MultiFab*>& mfs_vel,
1112  bool cons_only=false);
1113 
1114  // This one works only at level > 0 (base state does change)
1115  void FillPatchFineLevel (int lev, double time,
1116  const amrex::Vector<amrex::MultiFab*>& mfs_vel,
1117  const amrex::Vector<amrex::MultiFab*>& mfs_mom,
1118  const amrex::MultiFab& old_base_state,
1119  const amrex::MultiFab& new_base_state,
1120  bool fillset=true, bool cons_only=false);
1121 
1122  // Compute new multifabs by copying data from valid region and filling ghost cells.
1123  // Unlike FillPatch, FillIntermediatePatch will use the supplied multifabs instead of fine level data.
1124  // This is to support filling boundary cells at an intermediate time between old/new times
1125  // on the fine level when valid data at a specific time is already available (such as
1126  // at each RK stage when integrating between initial and final times at a given level).
1127  //
1128  // NOTE: FillIntermediatePatch takes in updated momenta, and returns both updated velocity and momenta
1129  //
1130  void FillIntermediatePatch (int lev, double time,
1131  const amrex::Vector<amrex::MultiFab*>& mfs_vel,
1132  const amrex::Vector<amrex::MultiFab*>& mfs_mom,
1133  int ng_cons, int ng_vel, bool cons_only, int icomp_cons, int ncomp_cons);
1134 
1135  // Fill all multifabs (and all components) in a vector of multifabs corresponding to the
1136  // grid variables defined in vars_old and vars_new just as FillCoarsePatch.
1137  void FillCoarsePatch (int lev, double time);
1138 
1139  // advance a level by dt
1140  // includes a recursive call for finer levels
1141  void timeStep (int lev, double time, int iteration);
1142 
1143  // advance a single level for a single time step
1144  void Advance (int lev, double time, double dt_lev, int iteration, int ncycle);
1145 
1146  //! Initialize HSE
1147  void initHSE ();
1148  void initHSE (int lev);
1149 
1150  // Fill base_state[lev] by conservative interpolation from base_state[lev-1], then apply
1151  // the base-state physical bc's. This is how the part of a fine level that lies inside
1152  // the domain but outside the fine grids -- and the fine ghost cells -- get their values,
1153  // so it must run before any construction that overwrites only the fine grids.
1154  void interp_base_state_from_coarse (int lev);
1155 
1156  //! Initialize Rayleigh damping profiles at a level
1157  void initRayleigh_at_level (const int& lev);
1158 
1159  //! Initialize sponge profiles
1160  void initSponge ();
1161 
1162  //! Set Rayleigh mean profiles from input sounding
1163  void setRayleighRefFromSounding (bool restarting);
1164 
1165  //! Set sponge mean profiles from input sounding
1166  void setSpongeRefFromSounding (bool restarting);
1167 
1168  // a wrapper for estTimeStep()
1169  void ComputeDt (int step = -1, double cur_time_d = 0.0);
1170 
1171  // get plotfile name
1172  [[nodiscard]] std::string PlotFileName (int lev) const;
1173 
1174  // set plotfile variable names
1175  static amrex::Vector<std::string> PlotFileVarNames (amrex::Vector<std::string> plot_var_names);
1176 
1177  // set which variables and derived quantities go into plotfiles
1178  void setPlotVariables (const std::string& pp_plot_var_names, amrex::Vector<std::string>& plot_var_names);
1179  void canonicalizePlot3DVariables (amrex::Vector<std::string>& plot_var_names);
1180  void appendPlot3DVariables (const amrex::Vector<std::string>& plot_var_names,
1181  amrex::Vector<std::string>& a_plot_var_names);
1182  void setPlotVariables2D (const std::string& pp_plot_var_names, amrex::Vector<std::string>& plot_var_names);
1183  // append variables to plot
1184  void appendPlotVariables (const std::string& pp_plot_var_names, amrex::Vector<std::string>& plot_var_names);
1185 
1186  void setSubVolVariables (const std::string& pp_subvol_var_names, amrex::Vector<std::string>& subvol_var_names);
1187 
1188 #ifdef ERF_USE_NETCDF
1189  //! Create 1D vertical column output for coupling
1190  void createNCColumnFile (int lev,
1191  const std::string& colfile_name, amrex::Real xloc, amrex::Real yloc);
1192 
1193  // Copy from the NC*fabs into the MultiFabs holding the boundary data
1194  void init_from_wrfbdy (amrex::Vector<amrex::FArrayBox*> x_vel_lateral,
1195  amrex::Vector<amrex::FArrayBox*> y_vel_lateral,
1196  amrex::Vector<amrex::FArrayBox*> z_vel_lateral,
1197  amrex::Vector<amrex::FArrayBox*> T_lateral);
1198 
1199  static double start_bdy_time;
1200  static double final_bdy_time;
1201 
1202  static double start_low_time;
1203  static double final_low_time;
1204 
1205  static double bdy_time_interval;
1206  static double low_time_interval;
1207 
1208  // *** *** FArrayBox's for holding the SURFACE data
1209  // amrex::IArrayBox NC_IVGTYP_fab; // Vegetation type (IVGTYP); Discrete numbers;
1210  // amrex::FArrayBox NC_z0_fab; // Surface Roughness, z0 = z0 (IVGTYP)
1211  // amrex::FArrayBox NC_PSFC_fab; // Surface pressure
1212 
1213  // TODO: Clarify the relation between SST and TSK
1214  // amrex::FArrayBox NC_SST_fab; // Sea Surface Temperature; Defined even for land area
1215  // amrex::FArrayBox NC_TSK_fab; // Surface Skin Temperature; Appears to be same as SST...
1216 
1217  // Vectors (over time) of Vector (over variables) of FArrayBoxs for holding the data read from the wrfbdy NetCDF file
1218  amrex::Vector<amrex::Vector<amrex::FArrayBox>> bdy_data_xlo;
1219  amrex::Vector<amrex::Vector<amrex::FArrayBox>> bdy_data_xhi;
1220  amrex::Vector<amrex::Vector<amrex::FArrayBox>> bdy_data_ylo;
1221  amrex::Vector<amrex::Vector<amrex::FArrayBox>> bdy_data_yhi;
1222 
1223  amrex::Vector<amrex::Vector<amrex::FArrayBox>> low_data_zlo;
1224 
1225  // Maximum value of terrain read in from wrfinput at level 0
1226  amrex::Real z_top = zero;
1227 
1228 #endif // ERF_USE_NETCDF
1229 
1230  // Latitude and Longitude on the grid, always at cell centers: the wrfinput
1231  // path reads XLAT / XLONG and the metgrid path reads XLAT_M / XLONG_M, both
1232  // of which are mass-point values, so a consumer that wants the mass point
1233  // can use these directly.
1234  amrex::Vector<std::unique_ptr<amrex::MultiFab>> lat_m, lon_m;
1235 
1236  amrex::Vector<std::unique_ptr<amrex::MultiFab>> sinPhi_m, cosPhi_m; // Coriolis factors on the grid
1237 
1238  // Struct for working with the sounding data we take as an input. Its profiles are
1239  // sampled at the level-0 cell centres; use sounding_at_level for any other level.
1241 
1242  // The sounding sampled at the cell centres of each level > 0, built on first use
1243  // from input_sounding_data (index 0 is unused)
1244  amrex::Vector<std::unique_ptr<InputSoundingData>> input_sounding_data_fine;
1245 
1246  // Struct for working with the sponge data we take as an input
1248 
1249  // Vector (6 planes) of DeviceVectors (ncell in plane) for Dirichlet BC data
1250  amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real>> xvel_bc_data;
1251  amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real>> yvel_bc_data;
1252  amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real>> zvel_bc_data;
1253  amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real>> th_bc_data;
1254 
1255  // Planar averages for immersed forcing (computed on slow step, used in slow and fast steps)
1256  amrex::Vector<amrex::TableData<amrex::Real, 1>> r_plane_avg; // density planar average per level
1257  amrex::Vector<amrex::TableData<amrex::Real, 1>> t_plane_avg; // RhoTheta planar average per level
1258 
1259  // Function to read and populate above vectors (if input file exists)
1260  bool init_Dirichlet_bc_data (const std::string input_file);
1261 
1262  // Read the file passed to amr.restart and use it as an initial condition for
1263  // the current simulation. Supports a different number of components and
1264  // ghost cells.
1266 
1267  // Initialize the new-time data at a level from the initial_data MultiFab
1268  void InitializeLevelFromData (int lev, const amrex::MultiFab& initial_data);
1269 
1270  // utility to skip to next line in Header
1271  static void GotoNextLine (std::istream& is);
1272 
1273  // Single level functions called by advance()
1274  void post_update (amrex::MultiFab& state_mf, double time, const amrex::Geometry& geom);
1275  void fill_rhs (amrex::MultiFab& rhs_mf, const amrex::MultiFab& state_mf, double time, const amrex::Geometry& geom);
1276 
1277  ////////////////
1278  // private data members
1279 
1280  std::unique_ptr<ProblemBase> prob = nullptr; // problem-specific functions
1281 
1282  amrex::Vector<int> num_boxes_at_level; // how many boxes specified at each level by tagging criteria
1283  amrex::Vector<int> num_files_at_level; // how many wrfinput files specified at each level
1284  amrex::Vector<amrex::Vector<amrex::Box>> boxes_at_level; // the boxes specified at each level by tagging criteria
1285 
1286  amrex::Vector<int> istep; // which step?
1287  amrex::Vector<int> nsubsteps; // how many substeps on each level?
1288 
1289  // One entry per level: set when that level has just been built by the
1290  // erf.interp_atmos_from_coarse path, whose atmospheric state comes from FillCoarsePatch
1291  // and is not yet thermodynamically consistent (rho, theta and qv are interpolated
1292  // independently). advance_radiation interpolates the radiation fields from the parent
1293  // rather than running RRTMGP on that state, and clears the entry once it has done so, so
1294  // exactly one step is skipped per level creation.
1295  //
1296  // NOTE: this is deliberately a flag owned by the level's lifetime rather than a test on
1297  // istep[lev]. istep is sized once in ReadParameters and is never reset when a
1298  // level is removed, so it carries over from a level's previous life: a level that
1299  // ran for fifty steps, was de-refined, and was then re-created would have
1300  // istep[lev] == 50 and would silently miss the skip.
1301  //
1302  // (using int instead of bool to avoid the std::vector<bool> specialization)
1304 
1305  // keep track of old time, new time, and time step at each level
1306  amrex::Vector<double> t_new;
1307  amrex::Vector<double> t_old;
1308  amrex::Vector<double> dt;
1309  amrex::Vector<long> dt_mri_ratio;
1310 
1311 #ifndef ERF_USE_MULTIBLOCK
1312  // Array of multifabs to store the solution at each level of refinement;
1313  // after advancing a level we use "swap".
1314  amrex::Vector<amrex::Vector<amrex::MultiFab> > vars_new;
1315  amrex::Vector<amrex::Vector<amrex::MultiFab> > vars_old;
1316 
1317  // Pressure gradient at each level
1318  amrex::Vector<amrex::Vector<amrex::MultiFab> > gradp;
1319 
1320  // Velocity time averaged field
1321  amrex::Vector<std::unique_ptr<amrex::MultiFab>> vel_t_avg;
1322  amrex::Vector<double> t_avg_cnt;
1323 
1324  // Interval first and second moments used by mean/fluctuation plot fields
1325  amrex::Vector<std::unique_ptr<amrex::MultiFab>> interval_means;
1326  amrex::Vector<double> t_mean_cnt;
1327  // Global one-shot time-reset state; interval_means remains per level.
1329 #endif
1330  amrex::Vector<std::unique_ptr<MRISplitIntegrator<amrex::Vector<amrex::MultiFab> > > > mri_integrator_mem;
1331 
1332  // Used for anelastic or when we impose an initial projection
1333  amrex::Vector<amrex::MultiFab> pp_inc;
1334 
1335  // Used only for fast substepping
1336  amrex::Vector<amrex::MultiFab> lagged_delta_rt;
1337  amrex::Vector<amrex::MultiFab> avg_xmom;
1338  amrex::Vector<amrex::MultiFab> avg_ymom;
1339  amrex::Vector<amrex::MultiFab> avg_zmom;
1340 
1341  // Vector over levels of routines to impose physical boundary conditions
1342  amrex::Vector<std::unique_ptr<ERFPhysBCFunct_cons>> physbcs_cons;
1343  amrex::Vector<std::unique_ptr<ERFPhysBCFunct_u>> physbcs_u;
1344  amrex::Vector<std::unique_ptr<ERFPhysBCFunct_v>> physbcs_v;
1345  amrex::Vector<std::unique_ptr<ERFPhysBCFunct_w>> physbcs_w;
1346  amrex::Vector<std::unique_ptr<ERFPhysBCFunct_base>> physbcs_base;
1347 
1348  // Store primitive variable for MOST BC
1349  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Theta_prim;
1350  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Qv_prim;
1351  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Qr_prim;
1352 
1353  // Scratch space for time integrator
1354  amrex::Vector<amrex::MultiFab> rU_old;
1355  amrex::Vector<amrex::MultiFab> rU_new;
1356  amrex::Vector<amrex::MultiFab> rV_old;
1357  amrex::Vector<amrex::MultiFab> rV_new;
1358  amrex::Vector<amrex::MultiFab> rW_old;
1359  amrex::Vector<amrex::MultiFab> rW_new;
1360 
1361  // amrex::Vector<amrex::MultiFab> xmom_crse_rhs;
1362  // amrex::Vector<amrex::MultiFab> ymom_crse_rhs;
1363  amrex::Vector<amrex::MultiFab> zmom_crse_rhs;
1364 
1365  std::unique_ptr<Microphysics> micro;
1366  std::unique_ptr<erf_sbm::SBMStateManager> sbm_state_manager;
1367  // Declared after the state manager so its non-owning layout reference is
1368  // destroyed before the authoritative SBM owner.
1369  std::unique_ptr<erf_sbm::SBMTransport> sbm_transport;
1370  std::unique_ptr<erf_auxiliary::AuxiliaryInertTracer> auxiliary_inert_tracer;
1371  std::unique_ptr<CloudChamberBudget> cloud_chamber_budget;
1373  amrex::Vector<amrex::Vector<amrex::MultiFab*>> qmoist; // (lev,ncomp) rain_accum, snow_accum, graup_accum
1374  amrex::Vector<std::unique_ptr<amrex::MultiFab>> precip; // SLM precipitation-rate scratch
1375 
1376  // Variables for wind farm parametrization models
1377 
1378 #ifdef ERF_USE_WINDFARM
1379  std::unique_ptr<WindFarm> windfarm;
1380  amrex::Vector<amrex::MultiFab> Nturb;
1381  amrex::Vector<amrex::MultiFab> vars_windfarm; // Fitch: Vabs, Vabsdt, dudt, dvdt, dTKEdt
1382  // EWP: dudt, dvdt, dTKEdt
1383 
1384  amrex::Vector<amrex::MultiFab> SMark; // A multifab that holds an integer corresponding
1385  // to the number of the wind turbine to sample
1386  // velocity upstream of the turbine
1387 #endif
1388 
1389  std::unique_ptr<SurfaceModel> m_SurfaceModel = nullptr;
1390 
1393  amrex::Vector<std::string> lsm_data_name; // (ncomp) -- e.g., sw_dn_dir/dif_vis/nir, lw_dn, cos_zen
1394  amrex::Vector<amrex::Vector<amrex::MultiFab*>> lsm_data; // (lev,ncomp) Data for LSM coupling
1395  amrex::Vector<std::string> lsm_flux_name; // (ncomp) -- e.g., hfx3, q1fx3, tau13, tau23
1396  amrex::Vector<amrex::Vector<amrex::MultiFab*>> lsm_flux; // (lev,ncomp) Fluxes from LSM needed by DYCORE
1397  amrex::Vector<amrex::Vector<amrex::MultiFab*>> urban_data; // (lev,ncomp) Data for urban coupling
1398  amrex::Vector<std::string> urban_data_name; // (ncomp) Urban coupling field names
1399  amrex::Vector<amrex::Vector<amrex::MultiFab*>> urban_flux; // (lev,ncomp) Fluxes from urban model
1400 
1402 
1403  // The large-scale forcing profiles on each level > 0, built on first use from lsf
1404  // (index 0 is unused)
1405  amrex::Vector<std::unique_ptr<LargeScaleForcingData>> lsf_fine;
1406  amrex::Vector<std::unique_ptr<amrex::MultiFab>> nudge_data; // holds nudging inputs: tnudge, qnudge, unudge, vnudge
1407  amrex::Vector<std::unique_ptr<amrex::MultiFab>> lsf_data; // holds large scale forcing tendencies: ttend, qtend, wsub
1408 
1409  amrex::Vector<std::unique_ptr<IRadiation>> rad; // Radiation model at each level
1410  amrex::Vector<std::unique_ptr<amrex::MultiFab>> qheating_rates; // radiation heating rate source terms (SW, LW) (DYCORE)
1411  // Radiation fluxes (SW up, SW down, LW up, LW down) [W/m^2] at the
1412  // interfaces (OUTPUT ONLY). Index k holds the lower interface of layer k
1413  // (k = klo is the surface); the top-of-atmosphere interface is stored in
1414  // the z-ghost cell k = khi + 1, so the array has one ghost cell in z.
1415  // Both RRTMGP and the two-stream model fill all nz + 1 levels.
1416  amrex::Vector<std::unique_ptr<amrex::MultiFab>> rad_fluxes;
1417 
1420 
1421  // Two-stream radiation model (erf.radiation_model = TwoStream): owns its
1422  // surface and SEB state; every call from ERF is behind a test of
1423  // solverChoice.rad_type == RadiationType::TwoStream.
1425 
1426 #ifdef ERF_USE_EAMXX_SHOC
1427  amrex::Vector<std::unique_ptr<SHOCInterface>> eamxx_shoc_interface; // EAMxx SHOC model at each level
1428 #endif
1429 
1430  amrex::Vector<std::unique_ptr<ShocDriver>> native_shoc_driver; // Native SHOC model at each level
1431 
1432  bool plot_rad = false;
1434 
1435  // Fillpatcher classes for coarse-fine boundaries
1436  int cf_width{0};
1438  amrex::Vector<ERFFillPatcher> FPr_c;
1439  amrex::Vector<ERFFillPatcher> FPr_u;
1440  amrex::Vector<ERFFillPatcher> FPr_v;
1441  amrex::Vector<ERFFillPatcher> FPr_w;
1442 
1443  // Diffusive stresses and Smag
1444  amrex::Vector<amrex::Vector<std::unique_ptr<amrex::MultiFab>>> Tau;
1445  amrex::Vector<amrex::Vector<std::unique_ptr<amrex::MultiFab>>> Tau_corr; // correction to tau for implicit
1446  amrex::Vector<std::unique_ptr<amrex::MultiFab>> eddyDiffs_lev;
1447  amrex::Vector<std::unique_ptr<amrex::MultiFab>> SmnSmn_lev;
1448 
1449  // Sea Surface Temps, Skin Temperature and Land Masks (lev, ntimes)
1450  amrex::Vector<amrex::Vector<std::unique_ptr<amrex::MultiFab>>> sst_lev;
1451  amrex::Vector<amrex::Vector<std::unique_ptr<amrex::MultiFab>>> tsk_lev;
1452  amrex::Vector<amrex::Vector<std::unique_ptr<amrex::iMultiFab>>> lmask_lev;
1453 
1454  // Land grid types and urban fraction
1455  amrex::Vector<amrex::Vector<std::unique_ptr<amrex::iMultiFab>>> land_type_lev;
1456  amrex::Vector<amrex::Vector<std::unique_ptr<amrex::iMultiFab>>> soil_type_lev;
1457  amrex::Vector<amrex::Vector<std::unique_ptr<amrex::MultiFab>>> urb_frac_lev;
1458 
1459  // Other SFS terms
1460  amrex::Vector<std::unique_ptr<amrex::MultiFab>> SFS_hfx1_lev, SFS_hfx2_lev, SFS_hfx3_lev;
1461  amrex::Vector<std::unique_ptr<amrex::MultiFab>> SFS_diss_lev;
1462  amrex::Vector<std::unique_ptr<amrex::MultiFab>> SFS_q1fx1_lev, SFS_q1fx2_lev, SFS_q1fx3_lev;
1463  amrex::Vector<std::unique_ptr<amrex::MultiFab>> SFS_q2fx3_lev;
1464 
1465  // Diffusive fluxes for EB
1466  // Tau_EB[level][component][grid_type]
1467  amrex::Vector<amrex::Vector<amrex::Vector<std::unique_ptr<amrex::MultiFab>>>> Tau_EB;
1468  amrex::Vector<std::unique_ptr<amrex::MultiFab>> hfx3_EB;
1469  amrex::Vector<std::unique_ptr<amrex::MultiFab>> qfx3_EB;
1470 
1471  // Grid stretching
1472  amrex::Vector<amrex::Vector<amrex::Real>> zlevels_stag; // nominal height levels
1473 
1474  // Data structures for terrain-fitted coordinates
1475  amrex::Vector<std::unique_ptr<amrex::MultiFab>> z_phys_nd;
1476  amrex::Vector<std::unique_ptr<amrex::MultiFab>> z_phys_cc;
1477 
1478  amrex::Vector<std::unique_ptr<amrex::MultiFab>> detJ_cc;
1479  amrex::Vector<std::unique_ptr<amrex::MultiFab>> ax;
1480  amrex::Vector<std::unique_ptr<amrex::MultiFab>> ay;
1481  amrex::Vector<std::unique_ptr<amrex::MultiFab>> az;
1482 
1483  amrex::Vector<std::unique_ptr<amrex::MultiFab>> z_phys_nd_src;
1484  amrex::Vector<std::unique_ptr<amrex::MultiFab>> z_phys_cc_src;
1485  amrex::Vector<std::unique_ptr<amrex::MultiFab>> detJ_cc_src;
1486  amrex::Vector<std::unique_ptr<amrex::MultiFab>> ax_src;
1487  amrex::Vector<std::unique_ptr<amrex::MultiFab>> ay_src;
1488  amrex::Vector<std::unique_ptr<amrex::MultiFab>> az_src;
1489 
1490  amrex::Vector<std::unique_ptr<amrex::MultiFab>> z_phys_nd_new;
1491  amrex::Vector<std::unique_ptr<amrex::MultiFab>> detJ_cc_new;
1492 
1493  amrex::Vector<std::unique_ptr<amrex::MultiFab>> z_t_rk;
1494 
1495  // Immersed-boundary surface energy balance: inputs and one face set per level
1497  amrex::Vector<std::unique_ptr<IBFaceSet>> m_ibseb;
1498  TwoStreamRadiation::OrbitalCache ibseb_orbit; ///< Orbit of the year for erf.ibseb.sun_mode = two_stream
1499  amrex::Real ibseb_z_i_level0 = 0.0; ///< Level 0's bulk-Richardson depth of its current step, for the refined levels
1500 
1501  // Data structures for terrain immersed forcing
1502  amrex::Vector<std::unique_ptr<amrex::MultiFab>> terrain_blanking;
1503  amrex::Vector<std::unique_ptr<amrex::MultiFab>> terrain_blanking_xface;
1504  amrex::Vector<std::unique_ptr<amrex::MultiFab>> terrain_blanking_yface;
1505  amrex::Vector<std::unique_ptr<amrex::MultiFab>> terrain_blanking_zface;
1506 
1507  // Wall distance function
1508  amrex::Vector<std::unique_ptr<amrex::MultiFab>> walldist;
1509 
1510  // Map scale factors -- vector across levels of vector across types
1511  amrex::Vector<amrex::Vector<std::unique_ptr<amrex::MultiFab>>> mapfac;
1512 
1513  // Mask to be used to identify cells covered by finer level (if level > 0)
1514  amrex::Vector<std::unique_ptr<amrex::MultiFab>> fine_mask;
1515 
1516  amrex::Vector<amrex::Vector<amrex::Real>> stretched_dz_h;
1517  amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real>> stretched_dz_d;
1518 
1519  amrex::Vector<amrex::MultiFab> base_state;
1520  amrex::Vector<amrex::MultiFab> base_state_new;
1521 
1522  // Wave coupling data
1523  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Hwave;
1524  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Lwave;
1525  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Hwave_onegrid;
1526  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Lwave_onegrid;
1527  bool finished_wave = false;
1528 
1529  // array of flux registers
1530  amrex::Vector<std::unique_ptr<amrex::YAFluxRegister>> advflux_reg;
1531 
1532  // A BCRec is essentially a 2*DIM integer array storing the boundary
1533  // condition type at each lo/hi walls in each direction. We have one BCRec
1534  // for each component of the cell-centered variables and each velocity component.
1535  amrex::Vector <amrex::BCRec> domain_bcs_type;
1536  amrex::Gpu::DeviceVector<amrex::BCRec> domain_bcs_type_d;
1537 
1538  // We store these so that we can print them out in the job_info file
1539  amrex::Array<std::string,2*AMREX_SPACEDIM> domain_bc_type;
1540 
1541  // These hold the Dirichlet values at walls which need them ...
1542  amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>, AMREX_SPACEDIM+NBCVAR_max> m_bc_extdir_vals;
1543 
1544  // These hold the Neumann values at walls which need them ...
1545  amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>, AMREX_SPACEDIM+NBCVAR_max> m_bc_neumann_vals;
1546 
1547  // Host-side, face-local metadata for solid-wall scalar inputs. This is
1548  // deliberately separate from the values copied into device ghost-fill
1549  // kernels so explicit zero values remain distinguishable from omission.
1550  amrex::Array<amrex::Array<erf_wall_scalar_bc::WallScalarBCIntent, AMREX_SPACEDIM*2>, NBCVAR_max>
1552 
1553  // Per-face flag: non-reflecting inflow (extrapolate RhoTheta instead of prescribing)
1554  amrex::Array<bool, AMREX_SPACEDIM*2> m_bc_nonreflecting = {{false}};
1555  // Per face: whether its Dirichlet theta comes from a dirichlet_file, and in which form
1556  // (0: not from a file, 1: the file holds rho*theta, 2: the file holds theta)
1557  amrex::Array<int, AMREX_SPACEDIM*2> m_th_file_face = {{0}};
1558 
1559  // These are the "physical" boundary condition types (e.g. "inflow")
1560  amrex::GpuArray<ERF_BC, AMREX_SPACEDIM*2> phys_bc_type;
1561 
1562  // These are the masks for the thin immersed body
1563  amrex::Vector<std::unique_ptr<amrex::iMultiFab>> xflux_imask;
1564  amrex::Vector<std::unique_ptr<amrex::iMultiFab>> yflux_imask;
1565  amrex::Vector<std::unique_ptr<amrex::iMultiFab>> zflux_imask;
1566  //amrex::Vector<std::unique_ptr<amrex::iMultiFab>> overset_imask;
1567 
1568  // These are the body forces that result from the thin immersed body
1569  amrex::Vector<std::unique_ptr<amrex::MultiFab>> thin_xforce;
1570  amrex::Vector<std::unique_ptr<amrex::MultiFab>> thin_yforce;
1571  amrex::Vector<std::unique_ptr<amrex::MultiFab>> thin_zforce;
1572 
1578 
1583  static double last_check_file_time;
1584 
1585  amrex::Vector<int> last_subvol_step;
1586  amrex::Vector<double> last_subvol_time;
1587 
1589 
1590  // Output control
1591  const int datwidth = 14;
1592  const int datprecision = 6;
1593  const int timeprecision = 13; // e.g., 1-yr LES: 31,536,000 s with dt ~ amrex::Real(0.01) ==> min prec = 10
1594  // epoch time for 2030-01-01 00:00:00 is 1,893,456,000 s with dt ~ amrex::Real(0.01) ==> min prec = 12
1595 
1596  ////////////////
1597  // runtime parameters
1598 
1599  // Maximum number of steps
1600  int max_step = -1;
1601 
1602  // Start and stop times
1603  static double start_time;
1604  static double stop_time;
1605 
1606  bool use_datetime = false;
1607  const std::string datetime_format = "%Y-%m-%d %H:%M:%S"; // ISO 8601 standard
1608 
1609  // if >= 0 we restart from a checkpoint
1610  std::string restart_chkfile = "";
1611 
1612  // Host-only metadata shared by all native output paths. It never enters
1613  // device code or changes the model state read from a checkpoint.
1615 
1616  // Time step controls
1621  static double dt_max_initial;
1622  static double dt_max;
1623 
1624  // Explicit eddy-diffusion time-step check (opt-in): warn when dt * rate exceeds
1625  // diffusive_cfl (diffusive_dt_check) and optionally limit an adaptive dt to it
1626  static bool diffusive_dt_check;
1627  static bool diffusive_dt_limit;
1629  // true until the first ComputeDt of this run has finished (restart hold of the limit)
1631  // largest Fourier number already reported per level (warnings repeat only when it grows)
1632  amrex::Vector<amrex::Real> diffusive_fourier_warned;
1633  // grids on which, and value at which, the terrain slope factor was last reported, per level
1634  amrex::Vector<amrex::BoxArray> slope_report_grids;
1635  amrex::Vector<amrex::Real> slope_report_alpha;
1636 
1637  // Fixed dt at each level (only used if positive)
1638  amrex::Vector<double> fixed_dt;
1639  amrex::Vector<double> fixed_fast_dt;
1641 
1642  // how often each level regrids the higher levels of refinement
1643  // (after a level advances that many time steps)
1644  int regrid_int = -1;
1645 
1646  // Should we regrid level 0 after restart if Ngrids < Nprocs or
1647  // max_grid_size has changed?
1649 
1650  //
1651  // The grids each level's checkpoint was written on, and whether level 0's grids actually
1652  // moved when it was read. ReadCheckpointFile decides the level-0 grids before it builds
1653  // the levels, so every field is read on the grids in the file and redistributed onto the
1654  // grids the run will use; these carry the former. Empty away from a restart.
1655  //
1656  amrex::Vector<amrex::BoxArray> ba_chkfile;
1657  amrex::Vector<amrex::DistributionMapping> dm_chkfile;
1659 
1660  //
1661  // Read one checkpoint MultiFab and deposit it into dst, which may live on different grids.
1662  //
1663  // The source is read into an undefined MultiFab, which VisMF::Read then defines on the
1664  // BoxArray recorded in the file, so no caller needs to know the checkpoint's grids. Only
1665  // the VALID cells of the source are offered by default: a file's ghost cells are not
1666  // guaranteed to agree with its valid data, and ParallelCopy intersects the grown source
1667  // with the grown destination without any ordering guarantee between overlapping sources,
1668  // so offering them can land stale values in valid cells (issue 4225). Pass
1669  // src_ghosts = true only for a field whose halo the checkpoint carries deliberately and
1670  // whose exterior halo cannot be rebuilt -- the terrain heights are the case that needs it.
1671  //
1672  void read_checkpoint_mf (amrex::MultiFab& dst,
1673  const std::string& mf_name,
1674  int lev,
1675  int scomp, int dcomp, int ncomp,
1676  const amrex::IntVect& dst_ghosts,
1677  bool src_ghosts = false);
1678 
1679  //
1680  // As above, returning false instead of aborting when the file is not there, for fields a
1681  // older checkpoint may not carry.
1682  //
1683  bool read_checkpoint_mf_if_present (amrex::MultiFab& dst,
1684  const std::string& mf_name,
1685  int lev,
1686  int scomp, int dcomp, int ncomp,
1687  const amrex::IntVect& dst_ghosts,
1688  bool src_ghosts = false);
1689 
1690  // plotfile prefix and frequency
1691  std::string plot3d_file_1 {"plt_1_"};
1692  std::string plot3d_file_2 {"plt_2_"};
1693  std::string plot2d_file_1 {"plt2d_1_"};
1694  std::string plot2d_file_2 {"plt2d_2_"};
1695  std::string subvol_file {"subvol"};
1697  int m_plot3d_int_1 = -1;
1698  int m_plot3d_int_2 = -1;
1699  int m_plot2d_int_1 = -1;
1700  int m_plot2d_int_2 = -1;
1701 
1702  amrex::Vector<int> m_subvol_int;
1703  amrex::Vector<double> m_subvol_per;
1704 
1705  double m_plot3d_per_1 = -1.0;
1706  double m_plot3d_per_2 = -1.0;
1707  double m_plot2d_per_1 = -1.0;
1708  double m_plot2d_per_2 = -1.0;
1709  bool m_plot_face_vels = false;
1711 
1712  bool plot_lsm = false;
1713  bool plot_surfmodel = false;
1714 
1715  // other sampling output control
1716  int profile_int = -1;
1717  bool destag_profiles = true;
1718 
1719  // Checkpoint type, prefix and frequency
1720  std::string check_file {"chk"};
1721  int m_check_int = -1;
1722  double m_check_per = -1.0;
1723 
1724  amrex::Vector<std::string> subvol3d_var_names;
1725 
1726  amrex::Vector<std::string> plot3d_var_names_1;
1727  amrex::Vector<std::string> plot3d_var_names_2;
1728  amrex::Vector<std::string> plot2d_var_names_1;
1729  amrex::Vector<std::string> plot2d_var_names_2;
1730  const amrex::Vector<std::string> cons_names {"density", "rhotheta", "rhoKE", "rhoadv_0",
1731  "rhoQ1", "rhoQ2", "rhoQ3",
1732  "rhoQ4", "rhoQ5", "rhoQ6",
1733  "rhoQ7", "rhoQ8", "rhoQ9",
1734  "rhoQ10", "rhoQ11"};
1735 
1736  // **************************************************************************************
1737  // NOTE: The order of variable names here **MUST MATCH THE ORDER** in IO/ERF_Plotfile.cpp
1738  // **************************************************************************************
1739  const amrex::Vector<std::string> derived_names {"temp", "theta", "KE", "scalar", "soundspeed",
1740  "reflectivity","max_reflectivity", "precipitable", "mucape",
1741  "vorticity_x","vorticity_y","vorticity_z",
1742  "helicity", "local_helicity", "vort_stretching",
1743  "magvel", "divU",
1744  "pres_hse", "dens_hse", "theta_hse", "pi_hse", "qv_hse",
1745  "pressure", "pert_pres", "pert_dens",
1746  "buoyancy", "eq_pot_temp", "VPD",
1747 #ifdef ERF_USE_WINDFARM
1748  "num_turb", "SMark0", "SMark1",
1749 #endif
1750  "dpdx", "dpdy", "dpdz", "pres_hse_x", "pres_hse_y",
1751  "z_phys", "detJ", "h_xi", "h_eta", "h_zeta",
1752  "mapfac", "lat_m", "lon_m",
1753  // Time averaged velocity
1754  "u_t_avg", "v_t_avg", "w_t_avg", "umag_t_avg",
1755  // Interval means and resolved turbulence moments
1756  "u_mean", "v_mean", "w_mean", "theta_mean",
1757  "uu_mean", "vv_mean", "ww_mean", "uw_mean", "vw_mean", "wtheta_mean",
1758  "uu_fluct", "vv_fluct", "ww_fluct", "uw_fluct", "vw_fluct", "wtheta_fluct", "tke_resolved",
1759  // eddy viscosity
1760  "nut",
1761  // eddy diffusivity of momentum
1762  "Kmv","Kmh",
1763  // eddy diffusivity of heat
1764  "Khv","Khh",
1765  // turbulence lengthscale
1766  "Lturb",
1767  // k-eqn RANS: smoothed turbulent Richardson number and stability functions
1768  "Rt", "cmu", "cmu_prime",
1769  // native SHOC diagnostics
1770  "pblh", "shoc_cldfrac", "shoc_ql", "shoc_ql2", "shoc_cond",
1771  "wqls_sec", "wthv_sec", "w_sec",
1772  "thl_sec", "qw_sec", "qwthl_sec", "wthl_sec", "wqw_sec", "w3",
1773  "brunt", "isotropy", "shear_prod", "buoy_prod", "diss_tke",
1774  // wall distance
1775  "walldist",
1776  // dissipation
1777  "diss",
1778  // moisture vars
1779  "moist_density", "qv", "qc", "qi", "qrain", "qsnow", "qgraup",
1780  "qt", "qn", "qp", "qsat", "nc", "ni", "nr", "ns", "ng", "nn",
1781  "rain_accum", "snow_accum", "graup_accum",
1782  "rel_humidity", "condensation_rate",
1783  // Terrain IB mask
1784  "terrain_IB_mask",
1785  "ibseb_nfaces", "ibseb_tskin",
1786  "ibseb_sw_abs", "ibseb_shadow",
1787  "ibseb_lw_net", "ibseb_f_sky", "ibseb_H", "ibseb_G",
1788  // EB variables
1789  "volfrac"
1790 #ifdef ERF_COMPUTE_ERROR
1791  // error vars
1792  ,"xvel_err", "yvel_err", "zvel_err", "pp_err"
1793 #endif
1794  ,"qsrc_sw", "qsrc_lw",
1795  "Tau11", "Tau12", "Tau13", "Tau21", "Tau22", "Tau23", "Tau31", "Tau32", "Tau33",
1796  "hfx1", "hfx2", "hfx3", "q1fx1", "q1fx2", "q1fx3", "q2fx3"
1797  };
1798 
1799  // **************************************************************************************
1800  // NOTE: This is the set of derived variables that WriteSubvolume knows how to fill; it
1801  // is an unordered allow-list, since setSubVolVariables walks "derived_names" and
1802  // keeps the entries found here. That means the names are selected in
1803  // "derived_names" order, which is the order WriteSubvolume must compute them in.
1804  // **************************************************************************************
1805  const amrex::Vector<std::string> derived_subvol_names {"soundspeed", "temp", "theta", "KE", "scalar",
1806  "precipitable", "mucape"};
1807 
1808  // algorithm choices
1810 
1811  // Turbulent perturbation structure
1813 
1814 #ifdef ERF_USE_PARTICLES
1815  // Particle container with all particle species
1816  ParticleData particleData;
1817 
1818  // variables and functions for tracers particles
1819  bool m_use_tracer_particles; /*!< tracer particles that advect with flow with optional sedimentation */
1820 
1821  /*! Read tracer and hydro particles parameters */
1822  void readTracersParams ();
1823 
1824  /*! Initialize tracer and hydro particles */
1825  void initializeTracers ( amrex::ParGDBBase*,
1826  const amrex::Vector<std::unique_ptr<amrex::MultiFab>>&,
1827  const double time);
1828 
1829  /*! Restart tracer and hydro particles */
1830  void restartTracers ( amrex::ParGDBBase*, const std::string& );
1831 
1832  /*! Evolve tracers and hydro particles */
1833  void evolveTracers ( int,
1834  double,
1835  amrex::Vector<amrex::Vector<amrex::MultiFab>>&,
1836  const amrex::Vector<std::unique_ptr<amrex::MultiFab>>& );
1837 
1838 #endif
1839 
1840 #ifdef ERF_USE_MULTIBLOCK
1841  MultiBlockContainer *m_mbc = nullptr;
1842 #endif
1843 
1844  static int verbose;
1845  static int mg_verbose;
1846  static bool use_fft;
1847 
1848  static int check_for_nans;
1849 
1850  // Diagnostic output interval
1851  static int sum_interval;
1852  static int pert_interval;
1853  static double sum_per;
1854 
1855  // Write in native AMReX or NetCDF format for each plotfile
1856  static PlotFileType plotfile3d_type_1;
1857  static PlotFileType plotfile3d_type_2;
1858  static PlotFileType plotfile2d_type_1;
1859  static PlotFileType plotfile2d_type_2;
1860 
1863 
1864  static StateInterpType interpolation_type;
1865 
1866  // NetCDF initialization (wrfinput) file
1867  static amrex::Vector<amrex::Vector<std::string>> nc_init_file;
1868  static amrex::Vector<amrex::Vector<int>> have_read_nc_init_file;
1869 
1870  // NetCDF initialization (wrfbdy/met_em) file
1871  static std::string nc_bdy_file;
1872  int real_width{0};
1873  bool real_extrap_w{true};
1874 
1875  // NetCDF initialization of zlo boundary values
1876  static std::string nc_low_file;
1877 
1878  // Options for vertical interpolation of met_em*.nc data.
1881  bool metgrid_debug_dry{false};
1882  bool metgrid_debug_psfc{false};
1883  bool metgrid_debug_msf{false};
1887  bool metgrid_use_sfc{true};
1888  bool metgrid_retain_sfc{false};
1892 
1893  // Options for ERF boundary files for real simulations.
1894  bool write_erfbdy{false}; // User-settable: write erfbdy during initialization
1895  bool use_erfbdy{false}; // User-settable for wrfinput: read erfbdy instead of
1896  // nc_bdy_file. Set internally for metgrid and on restart.
1897  std::string erfbdy_file{"erfbdy"}; // User-settable: erfbdy file name
1898  int nvars_erfbdy{0}; // Internal: number of variables in erfbdy
1899 
1900  amrex::Vector<amrex::BoxArray> ba1d;
1901  amrex::Vector<amrex::BoxArray> ba2d;
1902 
1903  // Vertical extent of the grid column over each (i,j), stored on ba2d (so the
1904  // compressed z index is 0) with one ghost cell in x and y so that a box can also
1905  // read the extent of the column on the other side of each of its faces.
1906  // component 0 : smallEnd(2) of the box covering this column
1907  // component 1 : bigEnd(2) of the box covering this column
1908  // Ghost entries that no box covers keep the "unconstraining" sentinels below.
1909  // This is well defined only because grids may not be split in the vertical --
1910  // see ERF::grids_are_split_in_z. Used by the implicit vertical diffusion solves.
1911  amrex::Vector<std::unique_ptr<amrex::iMultiFab>> column_kextent;
1912 
1913  static constexpr int column_kextent_lo_sentinel = std::numeric_limits<int>::min()/2;
1914  static constexpr int column_kextent_hi_sentinel = std::numeric_limits<int>::max()/2;
1915 
1916  void define_column_kextent (int lev, const amrex::BoxArray& ba,
1917  const amrex::DistributionMapping& dm);
1918 
1919  static bool grids_are_split_in_z (const amrex::BoxArray& ba);
1920 
1921  // The six parameters defining the WRF analytic reference profile, plus the layer
1922  // interfaces derived from them. These are read from the LEVEL 0 wrfinput file only
1923  // and then shared by every level: the levels of an AMR hierarchy must be built from
1924  // one reference profile, or their base states cannot agree across the coarse/fine
1925  // interface. (A nested wrfinput file that disagrees produces a warning.)
1927 
1928  std::unique_ptr<amrex::MultiFab> wrf_C1H;
1929  std::unique_ptr<amrex::MultiFab> wrf_C2H;
1930  std::unique_ptr<amrex::MultiFab> wrf_MUB;
1931  std::unique_ptr<amrex::MultiFab> wrf_RDNW;
1932  std::unique_ptr<amrex::MultiFab> wrf_PHB; // Base geopotential
1933 
1934  amrex::Vector<std::unique_ptr<amrex::MultiFab>> mf_PSFC;
1935 
1936  // 1D CDF output (for ingestion in AMR-Wind)
1937  static int output_1d_column;
1938  static int column_interval;
1939  static double column_per;
1942  static std::string column_file_name;
1943 
1944  // 2D BndryRegister output (for ingestion in AMR-Wind)
1949 
1950  // 2D BndryRegister input
1952 
1953  static int ng_dens_hse;
1954  static int ng_pres_hse;
1955 
1956  // Custom source terms
1957  amrex::Vector<std::unique_ptr<amrex::MultiFab>> rhotheta_src;
1958  amrex::Vector<std::unique_ptr<amrex::MultiFab>> rhoqt_src;
1959 
1960  amrex::Vector< amrex::Vector<amrex::Real> > h_w_subsid;
1961  amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real> > d_w_subsid;
1962 
1963  amrex::Vector< amrex::Vector<amrex::Real> > h_u_geos;
1964  amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real> > d_u_geos;
1965 
1966  amrex::Vector< amrex::Vector<amrex::Real> > h_v_geos;
1967  amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real> > d_v_geos;
1968 
1969  // Function to read and populate above host vectors (if input file exists)
1970  void init_geo_wind_profile (const std::string input_file,
1971  amrex::Vector<amrex::Real>& u_geos,
1972  amrex::Gpu::DeviceVector<amrex::Real>& u_geos_d,
1973  amrex::Vector<amrex::Real>& v_geos,
1974  amrex::Gpu::DeviceVector<amrex::Real>& v_geos_d,
1975  const amrex::Geometry& lgeom,
1976  const amrex::Vector<amrex::Real>& zlev_stag);
1977 
1978  // This is a vector over levels of vectors across quantities of Vectors
1979  amrex::Vector<amrex::Vector<amrex::Vector<amrex::Real> > > h_rayleigh_ptrs;
1980  amrex::Vector<amrex::Vector<amrex::Vector<amrex::Real> > > h_sponge_ptrs;
1981 
1982  // These are vectors over levels of Vectors
1983  amrex::Vector<amrex::Vector<amrex::Real> > h_sinesq_ptrs;
1984  amrex::Vector<amrex::Vector<amrex::Real> > h_sinesq_stag_ptrs;
1985 
1986  // This is a vector over levels of vectors across quantities of DeviceVectors
1987  amrex::Vector<amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real> > > d_rayleigh_ptrs;
1988  amrex::Vector<amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real> > > d_sponge_ptrs;
1989 
1990  // These are vectors over levels of DeviceVectors
1991  amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real> > d_sinesq_ptrs;
1992  amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real> > d_sinesq_stag_ptrs;
1993 
1994  amrex::Vector<amrex::Real> h_havg_density;
1995  amrex::Vector<amrex::Real> h_havg_temperature;
1996  amrex::Vector<amrex::Real> h_havg_pressure;
1997  amrex::Vector<amrex::Real> h_havg_qv;
1998  amrex::Vector<amrex::Real> h_havg_qc;
1999 
2000  amrex::Gpu::DeviceVector<amrex::Real> d_havg_density;
2001  amrex::Gpu::DeviceVector<amrex::Real> d_havg_temperature;
2002  amrex::Gpu::DeviceVector<amrex::Real> d_havg_pressure;
2003  amrex::Gpu::DeviceVector<amrex::Real> d_havg_qv;
2004  amrex::Gpu::DeviceVector<amrex::Real> d_havg_qc;
2005 
2006  void refinement_criteria_setup ();
2007 
2008  std::unique_ptr<WriteBndryPlanes> m_w2d = nullptr;
2009  std::unique_ptr<ReadBndryPlanes> m_r2d = nullptr;
2010  amrex::Vector<std::unique_ptr<SurfaceLayer>> m_SurfaceLayer;
2011  amrex::Vector<std::unique_ptr<ForestDrag>> m_forest_drag;
2012 
2013  //
2014  // Holds info for dynamically generated tagging criteria
2015  //
2016  static amrex::Vector<amrex::AMRErrorTag> ref_tags;
2017 
2018  //
2019  // Name of the refinement indicator that generated each entry of ref_tags.
2020  // Not every indicator generates a ref_tag (e.g. "storm_tracker" does not),
2021  // so this must be carried alongside ref_tags rather than re-deriving it
2022  // from the positional index into erf.refinement_indicators.
2023  //
2024  static amrex::Vector<std::string> ref_tag_indicator_names;
2025 
2026  amrex::Vector<amrex::Vector<amrex::BoxArray>> subdomains;
2027 
2028  amrex::Vector<amrex::Real> dz_min;
2029 
2030  static AMREX_FORCE_INLINE
2031  int
2033  {
2034  // We never have fewer than 2 ghost cells
2035  int ngrow = 2;
2036 
2037  // This sets the minimum to 3 if using num_diff but we might still need more
2038  if (sc.use_num_diff) {
2039  ngrow = 3;
2040  }
2041 
2042  // With EB we always have 4 so no need to do further tests
2043  if (sc.terrain_type == TerrainType::EB) {
2044  ngrow = 4;
2045  return ngrow;
2046  }
2047 
2048  if (
2055  { ngrow = 3; }
2056  else if (
2063  { ngrow = 3; }
2064  else if (
2071  { ngrow = 3; }
2072  else if (
2079  { ngrow = 3; }
2080  else if (
2087  { ngrow = 3; }
2088  else if (
2095  { ngrow = 4; }
2096 
2097  return ngrow;
2098  }
2099 
2100  AMREX_FORCE_INLINE
2101  amrex::YAFluxRegister* getAdvFluxReg (int lev)
2102  {
2103  return advflux_reg[lev].get();
2104  }
2105 
2106  AMREX_FORCE_INLINE
2107  std::ostream&
2108  DataLog (int i)
2109  {
2110  return *datalog[i];
2111  }
2112 
2113  AMREX_FORCE_INLINE
2114  std::ostream&
2115  DerDataLog (int i)
2116  {
2117  return *der_datalog[i];
2118  }
2119 
2120  AMREX_FORCE_INLINE
2121  int
2122  NumDataLogs () noexcept
2123  {
2124  return static_cast<int>(datalog.size());
2125  }
2126 
2127  AMREX_FORCE_INLINE
2128  int
2129  NumDerDataLogs () noexcept
2130  {
2131  return static_cast<int>(der_datalog.size());
2132  }
2133 
2134 
2135  AMREX_FORCE_INLINE
2136  std::ostream&
2138  {
2139  return *sampleptlog[i];
2140  }
2141 
2142  AMREX_FORCE_INLINE
2143  int
2145  {
2146  return static_cast<int>(sampleptlog.size());
2147  }
2148 
2149  AMREX_FORCE_INLINE
2150  std::ostream&
2152  {
2153  return *samplelinelog[i];
2154  }
2155 
2156  AMREX_FORCE_INLINE
2157  int
2158  NumSampleLineLogs () noexcept
2159  {
2160  return static_cast<int>(samplelinelog.size());
2161  }
2162 
2163  amrex::IntVect&
2164  SamplePoint (int i)
2165  {
2166  return samplepoint[i];
2167  }
2168 
2169  AMREX_FORCE_INLINE
2170  int
2171  NumSamplePoints () noexcept
2172  {
2173  return static_cast<int>(samplepoint.size());
2174  }
2175 
2176  amrex::IntVect&
2177  SampleLine (int i)
2178  {
2179  return sampleline[i];
2180  }
2181 
2182  AMREX_FORCE_INLINE
2183  int
2184  NumSampleLines () noexcept
2185  {
2186  return static_cast<int>(sampleline.size());
2187  }
2188 
2189  static double startCPUTime;
2190  static double previousCPUTimeUsed;
2191 
2192  static double
2194  {
2195  int numCores = amrex::ParallelDescriptor::NProcs();
2196 #ifdef _OPENMP
2197  numCores = numCores * omp_get_max_threads();
2198 #endif
2199 
2200  double T =
2201  numCores * (amrex::ParallelDescriptor::second() - startCPUTime) +
2203 
2204  return T;
2205  }
2206 
2207  void setRecordDataInfo (int i, const std::string& filename) // NOLINT
2208  {
2209  if (amrex::ParallelDescriptor::IOProcessor())
2210  {
2211  datalog[i] = std::make_unique<std::fstream>();
2212  datalog[i]->open(filename.c_str(),std::ios::out|std::ios::app);
2213  if (!datalog[i]->good()) {
2214  amrex::FileOpenFailed(filename);
2215  }
2216  }
2217  amrex::ParallelDescriptor::Barrier("ERF::setRecordDataInfo");
2218  }
2219 
2220  void setRecordDerDataInfo (int i, const std::string& filename) // NOLINT
2221  {
2222  if (amrex::ParallelDescriptor::IOProcessor())
2223  {
2224  der_datalog[i] = std::make_unique<std::fstream>();
2225  der_datalog[i]->open(filename.c_str(),std::ios::out|std::ios::app);
2226  if (!der_datalog[i]->good()) {
2227  amrex::FileOpenFailed(filename);
2228  }
2229  }
2230  amrex::ParallelDescriptor::Barrier("ERF::setRecordDerDataInfo");
2231  }
2232 
2233  void setRecordEnergyDataInfo (int i, const std::string& filename) // NOLINT
2234  {
2235  if (amrex::ParallelDescriptor::IOProcessor())
2236  {
2237  tot_e_datalog[i] = std::make_unique<std::fstream>();
2238  tot_e_datalog[i]->open(filename.c_str(),std::ios::out|std::ios::app);
2239  if (!tot_e_datalog[i]->good()) {
2240  amrex::FileOpenFailed(filename);
2241  }
2242  }
2243  amrex::ParallelDescriptor::Barrier("ERF::setRecordEnergyDataInfo");
2244  }
2245 
2246  void setRecordSamplePointInfo (int i, int lev, amrex::IntVect& cell, const std::string& filename) // NOLINT
2247  {
2248  amrex::MultiFab dummy(grids[lev],dmap[lev],1,0);
2249  for (amrex::MFIter mfi(dummy); mfi.isValid(); ++mfi)
2250  {
2251  const amrex::Box& bx = mfi.validbox();
2252  if (bx.contains(cell)) {
2253  sampleptlog[i] = std::make_unique<std::fstream>();
2254  sampleptlog[i]->open(filename.c_str(),std::ios::out|std::ios::app);
2255  if (!sampleptlog[i]->good()) {
2256  amrex::FileOpenFailed(filename);
2257  }
2258  }
2259  }
2260  amrex::ParallelDescriptor::Barrier("ERF::setRecordSamplePointInfo");
2261  }
2262 
2263  void setRecordSampleLineInfo (int i, int lev, amrex::IntVect& cell, const std::string& filename) // NOLINT
2264  {
2265  amrex::MultiFab dummy(grids[lev],dmap[lev],1,0);
2266  for (amrex::MFIter mfi(dummy); mfi.isValid(); ++mfi)
2267  {
2268  const amrex::Box& bx = mfi.validbox();
2269  if (bx.contains(cell)) {
2270  samplelinelog[i] = std::make_unique<std::fstream>();
2271  samplelinelog[i]->open(filename.c_str(),std::ios::out|std::ios::app);
2272  if (!samplelinelog[i]->good()) {
2273  amrex::FileOpenFailed(filename);
2274  }
2275  }
2276  }
2277  amrex::ParallelDescriptor::Barrier("ERF::setRecordSampleLineInfo");
2278  }
2279 
2280  // Data sampler for line and plane output
2285  std::unique_ptr<LineSampler> line_sampler = nullptr;
2286  std::unique_ptr<PlaneSampler> plane_sampler = nullptr;
2287 
2288  // Station time-series output
2291  std::unique_ptr<StationSampler> station_sampler = nullptr;
2292  // The 3D and 2D plot variables the stations need, in the order the fill
2293  // routines produce their components
2294  amrex::Vector<std::string> station_vars_3d;
2295  amrex::Vector<std::string> station_vars_2d;
2296  // The immersed-forcing terrain surface under each level's grids, for the stations
2297  amrex::Vector<std::unique_ptr<amrex::MultiFab>> station_ib_ground;
2298 
2299  // Nudging towards observations at stations; built only when
2300  // solverChoice.nudging_from_observations is true
2301  std::unique_ptr<ObsNudging> obs_nudging = nullptr;
2302 
2303  amrex::Vector<std::unique_ptr<std::fstream> > datalog;
2304  amrex::Vector<std::unique_ptr<std::fstream> > der_datalog;
2305  amrex::Vector<std::unique_ptr<std::fstream> > tot_e_datalog;
2306  amrex::Vector<std::string> datalogname;
2307  amrex::Vector<std::string> der_datalogname;
2308  amrex::Vector<std::string> tot_e_datalogname;
2309 
2310  amrex::Vector<std::unique_ptr<std::fstream> > sampleptlog;
2311  amrex::Vector<std::string> sampleptlogname;
2312  amrex::Vector<amrex::IntVect> samplepoint;
2313 
2314  amrex::Vector<std::unique_ptr<std::fstream> > samplelinelog;
2315  amrex::Vector<std::string> samplelinelogname;
2316  amrex::Vector<amrex::IntVect> sampleline;
2317 
2318  //! The filename of the ith datalog file.
2319  [[nodiscard]] std::string DataLogName (int i) const noexcept { return datalogname[i]; }
2320  [[nodiscard]] std::string DerDataLogName (int i) const noexcept { return der_datalogname[i]; }
2321 
2322  //! The filename of the ith sampleptlog file.
2323  [[nodiscard]] std::string SamplePointLogName (int i) const noexcept { return sampleptlogname[i]; }
2324 
2325  //! The filename of the ith samplelinelog file.
2326  [[nodiscard]] std::string SampleLineLogName (int i) const noexcept { return samplelinelogname[i]; }
2327 
2328  // array of EB objects
2329  amrex::Vector<std::unique_ptr<eb_>> eb;
2330 
2331  [[nodiscard]] eb_ const& get_eb (int lev) const noexcept {
2332  AMREX_ASSERT(lev >= 0 && lev < eb.size() && eb[lev] != nullptr);
2333  return *eb[lev];
2334  }
2335 
2336  //
2337  // NOTE: this dereferences the cell-centered EB factory, which is only built when
2338  // we are using EB or immersed forcing -- see ERF::MakeNewLevelFromScratch.
2339  // Calling this in any other case is undefined behavior, so we assert here
2340  // rather than relying on the (build-dependent) libstdc++ hardening check.
2341  //
2342  [[nodiscard]] amrex::EBFArrayBoxFactory const&
2343  EBFactory (int lev) const noexcept {
2344  AMREX_ASSERT(lev >= 0 && lev < eb.size() && eb[lev] != nullptr);
2345  AMREX_ASSERT(eb[lev]->get_const_factory() != nullptr);
2346  return *(eb[lev]->get_const_factory());
2347  }
2348 
2349  [[nodiscard]] static int nghost_eb_basic ()
2350  { return 5; }
2351 
2352  // We need 5 for doing StateRedistribution; otherwise 4 would be enough
2353  [[nodiscard]] static int nghost_eb_volume ()
2354  { return 5; }
2355 
2356  [[nodiscard]] static int nghost_eb_full ()
2357  { return 4; }
2358 
2359 #ifdef ERF_USE_FFT
2360  // Vector over levels of Vector over subdomains of solvers
2361  amrex::Vector<amrex::Vector<std::unique_ptr<amrex::FFT::Poisson<amrex::MultiFab>>>> m_3D_poisson;
2362  amrex::Vector<amrex::Vector<std::unique_ptr<amrex::FFT::PoissonHybrid<amrex::MultiFab>>>> m_2D_poisson;
2363 #endif
2364 
2365 public:
2366  void writeJobInfo (const std::string& dir,
2367  erf_provenance::ArtifactType artifact_type,
2368  int artifact_step,
2369  double artifact_time_seconds) const;
2370  static void writeBuildInfo (std::ostream& os);
2371 
2372  static void print_banner (MPI_Comm /*comm*/, std::ostream& /*out*/);
2373  static void print_usage (MPI_Comm /*comm*/, std::ostream& /*out*/);
2374  static void print_error (MPI_Comm /*comm*/, const std::string& msg);
2375  static void print_summary (std::ostream&);
2376  static void print_tpls (std::ostream& /*out*/);
2377 };
2378 
2379 #endif
AMREX_ENUM(StateInterpType, FullState, Perturbational)
@ tau23
Definition: ERF_DataStruct.H:48
@ tau13
Definition: ERF_DataStruct.H:48
Declares the embedded-boundary factory manager used by ERF levels.
Contains the Eulerian microphysics class.
Compact list of the wall faces of resolved buildings on one AMR level.
#define NBCVAR_max
Definition: ERF_IndexDefines.H:32
@ Centered_6th
Contains the Lagrangian microphysics class.
Dimensionless numeric literals and pure mathematical constants.
constexpr amrex::Real one
Definition: ERF_NumericalConstants.H:37
constexpr amrex::Real zero
Definition: ERF_NumericalConstants.H:36
std::string name
Definition: ERF_Plotfile2DCatalog.cpp:105
amrex::Real Real
Definition: ERF_ShocInterface.H:19
amrex::Vector< std::string > station_vars_3d
Definition: ERF.H:2294
void MakeHorizontalAverages()
Definition: ERF.cpp:4078
amrex::Vector< amrex::MultiFab > rU_new
Definition: ERF.H:1355
static int last_check_file_step
Definition: ERF.H:1577
amrex::Vector< std::unique_ptr< amrex::MultiFab > > walldist
Definition: ERF.H:1508
void ConfigureDriverAtmosToOceanCoupling(bool use_coupling_driver, bool use_two_way_coupling, bool use_state_contract)
Definition: ERF_to_REMORA.cpp:247
amrex::Vector< amrex::Vector< amrex::Vector< amrex::Real > > > h_sponge_ptrs
Definition: ERF.H:1980
amrex::Array< int, AMREX_SPACEDIM *2 > m_th_file_face
Definition: ERF.H:1557
void GetOceanToAtmosSurfaceLayout(amrex::BoxArray &ba, amrex::DistributionMapping &dm)
Definition: ERF_to_REMORA.cpp:263
bool metgrid_basic_linear
Definition: ERF.H:1885
amrex::Vector< amrex::Vector< amrex::Box > > boxes_at_level
Definition: ERF.H:1284
amrex::Vector< std::string > samplelinelogname
Definition: ERF.H:2315
void MakeEBGeometry()
void ReportTerrainSlopeFactor(int lev, bool force)
Definition: ERF_ComputeTimestep.cpp:248
int max_step
Definition: ERF.H:1600
void HurricaneTracker(int lev, double time, const amrex::MultiFab &cc_vel, const amrex::Real velmag_threshold, amrex::TagBoxArray *tags=nullptr)
Definition: ERF_RefineHurricane.cpp:147
bool metgrid_debug_msf
Definition: ERF.H:1883
AMREX_FORCE_INLINE std::ostream & DerDataLog(int i)
Definition: ERF.H:2115
amrex::Vector< amrex::Vector< std::unique_ptr< amrex::MultiFab > > > mapfac
Definition: ERF.H:1511
void setRayleighRefFromSounding(bool restarting)
Set Rayleigh mean profiles from input sounding.
Definition: ERF_InitRayleigh.cpp:85
static bool diffusive_dt_limit
Definition: ERF.H:1627
void init_only(int lev, double time)
Definition: ERF.cpp:3023
bool plot_surfmodel
Definition: ERF.H:1713
void BuildPlot3DScratch(const amrex::Vector< std::string > &plot_var_names, Plot3DScratch &scratch, int max_lev=-1, bool sync_solution=true)
Definition: ERF_Plotfile.cpp:300
void turbPert_amplitude_w(const int lev)
Definition: ERF_InitTurbPert.cpp:72
amrex::Vector< std::unique_ptr< MRISplitIntegrator< amrex::Vector< amrex::MultiFab > > > > mri_integrator_mem
Definition: ERF.H:1330
amrex::Vector< std::unique_ptr< amrex::iMultiFab > > column_kextent
Definition: ERF.H:1911
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > d_sinesq_stag_ptrs
Definition: ERF.H:1992
void check_vels_for_nans(amrex::MultiFab const &xvel, amrex::MultiFab const &yvel, amrex::MultiFab const &zvel)
Definition: ERF.cpp:4373
void ibseb_write_checkpoint(const std::string &checkpointname, int lev) const
Definition: ERF_IBSEB.cpp:556
void Evolve()
Definition: ERF.cpp:147
amrex::Vector< amrex::MultiFab > avg_xmom
Definition: ERF.H:1337
amrex::Vector< std::string > urban_data_name
Definition: ERF.H:1398
amrex::Vector< amrex::MultiFab > pp_inc
Definition: ERF.H:1333
void make_eb_box()
amrex::Real m_warned_coupled_sst_max
Definition: ERF.H:1042
amrex::Vector< ERFFillPatcher > FPr_u
Definition: ERF.H:1439
std::unique_ptr< SurfaceModel > m_SurfaceModel
Definition: ERF.H:1389
amrex::Vector< amrex::IntVect > sampleline
Definition: ERF.H:2316
void PackAtmosphericStates(amrex::Vector< amrex::MultiFab * > &states, double time, const amrex::Vector< const amrex::MultiFab * > &weight_mf, const amrex::Vector< const amrex::iMultiFab * > &index_mf, int max_stencil_size, const amrex::MultiFab *dst_mskr=nullptr, const amrex::MultiFab *dst_msku=nullptr, const amrex::MultiFab *dst_mskv=nullptr)
Definition: ERF_to_REMORA.cpp:370
amrex::Vector< std::string > subvol3d_var_names
Definition: ERF.H:1724
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_q1fx3_lev
Definition: ERF.H:1462
amrex::Vector< double > t_new
Definition: ERF.H:1306
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Hwave_onegrid
Definition: ERF.H:1525
amrex::Vector< amrex::Vector< amrex::MultiFab > > vars_new
Definition: ERF.H:1314
void FillCoarsePatch(int lev, double time)
Definition: ERF_FillCoarsePatch.cpp:20
void WriteAtIntermediateTime(int nstep, double time)
Definition: ERF.cpp:246
ERF(ERF &&) noexcept=delete
bool writeNow(double cur_time, const int nstep, const int plot_int, const double plot_per, const double dt_0, double &last_file_time)
Definition: ERF.cpp:4285
static constexpr int column_kextent_hi_sentinel
Definition: ERF.H:1914
static double startCPUTime
Definition: ERF.H:2189
void FillBdyCCVels(amrex::MultiFab &mf_cc_vel, amrex::Geometry &lev_geom)
Definition: ERF_FillBdyCCVels.cpp:17
AMREX_FORCE_INLINE int NumSampleLineLogs() noexcept
Definition: ERF.H:2158
static double last_plot2d_file_time_1
Definition: ERF.H:1581
static void print_tpls(std::ostream &)
Definition: ERF_ConsoleIO.cpp:150
amrex::Vector< amrex::Real > dz_min
Definition: ERF.H:2028
amrex::Vector< amrex::MultiFab > lagged_delta_rt
Definition: ERF.H:1336
amrex::Real plane_sampling_per
Definition: ERF.H:2284
std::string DataLogName(int i) const noexcept
The filename of the ith datalog file.
Definition: ERF.H:2319
void make_lsm_at_level(int lev, bool from_regrid=false, int source_lev=-1, bool source_is_raw_input=false, bool initialize_now=false)
Definition: ERF_MakeNewLevel.cpp:1645
std::string plot2d_file_2
Definition: ERF.H:1694
double m_plot3d_per_2
Definition: ERF.H:1706
static double bndry_output_planes_per
Definition: ERF.H:1947
amrex::Vector< std::unique_ptr< amrex::MultiFab > > thin_yforce
Definition: ERF.H:1570
void SetDriverAtmosToOceanStateContract(bool use_state_contract)
Definition: ERF_to_REMORA.cpp:257
void ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real time, int ngrow) override
Definition: ERF_Tagging.cpp:34
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_hfx3_lev
Definition: ERF.H:1460
amrex::Vector< amrex::Vector< amrex::Real > > h_w_subsid
Definition: ERF.H:1960
static void print_banner(MPI_Comm, std::ostream &)
Definition: ERF_ConsoleIO.cpp:65
void volWgtColumnSum(int lev, const amrex::MultiFab &mf, int comp, amrex::MultiFab &mf_2d, const amrex::MultiFab &dJ)
Definition: ERF_VolWgtSum.cpp:103
amrex::Vector< std::unique_ptr< ShocDriver > > native_shoc_driver
Definition: ERF.H:1430
amrex::Vector< std::unique_ptr< std::fstream > > datalog
Definition: ERF.H:2303
std::string MakeFilename_EyeTracker_maxvel(int nstep)
Definition: ERF_TrackerOutput.cpp:69
BaseStateParams wrf_bsp
Definition: ERF.H:1926
amrex::Vector< ERFFillPatcher > FPr_v
Definition: ERF.H:1440
int cf_set_width
Definition: ERF.H:1437
void initializeEB()
Definition: ERF_EBInit.cpp:23
std::unique_ptr< amrex::MultiFab > wrf_MUB
Definition: ERF.H:1930
void setPlotVariables(const std::string &pp_plot_var_names, amrex::Vector< std::string > &plot_var_names)
Definition: ERF_Plotfile.cpp:21
amrex::Gpu::DeviceVector< amrex::Real > d_havg_temperature
Definition: ERF.H:2001
void post_timestep(int nstep, double time, double dt_lev)
Definition: ERF.cpp:604
std::unique_ptr< amrex::MultiFab > wrf_C1H
Definition: ERF.H:1928
std::string erfbdy_file
Definition: ERF.H:1897
void init_obs_nudging()
Definition: ERF.cpp:2398
static int last_plot2d_file_step_2
Definition: ERF.H:1576
int station_sampling_interval
Definition: ERF.H:2289
bool ibseb_after_radiation() const
Definition: ERF.H:817
bool init_Dirichlet_bc_data(const std::string input_file)
Definition: ERF_InitBCs.cpp:796
IBSEBParams ibseb_params
Definition: ERF.H:1496
const int timeprecision
Definition: ERF.H:1593
amrex::Vector< amrex::Vector< amrex::MultiFab * > > urban_data
Definition: ERF.H:1397
void setRecordDataInfo(int i, const std::string &filename)
Definition: ERF.H:2207
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_hfx1_lev
Definition: ERF.H:1460
void canonicalizePlot3DVariables(amrex::Vector< std::string > &plot_var_names)
Definition: ERF_Plotfile.cpp:59
amrex::Vector< std::array< amrex::Real, 2 > > hurricane_eye_track_xy
Definition: ERF.H:282
void SurfaceDataInterpolation(const int nlevs, const double time, amrex::Vector< std::unique_ptr< amrex::MultiFab >> &z_phys_nd, bool regrid_forces_file_read)
Definition: ERF_SurfaceDataInterpolation.cpp:163
amrex::Vector< amrex::BoxArray > ba2d
Definition: ERF.H:1901
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_extdir_vals
Definition: ERF.H:1542
void init_stations()
Definition: ERF_StationSampler.cpp:695
void init_from_input_sounding(int lev)
Definition: ERF_InitFromInputSounding.cpp:148
void erf_enforce_hse(int lev, amrex::MultiFab &dens, amrex::MultiFab &pres, amrex::MultiFab &pi, amrex::MultiFab &th, amrex::MultiFab &qv, std::unique_ptr< amrex::MultiFab > &z_cc)
Definition: ERF_Init1D.cpp:228
amrex::Vector< amrex::Vector< amrex::MultiFab > > gradp
Definition: ERF.H:1318
std::string plot3d_file_1
Definition: ERF.H:1691
eb_ const & get_eb(int lev) const noexcept
Definition: ERF.H:2331
amrex::Gpu::DeviceVector< amrex::Real > d_havg_qv
Definition: ERF.H:2003
amrex::Vector< std::unique_ptr< amrex::MultiFab > > qfx3_EB
Definition: ERF.H:1469
static amrex::Real column_loc_y
Definition: ERF.H:1941
static bool plot_file_on_restart
Definition: ERF.H:1588
amrex::Vector< amrex::Vector< amrex::MultiFab > > bckgnd_state
Definition: ERF.H:295
amrex::Long m_warned_coupled_sst_nan
Definition: ERF.H:1043
static int mg_verbose
Definition: ERF.H:1845
double m_check_per
Definition: ERF.H:1722
void ReadParameters()
Definition: ERF.cpp:3201
static double sum_per
Definition: ERF.H:1853
static amrex::Vector< std::string > PlotFileVarNames(amrex::Vector< std::string > plot_var_names)
Definition: ERF_Plotfile.cpp:278
amrex::Vector< amrex::Vector< amrex::MultiFab > > forecast_state_interp
Definition: ERF.H:290
bool FindInitialEye(int lev, const amrex::MultiFab &cc_vel, const amrex::Real velmag_threshold, amrex::Real &eye_x, amrex::Real &eye_y)
Definition: ERF_RefineHurricane.cpp:31
void InitializeFromFile()
amrex::Vector< std::unique_ptr< ERFPhysBCFunct_cons > > physbcs_cons
Definition: ERF.H:1342
amrex::Vector< double > dt
Definition: ERF.H:1308
static double stop_time
Definition: ERF.H:1604
void advance_lsm(int lev, amrex::MultiFab &cons_in, amrex::MultiFab &xvel_in, amrex::MultiFab &yvel_in, const double &time, const double &dt_advance)
Definition: ERF_AdvanceLSM.cpp:50
amrex::Vector< std::unique_ptr< amrex::MultiFab > > mf_PSFC
Definition: ERF.H:1934
void flush_stations() const
Definition: ERF_StationSampler.cpp:1537
ERF()
Definition: ERF_Constructors.cpp:171
~ERF() override
amrex::Vector< std::unique_ptr< amrex::MultiFab > > z_phys_nd_src
Definition: ERF.H:1483
amrex::Vector< std::unique_ptr< amrex::MultiFab > > detJ_cc
Definition: ERF.H:1478
void seb_surface_layer_fluxes(int lev, const amrex::MultiFab *&sens_flux, const amrex::MultiFab *&laten_flux) const
Definition: ERF.cpp:524
amrex::Vector< std::string > lsm_flux_name
Definition: ERF.H:1395
void WriteMyEBSurface()
amrex::Vector< std::unique_ptr< amrex::MultiFab > > z_phys_cc
Definition: ERF.H:1476
amrex::Vector< amrex::BoxArray > slope_report_grids
Definition: ERF.H:1634
static double column_per
Definition: ERF.H:1939
amrex::Vector< std::unique_ptr< eb_ > > eb
Definition: ERF.H:2329
amrex::Vector< std::unique_ptr< amrex::MultiFab > > eddyDiffs_lev
Definition: ERF.H:1446
static SolverChoice solverChoice
Definition: ERF.H:1809
static constexpr int column_kextent_lo_sentinel
Definition: ERF.H:1913
amrex::Vector< std::unique_ptr< amrex::MultiFab > > hfx3_EB
Definition: ERF.H:1468
int mean_vars_time_reset_done
Definition: ERF.H:1328
amrex::Vector< ERFFillPatcher > FPr_c
Definition: ERF.H:1438
void WriteGenericPlotfileHeaderWithTerrain(std::ostream &HeaderFile, int nlevels, const amrex::Vector< amrex::BoxArray > &bArray, const amrex::Vector< std::string > &varnames, const amrex::Vector< amrex::Geometry > &my_geom, double time, const amrex::Vector< int > &level_steps, const amrex::Vector< amrex::IntVect > &my_ref_ratio, const std::string &versionName, const std::string &levelPrefix, const std::string &mfPrefix) const
Definition: ERF_Plotfile.cpp:2540
void update_box_for_refinement(std::string &ref_prefix, int &lev_for_box, amrex::RealBox &real_box, const double time)
Definition: ERF_RefineBox.cpp:372
void advance_urban(int lev, amrex::MultiFab &cons_in, amrex::MultiFab &u_in, amrex::MultiFab &v_in, const amrex::Real &dt_advance, const amrex::Geometry &geom, const amrex::MultiFab *z_phys_nd, amrex::MultiFab &eddyDiffs_in)
Definition: ERF_AdvanceUrban.cpp:9
amrex::Vector< amrex::DistributionMapping > dm_chkfile
Definition: ERF.H:1657
bool plot_rad
Definition: ERF.H:1432
TwoStreamRadiation two_stream_rad
Definition: ERF.H:1424
amrex::Vector< amrex::Real > diffusive_fourier_warned
Definition: ERF.H:1632
amrex::Vector< std::array< amrex::Real, 2 > > hurricane_tracker_circle
Definition: ERF.H:286
static bool use_fft
Definition: ERF.H:1846
bool m_plot_face_vels
Definition: ERF.H:1709
amrex::Vector< std::array< amrex::Real, 2 > > hurricane_maxvel_vs_time
Definition: ERF.H:284
void turbPert_update(const int lev, const double dt)
Definition: ERF_InitTurbPert.cpp:18
void sum_derived_quantities(double time)
Definition: ERF_WriteScalarProfiles.cpp:179
amrex::Vector< amrex::MultiFab > base_state_new
Definition: ERF.H:1520
std::string plot3d_file_2
Definition: ERF.H:1692
void ibseb_set_two_stream_sun(int lev, amrex::Real time)
Definition: ERF_IBSEB.cpp:438
amrex::Vector< std::unique_ptr< amrex::MultiFab > > az
Definition: ERF.H:1481
int regrid_int
Definition: ERF.H:1644
void derive_diag_profiles(double time, amrex::Gpu::HostVector< amrex::Real > &h_avg_u, amrex::Gpu::HostVector< amrex::Real > &h_avg_v, amrex::Gpu::HostVector< amrex::Real > &h_avg_w, amrex::Gpu::HostVector< amrex::Real > &h_avg_rho, amrex::Gpu::HostVector< amrex::Real > &h_avg_th, amrex::Gpu::HostVector< amrex::Real > &h_avg_ksgs, amrex::Gpu::HostVector< amrex::Real > &h_avg_Kmv, amrex::Gpu::HostVector< amrex::Real > &h_avg_Khv, amrex::Gpu::HostVector< amrex::Real > &h_avg_qv, amrex::Gpu::HostVector< amrex::Real > &h_avg_qc, amrex::Gpu::HostVector< amrex::Real > &h_avg_qr, amrex::Gpu::HostVector< amrex::Real > &h_avg_wqv, amrex::Gpu::HostVector< amrex::Real > &h_avg_wqc, amrex::Gpu::HostVector< amrex::Real > &h_avg_wqr, amrex::Gpu::HostVector< amrex::Real > &h_avg_qi, amrex::Gpu::HostVector< amrex::Real > &h_avg_qs, amrex::Gpu::HostVector< amrex::Real > &h_avg_qg, amrex::Gpu::HostVector< amrex::Real > &h_avg_uu, amrex::Gpu::HostVector< amrex::Real > &h_avg_uv, amrex::Gpu::HostVector< amrex::Real > &h_avg_uw, amrex::Gpu::HostVector< amrex::Real > &h_avg_vv, amrex::Gpu::HostVector< amrex::Real > &h_avg_vw, amrex::Gpu::HostVector< amrex::Real > &h_avg_ww, amrex::Gpu::HostVector< amrex::Real > &h_avg_uth, amrex::Gpu::HostVector< amrex::Real > &h_avg_vth, amrex::Gpu::HostVector< amrex::Real > &h_avg_wth, amrex::Gpu::HostVector< amrex::Real > &h_avg_thth, amrex::Gpu::HostVector< amrex::Real > &h_avg_ku, amrex::Gpu::HostVector< amrex::Real > &h_avg_kv, amrex::Gpu::HostVector< amrex::Real > &h_avg_kw, amrex::Gpu::HostVector< amrex::Real > &h_avg_p, amrex::Gpu::HostVector< amrex::Real > &h_avg_pu, amrex::Gpu::HostVector< amrex::Real > &h_avg_pv, amrex::Gpu::HostVector< amrex::Real > &h_avg_pw, amrex::Gpu::HostVector< amrex::Real > &h_avg_wthv)
Definition: ERF_Write1DProfiles.cpp:241
void sample_stations(amrex::Real time)
Definition: ERF_StationSampler.cpp:1254
bool write_erfbdy
Definition: ERF.H:1894
void solve_with_gmres(int lev, const amrex::Box &subdomain, amrex::MultiFab &rhs, amrex::MultiFab &p, amrex::Array< amrex::MultiFab, AMREX_SPACEDIM > &fluxes, amrex::MultiFab &ax_sub, amrex::MultiFab &ay_sub, amrex::MultiFab &az_sub, amrex::MultiFab &, amrex::MultiFab &znd_sub)
Definition: ERF_SolveWithGMRES.cpp:28
amrex::Vector< amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > > d_sponge_ptrs
Definition: ERF.H:1988
amrex::Vector< std::unique_ptr< amrex::MultiFab > > precip
Definition: ERF.H:1374
amrex::Vector< long > dt_mri_ratio
Definition: ERF.H:1309
amrex::Vector< amrex::Vector< std::unique_ptr< amrex::MultiFab > > > Tau
Definition: ERF.H:1444
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vel_t_avg
Definition: ERF.H:1321
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_q2fx3_lev
Definition: ERF.H:1463
amrex::Vector< amrex::Vector< std::unique_ptr< amrex::iMultiFab > > > lmask_lev
Definition: ERF.H:1452
void GetFillableAtmosToOceanLanes(bool state_contract, amrex::Vector< int > &can_fill) const
Definition: ERF_to_REMORA.cpp:300
AMREX_FORCE_INLINE int NumSamplePointLogs() noexcept
Definition: ERF.H:2144
amrex::Vector< amrex::Real > h_havg_pressure
Definition: ERF.H:1996
void update_diffusive_arrays(int lev, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm)
Definition: ERF_MakeNewArrays.cpp:698
bool regrid_level_0_on_restart_in_effect
Definition: ERF.H:1658
std::unique_ptr< amrex::MultiFab > wrf_PHB
Definition: ERF.H:1932
static int verbose
Definition: ERF.H:1844
amrex::Vector< amrex::Real > h_havg_qc
Definition: ERF.H:1998
amrex::Vector< std::unique_ptr< ERFPhysBCFunct_w > > physbcs_w
Definition: ERF.H:1345
static int nghost_eb_basic()
Definition: ERF.H:2349
void post_update(amrex::MultiFab &state_mf, double time, const amrex::Geometry &geom)
void AverageDownMoistStateTo(int crse_lev)
Conservation-preserving fine-to-coarse average of RhoTheta and the active moist conserved components ...
Definition: ERF_AverageDown.cpp:243
amrex::Vector< double > last_subvol_time
Definition: ERF.H:1586
void FillForecastStateMultiFabs(const int lev, const std::string &filename, const std::unique_ptr< amrex::MultiFab > &z_phys_nd, amrex::Vector< amrex::Vector< amrex::MultiFab >> &forecast_state)
Definition: ERF_WeatherDataInterpolation.cpp:72
static std::string column_file_name
Definition: ERF.H:1942
amrex::Vector< std::unique_ptr< std::fstream > > samplelinelog
Definition: ERF.H:2314
amrex::Vector< std::unique_ptr< amrex::MultiFab > > terrain_blanking
Definition: ERF.H:1502
amrex::Vector< std::unique_ptr< amrex::MultiFab > > terrain_blanking_xface
Definition: ERF.H:1503
std::unique_ptr< Microphysics > micro
Definition: ERF.H:1365
void surface_flux_sources(int lev, const amrex::MultiFab *&sens_flux, const amrex::MultiFab *&laten_flux) const
Definition: ERF_Plotfile2D.cpp:173
int m_plot2d_int_2
Definition: ERF.H:1700
amrex::Vector< amrex::MultiFab > base_state
Definition: ERF.H:1519
void fill_rhs(amrex::MultiFab &rhs_mf, const amrex::MultiFab &state_mf, double time, const amrex::Geometry &geom)
void GetEnsembleCheckpointName(int da_iter, int ens_no)
AMREX_FORCE_INLINE amrex::YAFluxRegister * getAdvFluxReg(int lev)
Definition: ERF.H:2101
int m_plot3d_int_1
Definition: ERF.H:1697
amrex::Vector< amrex::Real > h_havg_density
Definition: ERF.H:1994
amrex::Vector< int > m_skin_uncoupled_warned
Definition: ERF.H:456
static double last_plot2d_file_time_2
Definition: ERF.H:1582
amrex::Vector< std::unique_ptr< amrex::MultiFab > > z_phys_nd_new
Definition: ERF.H:1490
void derive_diag_profiles_stag(double time, amrex::Gpu::HostVector< amrex::Real > &h_avg_u, amrex::Gpu::HostVector< amrex::Real > &h_avg_v, amrex::Gpu::HostVector< amrex::Real > &h_avg_w, amrex::Gpu::HostVector< amrex::Real > &h_avg_rho, amrex::Gpu::HostVector< amrex::Real > &h_avg_th, amrex::Gpu::HostVector< amrex::Real > &h_avg_ksgs, amrex::Gpu::HostVector< amrex::Real > &h_avg_Kmv, amrex::Gpu::HostVector< amrex::Real > &h_avg_Khv, amrex::Gpu::HostVector< amrex::Real > &h_avg_qv, amrex::Gpu::HostVector< amrex::Real > &h_avg_qc, amrex::Gpu::HostVector< amrex::Real > &h_avg_qr, amrex::Gpu::HostVector< amrex::Real > &h_avg_wqv, amrex::Gpu::HostVector< amrex::Real > &h_avg_wqc, amrex::Gpu::HostVector< amrex::Real > &h_avg_wqr, amrex::Gpu::HostVector< amrex::Real > &h_avg_qi, amrex::Gpu::HostVector< amrex::Real > &h_avg_qs, amrex::Gpu::HostVector< amrex::Real > &h_avg_qg, amrex::Gpu::HostVector< amrex::Real > &h_avg_uu, amrex::Gpu::HostVector< amrex::Real > &h_avg_uv, amrex::Gpu::HostVector< amrex::Real > &h_avg_uw, amrex::Gpu::HostVector< amrex::Real > &h_avg_vv, amrex::Gpu::HostVector< amrex::Real > &h_avg_vw, amrex::Gpu::HostVector< amrex::Real > &h_avg_ww, amrex::Gpu::HostVector< amrex::Real > &h_avg_uth, amrex::Gpu::HostVector< amrex::Real > &h_avg_vth, amrex::Gpu::HostVector< amrex::Real > &h_avg_wth, amrex::Gpu::HostVector< amrex::Real > &h_avg_thth, amrex::Gpu::HostVector< amrex::Real > &h_avg_ku, amrex::Gpu::HostVector< amrex::Real > &h_avg_kv, amrex::Gpu::HostVector< amrex::Real > &h_avg_kw, amrex::Gpu::HostVector< amrex::Real > &h_avg_p, amrex::Gpu::HostVector< amrex::Real > &h_avg_pu, amrex::Gpu::HostVector< amrex::Real > &h_avg_pv, amrex::Gpu::HostVector< amrex::Real > &h_avg_pw, amrex::Gpu::HostVector< amrex::Real > &h_avg_wthv)
Definition: ERF_Write1DProfiles_stag.cpp:358
void create_background_state_for_ensemble(int lev, amrex::MultiFab &mf_cc_pert, amrex::MultiFab &cons_pert, amrex::MultiFab &xvel_pert, amrex::MultiFab &yvel_pert, amrex::MultiFab &zvel_pert)
Definition: ERF_InitForEnsemble.cpp:732
const amrex::Vector< std::string > derived_subvol_names
Definition: ERF.H:1805
amrex::Vector< std::array< amrex::Real, 2 > > hurricane_minpressure_vs_time
Definition: ERF.H:285
bool metgrid_retain_sfc
Definition: ERF.H:1888
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Qv_prim
Definition: ERF.H:1350
static int sum_interval
Definition: ERF.H:1851
static int pert_interval
Definition: ERF.H:1852
amrex::Real line_sampling_per
Definition: ERF.H:2283
void restart()
Definition: ERF.cpp:2968
void ibseb_report(int nstep, amrex::Real time)
Definition: ERF_IBSEB.cpp:579
amrex::Vector< double > t_avg_cnt
Definition: ERF.H:1322
static int last_plot3d_file_step_2
Definition: ERF.H:1574
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_q1fx2_lev
Definition: ERF.H:1462
amrex::Vector< double > fixed_fast_dt
Definition: ERF.H:1639
amrex::IntVect & SampleLine(int i)
Definition: ERF.H:2177
void build_fine_mask(int lev, amrex::MultiFab &fine_mask)
Definition: ERF_VolWgtSum.cpp:155
void HurricaneMaxVelTracker(const amrex::Geometry &geom, const amrex::MultiFab &mf_cc_vel, const double &time)
Definition: ERF_HurricaneDiagnostics.cpp:678
amrex::Real station_sampling_per
Definition: ERF.H:2290
amrex::Real calday
Definition: ERF.H:1419
int file_name_digits
Definition: ERF.H:1861
amrex::Vector< amrex::MultiFab > rV_new
Definition: ERF.H:1357
std::string PlotFileName(int lev) const
static bool diffusive_dt_check
Definition: ERF.H:1626
void initialize_integrator(int lev, amrex::MultiFab &cons_mf, amrex::MultiFab &vel_mf)
Definition: ERF_MakeNewArrays.cpp:1245
amrex::Vector< std::unique_ptr< amrex::MultiFab > > thin_zforce
Definition: ERF.H:1571
amrex::Vector< std::string > plot3d_var_names_2
Definition: ERF.H:1727
void sample_points(int lev, double time, amrex::IntVect cell, amrex::MultiFab &mf)
Definition: ERF_WriteScalarProfiles.cpp:537
void WeatherDataInterpolation(const int nlevs, const double time, amrex::Vector< std::unique_ptr< amrex::MultiFab >> &z_phys_nd, bool regrid_forces_file_read)
Definition: ERF_WeatherDataInterpolation.cpp:374
amrex::Vector< amrex::BCRec > domain_bcs_type
Definition: ERF.H:1535
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Qr_prim
Definition: ERF.H:1351
void HurricaneEyeTrackerNotInitial(const SolverChoice &sc, const amrex::Geometry &geom, const amrex::MultiFab &mf_cc_vel, const amrex::Vector< amrex::MultiFab > &S_data)
Definition: ERF_HurricaneDiagnostics.cpp:368
void ibseb_check_refined_levels() const
Definition: ERF_IBSEB.cpp:226
void resolve_station_stencils()
Definition: ERF_StationSampler.cpp:924
void apply_gaussian_smoothing_to_perturbations(const int lev, amrex::MultiFab &mf_cc_pert)
Definition: ERF_InitForEnsemble.cpp:117
std::string pp_prefix
Definition: ERF.H:918
std::string SampleLineLogName(int i) const noexcept
The filename of the ith samplelinelog file.
Definition: ERF.H:2326
amrex::Vector< amrex::Vector< std::unique_ptr< amrex::MultiFab > > > sst_lev
Definition: ERF.H:1450
amrex::Vector< amrex::TableData< amrex::Real, 1 > > t_plane_avg
Definition: ERF.H:1257
amrex::Vector< std::string > plot2d_var_names_1
Definition: ERF.H:1728
void init_phys_bcs(bool &read_prim_theta)
Definition: ERF_InitBCs.cpp:26
amrex::Vector< std::unique_ptr< amrex::MultiFab > > thin_xforce
Definition: ERF.H:1569
AMREX_FORCE_INLINE int NumSamplePoints() noexcept
Definition: ERF.H:2171
static bool grids_are_split_in_z(const amrex::BoxArray &ba)
Definition: ERF_MakeNewArrays.cpp:611
bool metgrid_use_sfc
Definition: ERF.H:1887
amrex::Vector< std::unique_ptr< amrex::YAFluxRegister > > advflux_reg
Definition: ERF.H:1530
void sample_lines(int lev, double time, amrex::IntVect cell, amrex::MultiFab &mf)
Definition: ERF_WriteScalarProfiles.cpp:573
void ComputeAndWriteEnsemblePerturbations(const int da_iter)
void setPlotVariables2D(const std::string &pp_plot_var_names, amrex::Vector< std::string > &plot_var_names)
Definition: ERF_Plotfile2D.cpp:115
void interp_psfc_from_coarse(int lev)
Definition: ERF.cpp:2517
void init_custom(int lev)
Definition: ERF_InitCustomPertState.cpp:26
amrex::Vector< std::unique_ptr< IRadiation > > rad
Definition: ERF.H:1409
std::unique_ptr< ProblemBase > prob
Definition: ERF.H:1280
amrex::Vector< int > num_files_at_level
Definition: ERF.H:1283
void ibseb_advance(int lev, amrex::Real time, amrex::Real dt_lev, const amrex::MultiFab &cons, const amrex::MultiFab &xvel, const amrex::MultiFab &yvel, const amrex::MultiFab &zvel)
Definition: ERF_IBSEB.cpp:479
static double last_plot3d_file_time_2
Definition: ERF.H:1580
void init_bcs()
Definition: ERF_InitBCs.cpp:323
int profile_int
Definition: ERF.H:1716
erf_cloud_chamber::Config cloud_chamber_config
Definition: ERF.H:1372
bool metgrid_debug_quiescent
Definition: ERF.H:1879
amrex::Vector< std::unique_ptr< ERFPhysBCFunct_u > > physbcs_u
Definition: ERF.H:1343
bool destag_profiles
Definition: ERF.H:1717
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > stretched_dz_d
Definition: ERF.H:1517
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > th_bc_data
Definition: ERF.H:1253
void FillPlot2DVars(int lev, const amrex::Vector< std::string > &plot_var_names, const amrex::Vector< std::string > &varnames, const amrex::Vector< plotfile2d::Plotfile2DOutputDescriptor > &output_descriptors, amrex::MultiFab &mf_dst, int ncomp_mf)
Definition: ERF_Plotfile2D.cpp:210
std::string DerDataLogName(int i) const noexcept
Definition: ERF.H:2320
void make_terrain_blanking(int lev)
Definition: ERF_MakeNewArrays.cpp:1153
void compute_max_pressure_gradient_diagnostic(int lev)
Definition: ERF_Diagnostics.cpp:14
void remake_zphys(int lev, amrex::Real time, std::unique_ptr< amrex::MultiFab > &temp_zphys_nd)
Definition: ERF_MakeNewArrays.cpp:1042
void project_momenta(int lev, double l_time, double l_dt, amrex::Vector< amrex::MultiFab > &vars)
Definition: ERF_PoissonSolve.cpp:148
int m_check_int
Definition: ERF.H:1721
void HurricaneEyeTrackerInitial(const SolverChoice &sc, const amrex::Geometry &geom, const amrex::Vector< amrex::MultiFab > &S_data, const amrex::Real &hurricane_eye_latitude, const amrex::Real &hurricane_eye_longitude)
Definition: ERF_HurricaneDiagnostics.cpp:229
void ReadVelsOnlyFromCheckpointFile(int lev_to_fill, std::string &chkfile)
Definition: ERF_Checkpoint.cpp:2195
void set_surface_layer_skin(int lev)
Definition: ERF.cpp:415
amrex::Vector< std::unique_ptr< amrex::MultiFab > > terrain_blanking_zface
Definition: ERF.H:1505
void appendPlot3DVariables(const amrex::Vector< std::string > &plot_var_names, amrex::Vector< std::string > &a_plot_var_names)
Definition: ERF_Plotfile.cpp:221
std::unique_ptr< amrex::iMultiFab > m_coupled_sst_valid
Definition: ERF.H:1032
static double last_plot3d_file_time_1
Definition: ERF.H:1579
double m_plot2d_per_2
Definition: ERF.H:1708
amrex::Vector< amrex::MultiFab > surface_state_1
Definition: ERF.H:291
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_diss_lev
Definition: ERF.H:1461
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > d_sinesq_ptrs
Definition: ERF.H:1991
amrex::Vector< amrex::MultiFab > rU_old
Definition: ERF.H:1354
amrex::Vector< std::unique_ptr< InputSoundingData > > input_sounding_data_fine
Definition: ERF.H:1244
bool HasRadiation() const
Definition: ERF.H:195
void ibseb_check_sun_matches_two_stream() const
Definition: ERF_IBSEB.cpp:308
AMREX_FORCE_INLINE int NumSampleLines() noexcept
Definition: ERF.H:2184
amrex::Array< bool, AMREX_SPACEDIM *2 > m_bc_nonreflecting
Definition: ERF.H:1554
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Theta_prim
Definition: ERF.H:1349
static double getCPUTime()
Definition: ERF.H:2193
void write_1D_profiles(double time)
Definition: ERF_Write1DProfiles.cpp:21
void init1DArrays()
amrex::Vector< std::unique_ptr< amrex::MultiFab > > z_t_rk
Definition: ERF.H:1493
static int check_for_nans
Definition: ERF.H:1848
void make_subdomains(const amrex::BoxList &ba, amrex::Vector< amrex::BoxArray > &bins)
Group a list of boxes into subdomains based on adjacency.
Definition: ERF_MakeSubdomains.cpp:11
std::string MakeVTKFilename(int nstep)
Definition: ERF_TrackerOutput.cpp:14
void initRayleigh_at_level(const int &lev)
Initialize Rayleigh damping profiles at a level.
Definition: ERF_InitRayleigh.cpp:16
Urban urban
Definition: ERF.H:1392
void appendPlotVariables(const std::string &pp_plot_var_names, amrex::Vector< std::string > &plot_var_names)
Definition: ERF_Plotfile.cpp:185
void read_box_for_refinement(std::string &ref_prefix, int &lev_for_box, amrex::RealBox &real_box)
Definition: ERF_RefineBox.cpp:13
amrex::Vector< int > rad_interp_from_coarse_pending
Definition: ERF.H:1303
int nvars_erfbdy
Definition: ERF.H:1898
amrex::Vector< std::unique_ptr< ERFPhysBCFunct_v > > physbcs_v
Definition: ERF.H:1344
void SetDirsForPlotfilesAndCheckpointsForDA(const int da_iter, const int ens_no)
amrex::Real m_warned_coupled_sst_min
Definition: ERF.H:1041
amrex::Vector< double > t_old
Definition: ERF.H:1307
amrex::Vector< std::string > tot_e_datalogname
Definition: ERF.H:2308
void FillIntermediatePatch(int lev, double time, const amrex::Vector< amrex::MultiFab * > &mfs_vel, const amrex::Vector< amrex::MultiFab * > &mfs_mom, int ng_cons, int ng_vel, bool cons_only, int icomp_cons, int ncomp_cons)
Definition: ERF_FillIntermediatePatch.cpp:27
static int output_bndry_planes
Definition: ERF.H:1945
void project_velocity_tb(int lev, double dt, amrex::Vector< amrex::MultiFab > &vars)
Definition: ERF_PoissonSolve_tb.cpp:35
bool m_seb_surface_layer_checked
check_seb_surface_layer has run
Definition: ERF.H:452
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > d_v_geos
Definition: ERF.H:1967
void update_terrain_arrays(int lev)
Definition: ERF_MakeNewArrays.cpp:1228
bool HasCloudWater() const
Definition: ERF.H:208
static std::string nc_bdy_file
Definition: ERF.H:1871
bool metgrid_interp_theta
Definition: ERF.H:1884
static amrex::Vector< amrex::Vector< std::string > > nc_init_file
Definition: ERF.H:1867
bool read_checkpoint_mf_if_present(amrex::MultiFab &dst, const std::string &mf_name, int lev, int scomp, int dcomp, int ncomp, const amrex::IntVect &dst_ghosts, bool src_ghosts=false)
Definition: ERF_Checkpoint.cpp:958
static int input_bndry_planes
Definition: ERF.H:1951
TwoStreamRadiation::OrbitalCache ibseb_orbit
Orbit of the year for erf.ibseb.sun_mode = two_stream.
Definition: ERF.H:1498
static StateInterpType interpolation_type
Definition: ERF.H:1864
LargeScaleForcingData lsf
Definition: ERF.H:1401
amrex::Gpu::DeviceVector< amrex::Real > d_havg_qc
Definition: ERF.H:2004
amrex::Real cloud_fraction(double time)
Definition: ERF_WriteScalarProfiles.cpp:458
void AverageDown()
Definition: ERF_AverageDown.cpp:16
std::set< std::string > user_specified_inputs
Definition: ERF.H:926
amrex::Vector< amrex::Vector< amrex::Real > > h_v_geos
Definition: ERF.H:1966
bool regrid_level_0_on_restart
Definition: ERF.H:1648
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Lwave_onegrid
Definition: ERF.H:1526
void advance_microphysics(int lev, amrex::MultiFab &cons_in, const double &dt_advance, const int &iteration, const double &time)
Definition: ERF_AdvanceMicrophysics.cpp:6
InputSoundingData input_sounding_data
Definition: ERF.H:1240
void write_1D_profiles_stag(double time)
Definition: ERF_Write1DProfiles_stag.cpp:29
amrex::Vector< amrex::Vector< amrex::Real > > h_sinesq_ptrs
Definition: ERF.H:1983
void create_random_perturbations(const int lev, amrex::MultiFab &mf_cc_pert)
Definition: ERF_InitForEnsemble.cpp:33
void Write2DPlotFile(int which, PlotFileType plotfile_type, amrex::Vector< std::string > plot_var_names)
Definition: ERF_Plotfile2D.cpp:714
amrex::Gpu::DeviceVector< amrex::Real > d_havg_density
Definition: ERF.H:2000
amrex::Vector< std::unique_ptr< amrex::MultiFab > > rhotheta_src
Definition: ERF.H:1957
void init_from_hse(int lev)
Definition: ERF_InitFromHSE.cpp:32
const std::string datetime_format
Definition: ERF.H:1607
void define_column_kextent(int lev, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm)
Definition: ERF_MakeNewArrays.cpp:635
void check_mesh_type(int lev)
Definition: ERF.cpp:4543
erf_provenance::ExecutionProvenance execution_provenance
Definition: ERF.H:1614
const amrex::MultiFab & station_ground(int lev)
Definition: ERF_StationSampler.cpp:1509
int metgrid_force_sfc_k
Definition: ERF.H:1891
void setSubVolVariables(const std::string &pp_subvol_var_names, amrex::Vector< std::string > &subvol_var_names)
Definition: ERF_WriteSubvolume.cpp:13
static int ng_pres_hse
Definition: ERF.H:1954
bool real_extrap_w
Definition: ERF.H:1873
static amrex::Real cfl
Definition: ERF.H:1617
void compute_max_buoyancy_gradp_diagnostic(int lev)
Definition: ERF_Diagnostics.cpp:307
amrex::Vector< std::unique_ptr< amrex::MultiFab > > fine_mask
Definition: ERF.H:1514
amrex::Gpu::DeviceVector< amrex::BCRec > domain_bcs_type_d
Definition: ERF.H:1536
amrex::Vector< double > t_mean_cnt
Definition: ERF.H:1326
amrex::Vector< std::unique_ptr< ForestDrag > > m_forest_drag
Definition: ERF.H:2011
const int datwidth
Definition: ERF.H:1591
amrex::Vector< amrex::BoxArray > ba1d
Definition: ERF.H:1900
InputSpongeData input_sponge_data
Definition: ERF.H:1247
amrex::Vector< amrex::Vector< amrex::BoxArray > > subdomains
Definition: ERF.H:2026
void check_state_for_nans(amrex::MultiFab const &S)
Definition: ERF.cpp:4306
bool diffusive_first_call
Definition: ERF.H:1630
std::string restart_chkfile
Definition: ERF.H:1610
bool metgrid_use_below_sfc
Definition: ERF.H:1886
amrex::Vector< std::string > sampleptlogname
Definition: ERF.H:2311
void ibseb_check_two_stream_provider() const
Definition: ERF_IBSEB.cpp:383
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > xvel_bc_data
Definition: ERF.H:1250
void InitData_pre()
Definition: ERF.cpp:899
amrex::IntVect & SamplePoint(int i)
Definition: ERF.H:2164
bool use_datetime
Definition: ERF.H:1606
amrex::Vector< std::array< amrex::Real, 2 > > hurricane_track_xy
Definition: ERF.H:281
amrex::Vector< amrex::Vector< amrex::Real > > h_u_geos
Definition: ERF.H:1963
void read_checkpoint_mf(amrex::MultiFab &dst, const std::string &mf_name, int lev, int scomp, int dcomp, int ncomp, const amrex::IntVect &dst_ghosts, bool src_ghosts=false)
Definition: ERF_Checkpoint.cpp:894
void InitializeLevelFromData(int lev, const amrex::MultiFab &initial_data)
std::string subvol_file
Definition: ERF.H:1695
int rad_datalog_int
Definition: ERF.H:1433
amrex::Vector< std::string > datalogname
Definition: ERF.H:2306
void initHSE()
Initialize HSE.
Definition: ERF_Init1D.cpp:208
void AverageDownTo(int crse_lev, int scomp, int ncomp, bool do_perturbational_and_momenta=true)
Definition: ERF_AverageDown.cpp:36
static amrex::Real column_loc_x
Definition: ERF.H:1940
static double dt_max
Definition: ERF.H:1622
amrex::Vector< amrex::MultiFab > surface_state_2
Definition: ERF.H:292
amrex::Vector< std::unique_ptr< amrex::MultiFab > > ax
Definition: ERF.H:1479
amrex::Vector< std::unique_ptr< amrex::MultiFab > > z_phys_nd
Definition: ERF.H:1475
void MakeDiagnosticAverage(amrex::Vector< amrex::Real > &h_havg, amrex::MultiFab &S, int n)
Definition: ERF.cpp:4184
amrex::Real metgrid_proximity
Definition: ERF.H:1889
amrex::Real volWgtSumMF(int lev, const amrex::MultiFab &mf, int comp, const amrex::MultiFab &dJ, const amrex::MultiFab &mfx, const amrex::MultiFab &mfy, bool finemask, bool local=true)
Definition: ERF_VolWgtSum.cpp:21
void setRecordDerDataInfo(int i, const std::string &filename)
Definition: ERF.H:2220
amrex::Vector< amrex::Real > h_havg_temperature
Definition: ERF.H:1995
amrex::Vector< std::unique_ptr< std::fstream > > sampleptlog
Definition: ERF.H:2310
void poisson_wall_dist(int lev)
Definition: ERF_PoissonWallDist.cpp:28
amrex::Vector< std::array< amrex::Real, 2 > > hurricane_eye_track_latlon
Definition: ERF.H:283
bool m_checked_coupled_sst
Definition: ERF.H:1038
amrex::Vector< std::unique_ptr< amrex::MultiFab > > detJ_cc_src
Definition: ERF.H:1485
amrex::Gpu::DeviceVector< amrex::Real > d_havg_pressure
Definition: ERF.H:2002
static bool is_it_time_for_action(int nstep, double time, double dt, int action_interval, double action_per)
Definition: ERF_WriteScalarProfiles.cpp:663
std::string plot2d_file_1
Definition: ERF.H:1693
void Advance(int lev, double time, double dt_lev, int iteration, int ncycle)
Definition: ERF_Advance.cpp:22
void ResetIntervalMeans()
Definition: ERF.cpp:365
amrex::Vector< amrex::TableData< amrex::Real, 1 > > r_plane_avg
Definition: ERF.H:1256
amrex::Vector< std::string > der_datalogname
Definition: ERF.H:2307
void ComputeDiffusiveRates(int lev, amrex::Real &rate_mom, amrex::Real &rate_scal) const
Definition: ERF_ComputeTimestep.cpp:165
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SmnSmn_lev
Definition: ERF.H:1447
const amrex::Vector< std::string > derived_names
Definition: ERF.H:1739
void fill_seb_from_coarse(int lev)
Fill a newly built level's two-stream SEB state from its parent.
Definition: ERF.cpp:549
void sum_integrated_quantities(double time)
Definition: ERF_WriteScalarProfiles.cpp:19
std::string MakeVTKFilename_TrackerCircle(int nstep)
Definition: ERF_TrackerOutput.cpp:27
void ComputeGlobalMinLocation(const SolverChoice &sc, const amrex::Geometry &geom, const amrex::Vector< amrex::MultiFab > &S_data, amrex::Real *d_val_min_ptr, int *d_i_min_ptr, int *d_j_min_ptr, amrex::Real &global_val_min, int &global_i_min, int &global_j_min)
Definition: ERF_HurricaneDiagnostics.cpp:77
amrex::Vector< std::unique_ptr< amrex::MultiFab > > ay_src
Definition: ERF.H:1487
std::unique_ptr< StationSampler > station_sampler
Definition: ERF.H:2291
void ComputeDt(int step=-1, double cur_time_d=0.0)
Definition: ERF_ComputeTimestep.cpp:26
AMREX_FORCE_INLINE std::ostream & DataLog(int i)
Definition: ERF.H:2108
std::string MakeVTKFilename_EyeTracker_xy(int nstep)
Definition: ERF_TrackerOutput.cpp:41
amrex::Vector< double > m_subvol_per
Definition: ERF.H:1703
amrex::Vector< int > nsubsteps
Definition: ERF.H:1287
amrex::Vector< std::unique_ptr< amrex::iMultiFab > > yflux_imask
Definition: ERF.H:1564
amrex::Vector< amrex::MultiFab > rW_new
Definition: ERF.H:1359
amrex::Vector< amrex::MultiFab > weather_forecast_data_2
Definition: ERF.H:287
amrex::Vector< std::unique_ptr< amrex::MultiFab > > lon_m
Definition: ERF.H:1234
std::unique_ptr< WriteBndryPlanes > m_w2d
Definition: ERF.H:2008
AMREX_FORCE_INLINE std::ostream & SampleLineLog(int i)
Definition: ERF.H:2151
void HurricaneMinPressureTracker(MoistureType moisture_type, const amrex::Geometry &geom, const amrex::MultiFab &mf_cons_var, const double &time)
Definition: ERF_HurricaneDiagnostics.cpp:742
amrex::Vector< amrex::Vector< amrex::MultiFab * > > lsm_flux
Definition: ERF.H:1396
double EvolveOneStep(double time, double dt_request)
Definition: ERF_to_REMORA.cpp:221
bool use_erfbdy
Definition: ERF.H:1895
amrex::Vector< std::unique_ptr< SurfaceLayer > > m_SurfaceLayer
Definition: ERF.H:2010
const LargeScaleForcingData & lsf_at_level(int lev)
Definition: ERF_InitFromInputSounding.cpp:123
amrex::Vector< std::string > plot3d_var_names_1
Definition: ERF.H:1726
std::string SamplePointLogName(int i) const noexcept
The filename of the ith sampleptlog file.
Definition: ERF.H:2323
void InitData_post()
Definition: ERF.cpp:956
void init_ibseb()
Definition: ERF_IBSEB.cpp:48
void refinement_criteria_setup()
Definition: ERF_Tagging.cpp:502
double estTimeStep(int lev, long &dt_fast_ratio) const
Definition: ERF_ComputeTimestep.cpp:304
static int nghost_eb_volume()
Definition: ERF.H:2353
bool metgrid_debug_dry
Definition: ERF.H:1881
static AMREX_FORCE_INLINE int ComputeGhostCells(const SolverChoice &sc)
Definition: ERF.H:2032
static int bndry_output_planes_interval
Definition: ERF.H:1946
void init_geo_wind_profile(const std::string input_file, amrex::Vector< amrex::Real > &u_geos, amrex::Gpu::DeviceVector< amrex::Real > &u_geos_d, amrex::Vector< amrex::Real > &v_geos, amrex::Gpu::DeviceVector< amrex::Real > &v_geos_d, const amrex::Geometry &lgeom, const amrex::Vector< amrex::Real > &zlev_stag)
Definition: ERF_InitGeowind.cpp:21
void ERF_shared()
Definition: ERF_Constructors.cpp:202
amrex::Vector< std::string > plot2d_var_names_2
Definition: ERF.H:1729
amrex::Vector< amrex::Vector< std::unique_ptr< amrex::MultiFab > > > Tau_corr
Definition: ERF.H:1445
void FillPatchCrseLevel(int lev, double time, const amrex::Vector< amrex::MultiFab * > &mfs_vel, bool cons_only=false)
Definition: ERF_FillPatch.cpp:356
void WriteSubvolume(int isub, amrex::Vector< std::string > subvol_var_names)
Definition: ERF_WriteSubvolume.cpp:113
const InputSoundingData & sounding_at_level(int lev)
Definition: ERF_InitFromInputSounding.cpp:89
void sum_energy_quantities(double time)
Definition: ERF_WriteScalarProfiles.cpp:318
void make_flux_register(int lev)
Definition: ERF_MakeNewArrays.cpp:684
static int nghost_eb_full()
Definition: ERF.H:2356
void RemakeLevel(int lev, amrex::Real time, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm) override
Definition: ERF_MakeNewLevel.cpp:853
static void GotoNextLine(std::istream &is)
Definition: ERF_Checkpoint.cpp:141
void MakeNewLevelFromScratch(int lev, amrex::Real time, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm) override
Definition: ERF_MakeNewLevel.cpp:28
void init_stuff(int lev, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm, amrex::Vector< amrex::MultiFab > &lev_new, amrex::Vector< amrex::MultiFab > &lev_old, amrex::MultiFab &tmp_base_state, std::unique_ptr< amrex::MultiFab > &tmp_zphys_nd)
Definition: ERF_MakeNewArrays.cpp:25
amrex::Vector< amrex::MultiFab > zmom_crse_rhs
Definition: ERF.H:1363
void advance_radiation(int lev, amrex::MultiFab &cons_in, const double &dt_advance)
Advance radiation diagnostics and heating rates for one time step.
Definition: ERF_AdvanceRadiation.cpp:55
bool metgrid_debug_isothermal
Definition: ERF.H:1880
void PerformDataAssimilation(int da_iter)
amrex::Vector< std::string > lsm_data_name
Definition: ERF.H:1393
std::unique_ptr< erf_sbm::SBMStateManager > sbm_state_manager
Definition: ERF.H:1366
amrex::Vector< std::unique_ptr< amrex::MultiFab > > rhoqt_src
Definition: ERF.H:1958
void initSponge()
Initialize sponge profiles.
Definition: ERF_InitSponge.cpp:35
std::unique_ptr< PlaneSampler > plane_sampler
Definition: ERF.H:2286
void check_for_low_temp(amrex::MultiFab &S)
Definition: ERF.cpp:4388
amrex::Vector< std::unique_ptr< std::fstream > > der_datalog
Definition: ERF.H:2304
static amrex::Vector< amrex::Vector< int > > have_read_nc_init_file
Definition: ERF.H:1868
amrex::Vector< std::unique_ptr< std::fstream > > tot_e_datalog
Definition: ERF.H:2305
amrex::Vector< std::unique_ptr< amrex::MultiFab > > sinPhi_m
Definition: ERF.H:1236
amrex::Real ibseb_bulk_richardson_height(int lev, const amrex::MultiFab &cons, const amrex::MultiFab &xvel, const amrex::MultiFab &yvel)
Definition: ERF_IBSEB.cpp:616
static double previousCPUTimeUsed
Definition: ERF.H:2190
void writeJobInfo(const std::string &dir, erf_provenance::ArtifactType artifact_type, int artifact_step, double artifact_time_seconds) const
Definition: ERF_WriteJobInfo.cpp:16
bool m_driver_has_atm2ocn_coupling
Definition: ERF.H:1022
double m_plot3d_per_1
Definition: ERF.H:1705
int real_width
Definition: ERF.H:1872
void MakeNewLevelFromCoarse(int lev, amrex::Real time, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm) override
Definition: ERF_MakeNewLevel.cpp:414
amrex::Vector< int > last_subvol_step
Definition: ERF.H:1585
void fill_from_bndryregs(const amrex::Vector< amrex::MultiFab * > &mfs, double time)
Definition: ERF_BoundaryConditionsBndryReg.cpp:13
amrex::Vector< std::unique_ptr< amrex::MultiFab > > ax_src
Definition: ERF.H:1486
void derive_forcing_profiles_stag(amrex::Gpu::HostVector< amrex::Real > &h_avg_ttend, amrex::Gpu::HostVector< amrex::Real > &h_avg_qtend, amrex::Gpu::HostVector< amrex::Real > &h_avg_wsub, amrex::Gpu::HostVector< amrex::Real > &h_avg_thtend, amrex::Gpu::HostVector< amrex::Real > &h_avg_qhtend, amrex::Gpu::HostVector< amrex::Real > &h_avg_tvtend, amrex::Gpu::HostVector< amrex::Real > &h_avg_qvtend, amrex::Gpu::HostVector< amrex::Real > &h_avg_qcvtend, amrex::Gpu::HostVector< amrex::Real > &h_avg_tnudge, amrex::Gpu::HostVector< amrex::Real > &h_avg_qnudge, amrex::Gpu::HostVector< amrex::Real > &h_avg_unudge, amrex::Gpu::HostVector< amrex::Real > &h_avg_vnudge)
Definition: ERF_Write1DProfiles_stag.cpp:803
amrex::Vector< amrex::Vector< std::unique_ptr< amrex::MultiFab > > > urb_frac_lev
Definition: ERF.H:1457
amrex::Vector< std::unique_ptr< amrex::MultiFab > > z_phys_cc_src
Definition: ERF.H:1484
void input_sponge(int lev)
Definition: ERF_InitSponge.cpp:17
amrex::Vector< std::unique_ptr< amrex::MultiFab > > nudge_data
Definition: ERF.H:1406
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > d_u_geos
Definition: ERF.H:1964
bool m_driver_uses_two_way_coupling
Definition: ERF.H:1023
void Define_ERFFillPatchers(int lev)
Definition: ERF.cpp:4259
AMREX_FORCE_INLINE int NumDataLogs() noexcept
Definition: ERF.H:2122
static PlotFileType plotfile3d_type_2
Definition: ERF.H:1857
void setRecordEnergyDataInfo(int i, const std::string &filename)
Definition: ERF.H:2233
TurbulentPerturbation turbPert
Definition: ERF.H:1812
amrex::Vector< amrex::MultiFab > rW_old
Definition: ERF.H:1358
amrex::Vector< double > fixed_dt
Definition: ERF.H:1638
void ResetIntervalMeansAfter3DPlotfileBatch(int plotfiles_written, bool interval_diagnostic_consumed)
Definition: ERF.cpp:351
amrex::Vector< amrex::Vector< amrex::MultiFab > > forecast_state_2
Definition: ERF.H:289
bool has_own_init_file(int lev) const
Definition: ERF.cpp:2428
amrex::Vector< std::unique_ptr< amrex::MultiFab > > station_ib_ground
Definition: ERF.H:2297
void check_for_negative_theta(amrex::MultiFab &S)
Definition: ERF.cpp:4468
void ImposeBCsOnPhi(int lev, amrex::MultiFab &phi, const amrex::Box &subdomain)
Definition: ERF_ImposeBCsOnPhi.cpp:19
void Interp2DArrays(int lev, const amrex::BoxArray &my_ba2d, const amrex::DistributionMapping &my_dm)
Definition: ERF.cpp:2664
amrex::Vector< std::unique_ptr< amrex::MultiFab > > lsf_data
Definition: ERF.H:1407
void ClearLevel(int lev) override
Definition: ERF_MakeNewLevel.cpp:1539
std::string MakeFilename_EyeTracker_minpressure(int nstep)
Definition: ERF_TrackerOutput.cpp:83
std::unique_ptr< amrex::MultiFab > wrf_RDNW
Definition: ERF.H:1931
void HurricaneEyeTracker(const SolverChoice &solverChoice, const amrex::MultiFab &mf_cc_vel)
Definition: ERF_HurricaneDiagnostics.cpp:644
static double dt_max_initial
Definition: ERF.H:1621
static PlotFileType plotfile2d_type_2
Definition: ERF.H:1859
int plane_sampling_interval
Definition: ERF.H:2282
void compute_divergence(int lev, amrex::MultiFab &rhs, amrex::Array< amrex::MultiFab const *, AMREX_SPACEDIM > rho0_u_const, amrex::MultiFab const &mf_mx, amrex::MultiFab const &mf_my, amrex::MultiFab const &mf_vx, amrex::MultiFab const &mf_uy, amrex::MultiFab const &ax_in, amrex::MultiFab const &ay_in, amrex::MultiFab const &dJ_in, amrex::Geometry const &geom_at_lev)
Definition: ERF_ComputeDivergence.cpp:18
static amrex::Vector< amrex::AMRErrorTag > ref_tags
Definition: ERF.H:2016
void make_physbcs(int lev)
Definition: ERF_MakeNewArrays.cpp:1268
amrex::Vector< std::unique_ptr< amrex::MultiFab > > terrain_blanking_yface
Definition: ERF.H:1504
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > d_w_subsid
Definition: ERF.H:1961
amrex::Vector< ERFFillPatcher > FPr_w
Definition: ERF.H:1441
void resolve_station_positions()
Definition: ERF_StationSampler.cpp:844
std::unique_ptr< erf_auxiliary::AuxiliaryInertTracer > auxiliary_inert_tracer
Definition: ERF.H:1370
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_hfx2_lev
Definition: ERF.H:1460
void WriteLinePlot(const std::string &filename, amrex::Vector< std::array< amrex::Real, 2 >> &points_xy)
Definition: ERF_Write1DProfiles.cpp:642
bool m_warned_coupled_sst_declined
Definition: ERF.H:1035
amrex::Vector< amrex::Vector< std::unique_ptr< amrex::iMultiFab > > > soil_type_lev
Definition: ERF.H:1456
amrex::Vector< amrex::Vector< amrex::Real > > zlevels_stag
Definition: ERF.H:1472
void FillPlot3DVars(int lev, const amrex::Vector< std::string > &plot_var_names, Plot3DScratch &scratch, amrex::MultiFab &mf_dst, int ncomp_mf, amrex::Real tnew)
Definition: ERF_Plotfile.cpp:499
AMREX_FORCE_INLINE int NumDerDataLogs() noexcept
Definition: ERF.H:2129
amrex::EBFArrayBoxFactory const & EBFactory(int lev) const noexcept
Definition: ERF.H:2343
amrex::Vector< amrex::Vector< amrex::MultiFab * > > lsm_data
Definition: ERF.H:1394
void init_immersed_forcing(int lev)
Definition: ERF_InitImmersedForcing.cpp:15
amrex::Vector< amrex::Vector< amrex::Real > > stretched_dz_h
Definition: ERF.H:1516
amrex::Vector< std::unique_ptr< LargeScaleForcingData > > lsf_fine
Definition: ERF.H:1405
bool use_real_time_in_pltname
Definition: ERF.H:1862
int m_plot2d_int_1
Definition: ERF.H:1699
void WriteCheckpointFile() const
Definition: ERF_Checkpoint.cpp:151
amrex::Array< amrex::Array< erf_wall_scalar_bc::WallScalarBCIntent, AMREX_SPACEDIM *2 >, NBCVAR_max > m_wall_scalar_bc_intent
Definition: ERF.H:1551
static int output_1d_column
Definition: ERF.H:1937
void interp_land_masks_from_coarse(int lev)
Definition: ERF.cpp:2574
bool metgrid_debug_psfc
Definition: ERF.H:1882
void ReadStormTrackerRestart()
Definition: ERF_HurricaneDiagnostics.cpp:479
bool Write3DPlotFile(int which, PlotFileType plotfile_type, amrex::Vector< std::string > plot_var_names)
Definition: ERF_Plotfile.cpp:2094
amrex::Vector< std::unique_ptr< amrex::MultiFab > > az_src
Definition: ERF.H:1488
static int fixed_mri_dt_ratio
Definition: ERF.H:1640
static amrex::Real init_shrink
Definition: ERF.H:1619
void WriteVTKPolyline(const std::string &filename, amrex::Vector< std::array< amrex::Real, 2 >> &points_xy)
Definition: ERF_TrackerOutput.cpp:97
void HurricaneTrackerCircle()
Definition: ERF_HurricaneDiagnostics.cpp:194
static double last_check_file_time
Definition: ERF.H:1583
static std::string nc_low_file
Definition: ERF.H:1876
amrex::Vector< amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > > d_rayleigh_ptrs
Definition: ERF.H:1987
void InitData()
Definition: ERF.cpp:889
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Lwave
Definition: ERF.H:1524
amrex::Vector< std::unique_ptr< amrex::MultiFab > > cosPhi_m
Definition: ERF.H:1236
amrex::Vector< std::unique_ptr< amrex::MultiFab > > interval_means
Definition: ERF.H:1325
void ParameterSanityChecks()
Definition: ERF.cpp:3955
amrex::Vector< amrex::Vector< std::unique_ptr< amrex::iMultiFab > > > land_type_lev
Definition: ERF.H:1455
static double start_time
Definition: ERF.H:1603
void init_zphys(int lev, double elapsed_time)
Definition: ERF_MakeNewArrays.cpp:898
void derive_stress_profiles(amrex::Gpu::HostVector< amrex::Real > &h_avg_tau11, amrex::Gpu::HostVector< amrex::Real > &h_avg_tau12, amrex::Gpu::HostVector< amrex::Real > &h_avg_tau13, amrex::Gpu::HostVector< amrex::Real > &h_avg_tau22, amrex::Gpu::HostVector< amrex::Real > &h_avg_tau23, amrex::Gpu::HostVector< amrex::Real > &h_avg_tau33, amrex::Gpu::HostVector< amrex::Real > &h_avg_hfx3, amrex::Gpu::HostVector< amrex::Real > &h_avg_q1fx3, amrex::Gpu::HostVector< amrex::Real > &h_avg_q2fx3, amrex::Gpu::HostVector< amrex::Real > &h_avg_diss)
Definition: ERF_Write1DProfiles.cpp:543
amrex::Vector< amrex::Vector< amrex::MultiFab > > forecast_state_1
Definition: ERF.H:288
int cf_width
Definition: ERF.H:1436
static int last_plot2d_file_step_1
Definition: ERF.H:1575
amrex::Vector< std::unique_ptr< amrex::iMultiFab > > zflux_imask
Definition: ERF.H:1565
bool m_expand_plotvars_to_unif_rr
Definition: ERF.H:1696
std::unique_ptr< CloudChamberBudget > cloud_chamber_budget
Definition: ERF.H:1371
void Construct_ERFFillPatchers(int lev)
Definition: ERF.cpp:4233
amrex::Vector< int > num_boxes_at_level
Definition: ERF.H:1282
void compute_native_shoc_tendencies(int lev, amrex::MultiFab *cons, amrex::MultiFab *xvel, amrex::MultiFab *yvel, amrex::MultiFab *zvel, amrex::Real *w_subsid, amrex::MultiFab *tau13, amrex::MultiFab *tau23, amrex::MultiFab *hfx3, amrex::MultiFab *qfx3, amrex::MultiFab *eddyDiffs, amrex::MultiFab *z_phys_nd, const double &dt_advance)
Definition: ERF_ShocCoupling.cpp:6
amrex::Vector< std::string > station_vars_2d
Definition: ERF.H:2295
void FillSurfaceStateMultiFabs(const int lev, const std::string &filename, amrex::Vector< amrex::MultiFab > &surface_state)
Definition: ERF_SurfaceDataInterpolation.cpp:26
static amrex::Real sub_cfl
Definition: ERF.H:1618
static void print_error(MPI_Comm, const std::string &msg)
Definition: ERF_ConsoleIO.cpp:48
static int ng_dens_hse
Definition: ERF.H:1953
std::unique_ptr< ReadBndryPlanes > m_r2d
Definition: ERF.H:2009
static amrex::Real diffusive_cfl
Definition: ERF.H:1628
amrex::Vector< std::unique_ptr< amrex::MultiFab > > ay
Definition: ERF.H:1480
amrex::Vector< amrex::Real > slope_report_alpha
Definition: ERF.H:1635
void interp_base_state_from_coarse(int lev)
Definition: ERF_Init1D.cpp:179
amrex::Vector< amrex::Vector< amrex::MultiFab * > > qmoist
Definition: ERF.H:1373
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_q1fx1_lev
Definition: ERF.H:1462
void GetLandMask(const amrex::iMultiFab *&lmask) const
Definition: ERF_to_REMORA.cpp:290
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > zvel_bc_data
Definition: ERF.H:1252
void derive_stress_profiles_stag(amrex::Gpu::HostVector< amrex::Real > &h_avg_tau11, amrex::Gpu::HostVector< amrex::Real > &h_avg_tau12, amrex::Gpu::HostVector< amrex::Real > &h_avg_tau13, amrex::Gpu::HostVector< amrex::Real > &h_avg_tau22, amrex::Gpu::HostVector< amrex::Real > &h_avg_tau23, amrex::Gpu::HostVector< amrex::Real > &h_avg_tau33, amrex::Gpu::HostVector< amrex::Real > &h_avg_hfx3, amrex::Gpu::HostVector< amrex::Real > &h_avg_q1fx3, amrex::Gpu::HostVector< amrex::Real > &h_avg_q2fx3, amrex::Gpu::HostVector< amrex::Real > &h_avg_diss)
Definition: ERF_Write1DProfiles_stag.cpp:684
LandSurface lsm
Definition: ERF.H:1391
static amrex::Real change_max
Definition: ERF.H:1620
void setRecordSampleLineInfo(int i, int lev, amrex::IntVect &cell, const std::string &filename)
Definition: ERF.H:2263
void ApplyOceanSurfaceState(const amrex::Vector< amrex::MultiFab * > &state, double time, const amrex::iMultiFab *erf_coverage=nullptr)
Definition: ERF_to_REMORA.cpp:830
void setSpongeRefFromSounding(bool restarting)
Set sponge mean profiles from input sounding.
Definition: ERF_InitSponge.cpp:65
amrex::Vector< amrex::MultiFab > avg_ymom
Definition: ERF.H:1338
int line_sampling_interval
Definition: ERF.H:2281
amrex::Vector< amrex::Vector< amrex::Real > > h_sinesq_stag_ptrs
Definition: ERF.H:1984
amrex::Vector< std::unique_ptr< amrex::MultiFab > > detJ_cc_new
Definition: ERF.H:1491
static amrex::Vector< std::string > ref_tag_indicator_names
Definition: ERF.H:2024
void project_initial_velocity(int lev, double time, double dt)
Definition: ERF_PoissonSolve.cpp:72
void interp_mapfac_from_coarse(int lev)
Definition: ERF.cpp:2451
amrex::Array< std::string, 2 *AMREX_SPACEDIM > domain_bc_type
Definition: ERF.H:1539
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > yvel_bc_data
Definition: ERF.H:1251
static void writeBuildInfo(std::ostream &os)
Definition: ERF_WriteJobInfo.cpp:183
amrex::GpuArray< ERF_BC, AMREX_SPACEDIM *2 > phys_bc_type
Definition: ERF.H:1560
std::string check_file
Definition: ERF.H:1720
bool rad_level_needs_interpolation(int lev) const
Definition: ERF.cpp:392
amrex::Vector< amrex::IntVect > samplepoint
Definition: ERF.H:2312
amrex::Vector< amrex::MultiFab > surface_state_interp
Definition: ERF.H:293
amrex::Vector< amrex::Real > h_havg_qv
Definition: ERF.H:1997
amrex::Vector< std::unique_ptr< IBFaceSet > > m_ibseb
Definition: ERF.H:1497
amrex::Vector< amrex::MultiFab > weather_forecast_data_1
Definition: ERF.H:287
void advance_dycore(int level, amrex::Vector< amrex::MultiFab > &state_old, amrex::Vector< amrex::MultiFab > &state_new, amrex::MultiFab &xvel_old, amrex::MultiFab &yvel_old, amrex::MultiFab &zvel_old, amrex::MultiFab &xvel_new, amrex::MultiFab &yvel_new, amrex::MultiFab &zvel_new, amrex::MultiFab &source, amrex::MultiFab &xmom_src, amrex::MultiFab &ymom_src, amrex::MultiFab &zmom_src, amrex::MultiFab &buoyancy, amrex::Geometry fine_geom, double dt, double time)
Definition: ERF_AdvanceDycore.cpp:41
static void print_usage(MPI_Comm, std::ostream &)
Definition: ERF_ConsoleIO.cpp:31
amrex::Real solar_declin
Definition: ERF.H:1418
amrex::Vector< amrex::MultiFab > rV_old
Definition: ERF.H:1356
amrex::Vector< std::unique_ptr< amrex::MultiFab > > lat_m
Definition: ERF.H:1234
void timeStep(int lev, double time, int iteration)
Definition: ERF_TimeStep.cpp:19
amrex::Vector< amrex::Vector< amrex::Vector< amrex::Real > > > h_rayleigh_ptrs
Definition: ERF.H:1979
void make_eb_regular()
amrex::Vector< amrex::Vector< amrex::MultiFab * > > urban_flux
Definition: ERF.H:1399
static int last_plot3d_file_step_1
Definition: ERF.H:1573
void FillPatchFineLevel(int lev, double time, const amrex::Vector< amrex::MultiFab * > &mfs_vel, const amrex::Vector< amrex::MultiFab * > &mfs_mom, const amrex::MultiFab &old_base_state, const amrex::MultiFab &new_base_state, bool fillset=true, bool cons_only=false)
Definition: ERF_FillPatch.cpp:25
std::unique_ptr< LineSampler > line_sampler
Definition: ERF.H:2285
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Hwave
Definition: ERF.H:1523
amrex::Vector< amrex::Vector< amrex::Vector< std::unique_ptr< amrex::MultiFab > > > > Tau_EB
Definition: ERF.H:1467
amrex::Vector< int > istep
Definition: ERF.H:1286
const int datprecision
Definition: ERF.H:1592
amrex::Vector< std::unique_ptr< amrex::iMultiFab > > xflux_imask
Definition: ERF.H:1563
void derive_upwp(amrex::Vector< amrex::Real > &h_havg)
static PlotFileType plotfile2d_type_1
Definition: ERF.H:1858
int metgrid_order
Definition: ERF.H:1890
bool finished_wave
Definition: ERF.H:1527
void ReadCheckpointFile()
Definition: ERF_Checkpoint.cpp:974
amrex::Vector< amrex::Vector< amrex::MultiFab > > vars_old
Definition: ERF.H:1315
amrex::Real ibseb_z_i_level0
Level 0's bulk-Richardson depth of its current step, for the refined levels.
Definition: ERF.H:1499
void WriteAtFinalTime()
Definition: ERF.cpp:303
amrex::Vector< std::unique_ptr< ERFPhysBCFunct_base > > physbcs_base
Definition: ERF.H:1346
void init_thin_body(int lev, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm)
Definition: ERF_MakeNewLevel.cpp:1736
static PlotFileType plotfile3d_type_1
Definition: ERF.H:1856
amrex::Vector< int > m_subvol_int
Definition: ERF.H:1702
AMREX_FORCE_INLINE std::ostream & SamplePointLog(int i)
Definition: ERF.H:2137
std::string MakeFilename_EyeTracker_latlon(int nstep)
Definition: ERF_TrackerOutput.cpp:55
void WriteMultiLevelPlotfileWithTerrain(const std::string &plotfilename, int nlevels, const amrex::Vector< const amrex::MultiFab * > &mf, const amrex::Vector< const amrex::MultiFab * > &mf_nd, const amrex::Vector< std::string > &varnames, const amrex::Vector< amrex::Geometry > &my_geom, double time, const amrex::Vector< int > &level_steps, const amrex::Vector< amrex::IntVect > &my_ref_ratio, const std::string &versionName="HyperCLaw-V1.1", const std::string &levelPrefix="Level_", const std::string &mfPrefix="Cell", const amrex::Vector< std::string > &extra_dirs=amrex::Vector< std::string >()) const
Definition: ERF_Plotfile.cpp:2453
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_neumann_vals
Definition: ERF.H:1545
amrex::Vector< amrex::BoxArray > ba_chkfile
Definition: ERF.H:1656
bool m_driver_atm2ocn_uses_state_contract
Definition: ERF.H:1024
bool m_plot_face_terrain_blanking
Definition: ERF.H:1710
amrex::Vector< amrex::Vector< std::unique_ptr< amrex::MultiFab > > > tsk_lev
Definition: ERF.H:1451
void setRecordSamplePointInfo(int i, int lev, amrex::IntVect &cell, const std::string &filename)
Definition: ERF.H:2246
std::unique_ptr< amrex::MultiFab > m_coupled_sst
Definition: ERF.H:1031
bool has_surface_layer_inputs(const std::string &prefix) const
Definition: ERF.cpp:4584
static int column_interval
Definition: ERF.H:1938
static void print_summary(std::ostream &)
int m_plot3d_int_2
Definition: ERF.H:1698
amrex::Vector< std::unique_ptr< amrex::MultiFab > > qheating_rates
Definition: ERF.H:1410
void fill_terrain_surface(int lev, amrex::MultiFab &z_phys, double elapsed_time)
Definition: ERF_MakeNewArrays.cpp:866
void check_seb_surface_layer()
Definition: ERF.cpp:459
void turbPert_amplitude(const int lev)
Definition: ERF_InitTurbPert.cpp:42
std::unique_ptr< erf_sbm::SBMTransport > sbm_transport
Definition: ERF.H:1369
amrex::Vector< std::unique_ptr< amrex::MultiFab > > rad_fluxes
Definition: ERF.H:1416
void initializeMicrophysics(const int &)
Definition: ERF.cpp:2933
static double bndry_output_planes_start_time
Definition: ERF.H:1948
std::unique_ptr< amrex::MultiFab > wrf_C2H
Definition: ERF.H:1929
bool plot_lsm
Definition: ERF.H:1712
amrex::Vector< amrex::MultiFab > avg_zmom
Definition: ERF.H:1339
const amrex::Vector< std::string > cons_names
Definition: ERF.H:1730
void ReadCheckpointFileSurfaceLayer()
Definition: ERF_Checkpoint.cpp:2235
void GetOceanToAtmosCellCenterLonLat(const amrex::MultiFab *&lon_cc, const amrex::MultiFab *&lat_cc) const
Definition: ERF_to_REMORA.cpp:276
double m_plot2d_per_1
Definition: ERF.H:1707
Wrapper class for managing land surface models across AMR levels.
Definition: ERF_LandSurface.H:19
The two-stream radiation model (erf.radiation_model = TwoStream).
Definition: ERF_TwoStreamRadiation.H:49
Wrapper class for managing urban models across AMR levels.
Definition: ERF_Urban.H:12
Owns and exposes cell-centered and face-centered EB factories.
Definition: ERF_EB.H:24
Definition: ERF_SBMStateManager.H:16
Definition: ERF_SBMTransport.H:27
Definition: ERF_InterpolationUtils.H:15
@ None
Definition: ERF_LSM_Types.H:6
@ pres
Definition: ERF_Kessler.H:28
@ qv
Definition: ERF_Kessler.H:31
@ T
Definition: ERF_IndexDefines.H:131
constexpr int S
Definition: ERF_TwoStreamColumn.H:604
@ xvel
Definition: ERF_IndexDefines.H:218
@ cons
Definition: ERF_IndexDefines.H:217
@ zvel
Definition: ERF_IndexDefines.H:220
@ yvel
Definition: ERF_IndexDefines.H:219
@ p
Definition: ERF_WSM6.H:280
Definition: ERF_ConsoleIO.cpp:17
ArtifactType
Definition: ERF_Provenance.H:37
Definition: ERF.H:108
real(c_double), parameter, private pi
Definition: ERF_module_mp_morr_two_moment.F90:100
integer, private isub
Definition: ERF_module_mp_morr_two_moment.F90:164
real(kind=kind_phys), parameter, private dens
Definition: ERF_module_mp_wdm6.F90:61
Definition: ERF_ObsNudging.cpp:22
Definition: ERF.H:107
AdvType dycore_vert_adv_type
Vertical advection scheme for dynamical-core variables.
Definition: ERF_AdvStruct.H:442
AdvType moistscal_vert_adv_type
Vertical advection scheme for moist scalar variables.
Definition: ERF_AdvStruct.H:446
AdvType dryscal_horiz_adv_type
Horizontal advection scheme for dry scalar variables.
Definition: ERF_AdvStruct.H:443
AdvType dycore_horiz_adv_type
Horizontal advection scheme for dynamical-core variables.
Definition: ERF_AdvStruct.H:441
AdvType moistscal_horiz_adv_type
Horizontal advection scheme for moist scalar variables.
Definition: ERF_AdvStruct.H:445
AdvType dryscal_vert_adv_type
Vertical advection scheme for dry scalar variables.
Definition: ERF_AdvStruct.H:444
Definition: ERF_BaseStateParams.H:35
Definition: ERF.H:737
amrex::Vector< amrex::MultiFab > mf_cc_vel
Definition: ERF.H:738
amrex::Vector< amrex::MultiFab > mf_cc_fx
Definition: ERF.H:740
amrex::Vector< amrex::MultiFab > mf_cc_tau
Definition: ERF.H:739
Definition: ERF_IBSEBParams.H:25
bool enable
Master switch.
Definition: ERF_IBSEBParams.H:26
std::string radiation
Definition: ERF_IBSEBParams.H:46
Definition: ERF_InputSoundingData.H:23
Definition: ERF_InputSpongeData.H:19
Definition: ERF_LargeScaleForcingData.H:31
int qi
cloud ice
Definition: ERF_DataStruct.H:251
int qc
cloud liquid water
Definition: ERF_DataStruct.H:250
Definition: ERF_DataStruct.H:685
MoistureType moisture_type
Moisture or microphysics model.
Definition: ERF_DataStruct.H:2524
AdvChoice advChoice
Advection-related options.
Definition: ERF_DataStruct.H:2248
static TerrainType terrain_type
Terrain or immersed-boundary representation.
Definition: ERF_DataStruct.H:2224
MoistureComponentIndices moisture_indices
Index map of the moisture data carried by the active scheme: conserved-state components for the speci...
Definition: ERF_DataStruct.H:2575
bool use_num_diff
Whether sixth-order numerical diffusion is enabled.
Definition: ERF_DataStruct.H:2520
Runtime state and operations for turbulent perturbation forcing.
Definition: ERF_TurbPertStruct.H:26
Definition: ERF_TwoStreamRadiation.H:293
Configuration parameters for cloud chamber initialization.
Definition: ERF_CloudChamber.H:40
Definition: ERF_Provenance.H:66
Definition: ERF_Plotfile2DSampledLevel.H:56