REMORA
Energy Research and Forecasting: An Atmospheric Modeling Code
main.cpp File Reference
#include <iostream>
#include <AMReX.H>
#include <AMReX_BLProfiler.H>
#include <AMReX_ParallelDescriptor.H>
#include <REMORA.H>
Include dependency graph for main.cpp:

Functions

void add_par ()
 
int main (int argc, char *argv[])
 

Variables

std::string inputs_name = ""
 

Function Documentation

◆ add_par()

void add_par ( )
17  {
18  ParmParse pp("amr");
19 
20  // Set the refine_grid_layout flags to (NGROW-1,NGROW-1,0) by default
21  pp.add("refine_grid_layout_x",1);
22  pp.add("refine_grid_layout_y",1);
23  pp.add("refine_grid_layout_z",0);
24 
25  // n_proper is the minimum number of coarse cells between coarse-fine boundaries
26  // between levels (ell and ell+1) and levels (ell-1 and ell). We want this to be
27  // greater than or equal to the stencil width (a function of spatial order) divided by
28  // ref_ratio (which can be 2,3 or 4). This ensures that fillpatch at level (ell)
29  // does not need to reach beyond level (ell-1). Here to be conservative we set this to 2
30  // (rather than the amrex default of 1).
31  pp.add("n_proper",2);
32 
33  int max_grid_size = 2048;
34  pp.queryAdd("max_grid_size",max_grid_size);
35 
36  // This will set the default value of blocking_factor to be 1, but will allow
37  // the user to override it in the inputs file or on command line
38  int blocking_factor = 1;
39  pp.queryAdd("blocking_factor",blocking_factor);
40 
41  pp.add("n_error_buf",0);
42 }

Referenced by main().

Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char *  argv[] 
)
45 {
46  // Check to see if the command line contains --describe
47  if (argc >= 2) {
48  for (auto i = 1; i < argc; i++) {
49  if (std::string(argv[i]) == "--describe") {
50  REMORA::writeBuildInfo(std::cout);
51  return 0;
52  }
53  }
54  }
55  amrex::Initialize(argc,argv,true,MPI_COMM_WORLD,add_par);
56 
57  // Save the inputs file name for later.
58  if (!strchr(argv[1], '=')) {
59  inputs_name = argv[1];
60  }
61 
62  // timer for profiling
63  BL_PROFILE_VAR("main()", pmain);
64 
65  // wallclock time
66  const Real strt_total = amrex::second();
67 
68  {
69  // constructor - reads in parameters from inputs file
70  // - sizes multilevel arrays and data structures
71  REMORA remora;
72 
73  // initialize AMR data
74  remora.InitData();
75 
76  // advance solution to final time
77  remora.Evolve();
78 
79  // wallclock time
80  Real end_total = amrex::second() - strt_total;
81 
82  // print wallclock time
83  ParallelDescriptor::ReduceRealMax(end_total ,ParallelDescriptor::IOProcessorNumber());
84  if (remora.Verbose()) {
85  amrex::Print() << "\nTotal Time: " << end_total << '\n';
86  }
87  }
88 
89  // destroy timer for profiling
90  BL_PROFILE_VAR_STOP(pmain);
91 
92  amrex::Finalize();
93 }
Definition: REMORA.H:69
void Evolve()
Definition: REMORA.cpp:142
static void writeBuildInfo(std::ostream &os)
Definition: writeJobInfo.cpp:135
void InitData()
Definition: REMORA.cpp:260
void add_par()
Definition: main.cpp:17
std::string inputs_name
Definition: main.cpp:9
Here is the call graph for this function:

Variable Documentation

◆ inputs_name

std::string inputs_name = ""

Referenced by main(), and REMORA::writeJobInfo().