51 const int narg = amrex::command_argument_count();
61 while (farg <= narg) {
62 const std::string fname = amrex::get_command_argument(farg);
63 if (fname ==
"-h" || fname ==
"--help") {
65 }
else if (fname ==
"-v") {
74 amrex::Print() <<
"No plotfilename specified " << std::endl;
78 if (iFile.back() ==
'/') {
82 amrex::Print() <<
"Reading " << iFile << std::endl;
86 PlotFileData pf_data(iFile);
88 int finest_level = pf_data.finestLevel();
90 int ncomp = pf_data.nComp();
93 amrex::Print() <<
"Finished defining pf with finest level " << finest_level <<
" and ncomp " << ncomp << std::endl;
96 const Vector<std::string>& varnames = pf_data.varNames();
99 double time = pf_data.time();
101 int max_grid_size = 64;
103 Vector<MultiFab> mfvec(finest_level+1);
104 Vector<Geometry> geom(finest_level+1);
106 double start_bdy_time = time;
113 Vector<Real> zlevels_stag;
115 for (
int lev = 0; lev <= finest_level; lev++)
117 mfvec[lev].define(pf_data.boxArray(lev), pf_data.DistributionMap(lev), ncomp, 0);
119 for (
int icomp = 0; icomp < ncomp; icomp++) {
120 MultiFab tmp_data = pf_data.get(lev, varnames[icomp]);
121 MultiFab::Copy(mfvec[lev],tmp_data,0,icomp,1,0);
125 BoxArray ba(pf_data.boxArray(lev));
126 Box bounding_region = (lev == 0) ? pf_data.probDomain(lev) : ba.minimalBox();
131 writeNCPlotFile(lev, which, iFile, GetVecOfConstPtrs(mfvec), varnames, istep,
132 pf_data.probLo(), pf_data.probHi(), pf_data.cellSize(lev), bounding_region,
133 time, start_bdy_time, solverChoice, zlevels_stag);
void writeNCPlotFile(int lev, int which_subdomain, const std::string &dir, const Vector< const MultiFab * > &plotMF, const Vector< std::string > &plot_var_names, const Vector< int > &, Array< Real, AMREX_SPACEDIM > prob_lo, Array< Real, AMREX_SPACEDIM > prob_hi, Array< Real, AMREX_SPACEDIM > dx_in, const Box &subdomain, const double &time, const double &start_bdy_time, const SolverChoice &solverChoice, const Vector< Real > &zlevels_stag)
Definition: ERF_NCPlotFile.cpp:20
static void PrintUsage()
Definition: ERF_PlotfileToNetCDF.cpp:34
Definition: ERF_DataStruct.H:241