@@ -583,8 +583,8 @@ void Neutrals::calc_chapman(Grid grid) {
583
583
species[iSpecies].density_scgc .slice (iAlt) %
584
584
species[iSpecies].scale_height_scgc .slice (iAlt);
585
585
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 ;
588
588
589
589
for (iAlt = nAlts - 2 ; iAlt >= 0 ; iAlt--) {
590
590
// 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) {
619
619
integral1d = integral3d.tube (iLon, iLat);
620
620
log_int1d = log_int3d.tube (iLon, iLat);
621
621
xp1d = xp3d.tube (iLon, iLat);
622
- y1d = y3d.tube (iLon, iLat);
622
+ // y1d = y3d.tube(iLon, iLat);
623
623
erfcy1d = erfcy3d.tube (iLon, iLat);
624
624
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);
626
626
627
627
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.
628
630
// 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 ) {
630
632
species[iSpecies].chapman_scgc (iLon, iLat, iAlt) =
631
633
integral1d (iAlt) * sqrt (0.5 * cPI * xp1d (iAlt)) * erfcy1d (iAlt);
632
634
} else {
0 commit comments