From 96730c3a6a8cdf7195469f3a3d8600d0689f30c8 Mon Sep 17 00:00:00 2001 From: asalmgren Date: Wed, 9 Oct 2024 03:04:02 +0000 Subject: [PATCH] Deployed from erf-model/ERF --- ERF_8H_source.html | 2396 ++++++++--------- ERF__init__from__input__sounding_8cpp.html | 310 +-- classERF-members.html | 4 +- classERF.html | 2725 ++++++++++---------- classERF.js | 4 +- classMultiBlockContainer.html | 2 +- functions_func_w.html | 4 +- functions_w.html | 4 +- navtreedata.js | 2 +- navtreeindex3.js | 4 +- navtreeindex4.js | 4 +- search/all_16.js | 4 +- search/functions_15.js | 4 +- 13 files changed, 2765 insertions(+), 2702 deletions(-) diff --git a/ERF_8H_source.html b/ERF_8H_source.html index 3f9d08ce7..91e17ed7b 100644 --- a/ERF_8H_source.html +++ b/ERF_8H_source.html @@ -398,1001 +398,1005 @@
310  // write plotfile to disk
311  void WritePlotFile (int which, amrex::Vector<std::string> plot_var_names);
312 
-
313  void WriteMultiLevelPlotfileWithTerrain (const std::string &plotfilename,
+
313  void WriteMultiLevelPlotfileWithTerrain (const std::string &plotfilename,
314  int nlevels,
315  const amrex::Vector<const amrex::MultiFab*> &mf,
316  const amrex::Vector<const amrex::MultiFab*> &mf_nd,
317  const amrex::Vector<std::string> &varnames,
-
318  amrex::Real time,
-
319  const amrex::Vector<int> &level_steps,
-
320  const std::string &versionName = "HyperCLaw-V1.1",
-
321  const std::string &levelPrefix = "Level_",
-
322  const std::string &mfPrefix = "Cell",
-
323  const amrex::Vector<std::string>& extra_dirs = amrex::Vector<std::string>()) const;
-
324 
-
325 
-
326  void WriteGenericPlotfileHeaderWithTerrain (std::ostream &HeaderFile,
-
327  int nlevels,
-
328  const amrex::Vector<amrex::BoxArray> &bArray,
-
329  const amrex::Vector<std::string> &varnames,
-
330  amrex::Real time,
-
331  const amrex::Vector<int> &level_steps,
-
332  const std::string &versionName,
-
333  const std::string &levelPrefix,
-
334  const std::string &mfPrefix) const;
-
335 
-
336  void erf_enforce_hse (int lev,
-
337  amrex::MultiFab& dens, amrex::MultiFab& pres, amrex::MultiFab& pi,
-
338  std::unique_ptr<amrex::MultiFab>& z_cc);
+
318  const amrex::Vector<amrex::Geometry>& my_geom,
+
319  amrex::Real time,
+
320  const amrex::Vector<int> &level_steps,
+
321  const amrex::Vector<amrex::IntVect>& my_ref_ratio,
+
322  const std::string &versionName = "HyperCLaw-V1.1",
+
323  const std::string &levelPrefix = "Level_",
+
324  const std::string &mfPrefix = "Cell",
+
325  const amrex::Vector<std::string>& extra_dirs = amrex::Vector<std::string>()) const;
+
326 
+
327 
+
328  void WriteGenericPlotfileHeaderWithTerrain (std::ostream &HeaderFile,
+
329  int nlevels,
+
330  const amrex::Vector<amrex::BoxArray> &bArray,
+
331  const amrex::Vector<std::string> &varnames,
+
332  const amrex::Vector<amrex::Geometry>& my_geom,
+
333  amrex::Real time,
+
334  const amrex::Vector<int> &level_steps,
+
335  const amrex::Vector<amrex::IntVect>& my_ref_ratio,
+
336  const std::string &versionName,
+
337  const std::string &levelPrefix,
+
338  const std::string &mfPrefix) const;
339 
-
340 #ifdef ERF_USE_NETCDF
-
341  //! Write a timestep to 1D vertical column output for coupling
-
342  void writeToNCColumnFile (int lev,
-
343  const std::string& colfile_name, amrex::Real xloc, amrex::Real yloc,
-
344  amrex::Real time);
-
345 #endif //ERF_USE_NETCDF
-
346 
-
347  void init_from_input_sounding (int lev);
-
348 
-
349  void input_sponge (int lev);
+
340  void erf_enforce_hse (int lev,
+
341  amrex::MultiFab& dens, amrex::MultiFab& pres, amrex::MultiFab& pi,
+
342  std::unique_ptr<amrex::MultiFab>& z_cc);
+
343 
+
344 #ifdef ERF_USE_NETCDF
+
345  //! Write a timestep to 1D vertical column output for coupling
+
346  void writeToNCColumnFile (int lev,
+
347  const std::string& colfile_name, amrex::Real xloc, amrex::Real yloc,
+
348  amrex::Real time);
+
349 #endif //ERF_USE_NETCDF
350 
-
351  void init_from_hse (int lev);
+
351  void init_from_input_sounding (int lev);
352 
-
353  void init_immersed_body (int lev, const amrex::BoxArray& ba, const amrex::DistributionMapping& dm);
+
353  void input_sponge (int lev);
354 
-
355 #ifdef ERF_USE_MULTIBLOCK
-
356  // constructor used when ERF is created by a multiblock driver
-
357  // calls AmrCore constructor -> AmrMesh constructor
-
358  ERF (const amrex::RealBox& rb, int max_level_in,
-
359  const amrex::Vector<int>& n_cell_in, int coord,
-
360  const amrex::Vector<amrex::IntVect>& ref_ratio,
-
361  const amrex::Array<int,AMREX_SPACEDIM>& is_per,
-
362  std::string prefix);
-
363 
-
364  // Advance a block specified number of time steps
-
365  void Evolve_MB (int MBstep, int max_block_step);
-
366 
-
367  // Advance a block specified number of time steps
-
368  void Evolve_MB (MultiBlockContainer* mbc, int MBstep, int max_block_step);
-
369 
-
370  // get the current time values
-
371  amrex::Real get_t_old() {return t_old[0];}
-
372  amrex::Real get_t_new() {return t_new[0];}
+
355  void init_from_hse (int lev);
+
356 
+
357  void init_immersed_body (int lev, const amrex::BoxArray& ba, const amrex::DistributionMapping& dm);
+
358 
+
359 #ifdef ERF_USE_MULTIBLOCK
+
360  // constructor used when ERF is created by a multiblock driver
+
361  // calls AmrCore constructor -> AmrMesh constructor
+
362  ERF (const amrex::RealBox& rb, int max_level_in,
+
363  const amrex::Vector<int>& n_cell_in, int coord,
+
364  const amrex::Vector<amrex::IntVect>& ref_ratio,
+
365  const amrex::Array<int,AMREX_SPACEDIM>& is_per,
+
366  std::string prefix);
+
367 
+
368  // Advance a block specified number of time steps
+
369  void Evolve_MB (int MBstep, int max_block_step);
+
370 
+
371  // Advance a block specified number of time steps
+
372  void Evolve_MB (MultiBlockContainer* mbc, int MBstep, int max_block_step);
373 
-
374  // Set parmparse prefix for MultiBlock
-
375  void SetParmParsePrefix (std::string name) { pp_prefix = name; }
-
376 
-
377  // Set 'this' from multiblock container
-
378  void SetMultiBlockPointer (MultiBlockContainer *mbc) { m_mbc = mbc; }
-
379 
-
380  // Public data copy for MB
-
381  std::vector<amrex::Box> domain_p;
-
382  MultiBlockContainer *m_mbc = nullptr;
-
383  amrex::Vector<amrex::Vector<amrex::MultiFab> > vars_new;
-
384  amrex::Vector<amrex::Vector<amrex::MultiFab> > vars_old;
-
385 
-
386  // Velocity time averaged field
-
387  amrex::Vector<std::unique_ptr<amrex::MultiFab>> vel_t_avg;
-
388  amrex::Vector<amrex::Real> t_avg_cnt;
+
374  // get the current time values
+
375  amrex::Real get_t_old() {return t_old[0];}
+
376  amrex::Real get_t_new() {return t_new[0];}
+
377 
+
378  // Set parmparse prefix for MultiBlock
+
379  void SetParmParsePrefix (std::string name) { pp_prefix = name; }
+
380 
+
381  // Set 'this' from multiblock container
+
382  void SetMultiBlockPointer (MultiBlockContainer *mbc) { m_mbc = mbc; }
+
383 
+
384  // Public data copy for MB
+
385  std::vector<amrex::Box> domain_p;
+
386  MultiBlockContainer *m_mbc = nullptr;
+
387  amrex::Vector<amrex::Vector<amrex::MultiFab> > vars_new;
+
388  amrex::Vector<amrex::Vector<amrex::MultiFab> > vars_old;
389 
-
390 #endif
-
391  std::string pp_prefix {"erf"};
-
392 
-
393  void fill_from_bndryregs (const amrex::Vector<amrex::MultiFab*>& mfs,
-
394  amrex::Real time);
-
395 
-
396 #ifdef ERF_USE_NETCDF
-
397  void fill_from_realbdy (const amrex::Vector<amrex::MultiFab*>& mfs,
-
398  amrex::Real time,
-
399  bool cons_only,
-
400  int icomp_cons,
-
401  int ncomp_cons,
-
402  amrex::IntVect ngvect_cons,
-
403  amrex::IntVect ngvect_vels);
-
404 #endif
-
405 
-
406 #ifdef ERF_USE_NETCDF
-
407  void init_from_wrfinput (int lev);
-
408  void init_from_metgrid (int lev);
-
409 #endif // ERF_USE_NETCDF
-
410 
-
411 #ifdef ERF_USE_WINDFARM
-
412  void init_windfarm(int lev);
-
413  void advance_windfarm (const amrex::Geometry& a_geom,
-
414  const amrex::Real& dt_advance,
-
415  amrex::MultiFab& cons_in,
-
416  amrex::MultiFab& U_old, amrex::MultiFab& V_old, amrex::MultiFab& W_old,
-
417  amrex::MultiFab& mf_vars_windfarm,
-
418  const amrex::MultiFab& mf_Nturb,
-
419  const amrex::MultiFab& mf_SMark);
-
420 #endif
-
421 
-
422 #ifdef ERF_USE_EB
-
423  void MakeEBGeometry ();
-
424  void make_eb_box ();
-
425  void make_eb_cylinder ();
-
426  void make_eb_regular ();
-
427 #endif
-
428 
-
429  // more flexible version of AverageDown() that lets you average down across multiple levels
-
430  void AverageDownTo (int crse_lev, int scomp, int ncomp); // NOLINT
-
431 
-
432 private:
-
433 
-
434  ///////////////////////////
-
435  // private member functions
-
436  ///////////////////////////
+
390  // Velocity time averaged field
+
391  amrex::Vector<std::unique_ptr<amrex::MultiFab>> vel_t_avg;
+
392  amrex::Vector<amrex::Real> t_avg_cnt;
+
393 
+
394 #endif
+
395  std::string pp_prefix {"erf"};
+
396 
+
397  void fill_from_bndryregs (const amrex::Vector<amrex::MultiFab*>& mfs,
+
398  amrex::Real time);
+
399 
+
400 #ifdef ERF_USE_NETCDF
+
401  void fill_from_realbdy (const amrex::Vector<amrex::MultiFab*>& mfs,
+
402  amrex::Real time,
+
403  bool cons_only,
+
404  int icomp_cons,
+
405  int ncomp_cons,
+
406  amrex::IntVect ngvect_cons,
+
407  amrex::IntVect ngvect_vels);
+
408 #endif
+
409 
+
410 #ifdef ERF_USE_NETCDF
+
411  void init_from_wrfinput (int lev);
+
412  void init_from_metgrid (int lev);
+
413 #endif // ERF_USE_NETCDF
+
414 
+
415 #ifdef ERF_USE_WINDFARM
+
416  void init_windfarm(int lev);
+
417  void advance_windfarm (const amrex::Geometry& a_geom,
+
418  const amrex::Real& dt_advance,
+
419  amrex::MultiFab& cons_in,
+
420  amrex::MultiFab& U_old, amrex::MultiFab& V_old, amrex::MultiFab& W_old,
+
421  amrex::MultiFab& mf_vars_windfarm,
+
422  const amrex::MultiFab& mf_Nturb,
+
423  const amrex::MultiFab& mf_SMark);
+
424 #endif
+
425 
+
426 #ifdef ERF_USE_EB
+
427  void MakeEBGeometry ();
+
428  void make_eb_box ();
+
429  void make_eb_cylinder ();
+
430  void make_eb_regular ();
+
431 #endif
+
432 
+
433  // more flexible version of AverageDown() that lets you average down across multiple levels
+
434  void AverageDownTo (int crse_lev, int scomp, int ncomp); // NOLINT
+
435 
+
436 private:
437 
-
438  // read in some parameters from inputs file
-
439  void ReadParameters ();
-
440  void ParameterSanityChecks ();
-
441 
-
442  // set covered coarse cells/faces to be the average of overlying fine cells/faces
-
443  void AverageDown ();
-
444 
-
445  void update_diffusive_arrays (int lev, const amrex::BoxArray& ba, const amrex::DistributionMapping& dm);
-
446 
-
447  void init_zphys (int lev, amrex::Real time);
-
448  void remake_zphys (int lev, std::unique_ptr<amrex::MultiFab>& temp_zphys_nd);
-
449  void update_terrain_arrays (int lev);
+
438  ///////////////////////////
+
439  // private member functions
+
440  ///////////////////////////
+
441 
+
442  // read in some parameters from inputs file
+
443  void ReadParameters ();
+
444  void ParameterSanityChecks ();
+
445 
+
446  // set covered coarse cells/faces to be the average of overlying fine cells/faces
+
447  void AverageDown ();
+
448 
+
449  void update_diffusive_arrays (int lev, const amrex::BoxArray& ba, const amrex::DistributionMapping& dm);
450 
-
451  void Construct_ERFFillPatchers (int lev);
-
452 
-
453  void Define_ERFFillPatchers (int lev);
+
451  void init_zphys (int lev, amrex::Real time);
+
452  void remake_zphys (int lev, std::unique_ptr<amrex::MultiFab>& temp_zphys_nd);
+
453  void update_terrain_arrays (int lev);
454 
-
455  void init1DArrays ();
+
455  void Construct_ERFFillPatchers (int lev);
456 
-
457  void init_bcs ();
+
457  void Define_ERFFillPatchers (int lev);
458 
-
459  void init_custom (int lev);
+
459  void init1DArrays ();
460 
-
461  void init_uniform (int lev);
+
461  void init_bcs ();
462 
-
463  void init_stuff (int lev, const amrex::BoxArray& ba, const amrex::DistributionMapping& dm,
-
464  amrex::Vector<amrex::MultiFab>& lev_new, amrex::Vector<amrex::MultiFab>& lev_old,
-
465  amrex::MultiFab& tmp_base_state,
-
466  std::unique_ptr<amrex::MultiFab>& tmp_zphys_nd);
-
467 
-
468  // Initialize the Turbulent perturbation
-
469  void turbPert_update (const int lev, const amrex::Real dt);
-
470  void turbPert_amplitude (const int lev);
+
463  void init_custom (int lev);
+
464 
+
465  void init_uniform (int lev);
+
466 
+
467  void init_stuff (int lev, const amrex::BoxArray& ba, const amrex::DistributionMapping& dm,
+
468  amrex::Vector<amrex::MultiFab>& lev_new, amrex::Vector<amrex::MultiFab>& lev_old,
+
469  amrex::MultiFab& tmp_base_state,
+
470  std::unique_ptr<amrex::MultiFab>& tmp_zphys_nd);
471 
-
472  // Initialize the integrator object
-
473  void initialize_integrator (int lev, amrex::MultiFab& cons_mf, amrex::MultiFab& vel_mf);
-
474 
-
475  // Create the physbcs objects
-
476  void make_physbcs (int lev);
-
477 
-
478  // Initialize the microphysics object
-
479  void initializeMicrophysics (const int&);
-
480 
-
481 #ifdef ERF_USE_WINDFARM
-
482  // Initialize the windfarm object
-
483  void initializeWindFarm (const int&);
-
484 #endif
-
485 
-
486  // Compute a vector of new MultiFabs by copying from valid region and filling ghost cells
-
487  //
-
488  // NOTE: FillPatch takes in an empty MF, and returns cell-centered + velocities (not momenta)
-
489  //
-
490  void FillPatch (int lev, amrex::Real time,
-
491  const amrex::Vector<amrex::MultiFab*>& mfs_vel,
-
492  const amrex::Vector<amrex::MultiFab*>& mfs_mom,
-
493  bool fillset=true, bool cons_only=false);
-
494 
-
495  // Compute a new MultiFab by copying from valid region and filling ghost cells -
-
496  void FillPatchMoistVars (int lev, amrex::MultiFab& mf);
-
497 
-
498  // Compute new multifabs by copying data from valid region and filling ghost cells.
-
499  // Unlike FillPatch, FillIntermediatePatch will use the supplied multifabs instead of fine level data.
-
500  // This is to support filling boundary cells at an intermediate time between old/new times
-
501  // on the fine level when valid data at a specific time is already available (such as
-
502  // at each RK stage when integrating between initial and final times at a given level).
-
503  //
-
504  // NOTE: FillIntermediatePatch takes in updated momenta, and returns both updated velocity and momenta
-
505  //
-
506  void FillIntermediatePatch (int lev, amrex::Real time,
-
507  const amrex::Vector<amrex::MultiFab*>& mfs_vel,
-
508  const amrex::Vector<amrex::MultiFab*>& mfs_mom,
-
509  int ng_cons, int ng_vel, bool cons_only, int icomp_cons, int ncomp_cons,
-
510  bool allow_most_bcs = true);
-
511 
-
512  // Fill all multifabs (and all components) in a vector of multifabs corresponding to the
-
513  // grid variables defined in vars_old and vars_new just as FillCoarsePatch.
-
514  void FillCoarsePatch (int lev, amrex::Real time);
+
472  // Initialize the Turbulent perturbation
+
473  void turbPert_update (const int lev, const amrex::Real dt);
+
474  void turbPert_amplitude (const int lev);
+
475 
+
476  // Initialize the integrator object
+
477  void initialize_integrator (int lev, amrex::MultiFab& cons_mf, amrex::MultiFab& vel_mf);
+
478 
+
479  // Create the physbcs objects
+
480  void make_physbcs (int lev);
+
481 
+
482  // Initialize the microphysics object
+
483  void initializeMicrophysics (const int&);
+
484 
+
485 #ifdef ERF_USE_WINDFARM
+
486  // Initialize the windfarm object
+
487  void initializeWindFarm (const int&);
+
488 #endif
+
489 
+
490  // Compute a vector of new MultiFabs by copying from valid region and filling ghost cells
+
491  //
+
492  // NOTE: FillPatch takes in an empty MF, and returns cell-centered + velocities (not momenta)
+
493  //
+
494  void FillPatch (int lev, amrex::Real time,
+
495  const amrex::Vector<amrex::MultiFab*>& mfs_vel,
+
496  const amrex::Vector<amrex::MultiFab*>& mfs_mom,
+
497  bool fillset=true, bool cons_only=false);
+
498 
+
499  // Compute a new MultiFab by copying from valid region and filling ghost cells -
+
500  void FillPatchMoistVars (int lev, amrex::MultiFab& mf);
+
501 
+
502  // Compute new multifabs by copying data from valid region and filling ghost cells.
+
503  // Unlike FillPatch, FillIntermediatePatch will use the supplied multifabs instead of fine level data.
+
504  // This is to support filling boundary cells at an intermediate time between old/new times
+
505  // on the fine level when valid data at a specific time is already available (such as
+
506  // at each RK stage when integrating between initial and final times at a given level).
+
507  //
+
508  // NOTE: FillIntermediatePatch takes in updated momenta, and returns both updated velocity and momenta
+
509  //
+
510  void FillIntermediatePatch (int lev, amrex::Real time,
+
511  const amrex::Vector<amrex::MultiFab*>& mfs_vel,
+
512  const amrex::Vector<amrex::MultiFab*>& mfs_mom,
+
513  int ng_cons, int ng_vel, bool cons_only, int icomp_cons, int ncomp_cons,
+
514  bool allow_most_bcs = true);
515 
-
516  // advance a level by dt
-
517  // includes a recursive call for finer levels
-
518  void timeStep (int lev, amrex::Real time, int iteration);
+
516  // Fill all multifabs (and all components) in a vector of multifabs corresponding to the
+
517  // grid variables defined in vars_old and vars_new just as FillCoarsePatch.
+
518  void FillCoarsePatch (int lev, amrex::Real time);
519 
-
520  // advance a single level for a single time step
-
521  void Advance (int lev, amrex::Real time, amrex::Real dt_lev, int iteration, int ncycle);
-
522 
-
523  //! Initialize HSE
-
524  void initHSE ();
-
525  void initHSE (int lev);
+
520  // advance a level by dt
+
521  // includes a recursive call for finer levels
+
522  void timeStep (int lev, amrex::Real time, int iteration);
+
523 
+
524  // advance a single level for a single time step
+
525  void Advance (int lev, amrex::Real time, amrex::Real dt_lev, int iteration, int ncycle);
526 
-
527  //! Initialize Rayleigh damping profiles
-
528  void initRayleigh ();
-
529 
-
530  //! Initialize sponge profiles
-
531  void initSponge ();
-
532 
-
533  //! Set Rayleigh mean profiles from input sounding
-
534  void setRayleighRefFromSounding (bool restarting);
-
535 
-
536  //! Set sponge mean profiles from input sounding
-
537  void setSpongeRefFromSounding (bool restarting);
-
538 
-
539  // a wrapper for estTimeStep()
-
540  void ComputeDt (int step = -1);
-
541 
-
542  // get plotfile name
-
543  [[nodiscard]] std::string PlotFileName (int lev) const;
-
544 
-
545  // set plotfile variables names
-
546  static amrex::Vector<std::string> PlotFileVarNames (amrex::Vector<std::string> plot_var_names) ;
-
547 
-
548  // set which variables and derived quantities go into plotfiles
-
549  void setPlotVariables (const std::string& pp_plot_var_names, amrex::Vector<std::string>& plot_var_names);
-
550  // append variables to plot
-
551  void appendPlotVariables (const std::string& pp_plot_var_names, amrex::Vector<std::string>& plot_var_names);
-
552 
-
553 #ifdef ERF_USE_NETCDF
-
554  //! Write plotfile using NETCDF
-
555  void writeNCPlotFile (int lev, int which, const std::string& dir,
-
556  const amrex::Vector<const amrex::MultiFab*> &mf,
-
557  const amrex::Vector<std::string> &plot_var_names,
-
558  const amrex::Vector<int>& level_steps, amrex::Real time) const;
-
559 
-
560  //! Write checkpointFile using NetCdf
-
561  void WriteNCCheckpointFile () const;
-
562 
-
563  //! Read checkpointFile for restart
-
564  void ReadNCCheckpointFile ();
-
565 
-
566  //! Write MultiFab in NetCDF format
-
567  static void WriteNCMultiFab (const amrex::FabArray<amrex::FArrayBox> &fab,
-
568  const std::string& name,
-
569  bool set_ghost = false) ;
-
570 
-
571  //! Read MultiFab in NetCDF format
-
572  void ReadNCMultiFab (amrex::FabArray<amrex::FArrayBox> &mf,
-
573  const std::string &name,
-
574  int coordinatorProc = amrex::ParallelDescriptor::IOProcessorNumber(),
-
575  int allow_empty_mf = 0);
-
576 
-
577  //! Create 1D vertical column output for coupling
-
578  void createNCColumnFile (int lev,
-
579  const std::string& colfile_name, amrex::Real xloc, amrex::Real yloc);
-
580 
-
581  // Copy from the NC*fabs into the MultiFabs holding the boundary data
-
582  void init_from_wrfbdy (amrex::Vector<amrex::FArrayBox*> x_vel_lateral,
-
583  amrex::Vector<amrex::FArrayBox*> y_vel_lateral,
-
584  amrex::Vector<amrex::FArrayBox*> z_vel_lateral,
-
585  amrex::Vector<amrex::FArrayBox*> T_lateral);
-
586 
-
587  amrex::Real start_bdy_time;
-
588 
-
589  // *** *** FArrayBox's for holding the SURFACE data
-
590  // amrex::IArrayBox NC_IVGTYP_fab; // Vegetation type (IVGTYP); Discrete numbers;
-
591  // amrex::FArrayBox NC_z0_fab; // Surface Roughness, z0 = z0 (IVGTYP)
-
592  // amrex::FArrayBox NC_PSFC_fab; // Surface pressure
-
593 
-
594  // TODO: Clarify the relation between SST and TSK
-
595  // amrex::FArrayBox NC_SST_fab; // Sea Surface Temperature; Defined even for land area
-
596  // amrex::FArrayBox NC_TSK_fab; // Surface Skin Temperature; Appears to be same as SST...
+
527  //! Initialize HSE
+
528  void initHSE ();
+
529  void initHSE (int lev);
+
530 
+
531  //! Initialize Rayleigh damping profiles
+
532  void initRayleigh ();
+
533 
+
534  //! Initialize sponge profiles
+
535  void initSponge ();
+
536 
+
537  //! Set Rayleigh mean profiles from input sounding
+
538  void setRayleighRefFromSounding (bool restarting);
+
539 
+
540  //! Set sponge mean profiles from input sounding
+
541  void setSpongeRefFromSounding (bool restarting);
+
542 
+
543  // a wrapper for estTimeStep()
+
544  void ComputeDt (int step = -1);
+
545 
+
546  // get plotfile name
+
547  [[nodiscard]] std::string PlotFileName (int lev) const;
+
548 
+
549  // set plotfile variables names
+
550  static amrex::Vector<std::string> PlotFileVarNames (amrex::Vector<std::string> plot_var_names) ;
+
551 
+
552  // set which variables and derived quantities go into plotfiles
+
553  void setPlotVariables (const std::string& pp_plot_var_names, amrex::Vector<std::string>& plot_var_names);
+
554  // append variables to plot
+
555  void appendPlotVariables (const std::string& pp_plot_var_names, amrex::Vector<std::string>& plot_var_names);
+
556 
+
557 #ifdef ERF_USE_NETCDF
+
558  //! Write plotfile using NETCDF
+
559  void writeNCPlotFile (int lev, int which, const std::string& dir,
+
560  const amrex::Vector<const amrex::MultiFab*> &mf,
+
561  const amrex::Vector<std::string> &plot_var_names,
+
562  const amrex::Vector<int>& level_steps, amrex::Real time) const;
+
563 
+
564  //! Write checkpointFile using NetCdf
+
565  void WriteNCCheckpointFile () const;
+
566 
+
567  //! Read checkpointFile for restart
+
568  void ReadNCCheckpointFile ();
+
569 
+
570  //! Write MultiFab in NetCDF format
+
571  static void WriteNCMultiFab (const amrex::FabArray<amrex::FArrayBox> &fab,
+
572  const std::string& name,
+
573  bool set_ghost = false) ;
+
574 
+
575  //! Read MultiFab in NetCDF format
+
576  void ReadNCMultiFab (amrex::FabArray<amrex::FArrayBox> &mf,
+
577  const std::string &name,
+
578  int coordinatorProc = amrex::ParallelDescriptor::IOProcessorNumber(),
+
579  int allow_empty_mf = 0);
+
580 
+
581  //! Create 1D vertical column output for coupling
+
582  void createNCColumnFile (int lev,
+
583  const std::string& colfile_name, amrex::Real xloc, amrex::Real yloc);
+
584 
+
585  // Copy from the NC*fabs into the MultiFabs holding the boundary data
+
586  void init_from_wrfbdy (amrex::Vector<amrex::FArrayBox*> x_vel_lateral,
+
587  amrex::Vector<amrex::FArrayBox*> y_vel_lateral,
+
588  amrex::Vector<amrex::FArrayBox*> z_vel_lateral,
+
589  amrex::Vector<amrex::FArrayBox*> T_lateral);
+
590 
+
591  amrex::Real start_bdy_time;
+
592 
+
593  // *** *** FArrayBox's for holding the SURFACE data
+
594  // amrex::IArrayBox NC_IVGTYP_fab; // Vegetation type (IVGTYP); Discrete numbers;
+
595  // amrex::FArrayBox NC_z0_fab; // Surface Roughness, z0 = z0 (IVGTYP)
+
596  // amrex::FArrayBox NC_PSFC_fab; // Surface pressure
597 
-
598  // Vectors (over time) of Vector (over variables) of FArrayBoxs for holding the data read from the wrfbdy NetCDF file
-
599  amrex::Vector<amrex::Vector<amrex::FArrayBox>> bdy_data_xlo;
-
600  amrex::Vector<amrex::Vector<amrex::FArrayBox>> bdy_data_xhi;
-
601  amrex::Vector<amrex::Vector<amrex::FArrayBox>> bdy_data_ylo;
-
602  amrex::Vector<amrex::Vector<amrex::FArrayBox>> bdy_data_yhi;
-
603 
-
604  amrex::Real bdy_time_interval;
-
605  amrex::Vector<std::unique_ptr<amrex::MultiFab>> lat_m, lon_m;
-
606  amrex::Real Latitude;
-
607  amrex::Real Longitude;
-
608 #endif // ERF_USE_NETCDF
-
609 
-
610  // Struct for working with the sounding data we take as an input
-
611  InputSoundingData input_sounding_data;
-
612 
-
613  // Struct for working with the sponge data we take as an input
-
614  InputSpongeData input_sponge_data;
-
615 
-
616  // Vector (6 planes) of DeviceVectors (ncell in plane) for Dirichlet BC data
-
617  amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real>> xvel_bc_data;
-
618  amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real>> yvel_bc_data;
-
619  amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real>> zvel_bc_data;
-
620 
-
621  // Function to read and populate above vectors (if input file exists)
-
622  void init_Dirichlet_bc_data (const std::string input_file);
-
623 
-
624  // write checkpoint file to disk
-
625  void WriteCheckpointFile () const;
-
626 
-
627  // read checkpoint file from disk
-
628  void ReadCheckpointFile ();
-
629 
-
630  // read checkpoint file from disk -- called after instantiating m_most
-
631  void ReadCheckpointFileMOST ();
-
632 
-
633  // Read the file passed to amr.restart and use it as an initial condition for
-
634  // the current simulation. Supports a different number of components and
-
635  // ghost cells.
-
636  void InitializeFromFile ();
-
637 
-
638  // Initialize the new-time data at a level from the initial_data MultiFab
-
639  void InitializeLevelFromData (int lev, const amrex::MultiFab& initial_data);
-
640 
-
641  // utility to skip to next line in Header
-
642  static void GotoNextLine (std::istream& is);
-
643 
-
644  // Single level functions called by advance()
-
645  void post_update (amrex::MultiFab& state_mf, amrex::Real time, const amrex::Geometry& geom);
-
646  void fill_rhs (amrex::MultiFab& rhs_mf, const amrex::MultiFab& state_mf, amrex::Real time, const amrex::Geometry& geom);
-
647 
-
648  ////////////////
-
649  // private data members
-
650 
-
651  std::unique_ptr<ProblemBase> prob = nullptr; // problem-specific functions
-
652 
-
653  amrex::Vector<int> num_boxes_at_level; // how many boxes specified at each level by tagging criteria
-
654  amrex::Vector<int> num_files_at_level; // how many wrfinput files specified at each level
-
655  amrex::Vector<amrex::Vector<amrex::Box>> boxes_at_level; // the boxes specified at each level by tagging criteria
+
598  // TODO: Clarify the relation between SST and TSK
+
599  // amrex::FArrayBox NC_SST_fab; // Sea Surface Temperature; Defined even for land area
+
600  // amrex::FArrayBox NC_TSK_fab; // Surface Skin Temperature; Appears to be same as SST...
+
601 
+
602  // Vectors (over time) of Vector (over variables) of FArrayBoxs for holding the data read from the wrfbdy NetCDF file
+
603  amrex::Vector<amrex::Vector<amrex::FArrayBox>> bdy_data_xlo;
+
604  amrex::Vector<amrex::Vector<amrex::FArrayBox>> bdy_data_xhi;
+
605  amrex::Vector<amrex::Vector<amrex::FArrayBox>> bdy_data_ylo;
+
606  amrex::Vector<amrex::Vector<amrex::FArrayBox>> bdy_data_yhi;
+
607 
+
608  amrex::Real bdy_time_interval;
+
609  amrex::Vector<std::unique_ptr<amrex::MultiFab>> lat_m, lon_m;
+
610  amrex::Real Latitude;
+
611  amrex::Real Longitude;
+
612 #endif // ERF_USE_NETCDF
+
613 
+
614  // Struct for working with the sounding data we take as an input
+
615  InputSoundingData input_sounding_data;
+
616 
+
617  // Struct for working with the sponge data we take as an input
+
618  InputSpongeData input_sponge_data;
+
619 
+
620  // Vector (6 planes) of DeviceVectors (ncell in plane) for Dirichlet BC data
+
621  amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real>> xvel_bc_data;
+
622  amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real>> yvel_bc_data;
+
623  amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real>> zvel_bc_data;
+
624 
+
625  // Function to read and populate above vectors (if input file exists)
+
626  void init_Dirichlet_bc_data (const std::string input_file);
+
627 
+
628  // write checkpoint file to disk
+
629  void WriteCheckpointFile () const;
+
630 
+
631  // read checkpoint file from disk
+
632  void ReadCheckpointFile ();
+
633 
+
634  // read checkpoint file from disk -- called after instantiating m_most
+
635  void ReadCheckpointFileMOST ();
+
636 
+
637  // Read the file passed to amr.restart and use it as an initial condition for
+
638  // the current simulation. Supports a different number of components and
+
639  // ghost cells.
+
640  void InitializeFromFile ();
+
641 
+
642  // Initialize the new-time data at a level from the initial_data MultiFab
+
643  void InitializeLevelFromData (int lev, const amrex::MultiFab& initial_data);
+
644 
+
645  // utility to skip to next line in Header
+
646  static void GotoNextLine (std::istream& is);
+
647 
+
648  // Single level functions called by advance()
+
649  void post_update (amrex::MultiFab& state_mf, amrex::Real time, const amrex::Geometry& geom);
+
650  void fill_rhs (amrex::MultiFab& rhs_mf, const amrex::MultiFab& state_mf, amrex::Real time, const amrex::Geometry& geom);
+
651 
+
652  ////////////////
+
653  // private data members
+
654 
+
655  std::unique_ptr<ProblemBase> prob = nullptr; // problem-specific functions
656 
-
657  amrex::Vector<int> istep; // which step?
-
658  amrex::Vector<int> nsubsteps; // how many substeps on each level?
-
659 
-
660  // keep track of old time, new time, and time step at each level
-
661  amrex::Vector<amrex::Real> t_new;
-
662  amrex::Vector<amrex::Real> t_old;
-
663  amrex::Vector<amrex::Real> dt;
-
664  amrex::Vector<long> dt_mri_ratio;
-
665 
-
666  // array of multifabs to store the solution at each level of refinement
-
667  // after advancing a level we use "swap".
-
668 #ifndef ERF_USE_MULTIBLOCK
-
669  amrex::Vector<amrex::Vector<amrex::MultiFab> > vars_new;
-
670  amrex::Vector<amrex::Vector<amrex::MultiFab> > vars_old;
-
671 
-
672  // Velocity time averaged field
-
673  amrex::Vector<std::unique_ptr<amrex::MultiFab>> vel_t_avg;
-
674  amrex::Vector<amrex::Real> t_avg_cnt;
-
675 #endif
-
676  amrex::Vector<std::unique_ptr<MRISplitIntegrator<amrex::Vector<amrex::MultiFab> > > > mri_integrator_mem;
-
677 
-
678  amrex::Vector<amrex::MultiFab> pp_inc;
-
679 
-
680  // Vector over levels of routines to impose physical boundary conditions
-
681  amrex::Vector<std::unique_ptr<ERFPhysBCFunct_cons>> physbcs_cons;
-
682  amrex::Vector<std::unique_ptr<ERFPhysBCFunct_u>> physbcs_u;
-
683  amrex::Vector<std::unique_ptr<ERFPhysBCFunct_v>> physbcs_v;
-
684  amrex::Vector<std::unique_ptr<ERFPhysBCFunct_w>> physbcs_w;
-
685  amrex::Vector<std::unique_ptr<ERFPhysBCFunct_base>> physbcs_base;
-
686 
-
687  // Store primitive variable for MOST BC
-
688  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Theta_prim;
-
689  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Qv_prim;
-
690  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Qr_prim;
-
691 
-
692  // Scratch space for time integrator
-
693  amrex::Vector<amrex::MultiFab> rU_old;
-
694  amrex::Vector<amrex::MultiFab> rU_new;
-
695  amrex::Vector<amrex::MultiFab> rV_old;
-
696  amrex::Vector<amrex::MultiFab> rV_new;
-
697  amrex::Vector<amrex::MultiFab> rW_old;
-
698  amrex::Vector<amrex::MultiFab> rW_new;
-
699 
-
700  std::unique_ptr<Microphysics> micro;
-
701  amrex::Vector<amrex::Vector<amrex::MultiFab*>> qmoist; // (lev,ncomp) This has up to 8 components: qt, qv, qc, qi, qp, qr, qs, qg
-
702 
-
703  // Variables for wind farm parametrization models
-
704 
-
705 #ifdef ERF_USE_WINDFARM
-
706  std::unique_ptr<WindFarm> windfarm;
-
707  amrex::Vector<amrex::MultiFab> Nturb;
-
708  amrex::Vector<amrex::MultiFab> vars_windfarm; // Fitch: Vabs, Vabsdt, dudt, dvdt, dTKEdt
-
709  // EWP: dudt, dvdt, dTKEdt
-
710 
-
711  amrex::Vector<amrex::MultiFab> SMark; // A multifab that holds an integer corresponding
-
712  // to the number of the wind turbine to sample
-
713  // velocity upstream of the turbine
-
714 #endif
-
715 
-
716  LandSurface lsm;
-
717  amrex::Vector<amrex::Vector<amrex::MultiFab*>> lsm_data; // (lev,ncomp) Components: theta, q1, q2
-
718  amrex::Vector<amrex::Vector<amrex::MultiFab*>> lsm_flux; // (lev,ncomp) Components: theta, q1, q2
+
657  amrex::Vector<int> num_boxes_at_level; // how many boxes specified at each level by tagging criteria
+
658  amrex::Vector<int> num_files_at_level; // how many wrfinput files specified at each level
+
659  amrex::Vector<amrex::Vector<amrex::Box>> boxes_at_level; // the boxes specified at each level by tagging criteria
+
660 
+
661  amrex::Vector<int> istep; // which step?
+
662  amrex::Vector<int> nsubsteps; // how many substeps on each level?
+
663 
+
664  // keep track of old time, new time, and time step at each level
+
665  amrex::Vector<amrex::Real> t_new;
+
666  amrex::Vector<amrex::Real> t_old;
+
667  amrex::Vector<amrex::Real> dt;
+
668  amrex::Vector<long> dt_mri_ratio;
+
669 
+
670  // array of multifabs to store the solution at each level of refinement
+
671  // after advancing a level we use "swap".
+
672 #ifndef ERF_USE_MULTIBLOCK
+
673  amrex::Vector<amrex::Vector<amrex::MultiFab> > vars_new;
+
674  amrex::Vector<amrex::Vector<amrex::MultiFab> > vars_old;
+
675 
+
676  // Velocity time averaged field
+
677  amrex::Vector<std::unique_ptr<amrex::MultiFab>> vel_t_avg;
+
678  amrex::Vector<amrex::Real> t_avg_cnt;
+
679 #endif
+
680  amrex::Vector<std::unique_ptr<MRISplitIntegrator<amrex::Vector<amrex::MultiFab> > > > mri_integrator_mem;
+
681 
+
682  amrex::Vector<amrex::MultiFab> pp_inc;
+
683 
+
684  // Vector over levels of routines to impose physical boundary conditions
+
685  amrex::Vector<std::unique_ptr<ERFPhysBCFunct_cons>> physbcs_cons;
+
686  amrex::Vector<std::unique_ptr<ERFPhysBCFunct_u>> physbcs_u;
+
687  amrex::Vector<std::unique_ptr<ERFPhysBCFunct_v>> physbcs_v;
+
688  amrex::Vector<std::unique_ptr<ERFPhysBCFunct_w>> physbcs_w;
+
689  amrex::Vector<std::unique_ptr<ERFPhysBCFunct_base>> physbcs_base;
+
690 
+
691  // Store primitive variable for MOST BC
+
692  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Theta_prim;
+
693  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Qv_prim;
+
694  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Qr_prim;
+
695 
+
696  // Scratch space for time integrator
+
697  amrex::Vector<amrex::MultiFab> rU_old;
+
698  amrex::Vector<amrex::MultiFab> rU_new;
+
699  amrex::Vector<amrex::MultiFab> rV_old;
+
700  amrex::Vector<amrex::MultiFab> rV_new;
+
701  amrex::Vector<amrex::MultiFab> rW_old;
+
702  amrex::Vector<amrex::MultiFab> rW_new;
+
703 
+
704  std::unique_ptr<Microphysics> micro;
+
705  amrex::Vector<amrex::Vector<amrex::MultiFab*>> qmoist; // (lev,ncomp) This has up to 8 components: qt, qv, qc, qi, qp, qr, qs, qg
+
706 
+
707  // Variables for wind farm parametrization models
+
708 
+
709 #ifdef ERF_USE_WINDFARM
+
710  std::unique_ptr<WindFarm> windfarm;
+
711  amrex::Vector<amrex::MultiFab> Nturb;
+
712  amrex::Vector<amrex::MultiFab> vars_windfarm; // Fitch: Vabs, Vabsdt, dudt, dvdt, dTKEdt
+
713  // EWP: dudt, dvdt, dTKEdt
+
714 
+
715  amrex::Vector<amrex::MultiFab> SMark; // A multifab that holds an integer corresponding
+
716  // to the number of the wind turbine to sample
+
717  // velocity upstream of the turbine
+
718 #endif
719 
-
720 #if defined(ERF_USE_RRTMGP)
-
721  Radiation rad;
-
722  amrex::Vector<std::unique_ptr<amrex::MultiFab>> qheating_rates; // radiation heating rate source terms
+
720  LandSurface lsm;
+
721  amrex::Vector<amrex::Vector<amrex::MultiFab*>> lsm_data; // (lev,ncomp) Components: theta, q1, q2
+
722  amrex::Vector<amrex::Vector<amrex::MultiFab*>> lsm_flux; // (lev,ncomp) Components: theta, q1, q2
723 
-
724  // Containers for additional SLM inputs
-
725  amrex::Vector<std::unique_ptr<amrex::MultiFab>> sw_lw_fluxes; // Direct SW (visible, NIR), Diffuse SW (visible, NIR), LW flux
-
726  amrex::Vector<std::unique_ptr<amrex::MultiFab>> solar_zenith; // Solar zenith angle
+
724 #if defined(ERF_USE_RRTMGP)
+
725  Radiation rad;
+
726  amrex::Vector<std::unique_ptr<amrex::MultiFab>> qheating_rates; // radiation heating rate source terms
727 
-
728  bool plot_rad = false;
-
729 #endif
-
730 
-
731  // Fillpatcher classes for coarse-fine boundaries
-
732  int cf_width{0};
-
733  int cf_set_width{0};
-
734  amrex::Vector<ERFFillPatcher> FPr_c;
-
735  amrex::Vector<ERFFillPatcher> FPr_u;
-
736  amrex::Vector<ERFFillPatcher> FPr_v;
-
737  amrex::Vector<ERFFillPatcher> FPr_w;
-
738 
-
739  // Diffusive stresses and Smag
-
740  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Tau11_lev, Tau22_lev, Tau33_lev;
-
741  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Tau12_lev, Tau21_lev;
-
742  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Tau13_lev, Tau31_lev;
-
743  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Tau23_lev, Tau32_lev;
-
744  amrex::Vector<std::unique_ptr<amrex::MultiFab>> eddyDiffs_lev;
-
745  amrex::Vector<std::unique_ptr<amrex::MultiFab>> SmnSmn_lev;
-
746 
-
747  // Sea Surface Temps and Land Masks (lev, ntimes)
-
748  amrex::Vector<amrex::Vector<std::unique_ptr<amrex::MultiFab>>> sst_lev;
-
749  amrex::Vector<amrex::Vector<std::unique_ptr<amrex::iMultiFab>>> lmask_lev;
+
728  // Containers for additional SLM inputs
+
729  amrex::Vector<std::unique_ptr<amrex::MultiFab>> sw_lw_fluxes; // Direct SW (visible, NIR), Diffuse SW (visible, NIR), LW flux
+
730  amrex::Vector<std::unique_ptr<amrex::MultiFab>> solar_zenith; // Solar zenith angle
+
731 
+
732  bool plot_rad = false;
+
733 #endif
+
734 
+
735  // Fillpatcher classes for coarse-fine boundaries
+
736  int cf_width{0};
+
737  int cf_set_width{0};
+
738  amrex::Vector<ERFFillPatcher> FPr_c;
+
739  amrex::Vector<ERFFillPatcher> FPr_u;
+
740  amrex::Vector<ERFFillPatcher> FPr_v;
+
741  amrex::Vector<ERFFillPatcher> FPr_w;
+
742 
+
743  // Diffusive stresses and Smag
+
744  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Tau11_lev, Tau22_lev, Tau33_lev;
+
745  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Tau12_lev, Tau21_lev;
+
746  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Tau13_lev, Tau31_lev;
+
747  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Tau23_lev, Tau32_lev;
+
748  amrex::Vector<std::unique_ptr<amrex::MultiFab>> eddyDiffs_lev;
+
749  amrex::Vector<std::unique_ptr<amrex::MultiFab>> SmnSmn_lev;
750 
-
751  // Other SFS terms
-
752  amrex::Vector<std::unique_ptr<amrex::MultiFab>> SFS_hfx1_lev, SFS_hfx2_lev, SFS_hfx3_lev;
-
753  amrex::Vector<std::unique_ptr<amrex::MultiFab>> SFS_diss_lev;
-
754  amrex::Vector<std::unique_ptr<amrex::MultiFab>> SFS_q1fx1_lev, SFS_q1fx2_lev, SFS_q1fx3_lev;
-
755  amrex::Vector<std::unique_ptr<amrex::MultiFab>> SFS_q2fx3_lev;
-
756 
-
757  // Terrain / grid stretching
-
758  amrex::Vector<amrex::Vector<amrex::Real>> zlevels_stag; // nominal height levels
-
759  amrex::Vector<std::unique_ptr<amrex::MultiFab>> z_phys_nd;
-
760  amrex::Vector<std::unique_ptr<amrex::MultiFab>> z_phys_cc;
-
761 
-
762  amrex::Vector<std::unique_ptr<amrex::MultiFab>> detJ_cc;
-
763  amrex::Vector<std::unique_ptr<amrex::MultiFab>> ax;
-
764  amrex::Vector<std::unique_ptr<amrex::MultiFab>> ay;
-
765  amrex::Vector<std::unique_ptr<amrex::MultiFab>> az;
-
766 
-
767  amrex::Vector<std::unique_ptr<amrex::MultiFab>> z_phys_nd_src;
-
768  amrex::Vector<std::unique_ptr<amrex::MultiFab>> detJ_cc_src;
-
769  amrex::Vector<std::unique_ptr<amrex::MultiFab>> ax_src;
-
770  amrex::Vector<std::unique_ptr<amrex::MultiFab>> ay_src;
-
771  amrex::Vector<std::unique_ptr<amrex::MultiFab>> az_src;
-
772 
-
773  amrex::Vector<std::unique_ptr<amrex::MultiFab>> z_phys_nd_new;
-
774  amrex::Vector<std::unique_ptr<amrex::MultiFab>> detJ_cc_new;
-
775  amrex::Vector<std::unique_ptr<amrex::MultiFab>> ax_new;
-
776  amrex::Vector<std::unique_ptr<amrex::MultiFab>> ay_new;
-
777  amrex::Vector<std::unique_ptr<amrex::MultiFab>> az_new;
-
778 
-
779  amrex::Vector<std::unique_ptr<amrex::MultiFab>> z_t_rk;
-
780 
-
781  amrex::Vector<std::unique_ptr<amrex::MultiFab>> mapfac_m;
-
782  amrex::Vector<std::unique_ptr<amrex::MultiFab>> mapfac_u;
-
783  amrex::Vector<std::unique_ptr<amrex::MultiFab>> mapfac_v;
+
751  // Sea Surface Temps and Land Masks (lev, ntimes)
+
752  amrex::Vector<amrex::Vector<std::unique_ptr<amrex::MultiFab>>> sst_lev;
+
753  amrex::Vector<amrex::Vector<std::unique_ptr<amrex::iMultiFab>>> lmask_lev;
+
754 
+
755  // Other SFS terms
+
756  amrex::Vector<std::unique_ptr<amrex::MultiFab>> SFS_hfx1_lev, SFS_hfx2_lev, SFS_hfx3_lev;
+
757  amrex::Vector<std::unique_ptr<amrex::MultiFab>> SFS_diss_lev;
+
758  amrex::Vector<std::unique_ptr<amrex::MultiFab>> SFS_q1fx1_lev, SFS_q1fx2_lev, SFS_q1fx3_lev;
+
759  amrex::Vector<std::unique_ptr<amrex::MultiFab>> SFS_q2fx3_lev;
+
760 
+
761  // Terrain / grid stretching
+
762  amrex::Vector<amrex::Vector<amrex::Real>> zlevels_stag; // nominal height levels
+
763  amrex::Vector<std::unique_ptr<amrex::MultiFab>> z_phys_nd;
+
764  amrex::Vector<std::unique_ptr<amrex::MultiFab>> z_phys_cc;
+
765 
+
766  amrex::Vector<std::unique_ptr<amrex::MultiFab>> detJ_cc;
+
767  amrex::Vector<std::unique_ptr<amrex::MultiFab>> ax;
+
768  amrex::Vector<std::unique_ptr<amrex::MultiFab>> ay;
+
769  amrex::Vector<std::unique_ptr<amrex::MultiFab>> az;
+
770 
+
771  amrex::Vector<std::unique_ptr<amrex::MultiFab>> z_phys_nd_src;
+
772  amrex::Vector<std::unique_ptr<amrex::MultiFab>> detJ_cc_src;
+
773  amrex::Vector<std::unique_ptr<amrex::MultiFab>> ax_src;
+
774  amrex::Vector<std::unique_ptr<amrex::MultiFab>> ay_src;
+
775  amrex::Vector<std::unique_ptr<amrex::MultiFab>> az_src;
+
776 
+
777  amrex::Vector<std::unique_ptr<amrex::MultiFab>> z_phys_nd_new;
+
778  amrex::Vector<std::unique_ptr<amrex::MultiFab>> detJ_cc_new;
+
779  amrex::Vector<std::unique_ptr<amrex::MultiFab>> ax_new;
+
780  amrex::Vector<std::unique_ptr<amrex::MultiFab>> ay_new;
+
781  amrex::Vector<std::unique_ptr<amrex::MultiFab>> az_new;
+
782 
+
783  amrex::Vector<std::unique_ptr<amrex::MultiFab>> z_t_rk;
784 
-
785  amrex::Vector<amrex::MultiFab> base_state;
-
786  amrex::Vector<amrex::MultiFab> base_state_new;
-
787 
-
788  // Wave coupling data
-
789  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Hwave;
-
790  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Lwave;
-
791  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Hwave_onegrid;
-
792  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Lwave_onegrid;
-
793  bool finished_wave = false;
-
794 
-
795  // array of flux registers
-
796  amrex::Vector<amrex::YAFluxRegister*> advflux_reg;
-
797 
-
798  // A BCRec is essentially a 2*DIM integer array storing the boundary
-
799  // condition type at each lo/hi walls in each direction. We have one BCRec
-
800  // for each component of the cell-centered variables and each velocity component.
-
801  amrex::Vector <amrex::BCRec> domain_bcs_type;
-
802  amrex::Gpu::DeviceVector<amrex::BCRec> domain_bcs_type_d;
-
803 
-
804  // We store these so that we can print them out in the job_info file
-
805  amrex::Array<std::string,2*AMREX_SPACEDIM> domain_bc_type;
-
806 
-
807  // These hold the Dirichlet values at walls which need them ...
-
808  amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>, AMREX_SPACEDIM+NBCVAR_max> m_bc_extdir_vals;
-
809 
-
810  // These hold the Neumann values at walls which need them ...
-
811  amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>, AMREX_SPACEDIM+NBCVAR_max> m_bc_neumann_vals;
-
812 
-
813  // These are the "physical" boundary condition types (e.g. "inflow")
-
814  amrex::GpuArray<ERF_BC, AMREX_SPACEDIM*2> phys_bc_type;
-
815 
-
816  // These are the masks for the thin immersed body
-
817  amrex::Vector<std::unique_ptr<amrex::iMultiFab>> xflux_imask;
-
818  amrex::Vector<std::unique_ptr<amrex::iMultiFab>> yflux_imask;
-
819  amrex::Vector<std::unique_ptr<amrex::iMultiFab>> zflux_imask;
-
820  //amrex::Vector<std::unique_ptr<amrex::iMultiFab>> overset_imask;
-
821 
-
822  // These are the body forces that result from the thin immersed body
-
823  amrex::Vector<std::unique_ptr<amrex::MultiFab>> thin_xforce;
-
824  amrex::Vector<std::unique_ptr<amrex::MultiFab>> thin_yforce;
-
825  amrex::Vector<std::unique_ptr<amrex::MultiFab>> thin_zforce;
-
826 
-
827  int last_plot_file_step_1;
-
828  int last_plot_file_step_2;
-
829 
-
830  int last_check_file_step;
-
831  int plot_file_on_restart = 1;
-
832 
-
833  ////////////////
-
834  // runtime parameters
-
835 
-
836  // maximum number of steps and stop time
-
837  int max_step = std::numeric_limits<int>::max();
-
838  amrex::Real start_time = 0.0;
-
839  amrex::Real stop_time = std::numeric_limits<amrex::Real>::max();
-
840 
-
841  // if >= 0 we restart from a checkpoint
-
842  std::string restart_chkfile = "";
-
843 
-
844  // Time step controls
-
845  static amrex::Real cfl;
-
846  static amrex::Real init_shrink;
-
847  static amrex::Real change_max;
-
848 
-
849  // Fixed dt for level 0 timesteps (only used if positive)
-
850  amrex::Vector<amrex::Real> fixed_dt;
-
851  amrex::Vector<amrex::Real> fixed_fast_dt;
-
852  static int fixed_mri_dt_ratio;
-
853 
-
854  // how often each level regrids the higher levels of refinement
-
855  // (after a level advances that many time steps)
-
856  int regrid_int = -1;
+
785  amrex::Vector<std::unique_ptr<amrex::MultiFab>> mapfac_m;
+
786  amrex::Vector<std::unique_ptr<amrex::MultiFab>> mapfac_u;
+
787  amrex::Vector<std::unique_ptr<amrex::MultiFab>> mapfac_v;
+
788 
+
789  amrex::Vector<amrex::MultiFab> base_state;
+
790  amrex::Vector<amrex::MultiFab> base_state_new;
+
791 
+
792  // Wave coupling data
+
793  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Hwave;
+
794  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Lwave;
+
795  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Hwave_onegrid;
+
796  amrex::Vector<std::unique_ptr<amrex::MultiFab>> Lwave_onegrid;
+
797  bool finished_wave = false;
+
798 
+
799  // array of flux registers
+
800  amrex::Vector<amrex::YAFluxRegister*> advflux_reg;
+
801 
+
802  // A BCRec is essentially a 2*DIM integer array storing the boundary
+
803  // condition type at each lo/hi walls in each direction. We have one BCRec
+
804  // for each component of the cell-centered variables and each velocity component.
+
805  amrex::Vector <amrex::BCRec> domain_bcs_type;
+
806  amrex::Gpu::DeviceVector<amrex::BCRec> domain_bcs_type_d;
+
807 
+
808  // We store these so that we can print them out in the job_info file
+
809  amrex::Array<std::string,2*AMREX_SPACEDIM> domain_bc_type;
+
810 
+
811  // These hold the Dirichlet values at walls which need them ...
+
812  amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>, AMREX_SPACEDIM+NBCVAR_max> m_bc_extdir_vals;
+
813 
+
814  // These hold the Neumann values at walls which need them ...
+
815  amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>, AMREX_SPACEDIM+NBCVAR_max> m_bc_neumann_vals;
+
816 
+
817  // These are the "physical" boundary condition types (e.g. "inflow")
+
818  amrex::GpuArray<ERF_BC, AMREX_SPACEDIM*2> phys_bc_type;
+
819 
+
820  // These are the masks for the thin immersed body
+
821  amrex::Vector<std::unique_ptr<amrex::iMultiFab>> xflux_imask;
+
822  amrex::Vector<std::unique_ptr<amrex::iMultiFab>> yflux_imask;
+
823  amrex::Vector<std::unique_ptr<amrex::iMultiFab>> zflux_imask;
+
824  //amrex::Vector<std::unique_ptr<amrex::iMultiFab>> overset_imask;
+
825 
+
826  // These are the body forces that result from the thin immersed body
+
827  amrex::Vector<std::unique_ptr<amrex::MultiFab>> thin_xforce;
+
828  amrex::Vector<std::unique_ptr<amrex::MultiFab>> thin_yforce;
+
829  amrex::Vector<std::unique_ptr<amrex::MultiFab>> thin_zforce;
+
830 
+
831  int last_plot_file_step_1;
+
832  int last_plot_file_step_2;
+
833 
+
834  int last_check_file_step;
+
835  int plot_file_on_restart = 1;
+
836 
+
837  ////////////////
+
838  // runtime parameters
+
839 
+
840  // maximum number of steps and stop time
+
841  int max_step = std::numeric_limits<int>::max();
+
842  amrex::Real start_time = 0.0;
+
843  amrex::Real stop_time = std::numeric_limits<amrex::Real>::max();
+
844 
+
845  // if >= 0 we restart from a checkpoint
+
846  std::string restart_chkfile = "";
+
847 
+
848  // Time step controls
+
849  static amrex::Real cfl;
+
850  static amrex::Real init_shrink;
+
851  static amrex::Real change_max;
+
852 
+
853  // Fixed dt for level 0 timesteps (only used if positive)
+
854  amrex::Vector<amrex::Real> fixed_dt;
+
855  amrex::Vector<amrex::Real> fixed_fast_dt;
+
856  static int fixed_mri_dt_ratio;
857 
-
858  // plotfile prefix and frequency
-
859  std::string plot_file_1 {"plt_1_"};
-
860  std::string plot_file_2 {"plt_2_"};
-
861  int m_plot_int_1 = -1;
-
862  int m_plot_int_2 = -1;
-
863  amrex::Real m_plot_per_1 = -1.0;
-
864  amrex::Real m_plot_per_2 = -1.0;
-
865 
-
866  bool plot_lsm = false;
-
867 
-
868  // other sampling output control
-
869  int profile_int = -1;
-
870  bool destag_profiles = true;
+
858  // how often each level regrids the higher levels of refinement
+
859  // (after a level advances that many time steps)
+
860  int regrid_int = -1;
+
861 
+
862  // plotfile prefix and frequency
+
863  std::string plot_file_1 {"plt_1_"};
+
864  std::string plot_file_2 {"plt_2_"};
+
865  int m_plot_int_1 = -1;
+
866  int m_plot_int_2 = -1;
+
867  amrex::Real m_plot_per_1 = -1.0;
+
868  amrex::Real m_plot_per_2 = -1.0;
+
869 
+
870  bool plot_lsm = false;
871 
-
872  // Checkpoint type, prefix and frequency
-
873  std::string check_file {"chk"};
-
874  std::string check_type {"native"};
-
875  std::string restart_type {"native"};
-
876  int m_check_int = -1;
-
877  amrex::Real m_check_per = -1.0;
-
878 
-
879  amrex::Vector<std::string> plot_var_names_1;
-
880  amrex::Vector<std::string> plot_var_names_2;
-
881  const amrex::Vector<std::string> cons_names {"density", "rhotheta", "rhoKE", "rhoQKE", "rhoadv_0",
-
882  "rhoQ1", "rhoQ2", "rhoQ3",
-
883  "rhoQ4", "rhoQ5", "rhoQ6"};
-
884 
-
885  // Note that the order of variable names here must match the order in ERF_Derive.cpp
-
886  const amrex::Vector<std::string> derived_names {"soundspeed", "temp", "theta", "KE", "QKE", "scalar",
-
887  "vorticity_x","vorticity_y","vorticity_z",
-
888  "magvel", "divU",
-
889  "pres_hse", "dens_hse", "pressure", "pert_pres", "pert_dens",
-
890  "eq_pot_temp", "num_turb", "SMark0", "SMark1",
-
891  "dpdx", "dpdy", "pres_hse_x", "pres_hse_y",
-
892  "z_phys", "detJ" , "mapfac", "lat_m", "lon_m",
-
893  // Time averaged velocity
-
894  "u_t_avg", "v_t_avg", "w_t_avg", "umag_t_avg",
-
895  // eddy viscosity
-
896  "Kmv","Kmh",
-
897  // eddy diffusivity of heat
-
898  "Khv","Khh",
-
899  // mynn pbl lengthscale
-
900  "Lpbl",
-
901  // moisture vars
-
902  "qt", "qv", "qc", "qi", "qp", "qrain", "qsnow", "qgraup", "qsat",
-
903  "rain_accum", "snow_accum", "graup_accum"
-
904 #ifdef ERF_COMPUTE_ERROR
-
905  // error vars
-
906  ,"xvel_err", "yvel_err", "zvel_err", "pp_err"
-
907 #endif
-
908 #ifdef ERF_USE_RRTMGP
-
909  ,"qsrc_sw", "qsrc_lw"
-
910 #endif
-
911  };
-
912 
-
913  // algorithm choices
-
914  static SolverChoice solverChoice;
-
915 
-
916  // Turbulent perturbation structure
-
917  TurbulentPerturbation turbPert;
-
918 
-
919 #ifdef ERF_USE_PARTICLES
-
920  // Particle container with all particle species
-
921  ParticleData particleData;
+
872  // other sampling output control
+
873  int profile_int = -1;
+
874  bool destag_profiles = true;
+
875 
+
876  // Checkpoint type, prefix and frequency
+
877  std::string check_file {"chk"};
+
878  std::string check_type {"native"};
+
879  std::string restart_type {"native"};
+
880  int m_check_int = -1;
+
881  amrex::Real m_check_per = -1.0;
+
882 
+
883  amrex::Vector<std::string> plot_var_names_1;
+
884  amrex::Vector<std::string> plot_var_names_2;
+
885  const amrex::Vector<std::string> cons_names {"density", "rhotheta", "rhoKE", "rhoQKE", "rhoadv_0",
+
886  "rhoQ1", "rhoQ2", "rhoQ3",
+
887  "rhoQ4", "rhoQ5", "rhoQ6"};
+
888 
+
889  // Note that the order of variable names here must match the order in ERF_Derive.cpp
+
890  const amrex::Vector<std::string> derived_names {"soundspeed", "temp", "theta", "KE", "QKE", "scalar",
+
891  "vorticity_x","vorticity_y","vorticity_z",
+
892  "magvel", "divU",
+
893  "pres_hse", "dens_hse", "pressure", "pert_pres", "pert_dens",
+
894  "eq_pot_temp", "num_turb", "SMark0", "SMark1",
+
895  "dpdx", "dpdy", "pres_hse_x", "pres_hse_y",
+
896  "z_phys", "detJ" , "mapfac", "lat_m", "lon_m",
+
897  // Time averaged velocity
+
898  "u_t_avg", "v_t_avg", "w_t_avg", "umag_t_avg",
+
899  // eddy viscosity
+
900  "Kmv","Kmh",
+
901  // eddy diffusivity of heat
+
902  "Khv","Khh",
+
903  // mynn pbl lengthscale
+
904  "Lpbl",
+
905  // moisture vars
+
906  "qt", "qv", "qc", "qi", "qp", "qrain", "qsnow", "qgraup", "qsat",
+
907  "rain_accum", "snow_accum", "graup_accum"
+
908 #ifdef ERF_COMPUTE_ERROR
+
909  // error vars
+
910  ,"xvel_err", "yvel_err", "zvel_err", "pp_err"
+
911 #endif
+
912 #ifdef ERF_USE_RRTMGP
+
913  ,"qsrc_sw", "qsrc_lw"
+
914 #endif
+
915  };
+
916 
+
917  // algorithm choices
+
918  static SolverChoice solverChoice;
+
919 
+
920  // Turbulent perturbation structure
+
921  TurbulentPerturbation turbPert;
922 
-
923  // variables and functions for tracers particles
-
924  bool m_use_tracer_particles; /*!< tracer particles that advect with flow */
-
925  bool m_use_hydro_particles; /*!< tracer particles that fall with gravity */
-
926 
-
927  /*! Read tracer and hydro particles parameters */
-
928  void readTracersParams();
-
929 
-
930  /*! Initialize tracer and hydro particles */
-
931  void initializeTracers ( amrex::ParGDBBase*,
-
932  const amrex::Vector<std::unique_ptr<amrex::MultiFab>>& );
+
923 #ifdef ERF_USE_PARTICLES
+
924  // Particle container with all particle species
+
925  ParticleData particleData;
+
926 
+
927  // variables and functions for tracers particles
+
928  bool m_use_tracer_particles; /*!< tracer particles that advect with flow */
+
929  bool m_use_hydro_particles; /*!< tracer particles that fall with gravity */
+
930 
+
931  /*! Read tracer and hydro particles parameters */
+
932  void readTracersParams();
933 
-
934  /*! Restart tracer and hydro particles */
-
935  void restartTracers ( amrex::ParGDBBase*, const std::string& );
-
936 
-
937  /*! Evolve tracers and hydro particles */
-
938  void evolveTracers( int,
-
939  amrex::Real,
-
940  amrex::Vector<amrex::Vector<amrex::MultiFab>>&,
-
941  const amrex::Vector<std::unique_ptr<amrex::MultiFab>>& );
-
942 
-
943 #endif
-
944 
-
945  static int verbose;
-
946  static int mg_verbose;
-
947  static bool use_heffte;
+
934  /*! Initialize tracer and hydro particles */
+
935  void initializeTracers ( amrex::ParGDBBase*,
+
936  const amrex::Vector<std::unique_ptr<amrex::MultiFab>>& );
+
937 
+
938  /*! Restart tracer and hydro particles */
+
939  void restartTracers ( amrex::ParGDBBase*, const std::string& );
+
940 
+
941  /*! Evolve tracers and hydro particles */
+
942  void evolveTracers( int,
+
943  amrex::Real,
+
944  amrex::Vector<amrex::Vector<amrex::MultiFab>>&,
+
945  const amrex::Vector<std::unique_ptr<amrex::MultiFab>>& );
+
946 
+
947 #endif
948 
-
949  // Diagnostic output interval
-
950  static int sum_interval;
-
951  static int pert_interval;
-
952  static amrex::Real sum_per;
-
953 
-
954  // Native or NetCDF
-
955  static std::string plotfile_type;
-
956 
-
957  // init_type: "ideal", "real", "input_sounding", "metgrid" or ""
-
958  static std::string init_type;
-
959 
-
960  // sponge_type: "input_sponge"
-
961  static std::string sponge_type;
-
962 
-
963  // use_real_bcs: only true if 1) ( (init_type == real) or (init_type == metgrid) )
-
964  // AND 2) we want to use the bc's from the WRF bdy file
-
965  static bool use_real_bcs;
+
949  static int verbose;
+
950  static int mg_verbose;
+
951  static bool use_heffte;
+
952 
+
953  // Diagnostic output interval
+
954  static int sum_interval;
+
955  static int pert_interval;
+
956  static amrex::Real sum_per;
+
957 
+
958  // Native or NetCDF
+
959  static std::string plotfile_type;
+
960 
+
961  // init_type: "ideal", "real", "input_sounding", "metgrid" or ""
+
962  static std::string init_type;
+
963 
+
964  // sponge_type: "input_sponge"
+
965  static std::string sponge_type;
966 
-
967  // NetCDF initialization (wrfinput) file
-
968  static amrex::Vector<amrex::Vector<std::string>> nc_init_file;
-
969 
-
970  // NetCDF initialization (wrfbdy/met_em) file
-
971  static std::string nc_bdy_file;
-
972  int real_width{0};
-
973  int real_set_width{0};
-
974 
-
975  // Flag to trigger initialization from input_sounding like WRF's ideal.exe
-
976  // used with init_type == "input_sounding"
-
977  static bool init_sounding_ideal;
+
967  // use_real_bcs: only true if 1) ( (init_type == real) or (init_type == metgrid) )
+
968  // AND 2) we want to use the bc's from the WRF bdy file
+
969  static bool use_real_bcs;
+
970 
+
971  // NetCDF initialization (wrfinput) file
+
972  static amrex::Vector<amrex::Vector<std::string>> nc_init_file;
+
973 
+
974  // NetCDF initialization (wrfbdy/met_em) file
+
975  static std::string nc_bdy_file;
+
976  int real_width{0};
+
977  int real_set_width{0};
978 
-
979  // 1D CDF output (for ingestion in AMR-Wind)
-
980  static int output_1d_column;
-
981  static int column_interval;
-
982  static amrex::Real column_per;
-
983  static amrex::Real column_loc_x;
-
984  static amrex::Real column_loc_y;
-
985  static std::string column_file_name;
-
986 
-
987  // 2D BndryRegister output (for ingestion in AMR-Wind)
-
988  static int output_bndry_planes;
-
989  static int bndry_output_planes_interval;
-
990  static amrex::Real bndry_output_planes_per;
-
991  static amrex::Real bndry_output_planes_start_time;
-
992 
-
993  // 2D BndryRegister input
-
994  static int input_bndry_planes;
-
995 
-
996  static int ng_dens_hse;
-
997  static int ng_pres_hse;
-
998 
-
999  // Custom source terms
-
1000  amrex::Vector< amrex::Vector<amrex::Real> > h_rhotheta_src;
-
1001  amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real> > d_rhotheta_src;
+
979  // Flag to trigger initialization from input_sounding like WRF's ideal.exe
+
980  // used with init_type == "input_sounding"
+
981  static bool init_sounding_ideal;
+
982 
+
983  // 1D CDF output (for ingestion in AMR-Wind)
+
984  static int output_1d_column;
+
985  static int column_interval;
+
986  static amrex::Real column_per;
+
987  static amrex::Real column_loc_x;
+
988  static amrex::Real column_loc_y;
+
989  static std::string column_file_name;
+
990 
+
991  // 2D BndryRegister output (for ingestion in AMR-Wind)
+
992  static int output_bndry_planes;
+
993  static int bndry_output_planes_interval;
+
994  static amrex::Real bndry_output_planes_per;
+
995  static amrex::Real bndry_output_planes_start_time;
+
996 
+
997  // 2D BndryRegister input
+
998  static int input_bndry_planes;
+
999 
+
1000  static int ng_dens_hse;
+
1001  static int ng_pres_hse;
1002 
-
1003  amrex::Vector< amrex::Vector<amrex::Real> > h_rhoqt_src;
-
1004  amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real> > d_rhoqt_src;
-
1005 
-
1006  amrex::Vector< amrex::Vector<amrex::Real> > h_w_subsid;
-
1007  amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real> > d_w_subsid;
-
1008 
-
1009  amrex::Vector< amrex::Vector<amrex::Real> > h_u_geos;
-
1010  amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real> > d_u_geos;
-
1011 
-
1012  amrex::Vector< amrex::Vector<amrex::Real> > h_v_geos;
-
1013  amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real> > d_v_geos;
-
1014 
-
1015  // Function to read and populate above host vectors (if input file exists)
-
1016  void init_geo_wind_profile (const std::string input_file,
-
1017  amrex::Vector<amrex::Real>& u_geos,
-
1018  amrex::Gpu::DeviceVector<amrex::Real>& u_geos_d,
-
1019  amrex::Vector<amrex::Real>& v_geos,
-
1020  amrex::Gpu::DeviceVector<amrex::Real>& v_geos_d,
-
1021  const amrex::Geometry& lgeom,
-
1022  const amrex::Vector<amrex::Real>& zlev_stag);
-
1023 
-
1024  // This is a vector over levels of vectors across quantities of Vectors
-
1025  amrex::Vector<amrex::Vector< amrex::Vector<amrex::Real> > > h_rayleigh_ptrs;
-
1026 
-
1027  // This is a vector over levels of vectors across quantities of Vectors
-
1028  amrex::Vector<amrex::Vector< amrex::Vector<amrex::Real> > > h_sponge_ptrs;
-
1029 
-
1030  // This is a vector over levels of vectors across quantities of DeviceVectors
-
1031  amrex::Vector<amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real> > > d_rayleigh_ptrs;
-
1032 
-
1033  // This is a vector over levels of vectors across quantities of DeviceVectors
-
1034  amrex::Vector<amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real> > > d_sponge_ptrs;
-
1035 
-
1036  amrex::Vector<amrex::Real> h_havg_density;
-
1037  amrex::Vector<amrex::Real> h_havg_temperature;
-
1038  amrex::Vector<amrex::Real> h_havg_pressure;
-
1039  amrex::Vector<amrex::Real> h_havg_qv;
-
1040  amrex::Vector<amrex::Real> h_havg_qc;
-
1041 
-
1042  amrex::Gpu::DeviceVector<amrex::Real> d_havg_density;
-
1043  amrex::Gpu::DeviceVector<amrex::Real> d_havg_temperature;
-
1044  amrex::Gpu::DeviceVector<amrex::Real> d_havg_pressure;
-
1045  amrex::Gpu::DeviceVector<amrex::Real> d_havg_qv;
-
1046  amrex::Gpu::DeviceVector<amrex::Real> d_havg_qc;
-
1047 
-
1048  void refinement_criteria_setup ();
-
1049 
-
1050  std::unique_ptr<WriteBndryPlanes> m_w2d = nullptr;
-
1051  std::unique_ptr<ReadBndryPlanes> m_r2d = nullptr;
-
1052  std::unique_ptr<ABLMost> m_most = nullptr;
+
1003  // Custom source terms
+
1004  amrex::Vector< amrex::Vector<amrex::Real> > h_rhotheta_src;
+
1005  amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real> > d_rhotheta_src;
+
1006 
+
1007  amrex::Vector< amrex::Vector<amrex::Real> > h_rhoqt_src;
+
1008  amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real> > d_rhoqt_src;
+
1009 
+
1010  amrex::Vector< amrex::Vector<amrex::Real> > h_w_subsid;
+
1011  amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real> > d_w_subsid;
+
1012 
+
1013  amrex::Vector< amrex::Vector<amrex::Real> > h_u_geos;
+
1014  amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real> > d_u_geos;
+
1015 
+
1016  amrex::Vector< amrex::Vector<amrex::Real> > h_v_geos;
+
1017  amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real> > d_v_geos;
+
1018 
+
1019  // Function to read and populate above host vectors (if input file exists)
+
1020  void init_geo_wind_profile (const std::string input_file,
+
1021  amrex::Vector<amrex::Real>& u_geos,
+
1022  amrex::Gpu::DeviceVector<amrex::Real>& u_geos_d,
+
1023  amrex::Vector<amrex::Real>& v_geos,
+
1024  amrex::Gpu::DeviceVector<amrex::Real>& v_geos_d,
+
1025  const amrex::Geometry& lgeom,
+
1026  const amrex::Vector<amrex::Real>& zlev_stag);
+
1027 
+
1028  // This is a vector over levels of vectors across quantities of Vectors
+
1029  amrex::Vector<amrex::Vector< amrex::Vector<amrex::Real> > > h_rayleigh_ptrs;
+
1030 
+
1031  // This is a vector over levels of vectors across quantities of Vectors
+
1032  amrex::Vector<amrex::Vector< amrex::Vector<amrex::Real> > > h_sponge_ptrs;
+
1033 
+
1034  // This is a vector over levels of vectors across quantities of DeviceVectors
+
1035  amrex::Vector<amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real> > > d_rayleigh_ptrs;
+
1036 
+
1037  // This is a vector over levels of vectors across quantities of DeviceVectors
+
1038  amrex::Vector<amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real> > > d_sponge_ptrs;
+
1039 
+
1040  amrex::Vector<amrex::Real> h_havg_density;
+
1041  amrex::Vector<amrex::Real> h_havg_temperature;
+
1042  amrex::Vector<amrex::Real> h_havg_pressure;
+
1043  amrex::Vector<amrex::Real> h_havg_qv;
+
1044  amrex::Vector<amrex::Real> h_havg_qc;
+
1045 
+
1046  amrex::Gpu::DeviceVector<amrex::Real> d_havg_density;
+
1047  amrex::Gpu::DeviceVector<amrex::Real> d_havg_temperature;
+
1048  amrex::Gpu::DeviceVector<amrex::Real> d_havg_pressure;
+
1049  amrex::Gpu::DeviceVector<amrex::Real> d_havg_qv;
+
1050  amrex::Gpu::DeviceVector<amrex::Real> d_havg_qc;
+
1051 
+
1052  void refinement_criteria_setup ();
1053 
-
1054  //
-
1055  // Holds info for dynamically generated tagging criteria
-
1056  //
-
1057  static amrex::Vector<amrex::AMRErrorTag> ref_tags;
-
1058 
-
1059  //
-
1060  // Build a mask that zeroes out values on a coarse level underlying
-
1061  // grids on the next finest level
-
1062  //
-
1063  amrex::MultiFab fine_mask;
-
1064 
-
1065  amrex::Vector<amrex::Real> dz_min;
-
1066 
-
1067  static AMREX_FORCE_INLINE
-
1068  int
-
1069  ComputeGhostCells (const AdvChoice& advChoice, bool use_num_diff)
-
1070  {
-
1071  if (use_num_diff)
-
1072  {
-
1073  return 3;
-
1074  } else {
-
1075  if (
-
1076  (advChoice.dycore_horiz_adv_type == AdvType::Centered_6th)
-
1077  || (advChoice.dycore_vert_adv_type == AdvType::Centered_6th)
-
1078  || (advChoice.moistscal_horiz_adv_type == AdvType::Centered_6th)
-
1079  || (advChoice.moistscal_horiz_adv_type == AdvType::Centered_6th)
-
1080  || (advChoice.dryscal_horiz_adv_type == AdvType::Centered_6th)
-
1081  || (advChoice.dryscal_vert_adv_type == AdvType::Centered_6th) )
-
1082  { return 3; }
-
1083  else if (
-
1084  (advChoice.dycore_horiz_adv_type == AdvType::Upwind_5th)
-
1085  || (advChoice.dycore_vert_adv_type == AdvType::Upwind_5th)
-
1086  || (advChoice.moistscal_horiz_adv_type == AdvType::Upwind_5th)
-
1087  || (advChoice.moistscal_horiz_adv_type == AdvType::Upwind_5th)
-
1088  || (advChoice.dryscal_horiz_adv_type == AdvType::Upwind_5th)
-
1089  || (advChoice.dryscal_vert_adv_type == AdvType::Upwind_5th) )
-
1090  { return 3; }
-
1091  else if (
-
1092  (advChoice.dryscal_horiz_adv_type == AdvType::Weno_5)
-
1093  || (advChoice.dryscal_vert_adv_type == AdvType::Weno_5)
-
1094  || (advChoice.moistscal_horiz_adv_type == AdvType::Weno_5)
-
1095  || (advChoice.moistscal_vert_adv_type == AdvType::Weno_5)
-
1096  || (advChoice.moistscal_horiz_adv_type == AdvType::Weno_5Z)
-
1097  || (advChoice.moistscal_vert_adv_type == AdvType::Weno_5Z)
-
1098  || (advChoice.dryscal_horiz_adv_type == AdvType::Weno_5Z)
-
1099  || (advChoice.dryscal_vert_adv_type == AdvType::Weno_5Z) )
-
1100  { return 3; }
-
1101  else if (
-
1102  (advChoice.dryscal_horiz_adv_type == AdvType::Weno_7)
-
1103  || (advChoice.dryscal_vert_adv_type == AdvType::Weno_7)
-
1104  || (advChoice.moistscal_horiz_adv_type == AdvType::Weno_7)
-
1105  || (advChoice.moistscal_vert_adv_type == AdvType::Weno_7)
-
1106  || (advChoice.moistscal_horiz_adv_type == AdvType::Weno_7Z)
-
1107  || (advChoice.moistscal_vert_adv_type == AdvType::Weno_7Z)
-
1108  || (advChoice.dryscal_horiz_adv_type == AdvType::Weno_7Z)
-
1109  || (advChoice.dryscal_vert_adv_type == AdvType::Weno_7Z) )
-
1110  { return 4; }
-
1111  else
-
1112  { return 2; }
-
1113  }
-
1114  }
-
1115 
-
1116  AMREX_FORCE_INLINE
-
1117  amrex::YAFluxRegister* getAdvFluxReg (int lev)
-
1118  {
-
1119  return advflux_reg[lev];
-
1120  }
-
1121 
-
1122  AMREX_FORCE_INLINE
-
1123  std::ostream&
-
1124  DataLog (int i)
-
1125  {
-
1126  return *datalog[i];
-
1127  }
-
1128 
-
1129  AMREX_FORCE_INLINE
-
1130  int
-
1131  NumDataLogs () noexcept
-
1132  {
-
1133  return datalog.size();
-
1134  }
-
1135 
-
1136  AMREX_FORCE_INLINE
-
1137  std::ostream&
-
1138  SamplePointLog (int i)
-
1139  {
-
1140  return *sampleptlog[i];
-
1141  }
-
1142 
-
1143  AMREX_FORCE_INLINE
-
1144  int
-
1145  NumSamplePointLogs () noexcept
-
1146  {
-
1147  return sampleptlog.size();
-
1148  }
-
1149 
-
1150  AMREX_FORCE_INLINE
-
1151  std::ostream&
-
1152  SampleLineLog (int i)
-
1153  {
-
1154  return *samplelinelog[i];
-
1155  }
-
1156 
-
1157  AMREX_FORCE_INLINE
-
1158  int
-
1159  NumSampleLineLogs () noexcept
-
1160  {
-
1161  return samplelinelog.size();
-
1162  }
-
1163 
-
1164  amrex::IntVect&
-
1165  SamplePoint (int i)
-
1166  {
-
1167  return samplepoint[i];
-
1168  }
-
1169 
-
1170  AMREX_FORCE_INLINE
-
1171  int
-
1172  NumSamplePoints () noexcept
-
1173  {
-
1174  return samplepoint.size();
-
1175  }
-
1176 
-
1177  amrex::IntVect&
-
1178  SampleLine (int i)
-
1179  {
-
1180  return sampleline[i];
-
1181  }
-
1182 
-
1183  AMREX_FORCE_INLINE
-
1184  int
-
1185  NumSampleLines () noexcept
-
1186  {
-
1187  return sampleline.size();
-
1188  }
-
1189 
-
1190  static amrex::Real startCPUTime;
-
1191  static amrex::Real previousCPUTimeUsed;
-
1192 
-
1193  static amrex::Real
-
1194  getCPUTime ()
-
1195  {
-
1196  int numCores = amrex::ParallelDescriptor::NProcs();
-
1197 #ifdef _OPENMP
-
1198  numCores = numCores * omp_get_max_threads();
-
1199 #endif
-
1200 
-
1201  amrex::Real T =
-
1202  numCores * (amrex::ParallelDescriptor::second() - startCPUTime) +
-
1203  previousCPUTimeUsed;
+
1054  std::unique_ptr<WriteBndryPlanes> m_w2d = nullptr;
+
1055  std::unique_ptr<ReadBndryPlanes> m_r2d = nullptr;
+
1056  std::unique_ptr<ABLMost> m_most = nullptr;
+
1057 
+
1058  //
+
1059  // Holds info for dynamically generated tagging criteria
+
1060  //
+
1061  static amrex::Vector<amrex::AMRErrorTag> ref_tags;
+
1062 
+
1063  //
+
1064  // Build a mask that zeroes out values on a coarse level underlying
+
1065  // grids on the next finest level
+
1066  //
+
1067  amrex::MultiFab fine_mask;
+
1068 
+
1069  amrex::Vector<amrex::Real> dz_min;
+
1070 
+
1071  static AMREX_FORCE_INLINE
+
1072  int
+
1073  ComputeGhostCells (const AdvChoice& advChoice, bool use_num_diff)
+
1074  {
+
1075  if (use_num_diff)
+
1076  {
+
1077  return 3;
+
1078  } else {
+
1079  if (
+
1080  (advChoice.dycore_horiz_adv_type == AdvType::Centered_6th)
+
1081  || (advChoice.dycore_vert_adv_type == AdvType::Centered_6th)
+
1082  || (advChoice.moistscal_horiz_adv_type == AdvType::Centered_6th)
+
1083  || (advChoice.moistscal_horiz_adv_type == AdvType::Centered_6th)
+
1084  || (advChoice.dryscal_horiz_adv_type == AdvType::Centered_6th)
+
1085  || (advChoice.dryscal_vert_adv_type == AdvType::Centered_6th) )
+
1086  { return 3; }
+
1087  else if (
+
1088  (advChoice.dycore_horiz_adv_type == AdvType::Upwind_5th)
+
1089  || (advChoice.dycore_vert_adv_type == AdvType::Upwind_5th)
+
1090  || (advChoice.moistscal_horiz_adv_type == AdvType::Upwind_5th)
+
1091  || (advChoice.moistscal_horiz_adv_type == AdvType::Upwind_5th)
+
1092  || (advChoice.dryscal_horiz_adv_type == AdvType::Upwind_5th)
+
1093  || (advChoice.dryscal_vert_adv_type == AdvType::Upwind_5th) )
+
1094  { return 3; }
+
1095  else if (
+
1096  (advChoice.dryscal_horiz_adv_type == AdvType::Weno_5)
+
1097  || (advChoice.dryscal_vert_adv_type == AdvType::Weno_5)
+
1098  || (advChoice.moistscal_horiz_adv_type == AdvType::Weno_5)
+
1099  || (advChoice.moistscal_vert_adv_type == AdvType::Weno_5)
+
1100  || (advChoice.moistscal_horiz_adv_type == AdvType::Weno_5Z)
+
1101  || (advChoice.moistscal_vert_adv_type == AdvType::Weno_5Z)
+
1102  || (advChoice.dryscal_horiz_adv_type == AdvType::Weno_5Z)
+
1103  || (advChoice.dryscal_vert_adv_type == AdvType::Weno_5Z) )
+
1104  { return 3; }
+
1105  else if (
+
1106  (advChoice.dryscal_horiz_adv_type == AdvType::Weno_7)
+
1107  || (advChoice.dryscal_vert_adv_type == AdvType::Weno_7)
+
1108  || (advChoice.moistscal_horiz_adv_type == AdvType::Weno_7)
+
1109  || (advChoice.moistscal_vert_adv_type == AdvType::Weno_7)
+
1110  || (advChoice.moistscal_horiz_adv_type == AdvType::Weno_7Z)
+
1111  || (advChoice.moistscal_vert_adv_type == AdvType::Weno_7Z)
+
1112  || (advChoice.dryscal_horiz_adv_type == AdvType::Weno_7Z)
+
1113  || (advChoice.dryscal_vert_adv_type == AdvType::Weno_7Z) )
+
1114  { return 4; }
+
1115  else
+
1116  { return 2; }
+
1117  }
+
1118  }
+
1119 
+
1120  AMREX_FORCE_INLINE
+
1121  amrex::YAFluxRegister* getAdvFluxReg (int lev)
+
1122  {
+
1123  return advflux_reg[lev];
+
1124  }
+
1125 
+
1126  AMREX_FORCE_INLINE
+
1127  std::ostream&
+
1128  DataLog (int i)
+
1129  {
+
1130  return *datalog[i];
+
1131  }
+
1132 
+
1133  AMREX_FORCE_INLINE
+
1134  int
+
1135  NumDataLogs () noexcept
+
1136  {
+
1137  return datalog.size();
+
1138  }
+
1139 
+
1140  AMREX_FORCE_INLINE
+
1141  std::ostream&
+
1142  SamplePointLog (int i)
+
1143  {
+
1144  return *sampleptlog[i];
+
1145  }
+
1146 
+
1147  AMREX_FORCE_INLINE
+
1148  int
+
1149  NumSamplePointLogs () noexcept
+
1150  {
+
1151  return sampleptlog.size();
+
1152  }
+
1153 
+
1154  AMREX_FORCE_INLINE
+
1155  std::ostream&
+
1156  SampleLineLog (int i)
+
1157  {
+
1158  return *samplelinelog[i];
+
1159  }
+
1160 
+
1161  AMREX_FORCE_INLINE
+
1162  int
+
1163  NumSampleLineLogs () noexcept
+
1164  {
+
1165  return samplelinelog.size();
+
1166  }
+
1167 
+
1168  amrex::IntVect&
+
1169  SamplePoint (int i)
+
1170  {
+
1171  return samplepoint[i];
+
1172  }
+
1173 
+
1174  AMREX_FORCE_INLINE
+
1175  int
+
1176  NumSamplePoints () noexcept
+
1177  {
+
1178  return samplepoint.size();
+
1179  }
+
1180 
+
1181  amrex::IntVect&
+
1182  SampleLine (int i)
+
1183  {
+
1184  return sampleline[i];
+
1185  }
+
1186 
+
1187  AMREX_FORCE_INLINE
+
1188  int
+
1189  NumSampleLines () noexcept
+
1190  {
+
1191  return sampleline.size();
+
1192  }
+
1193 
+
1194  static amrex::Real startCPUTime;
+
1195  static amrex::Real previousCPUTimeUsed;
+
1196 
+
1197  static amrex::Real
+
1198  getCPUTime ()
+
1199  {
+
1200  int numCores = amrex::ParallelDescriptor::NProcs();
+
1201 #ifdef _OPENMP
+
1202  numCores = numCores * omp_get_max_threads();
+
1203 #endif
1204 
-
1205  return T;
-
1206  }
-
1207 
-
1208  void setRecordDataInfo (int i, const std::string& filename) // NOLINT
-
1209  {
-
1210  if (amrex::ParallelDescriptor::IOProcessor())
-
1211  {
-
1212  datalog[i] = std::make_unique<std::fstream>();
-
1213  datalog[i]->open(filename.c_str(),std::ios::out|std::ios::app);
-
1214  if (!datalog[i]->good()) {
-
1215  amrex::FileOpenFailed(filename);
-
1216  }
-
1217  }
-
1218  amrex::ParallelDescriptor::Barrier("ERF::setRecordDataInfo");
-
1219  }
-
1220 
-
1221  void setRecordSamplePointInfo (int i, int lev, amrex::IntVect& cell, const std::string& filename) // NOLINT
-
1222  {
-
1223  amrex::MultiFab dummy(grids[lev],dmap[lev],1,0);
-
1224  for (amrex::MFIter mfi(dummy); mfi.isValid(); ++mfi)
-
1225  {
-
1226  const amrex::Box& bx = mfi.validbox();
-
1227  if (bx.contains(cell)) {
-
1228  sampleptlog[i] = std::make_unique<std::fstream>();
-
1229  sampleptlog[i]->open(filename.c_str(),std::ios::out|std::ios::app);
-
1230  if (!sampleptlog[i]->good()) {
-
1231  amrex::FileOpenFailed(filename);
-
1232  }
-
1233  }
-
1234  }
-
1235  amrex::ParallelDescriptor::Barrier("ERF::setRecordSamplePointInfo");
-
1236  }
-
1237 
-
1238  void setRecordSampleLineInfo (int i, int lev, amrex::IntVect& cell, const std::string& filename) // NOLINT
-
1239  {
-
1240  amrex::MultiFab dummy(grids[lev],dmap[lev],1,0);
-
1241  for (amrex::MFIter mfi(dummy); mfi.isValid(); ++mfi)
-
1242  {
-
1243  const amrex::Box& bx = mfi.validbox();
-
1244  if (bx.contains(cell)) {
-
1245  samplelinelog[i] = std::make_unique<std::fstream>();
-
1246  samplelinelog[i]->open(filename.c_str(),std::ios::out|std::ios::app);
-
1247  if (!samplelinelog[i]->good()) {
-
1248  amrex::FileOpenFailed(filename);
-
1249  }
-
1250  }
-
1251  }
-
1252  amrex::ParallelDescriptor::Barrier("ERF::setRecordSampleLineInfo");
-
1253  }
-
1254 
-
1255  amrex::Vector<std::unique_ptr<std::fstream> > datalog;
-
1256  amrex::Vector<std::string> datalogname;
-
1257 
-
1258  amrex::Vector<std::unique_ptr<std::fstream> > sampleptlog;
-
1259  amrex::Vector<std::string> sampleptlogname;
-
1260  amrex::Vector<amrex::IntVect> samplepoint;
+
1205  amrex::Real T =
+
1206  numCores * (amrex::ParallelDescriptor::second() - startCPUTime) +
+
1207  previousCPUTimeUsed;
+
1208 
+
1209  return T;
+
1210  }
+
1211 
+
1212  void setRecordDataInfo (int i, const std::string& filename) // NOLINT
+
1213  {
+
1214  if (amrex::ParallelDescriptor::IOProcessor())
+
1215  {
+
1216  datalog[i] = std::make_unique<std::fstream>();
+
1217  datalog[i]->open(filename.c_str(),std::ios::out|std::ios::app);
+
1218  if (!datalog[i]->good()) {
+
1219  amrex::FileOpenFailed(filename);
+
1220  }
+
1221  }
+
1222  amrex::ParallelDescriptor::Barrier("ERF::setRecordDataInfo");
+
1223  }
+
1224 
+
1225  void setRecordSamplePointInfo (int i, int lev, amrex::IntVect& cell, const std::string& filename) // NOLINT
+
1226  {
+
1227  amrex::MultiFab dummy(grids[lev],dmap[lev],1,0);
+
1228  for (amrex::MFIter mfi(dummy); mfi.isValid(); ++mfi)
+
1229  {
+
1230  const amrex::Box& bx = mfi.validbox();
+
1231  if (bx.contains(cell)) {
+
1232  sampleptlog[i] = std::make_unique<std::fstream>();
+
1233  sampleptlog[i]->open(filename.c_str(),std::ios::out|std::ios::app);
+
1234  if (!sampleptlog[i]->good()) {
+
1235  amrex::FileOpenFailed(filename);
+
1236  }
+
1237  }
+
1238  }
+
1239  amrex::ParallelDescriptor::Barrier("ERF::setRecordSamplePointInfo");
+
1240  }
+
1241 
+
1242  void setRecordSampleLineInfo (int i, int lev, amrex::IntVect& cell, const std::string& filename) // NOLINT
+
1243  {
+
1244  amrex::MultiFab dummy(grids[lev],dmap[lev],1,0);
+
1245  for (amrex::MFIter mfi(dummy); mfi.isValid(); ++mfi)
+
1246  {
+
1247  const amrex::Box& bx = mfi.validbox();
+
1248  if (bx.contains(cell)) {
+
1249  samplelinelog[i] = std::make_unique<std::fstream>();
+
1250  samplelinelog[i]->open(filename.c_str(),std::ios::out|std::ios::app);
+
1251  if (!samplelinelog[i]->good()) {
+
1252  amrex::FileOpenFailed(filename);
+
1253  }
+
1254  }
+
1255  }
+
1256  amrex::ParallelDescriptor::Barrier("ERF::setRecordSampleLineInfo");
+
1257  }
+
1258 
+
1259  amrex::Vector<std::unique_ptr<std::fstream> > datalog;
+
1260  amrex::Vector<std::string> datalogname;
1261 
-
1262  amrex::Vector<std::unique_ptr<std::fstream> > samplelinelog;
-
1263  amrex::Vector<std::string> samplelinelogname;
-
1264  amrex::Vector<amrex::IntVect> sampleline;
-
1265 
-
1266  //! The filename of the ith datalog file.
-
1267  [[nodiscard]] std::string DataLogName (int i) const noexcept { return datalogname[i]; }
-
1268 
-
1269  //! The filename of the ith sampleptlog file.
-
1270  [[nodiscard]] std::string SamplePointLogName (int i) const noexcept { return sampleptlogname[i]; }
-
1271 
-
1272  //! The filename of the ith samplelinelog file.
-
1273  [[nodiscard]] std::string SampleLineLogName (int i) const noexcept { return samplelinelogname[i]; }
-
1274 
-
1275  amrex::Vector<std::unique_ptr<amrex::FabFactory<amrex::FArrayBox> > > m_factory;
-
1276 
-
1277  [[nodiscard]] amrex::FabFactory<amrex::FArrayBox> const&
-
1278  Factory (int lev) const noexcept { return *m_factory[lev]; }
-
1279 #ifdef ERF_USE_EB
-
1280  [[nodiscard]] amrex::EBFArrayBoxFactory const&
-
1281  EBFactory (int lev) const noexcept {
-
1282  return static_cast<amrex::EBFArrayBoxFactory const&>(*m_factory[lev]);
-
1283  }
-
1284 
-
1285  [[nodiscard]] static int nghost_eb_basic ()
-
1286  { return 5; }
-
1287 
-
1288  // We need 5 for doing StateRedistribution; otherwise 4 would be enough
-
1289  [[nodiscard]] static int nghost_eb_volume ()
+
1262  amrex::Vector<std::unique_ptr<std::fstream> > sampleptlog;
+
1263  amrex::Vector<std::string> sampleptlogname;
+
1264  amrex::Vector<amrex::IntVect> samplepoint;
+
1265 
+
1266  amrex::Vector<std::unique_ptr<std::fstream> > samplelinelog;
+
1267  amrex::Vector<std::string> samplelinelogname;
+
1268  amrex::Vector<amrex::IntVect> sampleline;
+
1269 
+
1270  //! The filename of the ith datalog file.
+
1271  [[nodiscard]] std::string DataLogName (int i) const noexcept { return datalogname[i]; }
+
1272 
+
1273  //! The filename of the ith sampleptlog file.
+
1274  [[nodiscard]] std::string SamplePointLogName (int i) const noexcept { return sampleptlogname[i]; }
+
1275 
+
1276  //! The filename of the ith samplelinelog file.
+
1277  [[nodiscard]] std::string SampleLineLogName (int i) const noexcept { return samplelinelogname[i]; }
+
1278 
+
1279  amrex::Vector<std::unique_ptr<amrex::FabFactory<amrex::FArrayBox> > > m_factory;
+
1280 
+
1281  [[nodiscard]] amrex::FabFactory<amrex::FArrayBox> const&
+
1282  Factory (int lev) const noexcept { return *m_factory[lev]; }
+
1283 #ifdef ERF_USE_EB
+
1284  [[nodiscard]] amrex::EBFArrayBoxFactory const&
+
1285  EBFactory (int lev) const noexcept {
+
1286  return static_cast<amrex::EBFArrayBoxFactory const&>(*m_factory[lev]);
+
1287  }
+
1288 
+
1289  [[nodiscard]] static int nghost_eb_basic ()
1290  { return 5; }
1291 
-
1292  [[nodiscard]] static int nghost_eb_full ()
-
1293  { return 4; }
-
1294 #endif
+
1292  // We need 5 for doing StateRedistribution; otherwise 4 would be enough
+
1293  [[nodiscard]] static int nghost_eb_volume ()
+
1294  { return 5; }
1295 
-
1296 public:
-
1297  void writeJobInfo (const std::string& dir) const;
-
1298  static void writeBuildInfo (std::ostream& os);
+
1296  [[nodiscard]] static int nghost_eb_full ()
+
1297  { return 4; }
+
1298 #endif
1299 
-
1300  static void print_banner(MPI_Comm /*comm*/, std::ostream& /*out*/);
-
1301  static void print_usage(MPI_Comm /*comm*/, std::ostream& /*out*/);
-
1302  static void print_error(MPI_Comm /*comm*/, const std::string& msg);
-
1303  static void print_summary(std::ostream&);
-
1304  static void print_tpls(std::ostream& /*out*/);
-
1305 };
-
1306 
-
1307 #endif
+
1300 public:
+
1301  void writeJobInfo (const std::string& dir) const;
+
1302  static void writeBuildInfo (std::ostream& os);
+
1303 
+
1304  static void print_banner(MPI_Comm /*comm*/, std::ostream& /*out*/);
+
1305  static void print_usage(MPI_Comm /*comm*/, std::ostream& /*out*/);
+
1306  static void print_error(MPI_Comm /*comm*/, const std::string& msg);
+
1307  static void print_summary(std::ostream&);
+
1308  static void print_tpls(std::ostream& /*out*/);
+
1309 };
+
1310 
+
1311 #endif
@@ -1420,232 +1424,232 @@
Definition: ERF.H:92
-
void MakeHorizontalAverages()
Definition: ERF.cpp:1670
-
amrex::Vector< amrex::MultiFab > rU_new
Definition: ERF.H:694
-
int last_check_file_step
Definition: ERF.H:830
+
void MakeHorizontalAverages()
Definition: ERF.cpp:1674
+
amrex::Vector< amrex::MultiFab > rU_new
Definition: ERF.H:698
+
int last_check_file_step
Definition: ERF.H:834
void initRayleigh()
Initialize Rayleigh damping profiles.
Definition: ERF_init_rayleigh.cpp:14
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau23_lev
Definition: ERF.H:743
-
amrex::Vector< amrex::Vector< amrex::Box > > boxes_at_level
Definition: ERF.H:655
-
std::unique_ptr< ABLMost > m_most
Definition: ERF.H:1052
-
amrex::Vector< std::string > samplelinelogname
Definition: ERF.H:1263
-
int max_step
Definition: ERF.H:837
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau23_lev
Definition: ERF.H:747
+
amrex::Vector< amrex::Vector< amrex::Box > > boxes_at_level
Definition: ERF.H:659
+
std::unique_ptr< ABLMost > m_most
Definition: ERF.H:1056
+
amrex::Vector< std::string > samplelinelogname
Definition: ERF.H:1267
+
int max_step
Definition: ERF.H:841
void setRayleighRefFromSounding(bool restarting)
Set Rayleigh mean profiles from input sounding.
Definition: ERF_init_rayleigh.cpp:55
-
int last_plot_file_step_2
Definition: ERF.H:828
-
amrex::Vector< std::unique_ptr< MRISplitIntegrator< amrex::Vector< amrex::MultiFab > > > > mri_integrator_mem
Definition: ERF.H:676
+
int last_plot_file_step_2
Definition: ERF.H:832
+
amrex::Vector< std::unique_ptr< MRISplitIntegrator< amrex::Vector< amrex::MultiFab > > > > mri_integrator_mem
Definition: ERF.H:680
void WritePlotFile(int which, amrex::Vector< std::string > plot_var_names)
Definition: ERF_Plotfile.cpp:190
void Evolve()
Definition: ERF.cpp:348
-
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > d_rhotheta_src
Definition: ERF.H:1001
-
amrex::Vector< amrex::MultiFab > pp_inc
Definition: ERF.H:678
-
amrex::Vector< ERFFillPatcher > FPr_u
Definition: ERF.H:735
+
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > d_rhotheta_src
Definition: ERF.H:1005
+
amrex::Vector< amrex::MultiFab > pp_inc
Definition: ERF.H:682
+
amrex::Vector< ERFFillPatcher > FPr_u
Definition: ERF.H:739
amrex::Real cloud_fraction(amrex::Real time)
Definition: ERF_WriteScalarProfiles.cpp:173
-
amrex::Vector< amrex::IntVect > sampleline
Definition: ERF.H:1264
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_q1fx3_lev
Definition: ERF.H:754
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Hwave_onegrid
Definition: ERF.H:791
-
amrex::Vector< amrex::Vector< amrex::MultiFab > > vars_new
Definition: ERF.H:669
+
amrex::Vector< amrex::IntVect > sampleline
Definition: ERF.H:1268
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_q1fx3_lev
Definition: ERF.H:758
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Hwave_onegrid
Definition: ERF.H:795
+
amrex::Vector< amrex::Vector< amrex::MultiFab > > vars_new
Definition: ERF.H:673
ERF(ERF &&) noexcept=delete
-
AMREX_FORCE_INLINE int NumSampleLineLogs() noexcept
Definition: ERF.H:1159
+
AMREX_FORCE_INLINE int NumSampleLineLogs() noexcept
Definition: ERF.H:1163
static void print_tpls(std::ostream &)
Definition: ERF_console_io.cpp:137
-
amrex::Vector< amrex::Real > dz_min
Definition: ERF.H:1065
-
std::string DataLogName(int i) const noexcept
The filename of the ith datalog file.
Definition: ERF.H:1267
-
void WriteGenericPlotfileHeaderWithTerrain(std::ostream &HeaderFile, int nlevels, const amrex::Vector< amrex::BoxArray > &bArray, const amrex::Vector< std::string > &varnames, amrex::Real time, const amrex::Vector< int > &level_steps, const std::string &versionName, const std::string &levelPrefix, const std::string &mfPrefix) const
Definition: ERF_Plotfile.cpp:1586
+
amrex::Vector< amrex::Real > dz_min
Definition: ERF.H:1069
+
std::string DataLogName(int i) const noexcept
The filename of the ith datalog file.
Definition: ERF.H:1271
void remake_zphys(int lev, std::unique_ptr< amrex::MultiFab > &temp_zphys_nd)
Definition: ERF_make_new_arrays.cpp:479
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > thin_yforce
Definition: ERF.H:824
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > thin_yforce
Definition: ERF.H:828
void ErrorEst(int lev, amrex::TagBoxArray &tags, amrex::Real time, int ngrow) override
Definition: ERF_Tagging.cpp:15
-
std::string plot_file_2
Definition: ERF.H:860
+
std::string plot_file_2
Definition: ERF.H:864
void FillBdyCCVels(amrex::Vector< amrex::MultiFab > &mf_cc_vel)
Definition: ERF_FillPatch.cpp:704
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_hfx3_lev
Definition: ERF.H:752
-
amrex::Vector< amrex::Vector< amrex::Real > > h_w_subsid
Definition: ERF.H:1006
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_hfx3_lev
Definition: ERF.H:756
+
amrex::Vector< amrex::Vector< amrex::Real > > h_w_subsid
Definition: ERF.H:1010
static void print_banner(MPI_Comm, std::ostream &)
Definition: ERF_console_io.cpp:60
-
amrex::Vector< std::unique_ptr< std::fstream > > datalog
Definition: ERF.H:1255
-
static amrex::Real sum_per
Definition: ERF.H:952
-
amrex::Vector< ERFFillPatcher > FPr_v
Definition: ERF.H:736
-
int cf_set_width
Definition: ERF.H:733
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > mapfac_u
Definition: ERF.H:782
-
static amrex::Real previousCPUTimeUsed
Definition: ERF.H:1191
+
amrex::Vector< std::unique_ptr< std::fstream > > datalog
Definition: ERF.H:1259
+
static amrex::Real sum_per
Definition: ERF.H:956
+
amrex::Vector< ERFFillPatcher > FPr_v
Definition: ERF.H:740
+
int cf_set_width
Definition: ERF.H:737
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > mapfac_u
Definition: ERF.H:786
+
static amrex::Real previousCPUTimeUsed
Definition: ERF.H:1195
void setPlotVariables(const std::string &pp_plot_var_names, amrex::Vector< std::string > &plot_var_names)
Definition: ERF_Plotfile.cpp:18
-
amrex::Gpu::DeviceVector< amrex::Real > d_havg_temperature
Definition: ERF.H:1043
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau31_lev
Definition: ERF.H:742
-
amrex::Vector< amrex::Vector< amrex::Vector< amrex::Real > > > h_sponge_ptrs
Definition: ERF.H:1028
+
amrex::Gpu::DeviceVector< amrex::Real > d_havg_temperature
Definition: ERF.H:1047
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau31_lev
Definition: ERF.H:746
+
amrex::Vector< amrex::Vector< amrex::Vector< amrex::Real > > > h_sponge_ptrs
Definition: ERF.H:1032
void fill_from_bndryregs(const amrex::Vector< amrex::MultiFab * > &mfs, amrex::Real time)
Definition: ERF_BoundaryConditions_bndryreg.cpp:13
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > mapfac_m
Definition: ERF.H:781
-
void setRecordDataInfo(int i, const std::string &filename)
Definition: ERF.H:1208
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_hfx1_lev
Definition: ERF.H:752
-
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_extdir_vals
Definition: ERF.H:808
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > mapfac_m
Definition: ERF.H:785
+
void setRecordDataInfo(int i, const std::string &filename)
Definition: ERF.H:1212
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_hfx1_lev
Definition: ERF.H:756
+
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_extdir_vals
Definition: ERF.H:812
void project_velocities_tb(int lev, amrex::Real dt, amrex::Vector< amrex::MultiFab > &vars, amrex::MultiFab &p)
Definition: ERF_PoissonSolve_tb.cpp:15
void init_from_input_sounding(int lev)
Definition: ERF_init_from_input_sounding.cpp:49
-
amrex::Gpu::DeviceVector< amrex::Real > d_havg_qv
Definition: ERF.H:1045
-
static amrex::Real column_loc_y
Definition: ERF.H:984
-
static int mg_verbose
Definition: ERF.H:946
-
void ReadParameters()
Definition: ERF.cpp:1386
+
amrex::Gpu::DeviceVector< amrex::Real > d_havg_qv
Definition: ERF.H:1049
+
static amrex::Real column_loc_y
Definition: ERF.H:988
+
static int mg_verbose
Definition: ERF.H:950
+
void ReadParameters()
Definition: ERF.cpp:1390
static amrex::Vector< std::string > PlotFileVarNames(amrex::Vector< std::string > plot_var_names)
Definition: ERF_Plotfile.cpp:178
void InitializeFromFile()
-
amrex::Vector< std::unique_ptr< ERFPhysBCFunct_cons > > physbcs_cons
Definition: ERF.H:681
-
static bool init_sounding_ideal
Definition: ERF.H:977
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > ay_new
Definition: ERF.H:776
+
amrex::Vector< std::unique_ptr< ERFPhysBCFunct_cons > > physbcs_cons
Definition: ERF.H:685
+
static bool init_sounding_ideal
Definition: ERF.H:981
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > ay_new
Definition: ERF.H:780
ERF()
Definition: ERF.cpp:92
void init_Dirichlet_bc_data(const std::string input_file)
Definition: ERF_init_bcs.cpp:611
~ERF() override
-
std::string restart_type
Definition: ERF.H:875
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > z_phys_nd_src
Definition: ERF.H:767
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > detJ_cc
Definition: ERF.H:762
-
amrex::Real m_plot_per_1
Definition: ERF.H:863
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > z_phys_cc
Definition: ERF.H:760
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > eddyDiffs_lev
Definition: ERF.H:744
-
static SolverChoice solverChoice
Definition: ERF.H:914
-
std::string check_type
Definition: ERF.H:874
-
amrex::Vector< ERFFillPatcher > FPr_c
Definition: ERF.H:734
-
amrex::Vector< amrex::MultiFab > base_state_new
Definition: ERF.H:786
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > az
Definition: ERF.H:765
-
int regrid_int
Definition: ERF.H:856
-
amrex::Vector< amrex::Real > fixed_dt
Definition: ERF.H:850
+
std::string restart_type
Definition: ERF.H:879
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > z_phys_nd_src
Definition: ERF.H:771
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > detJ_cc
Definition: ERF.H:766
+
amrex::Real m_plot_per_1
Definition: ERF.H:867
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > z_phys_cc
Definition: ERF.H:764
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > eddyDiffs_lev
Definition: ERF.H:748
+
static SolverChoice solverChoice
Definition: ERF.H:918
+
std::string check_type
Definition: ERF.H:878
+
amrex::Vector< ERFFillPatcher > FPr_c
Definition: ERF.H:738
+
amrex::Vector< amrex::MultiFab > base_state_new
Definition: ERF.H:790
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > az
Definition: ERF.H:769
+
int regrid_int
Definition: ERF.H:860
+
amrex::Vector< amrex::Real > fixed_dt
Definition: ERF.H:854
void write_1D_profiles_stag(amrex::Real time)
Definition: ERF_Write1DProfiles_stag.cpp:23
-
amrex::Vector< amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > > d_sponge_ptrs
Definition: ERF.H:1034
-
amrex::Vector< amrex::Vector< amrex::Real > > h_rhoqt_src
Definition: ERF.H:1003
-
amrex::Vector< long > dt_mri_ratio
Definition: ERF.H:664
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vel_t_avg
Definition: ERF.H:673
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_q2fx3_lev
Definition: ERF.H:755
-
amrex::Vector< amrex::Vector< std::unique_ptr< amrex::iMultiFab > > > lmask_lev
Definition: ERF.H:749
-
amrex::Real stop_time
Definition: ERF.H:839
-
AMREX_FORCE_INLINE int NumSamplePointLogs() noexcept
Definition: ERF.H:1145
-
amrex::Vector< amrex::Real > h_havg_pressure
Definition: ERF.H:1038
+
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, amrex::Real 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:1592
+
amrex::Vector< amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > > d_sponge_ptrs
Definition: ERF.H:1038
+
amrex::Vector< amrex::Vector< amrex::Real > > h_rhoqt_src
Definition: ERF.H:1007
+
amrex::Vector< long > dt_mri_ratio
Definition: ERF.H:668
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vel_t_avg
Definition: ERF.H:677
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_q2fx3_lev
Definition: ERF.H:759
+
amrex::Vector< amrex::Vector< std::unique_ptr< amrex::iMultiFab > > > lmask_lev
Definition: ERF.H:753
+
amrex::Real stop_time
Definition: ERF.H:843
+
AMREX_FORCE_INLINE int NumSamplePointLogs() noexcept
Definition: ERF.H:1149
+
amrex::Vector< amrex::Real > h_havg_pressure
Definition: ERF.H:1042
void update_diffusive_arrays(int lev, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm)
Definition: ERF_make_new_arrays.cpp:351
-
static int verbose
Definition: ERF.H:945
-
amrex::Vector< amrex::Real > h_havg_qc
Definition: ERF.H:1040
-
amrex::Vector< std::unique_ptr< ERFPhysBCFunct_w > > physbcs_w
Definition: ERF.H:684
+
static int verbose
Definition: ERF.H:949
+
amrex::Vector< amrex::Real > h_havg_qc
Definition: ERF.H:1044
+
amrex::Vector< std::unique_ptr< ERFPhysBCFunct_w > > physbcs_w
Definition: ERF.H:688
void Advance(int lev, amrex::Real time, amrex::Real dt_lev, int iteration, int ncycle)
Definition: ERF_Advance.cpp:20
-
static std::string column_file_name
Definition: ERF.H:985
-
amrex::Vector< std::unique_ptr< std::fstream > > samplelinelog
Definition: ERF.H:1262
-
std::unique_ptr< Microphysics > micro
Definition: ERF.H:700
-
amrex::Vector< amrex::MultiFab > base_state
Definition: ERF.H:785
-
AMREX_FORCE_INLINE amrex::YAFluxRegister * getAdvFluxReg(int lev)
Definition: ERF.H:1117
-
amrex::Vector< amrex::Real > h_havg_density
Definition: ERF.H:1036
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > z_phys_nd_new
Definition: ERF.H:773
-
amrex::Vector< amrex::Real > fixed_fast_dt
Definition: ERF.H:851
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Qv_prim
Definition: ERF.H:689
-
static int sum_interval
Definition: ERF.H:950
-
static int pert_interval
Definition: ERF.H:951
+
static std::string column_file_name
Definition: ERF.H:989
+
amrex::Vector< std::unique_ptr< std::fstream > > samplelinelog
Definition: ERF.H:1266
+
std::unique_ptr< Microphysics > micro
Definition: ERF.H:704
+
amrex::Vector< amrex::MultiFab > base_state
Definition: ERF.H:789
+
AMREX_FORCE_INLINE amrex::YAFluxRegister * getAdvFluxReg(int lev)
Definition: ERF.H:1121
+
amrex::Vector< amrex::Real > h_havg_density
Definition: ERF.H:1040
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > z_phys_nd_new
Definition: ERF.H:777
+
amrex::Vector< amrex::Real > fixed_fast_dt
Definition: ERF.H:855
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Qv_prim
Definition: ERF.H:693
+
static int sum_interval
Definition: ERF.H:954
+
static int pert_interval
Definition: ERF.H:955
void restart()
Definition: ERF.cpp:1247
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau13_lev
Definition: ERF.H:742
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_q1fx2_lev
Definition: ERF.H:754
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau13_lev
Definition: ERF.H:746
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_q1fx2_lev
Definition: ERF.H:758
void ReadCheckpointFileMOST()
Definition: ERF_Checkpoint.cpp:567
void FillIntermediatePatch(int lev, amrex::Real 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, bool allow_most_bcs=true)
Definition: ERF_FillPatch.cpp:308
-
amrex::IntVect & SampleLine(int i)
Definition: ERF.H:1178
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau21_lev
Definition: ERF.H:741
-
amrex::Vector< amrex::MultiFab > rV_new
Definition: ERF.H:696
+
amrex::IntVect & SampleLine(int i)
Definition: ERF.H:1182
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau21_lev
Definition: ERF.H:745
+
amrex::Vector< amrex::MultiFab > rV_new
Definition: ERF.H:700
std::string PlotFileName(int lev) const
void write_1D_profiles(amrex::Real time)
Definition: ERF_Write1DProfiles.cpp:15
void initialize_integrator(int lev, amrex::MultiFab &cons_mf, amrex::MultiFab &vel_mf)
Definition: ERF_make_new_arrays.cpp:516
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > thin_zforce
Definition: ERF.H:825
-
amrex::Vector< amrex::BCRec > domain_bcs_type
Definition: ERF.H:801
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > thin_zforce
Definition: ERF.H:829
+
amrex::Vector< amrex::BCRec > domain_bcs_type
Definition: ERF.H:805
amrex::Array< amrex::LinOpBCType, AMREX_SPACEDIM > get_projection_bc(amrex::Orientation::Side side) const noexcept
Definition: ERF_PoissonSolve.cpp:19
-
int m_plot_int_1
Definition: ERF.H:861
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Qr_prim
Definition: ERF.H:690
+
int m_plot_int_1
Definition: ERF.H:865
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Qr_prim
Definition: ERF.H:694
void post_timestep(int nstep, amrex::Real time, amrex::Real dt_lev)
Definition: ERF.cpp:435
-
std::string pp_prefix
Definition: ERF.H:391
-
std::string SampleLineLogName(int i) const noexcept
The filename of the ith samplelinelog file.
Definition: ERF.H:1273
-
amrex::Vector< amrex::Vector< std::unique_ptr< amrex::MultiFab > > > sst_lev
Definition: ERF.H:748
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > thin_xforce
Definition: ERF.H:823
-
AMREX_FORCE_INLINE int NumSamplePoints() noexcept
Definition: ERF.H:1172
-
static amrex::Real bndry_output_planes_per
Definition: ERF.H:990
-
amrex::Real m_check_per
Definition: ERF.H:877
+
std::string pp_prefix
Definition: ERF.H:395
+
std::string SampleLineLogName(int i) const noexcept
The filename of the ith samplelinelog file.
Definition: ERF.H:1277
+
amrex::Vector< amrex::Vector< std::unique_ptr< amrex::MultiFab > > > sst_lev
Definition: ERF.H:752
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > thin_xforce
Definition: ERF.H:827
+
AMREX_FORCE_INLINE int NumSamplePoints() noexcept
Definition: ERF.H:1176
+
static amrex::Real bndry_output_planes_per
Definition: ERF.H:994
+
amrex::Real m_check_per
Definition: ERF.H:881
void init_custom(int lev)
Definition: ERF_init_custom.cpp:26
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau33_lev
Definition: ERF.H:740
-
std::unique_ptr< ProblemBase > prob
Definition: ERF.H:651
-
amrex::Vector< int > num_files_at_level
Definition: ERF.H:654
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau33_lev
Definition: ERF.H:744
+
std::unique_ptr< ProblemBase > prob
Definition: ERF.H:655
+
amrex::Vector< int > num_files_at_level
Definition: ERF.H:658
+
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, amrex::Real 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:1505
void init_bcs()
Definition: ERF_init_bcs.cpp:20
-
int profile_int
Definition: ERF.H:869
+
int profile_int
Definition: ERF.H:873
void init_immersed_body(int lev, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm)
Definition: ERF_make_new_level.cpp:469
-
amrex::Vector< std::unique_ptr< ERFPhysBCFunct_u > > physbcs_u
Definition: ERF.H:682
-
amrex::Vector< amrex::Real > t_new
Definition: ERF.H:661
-
bool destag_profiles
Definition: ERF.H:870
-
amrex::Vector< amrex::Real > t_avg_cnt
Definition: ERF.H:674
-
amrex::Vector< std::string > plot_var_names_1
Definition: ERF.H:879
-
int m_check_int
Definition: ERF.H:876
+
amrex::Vector< std::unique_ptr< ERFPhysBCFunct_u > > physbcs_u
Definition: ERF.H:686
+
amrex::Vector< amrex::Real > t_new
Definition: ERF.H:665
+
bool destag_profiles
Definition: ERF.H:874
+
amrex::Vector< amrex::Real > t_avg_cnt
Definition: ERF.H:678
+
amrex::Vector< std::string > plot_var_names_1
Definition: ERF.H:883
+
int m_check_int
Definition: ERF.H:880
amrex::Real estTimeStep(int lev, long &dt_fast_ratio) const
Definition: ERF_ComputeTimestep.cpp:55
-
static std::string sponge_type
Definition: ERF.H:961
-
static amrex::Real startCPUTime
Definition: ERF.H:1190
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_diss_lev
Definition: ERF.H:753
-
amrex::Vector< amrex::MultiFab > rU_old
Definition: ERF.H:693
-
amrex::Vector< amrex::Real > t_old
Definition: ERF.H:662
-
AMREX_FORCE_INLINE int NumSampleLines() noexcept
Definition: ERF.H:1185
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Theta_prim
Definition: ERF.H:688
+
static std::string sponge_type
Definition: ERF.H:965
+
static amrex::Real startCPUTime
Definition: ERF.H:1194
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_diss_lev
Definition: ERF.H:757
+
amrex::Vector< amrex::MultiFab > rU_old
Definition: ERF.H:697
+
amrex::Vector< amrex::Real > t_old
Definition: ERF.H:666
+
AMREX_FORCE_INLINE int NumSampleLines() noexcept
Definition: ERF.H:1189
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Theta_prim
Definition: ERF.H:692
void init1DArrays()
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > z_t_rk
Definition: ERF.H:779
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > z_t_rk
Definition: ERF.H:783
void fill_rhs(amrex::MultiFab &rhs_mf, const amrex::MultiFab &state_mf, amrex::Real time, const amrex::Geometry &geom)
void appendPlotVariables(const std::string &pp_plot_var_names, amrex::Vector< std::string > &plot_var_names)
Definition: ERF_Plotfile.cpp:132
-
amrex::Vector< std::unique_ptr< ERFPhysBCFunct_v > > physbcs_v
Definition: ERF.H:683
-
amrex::Vector< std::string > plot_var_names_2
Definition: ERF.H:880
-
static amrex::Real column_per
Definition: ERF.H:982
-
static int output_bndry_planes
Definition: ERF.H:988
-
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > d_v_geos
Definition: ERF.H:1013
-
int last_plot_file_step_1
Definition: ERF.H:827
+
amrex::Vector< std::unique_ptr< ERFPhysBCFunct_v > > physbcs_v
Definition: ERF.H:687
+
amrex::Vector< std::string > plot_var_names_2
Definition: ERF.H:884
+
static amrex::Real column_per
Definition: ERF.H:986
+
static int output_bndry_planes
Definition: ERF.H:992
+
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > d_v_geos
Definition: ERF.H:1017
+
int last_plot_file_step_1
Definition: ERF.H:831
void update_terrain_arrays(int lev)
Definition: ERF_make_new_arrays.cpp:506
-
static std::string nc_bdy_file
Definition: ERF.H:971
-
static amrex::Vector< amrex::Vector< std::string > > nc_init_file
Definition: ERF.H:968
+
static std::string nc_bdy_file
Definition: ERF.H:975
+
static amrex::Vector< amrex::Vector< std::string > > nc_init_file
Definition: ERF.H:972
void init_only(int lev, amrex::Real time)
Definition: ERF.cpp:1278
-
static int input_bndry_planes
Definition: ERF.H:994
-
amrex::Gpu::DeviceVector< amrex::Real > d_havg_qc
Definition: ERF.H:1046
-
void AverageDown()
Definition: ERF.cpp:1823
-
amrex::Vector< amrex::Vector< amrex::Real > > h_v_geos
Definition: ERF.H:1012
+
static int input_bndry_planes
Definition: ERF.H:998
+
amrex::Gpu::DeviceVector< amrex::Real > d_havg_qc
Definition: ERF.H:1050
+
void AverageDown()
Definition: ERF.cpp:1827
+
amrex::Vector< amrex::Vector< amrex::Real > > h_v_geos
Definition: ERF.H:1016
bool projection_has_dirichlet(amrex::Array< amrex::LinOpBCType, AMREX_SPACEDIM > bcs) const
Definition: ERF_PoissonSolve.cpp:37
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Lwave_onegrid
Definition: ERF.H:792
-
InputSoundingData input_sounding_data
Definition: ERF.H:611
-
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > d_rhoqt_src
Definition: ERF.H:1004
-
amrex::MultiFab fine_mask
Definition: ERF.H:1063
-
amrex::Gpu::DeviceVector< amrex::Real > d_havg_density
Definition: ERF.H:1042
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Lwave_onegrid
Definition: ERF.H:796
+
InputSoundingData input_sounding_data
Definition: ERF.H:615
+
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > d_rhoqt_src
Definition: ERF.H:1008
+
amrex::MultiFab fine_mask
Definition: ERF.H:1067
+
amrex::Gpu::DeviceVector< amrex::Real > d_havg_density
Definition: ERF.H:1046
void init_from_hse(int lev)
Definition: ERF_init_from_hse.cpp:34
-
static bool use_real_bcs
Definition: ERF.H:965
-
amrex::Vector< amrex::YAFluxRegister * > advflux_reg
Definition: ERF.H:796
-
amrex::Vector< amrex::Vector< amrex::Real > > h_rhotheta_src
Definition: ERF.H:1000
-
static int ng_pres_hse
Definition: ERF.H:997
-
static amrex::Real bndry_output_planes_start_time
Definition: ERF.H:991
-
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, amrex::Real time, const amrex::Vector< int > &level_steps, 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:1501
-
static amrex::Real cfl
Definition: ERF.H:845
-
amrex::Gpu::DeviceVector< amrex::BCRec > domain_bcs_type_d
Definition: ERF.H:802
+
static bool use_real_bcs
Definition: ERF.H:969
+
amrex::Vector< amrex::YAFluxRegister * > advflux_reg
Definition: ERF.H:800
+
amrex::Vector< amrex::Vector< amrex::Real > > h_rhotheta_src
Definition: ERF.H:1004
+
static int ng_pres_hse
Definition: ERF.H:1001
+
static amrex::Real bndry_output_planes_start_time
Definition: ERF.H:995
+
static amrex::Real cfl
Definition: ERF.H:849
+
amrex::Gpu::DeviceVector< amrex::BCRec > domain_bcs_type_d
Definition: ERF.H:806
void derive_diag_profiles_stag(amrex::Real 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:298
-
InputSpongeData input_sponge_data
Definition: ERF.H:614
+
InputSpongeData input_sponge_data
Definition: ERF.H:618
void FillPatch(int lev, amrex::Real time, const amrex::Vector< amrex::MultiFab * > &mfs_vel, const amrex::Vector< amrex::MultiFab * > &mfs_mom, bool fillset=true, bool cons_only=false)
Definition: ERF_FillPatch.cpp:22
-
std::string restart_chkfile
Definition: ERF.H:842
+
std::string restart_chkfile
Definition: ERF.H:846
void init_zphys(int lev, amrex::Real time)
Definition: ERF_make_new_arrays.cpp:441
-
amrex::Vector< std::string > sampleptlogname
Definition: ERF.H:1259
-
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > xvel_bc_data
Definition: ERF.H:617
+
amrex::Vector< std::string > sampleptlogname
Definition: ERF.H:1263
+
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > xvel_bc_data
Definition: ERF.H:621
void InitData_pre()
Definition: ERF.cpp:587
-
amrex::IntVect & SamplePoint(int i)
Definition: ERF.H:1165
-
amrex::Vector< amrex::Vector< amrex::Real > > h_u_geos
Definition: ERF.H:1009
+
amrex::IntVect & SamplePoint(int i)
Definition: ERF.H:1169
+
amrex::Vector< amrex::Vector< amrex::Real > > h_u_geos
Definition: ERF.H:1013
void InitializeLevelFromData(int lev, const amrex::MultiFab &initial_data)
void sum_integrated_quantities(amrex::Real time)
Definition: ERF_WriteScalarProfiles.cpp:14
-
amrex::Vector< std::string > datalogname
Definition: ERF.H:1256
+
amrex::Vector< std::string > datalogname
Definition: ERF.H:1260
void initHSE()
Initialize HSE.
Definition: ERF_init1d.cpp:130
-
static amrex::Real column_loc_x
Definition: ERF.H:983
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > ax
Definition: ERF.H:763
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > z_phys_nd
Definition: ERF.H:759
-
void MakeDiagnosticAverage(amrex::Vector< amrex::Real > &h_havg, amrex::MultiFab &S, int n)
Definition: ERF.cpp:1776
-
amrex::Vector< amrex::Real > h_havg_temperature
Definition: ERF.H:1037
-
amrex::Vector< std::unique_ptr< std::fstream > > sampleptlog
Definition: ERF.H:1258
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > detJ_cc_src
Definition: ERF.H:768
-
amrex::Gpu::DeviceVector< amrex::Real > d_havg_pressure
Definition: ERF.H:1044
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SmnSmn_lev
Definition: ERF.H:745
-
const amrex::Vector< std::string > derived_names
Definition: ERF.H:886
-
amrex::Real start_time
Definition: ERF.H:838
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > ay_src
Definition: ERF.H:770
+
static amrex::Real column_loc_x
Definition: ERF.H:987
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > ax
Definition: ERF.H:767
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > z_phys_nd
Definition: ERF.H:763
+
void MakeDiagnosticAverage(amrex::Vector< amrex::Real > &h_havg, amrex::MultiFab &S, int n)
Definition: ERF.cpp:1780
+
amrex::Vector< amrex::Real > h_havg_temperature
Definition: ERF.H:1041
+
amrex::Vector< std::unique_ptr< std::fstream > > sampleptlog
Definition: ERF.H:1262
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > detJ_cc_src
Definition: ERF.H:772
+
amrex::Gpu::DeviceVector< amrex::Real > d_havg_pressure
Definition: ERF.H:1048
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SmnSmn_lev
Definition: ERF.H:749
+
const amrex::Vector< std::string > derived_names
Definition: ERF.H:890
+
amrex::Real start_time
Definition: ERF.H:842
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > ay_src
Definition: ERF.H:774
void sample_points(int lev, amrex::Real time, amrex::IntVect cell, amrex::MultiFab &mf)
Definition: ERF_WriteScalarProfiles.cpp:249
-
AMREX_FORCE_INLINE std::ostream & DataLog(int i)
Definition: ERF.H:1124
+
AMREX_FORCE_INLINE std::ostream & DataLog(int i)
Definition: ERF.H:1128
void writeJobInfo(const std::string &dir) const
Definition: ERF_writeJobInfo.cpp:9
void ComputeDt(int step=-1)
Definition: ERF_ComputeTimestep.cpp:11
-
amrex::Vector< int > nsubsteps
Definition: ERF.H:658
-
amrex::Vector< std::unique_ptr< amrex::iMultiFab > > yflux_imask
Definition: ERF.H:818
-
amrex::Vector< amrex::MultiFab > rW_new
Definition: ERF.H:698
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > az_new
Definition: ERF.H:777
-
std::unique_ptr< WriteBndryPlanes > m_w2d
Definition: ERF.H:1050
-
std::string plot_file_1
Definition: ERF.H:859
-
AMREX_FORCE_INLINE std::ostream & SampleLineLog(int i)
Definition: ERF.H:1152
-
amrex::Vector< amrex::Vector< amrex::MultiFab * > > lsm_flux
Definition: ERF.H:718
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau32_lev
Definition: ERF.H:743
-
std::string SamplePointLogName(int i) const noexcept
The filename of the ith sampleptlog file.
Definition: ERF.H:1270
+
amrex::Vector< int > nsubsteps
Definition: ERF.H:662
+
amrex::Vector< std::unique_ptr< amrex::iMultiFab > > yflux_imask
Definition: ERF.H:822
+
amrex::Vector< amrex::MultiFab > rW_new
Definition: ERF.H:702
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > az_new
Definition: ERF.H:781
+
std::unique_ptr< WriteBndryPlanes > m_w2d
Definition: ERF.H:1054
+
std::string plot_file_1
Definition: ERF.H:863
+
AMREX_FORCE_INLINE std::ostream & SampleLineLog(int i)
Definition: ERF.H:1156
+
amrex::Vector< amrex::Vector< amrex::MultiFab * > > lsm_flux
Definition: ERF.H:722
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau32_lev
Definition: ERF.H:747
+
std::string SamplePointLogName(int i) const noexcept
The filename of the ith sampleptlog file.
Definition: ERF.H:1274
void turbPert_update(const int lev, const amrex::Real dt)
Definition: ERF_init_TurbPert.cpp:15
void InitData_post()
Definition: ERF.cpp:628
void refinement_criteria_setup()
Definition: ERF_Tagging.cpp:105
-
static int bndry_output_planes_interval
Definition: ERF.H:989
+
static int bndry_output_planes_interval
Definition: ERF.H:993
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_init_geowind.cpp:15
void ERF_shared()
Definition: ERF.cpp:98
void RemakeLevel(int lev, amrex::Real time, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm) override
Definition: ERF_make_new_level.cpp:284
@@ -1654,111 +1658,111 @@
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_make_new_arrays.cpp:23
void initSponge()
Initialize sponge profiles.
Definition: ERF_init_sponge.cpp:35
void derive_diag_profiles(amrex::Real 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:192
-
int real_width
Definition: ERF.H:972
+
int real_width
Definition: ERF.H:976
void MakeNewLevelFromCoarse(int lev, amrex::Real time, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm) override
Definition: ERF_make_new_level.cpp:177
-
amrex::Vector< std::unique_ptr< amrex::FabFactory< amrex::FArrayBox > > > m_factory
Definition: ERF.H:1275
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > ax_src
Definition: ERF.H:769
+
amrex::Vector< std::unique_ptr< amrex::FabFactory< amrex::FArrayBox > > > m_factory
Definition: ERF.H:1279
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > ax_src
Definition: ERF.H:773
void input_sponge(int lev)
Definition: ERF_init_sponge.cpp:17
-
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > d_u_geos
Definition: ERF.H:1010
-
void Define_ERFFillPatchers(int lev)
Definition: ERF.cpp:1957
-
AMREX_FORCE_INLINE int NumDataLogs() noexcept
Definition: ERF.H:1131
-
TurbulentPerturbation turbPert
Definition: ERF.H:917
-
amrex::Vector< amrex::MultiFab > rW_old
Definition: ERF.H:697
+
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > d_u_geos
Definition: ERF.H:1014
+
void Define_ERFFillPatchers(int lev)
Definition: ERF.cpp:1961
+
AMREX_FORCE_INLINE int NumDataLogs() noexcept
Definition: ERF.H:1135
+
TurbulentPerturbation turbPert
Definition: ERF.H:921
+
amrex::Vector< amrex::MultiFab > rW_old
Definition: ERF.H:701
void advance_lsm(int lev, amrex::MultiFab &, const amrex::Real &dt_advance)
Definition: ERF_advance_lsm.cpp:5
void FillCoarsePatch(int lev, amrex::Real time)
Definition: ERF_FillPatch.cpp:581
void ClearLevel(int lev) override
Definition: ERF_make_new_level.cpp:434
-
static bool use_heffte
Definition: ERF.H:947
-
static amrex::Vector< amrex::AMRErrorTag > ref_tags
Definition: ERF.H:1057
+
static bool use_heffte
Definition: ERF.H:951
+
static amrex::Vector< amrex::AMRErrorTag > ref_tags
Definition: ERF.H:1061
void make_physbcs(int lev)
Definition: ERF_make_new_arrays.cpp:538
-
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > d_w_subsid
Definition: ERF.H:1007
-
amrex::Vector< ERFFillPatcher > FPr_w
Definition: ERF.H:737
-
int real_set_width
Definition: ERF.H:973
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_hfx2_lev
Definition: ERF.H:752
-
amrex::Vector< amrex::Vector< amrex::Real > > zlevels_stag
Definition: ERF.H:758
-
amrex::Vector< amrex::Vector< amrex::MultiFab * > > lsm_data
Definition: ERF.H:717
+
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > d_w_subsid
Definition: ERF.H:1011
+
amrex::Vector< ERFFillPatcher > FPr_w
Definition: ERF.H:741
+
int real_set_width
Definition: ERF.H:977
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_hfx2_lev
Definition: ERF.H:756
+
amrex::Vector< amrex::Vector< amrex::Real > > zlevels_stag
Definition: ERF.H:762
+
amrex::Vector< amrex::Vector< amrex::MultiFab * > > lsm_data
Definition: ERF.H:721
void WriteCheckpointFile() const
Definition: ERF_Checkpoint.cpp:25
-
static int output_1d_column
Definition: ERF.H:980
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > az_src
Definition: ERF.H:771
-
static int fixed_mri_dt_ratio
Definition: ERF.H:852
-
int m_plot_int_2
Definition: ERF.H:862
-
amrex::Vector< amrex::Real > dt
Definition: ERF.H:663
-
static amrex::Real init_shrink
Definition: ERF.H:846
+
static int output_1d_column
Definition: ERF.H:984
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > az_src
Definition: ERF.H:775
+
static int fixed_mri_dt_ratio
Definition: ERF.H:856
+
int m_plot_int_2
Definition: ERF.H:866
+
amrex::Vector< amrex::Real > dt
Definition: ERF.H:667
+
static amrex::Real init_shrink
Definition: ERF.H:850
static bool is_it_time_for_action(int nstep, amrex::Real time, amrex::Real dt, int action_interval, amrex::Real action_per)
Definition: ERF_WriteScalarProfiles.cpp:464
-
amrex::Vector< amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > > d_rayleigh_ptrs
Definition: ERF.H:1031
+
amrex::Vector< amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > > d_rayleigh_ptrs
Definition: ERF.H:1035
void InitData()
Definition: ERF.cpp:567
void advance_microphysics(int lev, amrex::MultiFab &cons_in, const amrex::Real &dt_advance, const int &iteration, const amrex::Real &time)
Definition: ERF_advance_microphysics.cpp:5
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Lwave
Definition: ERF.H:790
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Lwave
Definition: ERF.H:794
void project_velocities(int lev, amrex::Real dt, amrex::Vector< amrex::MultiFab > &vars, amrex::MultiFab &p)
Definition: ERF_PoissonSolve.cpp:50
-
void ParameterSanityChecks()
Definition: ERF.cpp:1585
+
void ParameterSanityChecks()
Definition: ERF.cpp:1589
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:487
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau12_lev
Definition: ERF.H:741
-
int cf_width
Definition: ERF.H:732
-
amrex::Vector< amrex::Vector< amrex::Vector< amrex::Real > > > h_rayleigh_ptrs
Definition: ERF.H:1025
-
amrex::Vector< std::unique_ptr< amrex::iMultiFab > > zflux_imask
Definition: ERF.H:819
-
int plot_file_on_restart
Definition: ERF.H:831
-
void Construct_ERFFillPatchers(int lev)
Definition: ERF.cpp:1931
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau12_lev
Definition: ERF.H:745
+
int cf_width
Definition: ERF.H:736
+
amrex::Vector< amrex::Vector< amrex::Vector< amrex::Real > > > h_rayleigh_ptrs
Definition: ERF.H:1029
+
amrex::Vector< std::unique_ptr< amrex::iMultiFab > > zflux_imask
Definition: ERF.H:823
+
int plot_file_on_restart
Definition: ERF.H:835
+
void Construct_ERFFillPatchers(int lev)
Definition: ERF.cpp:1935
void post_update(amrex::MultiFab &state_mf, amrex::Real time, const amrex::Geometry &geom)
-
amrex::Vector< int > num_boxes_at_level
Definition: ERF.H:653
+
amrex::Vector< int > num_boxes_at_level
Definition: ERF.H:657
void erf_enforce_hse(int lev, amrex::MultiFab &dens, amrex::MultiFab &pres, amrex::MultiFab &pi, std::unique_ptr< amrex::MultiFab > &z_cc)
Definition: ERF_init1d.cpp:149
-
amrex::FabFactory< amrex::FArrayBox > const & Factory(int lev) const noexcept
Definition: ERF.H:1278
+
amrex::FabFactory< amrex::FArrayBox > const & Factory(int lev) const noexcept
Definition: ERF.H:1282
static void print_error(MPI_Comm, const std::string &msg)
Definition: ERF_console_io.cpp:43
-
static int ng_dens_hse
Definition: ERF.H:996
-
std::unique_ptr< ReadBndryPlanes > m_r2d
Definition: ERF.H:1051
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > ay
Definition: ERF.H:764
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > ax_new
Definition: ERF.H:775
-
amrex::Vector< amrex::Vector< amrex::MultiFab * > > qmoist
Definition: ERF.H:701
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_q1fx1_lev
Definition: ERF.H:754
-
static amrex::Real getCPUTime()
Definition: ERF.H:1194
-
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > zvel_bc_data
Definition: ERF.H:619
+
static int ng_dens_hse
Definition: ERF.H:1000
+
std::unique_ptr< ReadBndryPlanes > m_r2d
Definition: ERF.H:1055
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > ay
Definition: ERF.H:768
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > ax_new
Definition: ERF.H:779
+
amrex::Vector< amrex::Vector< amrex::MultiFab * > > qmoist
Definition: ERF.H:705
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_q1fx1_lev
Definition: ERF.H:758
+
static amrex::Real getCPUTime()
Definition: ERF.H:1198
+
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > zvel_bc_data
Definition: ERF.H:623
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:607
-
LandSurface lsm
Definition: ERF.H:716
-
static amrex::Real change_max
Definition: ERF.H:847
-
void AverageDownTo(int crse_lev, int scomp, int ncomp)
Definition: ERF.cpp:1836
-
void setRecordSampleLineInfo(int i, int lev, amrex::IntVect &cell, const std::string &filename)
Definition: ERF.H:1238
+
LandSurface lsm
Definition: ERF.H:720
+
static amrex::Real change_max
Definition: ERF.H:851
+
void AverageDownTo(int crse_lev, int scomp, int ncomp)
Definition: ERF.cpp:1840
+
void setRecordSampleLineInfo(int i, int lev, amrex::IntVect &cell, const std::string &filename)
Definition: ERF.H:1242
void setSpongeRefFromSounding(bool restarting)
Set sponge mean profiles from input sounding.
Definition: ERF_init_sponge.cpp:65
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > detJ_cc_new
Definition: ERF.H:774
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > mapfac_v
Definition: ERF.H:783
-
amrex::Array< std::string, 2 *AMREX_SPACEDIM > domain_bc_type
Definition: ERF.H:805
-
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > yvel_bc_data
Definition: ERF.H:618
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > detJ_cc_new
Definition: ERF.H:778
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > mapfac_v
Definition: ERF.H:787
+
amrex::Array< std::string, 2 *AMREX_SPACEDIM > domain_bc_type
Definition: ERF.H:809
+
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > yvel_bc_data
Definition: ERF.H:622
void init_uniform(int lev)
Definition: ERF_init_uniform.cpp:17
-
static AMREX_FORCE_INLINE int ComputeGhostCells(const AdvChoice &advChoice, bool use_num_diff)
Definition: ERF.H:1069
+
static AMREX_FORCE_INLINE int ComputeGhostCells(const AdvChoice &advChoice, bool use_num_diff)
Definition: ERF.H:1073
static void writeBuildInfo(std::ostream &os)
Definition: ERF_writeJobInfo.cpp:137
-
amrex::GpuArray< ERF_BC, AMREX_SPACEDIM *2 > phys_bc_type
Definition: ERF.H:814
-
std::string check_file
Definition: ERF.H:873
-
static std::string plotfile_type
Definition: ERF.H:955
-
amrex::Vector< amrex::IntVect > samplepoint
Definition: ERF.H:1260
-
amrex::Vector< amrex::Real > h_havg_qv
Definition: ERF.H:1039
+
amrex::GpuArray< ERF_BC, AMREX_SPACEDIM *2 > phys_bc_type
Definition: ERF.H:818
+
std::string check_file
Definition: ERF.H:877
+
static std::string plotfile_type
Definition: ERF.H:959
+
amrex::Vector< amrex::IntVect > samplepoint
Definition: ERF.H:1264
+
amrex::Vector< amrex::Real > h_havg_qv
Definition: ERF.H:1043
amrex::Real volWgtSumMF(int lev, const amrex::MultiFab &mf, int comp, const amrex::MultiFab &mapfac, bool local, bool finemask)
Definition: ERF_WriteScalarProfiles.cpp:378
static void print_usage(MPI_Comm, std::ostream &)
Definition: ERF_console_io.cpp:26
-
amrex::Vector< amrex::MultiFab > rV_old
Definition: ERF.H:695
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau11_lev
Definition: ERF.H:740
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Hwave
Definition: ERF.H:789
-
amrex::Vector< int > istep
Definition: ERF.H:657
-
amrex::Vector< std::unique_ptr< amrex::iMultiFab > > xflux_imask
Definition: ERF.H:817
+
amrex::Vector< amrex::MultiFab > rV_old
Definition: ERF.H:699
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau11_lev
Definition: ERF.H:744
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Hwave
Definition: ERF.H:793
+
amrex::Vector< int > istep
Definition: ERF.H:661
+
amrex::Vector< std::unique_ptr< amrex::iMultiFab > > xflux_imask
Definition: ERF.H:821
void derive_upwp(amrex::Vector< amrex::Real > &h_havg)
-
bool finished_wave
Definition: ERF.H:793
+
bool finished_wave
Definition: ERF.H:797
void ReadCheckpointFile()
Definition: ERF_Checkpoint.cpp:264
-
bool writeNow(const amrex::Real cur_time, const amrex::Real dt, const int nstep, const int plot_int, const amrex::Real plot_per)
Definition: ERF.cpp:2088
-
amrex::Vector< amrex::Vector< amrex::MultiFab > > vars_old
Definition: ERF.H:670
+
bool writeNow(const amrex::Real cur_time, const amrex::Real dt, const int nstep, const int plot_int, const amrex::Real plot_per)
Definition: ERF.cpp:2092
+
amrex::Vector< amrex::Vector< amrex::MultiFab > > vars_old
Definition: ERF.H:674
amrex::MultiFab & build_fine_mask(int lev)
Definition: ERF_WriteScalarProfiles.cpp:427
-
amrex::Vector< std::unique_ptr< ERFPhysBCFunct_base > > physbcs_base
Definition: ERF.H:685
-
static std::string init_type
Definition: ERF.H:958
-
AMREX_FORCE_INLINE std::ostream & SamplePointLog(int i)
Definition: ERF.H:1138
-
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_neumann_vals
Definition: ERF.H:811
+
amrex::Vector< std::unique_ptr< ERFPhysBCFunct_base > > physbcs_base
Definition: ERF.H:689
+
static std::string init_type
Definition: ERF.H:962
+
AMREX_FORCE_INLINE std::ostream & SamplePointLog(int i)
Definition: ERF.H:1142
+
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_neumann_vals
Definition: ERF.H:815
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::Geometry fine_geom, amrex::Real dt, amrex::Real time)
Definition: ERF_advance_dycore.cpp:37
-
void setRecordSamplePointInfo(int i, int lev, amrex::IntVect &cell, const std::string &filename)
Definition: ERF.H:1221
-
static int column_interval
Definition: ERF.H:981
+
void setRecordSamplePointInfo(int i, int lev, amrex::IntVect &cell, const std::string &filename)
Definition: ERF.H:1225
+
static int column_interval
Definition: ERF.H:985
static void print_summary(std::ostream &)
void solve_with_heffte(int lev, amrex::MultiFab &rhs, amrex::MultiFab &soln, amrex::Array< amrex::MultiFab, AMREX_SPACEDIM > &fluxes)
void FillPatchMoistVars(int lev, amrex::MultiFab &mf)
Definition: ERF_FillPatch.cpp:267
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau22_lev
Definition: ERF.H:740
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau22_lev
Definition: ERF.H:744
void turbPert_amplitude(const int lev)
Definition: ERF_init_TurbPert.cpp:44
void sample_lines(int lev, amrex::Real time, amrex::IntVect cell, amrex::MultiFab &mf)
Definition: ERF_WriteScalarProfiles.cpp:287
void initializeMicrophysics(const int &)
Definition: ERF.cpp:1211
-
bool plot_lsm
Definition: ERF.H:866
-
const amrex::Vector< std::string > cons_names
Definition: ERF.H:881
+
bool plot_lsm
Definition: ERF.H:870
+
const amrex::Vector< std::string > cons_names
Definition: ERF.H:885
void timeStep(int lev, amrex::Real time, int iteration)
Definition: ERF_TimeStep.cpp:16
-
amrex::Real m_plot_per_2
Definition: ERF.H:864
+
amrex::Real m_plot_per_2
Definition: ERF.H:868
Definition: ERF_LandSurface.H:10
Definition: ERF_MultiBlockContainer.H:8
Definition: ERF_Radiation.H:36
diff --git a/ERF__init__from__input__sounding_8cpp.html b/ERF__init__from__input__sounding_8cpp.html index 9d9c63f09..10982af9d 100644 --- a/ERF__init__from__input__sounding_8cpp.html +++ b/ERF__init__from__input__sounding_8cpp.html @@ -220,45 +220,45 @@

140 {
-
141  const Real* z_inp_sound = inputSoundingData.z_inp_sound_d[0].dataPtr();
-
142  const Real* theta_inp_sound = inputSoundingData.theta_inp_sound_d[0].dataPtr();
-
143  const Real* qv_inp_sound = inputSoundingData.qv_inp_sound_d[0].dataPtr();
-
144  const int inp_sound_size = inputSoundingData.size(0);
-
145 
-
146  // Geometry
-
147  const Real* prob_lo = geomdata.ProbLo();
-
148  const Real* dx = geomdata.CellSize();
-
149  const Real z_lo = prob_lo[2];
-
150  const Real dz = dx[2];
-
151 
-
152  // We want to set the lateral BC values, too
-
153  Box gbx = bx; // Copy constructor
-
154  gbx.grow(0,1); gbx.grow(1,1); // Grow by one in the lateral directions
-
155 
-
156  ParallelFor(gbx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
-
157  const Real z = (z_cc_arr) ? z_cc_arr(i,j,k)
-
158  : z_lo + (k + 0.5) * dz;
-
159 
-
160  Real rho_0 = 1.0;
-
161 
-
162  // Set the density
-
163  state(i, j, k, Rho_comp) = rho_0;
-
164 
-
165  // Initial Rho0*Theta0
-
166  state(i, j, k, RhoTheta_comp) = rho_0 * interpolate_1d(z_inp_sound, theta_inp_sound, z, inp_sound_size);
-
167 
-
168  // Initialize all scalars to 0.
-
169  for (int n = 0; n < NSCALARS; n++) {
-
170  state(i, j, k, RhoScalar_comp+n) = 0;
-
171  }
-
172 
-
173  // total nonprecipitating water (Q1) == water vapor (Qv), i.e., there is no cloud water or cloud ice
-
174  if (l_moist) {
-
175  state(i, j, k, RhoQ1_comp) = rho_0 * interpolate_1d(z_inp_sound, qv_inp_sound, z, inp_sound_size);
-
176  }
-
177  });
-
178 }
+
165 {
+
166  const Real* z_inp_sound = inputSoundingData.z_inp_sound_d[0].dataPtr();
+
167  const Real* theta_inp_sound = inputSoundingData.theta_inp_sound_d[0].dataPtr();
+
168  const Real* qv_inp_sound = inputSoundingData.qv_inp_sound_d[0].dataPtr();
+
169  const int inp_sound_size = inputSoundingData.size(0);
+
170 
+
171  // Geometry
+
172  const Real* prob_lo = geomdata.ProbLo();
+
173  const Real* dx = geomdata.CellSize();
+
174  const Real z_lo = prob_lo[2];
+
175  const Real dz = dx[2];
+
176 
+
177  // We want to set the lateral BC values, too
+
178  Box gbx = bx; // Copy constructor
+
179  gbx.grow(0,1); gbx.grow(1,1); // Grow by one in the lateral directions
+
180 
+
181  ParallelFor(gbx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
+
182  const Real z = (z_cc_arr) ? z_cc_arr(i,j,k)
+
183  : z_lo + (k + 0.5) * dz;
+
184 
+
185  Real rho_0 = 1.0;
+
186 
+
187  // Set the density
+
188  state(i, j, k, Rho_comp) = rho_0;
+
189 
+
190  // Initial Rho0*Theta0
+
191  state(i, j, k, RhoTheta_comp) = rho_0 * interpolate_1d(z_inp_sound, theta_inp_sound, z, inp_sound_size);
+
192 
+
193  // Initialize all scalars to 0.
+
194  for (int n = 0; n < NSCALARS; n++) {
+
195  state(i, j, k, RhoScalar_comp+n) = 0;
+
196  }
+
197 
+
198  // total nonprecipitating water (Q1) == water vapor (Qv), i.e., there is no cloud water or cloud ice
+
199  if (l_moist) {
+
200  state(i, j, k, RhoQ1_comp) = rho_0 * interpolate_1d(z_inp_sound, qv_inp_sound, z, inp_sound_size);
+
201  }
+
202  });
+
203 }
#define RhoScalar_comp
Definition: ERF_IndexDefines.H:41
#define Rho_comp
Definition: ERF_IndexDefines.H:36
@@ -384,70 +384,72 @@

206 {
-
207  const Real* z_inp_sound = inputSoundingData.z_inp_sound_d[0].dataPtr();
-
208  const Real* rho_inp_sound = inputSoundingData.rho_inp_sound_d.dataPtr();
-
209  const Real* theta_inp_sound = inputSoundingData.theta_inp_sound_d[0].dataPtr();
-
210  const Real* qv_inp_sound = inputSoundingData.qv_inp_sound_d[0].dataPtr();
-
211  const int inp_sound_size = inputSoundingData.size(0);
-
212 
-
213  // Geometry
-
214  int ktop = bx.bigEnd(2);
-
215  const Real* prob_lo = geomdata.ProbLo();
-
216  const Real* dx = geomdata.CellSize();
-
217  const Real z_lo = prob_lo[2];
-
218  const Real dz = dx[2];
-
219 
-
220  // We want to set the lateral BC values, too
-
221  Box gbx = bx; // Copy constructor
-
222  gbx.grow(0,1); gbx.grow(1,1); // Grow by one in the lateral directions
-
223 
-
224  ParallelFor(gbx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
-
225  const Real z = (z_cc_arr) ? z_cc_arr(i,j,k)
-
226  : z_lo + (k + 0.5) * dz;
-
227 
-
228  Real rho_k, qv_k, rhoTh_k;
-
229 
-
230  // Set the density
-
231  rho_k = interpolate_1d(z_inp_sound, rho_inp_sound, z, inp_sound_size);
-
232  state(i, j, k, Rho_comp) = rho_k;
-
233 
-
234  // Initial Rho0*Theta0
-
235  rhoTh_k = rho_k * interpolate_1d(z_inp_sound, theta_inp_sound, z, inp_sound_size);
-
236  state(i, j, k, RhoTheta_comp) = rhoTh_k;
+
231 {
+
232  const Real* z_inp_sound = inputSoundingData.z_inp_sound_d[0].dataPtr();
+
233  const Real* rho_inp_sound = inputSoundingData.rho_inp_sound_d.dataPtr();
+
234  const Real* theta_inp_sound = inputSoundingData.theta_inp_sound_d[0].dataPtr();
+
235  const Real* qv_inp_sound = inputSoundingData.qv_inp_sound_d[0].dataPtr();
+
236  const int inp_sound_size = inputSoundingData.size(0);
237 
-
238  // Initialize all scalars to 0.
-
239  for (int n = 0; n < NSCALARS; n++) {
-
240  state(i, j, k, RhoScalar_comp+n) = 0;
-
241  }
-
242 
-
243  // Update hse quantities with values calculated from InputSoundingData.calc_rho_p()
-
244  qv_k = (l_moist) ? interpolate_1d(z_inp_sound, qv_inp_sound, z, inp_sound_size) : 0.0;
-
245  r_hse_arr (i, j, k) = rho_k * (1.0 + qv_k);
-
246  p_hse_arr (i, j, k) = getPgivenRTh(rhoTh_k, qv_k);
-
247  pi_hse_arr(i, j, k) = getExnergivenRTh(rhoTh_k, l_rdOcp);
-
248 
-
249  // FOEXTRAP hse arrays
-
250  if (k==0)
-
251  {
-
252  r_hse_arr (i, j, k-1) = r_hse_arr (i,j,k);
-
253  p_hse_arr (i, j, k-1) = p_hse_arr (i,j,k);
-
254  pi_hse_arr(i, j, k-1) = pi_hse_arr(i,j,k);
-
255  }
-
256  else if (k==ktop)
-
257  {
-
258  r_hse_arr (i, j, k+1) = r_hse_arr (i,j,k);
-
259  p_hse_arr (i, j, k+1) = p_hse_arr (i,j,k);
-
260  pi_hse_arr(i, j, k+1) = pi_hse_arr(i,j,k);
-
261  }
-
262 
-
263  // total nonprecipitating water (Q1) == water vapor (Qv), i.e., there
-
264  // is no cloud water or cloud ice
-
265  if (l_moist) {
-
266  state(i, j, k, RhoQ1_comp) = rho_k * qv_k;
-
267  }
-
268  });
-
269 }
+
238  // Geometry
+
239  const Real* prob_lo = geomdata.ProbLo();
+
240  const Real* dx = geomdata.CellSize();
+
241  const Real z_lo = prob_lo[2];
+
242  const Real dz = dx[2];
+
243 
+
244  int kbot = geomdata.Domain().smallEnd(2);
+
245  int ktop = geomdata.Domain().bigEnd(2);
+
246 
+
247  // We want to set the lateral BC values, too
+
248  Box gbx = bx; // Copy constructor
+
249  gbx.grow(0,1); gbx.grow(1,1); // Grow by one in the lateral directions
+
250 
+
251  ParallelFor(gbx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
+
252  const Real z = (z_cc_arr) ? z_cc_arr(i,j,k)
+
253  : z_lo + (k + 0.5) * dz;
+
254 
+
255  Real rho_k, qv_k, rhoTh_k;
+
256 
+
257  // Set the density
+
258  rho_k = interpolate_1d(z_inp_sound, rho_inp_sound, z, inp_sound_size);
+
259  state(i, j, k, Rho_comp) = rho_k;
+
260 
+
261  // Initial Rho0*Theta0
+
262  rhoTh_k = rho_k * interpolate_1d(z_inp_sound, theta_inp_sound, z, inp_sound_size);
+
263  state(i, j, k, RhoTheta_comp) = rhoTh_k;
+
264 
+
265  // Initialize all scalars to 0.
+
266  for (int n = 0; n < NSCALARS; n++) {
+
267  state(i, j, k, RhoScalar_comp+n) = 0;
+
268  }
+
269 
+
270  // Update hse quantities with values calculated from InputSoundingData.calc_rho_p()
+
271  qv_k = (l_moist) ? interpolate_1d(z_inp_sound, qv_inp_sound, z, inp_sound_size) : 0.0;
+
272  r_hse_arr (i, j, k) = rho_k * (1.0 + qv_k);
+
273  p_hse_arr (i, j, k) = getPgivenRTh(rhoTh_k, qv_k);
+
274  pi_hse_arr(i, j, k) = getExnergivenRTh(rhoTh_k, l_rdOcp);
+
275 
+
276  // FOEXTRAP hse arrays
+
277  if (k==kbot)
+
278  {
+
279  r_hse_arr (i, j, k-1) = r_hse_arr (i,j,k);
+
280  p_hse_arr (i, j, k-1) = p_hse_arr (i,j,k);
+
281  pi_hse_arr(i, j, k-1) = pi_hse_arr(i,j,k);
+
282  }
+
283  else if (k==ktop)
+
284  {
+
285  r_hse_arr (i, j, k+1) = r_hse_arr (i,j,k);
+
286  p_hse_arr (i, j, k+1) = p_hse_arr (i,j,k);
+
287  pi_hse_arr(i, j, k+1) = pi_hse_arr(i,j,k);
+
288  }
+
289 
+
290  // total nonprecipitating water (Q1) == water vapor (Qv), i.e., there
+
291  // is no cloud water or cloud ice
+
292  if (l_moist) {
+
293  state(i, j, k, RhoQ1_comp) = rho_k * qv_k;
+
294  }
+
295  });
+
296 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getPgivenRTh(const amrex::Real rhotheta, const amrex::Real qv=0.)
Definition: ERF_EOS.H:76
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getExnergivenRTh(const amrex::Real rhotheta, const amrex::Real rdOcp, const amrex::Real qv=0.0)
Definition: ERF_EOS.H:130
@@ -543,59 +545,59 @@

289 {
-
290  const Real* z_inp_sound = inputSoundingData.z_inp_sound_d[0].dataPtr();
-
291  const Real* U_inp_sound = inputSoundingData.U_inp_sound_d[0].dataPtr();
-
292  const Real* V_inp_sound = inputSoundingData.V_inp_sound_d[0].dataPtr();
-
293  const int inp_sound_size = inputSoundingData.size(0);
-
294 
-
295  // Geometry
-
296  const Real* prob_lo = geomdata.ProbLo();
-
297  const Real* dx = geomdata.CellSize();
-
298  const Real z_lo = prob_lo[2];
-
299  const Real dz = dx[2];
-
300 
-
301  // We want to set the lateral BC values, too
-
302  Box gbx = bx; // Copy constructor
-
303  gbx.grow(0,1); gbx.grow(1,1); // Grow by one in the lateral directions
-
304 
-
305  // Construct a box that is on x-faces
-
306  const Box& xbx = surroundingNodes(gbx,0);
-
307  // Construct a box that is on y-faces
-
308  const Box& ybx = surroundingNodes(gbx,1);
-
309  // Construct a box that is on z-faces
-
310  const Box& zbx = surroundingNodes(gbx,2);
-
311 
-
312  // Set the x,y,z-velocities
-
313  ParallelFor(xbx, ybx, zbx,
-
314  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
-
315  // Note that this is called on a box of x-faces
-
316  const Real z = (z_nd_arr) ? 0.25*( z_nd_arr(i,j ,k )
-
317  + z_nd_arr(i,j+1,k )
-
318  + z_nd_arr(i,j ,k+1)
-
319  + z_nd_arr(i,j+1,k+1))
-
320  : z_lo + (k + 0.5) * dz;
+
316 {
+
317  const Real* z_inp_sound = inputSoundingData.z_inp_sound_d[0].dataPtr();
+
318  const Real* U_inp_sound = inputSoundingData.U_inp_sound_d[0].dataPtr();
+
319  const Real* V_inp_sound = inputSoundingData.V_inp_sound_d[0].dataPtr();
+
320  const int inp_sound_size = inputSoundingData.size(0);
321 
-
322  // Set the x-velocity
-
323  x_vel(i, j, k) = interpolate_1d(z_inp_sound, U_inp_sound, z, inp_sound_size);
-
324  },
-
325  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
-
326  // Note that this is called on a box of y-faces
-
327  const Real z = (z_nd_arr) ? 0.25*( z_nd_arr(i ,j,k )
-
328  + z_nd_arr(i+1,j,k )
-
329  + z_nd_arr(i ,j,k+1)
-
330  + z_nd_arr(i+1,j,k+1))
-
331  : z_lo + (k + 0.5) * dz;
-
332 
-
333  // Set the y-velocity
-
334  y_vel(i, j, k) = interpolate_1d(z_inp_sound, V_inp_sound, z, inp_sound_size);
-
335  },
-
336  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
-
337  // Note that this is called on a box of z-faces
-
338  // Set the z-velocity
-
339  z_vel(i, j, k) = 0.0;
-
340  });
-
341 }
+
322  // Geometry
+
323  const Real* prob_lo = geomdata.ProbLo();
+
324  const Real* dx = geomdata.CellSize();
+
325  const Real z_lo = prob_lo[2];
+
326  const Real dz = dx[2];
+
327 
+
328  // We want to set the lateral BC values, too
+
329  Box gbx = bx; // Copy constructor
+
330  gbx.grow(0,1); gbx.grow(1,1); // Grow by one in the lateral directions
+
331 
+
332  // Construct a box that is on x-faces
+
333  const Box& xbx = surroundingNodes(gbx,0);
+
334  // Construct a box that is on y-faces
+
335  const Box& ybx = surroundingNodes(gbx,1);
+
336  // Construct a box that is on z-faces
+
337  const Box& zbx = surroundingNodes(gbx,2);
+
338 
+
339  // Set the x,y,z-velocities
+
340  ParallelFor(xbx, ybx, zbx,
+
341  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
+
342  // Note that this is called on a box of x-faces
+
343  const Real z = (z_nd_arr) ? 0.25*( z_nd_arr(i,j ,k )
+
344  + z_nd_arr(i,j+1,k )
+
345  + z_nd_arr(i,j ,k+1)
+
346  + z_nd_arr(i,j+1,k+1))
+
347  : z_lo + (k + 0.5) * dz;
+
348 
+
349  // Set the x-velocity
+
350  x_vel(i, j, k) = interpolate_1d(z_inp_sound, U_inp_sound, z, inp_sound_size);
+
351  },
+
352  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
+
353  // Note that this is called on a box of y-faces
+
354  const Real z = (z_nd_arr) ? 0.25*( z_nd_arr(i ,j,k )
+
355  + z_nd_arr(i+1,j,k )
+
356  + z_nd_arr(i ,j,k+1)
+
357  + z_nd_arr(i+1,j,k+1))
+
358  : z_lo + (k + 0.5) * dz;
+
359 
+
360  // Set the y-velocity
+
361  y_vel(i, j, k) = interpolate_1d(z_inp_sound, V_inp_sound, z, inp_sound_size);
+
362  },
+
363  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
+
364  // Note that this is called on a box of z-faces
+
365  // Set the z-velocity
+
366  z_vel(i, j, k) = 0.0;
+
367  });
+
368 }

Referenced by ERF::init_from_input_sounding().

diff --git a/classERF-members.html b/classERF-members.html index bfaa8e292..53c35f266 100644 --- a/classERF-members.html +++ b/classERF-members.html @@ -414,9 +414,9 @@ write_1D_profiles_stag(amrex::Real time)ERF writeBuildInfo(std::ostream &os)ERFstatic WriteCheckpointFile() constERFprivate - WriteGenericPlotfileHeaderWithTerrain(std::ostream &HeaderFile, int nlevels, const amrex::Vector< amrex::BoxArray > &bArray, const amrex::Vector< std::string > &varnames, amrex::Real time, const amrex::Vector< int > &level_steps, const std::string &versionName, const std::string &levelPrefix, const std::string &mfPrefix) constERF + 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, amrex::Real 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) constERF writeJobInfo(const std::string &dir) constERF - 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, amrex::Real time, const amrex::Vector< int > &level_steps, 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 >()) constERF + 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, amrex::Real 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 >()) constERF writeNow(const amrex::Real cur_time, const amrex::Real dt, const int nstep, const int plot_int, const amrex::Real plot_per)ERF WritePlotFile(int which, amrex::Vector< std::string > plot_var_names)ERF xflux_imaskERFprivate diff --git a/classERF.html b/classERF.html index 4230cea60..000cfc178 100644 --- a/classERF.html +++ b/classERF.html @@ -258,10 +258,10 @@   void WritePlotFile (int which, amrex::Vector< std::string > plot_var_names)   -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, amrex::Real time, const amrex::Vector< int > &level_steps, 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 -  -void WriteGenericPlotfileHeaderWithTerrain (std::ostream &HeaderFile, int nlevels, const amrex::Vector< amrex::BoxArray > &bArray, const amrex::Vector< std::string > &varnames, amrex::Real time, const amrex::Vector< int > &level_steps, const std::string &versionName, const std::string &levelPrefix, const std::string &mfPrefix) const -  +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, amrex::Real 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 +  +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, amrex::Real 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 +  void erf_enforce_hse (int lev, amrex::MultiFab &dens, amrex::MultiFab &pres, amrex::MultiFab &pi, std::unique_ptr< amrex::MultiFab > &z_cc)   void init_from_input_sounding (int lev) @@ -1255,35 +1255,35 @@

@ MOST

AMREX_FORCE_INLINE amrex::IntVect TileNoZ()
Definition: ERF_TileNoZ.H:11
void Time_Avg_Vel_atCC(const Real &dt, Real &t_avg_cnt, MultiFab *vel_t_avg, MultiFab &xvel, MultiFab &yvel, MultiFab &zvel)
Definition: ERF_Time_Avg_Vel.cpp:9
-
amrex::Vector< amrex::MultiFab > rU_new
Definition: ERF.H:694
-
std::unique_ptr< ABLMost > m_most
Definition: ERF.H:1052
-
amrex::Vector< ERFFillPatcher > FPr_u
Definition: ERF.H:735
-
amrex::Vector< amrex::Vector< amrex::MultiFab > > vars_new
Definition: ERF.H:669
-
amrex::Vector< ERFFillPatcher > FPr_v
Definition: ERF.H:736
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > z_phys_cc
Definition: ERF.H:760
-
static SolverChoice solverChoice
Definition: ERF.H:914
-
amrex::Vector< ERFFillPatcher > FPr_c
Definition: ERF.H:734
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vel_t_avg
Definition: ERF.H:673
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Qv_prim
Definition: ERF.H:689
-
amrex::Vector< amrex::MultiFab > rV_new
Definition: ERF.H:696
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Qr_prim
Definition: ERF.H:690
-
amrex::Vector< amrex::Real > t_avg_cnt
Definition: ERF.H:674
-
amrex::Vector< amrex::MultiFab > rU_old
Definition: ERF.H:693
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Theta_prim
Definition: ERF.H:688
+
amrex::Vector< amrex::MultiFab > rU_new
Definition: ERF.H:698
+
std::unique_ptr< ABLMost > m_most
Definition: ERF.H:1056
+
amrex::Vector< ERFFillPatcher > FPr_u
Definition: ERF.H:739
+
amrex::Vector< amrex::Vector< amrex::MultiFab > > vars_new
Definition: ERF.H:673
+
amrex::Vector< ERFFillPatcher > FPr_v
Definition: ERF.H:740
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > z_phys_cc
Definition: ERF.H:764
+
static SolverChoice solverChoice
Definition: ERF.H:918
+
amrex::Vector< ERFFillPatcher > FPr_c
Definition: ERF.H:738
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vel_t_avg
Definition: ERF.H:677
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Qv_prim
Definition: ERF.H:693
+
amrex::Vector< amrex::MultiFab > rV_new
Definition: ERF.H:700
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Qr_prim
Definition: ERF.H:694
+
amrex::Vector< amrex::Real > t_avg_cnt
Definition: ERF.H:678
+
amrex::Vector< amrex::MultiFab > rU_old
Definition: ERF.H:697
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Theta_prim
Definition: ERF.H:692
void FillPatch(int lev, amrex::Real time, const amrex::Vector< amrex::MultiFab * > &mfs_vel, const amrex::Vector< amrex::MultiFab * > &mfs_mom, bool fillset=true, bool cons_only=false)
Definition: ERF_FillPatch.cpp:22
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > z_phys_nd
Definition: ERF.H:759
-
amrex::Vector< amrex::MultiFab > rW_new
Definition: ERF.H:698
-
TurbulentPerturbation turbPert
Definition: ERF.H:917
-
amrex::Vector< amrex::MultiFab > rW_old
Definition: ERF.H:697
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > z_phys_nd
Definition: ERF.H:763
+
amrex::Vector< amrex::MultiFab > rW_new
Definition: ERF.H:702
+
TurbulentPerturbation turbPert
Definition: ERF.H:921
+
amrex::Vector< amrex::MultiFab > rW_old
Definition: ERF.H:701
void advance_lsm(int lev, amrex::MultiFab &, const amrex::Real &dt_advance)
Definition: ERF_advance_lsm.cpp:5
-
amrex::Vector< ERFFillPatcher > FPr_w
Definition: ERF.H:737
-
amrex::Vector< amrex::Real > dt
Definition: ERF.H:663
+
amrex::Vector< ERFFillPatcher > FPr_w
Definition: ERF.H:741
+
amrex::Vector< amrex::Real > dt
Definition: ERF.H:667
void advance_microphysics(int lev, amrex::MultiFab &cons_in, const amrex::Real &dt_advance, const int &iteration, const amrex::Real &time)
Definition: ERF_advance_microphysics.cpp:5
-
int cf_width
Definition: ERF.H:732
-
amrex::Vector< amrex::Vector< amrex::MultiFab * > > qmoist
Definition: ERF.H:701
-
amrex::GpuArray< ERF_BC, AMREX_SPACEDIM *2 > phys_bc_type
Definition: ERF.H:814
-
amrex::Vector< amrex::MultiFab > rV_old
Definition: ERF.H:695
-
amrex::Vector< amrex::Vector< amrex::MultiFab > > vars_old
Definition: ERF.H:670
+
int cf_width
Definition: ERF.H:736
+
amrex::Vector< amrex::Vector< amrex::MultiFab * > > qmoist
Definition: ERF.H:705
+
amrex::GpuArray< ERF_BC, AMREX_SPACEDIM *2 > phys_bc_type
Definition: ERF.H:818
+
amrex::Vector< amrex::MultiFab > rV_old
Definition: ERF.H:699
+
amrex::Vector< amrex::Vector< amrex::MultiFab > > vars_old
Definition: ERF.H:674
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::Geometry fine_geom, amrex::Real dt, amrex::Real time)
Definition: ERF_advance_dycore.cpp:37
void FillPatchMoistVars(int lev, amrex::MultiFab &mf)
Definition: ERF_FillPatch.cpp:267
@ ymom
Definition: ERF_IndexDefines.H:133
@@ -1730,47 +1730,47 @@

auto apply_bcs
Definition: ERF_TI_utils.H:40

auto cons_to_prim
Definition: ERF_TI_utils.H:4
void VelocityToMomentum(const amrex::MultiFab &xvel_in, const amrex::IntVect &xvel_ngrow, const amrex::MultiFab &yvel_in, const amrex::IntVect &yvel_ngrow, const amrex::MultiFab &zvel_in, const amrex::IntVect &zvel_ngrow, const amrex::MultiFab &cons_in, amrex::MultiFab &xmom_out, amrex::MultiFab &ymom_out, amrex::MultiFab &zmom_out, const amrex::Box &domain, const amrex::Vector< amrex::BCRec > &domain_bcs_type_h)
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau23_lev
Definition: ERF.H:743
-
amrex::Vector< std::unique_ptr< MRISplitIntegrator< amrex::Vector< amrex::MultiFab > > > > mri_integrator_mem
Definition: ERF.H:676
-
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > d_rhotheta_src
Definition: ERF.H:1001
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_q1fx3_lev
Definition: ERF.H:754
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_hfx3_lev
Definition: ERF.H:752
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > mapfac_u
Definition: ERF.H:782
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau31_lev
Definition: ERF.H:742
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > mapfac_m
Definition: ERF.H:781
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_hfx1_lev
Definition: ERF.H:752
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > detJ_cc
Definition: ERF.H:762
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > eddyDiffs_lev
Definition: ERF.H:744
-
amrex::Vector< amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > > d_sponge_ptrs
Definition: ERF.H:1034
-
amrex::Vector< amrex::Vector< amrex::Real > > h_rhoqt_src
Definition: ERF.H:1003
-
amrex::Vector< long > dt_mri_ratio
Definition: ERF.H:664
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_q2fx3_lev
Definition: ERF.H:755
-
static int verbose
Definition: ERF.H:945
-
amrex::Vector< amrex::MultiFab > base_state
Definition: ERF.H:785
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau13_lev
Definition: ERF.H:742
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_q1fx2_lev
Definition: ERF.H:754
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau21_lev
Definition: ERF.H:741
-
amrex::Vector< amrex::BCRec > domain_bcs_type
Definition: ERF.H:801
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau33_lev
Definition: ERF.H:740
-
std::unique_ptr< ProblemBase > prob
Definition: ERF.H:651
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_diss_lev
Definition: ERF.H:753
-
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > d_v_geos
Definition: ERF.H:1013
-
amrex::Vector< amrex::Vector< amrex::Real > > h_v_geos
Definition: ERF.H:1012
-
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > d_rhoqt_src
Definition: ERF.H:1004
-
amrex::Vector< amrex::Vector< amrex::Real > > h_rhotheta_src
Definition: ERF.H:1000
-
amrex::Vector< amrex::Vector< amrex::Real > > h_u_geos
Definition: ERF.H:1009
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SmnSmn_lev
Definition: ERF.H:745
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau32_lev
Definition: ERF.H:743
-
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > d_u_geos
Definition: ERF.H:1010
-
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > d_w_subsid
Definition: ERF.H:1007
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_hfx2_lev
Definition: ERF.H:752
-
static int fixed_mri_dt_ratio
Definition: ERF.H:852
-
amrex::Vector< amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > > d_rayleigh_ptrs
Definition: ERF.H:1031
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau12_lev
Definition: ERF.H:741
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_q1fx1_lev
Definition: ERF.H:754
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > mapfac_v
Definition: ERF.H:783
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau11_lev
Definition: ERF.H:740
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau22_lev
Definition: ERF.H:740
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau23_lev
Definition: ERF.H:747
+
amrex::Vector< std::unique_ptr< MRISplitIntegrator< amrex::Vector< amrex::MultiFab > > > > mri_integrator_mem
Definition: ERF.H:680
+
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > d_rhotheta_src
Definition: ERF.H:1005
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_q1fx3_lev
Definition: ERF.H:758
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_hfx3_lev
Definition: ERF.H:756
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > mapfac_u
Definition: ERF.H:786
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau31_lev
Definition: ERF.H:746
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > mapfac_m
Definition: ERF.H:785
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_hfx1_lev
Definition: ERF.H:756
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > detJ_cc
Definition: ERF.H:766
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > eddyDiffs_lev
Definition: ERF.H:748
+
amrex::Vector< amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > > d_sponge_ptrs
Definition: ERF.H:1038
+
amrex::Vector< amrex::Vector< amrex::Real > > h_rhoqt_src
Definition: ERF.H:1007
+
amrex::Vector< long > dt_mri_ratio
Definition: ERF.H:668
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_q2fx3_lev
Definition: ERF.H:759
+
static int verbose
Definition: ERF.H:949
+
amrex::Vector< amrex::MultiFab > base_state
Definition: ERF.H:789
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau13_lev
Definition: ERF.H:746
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_q1fx2_lev
Definition: ERF.H:758
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau21_lev
Definition: ERF.H:745
+
amrex::Vector< amrex::BCRec > domain_bcs_type
Definition: ERF.H:805
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau33_lev
Definition: ERF.H:744
+
std::unique_ptr< ProblemBase > prob
Definition: ERF.H:655
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_diss_lev
Definition: ERF.H:757
+
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > d_v_geos
Definition: ERF.H:1017
+
amrex::Vector< amrex::Vector< amrex::Real > > h_v_geos
Definition: ERF.H:1016
+
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > d_rhoqt_src
Definition: ERF.H:1008
+
amrex::Vector< amrex::Vector< amrex::Real > > h_rhotheta_src
Definition: ERF.H:1004
+
amrex::Vector< amrex::Vector< amrex::Real > > h_u_geos
Definition: ERF.H:1013
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SmnSmn_lev
Definition: ERF.H:749
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau32_lev
Definition: ERF.H:747
+
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > d_u_geos
Definition: ERF.H:1014
+
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > d_w_subsid
Definition: ERF.H:1011
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_hfx2_lev
Definition: ERF.H:756
+
static int fixed_mri_dt_ratio
Definition: ERF.H:856
+
amrex::Vector< amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > > d_rayleigh_ptrs
Definition: ERF.H:1035
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau12_lev
Definition: ERF.H:745
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > SFS_q1fx1_lev
Definition: ERF.H:758
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > mapfac_v
Definition: ERF.H:787
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau11_lev
Definition: ERF.H:744
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Tau22_lev
Definition: ERF.H:744
Definition: ERF_MRI.H:16
void set_slow_rhs_pre(std::function< void(T &, T &, T &, T &, const amrex::Real, const amrex::Real, const amrex::Real, const int)> F)
Definition: ERF_MRI.H:137
void set_no_substep(std::function< void(T &, T &, T &, amrex::Real, amrex::Real, int)> F)
Definition: ERF_MRI.H:177
@@ -1883,7 +1883,7 @@

10  lsm.Advance(lev, dt_advance);
11  }
12 }
-
LandSurface lsm
Definition: ERF.H:716
+
LandSurface lsm
Definition: ERF.H:720
void Advance(const int &lev, const amrex::Real &dt_advance)
Definition: ERF_LandSurface.H:47
LandSurfaceType lsm_type
Definition: ERF_DataStruct.H:629
@@ -1939,7 +1939,7 @@

14  micro->Update_State_Vars_Lev(lev, cons);
15  }
16 }
-
std::unique_ptr< Microphysics > micro
Definition: ERF.H:700
+
std::unique_ptr< Microphysics > micro
Definition: ERF.H:704
@@ -2020,7 +2020,7 @@

174 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real pp(amrex::Real y)
Definition: ERF_Microphysics_Utils.H:188
bool containerHasElement(const V &iterable, const T &query)
Definition: ERF_Plotfile.cpp:13
-
std::string pp_prefix
Definition: ERF.H:391
+
std::string pp_prefix
Definition: ERF.H:395
Here is the call graph for this function:
@@ -2056,16 +2056,16 @@

-
1824 {
-
1825  AMREX_ALWAYS_ASSERT(solverChoice.coupling_type == CouplingType::TwoWay);
-
1826  int src_comp = 0;
-
1827  int num_comp = vars_new[0][Vars::cons].nComp();
-
1828  for (int lev = finest_level-1; lev >= 0; --lev)
-
1829  {
-
1830  AverageDownTo(lev,src_comp,num_comp);
-
1831  }
-
1832 }
-
void AverageDownTo(int crse_lev, int scomp, int ncomp)
Definition: ERF.cpp:1836
+
1828 {
+
1829  AMREX_ALWAYS_ASSERT(solverChoice.coupling_type == CouplingType::TwoWay);
+
1830  int src_comp = 0;
+
1831  int num_comp = vars_new[0][Vars::cons].nComp();
+
1832  for (int lev = finest_level-1; lev >= 0; --lev)
+
1833  {
+
1834  AverageDownTo(lev,src_comp,num_comp);
+
1835  }
+
1836 }
+
void AverageDownTo(int crse_lev, int scomp, int ncomp)
Definition: ERF.cpp:1840
CouplingType coupling_type
Definition: ERF_DataStruct.H:624
@@ -2101,98 +2101,98 @@

-
1837 {
-
1838  AMREX_ALWAYS_ASSERT(solverChoice.coupling_type == CouplingType::TwoWay);
-
1839 
-
1840  // ******************************************************************************************
-
1841  // First do cell-centered quantities
-
1842  // The quantity that is conserved is not (rho S), but rather (rho S / m^2) where
-
1843  // m is the map scale factor at cell centers
-
1844  // Here we pre-divide (rho S) by m^2 before average down
-
1845  // ******************************************************************************************
-
1846  for (int lev = crse_lev; lev <= crse_lev+1; lev++) {
-
1847  for (MFIter mfi(vars_new[lev][Vars::cons], TilingIfNotGPU()); mfi.isValid(); ++mfi) {
-
1848  const Box& bx = mfi.tilebox();
-
1849  const Array4< Real> cons_arr = vars_new[lev][Vars::cons].array(mfi);
-
1850  const Array4<const Real> mapfac_arr = mapfac_m[lev]->const_array(mfi);
-
1851  if (solverChoice.use_terrain) {
-
1852  const Array4<const Real> detJ_arr = detJ_cc[lev]->const_array(mfi);
-
1853  ParallelFor(bx, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
-
1854  {
-
1855  cons_arr(i,j,k,scomp+n) *= detJ_arr(i,j,k) / (mapfac_arr(i,j,0)*mapfac_arr(i,j,0));
-
1856  });
-
1857  } else {
-
1858  ParallelFor(bx, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
-
1859  {
-
1860  cons_arr(i,j,k,scomp+n) /= (mapfac_arr(i,j,0)*mapfac_arr(i,j,0));
-
1861  });
-
1862  }
-
1863  } // mfi
-
1864  } // lev
-
1865 
-
1866  average_down(vars_new[crse_lev+1][Vars::cons],
-
1867  vars_new[crse_lev ][Vars::cons],
-
1868  scomp, ncomp, refRatio(crse_lev));
+
1841 {
+
1842  AMREX_ALWAYS_ASSERT(solverChoice.coupling_type == CouplingType::TwoWay);
+
1843 
+
1844  // ******************************************************************************************
+
1845  // First do cell-centered quantities
+
1846  // The quantity that is conserved is not (rho S), but rather (rho S / m^2) where
+
1847  // m is the map scale factor at cell centers
+
1848  // Here we pre-divide (rho S) by m^2 before average down
+
1849  // ******************************************************************************************
+
1850  for (int lev = crse_lev; lev <= crse_lev+1; lev++) {
+
1851  for (MFIter mfi(vars_new[lev][Vars::cons], TilingIfNotGPU()); mfi.isValid(); ++mfi) {
+
1852  const Box& bx = mfi.tilebox();
+
1853  const Array4< Real> cons_arr = vars_new[lev][Vars::cons].array(mfi);
+
1854  const Array4<const Real> mapfac_arr = mapfac_m[lev]->const_array(mfi);
+
1855  if (solverChoice.use_terrain) {
+
1856  const Array4<const Real> detJ_arr = detJ_cc[lev]->const_array(mfi);
+
1857  ParallelFor(bx, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
+
1858  {
+
1859  cons_arr(i,j,k,scomp+n) *= detJ_arr(i,j,k) / (mapfac_arr(i,j,0)*mapfac_arr(i,j,0));
+
1860  });
+
1861  } else {
+
1862  ParallelFor(bx, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
+
1863  {
+
1864  cons_arr(i,j,k,scomp+n) /= (mapfac_arr(i,j,0)*mapfac_arr(i,j,0));
+
1865  });
+
1866  }
+
1867  } // mfi
+
1868  } // lev
1869 
-
1870  // Here we multiply (rho S) by m^2 after average down
-
1871  for (int lev = crse_lev; lev <= crse_lev+1; lev++) {
-
1872  for (MFIter mfi(vars_new[lev][Vars::cons], TilingIfNotGPU()); mfi.isValid(); ++mfi) {
-
1873  const Box& bx = mfi.tilebox();
-
1874  const Array4< Real> cons_arr = vars_new[lev][Vars::cons].array(mfi);
-
1875  const Array4<const Real> mapfac_arr = mapfac_m[lev]->const_array(mfi);
-
1876  if (solverChoice.use_terrain) {
-
1877  const Array4<const Real> detJ_arr = detJ_cc[lev]->const_array(mfi);
-
1878  ParallelFor(bx, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
-
1879  {
-
1880  cons_arr(i,j,k,scomp+n) *= (mapfac_arr(i,j,0)*mapfac_arr(i,j,0)) / detJ_arr(i,j,k);
-
1881  });
-
1882  } else {
-
1883  ParallelFor(bx, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
-
1884  {
-
1885  cons_arr(i,j,k,scomp+n) *= (mapfac_arr(i,j,0)*mapfac_arr(i,j,0));
-
1886  });
-
1887  }
-
1888  } // mfi
-
1889  } // lev
-
1890 
-
1891  // ******************************************************************************************
-
1892  // Now average down momenta.
-
1893  // Note that vars_new holds velocities not momenta, but we want to do conservative
-
1894  // averaging so we first convert to momentum, then average down, then convert
-
1895  // back to velocities -- only on the valid region
-
1896  // ******************************************************************************************
-
1897  for (int lev = crse_lev; lev <= crse_lev+1; lev++)
-
1898  {
-
1899  // FillBoundary for density so we can go back and forth between velocity and momentum
-
1900  vars_new[lev][Vars::cons].FillBoundary(geom[lev].periodicity());
-
1901 
-
1902  VelocityToMomentum(vars_new[lev][Vars::xvel], IntVect(0,0,0),
-
1903  vars_new[lev][Vars::yvel], IntVect(0,0,0),
-
1904  vars_new[lev][Vars::zvel], IntVect(0,0,0),
-
1905  vars_new[lev][Vars::cons],
-
1906  rU_new[lev],
-
1907  rV_new[lev],
-
1908  rW_new[lev],
-
1909  Geom(lev).Domain(),
-
1910  domain_bcs_type);
-
1911  }
-
1912 
-
1913  average_down_faces(rU_new[crse_lev+1], rU_new[crse_lev], refRatio(crse_lev), geom[crse_lev]);
-
1914  average_down_faces(rV_new[crse_lev+1], rV_new[crse_lev], refRatio(crse_lev), geom[crse_lev]);
-
1915  average_down_faces(rW_new[crse_lev+1], rW_new[crse_lev], refRatio(crse_lev), geom[crse_lev]);
+
1870  average_down(vars_new[crse_lev+1][Vars::cons],
+
1871  vars_new[crse_lev ][Vars::cons],
+
1872  scomp, ncomp, refRatio(crse_lev));
+
1873 
+
1874  // Here we multiply (rho S) by m^2 after average down
+
1875  for (int lev = crse_lev; lev <= crse_lev+1; lev++) {
+
1876  for (MFIter mfi(vars_new[lev][Vars::cons], TilingIfNotGPU()); mfi.isValid(); ++mfi) {
+
1877  const Box& bx = mfi.tilebox();
+
1878  const Array4< Real> cons_arr = vars_new[lev][Vars::cons].array(mfi);
+
1879  const Array4<const Real> mapfac_arr = mapfac_m[lev]->const_array(mfi);
+
1880  if (solverChoice.use_terrain) {
+
1881  const Array4<const Real> detJ_arr = detJ_cc[lev]->const_array(mfi);
+
1882  ParallelFor(bx, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
+
1883  {
+
1884  cons_arr(i,j,k,scomp+n) *= (mapfac_arr(i,j,0)*mapfac_arr(i,j,0)) / detJ_arr(i,j,k);
+
1885  });
+
1886  } else {
+
1887  ParallelFor(bx, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
+
1888  {
+
1889  cons_arr(i,j,k,scomp+n) *= (mapfac_arr(i,j,0)*mapfac_arr(i,j,0));
+
1890  });
+
1891  }
+
1892  } // mfi
+
1893  } // lev
+
1894 
+
1895  // ******************************************************************************************
+
1896  // Now average down momenta.
+
1897  // Note that vars_new holds velocities not momenta, but we want to do conservative
+
1898  // averaging so we first convert to momentum, then average down, then convert
+
1899  // back to velocities -- only on the valid region
+
1900  // ******************************************************************************************
+
1901  for (int lev = crse_lev; lev <= crse_lev+1; lev++)
+
1902  {
+
1903  // FillBoundary for density so we can go back and forth between velocity and momentum
+
1904  vars_new[lev][Vars::cons].FillBoundary(geom[lev].periodicity());
+
1905 
+
1906  VelocityToMomentum(vars_new[lev][Vars::xvel], IntVect(0,0,0),
+
1907  vars_new[lev][Vars::yvel], IntVect(0,0,0),
+
1908  vars_new[lev][Vars::zvel], IntVect(0,0,0),
+
1909  vars_new[lev][Vars::cons],
+
1910  rU_new[lev],
+
1911  rV_new[lev],
+
1912  rW_new[lev],
+
1913  Geom(lev).Domain(),
+
1914  domain_bcs_type);
+
1915  }
1916 
-
1917  for (int lev = crse_lev; lev <= crse_lev+1; lev++) {
- -
1919  vars_new[lev][Vars::yvel],
-
1920  vars_new[lev][Vars::zvel],
-
1921  vars_new[lev][Vars::cons],
-
1922  rU_new[lev],
-
1923  rV_new[lev],
-
1924  rW_new[lev],
-
1925  Geom(lev).Domain(),
-
1926  domain_bcs_type);
-
1927  }
-
1928 }
+
1917  average_down_faces(rU_new[crse_lev+1], rU_new[crse_lev], refRatio(crse_lev), geom[crse_lev]);
+
1918  average_down_faces(rV_new[crse_lev+1], rV_new[crse_lev], refRatio(crse_lev), geom[crse_lev]);
+
1919  average_down_faces(rW_new[crse_lev+1], rW_new[crse_lev], refRatio(crse_lev), geom[crse_lev]);
+
1920 
+
1921  for (int lev = crse_lev; lev <= crse_lev+1; lev++) {
+ +
1923  vars_new[lev][Vars::yvel],
+
1924  vars_new[lev][Vars::zvel],
+
1925  vars_new[lev][Vars::cons],
+
1926  rU_new[lev],
+
1927  rV_new[lev],
+
1928  rW_new[lev],
+
1929  Geom(lev).Domain(),
+
1930  domain_bcs_type);
+
1931  }
+
1932 }
void MomentumToVelocity(MultiFab &xvel, MultiFab &yvel, MultiFab &zvel, const MultiFab &density, const MultiFab &xmom_in, const MultiFab &ymom_in, const MultiFab &zmom_in, const Box &domain, const Vector< BCRec > &domain_bcs_type_h)
Definition: ERF_MomentumToVelocity.cpp:25
Here is the call graph for this function:
@@ -2252,7 +2252,7 @@

448 

449  return fine_mask;
450 }
-
amrex::MultiFab fine_mask
Definition: ERF.H:1063
+
amrex::MultiFab fine_mask
Definition: ERF.H:1067

@@ -2311,13 +2311,13 @@

464  // Clears the flux register array
465  advflux_reg[lev]->reset();
466 }
-
amrex::Vector< amrex::MultiFab > pp_inc
Definition: ERF.H:678
-
amrex::Vector< std::unique_ptr< ERFPhysBCFunct_cons > > physbcs_cons
Definition: ERF.H:681
-
amrex::Vector< std::unique_ptr< ERFPhysBCFunct_w > > physbcs_w
Definition: ERF.H:684
-
amrex::Vector< std::unique_ptr< ERFPhysBCFunct_u > > physbcs_u
Definition: ERF.H:682
-
amrex::Vector< std::unique_ptr< ERFPhysBCFunct_v > > physbcs_v
Definition: ERF.H:683
-
amrex::Vector< amrex::YAFluxRegister * > advflux_reg
Definition: ERF.H:796
-
amrex::Vector< std::unique_ptr< ERFPhysBCFunct_base > > physbcs_base
Definition: ERF.H:685
+
amrex::Vector< amrex::MultiFab > pp_inc
Definition: ERF.H:682
+
amrex::Vector< std::unique_ptr< ERFPhysBCFunct_cons > > physbcs_cons
Definition: ERF.H:685
+
amrex::Vector< std::unique_ptr< ERFPhysBCFunct_w > > physbcs_w
Definition: ERF.H:688
+
amrex::Vector< std::unique_ptr< ERFPhysBCFunct_u > > physbcs_u
Definition: ERF.H:686
+
amrex::Vector< std::unique_ptr< ERFPhysBCFunct_v > > physbcs_v
Definition: ERF.H:687
+
amrex::Vector< amrex::YAFluxRegister * > advflux_reg
Definition: ERF.H:800
+
amrex::Vector< std::unique_ptr< ERFPhysBCFunct_base > > physbcs_base
Definition: ERF.H:689
@ NumTypes
Definition: ERF_IndexDefines.H:125
@@ -2465,12 +2465,12 @@

44  dt[lev] = dt[lev-1] / nsubsteps[lev];
45  }
46 }
-
amrex::Real stop_time
Definition: ERF.H:839
-
amrex::Vector< amrex::Real > t_new
Definition: ERF.H:661
+
amrex::Real stop_time
Definition: ERF.H:843
+
amrex::Vector< amrex::Real > t_new
Definition: ERF.H:665
amrex::Real estTimeStep(int lev, long &dt_fast_ratio) const
Definition: ERF_ComputeTimestep.cpp:55
-
amrex::Vector< int > nsubsteps
Definition: ERF.H:658
-
static amrex::Real init_shrink
Definition: ERF.H:846
-
static amrex::Real change_max
Definition: ERF.H:847
+
amrex::Vector< int > nsubsteps
Definition: ERF.H:662
+
static amrex::Real init_shrink
Definition: ERF.H:850
+
static amrex::Real change_max
Definition: ERF.H:851
@@ -2507,51 +2507,51 @@

-
1070  {
-
1071  if (use_num_diff)
-
1072  {
-
1073  return 3;
-
1074  } else {
-
1075  if (
- - - - - -
1081  || (advChoice.dryscal_vert_adv_type == AdvType::Centered_6th) )
-
1082  { return 3; }
-
1083  else if (
- -
1085  || (advChoice.dycore_vert_adv_type == AdvType::Upwind_5th)
- - - -
1089  || (advChoice.dryscal_vert_adv_type == AdvType::Upwind_5th) )
-
1090  { return 3; }
-
1091  else if (
- -
1093  || (advChoice.dryscal_vert_adv_type == AdvType::Weno_5)
-
1094  || (advChoice.moistscal_horiz_adv_type == AdvType::Weno_5)
-
1095  || (advChoice.moistscal_vert_adv_type == AdvType::Weno_5)
-
1096  || (advChoice.moistscal_horiz_adv_type == AdvType::Weno_5Z)
-
1097  || (advChoice.moistscal_vert_adv_type == AdvType::Weno_5Z)
-
1098  || (advChoice.dryscal_horiz_adv_type == AdvType::Weno_5Z)
-
1099  || (advChoice.dryscal_vert_adv_type == AdvType::Weno_5Z) )
-
1100  { return 3; }
-
1101  else if (
- -
1103  || (advChoice.dryscal_vert_adv_type == AdvType::Weno_7)
-
1104  || (advChoice.moistscal_horiz_adv_type == AdvType::Weno_7)
-
1105  || (advChoice.moistscal_vert_adv_type == AdvType::Weno_7)
-
1106  || (advChoice.moistscal_horiz_adv_type == AdvType::Weno_7Z)
-
1107  || (advChoice.moistscal_vert_adv_type == AdvType::Weno_7Z)
-
1108  || (advChoice.dryscal_horiz_adv_type == AdvType::Weno_7Z)
-
1109  || (advChoice.dryscal_vert_adv_type == AdvType::Weno_7Z) )
-
1110  { return 4; }
-
1111  else
-
1112  { return 2; }
-
1113  }
-
1114  }
+
1074  {
+
1075  if (use_num_diff)
+
1076  {
+
1077  return 3;
+
1078  } else {
+
1079  if (
+ + + + + +
1085  || (advChoice.dryscal_vert_adv_type == AdvType::Centered_6th) )
+
1086  { return 3; }
+
1087  else if (
+ +
1089  || (advChoice.dycore_vert_adv_type == AdvType::Upwind_5th)
+ + + +
1093  || (advChoice.dryscal_vert_adv_type == AdvType::Upwind_5th) )
+
1094  { return 3; }
+
1095  else if (
+ +
1097  || (advChoice.dryscal_vert_adv_type == AdvType::Weno_5)
+
1098  || (advChoice.moistscal_horiz_adv_type == AdvType::Weno_5)
+
1099  || (advChoice.moistscal_vert_adv_type == AdvType::Weno_5)
+
1100  || (advChoice.moistscal_horiz_adv_type == AdvType::Weno_5Z)
+
1101  || (advChoice.moistscal_vert_adv_type == AdvType::Weno_5Z)
+
1102  || (advChoice.dryscal_horiz_adv_type == AdvType::Weno_5Z)
+
1103  || (advChoice.dryscal_vert_adv_type == AdvType::Weno_5Z) )
+
1104  { return 3; }
+
1105  else if (
+ +
1107  || (advChoice.dryscal_vert_adv_type == AdvType::Weno_7)
+
1108  || (advChoice.moistscal_horiz_adv_type == AdvType::Weno_7)
+
1109  || (advChoice.moistscal_vert_adv_type == AdvType::Weno_7)
+
1110  || (advChoice.moistscal_horiz_adv_type == AdvType::Weno_7Z)
+
1111  || (advChoice.moistscal_vert_adv_type == AdvType::Weno_7Z)
+
1112  || (advChoice.dryscal_horiz_adv_type == AdvType::Weno_7Z)
+
1113  || (advChoice.dryscal_vert_adv_type == AdvType::Weno_7Z) )
+
1114  { return 4; }
+
1115  else
+
1116  { return 2; }
+
1117  }
+
1118  }
@@ -2590,30 +2590,30 @@

-
1932 {
-
1933  auto& fine_new = vars_new[lev];
-
1934  auto& crse_new = vars_new[lev-1];
-
1935  auto& ba_fine = fine_new[Vars::cons].boxArray();
-
1936  auto& ba_crse = crse_new[Vars::cons].boxArray();
-
1937  auto& dm_fine = fine_new[Vars::cons].DistributionMap();
-
1938  auto& dm_crse = crse_new[Vars::cons].DistributionMap();
-
1939 
-
1940  int ncomp = vars_new[lev][Vars::cons].nComp();
-
1941 
-
1942  FPr_c.emplace_back(ba_fine, dm_fine, geom[lev] ,
-
1943  ba_crse, dm_crse, geom[lev-1],
-
1944  -cf_width, -cf_set_width, ncomp, &cell_cons_interp);
-
1945  FPr_u.emplace_back(convert(ba_fine, IntVect(1,0,0)), dm_fine, geom[lev] ,
-
1946  convert(ba_crse, IntVect(1,0,0)), dm_crse, geom[lev-1],
-
1947  -cf_width, -cf_set_width, 1, &face_cons_linear_interp);
-
1948  FPr_v.emplace_back(convert(ba_fine, IntVect(0,1,0)), dm_fine, geom[lev] ,
-
1949  convert(ba_crse, IntVect(0,1,0)), dm_crse, geom[lev-1],
-
1950  -cf_width, -cf_set_width, 1, &face_cons_linear_interp);
-
1951  FPr_w.emplace_back(convert(ba_fine, IntVect(0,0,1)), dm_fine, geom[lev] ,
-
1952  convert(ba_crse, IntVect(0,0,1)), dm_crse, geom[lev-1],
-
1953  -cf_width, -cf_set_width, 1, &face_cons_linear_interp);
-
1954 }
-
int cf_set_width
Definition: ERF.H:733
+
1936 {
+
1937  auto& fine_new = vars_new[lev];
+
1938  auto& crse_new = vars_new[lev-1];
+
1939  auto& ba_fine = fine_new[Vars::cons].boxArray();
+
1940  auto& ba_crse = crse_new[Vars::cons].boxArray();
+
1941  auto& dm_fine = fine_new[Vars::cons].DistributionMap();
+
1942  auto& dm_crse = crse_new[Vars::cons].DistributionMap();
+
1943 
+
1944  int ncomp = vars_new[lev][Vars::cons].nComp();
+
1945 
+
1946  FPr_c.emplace_back(ba_fine, dm_fine, geom[lev] ,
+
1947  ba_crse, dm_crse, geom[lev-1],
+
1948  -cf_width, -cf_set_width, ncomp, &cell_cons_interp);
+
1949  FPr_u.emplace_back(convert(ba_fine, IntVect(1,0,0)), dm_fine, geom[lev] ,
+
1950  convert(ba_crse, IntVect(1,0,0)), dm_crse, geom[lev-1],
+
1951  -cf_width, -cf_set_width, 1, &face_cons_linear_interp);
+
1952  FPr_v.emplace_back(convert(ba_fine, IntVect(0,1,0)), dm_fine, geom[lev] ,
+
1953  convert(ba_crse, IntVect(0,1,0)), dm_crse, geom[lev-1],
+
1954  -cf_width, -cf_set_width, 1, &face_cons_linear_interp);
+
1955  FPr_w.emplace_back(convert(ba_fine, IntVect(0,0,1)), dm_fine, geom[lev] ,
+
1956  convert(ba_crse, IntVect(0,0,1)), dm_crse, geom[lev-1],
+
1957  -cf_width, -cf_set_width, 1, &face_cons_linear_interp);
+
1958 }
+
int cf_set_width
Definition: ERF.H:737

@@ -2640,10 +2640,10 @@

-
1125  {
-
1126  return *datalog[i];
-
1127  }
-
amrex::Vector< std::unique_ptr< std::fstream > > datalog
Definition: ERF.H:1255
+
1129  {
+
1130  return *datalog[i];
+
1131  }
+
amrex::Vector< std::unique_ptr< std::fstream > > datalog
Definition: ERF.H:1259

@@ -2672,8 +2672,8 @@

The filename of the ith datalog file.

-
1267 { return datalogname[i]; }
-
amrex::Vector< std::string > datalogname
Definition: ERF.H:1256
+
1271 { return datalogname[i]; }
+
amrex::Vector< std::string > datalogname
Definition: ERF.H:1260
@@ -2700,29 +2700,29 @@

-
1958 {
-
1959  auto& fine_new = vars_new[lev];
-
1960  auto& crse_new = vars_new[lev-1];
-
1961  auto& ba_fine = fine_new[Vars::cons].boxArray();
-
1962  auto& ba_crse = crse_new[Vars::cons].boxArray();
-
1963  auto& dm_fine = fine_new[Vars::cons].DistributionMap();
-
1964  auto& dm_crse = crse_new[Vars::cons].DistributionMap();
-
1965 
-
1966  int ncomp = fine_new[Vars::cons].nComp();
-
1967 
-
1968  FPr_c[lev-1].Define(ba_fine, dm_fine, geom[lev] ,
-
1969  ba_crse, dm_crse, geom[lev-1],
-
1970  -cf_width, -cf_set_width, ncomp, &cell_cons_interp);
-
1971  FPr_u[lev-1].Define(convert(ba_fine, IntVect(1,0,0)), dm_fine, geom[lev] ,
-
1972  convert(ba_crse, IntVect(1,0,0)), dm_crse, geom[lev-1],
-
1973  -cf_width, -cf_set_width, 1, &face_cons_linear_interp);
-
1974  FPr_v[lev-1].Define(convert(ba_fine, IntVect(0,1,0)), dm_fine, geom[lev] ,
-
1975  convert(ba_crse, IntVect(0,1,0)), dm_crse, geom[lev-1],
-
1976  -cf_width, -cf_set_width, 1, &face_cons_linear_interp);
-
1977  FPr_w[lev-1].Define(convert(ba_fine, IntVect(0,0,1)), dm_fine, geom[lev] ,
-
1978  convert(ba_crse, IntVect(0,0,1)), dm_crse, geom[lev-1],
-
1979  -cf_width, -cf_set_width, 1, &face_cons_linear_interp);
-
1980 }
+
1962 {
+
1963  auto& fine_new = vars_new[lev];
+
1964  auto& crse_new = vars_new[lev-1];
+
1965  auto& ba_fine = fine_new[Vars::cons].boxArray();
+
1966  auto& ba_crse = crse_new[Vars::cons].boxArray();
+
1967  auto& dm_fine = fine_new[Vars::cons].DistributionMap();
+
1968  auto& dm_crse = crse_new[Vars::cons].DistributionMap();
+
1969 
+
1970  int ncomp = fine_new[Vars::cons].nComp();
+
1971 
+
1972  FPr_c[lev-1].Define(ba_fine, dm_fine, geom[lev] ,
+
1973  ba_crse, dm_crse, geom[lev-1],
+
1974  -cf_width, -cf_set_width, ncomp, &cell_cons_interp);
+
1975  FPr_u[lev-1].Define(convert(ba_fine, IntVect(1,0,0)), dm_fine, geom[lev] ,
+
1976  convert(ba_crse, IntVect(1,0,0)), dm_crse, geom[lev-1],
+
1977  -cf_width, -cf_set_width, 1, &face_cons_linear_interp);
+
1978  FPr_v[lev-1].Define(convert(ba_fine, IntVect(0,1,0)), dm_fine, geom[lev] ,
+
1979  convert(ba_crse, IntVect(0,1,0)), dm_crse, geom[lev-1],
+
1980  -cf_width, -cf_set_width, 1, &face_cons_linear_interp);
+
1981  FPr_w[lev-1].Define(convert(ba_fine, IntVect(0,0,1)), dm_fine, geom[lev] ,
+
1982  convert(ba_crse, IntVect(0,0,1)), dm_crse, geom[lev-1],
+
1983  -cf_width, -cf_set_width, 1, &face_cons_linear_interp);
+
1984 }
@@ -4666,47 +4666,47 @@

342 }
void init_zlevels(Vector< Vector< Real >> &zlevels_stag, Vector< Geometry > const &geom, Vector< IntVect > const &ref_ratio, const Real grid_stretching_ratio, const Real zsurf, const Real dz0)
Definition: ERF_TerrainMetrics.cpp:11
std::unique_ptr< ProblemBase > amrex_probinit(const amrex_real *problo, const amrex_real *probhi) AMREX_ATTRIBUTE_WEAK
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Hwave_onegrid
Definition: ERF.H:791
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > thin_yforce
Definition: ERF.H:824
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Hwave_onegrid
Definition: ERF.H:795
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > thin_yforce
Definition: ERF.H:828
void setPlotVariables(const std::string &pp_plot_var_names, amrex::Vector< std::string > &plot_var_names)
Definition: ERF_Plotfile.cpp:18
-
void ReadParameters()
Definition: ERF.cpp:1386
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > ay_new
Definition: ERF.H:776
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > z_phys_nd_src
Definition: ERF.H:767
-
amrex::Vector< amrex::MultiFab > base_state_new
Definition: ERF.H:786
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > az
Definition: ERF.H:765
-
amrex::Vector< amrex::Vector< std::unique_ptr< amrex::iMultiFab > > > lmask_lev
Definition: ERF.H:749
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > z_phys_nd_new
Definition: ERF.H:773
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > thin_zforce
Definition: ERF.H:825
-
amrex::Vector< amrex::Vector< std::unique_ptr< amrex::MultiFab > > > sst_lev
Definition: ERF.H:748
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > thin_xforce
Definition: ERF.H:823
-
amrex::Vector< std::string > plot_var_names_1
Definition: ERF.H:879
-
amrex::Vector< amrex::Real > t_old
Definition: ERF.H:662
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > z_t_rk
Definition: ERF.H:779
-
amrex::Vector< std::string > plot_var_names_2
Definition: ERF.H:880
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Lwave_onegrid
Definition: ERF.H:792
-
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > xvel_bc_data
Definition: ERF.H:617
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > ax
Definition: ERF.H:763
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > detJ_cc_src
Definition: ERF.H:768
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > ay_src
Definition: ERF.H:770
-
amrex::Vector< std::unique_ptr< amrex::iMultiFab > > yflux_imask
Definition: ERF.H:818
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > az_new
Definition: ERF.H:777
-
amrex::Vector< amrex::Vector< amrex::MultiFab * > > lsm_flux
Definition: ERF.H:718
+
void ReadParameters()
Definition: ERF.cpp:1390
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > ay_new
Definition: ERF.H:780
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > z_phys_nd_src
Definition: ERF.H:771
+
amrex::Vector< amrex::MultiFab > base_state_new
Definition: ERF.H:790
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > az
Definition: ERF.H:769
+
amrex::Vector< amrex::Vector< std::unique_ptr< amrex::iMultiFab > > > lmask_lev
Definition: ERF.H:753
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > z_phys_nd_new
Definition: ERF.H:777
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > thin_zforce
Definition: ERF.H:829
+
amrex::Vector< amrex::Vector< std::unique_ptr< amrex::MultiFab > > > sst_lev
Definition: ERF.H:752
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > thin_xforce
Definition: ERF.H:827
+
amrex::Vector< std::string > plot_var_names_1
Definition: ERF.H:883
+
amrex::Vector< amrex::Real > t_old
Definition: ERF.H:666
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > z_t_rk
Definition: ERF.H:783
+
amrex::Vector< std::string > plot_var_names_2
Definition: ERF.H:884
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Lwave_onegrid
Definition: ERF.H:796
+
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > xvel_bc_data
Definition: ERF.H:621
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > ax
Definition: ERF.H:767
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > detJ_cc_src
Definition: ERF.H:772
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > ay_src
Definition: ERF.H:774
+
amrex::Vector< std::unique_ptr< amrex::iMultiFab > > yflux_imask
Definition: ERF.H:822
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > az_new
Definition: ERF.H:781
+
amrex::Vector< amrex::Vector< amrex::MultiFab * > > lsm_flux
Definition: ERF.H:722
void refinement_criteria_setup()
Definition: ERF_Tagging.cpp:105
-
amrex::Vector< std::unique_ptr< amrex::FabFactory< amrex::FArrayBox > > > m_factory
Definition: ERF.H:1275
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > ax_src
Definition: ERF.H:769
-
amrex::Vector< amrex::Vector< amrex::Real > > zlevels_stag
Definition: ERF.H:758
-
amrex::Vector< amrex::Vector< amrex::MultiFab * > > lsm_data
Definition: ERF.H:717
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > az_src
Definition: ERF.H:771
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Lwave
Definition: ERF.H:790
-
amrex::Vector< std::unique_ptr< amrex::iMultiFab > > zflux_imask
Definition: ERF.H:819
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > ay
Definition: ERF.H:764
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > ax_new
Definition: ERF.H:775
-
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > zvel_bc_data
Definition: ERF.H:619
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > detJ_cc_new
Definition: ERF.H:774
-
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > yvel_bc_data
Definition: ERF.H:618
-
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Hwave
Definition: ERF.H:789
-
amrex::Vector< int > istep
Definition: ERF.H:657
-
amrex::Vector< std::unique_ptr< amrex::iMultiFab > > xflux_imask
Definition: ERF.H:817
+
amrex::Vector< std::unique_ptr< amrex::FabFactory< amrex::FArrayBox > > > m_factory
Definition: ERF.H:1279
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > ax_src
Definition: ERF.H:773
+
amrex::Vector< amrex::Vector< amrex::Real > > zlevels_stag
Definition: ERF.H:762
+
amrex::Vector< amrex::Vector< amrex::MultiFab * > > lsm_data
Definition: ERF.H:721
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > az_src
Definition: ERF.H:775
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Lwave
Definition: ERF.H:794
+
amrex::Vector< std::unique_ptr< amrex::iMultiFab > > zflux_imask
Definition: ERF.H:823
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > ay
Definition: ERF.H:768
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > ax_new
Definition: ERF.H:779
+
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > zvel_bc_data
Definition: ERF.H:623
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > detJ_cc_new
Definition: ERF.H:778
+
amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real > > yvel_bc_data
Definition: ERF.H:622
+
amrex::Vector< std::unique_ptr< amrex::MultiFab > > Hwave
Definition: ERF.H:793
+
amrex::Vector< int > istep
Definition: ERF.H:661
+
amrex::Vector< std::unique_ptr< amrex::iMultiFab > > xflux_imask
Definition: ERF.H:821
void initializeMicrophysics(const int &)
Definition: ERF.cpp:1211
void ReSize(const int &nlev)
Definition: ERF_LandSurface.H:19
const char * buildInfoGetGitHash(int i)
@@ -4866,7 +4866,7 @@

96  ref_tags[j](tags,mf.get(),clearval,tagval,time,levc,geom[levc]);
97  } // loop over j
98 }
-
static amrex::Vector< amrex::AMRErrorTag > ref_tags
Definition: ERF.H:1057
+
static amrex::Vector< amrex::AMRErrorTag > ref_tags
Definition: ERF.H:1061
void erf_derscalar(const Box &bx, FArrayBox &derfab, int, int, const FArrayBox &datfab, const Geometry &, Real, const int *, const int)
Definition: ERF_Derive.cpp:165
void erf_dertheta(const Box &bx, FArrayBox &derfab, int, int, const FArrayBox &datfab, const Geometry &, Real, const int *, const int)
Definition: ERF_Derive.cpp:144
@@ -5099,10 +5099,10 @@

236  }

237 }
constexpr amrex::Real Gamma
Definition: ERF_Constants.H:19
-
amrex::Vector< amrex::Real > dz_min
Definition: ERF.H:1065
-
amrex::Vector< amrex::Real > fixed_dt
Definition: ERF.H:850
-
amrex::Vector< amrex::Real > fixed_fast_dt
Definition: ERF.H:851
-
static amrex::Real cfl
Definition: ERF.H:845
+
amrex::Vector< amrex::Real > dz_min
Definition: ERF.H:1069
+
amrex::Vector< amrex::Real > fixed_dt
Definition: ERF.H:854
+
amrex::Vector< amrex::Real > fixed_fast_dt
Definition: ERF.H:855
+
static amrex::Real cfl
Definition: ERF.H:849
@ rho
Definition: ERF_Kessler.H:30
int force_stage1_single_substep
Definition: ERF_DataStruct.H:544
amrex::Vector< SubsteppingType > substepping_type
Definition: ERF_DataStruct.H:546
@@ -5215,26 +5215,26 @@

429 
430  BL_PROFILE_VAR_STOP(evolve);
431 }
-
int last_check_file_step
Definition: ERF.H:830
-
int max_step
Definition: ERF.H:837
-
int last_plot_file_step_2
Definition: ERF.H:828
+
int last_check_file_step
Definition: ERF.H:834
+
int max_step
Definition: ERF.H:841
+
int last_plot_file_step_2
Definition: ERF.H:832
void WritePlotFile(int which, amrex::Vector< std::string > plot_var_names)
Definition: ERF_Plotfile.cpp:190
-
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_extdir_vals
Definition: ERF.H:808
-
amrex::Real m_plot_per_1
Definition: ERF.H:863
-
std::string check_type
Definition: ERF.H:874
-
int m_plot_int_1
Definition: ERF.H:861
+
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_extdir_vals
Definition: ERF.H:812
+
amrex::Real m_plot_per_1
Definition: ERF.H:867
+
std::string check_type
Definition: ERF.H:878
+
int m_plot_int_1
Definition: ERF.H:865
void post_timestep(int nstep, amrex::Real time, amrex::Real dt_lev)
Definition: ERF.cpp:435
-
amrex::Real m_check_per
Definition: ERF.H:877
-
int m_check_int
Definition: ERF.H:876
-
int last_plot_file_step_1
Definition: ERF.H:827
-
static int input_bndry_planes
Definition: ERF.H:994
+
amrex::Real m_check_per
Definition: ERF.H:881
+
int m_check_int
Definition: ERF.H:880
+
int last_plot_file_step_1
Definition: ERF.H:831
+
static int input_bndry_planes
Definition: ERF.H:998
void ComputeDt(int step=-1)
Definition: ERF_ComputeTimestep.cpp:11
void WriteCheckpointFile() const
Definition: ERF_Checkpoint.cpp:25
-
int m_plot_int_2
Definition: ERF.H:862
-
std::unique_ptr< ReadBndryPlanes > m_r2d
Definition: ERF.H:1051
-
bool writeNow(const amrex::Real cur_time, const amrex::Real dt, const int nstep, const int plot_int, const amrex::Real plot_per)
Definition: ERF.cpp:2088
+
int m_plot_int_2
Definition: ERF.H:866
+
std::unique_ptr< ReadBndryPlanes > m_r2d
Definition: ERF.H:1055
+
bool writeNow(const amrex::Real cur_time, const amrex::Real dt, const int nstep, const int plot_int, const amrex::Real plot_per)
Definition: ERF.cpp:2092
void timeStep(int lev, amrex::Real time, int iteration)
Definition: ERF_TimeStep.cpp:16
-
amrex::Real m_plot_per_2
Definition: ERF.H:864
+
amrex::Real m_plot_per_2
Definition: ERF.H:868

Referenced by main().

@@ -5272,7 +5272,7 @@

-
1278 { return *m_factory[lev]; }
+
1282 { return *m_factory[lev]; }

@@ -5418,7 +5418,7 @@

128 }
#define RhoScalar_comp
Definition: ERF_IndexDefines.H:41
#define NSCALARS
Definition: ERF_IndexDefines.H:16
-
amrex::Gpu::DeviceVector< amrex::BCRec > domain_bcs_type_d
Definition: ERF.H:802
+
amrex::Gpu::DeviceVector< amrex::BCRec > domain_bcs_type_d
Definition: ERF.H:806
@ RhoScalar_bc_comp
Definition: ERF_IndexDefines.H:72
@ zvel_bc
Definition: ERF_IndexDefines.H:82
@ yvel_bc
Definition: ERF_IndexDefines.H:81
@@ -6091,7 +6091,7 @@

AMREX_GPU_HOST AMREX_FORCE_INLINE void ApplyMask(amrex::MultiFab &dst, const amrex::iMultiFab &imask, const int nghost=0)
Definition: ERF_Utils.H:363
void fill_from_bndryregs(const amrex::Vector< amrex::MultiFab * > &mfs, amrex::Real time)
Definition: ERF_BoundaryConditions_bndryreg.cpp:13
void FillIntermediatePatch(int lev, amrex::Real 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, bool allow_most_bcs=true)
Definition: ERF_FillPatch.cpp:308
-
static bool use_real_bcs
Definition: ERF.H:965
+
static bool use_real_bcs
Definition: ERF.H:969
@ NumTypes
Definition: ERF_IndexDefines.H:135
Here is the call graph for this function:
@@ -6507,7 +6507,7 @@

34  }
35  return r;
36 }
-
amrex::Array< std::string, 2 *AMREX_SPACEDIM > domain_bc_type
Definition: ERF.H:805
+
amrex::Array< std::string, 2 *AMREX_SPACEDIM > domain_bc_type
Definition: ERF.H:809
@@ -6534,9 +6534,9 @@

-
1118  {
-
1119  return advflux_reg[lev];
-
1120  }
+
1122  {
+
1123  return advflux_reg[lev];
+
1124  }
@@ -6562,20 +6562,20 @@

-
1195  {
-
1196  int numCores = amrex::ParallelDescriptor::NProcs();
-
1197 #ifdef _OPENMP
-
1198  numCores = numCores * omp_get_max_threads();
-
1199 #endif
-
1200 
-
1201  amrex::Real T =
-
1202  numCores * (amrex::ParallelDescriptor::second() - startCPUTime) +
- +
1199  {
+
1200  int numCores = amrex::ParallelDescriptor::NProcs();
+
1201 #ifdef _OPENMP
+
1202  numCores = numCores * omp_get_max_threads();
+
1203 #endif
1204 
-
1205  return T;
-
1206  }
-
static amrex::Real previousCPUTimeUsed
Definition: ERF.H:1191
-
static amrex::Real startCPUTime
Definition: ERF.H:1190
+
1205  amrex::Real T =
+
1206  numCores * (amrex::ParallelDescriptor::second() - startCPUTime) +
+ +
1208 
+
1209  return T;
+
1210  }
+
static amrex::Real previousCPUTimeUsed
Definition: ERF.H:1195
+
static amrex::Real startCPUTime
Definition: ERF.H:1194
@ T
Definition: ERF_IndexDefines.H:91
@@ -7260,7 +7260,7 @@

@ inflow
void init_Dirichlet_bc_data(const std::string input_file)
Definition: ERF_init_bcs.cpp:611
-
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_neumann_vals
Definition: ERF.H:811
+
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_neumann_vals
Definition: ERF.H:815
@ RhoQ6_bc_comp
Definition: ERF_IndexDefines.H:78
@ RhoQ4_bc_comp
Definition: ERF_IndexDefines.H:76
@ RhoKE_bc_comp
Definition: ERF_IndexDefines.H:70
@@ -7656,66 +7656,92 @@

65  // this will calculate the hydrostatically balanced density and pressure
66  // profiles following WRF ideal.exe
-
68  }
-
69 
-
70  auto& lev_new = vars_new[lev];
-
71 
-
72  // update if init_sounding_ideal == true
-
73  MultiFab r_hse (base_state[lev], make_alias, 0, 1); // r_0 is first component
-
74  MultiFab p_hse (base_state[lev], make_alias, 1, 1); // p_0 is second component
-
75  MultiFab pi_hse(base_state[lev], make_alias, 2, 1); // pi_0 is third component
-
76 
-
77  const Real l_gravity = solverChoice.gravity;
-
78  const Real l_rdOcp = solverChoice.rdOcp;
-
79  const bool l_moist = (solverChoice.moisture_type != MoistureType::None);
-
80 
-
81 #ifdef _OPENMP
-
82 #pragma omp parallel if (Gpu::notInLaunchRegion())
-
83 #endif
-
84  for (MFIter mfi(lev_new[Vars::cons], TilingIfNotGPU()); mfi.isValid(); ++mfi) {
-
85  const Box &bx = mfi.tilebox();
-
86  const auto &cons_arr = lev_new[Vars::cons].array(mfi);
-
87  const auto &xvel_arr = lev_new[Vars::xvel].array(mfi);
-
88  const auto &yvel_arr = lev_new[Vars::yvel].array(mfi);
-
89  const auto &zvel_arr = lev_new[Vars::zvel].array(mfi);
-
90  Array4<Real> r_hse_arr = r_hse.array(mfi);
-
91  Array4<Real> p_hse_arr = p_hse.array(mfi);
-
92  Array4<Real> pi_hse_arr = pi_hse.array(mfi);
-
93 
-
94  Array4<Real const> z_cc_arr = (solverChoice.use_terrain) ? z_phys_cc[lev]->const_array(mfi) : Array4<Real const>{};
-
95  Array4<Real const> z_nd_arr = (solverChoice.use_terrain) ? z_phys_nd[lev]->const_array(mfi) : Array4<Real const>{};
+
68 
+
69  } else {
+
70  //
+
71  // We need to do this interp from coarse level in order to set the values of
+
72  // the base state inside the domain but outside of the fine region
+
73  //
+
74  base_state[lev-1].FillBoundary(geom[lev-1].periodicity());
+
75  //
+
76  // NOTE: this interpolater assumes that ALL ghost cells of the coarse MultiFab
+
77  // have been pre-filled - this includes ghost cells both inside and outside
+
78  // the domain
+
79  //
+
80  InterpFromCoarseLevel(base_state[lev], base_state[lev].nGrowVect(),
+
81  IntVect(0,0,0), // do not fill ghost cells outside the domain
+
82  base_state[lev-1], 0, 0, 3,
+
83  geom[lev-1], geom[lev],
+
84  refRatio(lev-1), &cell_cons_interp,
+ +
86 
+
87  // We need to do this here because the interpolation above may leave corners unfilled
+
88  // when the corners need to be filled by, for example, reflection of the fine ghost
+
89  // cell outside the fine region but inide the domain.
+
90  int bccomp = BCVars::base_bc;
+
91  int icomp = 0; int ncomp = 3; Real dummy_time = 0.;
+
92  (*physbcs_base[lev])(base_state[lev],icomp,ncomp,base_state[lev].nGrowVect(),dummy_time,bccomp);
+
93  }
+
94 
+
95  auto& lev_new = vars_new[lev];
96 
- -
98  {
-
99  // HSE will be initialized here, interpolated from values previously
-
100  // calculated by calc_rho_p()
- -
102  bx, cons_arr,
-
103  r_hse_arr, p_hse_arr, pi_hse_arr,
-
104  geom[lev].data(), z_cc_arr,
-
105  l_gravity, l_rdOcp, l_moist, input_sounding_data);
-
106  }
-
107  else
-
108  {
-
109  // HSE will be calculated later with call to initHSE
- -
111  bx, cons_arr,
-
112  geom[lev].data(), z_cc_arr,
-
113  l_moist, input_sounding_data);
-
114  }
-
115 
- -
117  bx, xvel_arr, yvel_arr, zvel_arr,
-
118  geom[lev].data(), z_nd_arr,
- -
120 
-
121  } //mfi
-
122 }
-
void init_bx_scalars_from_input_sounding(const Box &bx, Array4< Real > const &state, GeometryData const &geomdata, Array4< const Real > const &z_cc_arr, const bool &l_moist, InputSoundingData const &inputSoundingData)
Definition: ERF_init_from_input_sounding.cpp:134
-
void init_bx_velocities_from_input_sounding(const Box &bx, Array4< Real > const &x_vel, Array4< Real > const &y_vel, Array4< Real > const &z_vel, GeometryData const &geomdata, Array4< const Real > const &z_nd_arr, InputSoundingData const &inputSoundingData)
Definition: ERF_init_from_input_sounding.cpp:282
-
void init_bx_scalars_from_input_sounding_hse(const Box &bx, Array4< Real > const &state, Array4< Real > const &r_hse_arr, Array4< Real > const &p_hse_arr, Array4< Real > const &pi_hse_arr, GeometryData const &geomdata, Array4< const Real > const &z_cc_arr, const Real &l_gravity, const Real &l_rdOcp, const bool &l_moist, InputSoundingData const &inputSoundingData)
Definition: ERF_init_from_input_sounding.cpp:195
-
static bool init_sounding_ideal
Definition: ERF.H:977
-
InputSoundingData input_sounding_data
Definition: ERF.H:611
+
97  // update if init_sounding_ideal == true
+
98  MultiFab r_hse (base_state[lev], make_alias, 0, 1); // r_0 is first component
+
99  MultiFab p_hse (base_state[lev], make_alias, 1, 1); // p_0 is second component
+
100  MultiFab pi_hse(base_state[lev], make_alias, 2, 1); // pi_0 is third component
+
101 
+
102  const Real l_gravity = solverChoice.gravity;
+
103  const Real l_rdOcp = solverChoice.rdOcp;
+
104  const bool l_moist = (solverChoice.moisture_type != MoistureType::None);
+
105 
+
106 #ifdef _OPENMP
+
107 #pragma omp parallel if (Gpu::notInLaunchRegion())
+
108 #endif
+
109  for (MFIter mfi(lev_new[Vars::cons], TilingIfNotGPU()); mfi.isValid(); ++mfi) {
+
110  const Box &bx = mfi.tilebox();
+
111  const auto &cons_arr = lev_new[Vars::cons].array(mfi);
+
112  const auto &xvel_arr = lev_new[Vars::xvel].array(mfi);
+
113  const auto &yvel_arr = lev_new[Vars::yvel].array(mfi);
+
114  const auto &zvel_arr = lev_new[Vars::zvel].array(mfi);
+
115  Array4<Real> r_hse_arr = r_hse.array(mfi);
+
116  Array4<Real> p_hse_arr = p_hse.array(mfi);
+
117  Array4<Real> pi_hse_arr = pi_hse.array(mfi);
+
118 
+
119  Array4<Real const> z_cc_arr = (solverChoice.use_terrain) ? z_phys_cc[lev]->const_array(mfi) : Array4<Real const>{};
+
120  Array4<Real const> z_nd_arr = (solverChoice.use_terrain) ? z_phys_nd[lev]->const_array(mfi) : Array4<Real const>{};
+
121 
+ +
123  {
+
124  // HSE will be initialized here, interpolated from values previously
+
125  // calculated by calc_rho_p()
+ +
127  bx, cons_arr,
+
128  r_hse_arr, p_hse_arr, pi_hse_arr,
+
129  geom[lev].data(), z_cc_arr,
+
130  l_gravity, l_rdOcp, l_moist, input_sounding_data);
+
131  }
+
132  else
+
133  {
+
134  // HSE will be calculated later with call to initHSE
+ +
136  bx, cons_arr,
+
137  geom[lev].data(), z_cc_arr,
+
138  l_moist, input_sounding_data);
+
139  }
+
140 
+ +
142  bx, xvel_arr, yvel_arr, zvel_arr,
+
143  geom[lev].data(), z_nd_arr,
+ +
145 
+
146  } //mfi
+
147 }
+
void init_bx_scalars_from_input_sounding(const Box &bx, Array4< Real > const &state, GeometryData const &geomdata, Array4< const Real > const &z_cc_arr, const bool &l_moist, InputSoundingData const &inputSoundingData)
Definition: ERF_init_from_input_sounding.cpp:159
+
void init_bx_velocities_from_input_sounding(const Box &bx, Array4< Real > const &x_vel, Array4< Real > const &y_vel, Array4< Real > const &z_vel, GeometryData const &geomdata, Array4< const Real > const &z_nd_arr, InputSoundingData const &inputSoundingData)
Definition: ERF_init_from_input_sounding.cpp:309
+
void init_bx_scalars_from_input_sounding_hse(const Box &bx, Array4< Real > const &state, Array4< Real > const &r_hse_arr, Array4< Real > const &p_hse_arr, Array4< Real > const &pi_hse_arr, GeometryData const &geomdata, Array4< const Real > const &z_cc_arr, const Real &l_gravity, const Real &l_rdOcp, const bool &l_moist, InputSoundingData const &inputSoundingData)
Definition: ERF_init_from_input_sounding.cpp:220
+
static bool init_sounding_ideal
Definition: ERF.H:981
+
InputSoundingData input_sounding_data
Definition: ERF.H:615
+
@ base_bc
Definition: ERF_IndexDefines.H:79
void resize_arrays()
Definition: ERF_InputSoundingData.H:60
int n_sounding_files
Definition: ERF_InputSoundingData.H:316
void read_from_file(const amrex::Geometry &geom, const amrex::Vector< amrex::Real > &zlevels_stag, int itime)
Definition: ERF_InputSoundingData.H:77
@@ -8060,85 +8086,89 @@

1301  // The base state is initialized by integrating vertically through the
1302  // input sounding, if the init_sounding_ideal flag is set; otherwise
1303  // it is set by initHSE()
- -
1305 
-
1306  // The physbc's need the terrain but are needed for initHSE
-
1307  make_physbcs(lev);
-
1308 
-
1309  if (init_sounding_ideal) {
-
1310  AMREX_ALWAYS_ASSERT_WITH_MESSAGE(solverChoice.use_gravity,
-
1311  "Gravity should be on to be consistent with sounding initialization.");
-
1312  } else {
-
1313  initHSE();
-
1314  }
-
1315 
-
1316 #ifdef ERF_USE_NETCDF
-
1317  } else if (init_type == "ideal" || init_type == "real") {
-
1318  // The base state is initialized from WRF wrfinput data, output by
-
1319  // ideal.exe or real.exe
-
1320  init_from_wrfinput(lev);
-
1321 
-
1322  // The physbc's need the terrain but are needed for initHSE
-
1323  if (init_type == "ideal") {
-
1324  make_physbcs(lev);
-
1325  initHSE(lev);
-
1326  }
-
1327 
-
1328  } else if (init_type == "metgrid") {
-
1329  // The base state is initialized from data output by WPS metgrid;
-
1330  // we will rebalance after interpolation
-
1331  init_from_metgrid(lev);
-
1332 #endif
-
1333  } else if (init_type == "uniform") {
-
1334  // Initialize a uniform background field and base state based on the
-
1335  // problem-specified reference density and temperature
-
1336 
-
1337  // The physbc's need the terrain but are needed for initHSE
-
1338  make_physbcs(lev);
-
1339 
-
1340  init_uniform(lev);
-
1341  initHSE(lev);
-
1342  } else {
-
1343  // No background flow initialization specified, initialize the
-
1344  // background field to be equal to the base state, calculated from the
-
1345  // problem-specific erf_init_dens_hse
-
1346 
-
1347  // The bc's need the terrain but are needed for initHSE
-
1348  make_physbcs(lev);
-
1349 
-
1350  // We will initialize the state from the background state so must set that first
-
1351  initHSE(lev);
-
1352  init_from_hse(lev);
-
1353  }
-
1354 
-
1355  // Add problem-specific flow features
-
1356  //
-
1357  // Notes:
-
1358  // - This calls init_custom_pert that is defined for each problem
-
1359  // - This may modify the base state
-
1360  // - The fields set by init_custom_pert are **perturbations** to the
-
1361  // background flow set based on init_type
-
1362  init_custom(lev);
-
1363 
-
1364  // Ensure that the face-based data are the same on both sides of a periodic domain.
-
1365  // The data associated with the lower grid ID is considered the correct value.
-
1366  lev_new[Vars::xvel].OverrideSync(geom[lev].periodicity());
-
1367  lev_new[Vars::yvel].OverrideSync(geom[lev].periodicity());
-
1368  lev_new[Vars::zvel].OverrideSync(geom[lev].periodicity());
-
1369 
-
1370  if(solverChoice.spongeChoice.sponge_type == "input_sponge"){
-
1371  input_sponge(lev);
-
1372  }
+
1304 
+
1305  // The physbc's need the terrain but are needed for initHSE
+
1306  // We have already made the terrain in the call to init_zphys
+
1307  // in MakeNewLevelFromScratch
+
1308  make_physbcs(lev);
+
1309 
+
1310  // Now init the base state and the data itself
+ +
1312 
+
1313  if (init_sounding_ideal) {
+
1314  AMREX_ALWAYS_ASSERT_WITH_MESSAGE(solverChoice.use_gravity,
+
1315  "Gravity should be on to be consistent with sounding initialization.");
+
1316  } else {
+
1317  initHSE();
+
1318  }
+
1319 
+
1320 #ifdef ERF_USE_NETCDF
+
1321  } else if (init_type == "ideal" || init_type == "real") {
+
1322  // The base state is initialized from WRF wrfinput data, output by
+
1323  // ideal.exe or real.exe
+
1324  init_from_wrfinput(lev);
+
1325 
+
1326  // The physbc's need the terrain but are needed for initHSE
+
1327  if (init_type == "ideal") {
+
1328  make_physbcs(lev);
+
1329  initHSE(lev);
+
1330  }
+
1331 
+
1332  } else if (init_type == "metgrid") {
+
1333  // The base state is initialized from data output by WPS metgrid;
+
1334  // we will rebalance after interpolation
+
1335  init_from_metgrid(lev);
+
1336 #endif
+
1337  } else if (init_type == "uniform") {
+
1338  // Initialize a uniform background field and base state based on the
+
1339  // problem-specified reference density and temperature
+
1340 
+
1341  // The physbc's need the terrain but are needed for initHSE
+
1342  make_physbcs(lev);
+
1343 
+
1344  init_uniform(lev);
+
1345  initHSE(lev);
+
1346  } else {
+
1347  // No background flow initialization specified, initialize the
+
1348  // background field to be equal to the base state, calculated from the
+
1349  // problem-specific erf_init_dens_hse
+
1350 
+
1351  // The bc's need the terrain but are needed for initHSE
+
1352  make_physbcs(lev);
+
1353 
+
1354  // We will initialize the state from the background state so must set that first
+
1355  initHSE(lev);
+
1356  init_from_hse(lev);
+
1357  }
+
1358 
+
1359  // Add problem-specific flow features
+
1360  //
+
1361  // Notes:
+
1362  // - This calls init_custom_pert that is defined for each problem
+
1363  // - This may modify the base state
+
1364  // - The fields set by init_custom_pert are **perturbations** to the
+
1365  // background flow set based on init_type
+
1366  init_custom(lev);
+
1367 
+
1368  // Ensure that the face-based data are the same on both sides of a periodic domain.
+
1369  // The data associated with the lower grid ID is considered the correct value.
+
1370  lev_new[Vars::xvel].OverrideSync(geom[lev].periodicity());
+
1371  lev_new[Vars::yvel].OverrideSync(geom[lev].periodicity());
+
1372  lev_new[Vars::zvel].OverrideSync(geom[lev].periodicity());
1373 
-
1374  // Initialize turbulent perturbation
-
1375  if (solverChoice.pert_type == PerturbationType::Source ||
-
1376  solverChoice.pert_type == PerturbationType::Direct) {
-
1377  if (lev == 0) {
-
1378  turbPert_update(lev, 0.);
-
1379  turbPert_amplitude(lev);
-
1380  }
-
1381  }
-
1382 }
+
1374  if(solverChoice.spongeChoice.sponge_type == "input_sponge"){
+
1375  input_sponge(lev);
+
1376  }
+
1377 
+
1378  // Initialize turbulent perturbation
+
1379  if (solverChoice.pert_type == PerturbationType::Source ||
+
1380  solverChoice.pert_type == PerturbationType::Direct) {
+
1381  if (lev == 0) {
+
1382  turbPert_update(lev, 0.);
+
1383  turbPert_amplitude(lev);
+
1384  }
+
1385  }
+
1386 }
void init_from_input_sounding(int lev)
Definition: ERF_init_from_input_sounding.cpp:49
void init_custom(int lev)
Definition: ERF_init_custom.cpp:26
void init_bcs()
Definition: ERF_init_bcs.cpp:20
@@ -8148,7 +8178,7 @@

void input_sponge(int lev)
Definition: ERF_init_sponge.cpp:17
void make_physbcs(int lev)
Definition: ERF_make_new_arrays.cpp:538
void init_uniform(int lev)
Definition: ERF_init_uniform.cpp:17
-
static std::string init_type
Definition: ERF.H:958
+
static std::string init_type
Definition: ERF.H:962
void turbPert_amplitude(const int lev)
Definition: ERF_init_TurbPert.cpp:44
bool use_gravity
Definition: ERF_DataStruct.H:562
@@ -8540,7 +8570,7 @@

347  #endif
348 }
#define NDRY
Definition: ERF_IndexDefines.H:13
-
static AMREX_FORCE_INLINE int ComputeGhostCells(const AdvChoice &advChoice, bool use_num_diff)
Definition: ERF.H:1069
+
static AMREX_FORCE_INLINE int ComputeGhostCells(const AdvChoice &advChoice, bool use_num_diff)
Definition: ERF.H:1073
bool test_mapfactor
Definition: ERF_DataStruct.H:555
TerrainType terrain_type
Definition: ERF_DataStruct.H:625
void init_tpi(const int lev, const amrex::IntVect &nx, const amrex::GpuArray< amrex::Real, 3 > dx, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm, const int ngrow_state)
Definition: ERF_TurbPertStruct.H:29
@@ -9315,40 +9345,40 @@

1206 
1207 }
void initRayleigh()
Initialize Rayleigh damping profiles.
Definition: ERF_init_rayleigh.cpp:14
-
amrex::Vector< std::string > samplelinelogname
Definition: ERF.H:1263
+
amrex::Vector< std::string > samplelinelogname
Definition: ERF.H:1267
void setRayleighRefFromSounding(bool restarting)
Set Rayleigh mean profiles from input sounding.
Definition: ERF_init_rayleigh.cpp:55
-
amrex::Vector< amrex::IntVect > sampleline
Definition: ERF.H:1264
-
amrex::Vector< amrex::Vector< amrex::Real > > h_w_subsid
Definition: ERF.H:1006
-
static amrex::Real sum_per
Definition: ERF.H:952
-
void setRecordDataInfo(int i, const std::string &filename)
Definition: ERF.H:1208
+
amrex::Vector< amrex::IntVect > sampleline
Definition: ERF.H:1268
+
amrex::Vector< amrex::Vector< amrex::Real > > h_w_subsid
Definition: ERF.H:1010
+
static amrex::Real sum_per
Definition: ERF.H:956
+
void setRecordDataInfo(int i, const std::string &filename)
Definition: ERF.H:1212
void write_1D_profiles_stag(amrex::Real time)
Definition: ERF_Write1DProfiles_stag.cpp:23
-
amrex::Vector< std::unique_ptr< std::fstream > > samplelinelog
Definition: ERF.H:1262
-
static int sum_interval
Definition: ERF.H:950
-
static int pert_interval
Definition: ERF.H:951
+
amrex::Vector< std::unique_ptr< std::fstream > > samplelinelog
Definition: ERF.H:1266
+
static int sum_interval
Definition: ERF.H:954
+
static int pert_interval
Definition: ERF.H:955
void restart()
Definition: ERF.cpp:1247
void ReadCheckpointFileMOST()
Definition: ERF_Checkpoint.cpp:567
void write_1D_profiles(amrex::Real time)
Definition: ERF_Write1DProfiles.cpp:15
-
int profile_int
Definition: ERF.H:869
-
bool destag_profiles
Definition: ERF.H:870
+
int profile_int
Definition: ERF.H:873
+
bool destag_profiles
Definition: ERF.H:874
void appendPlotVariables(const std::string &pp_plot_var_names, amrex::Vector< std::string > &plot_var_names)
Definition: ERF_Plotfile.cpp:132
-
static int output_bndry_planes
Definition: ERF.H:988
-
void AverageDown()
Definition: ERF.cpp:1823
-
static amrex::Real bndry_output_planes_start_time
Definition: ERF.H:991
-
std::string restart_chkfile
Definition: ERF.H:842
-
amrex::Vector< std::string > sampleptlogname
Definition: ERF.H:1259
+
static int output_bndry_planes
Definition: ERF.H:992
+
void AverageDown()
Definition: ERF.cpp:1827
+
static amrex::Real bndry_output_planes_start_time
Definition: ERF.H:995
+
std::string restart_chkfile
Definition: ERF.H:846
+
amrex::Vector< std::string > sampleptlogname
Definition: ERF.H:1263
void sum_integrated_quantities(amrex::Real time)
Definition: ERF_WriteScalarProfiles.cpp:14
-
amrex::Vector< std::unique_ptr< std::fstream > > sampleptlog
Definition: ERF.H:1258
-
std::unique_ptr< WriteBndryPlanes > m_w2d
Definition: ERF.H:1050
+
amrex::Vector< std::unique_ptr< std::fstream > > sampleptlog
Definition: ERF.H:1262
+
std::unique_ptr< WriteBndryPlanes > m_w2d
Definition: ERF.H:1054
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_init_geowind.cpp:15
void initSponge()
Initialize sponge profiles.
Definition: ERF_init_sponge.cpp:35
static bool is_it_time_for_action(int nstep, amrex::Real time, amrex::Real dt, int action_interval, amrex::Real action_per)
Definition: ERF_WriteScalarProfiles.cpp:464
void project_velocities(int lev, amrex::Real dt, amrex::Vector< amrex::MultiFab > &vars, amrex::MultiFab &p)
Definition: ERF_PoissonSolve.cpp:50
-
int plot_file_on_restart
Definition: ERF.H:831
-
void Construct_ERFFillPatchers(int lev)
Definition: ERF.cpp:1931
-
void setRecordSampleLineInfo(int i, int lev, amrex::IntVect &cell, const std::string &filename)
Definition: ERF.H:1238
+
int plot_file_on_restart
Definition: ERF.H:835
+
void Construct_ERFFillPatchers(int lev)
Definition: ERF.cpp:1935
+
void setRecordSampleLineInfo(int i, int lev, amrex::IntVect &cell, const std::string &filename)
Definition: ERF.H:1242
void setSpongeRefFromSounding(bool restarting)
Set sponge mean profiles from input sounding.
Definition: ERF_init_sponge.cpp:65
-
amrex::Vector< amrex::IntVect > samplepoint
Definition: ERF.H:1260
-
void setRecordSamplePointInfo(int i, int lev, amrex::IntVect &cell, const std::string &filename)
Definition: ERF.H:1221
+
amrex::Vector< amrex::IntVect > samplepoint
Definition: ERF.H:1264
+
void setRecordSamplePointInfo(int i, int lev, amrex::IntVect &cell, const std::string &filename)
Definition: ERF.H:1225
static MoistureModelType modelType(const MoistureType a_moisture_type)
query if a specified moisture model is Eulerian or Lagrangian
Definition: ERF_Microphysics.H:64
bool have_geo_wind_profile
Definition: ERF_DataStruct.H:635
bool project_initial_velocity
Definition: ERF_DataStruct.H:587
@@ -9421,7 +9451,7 @@

623  }
624  }
625 }
-
amrex::Real start_time
Definition: ERF.H:838
+
amrex::Real start_time
Definition: ERF.H:842
@@ -9592,7 +9622,6 @@

127 }
void ChopGrids2D(BoxArray &ba, const Box &domain, int target_size)
Definition: ERF_ChopGrids.cpp:21
void erf_enforce_hse(int lev, amrex::MultiFab &dens, amrex::MultiFab &pres, amrex::MultiFab &pi, std::unique_ptr< amrex::MultiFab > &z_cc)
Definition: ERF_init1d.cpp:149
-
@ base_bc
Definition: ERF_IndexDefines.H:79
bool use_moist_background
Definition: ERF_DataStruct.H:641
Here is the call graph for this function:
@@ -9849,7 +9878,7 @@

43  }
44  }
45 }
-
amrex::Vector< amrex::Vector< amrex::Vector< amrex::Real > > > h_rayleigh_ptrs
Definition: ERF.H:1025
+
amrex::Vector< amrex::Vector< amrex::Vector< amrex::Real > > > h_rayleigh_ptrs
Definition: ERF.H:1029
amrex::Real rayleigh_zdamp
Definition: ERF_DataStruct.H:571
amrex::Real rayleigh_ztop
Definition: ERF_DataStruct.H:572
@@ -9900,7 +9929,7 @@

53 
54  }
55 }
-
amrex::Vector< amrex::Vector< amrex::Vector< amrex::Real > > > h_sponge_ptrs
Definition: ERF.H:1028
+
amrex::Vector< amrex::Vector< amrex::Vector< amrex::Real > > > h_sponge_ptrs
Definition: ERF.H:1032
@@ -9937,7 +9966,7 @@

26  input_sponge_data.read_from_file(geom[lev], zlevels_stag[lev]);
27  }
28 }
-
InputSpongeData input_sponge_data
Definition: ERF.H:614
+
InputSpongeData input_sponge_data
Definition: ERF.H:618
void read_from_file(const amrex::Geometry &geom, const amrex::Vector< amrex::Real > &zlevels_stag)
Definition: ERF_InputSpongeData.H:28
std::string input_sponge_file
Definition: ERF_InputSpongeData.H:111
@@ -10100,49 +10129,49 @@

-
1777 {
-
1778  // Get the number of cells in z at level 0
-
1779  int dir_z = AMREX_SPACEDIM-1;
-
1780  auto domain = geom[0].Domain();
-
1781  int size_z = domain.length(dir_z);
-
1782  int start_z = domain.smallEnd()[dir_z];
-
1783  Real area_z = static_cast<Real>(domain.length(0)*domain.length(1));
-
1784 
-
1785  // resize the level 0 horizontal average vectors
-
1786  h_havg.resize(size_z, 0.0_rt);
-
1787 
-
1788  // Get the cell centered data and construct sums
-
1789 #ifdef _OPENMP
-
1790 #pragma omp parallel if (Gpu::notInLaunchRegion())
-
1791 #endif
-
1792  for (MFIter mfi(S); mfi.isValid(); ++mfi) {
-
1793  const Box& box = mfi.validbox();
-
1794  const IntVect& se = box.smallEnd();
-
1795  const IntVect& be = box.bigEnd();
-
1796 
-
1797  auto fab_arr = S[mfi].array();
-
1798 
-
1799  FArrayBox fab_reduce(box, 1, The_Async_Arena());
-
1800  auto arr_reduce = fab_reduce.array();
-
1801 
-
1802  ParallelFor(box, [=] AMREX_GPU_DEVICE (int i, int j, int k) {
-
1803  arr_reduce(i, j, k, 0) = fab_arr(i,j,k,n);
-
1804  });
+
1781 {
+
1782  // Get the number of cells in z at level 0
+
1783  int dir_z = AMREX_SPACEDIM-1;
+
1784  auto domain = geom[0].Domain();
+
1785  int size_z = domain.length(dir_z);
+
1786  int start_z = domain.smallEnd()[dir_z];
+
1787  Real area_z = static_cast<Real>(domain.length(0)*domain.length(1));
+
1788 
+
1789  // resize the level 0 horizontal average vectors
+
1790  h_havg.resize(size_z, 0.0_rt);
+
1791 
+
1792  // Get the cell centered data and construct sums
+
1793 #ifdef _OPENMP
+
1794 #pragma omp parallel if (Gpu::notInLaunchRegion())
+
1795 #endif
+
1796  for (MFIter mfi(S); mfi.isValid(); ++mfi) {
+
1797  const Box& box = mfi.validbox();
+
1798  const IntVect& se = box.smallEnd();
+
1799  const IntVect& be = box.bigEnd();
+
1800 
+
1801  auto fab_arr = S[mfi].array();
+
1802 
+
1803  FArrayBox fab_reduce(box, 1, The_Async_Arena());
+
1804  auto arr_reduce = fab_reduce.array();
1805 
-
1806  for (int k=se[dir_z]; k <= be[dir_z]; ++k) {
-
1807  Box kbox(box); kbox.setSmall(dir_z,k); kbox.setBig(dir_z,k);
-
1808  h_havg[k-start_z] += fab_reduce.sum<RunOn::Device>(kbox,0);
-
1809  }
-
1810  }
-
1811 
-
1812  // combine sums from different MPI ranks
-
1813  ParallelDescriptor::ReduceRealSum(h_havg.dataPtr(), h_havg.size());
-
1814 
-
1815  // divide by the total number of cells we are averaging over
-
1816  for (int k = 0; k < size_z; ++k) {
-
1817  h_havg[k] /= area_z;
-
1818  }
-
1819 }
+
1806  ParallelFor(box, [=] AMREX_GPU_DEVICE (int i, int j, int k) {
+
1807  arr_reduce(i, j, k, 0) = fab_arr(i,j,k,n);
+
1808  });
+
1809 
+
1810  for (int k=se[dir_z]; k <= be[dir_z]; ++k) {
+
1811  Box kbox(box); kbox.setSmall(dir_z,k); kbox.setBig(dir_z,k);
+
1812  h_havg[k-start_z] += fab_reduce.sum<RunOn::Device>(kbox,0);
+
1813  }
+
1814  }
+
1815 
+
1816  // combine sums from different MPI ranks
+
1817  ParallelDescriptor::ReduceRealSum(h_havg.dataPtr(), h_havg.size());
+
1818 
+
1819  // divide by the total number of cells we are averaging over
+
1820  for (int k = 0; k < size_z; ++k) {
+
1821  h_havg[k] /= area_z;
+
1822  }
+
1823 }
@@ -10160,116 +10189,116 @@

-
1671 {
-
1672  int lev = 0;
-
1673 
-
1674  // First, average down all levels (if doing two-way coupling)
-
1675  if (solverChoice.coupling_type == CouplingType::TwoWay) {
-
1676  AverageDown();
-
1677  }
-
1678 
-
1679  MultiFab mf(grids[lev], dmap[lev], 5, 0);
-
1680 
-
1681  int zdir = 2;
-
1682  auto domain = geom[0].Domain();
-
1683 
-
1684  bool use_moisture = (solverChoice.moisture_type != MoistureType::None);
-
1685  bool is_anelastic = (solverChoice.anelastic[lev] == 1);
-
1686 
-
1687  for (MFIter mfi(mf); mfi.isValid(); ++mfi) {
-
1688  const Box& bx = mfi.validbox();
-
1689  auto fab_arr = mf.array(mfi);
-
1690  auto const hse_arr = base_state[lev].const_array(mfi);
-
1691  auto const cons_arr = vars_new[lev][Vars::cons].const_array(mfi);
-
1692  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) {
-
1693  Real dens = cons_arr(i, j, k, Rho_comp);
-
1694  fab_arr(i, j, k, 0) = dens;
-
1695  fab_arr(i, j, k, 1) = cons_arr(i, j, k, RhoTheta_comp) / dens;
-
1696  if (!use_moisture) {
-
1697  if (is_anelastic) {
-
1698  fab_arr(i,j,k,2) = hse_arr(i,j,k,1);
-
1699  } else {
-
1700  fab_arr(i,j,k,2) = getPgivenRTh(cons_arr(i,j,k,RhoTheta_comp));
-
1701  }
-
1702  }
-
1703  });
-
1704  }
-
1705 
-
1706  if (use_moisture)
-
1707  {
-
1708  for (MFIter mfi(mf); mfi.isValid(); ++mfi) {
-
1709  const Box& bx = mfi.validbox();
-
1710  auto fab_arr = mf.array(mfi);
-
1711  auto const hse_arr = base_state[lev].const_array(mfi);
-
1712  auto const cons_arr = vars_new[lev][Vars::cons].const_array(mfi);
-
1713  auto const qv_arr = qmoist[lev][0]->const_array(mfi);
-
1714  int ncomp = vars_new[lev][Vars::cons].nComp();
-
1715 
-
1716  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) {
-
1717  Real dens = cons_arr(i, j, k, Rho_comp);
-
1718  if (is_anelastic) {
-
1719  fab_arr(i,j,k,2) = hse_arr(i,j,k,1);
-
1720  } else {
-
1721  fab_arr(i, j, k, 2) = getPgivenRTh(cons_arr(i, j, k, RhoTheta_comp), qv_arr(i,j,k));
-
1722  }
-
1723  fab_arr(i, j, k, 3) = (ncomp > RhoQ1_comp ? cons_arr(i, j, k, RhoQ1_comp) / dens : 0.0);
-
1724  fab_arr(i, j, k, 4) = (ncomp > RhoQ2_comp ? cons_arr(i, j, k, RhoQ2_comp) / dens : 0.0);
-
1725  });
-
1726  }
-
1727 
-
1728  Gpu::HostVector<Real> h_avg_qv = sumToLine(mf,3,1,domain,zdir);
-
1729  Gpu::HostVector<Real> h_avg_qc = sumToLine(mf,4,1,domain,zdir);
-
1730  }
+
1675 {
+
1676  int lev = 0;
+
1677 
+
1678  // First, average down all levels (if doing two-way coupling)
+
1679  if (solverChoice.coupling_type == CouplingType::TwoWay) {
+
1680  AverageDown();
+
1681  }
+
1682 
+
1683  MultiFab mf(grids[lev], dmap[lev], 5, 0);
+
1684 
+
1685  int zdir = 2;
+
1686  auto domain = geom[0].Domain();
+
1687 
+
1688  bool use_moisture = (solverChoice.moisture_type != MoistureType::None);
+
1689  bool is_anelastic = (solverChoice.anelastic[lev] == 1);
+
1690 
+
1691  for (MFIter mfi(mf); mfi.isValid(); ++mfi) {
+
1692  const Box& bx = mfi.validbox();
+
1693  auto fab_arr = mf.array(mfi);
+
1694  auto const hse_arr = base_state[lev].const_array(mfi);
+
1695  auto const cons_arr = vars_new[lev][Vars::cons].const_array(mfi);
+
1696  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) {
+
1697  Real dens = cons_arr(i, j, k, Rho_comp);
+
1698  fab_arr(i, j, k, 0) = dens;
+
1699  fab_arr(i, j, k, 1) = cons_arr(i, j, k, RhoTheta_comp) / dens;
+
1700  if (!use_moisture) {
+
1701  if (is_anelastic) {
+
1702  fab_arr(i,j,k,2) = hse_arr(i,j,k,1);
+
1703  } else {
+
1704  fab_arr(i,j,k,2) = getPgivenRTh(cons_arr(i,j,k,RhoTheta_comp));
+
1705  }
+
1706  }
+
1707  });
+
1708  }
+
1709 
+
1710  if (use_moisture)
+
1711  {
+
1712  for (MFIter mfi(mf); mfi.isValid(); ++mfi) {
+
1713  const Box& bx = mfi.validbox();
+
1714  auto fab_arr = mf.array(mfi);
+
1715  auto const hse_arr = base_state[lev].const_array(mfi);
+
1716  auto const cons_arr = vars_new[lev][Vars::cons].const_array(mfi);
+
1717  auto const qv_arr = qmoist[lev][0]->const_array(mfi);
+
1718  int ncomp = vars_new[lev][Vars::cons].nComp();
+
1719 
+
1720  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) {
+
1721  Real dens = cons_arr(i, j, k, Rho_comp);
+
1722  if (is_anelastic) {
+
1723  fab_arr(i,j,k,2) = hse_arr(i,j,k,1);
+
1724  } else {
+
1725  fab_arr(i, j, k, 2) = getPgivenRTh(cons_arr(i, j, k, RhoTheta_comp), qv_arr(i,j,k));
+
1726  }
+
1727  fab_arr(i, j, k, 3) = (ncomp > RhoQ1_comp ? cons_arr(i, j, k, RhoQ1_comp) / dens : 0.0);
+
1728  fab_arr(i, j, k, 4) = (ncomp > RhoQ2_comp ? cons_arr(i, j, k, RhoQ2_comp) / dens : 0.0);
+
1729  });
+
1730  }
1731 
-
1732  // Sum in the horizontal plane
-
1733  Gpu::HostVector<Real> h_avg_density = sumToLine(mf,0,1,domain,zdir);
-
1734  Gpu::HostVector<Real> h_avg_temperature = sumToLine(mf,1,1,domain,zdir);
-
1735  Gpu::HostVector<Real> h_avg_pressure = sumToLine(mf,2,1,domain,zdir);
-
1736 
-
1737  // Divide by the total number of cells we are averaging over
-
1738  int size_z = domain.length(zdir);
-
1739  Real area_z = static_cast<Real>(domain.length(0)*domain.length(1));
-
1740  int klen = static_cast<int>(h_avg_density.size());
-
1741 
-
1742  for (int k = 0; k < klen; ++k) {
-
1743  h_havg_density[k] /= area_z;
-
1744  h_havg_temperature[k] /= area_z;
-
1745  h_havg_pressure[k] /= area_z;
-
1746  if (solverChoice.moisture_type != MoistureType::None)
-
1747  {
-
1748  h_havg_qc[k] /= area_z;
-
1749  h_havg_qv[k] /= area_z;
-
1750  }
-
1751  } // k
-
1752 
-
1753  // resize device vectors
-
1754  d_havg_density.resize(size_z, 0.0_rt);
-
1755  d_havg_temperature.resize(size_z, 0.0_rt);
-
1756  d_havg_pressure.resize(size_z, 0.0_rt);
-
1757 
-
1758  // copy host vectors to device vectors
-
1759  Gpu::copy(Gpu::hostToDevice, h_havg_density.begin(), h_havg_density.end(), d_havg_density.begin());
-
1760  Gpu::copy(Gpu::hostToDevice, h_havg_temperature.begin(), h_havg_temperature.end(), d_havg_temperature.begin());
-
1761  Gpu::copy(Gpu::hostToDevice, h_havg_pressure.begin(), h_havg_pressure.end(), d_havg_pressure.begin());
-
1762 
-
1763  if (solverChoice.moisture_type != MoistureType::None)
-
1764  {
-
1765  d_havg_qv.resize(size_z, 0.0_rt);
-
1766  d_havg_qc.resize(size_z, 0.0_rt);
-
1767  Gpu::copy(Gpu::hostToDevice, h_havg_qv.begin(), h_havg_qv.end(), d_havg_qv.begin());
-
1768  Gpu::copy(Gpu::hostToDevice, h_havg_qc.begin(), h_havg_qc.end(), d_havg_qc.begin());
-
1769  }
-
1770 }
-
amrex::Gpu::DeviceVector< amrex::Real > d_havg_temperature
Definition: ERF.H:1043
-
amrex::Gpu::DeviceVector< amrex::Real > d_havg_qv
Definition: ERF.H:1045
-
amrex::Vector< amrex::Real > h_havg_pressure
Definition: ERF.H:1038
-
amrex::Vector< amrex::Real > h_havg_qc
Definition: ERF.H:1040
-
amrex::Vector< amrex::Real > h_havg_density
Definition: ERF.H:1036
-
amrex::Gpu::DeviceVector< amrex::Real > d_havg_qc
Definition: ERF.H:1046
-
amrex::Gpu::DeviceVector< amrex::Real > d_havg_density
Definition: ERF.H:1042
-
amrex::Vector< amrex::Real > h_havg_temperature
Definition: ERF.H:1037
-
amrex::Gpu::DeviceVector< amrex::Real > d_havg_pressure
Definition: ERF.H:1044
-
amrex::Vector< amrex::Real > h_havg_qv
Definition: ERF.H:1039
+
1732  Gpu::HostVector<Real> h_avg_qv = sumToLine(mf,3,1,domain,zdir);
+
1733  Gpu::HostVector<Real> h_avg_qc = sumToLine(mf,4,1,domain,zdir);
+
1734  }
+
1735 
+
1736  // Sum in the horizontal plane
+
1737  Gpu::HostVector<Real> h_avg_density = sumToLine(mf,0,1,domain,zdir);
+
1738  Gpu::HostVector<Real> h_avg_temperature = sumToLine(mf,1,1,domain,zdir);
+
1739  Gpu::HostVector<Real> h_avg_pressure = sumToLine(mf,2,1,domain,zdir);
+
1740 
+
1741  // Divide by the total number of cells we are averaging over
+
1742  int size_z = domain.length(zdir);
+
1743  Real area_z = static_cast<Real>(domain.length(0)*domain.length(1));
+
1744  int klen = static_cast<int>(h_avg_density.size());
+
1745 
+
1746  for (int k = 0; k < klen; ++k) {
+
1747  h_havg_density[k] /= area_z;
+
1748  h_havg_temperature[k] /= area_z;
+
1749  h_havg_pressure[k] /= area_z;
+
1750  if (solverChoice.moisture_type != MoistureType::None)
+
1751  {
+
1752  h_havg_qc[k] /= area_z;
+
1753  h_havg_qv[k] /= area_z;
+
1754  }
+
1755  } // k
+
1756 
+
1757  // resize device vectors
+
1758  d_havg_density.resize(size_z, 0.0_rt);
+
1759  d_havg_temperature.resize(size_z, 0.0_rt);
+
1760  d_havg_pressure.resize(size_z, 0.0_rt);
+
1761 
+
1762  // copy host vectors to device vectors
+
1763  Gpu::copy(Gpu::hostToDevice, h_havg_density.begin(), h_havg_density.end(), d_havg_density.begin());
+
1764  Gpu::copy(Gpu::hostToDevice, h_havg_temperature.begin(), h_havg_temperature.end(), d_havg_temperature.begin());
+
1765  Gpu::copy(Gpu::hostToDevice, h_havg_pressure.begin(), h_havg_pressure.end(), d_havg_pressure.begin());
+
1766 
+
1767  if (solverChoice.moisture_type != MoistureType::None)
+
1768  {
+
1769  d_havg_qv.resize(size_z, 0.0_rt);
+
1770  d_havg_qc.resize(size_z, 0.0_rt);
+
1771  Gpu::copy(Gpu::hostToDevice, h_havg_qv.begin(), h_havg_qv.end(), d_havg_qv.begin());
+
1772  Gpu::copy(Gpu::hostToDevice, h_havg_qc.begin(), h_havg_qc.end(), d_havg_qc.begin());
+
1773  }
+
1774 }
+
amrex::Gpu::DeviceVector< amrex::Real > d_havg_temperature
Definition: ERF.H:1047
+
amrex::Gpu::DeviceVector< amrex::Real > d_havg_qv
Definition: ERF.H:1049
+
amrex::Vector< amrex::Real > h_havg_pressure
Definition: ERF.H:1042
+
amrex::Vector< amrex::Real > h_havg_qc
Definition: ERF.H:1044
+
amrex::Vector< amrex::Real > h_havg_density
Definition: ERF.H:1040
+
amrex::Gpu::DeviceVector< amrex::Real > d_havg_qc
Definition: ERF.H:1050
+
amrex::Gpu::DeviceVector< amrex::Real > d_havg_density
Definition: ERF.H:1046
+
amrex::Vector< amrex::Real > h_havg_temperature
Definition: ERF.H:1041
+
amrex::Gpu::DeviceVector< amrex::Real > d_havg_pressure
Definition: ERF.H:1048
+
amrex::Vector< amrex::Real > h_havg_qv
Definition: ERF.H:1043
Here is the call graph for this function:
@@ -10431,7 +10460,7 @@

void update_terrain_arrays(int lev)
Definition: ERF_make_new_arrays.cpp:506

void init_zphys(int lev, amrex::Real time)
Definition: ERF_make_new_arrays.cpp:441
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_make_new_arrays.cpp:23
-
void Define_ERFFillPatchers(int lev)
Definition: ERF.cpp:1957
+
void Define_ERFFillPatchers(int lev)
Definition: ERF.cpp:1961
@@ -10668,9 +10697,9 @@

-
1132  {
-
1133  return datalog.size();
-
1134  }
+
1136  {
+
1137  return datalog.size();
+
1138  }
@@ -10696,9 +10725,9 @@

-
1160  {
-
1161  return samplelinelog.size();
-
1162  }
+
1164  {
+
1165  return samplelinelog.size();
+
1166  }
@@ -10724,9 +10753,9 @@

-
1186  {
-
1187  return sampleline.size();
-
1188  }
+
1190  {
+
1191  return sampleline.size();
+
1192  }
@@ -10752,9 +10781,9 @@

-
1146  {
-
1147  return sampleptlog.size();
-
1148  }
+
1150  {
+
1151  return sampleptlog.size();
+
1152  }
@@ -10780,9 +10809,9 @@

-
1173  {
-
1174  return samplepoint.size();
-
1175  }
+
1177  {
+
1178  return samplepoint.size();
+
1179  }
@@ -10860,89 +10889,89 @@

-
1586 {
-
1587  AMREX_ALWAYS_ASSERT(cfl > 0. || fixed_dt[0] > 0.);
-
1588 
-
1589  // We don't allow use_real_bcs to be true if init_type is not either real or metgrid
-
1590  AMREX_ALWAYS_ASSERT(!use_real_bcs || ((init_type == "real") || (init_type == "metgrid")) );
-
1591 
-
1592  AMREX_ALWAYS_ASSERT(real_width >= 0);
-
1593  AMREX_ALWAYS_ASSERT(real_set_width >= 0);
-
1594  AMREX_ALWAYS_ASSERT(real_width >= real_set_width);
+
1590 {
+
1591  AMREX_ALWAYS_ASSERT(cfl > 0. || fixed_dt[0] > 0.);
+
1592 
+
1593  // We don't allow use_real_bcs to be true if init_type is not either real or metgrid
+
1594  AMREX_ALWAYS_ASSERT(!use_real_bcs || ((init_type == "real") || (init_type == "metgrid")) );
1595 
-
1596  if (cf_width < 0 || cf_set_width < 0 || cf_width < cf_set_width) {
-
1597  Abort("You must set cf_width >= cf_set_width >= 0");
-
1598  }
-
1599  if (max_level > 0 && cf_set_width > 0) {
-
1600  for (int lev = 1; lev <= max_level; lev++) {
-
1601  if (cf_set_width%ref_ratio[lev-1][0] != 0 ||
-
1602  cf_set_width%ref_ratio[lev-1][1] != 0 ||
-
1603  cf_set_width%ref_ratio[lev-1][2] != 0 ) {
-
1604  Abort("You must set cf_width to be a multiple of ref_ratio");
-
1605  }
-
1606  }
-
1607  }
-
1608 
-
1609  if (plotfile_type != "amrex" &&
-
1610  plotfile_type != "netcdf" && plotfile_type != "NetCDF" &&
-
1611  plotfile_type != "hdf5" && plotfile_type != "HDF5" )
-
1612  {
-
1613  Print() << "User selected plotfile_type = " << plotfile_type << std::endl;
-
1614  Abort("Dont know this plotfile_type");
-
1615  }
-
1616 
-
1617  // Enforce the init_type is one we know
-
1618  if (!init_type.empty() &&
-
1619  init_type != "uniform" &&
-
1620  init_type != "ideal" &&
-
1621  init_type != "real" &&
-
1622  init_type != "metgrid" &&
-
1623  init_type != "input_sounding")
-
1624  {
-
1625  Error("if specified, init_type must be uniform, ideal, real, metgrid or input_sounding");
-
1626  }
-
1627 
-
1628  // If fixed_mri_dt_ratio is set, it must be even
-
1629  if (fixed_mri_dt_ratio > 0 && (fixed_mri_dt_ratio%2 != 0) )
-
1630  {
-
1631  Abort("If you specify fixed_mri_dt_ratio, it must be even");
-
1632  }
-
1633 
-
1634  for (int lev = 0; lev <= max_level; lev++)
-
1635  {
-
1636  // We ignore fixed_fast_dt if not substepping
-
1637  if (solverChoice.substepping_type[lev] == SubsteppingType::None) {
-
1638  fixed_fast_dt[lev] = -1.0;
-
1639  }
-
1640 
-
1641  // If both fixed_dt and fast_dt are specified, their ratio must be an even integer
-
1642  if (fixed_dt[lev] > 0. && fixed_fast_dt[lev] > 0. && fixed_mri_dt_ratio <= 0)
-
1643  {
-
1644  Real eps = 1.e-12;
-
1645  int ratio = static_cast<int>( ( (1.0+eps) * fixed_dt[lev] ) / fixed_fast_dt[lev] );
-
1646  if (fixed_dt[lev] / fixed_fast_dt[lev] != ratio)
-
1647  {
-
1648  Abort("Ratio of fixed_dt to fixed_fast_dt must be an even integer");
-
1649  }
-
1650  }
-
1651 
-
1652  // If all three are specified, they must be consistent
-
1653  if (fixed_dt[lev] > 0. && fixed_fast_dt[lev] > 0. && fixed_mri_dt_ratio > 0)
-
1654  {
-
1655  if (fixed_dt[lev] / fixed_fast_dt[lev] != fixed_mri_dt_ratio)
-
1656  {
-
1657  Abort("Dt is over-specfied");
-
1658  }
-
1659  }
-
1660  } // lev
-
1661 
-
1662  if (solverChoice.coupling_type == CouplingType::TwoWay && cf_width > 0) {
-
1663  Abort("For two-way coupling you must set cf_width = 0");
-
1664  }
-
1665 }
-
int real_width
Definition: ERF.H:972
-
int real_set_width
Definition: ERF.H:973
-
static std::string plotfile_type
Definition: ERF.H:955
+
1596  AMREX_ALWAYS_ASSERT(real_width >= 0);
+
1597  AMREX_ALWAYS_ASSERT(real_set_width >= 0);
+
1598  AMREX_ALWAYS_ASSERT(real_width >= real_set_width);
+
1599 
+
1600  if (cf_width < 0 || cf_set_width < 0 || cf_width < cf_set_width) {
+
1601  Abort("You must set cf_width >= cf_set_width >= 0");
+
1602  }
+
1603  if (max_level > 0 && cf_set_width > 0) {
+
1604  for (int lev = 1; lev <= max_level; lev++) {
+
1605  if (cf_set_width%ref_ratio[lev-1][0] != 0 ||
+
1606  cf_set_width%ref_ratio[lev-1][1] != 0 ||
+
1607  cf_set_width%ref_ratio[lev-1][2] != 0 ) {
+
1608  Abort("You must set cf_width to be a multiple of ref_ratio");
+
1609  }
+
1610  }
+
1611  }
+
1612 
+
1613  if (plotfile_type != "amrex" &&
+
1614  plotfile_type != "netcdf" && plotfile_type != "NetCDF" &&
+
1615  plotfile_type != "hdf5" && plotfile_type != "HDF5" )
+
1616  {
+
1617  Print() << "User selected plotfile_type = " << plotfile_type << std::endl;
+
1618  Abort("Dont know this plotfile_type");
+
1619  }
+
1620 
+
1621  // Enforce the init_type is one we know
+
1622  if (!init_type.empty() &&
+
1623  init_type != "uniform" &&
+
1624  init_type != "ideal" &&
+
1625  init_type != "real" &&
+
1626  init_type != "metgrid" &&
+
1627  init_type != "input_sounding")
+
1628  {
+
1629  Error("if specified, init_type must be uniform, ideal, real, metgrid or input_sounding");
+
1630  }
+
1631 
+
1632  // If fixed_mri_dt_ratio is set, it must be even
+
1633  if (fixed_mri_dt_ratio > 0 && (fixed_mri_dt_ratio%2 != 0) )
+
1634  {
+
1635  Abort("If you specify fixed_mri_dt_ratio, it must be even");
+
1636  }
+
1637 
+
1638  for (int lev = 0; lev <= max_level; lev++)
+
1639  {
+
1640  // We ignore fixed_fast_dt if not substepping
+
1641  if (solverChoice.substepping_type[lev] == SubsteppingType::None) {
+
1642  fixed_fast_dt[lev] = -1.0;
+
1643  }
+
1644 
+
1645  // If both fixed_dt and fast_dt are specified, their ratio must be an even integer
+
1646  if (fixed_dt[lev] > 0. && fixed_fast_dt[lev] > 0. && fixed_mri_dt_ratio <= 0)
+
1647  {
+
1648  Real eps = 1.e-12;
+
1649  int ratio = static_cast<int>( ( (1.0+eps) * fixed_dt[lev] ) / fixed_fast_dt[lev] );
+
1650  if (fixed_dt[lev] / fixed_fast_dt[lev] != ratio)
+
1651  {
+
1652  Abort("Ratio of fixed_dt to fixed_fast_dt must be an even integer");
+
1653  }
+
1654  }
+
1655 
+
1656  // If all three are specified, they must be consistent
+
1657  if (fixed_dt[lev] > 0. && fixed_fast_dt[lev] > 0. && fixed_mri_dt_ratio > 0)
+
1658  {
+
1659  if (fixed_dt[lev] / fixed_fast_dt[lev] != fixed_mri_dt_ratio)
+
1660  {
+
1661  Abort("Dt is over-specfied");
+
1662  }
+
1663  }
+
1664  } // lev
+
1665 
+
1666  if (solverChoice.coupling_type == CouplingType::TwoWay && cf_width > 0) {
+
1667  Abort("For two-way coupling you must set cf_width = 0");
+
1668  }
+
1669 }
+
int real_width
Definition: ERF.H:976
+
int real_set_width
Definition: ERF.H:977
+
static std::string plotfile_type
Definition: ERF.H:959
@@ -11166,15 +11195,15 @@

562  }
563 } // post_timestep
void make_zcc(const Geometry &geom, MultiFab &z_phys_nd, MultiFab &z_phys_cc)
Definition: ERF_TerrainMetrics.cpp:687
-
static amrex::Real column_loc_y
Definition: ERF.H:984
-
static std::string column_file_name
Definition: ERF.H:985
-
AMREX_FORCE_INLINE amrex::YAFluxRegister * getAdvFluxReg(int lev)
Definition: ERF.H:1117
-
static amrex::Real bndry_output_planes_per
Definition: ERF.H:990
-
static amrex::Real column_per
Definition: ERF.H:982
-
static amrex::Real column_loc_x
Definition: ERF.H:983
-
static int bndry_output_planes_interval
Definition: ERF.H:989
-
static int output_1d_column
Definition: ERF.H:980
-
static int column_interval
Definition: ERF.H:981
+
static amrex::Real column_loc_y
Definition: ERF.H:988
+
static std::string column_file_name
Definition: ERF.H:989
+
AMREX_FORCE_INLINE amrex::YAFluxRegister * getAdvFluxReg(int lev)
Definition: ERF.H:1121
+
static amrex::Real bndry_output_planes_per
Definition: ERF.H:994
+
static amrex::Real column_per
Definition: ERF.H:986
+
static amrex::Real column_loc_x
Definition: ERF.H:987
+
static int bndry_output_planes_interval
Definition: ERF.H:993
+
static int output_1d_column
Definition: ERF.H:984
+
static int column_interval
Definition: ERF.H:985
Here is the call graph for this function:
@@ -11787,10 +11816,10 @@

249 #endif

250 }
AMREX_FORCE_INLINE IntVect offset(const int face_dir, const int normal)
Definition: ERF_ReadBndryPlanes.cpp:28
-
static int mg_verbose
Definition: ERF.H:946
+
static int mg_verbose
Definition: ERF.H:950
amrex::Array< amrex::LinOpBCType, AMREX_SPACEDIM > get_projection_bc(amrex::Orientation::Side side) const noexcept
Definition: ERF_PoissonSolve.cpp:19
bool projection_has_dirichlet(amrex::Array< amrex::LinOpBCType, AMREX_SPACEDIM > bcs) const
Definition: ERF_PoissonSolve.cpp:37
-
static bool use_heffte
Definition: ERF.H:947
+
static bool use_heffte
Definition: ERF.H:951
amrex::Real volWgtSumMF(int lev, const amrex::MultiFab &mf, int comp, const amrex::MultiFab &mapfac, bool local, bool finemask)
Definition: ERF_WriteScalarProfiles.cpp:378
void solve_with_heffte(int lev, amrex::MultiFab &rhs, amrex::MultiFab &soln, amrex::Array< amrex::MultiFab, AMREX_SPACEDIM > &fluxes)
amrex::Real poisson_reltol
Definition: ERF_DataStruct.H:553
@@ -12533,213 +12562,213 @@

-
1387 {
-
1388  {
-
1389  ParmParse pp; // Traditionally, max_step and stop_time do not have prefix.
-
1390  pp.query("max_step", max_step);
-
1391  pp.query("stop_time", stop_time);
-
1392 
-
1393  pp.query("start_time", start_time); // This is optional, it defaults to 0
-
1394  }
-
1395 
-
1396  ParmParse pp(pp_prefix);
-
1397  ParmParse pp_amr("amr");
-
1398  {
-
1399  // The type of the file we restart from
-
1400  pp.query("restart_type", restart_type);
-
1401 
-
1402  pp.query("regrid_int", regrid_int);
-
1403  pp.query("check_file", check_file);
-
1404  pp.query("check_type", check_type);
+
1391 {
+
1392  {
+
1393  ParmParse pp; // Traditionally, max_step and stop_time do not have prefix.
+
1394  pp.query("max_step", max_step);
+
1395  pp.query("stop_time", stop_time);
+
1396 
+
1397  pp.query("start_time", start_time); // This is optional, it defaults to 0
+
1398  }
+
1399 
+
1400  ParmParse pp(pp_prefix);
+
1401  ParmParse pp_amr("amr");
+
1402  {
+
1403  // The type of the file we restart from
+
1404  pp.query("restart_type", restart_type);
1405 
-
1406  // The regression tests use "amr.restart" and "amr.m_check_int" so we allow
-
1407  // for those or "erf.restart" / "erf.m_check_int" with the former taking
-
1408  // precedence if both are specified
-
1409  pp.query("check_int", m_check_int);
-
1410  pp.query("check_per", m_check_per);
-
1411  pp_amr.query("check_int", m_check_int);
-
1412  pp_amr.query("check_per", m_check_per);
-
1413 
-
1414  pp.query("restart", restart_chkfile);
-
1415  pp_amr.query("restart", restart_chkfile);
-
1416 
-
1417  // Verbosity
-
1418  pp.query("v", verbose);
-
1419  pp.query("mg_v", mg_verbose);
-
1420  pp.query("use_heffte", use_heffte);
-
1421 
-
1422  // Frequency of diagnostic output
-
1423  pp.query("sum_interval", sum_interval);
-
1424  pp.query("sum_period" , sum_per);
+
1406  pp.query("regrid_int", regrid_int);
+
1407  pp.query("check_file", check_file);
+
1408  pp.query("check_type", check_type);
+
1409 
+
1410  // The regression tests use "amr.restart" and "amr.m_check_int" so we allow
+
1411  // for those or "erf.restart" / "erf.m_check_int" with the former taking
+
1412  // precedence if both are specified
+
1413  pp.query("check_int", m_check_int);
+
1414  pp.query("check_per", m_check_per);
+
1415  pp_amr.query("check_int", m_check_int);
+
1416  pp_amr.query("check_per", m_check_per);
+
1417 
+
1418  pp.query("restart", restart_chkfile);
+
1419  pp_amr.query("restart", restart_chkfile);
+
1420 
+
1421  // Verbosity
+
1422  pp.query("v", verbose);
+
1423  pp.query("mg_v", mg_verbose);
+
1424  pp.query("use_heffte", use_heffte);
1425 
-
1426  pp.query("pert_interval", pert_interval);
-
1427 
-
1428  // Time step controls
-
1429  pp.query("cfl", cfl);
-
1430  pp.query("init_shrink", init_shrink);
-
1431  pp.query("change_max", change_max);
-
1432 
-
1433  fixed_dt.resize(max_level+1,-1.);
-
1434  fixed_fast_dt.resize(max_level+1,-1.);
-
1435 
-
1436  pp.query("fixed_dt", fixed_dt[0]);
-
1437  pp.query("fixed_fast_dt", fixed_fast_dt[0]);
-
1438 
-
1439  for (int lev = 1; lev <= max_level; lev++)
-
1440  {
-
1441  fixed_dt[lev] = fixed_dt[lev-1] / static_cast<Real>(MaxRefRatio(lev-1));
-
1442  fixed_fast_dt[lev] = fixed_fast_dt[lev-1] / static_cast<Real>(MaxRefRatio(lev-1));
-
1443  }
-
1444 
-
1445  pp.query("fixed_mri_dt_ratio", fixed_mri_dt_ratio);
-
1446 
-
1447  // How to initialize
-
1448  pp.query("init_type",init_type);
-
1449 
-
1450  // Should we use the bcs we've read in from wrfbdy or metgrid files?
-
1451  // We default to yes if we have them, but the user can override that option
-
1452  use_real_bcs = ( (init_type == "real") || (init_type == "metgrid") );
-
1453  pp.query("use_real_bcs",use_real_bcs);
-
1454 
-
1455  // We use this to keep track of how many boxes we read in from WRF initialization
-
1456  num_files_at_level.resize(max_level+1,0);
-
1457 
-
1458  // We use this to keep track of how many boxes are specified thru the refinement indicators
-
1459  num_boxes_at_level.resize(max_level+1,0);
-
1460  boxes_at_level.resize(max_level+1);
+
1426  // Frequency of diagnostic output
+
1427  pp.query("sum_interval", sum_interval);
+
1428  pp.query("sum_period" , sum_per);
+
1429 
+
1430  pp.query("pert_interval", pert_interval);
+
1431 
+
1432  // Time step controls
+
1433  pp.query("cfl", cfl);
+
1434  pp.query("init_shrink", init_shrink);
+
1435  pp.query("change_max", change_max);
+
1436 
+
1437  fixed_dt.resize(max_level+1,-1.);
+
1438  fixed_fast_dt.resize(max_level+1,-1.);
+
1439 
+
1440  pp.query("fixed_dt", fixed_dt[0]);
+
1441  pp.query("fixed_fast_dt", fixed_fast_dt[0]);
+
1442 
+
1443  for (int lev = 1; lev <= max_level; lev++)
+
1444  {
+
1445  fixed_dt[lev] = fixed_dt[lev-1] / static_cast<Real>(MaxRefRatio(lev-1));
+
1446  fixed_fast_dt[lev] = fixed_fast_dt[lev-1] / static_cast<Real>(MaxRefRatio(lev-1));
+
1447  }
+
1448 
+
1449  pp.query("fixed_mri_dt_ratio", fixed_mri_dt_ratio);
+
1450 
+
1451  // How to initialize
+
1452  pp.query("init_type",init_type);
+
1453 
+
1454  // Should we use the bcs we've read in from wrfbdy or metgrid files?
+
1455  // We default to yes if we have them, but the user can override that option
+
1456  use_real_bcs = ( (init_type == "real") || (init_type == "metgrid") );
+
1457  pp.query("use_real_bcs",use_real_bcs);
+
1458 
+
1459  // We use this to keep track of how many boxes we read in from WRF initialization
+
1460  num_files_at_level.resize(max_level+1,0);
1461 
-
1462  // We always have exactly one file at level 0
-
1463  num_boxes_at_level[0] = 1;
-
1464  boxes_at_level[0].resize(1);
-
1465  boxes_at_level[0][0] = geom[0].Domain();
-
1466 
-
1467 #ifdef ERF_USE_NETCDF
-
1468  nc_init_file.resize(max_level+1);
-
1469 
-
1470  // NetCDF wrfinput initialization files -- possibly multiple files at each of multiple levels
-
1471  // but we always have exactly one file at level 0
-
1472  for (int lev = 0; lev <= max_level; lev++)
-
1473  {
-
1474  const std::string nc_file_names = Concatenate("nc_init_file_",lev,1);
-
1475  if (pp.contains(nc_file_names.c_str()))
-
1476  {
-
1477  int num_files = pp.countval(nc_file_names.c_str());
-
1478  num_files_at_level[lev] = num_files;
-
1479  nc_init_file[lev].resize(num_files);
-
1480  pp.queryarr(nc_file_names.c_str(), nc_init_file[lev],0,num_files);
-
1481  for (int j = 0; j < num_files; j++)
-
1482  Print() << "Reading NC init file names at level " << lev << " and index " << j << " : " << nc_init_file[lev][j] << std::endl;
-
1483  }
-
1484  }
-
1485 
-
1486  // NetCDF wrfbdy lateral boundary file
-
1487  pp.query("nc_bdy_file", nc_bdy_file);
-
1488 #endif
+
1462  // We use this to keep track of how many boxes are specified thru the refinement indicators
+
1463  num_boxes_at_level.resize(max_level+1,0);
+
1464  boxes_at_level.resize(max_level+1);
+
1465 
+
1466  // We always have exactly one file at level 0
+
1467  num_boxes_at_level[0] = 1;
+
1468  boxes_at_level[0].resize(1);
+
1469  boxes_at_level[0][0] = geom[0].Domain();
+
1470 
+
1471 #ifdef ERF_USE_NETCDF
+
1472  nc_init_file.resize(max_level+1);
+
1473 
+
1474  // NetCDF wrfinput initialization files -- possibly multiple files at each of multiple levels
+
1475  // but we always have exactly one file at level 0
+
1476  for (int lev = 0; lev <= max_level; lev++)
+
1477  {
+
1478  const std::string nc_file_names = Concatenate("nc_init_file_",lev,1);
+
1479  if (pp.contains(nc_file_names.c_str()))
+
1480  {
+
1481  int num_files = pp.countval(nc_file_names.c_str());
+
1482  num_files_at_level[lev] = num_files;
+
1483  nc_init_file[lev].resize(num_files);
+
1484  pp.queryarr(nc_file_names.c_str(), nc_init_file[lev],0,num_files);
+
1485  for (int j = 0; j < num_files; j++)
+
1486  Print() << "Reading NC init file names at level " << lev << " and index " << j << " : " << nc_init_file[lev][j] << std::endl;
+
1487  }
+
1488  }
1489 
-
1490  // Flag to trigger initialization from input_sounding like WRF's ideal.exe
-
1491  pp.query("init_sounding_ideal", init_sounding_ideal);
-
1492 
-
1493  // Output format
-
1494  pp.query("plotfile_type", plotfile_type);
-
1495  pp.query("plot_file_1", plot_file_1);
-
1496  pp.query("plot_file_2", plot_file_2);
-
1497  pp.query("plot_int_1" , m_plot_int_1);
-
1498  pp.query("plot_int_2" , m_plot_int_2);
-
1499  pp.query("plot_per_1", m_plot_per_1);
-
1500  pp.query("plot_per_2", m_plot_per_2);
-
1501 
-
1502  if ( (m_plot_int_1 > 0 && m_plot_per_1 > 0) ||
-
1503  (m_plot_int_2 > 0 && m_plot_per_2 > 0.) ) {
-
1504  Abort("Must choose only one of plot_int or plot_per");
-
1505  }
-
1506 
-
1507  pp.query("profile_int", profile_int);
-
1508  pp.query("destag_profiles", destag_profiles);
-
1509 
-
1510  pp.query("plot_lsm", plot_lsm);
-
1511 #ifdef ERF_USE_RRTMGP
-
1512  pp.query("plot_rad", plot_rad);
-
1513 #endif
-
1514 
-
1515  pp.query("output_1d_column", output_1d_column);
-
1516  pp.query("column_per", column_per);
-
1517  pp.query("column_interval", column_interval);
-
1518  pp.query("column_loc_x", column_loc_x);
-
1519  pp.query("column_loc_y", column_loc_y);
-
1520  pp.query("column_file_name", column_file_name);
-
1521 
-
1522  // Specify information about outputting planes of data
-
1523  pp.query("output_bndry_planes", output_bndry_planes);
-
1524  pp.query("bndry_output_planes_interval", bndry_output_planes_interval);
-
1525  pp.query("bndry_output_planes_per", bndry_output_planes_per);
-
1526  pp.query("bndry_output_start_time", bndry_output_planes_start_time);
-
1527 
-
1528  // Specify whether ingest boundary planes of data
-
1529  pp.query("input_bndry_planes", input_bndry_planes);
-
1530 
-
1531  // Query the set and total widths for wrfbdy interior ghost cells
-
1532  pp.query("real_width", real_width);
-
1533  pp.query("real_set_width", real_set_width);
+
1490  // NetCDF wrfbdy lateral boundary file
+
1491  pp.query("nc_bdy_file", nc_bdy_file);
+
1492 #endif
+
1493 
+
1494  // Flag to trigger initialization from input_sounding like WRF's ideal.exe
+
1495  pp.query("init_sounding_ideal", init_sounding_ideal);
+
1496 
+
1497  // Output format
+
1498  pp.query("plotfile_type", plotfile_type);
+
1499  pp.query("plot_file_1", plot_file_1);
+
1500  pp.query("plot_file_2", plot_file_2);
+
1501  pp.query("plot_int_1" , m_plot_int_1);
+
1502  pp.query("plot_int_2" , m_plot_int_2);
+
1503  pp.query("plot_per_1", m_plot_per_1);
+
1504  pp.query("plot_per_2", m_plot_per_2);
+
1505 
+
1506  if ( (m_plot_int_1 > 0 && m_plot_per_1 > 0) ||
+
1507  (m_plot_int_2 > 0 && m_plot_per_2 > 0.) ) {
+
1508  Abort("Must choose only one of plot_int or plot_per");
+
1509  }
+
1510 
+
1511  pp.query("profile_int", profile_int);
+
1512  pp.query("destag_profiles", destag_profiles);
+
1513 
+
1514  pp.query("plot_lsm", plot_lsm);
+
1515 #ifdef ERF_USE_RRTMGP
+
1516  pp.query("plot_rad", plot_rad);
+
1517 #endif
+
1518 
+
1519  pp.query("output_1d_column", output_1d_column);
+
1520  pp.query("column_per", column_per);
+
1521  pp.query("column_interval", column_interval);
+
1522  pp.query("column_loc_x", column_loc_x);
+
1523  pp.query("column_loc_y", column_loc_y);
+
1524  pp.query("column_file_name", column_file_name);
+
1525 
+
1526  // Specify information about outputting planes of data
+
1527  pp.query("output_bndry_planes", output_bndry_planes);
+
1528  pp.query("bndry_output_planes_interval", bndry_output_planes_interval);
+
1529  pp.query("bndry_output_planes_per", bndry_output_planes_per);
+
1530  pp.query("bndry_output_start_time", bndry_output_planes_start_time);
+
1531 
+
1532  // Specify whether ingest boundary planes of data
+
1533  pp.query("input_bndry_planes", input_bndry_planes);
1534 
-
1535  // Query the set and total widths for crse-fine interior ghost cells
-
1536  pp.query("cf_width", cf_width);
-
1537  pp.query("cf_set_width", cf_set_width);
+
1535  // Query the set and total widths for wrfbdy interior ghost cells
+
1536  pp.query("real_width", real_width);
+
1537  pp.query("real_set_width", real_set_width);
1538 
-
1539  // AmrMesh iterate on grids?
-
1540  bool iterate(true);
-
1541  pp_amr.query("iterate_grids",iterate);
-
1542  if (!iterate) SetIterateToFalse();
-
1543  }
-
1544 
-
1545 #ifdef ERF_USE_PARTICLES
-
1546  readTracersParams();
-
1547 #endif
+
1539  // Query the set and total widths for crse-fine interior ghost cells
+
1540  pp.query("cf_width", cf_width);
+
1541  pp.query("cf_set_width", cf_set_width);
+
1542 
+
1543  // AmrMesh iterate on grids?
+
1544  bool iterate(true);
+
1545  pp_amr.query("iterate_grids",iterate);
+
1546  if (!iterate) SetIterateToFalse();
+
1547  }
1548 
-
1549 #ifdef ERF_USE_MULTIBLOCK
- +
1549 #ifdef ERF_USE_PARTICLES
+
1550  readTracersParams();
1551 #endif
1552 
-
1553  solverChoice.init_params(max_level);
-
1554 
-
1555  // No moving terrain with init real (we must do this after init_params
-
1556  // because that is where we set terrain_type
-
1557  if (init_type == "real" && solverChoice.terrain_type == TerrainType::Moving) {
-
1558  Abort("Moving terrain is not supported with init real");
-
1559  }
-
1560 
-
1561  // What type of land surface model to use
-
1562  // NOTE: Must be checked after init_params
-
1563  if (solverChoice.lsm_type == LandSurfaceType::SLM) {
-
1564  lsm.SetModel<SLM>();
-
1565  Print() << "SLM land surface model!\n";
-
1566  } else if (solverChoice.lsm_type == LandSurfaceType::MM5) {
-
1567  lsm.SetModel<MM5>();
-
1568  Print() << "MM5 land surface model!\n";
-
1569  } else if (solverChoice.lsm_type == LandSurfaceType::None) {
-
1570  lsm.SetModel<NullSurf>();
-
1571  Print() << "Null land surface model!\n";
-
1572  } else {
-
1573  Abort("Dont know this LandSurfaceType!") ;
-
1574  }
-
1575 
-
1576  if (verbose > 0) {
-
1577  solverChoice.display(max_level);
+
1553 #ifdef ERF_USE_MULTIBLOCK
+ +
1555 #endif
+
1556 
+
1557  solverChoice.init_params(max_level);
+
1558 
+
1559  // No moving terrain with init real (we must do this after init_params
+
1560  // because that is where we set terrain_type
+
1561  if (init_type == "real" && solverChoice.terrain_type == TerrainType::Moving) {
+
1562  Abort("Moving terrain is not supported with init real");
+
1563  }
+
1564 
+
1565  // What type of land surface model to use
+
1566  // NOTE: Must be checked after init_params
+
1567  if (solverChoice.lsm_type == LandSurfaceType::SLM) {
+
1568  lsm.SetModel<SLM>();
+
1569  Print() << "SLM land surface model!\n";
+
1570  } else if (solverChoice.lsm_type == LandSurfaceType::MM5) {
+
1571  lsm.SetModel<MM5>();
+
1572  Print() << "MM5 land surface model!\n";
+
1573  } else if (solverChoice.lsm_type == LandSurfaceType::None) {
+
1574  lsm.SetModel<NullSurf>();
+
1575  Print() << "Null land surface model!\n";
+
1576  } else {
+
1577  Abort("Dont know this LandSurfaceType!") ;
1578  }
1579 
- -
1581 }
-
amrex::Vector< amrex::Vector< amrex::Box > > boxes_at_level
Definition: ERF.H:655
-
std::string plot_file_2
Definition: ERF.H:860
-
std::string restart_type
Definition: ERF.H:875
-
int regrid_int
Definition: ERF.H:856
-
amrex::Vector< int > num_files_at_level
Definition: ERF.H:654
-
static std::string nc_bdy_file
Definition: ERF.H:971
-
static amrex::Vector< amrex::Vector< std::string > > nc_init_file
Definition: ERF.H:968
-
std::string plot_file_1
Definition: ERF.H:859
-
void ParameterSanityChecks()
Definition: ERF.cpp:1585
-
amrex::Vector< int > num_boxes_at_level
Definition: ERF.H:653
-
std::string check_file
Definition: ERF.H:873
-
bool plot_lsm
Definition: ERF.H:866
+
1580  if (verbose > 0) {
+
1581  solverChoice.display(max_level);
+
1582  }
+
1583 
+ +
1585 }
+
amrex::Vector< amrex::Vector< amrex::Box > > boxes_at_level
Definition: ERF.H:659
+
std::string plot_file_2
Definition: ERF.H:864
+
std::string restart_type
Definition: ERF.H:879
+
int regrid_int
Definition: ERF.H:860
+
amrex::Vector< int > num_files_at_level
Definition: ERF.H:658
+
static std::string nc_bdy_file
Definition: ERF.H:975
+
static amrex::Vector< amrex::Vector< std::string > > nc_init_file
Definition: ERF.H:972
+
std::string plot_file_1
Definition: ERF.H:863
+
void ParameterSanityChecks()
Definition: ERF.cpp:1589
+
amrex::Vector< int > num_boxes_at_level
Definition: ERF.H:657
+
std::string check_file
Definition: ERF.H:877
+
bool plot_lsm
Definition: ERF.H:870
void SetModel()
Definition: ERF_LandSurface.H:23
Definition: ERF_MM5.H:26
Definition: ERF_NullSurf.H:8
@@ -13441,7 +13470,7 @@

364  } // if good

365  } // mfi
366 }
-
AMREX_FORCE_INLINE std::ostream & SampleLineLog(int i)
Definition: ERF.H:1152
+
AMREX_FORCE_INLINE std::ostream & SampleLineLog(int i)
Definition: ERF.H:1156
@@ -13518,7 +13547,7 @@

273  } // if good
274  } // only write from processor that holds the cell
275 }
-
AMREX_FORCE_INLINE std::ostream & SamplePointLog(int i)
Definition: ERF.H:1138
+
AMREX_FORCE_INLINE std::ostream & SamplePointLog(int i)
Definition: ERF.H:1142
@@ -13545,9 +13574,9 @@

-
1179  {
-
1180  return sampleline[i];
-
1181  }
+
1183  {
+
1184  return sampleline[i];
+
1185  }
@@ -13574,9 +13603,9 @@

-
1153  {
-
1154  return *samplelinelog[i];
-
1155  }
+
1157  {
+
1158  return *samplelinelog[i];
+
1159  }
@@ -13605,7 +13634,7 @@

The filename of the ith samplelinelog file.

-
1273 { return samplelinelogname[i]; }
+
1277 { return samplelinelogname[i]; }
@@ -13632,9 +13661,9 @@

-
1166  {
-
1167  return samplepoint[i];
-
1168  }
+
1170  {
+
1171  return samplepoint[i];
+
1172  }
@@ -13661,9 +13690,9 @@

-
1139  {
-
1140  return *sampleptlog[i];
-
1141  }
+
1143  {
+
1144  return *sampleptlog[i];
+
1145  }
@@ -13692,7 +13721,7 @@

The filename of the ith sampleptlog file.

-
1270 { return sampleptlogname[i]; }
+
1274 { return sampleptlogname[i]; }
@@ -13840,8 +13869,8 @@

127 
128  plot_var_names = tmp_plot_names;
129 }
-
const amrex::Vector< std::string > derived_names
Definition: ERF.H:886
-
const amrex::Vector< std::string > cons_names
Definition: ERF.H:881
+
const amrex::Vector< std::string > derived_names
Definition: ERF.H:890
+
const amrex::Vector< std::string > cons_names
Definition: ERF.H:885
Here is the call graph for this function:
@@ -13996,17 +14025,17 @@

-
1209  {
-
1210  if (amrex::ParallelDescriptor::IOProcessor())
-
1211  {
-
1212  datalog[i] = std::make_unique<std::fstream>();
-
1213  datalog[i]->open(filename.c_str(),std::ios::out|std::ios::app);
-
1214  if (!datalog[i]->good()) {
-
1215  amrex::FileOpenFailed(filename);
-
1216  }
-
1217  }
-
1218  amrex::ParallelDescriptor::Barrier("ERF::setRecordDataInfo");
-
1219  }
+
1213  {
+
1214  if (amrex::ParallelDescriptor::IOProcessor())
+
1215  {
+
1216  datalog[i] = std::make_unique<std::fstream>();
+
1217  datalog[i]->open(filename.c_str(),std::ios::out|std::ios::app);
+
1218  if (!datalog[i]->good()) {
+
1219  amrex::FileOpenFailed(filename);
+
1220  }
+
1221  }
+
1222  amrex::ParallelDescriptor::Barrier("ERF::setRecordDataInfo");
+
1223  }

@@ -14055,21 +14084,21 @@

-
1239  {
-
1240  amrex::MultiFab dummy(grids[lev],dmap[lev],1,0);
-
1241  for (amrex::MFIter mfi(dummy); mfi.isValid(); ++mfi)
-
1242  {
-
1243  const amrex::Box& bx = mfi.validbox();
-
1244  if (bx.contains(cell)) {
-
1245  samplelinelog[i] = std::make_unique<std::fstream>();
-
1246  samplelinelog[i]->open(filename.c_str(),std::ios::out|std::ios::app);
-
1247  if (!samplelinelog[i]->good()) {
-
1248  amrex::FileOpenFailed(filename);
-
1249  }
-
1250  }
-
1251  }
-
1252  amrex::ParallelDescriptor::Barrier("ERF::setRecordSampleLineInfo");
-
1253  }
+
1243  {
+
1244  amrex::MultiFab dummy(grids[lev],dmap[lev],1,0);
+
1245  for (amrex::MFIter mfi(dummy); mfi.isValid(); ++mfi)
+
1246  {
+
1247  const amrex::Box& bx = mfi.validbox();
+
1248  if (bx.contains(cell)) {
+
1249  samplelinelog[i] = std::make_unique<std::fstream>();
+
1250  samplelinelog[i]->open(filename.c_str(),std::ios::out|std::ios::app);
+
1251  if (!samplelinelog[i]->good()) {
+
1252  amrex::FileOpenFailed(filename);
+
1253  }
+
1254  }
+
1255  }
+
1256  amrex::ParallelDescriptor::Barrier("ERF::setRecordSampleLineInfo");
+
1257  }
@@ -14118,21 +14147,21 @@

-
1222  {
-
1223  amrex::MultiFab dummy(grids[lev],dmap[lev],1,0);
-
1224  for (amrex::MFIter mfi(dummy); mfi.isValid(); ++mfi)
-
1225  {
-
1226  const amrex::Box& bx = mfi.validbox();
-
1227  if (bx.contains(cell)) {
-
1228  sampleptlog[i] = std::make_unique<std::fstream>();
-
1229  sampleptlog[i]->open(filename.c_str(),std::ios::out|std::ios::app);
-
1230  if (!sampleptlog[i]->good()) {
-
1231  amrex::FileOpenFailed(filename);
-
1232  }
-
1233  }
-
1234  }
-
1235  amrex::ParallelDescriptor::Barrier("ERF::setRecordSamplePointInfo");
-
1236  }
+
1226  {
+
1227  amrex::MultiFab dummy(grids[lev],dmap[lev],1,0);
+
1228  for (amrex::MFIter mfi(dummy); mfi.isValid(); ++mfi)
+
1229  {
+
1230  const amrex::Box& bx = mfi.validbox();
+
1231  if (bx.contains(cell)) {
+
1232  sampleptlog[i] = std::make_unique<std::fstream>();
+
1233  sampleptlog[i]->open(filename.c_str(),std::ios::out|std::ios::app);
+
1234  if (!sampleptlog[i]->good()) {
+
1235  amrex::FileOpenFailed(filename);
+
1236  }
+
1237  }
+
1238  }
+
1239  amrex::ParallelDescriptor::Barrier("ERF::setRecordSamplePointInfo");
+
1240  }
@@ -14448,15 +14477,15 @@

168  }
169  }
170 }
-
AMREX_FORCE_INLINE int NumSampleLineLogs() noexcept
Definition: ERF.H:1159
-
AMREX_FORCE_INLINE int NumSamplePointLogs() noexcept
Definition: ERF.H:1145
-
amrex::IntVect & SampleLine(int i)
Definition: ERF.H:1178
-
AMREX_FORCE_INLINE int NumSamplePoints() noexcept
Definition: ERF.H:1172
-
AMREX_FORCE_INLINE int NumSampleLines() noexcept
Definition: ERF.H:1185
-
amrex::IntVect & SamplePoint(int i)
Definition: ERF.H:1165
+
AMREX_FORCE_INLINE int NumSampleLineLogs() noexcept
Definition: ERF.H:1163
+
AMREX_FORCE_INLINE int NumSamplePointLogs() noexcept
Definition: ERF.H:1149
+
amrex::IntVect & SampleLine(int i)
Definition: ERF.H:1182
+
AMREX_FORCE_INLINE int NumSamplePoints() noexcept
Definition: ERF.H:1176
+
AMREX_FORCE_INLINE int NumSampleLines() noexcept
Definition: ERF.H:1189
+
amrex::IntVect & SamplePoint(int i)
Definition: ERF.H:1169
void sample_points(int lev, amrex::Real time, amrex::IntVect cell, amrex::MultiFab &mf)
Definition: ERF_WriteScalarProfiles.cpp:249
-
AMREX_FORCE_INLINE std::ostream & DataLog(int i)
Definition: ERF.H:1124
-
AMREX_FORCE_INLINE int NumDataLogs() noexcept
Definition: ERF.H:1131
+
AMREX_FORCE_INLINE std::ostream & DataLog(int i)
Definition: ERF.H:1128
+
AMREX_FORCE_INLINE int NumDataLogs() noexcept
Definition: ERF.H:1135
void sample_lines(int lev, amrex::Real time, amrex::IntVect cell, amrex::MultiFab &mf)
Definition: ERF_WriteScalarProfiles.cpp:287
@@ -15837,8 +15866,8 @@

-

◆ WriteGenericPlotfileHeaderWithTerrain()

+ +

◆ WriteGenericPlotfileHeaderWithTerrain()

@@ -15867,6 +15896,12 @@

const amrex::Vector< std::string > &  varnames, + + + + const amrex::Vector< amrex::Geometry > &  + my_geom, + @@ -15879,6 +15914,12 @@

const amrex::Vector< int > &  level_steps, + + + + const amrex::Vector< amrex::IntVect > &  + my_ref_ratio, + @@ -15904,82 +15945,82 @@

-
1595 {
-
1596  AMREX_ALWAYS_ASSERT(nlevels <= bArray.size());
-
1597  AMREX_ALWAYS_ASSERT(nlevels <= ref_ratio.size()+1);
-
1598  AMREX_ALWAYS_ASSERT(nlevels <= level_steps.size());
-
1599 
-
1600  HeaderFile.precision(17);
-
1601 
-
1602  // ---- this is the generic plot file type name
-
1603  HeaderFile << versionName << '\n';
-
1604 
-
1605  HeaderFile << varnames.size() << '\n';
-
1606 
-
1607  for (int ivar = 0; ivar < varnames.size(); ++ivar) {
-
1608  HeaderFile << varnames[ivar] << "\n";
-
1609  }
-
1610  HeaderFile << AMREX_SPACEDIM << '\n';
-
1611  HeaderFile << time << '\n';
-
1612  HeaderFile << finest_level << '\n';
-
1613  for (int i = 0; i < AMREX_SPACEDIM; ++i) {
-
1614  HeaderFile << geom[0].ProbLo(i) << ' ';
-
1615  }
-
1616  HeaderFile << '\n';
-
1617  for (int i = 0; i < AMREX_SPACEDIM; ++i) {
-
1618  HeaderFile << geom[0].ProbHi(i) << ' ';
-
1619  }
-
1620  HeaderFile << '\n';
-
1621  for (int i = 0; i < finest_level; ++i) {
-
1622  HeaderFile << ref_ratio[i][0] << ' ';
+
1603 {
+
1604  AMREX_ALWAYS_ASSERT(nlevels <= bArray.size());
+
1605  AMREX_ALWAYS_ASSERT(nlevels <= my_ref_ratio.size()+1);
+
1606  AMREX_ALWAYS_ASSERT(nlevels <= level_steps.size());
+
1607 
+
1608  HeaderFile.precision(17);
+
1609 
+
1610  // ---- this is the generic plot file type name
+
1611  HeaderFile << versionName << '\n';
+
1612 
+
1613  HeaderFile << varnames.size() << '\n';
+
1614 
+
1615  for (int ivar = 0; ivar < varnames.size(); ++ivar) {
+
1616  HeaderFile << varnames[ivar] << "\n";
+
1617  }
+
1618  HeaderFile << AMREX_SPACEDIM << '\n';
+
1619  HeaderFile << my_time << '\n';
+
1620  HeaderFile << finest_level << '\n';
+
1621  for (int i = 0; i < AMREX_SPACEDIM; ++i) {
+
1622  HeaderFile << my_geom[0].ProbLo(i) << ' ';
1623  }
1624  HeaderFile << '\n';
-
1625  for (int i = 0; i <= finest_level; ++i) {
-
1626  HeaderFile << geom[i].Domain() << ' ';
+
1625  for (int i = 0; i < AMREX_SPACEDIM; ++i) {
+
1626  HeaderFile << my_geom[0].ProbHi(i) << ' ';
1627  }
1628  HeaderFile << '\n';
-
1629  for (int i = 0; i <= finest_level; ++i) {
-
1630  HeaderFile << level_steps[i] << ' ';
+
1629  for (int i = 0; i < finest_level; ++i) {
+
1630  HeaderFile << my_ref_ratio[i][0] << ' ';
1631  }
1632  HeaderFile << '\n';
1633  for (int i = 0; i <= finest_level; ++i) {
-
1634  for (int k = 0; k < AMREX_SPACEDIM; ++k) {
-
1635  HeaderFile << geom[i].CellSize()[k] << ' ';
-
1636  }
-
1637  HeaderFile << '\n';
-
1638  }
-
1639  HeaderFile << (int) geom[0].Coord() << '\n';
-
1640  HeaderFile << "0\n";
-
1641 
-
1642  for (int level = 0; level <= finest_level; ++level) {
-
1643  HeaderFile << level << ' ' << bArray[level].size() << ' ' << time << '\n';
-
1644  HeaderFile << level_steps[level] << '\n';
-
1645 
-
1646  const IntVect& domain_lo = geom[level].Domain().smallEnd();
-
1647  for (int i = 0; i < bArray[level].size(); ++i)
-
1648  {
-
1649  // Need to shift because the RealBox ctor we call takes the
-
1650  // physical location of index (0,0,0). This does not affect
-
1651  // the usual cases where the domain index starts with 0.
-
1652  const Box& b = shift(bArray[level][i], -domain_lo);
-
1653  RealBox loc = RealBox(b, geom[level].CellSize(), geom[level].ProbLo());
-
1654  for (int n = 0; n < AMREX_SPACEDIM; ++n) {
-
1655  HeaderFile << loc.lo(n) << ' ' << loc.hi(n) << '\n';
-
1656  }
-
1657  }
-
1658 
-
1659  HeaderFile << MultiFabHeaderPath(level, levelPrefix, mfPrefix) << '\n';
-
1660  }
-
1661  HeaderFile << "1" << "\n";
-
1662  HeaderFile << "3" << "\n";
-
1663  HeaderFile << "amrexvec_nu_x" << "\n";
-
1664  HeaderFile << "amrexvec_nu_y" << "\n";
-
1665  HeaderFile << "amrexvec_nu_z" << "\n";
-
1666  std::string mf_nodal_prefix = "Nu_nd";
-
1667  for (int level = 0; level <= finest_level; ++level) {
-
1668  HeaderFile << MultiFabHeaderPath(level, levelPrefix, mf_nodal_prefix) << '\n';
-
1669  }
-
1670 }
+
1634  HeaderFile << my_geom[i].Domain() << ' ';
+
1635  }
+
1636  HeaderFile << '\n';
+
1637  for (int i = 0; i <= finest_level; ++i) {
+
1638  HeaderFile << level_steps[i] << ' ';
+
1639  }
+
1640  HeaderFile << '\n';
+
1641  for (int i = 0; i <= finest_level; ++i) {
+
1642  for (int k = 0; k < AMREX_SPACEDIM; ++k) {
+
1643  HeaderFile << my_geom[i].CellSize()[k] << ' ';
+
1644  }
+
1645  HeaderFile << '\n';
+
1646  }
+
1647  HeaderFile << (int) my_geom[0].Coord() << '\n';
+
1648  HeaderFile << "0\n";
+
1649 
+
1650  for (int level = 0; level <= finest_level; ++level) {
+
1651  HeaderFile << level << ' ' << bArray[level].size() << ' ' << my_time << '\n';
+
1652  HeaderFile << level_steps[level] << '\n';
+
1653 
+
1654  const IntVect& domain_lo = my_geom[level].Domain().smallEnd();
+
1655  for (int i = 0; i < bArray[level].size(); ++i)
+
1656  {
+
1657  // Need to shift because the RealBox ctor we call takes the
+
1658  // physical location of index (0,0,0). This does not affect
+
1659  // the usual cases where the domain index starts with 0.
+
1660  const Box& b = shift(bArray[level][i], -domain_lo);
+
1661  RealBox loc = RealBox(b, my_geom[level].CellSize(), my_geom[level].ProbLo());
+
1662  for (int n = 0; n < AMREX_SPACEDIM; ++n) {
+
1663  HeaderFile << loc.lo(n) << ' ' << loc.hi(n) << '\n';
+
1664  }
+
1665  }
+
1666 
+
1667  HeaderFile << MultiFabHeaderPath(level, levelPrefix, mfPrefix) << '\n';
+
1668  }
+
1669  HeaderFile << "1" << "\n";
+
1670  HeaderFile << "3" << "\n";
+
1671  HeaderFile << "amrexvec_nu_x" << "\n";
+
1672  HeaderFile << "amrexvec_nu_y" << "\n";
+
1673  HeaderFile << "amrexvec_nu_z" << "\n";
+
1674  std::string mf_nodal_prefix = "Nu_nd";
+
1675  for (int level = 0; level <= finest_level; ++level) {
+
1676  HeaderFile << MultiFabHeaderPath(level, levelPrefix, mf_nodal_prefix) << '\n';
+
1677  }
+
1678 }
Coord
Definition: ERF_DataStruct.H:60
@@ -16125,7 +16166,7 @@

133  jobInfoFile.close();

134 }
std::string inputs_name
Definition: main.cpp:23
-
static amrex::Real getCPUTime()
Definition: ERF.H:1194
+
static amrex::Real getCPUTime()
Definition: ERF.H:1198
Here is the call graph for this function:
@@ -16141,8 +16182,8 @@

-

◆ WriteMultiLevelPlotfileWithTerrain()

+ +

◆ WriteMultiLevelPlotfileWithTerrain()

@@ -16177,6 +16218,12 @@

const amrex::Vector< std::string > &  varnames, + + + + const amrex::Vector< amrex::Geometry > &  + my_geom, + @@ -16189,6 +16236,12 @@

const amrex::Vector< int > &  level_steps, + + + + const amrex::Vector< amrex::IntVect > &  + my_ref_ratio, + @@ -16220,81 +16273,81 @@

-
1511 {
-
1512  BL_PROFILE("WriteMultiLevelPlotfileWithTerrain()");
-
1513 
-
1514  AMREX_ALWAYS_ASSERT(nlevels <= mf.size());
-
1515  AMREX_ALWAYS_ASSERT(nlevels <= ref_ratio.size()+1);
-
1516  AMREX_ALWAYS_ASSERT(nlevels <= level_steps.size());
-
1517  AMREX_ALWAYS_ASSERT(mf[0]->nComp() == varnames.size());
-
1518 
-
1519  bool callBarrier(false);
-
1520  PreBuildDirectorHierarchy(plotfilename, levelPrefix, nlevels, callBarrier);
-
1521  if (!extra_dirs.empty()) {
-
1522  for (const auto& d : extra_dirs) {
-
1523  const std::string ed = plotfilename+"/"+d;
-
1524  PreBuildDirectorHierarchy(ed, levelPrefix, nlevels, callBarrier);
-
1525  }
-
1526  }
-
1527  ParallelDescriptor::Barrier();
-
1528 
-
1529  if (ParallelDescriptor::MyProc() == ParallelDescriptor::NProcs()-1) {
-
1530  Vector<BoxArray> boxArrays(nlevels);
-
1531  for(int level(0); level < boxArrays.size(); ++level) {
-
1532  boxArrays[level] = mf[level]->boxArray();
-
1533  }
+
1517 {
+
1518  BL_PROFILE("WriteMultiLevelPlotfileWithTerrain()");
+
1519 
+
1520  AMREX_ALWAYS_ASSERT(nlevels <= mf.size());
+
1521  AMREX_ALWAYS_ASSERT(nlevels <= ref_ratio.size()+1);
+
1522  AMREX_ALWAYS_ASSERT(nlevels <= level_steps.size());
+
1523  AMREX_ALWAYS_ASSERT(mf[0]->nComp() == varnames.size());
+
1524 
+
1525  bool callBarrier(false);
+
1526  PreBuildDirectorHierarchy(plotfilename, levelPrefix, nlevels, callBarrier);
+
1527  if (!extra_dirs.empty()) {
+
1528  for (const auto& d : extra_dirs) {
+
1529  const std::string ed = plotfilename+"/"+d;
+
1530  PreBuildDirectorHierarchy(ed, levelPrefix, nlevels, callBarrier);
+
1531  }
+
1532  }
+
1533  ParallelDescriptor::Barrier();
1534 
-
1535  auto f = [=]() {
-
1536  VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size);
-
1537  std::string HeaderFileName(plotfilename + "/Header");
-
1538  std::ofstream HeaderFile;
-
1539  HeaderFile.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.size());
-
1540  HeaderFile.open(HeaderFileName.c_str(), std::ofstream::out |
-
1541  std::ofstream::trunc |
-
1542  std::ofstream::binary);
-
1543  if( ! HeaderFile.good()) FileOpenFailed(HeaderFileName);
-
1544  WriteGenericPlotfileHeaderWithTerrain(HeaderFile, nlevels, boxArrays, varnames,
-
1545  time, level_steps, versionName,
-
1546  levelPrefix, mfPrefix);
-
1547  };
-
1548 
-
1549  if (AsyncOut::UseAsyncOut()) {
-
1550  AsyncOut::Submit(std::move(f));
-
1551  } else {
-
1552  f();
-
1553  }
-
1554  }
-
1555 
-
1556  std::string mf_nodal_prefix = "Nu_nd";
-
1557  for (int level = 0; level <= finest_level; ++level)
-
1558  {
-
1559  if (AsyncOut::UseAsyncOut()) {
-
1560  VisMF::AsyncWrite(*mf[level],
-
1561  MultiFabFileFullPrefix(level, plotfilename, levelPrefix, mfPrefix),
-
1562  true);
-
1563  VisMF::AsyncWrite(*mf_nd[level],
-
1564  MultiFabFileFullPrefix(level, plotfilename, levelPrefix, mf_nodal_prefix),
-
1565  true);
-
1566  } else {
-
1567  const MultiFab* data;
-
1568  std::unique_ptr<MultiFab> mf_tmp;
-
1569  if (mf[level]->nGrowVect() != 0) {
-
1570  mf_tmp = std::make_unique<MultiFab>(mf[level]->boxArray(),
-
1571  mf[level]->DistributionMap(),
-
1572  mf[level]->nComp(), 0, MFInfo(),
-
1573  mf[level]->Factory());
-
1574  MultiFab::Copy(*mf_tmp, *mf[level], 0, 0, mf[level]->nComp(), 0);
-
1575  data = mf_tmp.get();
-
1576  } else {
-
1577  data = mf[level];
-
1578  }
-
1579  VisMF::Write(*data , MultiFabFileFullPrefix(level, plotfilename, levelPrefix, mfPrefix));
-
1580  VisMF::Write(*mf_nd[level], MultiFabFileFullPrefix(level, plotfilename, levelPrefix, mf_nodal_prefix));
-
1581  }
-
1582  }
-
1583 }
-
void WriteGenericPlotfileHeaderWithTerrain(std::ostream &HeaderFile, int nlevels, const amrex::Vector< amrex::BoxArray > &bArray, const amrex::Vector< std::string > &varnames, amrex::Real time, const amrex::Vector< int > &level_steps, const std::string &versionName, const std::string &levelPrefix, const std::string &mfPrefix) const
Definition: ERF_Plotfile.cpp:1586
-
amrex::FabFactory< amrex::FArrayBox > const & Factory(int lev) const noexcept
Definition: ERF.H:1278
+
1535  if (ParallelDescriptor::MyProc() == ParallelDescriptor::NProcs()-1) {
+
1536  Vector<BoxArray> boxArrays(nlevels);
+
1537  for(int level(0); level < boxArrays.size(); ++level) {
+
1538  boxArrays[level] = mf[level]->boxArray();
+
1539  }
+
1540 
+
1541  auto f = [=]() {
+
1542  VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size);
+
1543  std::string HeaderFileName(plotfilename + "/Header");
+
1544  std::ofstream HeaderFile;
+
1545  HeaderFile.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.size());
+
1546  HeaderFile.open(HeaderFileName.c_str(), std::ofstream::out |
+
1547  std::ofstream::trunc |
+
1548  std::ofstream::binary);
+
1549  if( ! HeaderFile.good()) FileOpenFailed(HeaderFileName);
+
1550  WriteGenericPlotfileHeaderWithTerrain(HeaderFile, nlevels, boxArrays, varnames,
+
1551  geom, time, level_steps, ref_ratio, versionName,
+
1552  levelPrefix, mfPrefix);
+
1553  };
+
1554 
+
1555  if (AsyncOut::UseAsyncOut()) {
+
1556  AsyncOut::Submit(std::move(f));
+
1557  } else {
+
1558  f();
+
1559  }
+
1560  }
+
1561 
+
1562  std::string mf_nodal_prefix = "Nu_nd";
+
1563  for (int level = 0; level <= finest_level; ++level)
+
1564  {
+
1565  if (AsyncOut::UseAsyncOut()) {
+
1566  VisMF::AsyncWrite(*mf[level],
+
1567  MultiFabFileFullPrefix(level, plotfilename, levelPrefix, mfPrefix),
+
1568  true);
+
1569  VisMF::AsyncWrite(*mf_nd[level],
+
1570  MultiFabFileFullPrefix(level, plotfilename, levelPrefix, mf_nodal_prefix),
+
1571  true);
+
1572  } else {
+
1573  const MultiFab* data;
+
1574  std::unique_ptr<MultiFab> mf_tmp;
+
1575  if (mf[level]->nGrowVect() != 0) {
+
1576  mf_tmp = std::make_unique<MultiFab>(mf[level]->boxArray(),
+
1577  mf[level]->DistributionMap(),
+
1578  mf[level]->nComp(), 0, MFInfo(),
+
1579  mf[level]->Factory());
+
1580  MultiFab::Copy(*mf_tmp, *mf[level], 0, 0, mf[level]->nComp(), 0);
+
1581  data = mf_tmp.get();
+
1582  } else {
+
1583  data = mf[level];
+
1584  }
+
1585  VisMF::Write(*data , MultiFabFileFullPrefix(level, plotfilename, levelPrefix, mfPrefix));
+
1586  VisMF::Write(*mf_nd[level], MultiFabFileFullPrefix(level, plotfilename, levelPrefix, mf_nodal_prefix));
+
1587  }
+
1588  }
+
1589 }
+
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, amrex::Real 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:1592
+
amrex::FabFactory< amrex::FArrayBox > const & Factory(int lev) const noexcept
Definition: ERF.H:1282

@@ -16341,47 +16394,47 @@

-
2089 {
-
2090  bool write_now = false;
-
2091 
-
2092  if ( plot_int > 0 && (nstep % plot_int == 0) ) {
-
2093  write_now = true;
-
2094 
-
2095  } else if (plot_per > 0.0) {
-
2096 
-
2097  // Check to see if we've crossed a plot_per interval by comparing
-
2098  // the number of intervals that have elapsed for both the current
-
2099  // time and the time at the beginning of this timestep.
+
2093 {
+
2094  bool write_now = false;
+
2095 
+
2096  if ( plot_int > 0 && (nstep % plot_int == 0) ) {
+
2097  write_now = true;
+
2098 
+
2099  } else if (plot_per > 0.0) {
2100 
-
2101  const Real eps = std::numeric_limits<Real>::epsilon() * Real(10.0) * std::abs(cur_time);
-
2102 
-
2103  int num_per_old = static_cast<int>(std::floor((cur_time-eps-dt_lev) / plot_per));
-
2104  int num_per_new = static_cast<int>(std::floor((cur_time-eps ) / plot_per));
-
2105 
-
2106  // Before using these, however, we must test for the case where we're
-
2107  // within machine epsilon of the next interval. In that case, increment
-
2108  // the counter, because we have indeed reached the next plot_per interval
-
2109  // at this point.
-
2110 
-
2111  const Real next_plot_time = (num_per_old + 1) * plot_per;
-
2112 
-
2113  if ((num_per_new == num_per_old) && std::abs(cur_time - next_plot_time) <= eps)
-
2114  {
-
2115  num_per_new += 1;
-
2116  }
-
2117 
-
2118  // Similarly, we have to account for the case where the old time is within
-
2119  // machine epsilon of the beginning of this interval, so that we don't double
-
2120  // count that time threshold -- we already plotted at that time on the last timestep.
+
2101  // Check to see if we've crossed a plot_per interval by comparing
+
2102  // the number of intervals that have elapsed for both the current
+
2103  // time and the time at the beginning of this timestep.
+
2104 
+
2105  const Real eps = std::numeric_limits<Real>::epsilon() * Real(10.0) * std::abs(cur_time);
+
2106 
+
2107  int num_per_old = static_cast<int>(std::floor((cur_time-eps-dt_lev) / plot_per));
+
2108  int num_per_new = static_cast<int>(std::floor((cur_time-eps ) / plot_per));
+
2109 
+
2110  // Before using these, however, we must test for the case where we're
+
2111  // within machine epsilon of the next interval. In that case, increment
+
2112  // the counter, because we have indeed reached the next plot_per interval
+
2113  // at this point.
+
2114 
+
2115  const Real next_plot_time = (num_per_old + 1) * plot_per;
+
2116 
+
2117  if ((num_per_new == num_per_old) && std::abs(cur_time - next_plot_time) <= eps)
+
2118  {
+
2119  num_per_new += 1;
+
2120  }
2121 
-
2122  if ((num_per_new != num_per_old) && std::abs((cur_time - dt_lev) - next_plot_time) <= eps)
-
2123  num_per_old += 1;
-
2124 
-
2125  if (num_per_old != num_per_new)
-
2126  write_now = true;
-
2127  }
-
2128  return write_now;
-
2129 }
+
2122  // Similarly, we have to account for the case where the old time is within
+
2123  // machine epsilon of the beginning of this interval, so that we don't double
+
2124  // count that time threshold -- we already plotted at that time on the last timestep.
+
2125 
+
2126  if ((num_per_new != num_per_old) && std::abs((cur_time - dt_lev) - next_plot_time) <= eps)
+
2127  num_per_old += 1;
+
2128 
+
2129  if (num_per_old != num_per_new)
+
2130  write_now = true;
+
2131  }
+
2132  return write_now;
+
2133 }

@@ -17586,11 +17639,11 @@

1364  if (plotfile_type == "amrex") {

1365  Print() << "Writing native plotfile " << plotfilename << "\n";
1366  if (solverChoice.use_terrain) {
-
1367  WriteMultiLevelPlotfileWithTerrain(plotfilename, finest_level+1,
+
1367  WriteMultiLevelPlotfileWithTerrain(plotfilename, finest_level+1,
1368  GetVecOfConstPtrs(mf),
1369  GetVecOfConstPtrs(mf_nd),
1370  varnames,
-
1371  t_new[0], istep);
+
1371  Geom(), t_new[0], istep, refRatio());
1372  } else {
1373  WriteMultiLevelPlotfile(plotfilename, finest_level+1,
1374  GetVecOfConstPtrs(mf),
@@ -17625,99 +17678,103 @@

1403 
1404  if (plotfile_type == "amrex") {
1405 
-
1406  if (ref_ratio[0][2] == 1) {
-
1407 
-
1408  Vector<IntVect> r2(finest_level);
-
1409  Vector<Geometry> g2(finest_level+1);
-
1410  Vector<MultiFab> mf2(finest_level+1);
+
1406  // NOTE: this assumes that -- at least -- there is refinement in the x-direction
+
1407  // Otherwise the logic will be wrong
+
1408  int lev0 = 0;
+
1409  int desired_ratio = ref_ratio[lev0][0];
+
1410  if (ref_ratio[lev0][2] == 1) {
1411 
-
1412  mf2[0].define(grids[0], dmap[0], ncomp_mf, 0);
-
1413 
-
1414  // Copy level 0 as is
-
1415  MultiFab::Copy(mf2[0],mf[0],0,0,mf[0].nComp(),0);
-
1416 
-
1417  // Define a new multi-level array of Geometry's so that we pass the new "domain" at lev > 0
-
1418  Array<int,AMREX_SPACEDIM> periodicity =
-
1419  {Geom()[0].isPeriodic(0),Geom()[0].isPeriodic(1),Geom()[0].isPeriodic(2)};
-
1420  g2[0].define(Geom()[0].Domain(),&(Geom()[0].ProbDomain()),0,periodicity.data());
-
1421 
-
1422  r2[0] = IntVect(1,1,ref_ratio[0][0]);
-
1423  for (int lev = 1; lev <= finest_level; ++lev) {
-
1424  if (lev > 1) {
-
1425  r2[lev-1][0] = 1;
-
1426  r2[lev-1][1] = 1;
-
1427  r2[lev-1][2] = r2[lev-2][2] * ref_ratio[lev-1][0];
-
1428  }
-
1429 
-
1430  mf2[lev].define(refine(grids[lev],r2[lev-1]), dmap[lev], ncomp_mf, 0);
-
1431 
-
1432  // Set the new problem domain
-
1433  Box d2(Geom()[lev].Domain());
-
1434  d2.refine(r2[lev-1]);
+
1412  Vector<IntVect> r2(finest_level);
+
1413  Vector<Geometry> g2(finest_level+1);
+
1414  Vector<MultiFab> mf2(finest_level+1);
+
1415 
+
1416  mf2[0].define(grids[0], dmap[0], ncomp_mf, 0);
+
1417 
+
1418  // Copy level 0 as is
+
1419  MultiFab::Copy(mf2[0],mf[0],0,0,mf[0].nComp(),0);
+
1420 
+
1421  // Define a new multi-level array of Geometry's so that we pass the new "domain" at lev > 0
+
1422  Array<int,AMREX_SPACEDIM> periodicity =
+
1423  {Geom()[lev0].isPeriodic(0),Geom()[lev0].isPeriodic(1),Geom()[lev0].isPeriodic(2)};
+
1424  g2[lev0].define(Geom()[lev0].Domain(),&(Geom()[lev0].ProbDomain()),0,periodicity.data());
+
1425 
+
1426  r2[0] = IntVect(1,desired_ratio, desired_ratio);
+
1427  for (int lev = 1; lev <= finest_level; ++lev) {
+
1428  if (lev > 1) {
+
1429  r2[lev-1][0] = 1;
+
1430  r2[lev-1][1] *= desired_ratio / ref_ratio[lev0][1];
+
1431  r2[lev-1][2] *= desired_ratio / ref_ratio[lev0][2];
+
1432  }
+
1433 
+
1434  mf2[lev].define(refine(grids[lev],r2[lev-1]), dmap[lev], ncomp_mf, 0);
1435 
-
1436  g2[lev].define(d2,&(Geom()[lev].ProbDomain()),0,periodicity.data());
-
1437  }
-
1438 
-
1439  // Do piecewise interpolation of mf into mf2
-
1440  for (int lev = 1; lev <= finest_level; ++lev) {
-
1441  Interpolater* mapper_c = &pc_interp;
-
1442  InterpFromCoarseLevel(mf2[lev], t_new[lev], mf[lev],
-
1443  0, 0, ncomp_mf,
-
1444  geom[lev], g2[lev],
- -
1446  r2[lev-1], mapper_c, domain_bcs_type, 0);
-
1447  }
-
1448 
-
1449  // Define an effective ref_ratio which is isotropic to be passed into WriteMultiLevelPlotfile
-
1450  Vector<IntVect> rr(finest_level);
-
1451  for (int lev = 0; lev < finest_level; ++lev) {
-
1452  rr[lev] = IntVect(ref_ratio[lev][0],ref_ratio[lev][1],ref_ratio[lev][0]);
-
1453  }
-
1454 
-
1455  Print() << "Writing plotfile " << plotfilename << "\n";
-
1456  if (solverChoice.use_terrain) {
-
1457  WriteMultiLevelPlotfileWithTerrain(plotfilename, finest_level+1,
-
1458  GetVecOfConstPtrs(mf),
-
1459  GetVecOfConstPtrs(mf_nd),
-
1460  varnames,
-
1461  t_new[0], istep);
-
1462  } else {
-
1463  WriteMultiLevelPlotfile(plotfilename, finest_level+1,
-
1464  GetVecOfConstPtrs(mf2), varnames,
-
1465  g2, t_new[0], istep, rr);
-
1466  }
-
1467 
-
1468  } else if (ref_ratio[0][2] != 1) {
-
1469  if (solverChoice.use_terrain) {
-
1470  WriteMultiLevelPlotfileWithTerrain(plotfilename, finest_level+1,
-
1471  GetVecOfConstPtrs(mf),
-
1472  GetVecOfConstPtrs(mf_nd),
-
1473  varnames,
-
1474  t_new[0], istep);
-
1475  } else {
-
1476  WriteMultiLevelPlotfile(plotfilename, finest_level+1,
-
1477  GetVecOfConstPtrs(mf), varnames,
-
1478  geom, t_new[0], istep, ref_ratio);
-
1479  }
-
1480  } // ref_ratio test
-
1481 
-
1482  writeJobInfo(plotfilename);
-
1483 
-
1484 #ifdef ERF_USE_PARTICLES
-
1485  particleData.writePlotFile(plotfilename);
-
1486 #endif
+
1436  // Set the new problem domain
+
1437  Box d2(Geom()[lev].Domain());
+
1438  d2.refine(r2[lev-1]);
+
1439 
+
1440  g2[lev].define(d2,&(Geom()[lev].ProbDomain()),0,periodicity.data());
+
1441  }
+
1442 
+
1443  // Do piecewise interpolation of mf into mf2
+
1444  for (int lev = 1; lev <= finest_level; ++lev) {
+
1445  Interpolater* mapper_c = &pc_interp;
+
1446  InterpFromCoarseLevel(mf2[lev], t_new[lev], mf[lev],
+
1447  0, 0, ncomp_mf,
+
1448  geom[lev], g2[lev],
+ +
1450  r2[lev-1], mapper_c, domain_bcs_type, 0);
+
1451  }
+
1452 
+
1453  // Define an effective ref_ratio which is isotropic to be passed into WriteMultiLevelPlotfile
+
1454  Vector<IntVect> rr(finest_level);
+
1455  for (int lev = 0; lev < finest_level; ++lev) {
+
1456  rr[lev] = IntVect(desired_ratio);
+
1457  }
+
1458 
+
1459  Print() << "Writing plotfile " << plotfilename << "\n";
+
1460  if (solverChoice.use_terrain) {
+
1461  WriteMultiLevelPlotfileWithTerrain(plotfilename, finest_level+1,
+
1462  GetVecOfConstPtrs(mf2),
+
1463  GetVecOfConstPtrs(mf_nd),
+
1464  varnames,
+
1465  g2, t_new[0], istep, rr);
+
1466  } else {
+
1467  WriteMultiLevelPlotfile(plotfilename, finest_level+1,
+
1468  GetVecOfConstPtrs(mf2), varnames,
+
1469  g2, t_new[0], istep, rr);
+
1470  }
+
1471 
+
1472  } else if (ref_ratio[0][2] != 1) {
+
1473  if (solverChoice.use_terrain) {
+
1474  WriteMultiLevelPlotfileWithTerrain(plotfilename, finest_level+1,
+
1475  GetVecOfConstPtrs(mf),
+
1476  GetVecOfConstPtrs(mf_nd),
+
1477  varnames,
+
1478  geom, t_new[0], istep, ref_ratio);
+
1479  } else {
+
1480  WriteMultiLevelPlotfile(plotfilename, finest_level+1,
+
1481  GetVecOfConstPtrs(mf), varnames,
+
1482  geom, t_new[0], istep, ref_ratio);
+
1483  }
+
1484  } // ref_ratio test
+
1485 
+
1486  writeJobInfo(plotfilename);
1487 
-
1488 #ifdef ERF_USE_NETCDF
-
1489  } else if (plotfile_type == "netcdf" || plotfile_type == "NetCDF") {
-
1490  for (int lev = 0; lev <= finest_level; ++lev) {
-
1491  for (int which_box = 0; which_box < num_boxes_at_level[lev]; which_box++) {
-
1492  writeNCPlotFile(lev, which_box, plotfilename, GetVecOfConstPtrs(mf), varnames, istep, t_new[0]);
-
1493  }
-
1494  }
-
1495 #endif
-
1496  }
-
1497  } // end multi-level
-
1498 }
+
1488 #ifdef ERF_USE_PARTICLES
+
1489  particleData.writePlotFile(plotfilename);
+
1490 #endif
+
1491 
+
1492 #ifdef ERF_USE_NETCDF
+
1493  } else if (plotfile_type == "netcdf" || plotfile_type == "NetCDF") {
+
1494  for (int lev = 0; lev <= finest_level; ++lev) {
+
1495  for (int which_box = 0; which_box < num_boxes_at_level[lev]; which_box++) {
+
1496  writeNCPlotFile(lev, which_box, plotfilename, GetVecOfConstPtrs(mf), varnames, istep, t_new[0]);
+
1497  }
+
1498  }
+
1499 #endif
+
1500  }
+
1501  } // end multi-level
+
1502 }
constexpr amrex::Real Cp_d
Definition: ERF_Constants.H:12
constexpr amrex::Real PI
Definition: ERF_Constants.H:6
constexpr amrex::Real CONST_GRAV
Definition: ERF_Constants.H:21
@@ -17736,7 +17793,7 @@

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_eta_AtJface(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:156
void FillBdyCCVels(amrex::Vector< amrex::MultiFab > &mf_cc_vel)
Definition: ERF_FillPatch.cpp:704
static amrex::Vector< std::string > PlotFileVarNames(amrex::Vector< std::string > plot_var_names)
Definition: ERF_Plotfile.cpp:178
-
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, amrex::Real time, const amrex::Vector< int > &level_steps, 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:1501
+
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, amrex::Real 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:1505
void writeJobInfo(const std::string &dir) const
Definition: ERF_writeJobInfo.cpp:9
void Plot_Lsm_Data(amrex::Real time, const amrex::Vector< int > &level_steps, const amrex::Vector< amrex::IntVect > &ref_ratio)
Definition: ERF_LandSurface.H:80
@ Mom_h
Definition: ERF_IndexDefines.H:143
diff --git a/classERF.js b/classERF.js index 825daca48..eb91d4b0c 100644 --- a/classERF.js +++ b/classERF.js @@ -125,9 +125,9 @@ var classERF = [ "write_1D_profiles_stag", "classERF.html#a39efa3a0f3ae3deb7a43f4ce110ee49a", null ], [ "writeBuildInfo", "classERF.html#ae6afed5b3a72ca80ccf0d791b08516aa", null ], [ "WriteCheckpointFile", "classERF.html#ad101fd46096db2d6b21544bfede6551f", null ], - [ "WriteGenericPlotfileHeaderWithTerrain", "classERF.html#a16e49fd65c68e2afc2140bd9e97bcbe9", null ], + [ "WriteGenericPlotfileHeaderWithTerrain", "classERF.html#a3a918bd26ed0c1dc2efa75c2586ff664", null ], [ "writeJobInfo", "classERF.html#aa2d8099655a8779836e63e3e98ea4372", null ], - [ "WriteMultiLevelPlotfileWithTerrain", "classERF.html#a898410553492b2add00a72374dcec6ba", null ], + [ "WriteMultiLevelPlotfileWithTerrain", "classERF.html#a61510e69bdaee84a01cf33943b043a5c", null ], [ "writeNow", "classERF.html#af2e4de4eaa0f93149c1aefd58dc7068a", null ], [ "WritePlotFile", "classERF.html#a0b0b4140e117163895e5e2c89a68d12a", null ], [ "advflux_reg", "classERF.html#a86a0bc8e41668411ee0ab5801d4688a7", null ], diff --git a/classMultiBlockContainer.html b/classMultiBlockContainer.html index d4925426a..55dcbd8fc 100644 --- a/classMultiBlockContainer.html +++ b/classMultiBlockContainer.html @@ -391,7 +391,7 @@

184  amrex::NonLocalBC::ParallelCopy(erf2.vars_new[0][dst_ind], erf1.vars_new[0][src_ind],
185  *(cmd[dst_ind][j]), 0, 0, 1, dtos);
186 }
-
amrex::Vector< amrex::Vector< amrex::MultiFab > > vars_new
Definition: ERF.H:669
+
amrex::Vector< amrex::Vector< amrex::MultiFab > > vars_new
Definition: ERF.H:673
std::vector< std::vector< amrex::NonLocalBC::MultiBlockCommMetaData * > > cmd
Definition: ERF_MultiBlockContainer.H:43
diff --git a/functions_func_w.html b/functions_func_w.html index ca391f907..9863c21ce 100644 --- a/functions_func_w.html +++ b/functions_func_w.html @@ -146,13 +146,13 @@

- w -

    : ERF
  • WriteGenericPlotfileHeaderWithTerrain() -: ERF +: ERF
  • writeJobInfo() : ERF
  • WriteMultiLevelPlotfileWithTerrain() -: ERF +: ERF
  • writeNow() : ERF diff --git a/functions_w.html b/functions_w.html index 6ffd7af94..86cd44872 100644 --- a/functions_w.html +++ b/functions_w.html @@ -204,13 +204,13 @@

    - w -

      : ERF
    • WriteGenericPlotfileHeaderWithTerrain() -: ERF +: ERF
    • writeJobInfo() : ERF
    • WriteMultiLevelPlotfileWithTerrain() -: ERF +: ERF
    • writeNow() : ERF diff --git a/navtreedata.js b/navtreedata.js index 01e7dc322..05b517719 100644 --- a/navtreedata.js +++ b/navtreedata.js @@ -76,7 +76,7 @@ var NAVTREEINDEX = "ERF__DiffusionSrcForState__N_8cpp.html#a61d842d8a45b6d97948ce19b106bba0a", "ERF__NCWpsFile_8H.html#a147911bcb83952a10f7560fd4e9d8f06aaa684fa862f886663c11fcad18416550", "ERF__fast__rhs__MT_8cpp.html", -"classERF.html#a18c1142552120bbd22987f34995ee939", +"classERF.html#a18e6dbbf968b4492e78aa427791620f4", "classERF.html#adc284f421c5fd9dd15c0e5cbe4ff5fc8", "classIntersectionCIF.html#abf356bbe64e8979330be6f8b3417a100", "classMamConstituents.html#a19309fc1bfd9a51b5ac412ba7f17734f", diff --git a/navtreeindex3.js b/navtreeindex3.js index df27cf28e..90cbd897d 100644 --- a/navtreeindex3.js +++ b/navtreeindex3.js @@ -248,6 +248,6 @@ var NAVTREEINDEX3 = "classERF.html#a15af18ae136cf3a11bb63fe0cf3924c8":[2,0,22,87], "classERF.html#a15db5266359edba700f523f16da303a7":[2,0,22,182], "classERF.html#a16e1f6b8bbb05ae738daf2abe626c159":[2,0,22,18], -"classERF.html#a16e49fd65c68e2afc2140bd9e97bcbe9":[2,0,22,125], -"classERF.html#a18610f7aac948db169cf8a4642573027":[2,0,22,96] +"classERF.html#a18610f7aac948db169cf8a4642573027":[2,0,22,96], +"classERF.html#a18c1142552120bbd22987f34995ee939":[2,0,22,322] }; diff --git a/navtreeindex4.js b/navtreeindex4.js index 6f553ee75..74be1e2a8 100644 --- a/navtreeindex4.js +++ b/navtreeindex4.js @@ -1,6 +1,5 @@ var NAVTREEINDEX4 = { -"classERF.html#a18c1142552120bbd22987f34995ee939":[2,0,22,322], "classERF.html#a18e6dbbf968b4492e78aa427791620f4":[2,0,22,27], "classERF.html#a18fa84b06132715757d97ec38678aa2c":[2,0,22,259], "classERF.html#a19c8017ca1ff0eead61abd7e0ce62232":[2,0,22,33], @@ -50,6 +49,7 @@ var NAVTREEINDEX4 = "classERF.html#a3937527f96c81674fa38dc34ed24f3f5":[2,0,22,276], "classERF.html#a393b540493795b8c6ee0f64634b8b815":[2,0,22,186], "classERF.html#a39efa3a0f3ae3deb7a43f4ce110ee49a":[2,0,22,122], +"classERF.html#a3a918bd26ed0c1dc2efa75c2586ff664":[2,0,22,125], "classERF.html#a3b9bcb54c278dfec6027e9727cc01bc5":[2,0,22,166], "classERF.html#a3c5eca26a28dda3a981b3581abadfca0":[2,0,22,199], "classERF.html#a3cf7cb2e51eb7b69cb4079ffc6722459":[2,0,22,181], @@ -103,6 +103,7 @@ var NAVTREEINDEX4 = "classERF.html#a60a185c47f07bf4fb537a15d5a226d8a":[2,0,22,319], "classERF.html#a60e8cb933f237903e3fbcd6376c26db0":[2,0,22,268], "classERF.html#a610a988f46e0496e6dbd0471ae817f75":[2,0,22,248], +"classERF.html#a61510e69bdaee84a01cf33943b043a5c":[2,0,22,127], "classERF.html#a618e8fdff3239cc79d4145d02b1ecaa2":[2,0,22,43], "classERF.html#a633cd0b44d2e38f02c23e953aecd69eb":[2,0,22,269], "classERF.html#a63c64467bb933ddd2feff8b08e48b812":[2,0,22,49], @@ -152,7 +153,6 @@ var NAVTREEINDEX4 = "classERF.html#a87aad7caaf3b575734994b47628a2faf":[2,0,22,200], "classERF.html#a87dc6c0720462bfd088c909289cdca0b":[2,0,22,245], "classERF.html#a87e58f16f44a6cb35d6983ed3fe7d3c1":[2,0,22,144], -"classERF.html#a898410553492b2add00a72374dcec6ba":[2,0,22,127], "classERF.html#a89f605d1a1eae06a7c79f9b6b65c637f":[2,0,22,148], "classERF.html#a8a99e22b1111c803e31b4afd5fcdea60":[2,0,22,179], "classERF.html#a8b93b715895b00e86e7db653d2a7284a":[2,0,22,21], diff --git a/search/all_16.js b/search/all_16.js index 912058968..100a65d4d 100644 --- a/search/all_16.js +++ b/search/all_16.js @@ -52,9 +52,9 @@ var searchData= ['writebndryplanes_2401',['WriteBndryPlanes',['../classWriteBndryPlanes.html',1,'WriteBndryPlanes'],['../classWriteBndryPlanes.html#a460f7f20cb59e7f2f8546ebf423585d5',1,'WriteBndryPlanes::WriteBndryPlanes()']]], ['writebuildinfo_2402',['writeBuildInfo',['../classERF.html#ae6afed5b3a72ca80ccf0d791b08516aa',1,'ERF']]], ['writecheckpointfile_2403',['WriteCheckpointFile',['../classERF.html#ad101fd46096db2d6b21544bfede6551f',1,'ERF']]], - ['writegenericplotfileheaderwithterrain_2404',['WriteGenericPlotfileHeaderWithTerrain',['../classERF.html#a16e49fd65c68e2afc2140bd9e97bcbe9',1,'ERF']]], + ['writegenericplotfileheaderwithterrain_2404',['WriteGenericPlotfileHeaderWithTerrain',['../classERF.html#a3a918bd26ed0c1dc2efa75c2586ff664',1,'ERF']]], ['writejobinfo_2405',['writeJobInfo',['../classERF.html#aa2d8099655a8779836e63e3e98ea4372',1,'ERF']]], - ['writemultilevelplotfilewithterrain_2406',['WriteMultiLevelPlotfileWithTerrain',['../classERF.html#a898410553492b2add00a72374dcec6ba',1,'ERF']]], + ['writemultilevelplotfilewithterrain_2406',['WriteMultiLevelPlotfileWithTerrain',['../classERF.html#a61510e69bdaee84a01cf33943b043a5c',1,'ERF']]], ['writenow_2407',['writeNow',['../classERF.html#af2e4de4eaa0f93149c1aefd58dc7068a',1,'ERF']]], ['writeplotfile_2408',['writePlotfile',['../classRadiation.html#a4970f2e4bd068de34295053f77db0e4c',1,'Radiation']]], ['writeplotfile_2409',['WritePlotFile',['../classERF.html#a0b0b4140e117163895e5e2c89a68d12a',1,'ERF']]], diff --git a/search/functions_15.js b/search/functions_15.js index 27ada0585..79efe12f4 100644 --- a/search/functions_15.js +++ b/search/functions_15.js @@ -23,9 +23,9 @@ var searchData= ['writebndryplanes_3743',['WriteBndryPlanes',['../classWriteBndryPlanes.html#a460f7f20cb59e7f2f8546ebf423585d5',1,'WriteBndryPlanes']]], ['writebuildinfo_3744',['writeBuildInfo',['../classERF.html#ae6afed5b3a72ca80ccf0d791b08516aa',1,'ERF']]], ['writecheckpointfile_3745',['WriteCheckpointFile',['../classERF.html#ad101fd46096db2d6b21544bfede6551f',1,'ERF']]], - ['writegenericplotfileheaderwithterrain_3746',['WriteGenericPlotfileHeaderWithTerrain',['../classERF.html#a16e49fd65c68e2afc2140bd9e97bcbe9',1,'ERF']]], + ['writegenericplotfileheaderwithterrain_3746',['WriteGenericPlotfileHeaderWithTerrain',['../classERF.html#a3a918bd26ed0c1dc2efa75c2586ff664',1,'ERF']]], ['writejobinfo_3747',['writeJobInfo',['../classERF.html#aa2d8099655a8779836e63e3e98ea4372',1,'ERF']]], - ['writemultilevelplotfilewithterrain_3748',['WriteMultiLevelPlotfileWithTerrain',['../classERF.html#a898410553492b2add00a72374dcec6ba',1,'ERF']]], + ['writemultilevelplotfilewithterrain_3748',['WriteMultiLevelPlotfileWithTerrain',['../classERF.html#a61510e69bdaee84a01cf33943b043a5c',1,'ERF']]], ['writenow_3749',['writeNow',['../classERF.html#af2e4de4eaa0f93149c1aefd58dc7068a',1,'ERF']]], ['writeplotfile_3750',['writePlotfile',['../classRadiation.html#a4970f2e4bd068de34295053f77db0e4c',1,'Radiation']]], ['writeplotfile_3751',['WritePlotFile',['../classERF.html#a0b0b4140e117163895e5e2c89a68d12a',1,'ERF']]],