Skip to content

Commit

Permalink
BUG: account for cubesphere in dt calc
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronjridley committed Nov 17, 2023
1 parent 6f8182b commit a0e5dbf
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions src/calc_neutral_derived.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,32 +338,36 @@ precision_t Neutrals::calc_dt(Grid grid) {
static int iFunction = -1;
report.enter(function, iFunction);

int iDir;
if (input.get_is_cubesphere())
dt = calc_dt_cubesphere(grid);
else {
int iDir;

arma_vec dta(4);
arma_vec dta(4);

// simply some things, and just take the bulk value for now:
arma_cube dtx = grid.dlon_center_dist_scgc / cMax_vcgc[0];
dta(0) = dtx.min();
// simply some things, and just take the bulk value for now:
arma_cube dtx = grid.dlon_center_dist_scgc / cMax_vcgc[0];
dta(0) = dtx.min();

arma_cube dty = grid.dlat_center_dist_scgc / cMax_vcgc[1];
dta(1) = dty.min();
arma_cube dty = grid.dlat_center_dist_scgc / cMax_vcgc[1];
dta(1) = dty.min();

if (input.get_nAltsGeo() > 1) {
arma_cube dtz = grid.dalt_center_scgc / cMax_vcgc[2];
dta(2) = dtz.min();
} else
dta(2) = 1e32;
if (input.get_nAltsGeo() > 1) {
arma_cube dtz = grid.dalt_center_scgc / cMax_vcgc[2];
dta(2) = dtz.min();
} else
dta(2) = 1e32;

dta(3) = 10.0;
dta(3) = 10.0;

dt = dta.min();
dt = dta.min();

if (report.test_verbose(3))
std::cout << "dt for neutrals : " << dt << "\n";
if (report.test_verbose(3))
std::cout << "dt (sphere) for neutrals : " << dt << "\n";

if (report.test_verbose(4))
std::cout << " derived from dt(x, y, z, extra) : " << dta << "\n";
if (report.test_verbose(4))
std::cout << " derived from dt(x, y, z, extra) : " << dta << "\n";
}

report.exit(function);
return dt;
Expand Down Expand Up @@ -416,7 +420,7 @@ precision_t Neutrals::calc_dt_cubesphere(Grid grid) {
dt = dta.min();

if (report.test_verbose(3))
std::cout << "dt for neutrals : " << dt << "\n";
std::cout << "dt (cubesphere) for neutrals : " << dt << "\n";

if (report.test_verbose(4))
std::cout << " derived from dt(x, y, z, extra) : " << dta << "\n";
Expand Down

0 comments on commit a0e5dbf

Please sign in to comment.