Skip to content

Commit

Permalink
This ran.
Browse files Browse the repository at this point in the history
  • Loading branch information
AMLattanzi committed Nov 23, 2024
1 parent 3890775 commit d6bbb9a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 19 deletions.
3 changes: 3 additions & 0 deletions Docs/sphinx_doc/Inputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,9 @@ List of Parameters
| **erf.input_sounding_file** | Name(s) of the | String(s) | input_sounding_file |
| | input sounding file(s) | | |
+-------------------------------------+------------------------+-------------------+---------------------+
| **erf.forest_file** | Name(s) of the | String | None |
| | canopy forest file | | |
+-------------------------------------+------------------------+-------------------+---------------------+
| **erf.input_sounding_time** | Time(s) of the | Real(s) | false |
| | input sounding file(s) | | |
+-------------------------------------+------------------------+-------------------+---------------------+
Expand Down
2 changes: 1 addition & 1 deletion Source/ERF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1590,7 +1590,7 @@ ERF::ReadParameters ()
std::string forestfile;
auto do_forest = pp.query("forest_file", forestfile);
if (do_forest) {
for (int lev = 0; lev < max_level; ++lev) {
for (int lev = 0; lev <= max_level; ++lev) {
m_forest[lev] = std::make_unique<ForestDrag>(forestfile);
}
}
Expand Down
10 changes: 3 additions & 7 deletions Source/SourceTerms/ERF_ForestDrag.H
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
#define ERF_FORESTDRAG_H_

#include <memory>
#include <iostream>
#include <fstream>
#include <string>
#include <AMReX_MultiFab.H>

/*
Expand All @@ -16,13 +13,13 @@ class ForestDrag
{
public:

ForestDrag (std::string forestfile);
explicit ForestDrag (std::string forestfile);

~ForestDrag () = default;

void
define_drag_field (amrex::BoxArray ba,
amrex::DistributionMapping dm,
define_drag_field (const amrex::BoxArray& ba,
const amrex::DistributionMapping& dm,
amrex::Geometry& geom,
amrex::MultiFab* z_phys_nd);

Expand All @@ -39,6 +36,5 @@ private:
amrex::Vector<amrex::Real> m_lai_forest;
amrex::Vector<amrex::Real> m_laimax_forest;
std::unique_ptr<amrex::MultiFab> m_forest_drag;
std::unique_ptr<int> iptr;
};
#endif
16 changes: 5 additions & 11 deletions Source/SourceTerms/ERF_ForestDrag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ ForestDrag::ForestDrag (std::string forestfile)
}

void
ForestDrag::define_drag_field (BoxArray ba,
DistributionMapping dm,
ForestDrag::define_drag_field (const BoxArray& ba,
const DistributionMapping& dm,
Geometry& geom,
MultiFab* z_phys_nd)
{
Expand All @@ -40,15 +40,8 @@ ForestDrag::define_drag_field (BoxArray ba,

// Allocate the forest drag MF
// NOTE: 1 ghost cell for averaging to faces
//m_forest_drag.reset();
//m_forest_drag = std::make_unique<MultiFab>(ba,dm,1,1);
Print() << "CHECK: " << ba << ' '
<< dm << "\n";
MultiFab Test;
Test.define(ba,dm,1,1);
iptr = std::make_unique<int>(2);
exit(0);

m_forest_drag.reset();
m_forest_drag = std::make_unique<MultiFab>(ba,dm,1,1);
m_forest_drag->setVal(0.);

// Loop over forest types and pre-compute factors
Expand Down Expand Up @@ -137,3 +130,4 @@ ForestDrag::define_drag_field (BoxArray ba,
m_forest_drag->FillBoundary(geom.periodicity());

} // init_drag_field

0 comments on commit d6bbb9a

Please sign in to comment.