Skip to content

Commit a4724ff

Browse files
committed
STY/Bugs: Get chapman integrals working on dipole, clean up code a bit.
1 parent 218c7a5 commit a4724ff

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/calc_neutral_derived.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -583,8 +583,8 @@ void Neutrals::calc_chapman(Grid grid) {
583583
species[iSpecies].density_scgc.slice(iAlt) %
584584
species[iSpecies].scale_height_scgc.slice(iAlt);
585585

586-
species[iSpecies].rho_alt_int_scgc.slice(iAlt) = integral3d.slice(
587-
iAlt) * species[iSpecies].mass;
586+
species[iSpecies].rho_alt_int_scgc.slice(iAlt) = integral3d.slice(iAlt)
587+
* species[iSpecies].mass;
588588

589589
for (iAlt = nAlts - 2; iAlt >= 0; iAlt--) {
590590
// dr is used here instead of dalt, since we only want the radial integration, while
@@ -619,14 +619,16 @@ void Neutrals::calc_chapman(Grid grid) {
619619
integral1d = integral3d.tube(iLon, iLat);
620620
log_int1d = log_int3d.tube(iLon, iLat);
621621
xp1d = xp3d.tube(iLon, iLat);
622-
y1d = y3d.tube(iLon, iLat);
622+
// y1d = y3d.tube(iLon, iLat);
623623
erfcy1d = erfcy3d.tube(iLon, iLat);
624624
radius1d = grid.radius_scgc.tube(iLon, iLat);
625-
H1d = species[iSpecies].scale_height_scgc.tube(iLon, iLat);
625+
// H1d = species[iSpecies].scale_height_scgc.tube(iLon, iLat);
626626

627627
for (iAlt = nGCs; iAlt < nAlts; iAlt++) {
628+
if (!grid.UseThisCell(iLon, iLat, iAlt))
629+
continue; // masks off cells below surface of earth, not the best implementation.
628630
// This is on the dayside:
629-
if (sza1d(iAlt) < cPI / 2 || sza1d(iAlt) > 3 * cPI / 2) {
631+
else if (sza1d(iAlt) < cPI / 2 || sza1d(iAlt) > 3 * cPI / 2) {
630632
species[iSpecies].chapman_scgc(iLon, iLat, iAlt) =
631633
integral1d(iAlt) * sqrt(0.5 * cPI * xp1d(iAlt)) * erfcy1d(iAlt);
632634
} else {

0 commit comments

Comments
 (0)