Skip to content

add support for sectional dry deposition - #230

Open
zdaq12 wants to merge 19 commits into
compdyn:masterfrom
zdaq12:sect_drydep
Open

zdaq12 wants to merge 19 commits into
compdyn:masterfrom
zdaq12:sect_drydep

Conversation

@zdaq12

@zdaq12 zdaq12 commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds dry deposition support to the sectional representation. Also corrects the
deposition velocity formula shared by all representations to match
Zhang et al. (2001) and Emerson et al. (2020) as published.

Sectional dry deposition

scenario_binned_loss() applies per-bin dry deposition loss each timestep, using
the same scenario_loss_rate() as the particle-resolved model. The sectional model
accepts loss_function none or drydep and stops with an error for
any other loss function.

Each bin decays as m(t+dt) = m(t) * exp(-rate*dt) — the exact solution
of dm/dt = -rate*m. Mass (vol_conc) is
prognostic and num_conc is diagnosed, matching the convention already used by
sectional coagulation.

output_sectional()/input_sectional() gain a scenario argument so dry
deposition parameters are written to and read from NetCDF output, mirroring
output_modal()/input_modal().

Deposition velocity formula change

before: V_d = V_s + 1/(R_a + R_s + R_a*R_s*V_s)
after:  V_d = V_s + 1/(R_a + R_s)

The R_a*R_s*V_s term comes from the two-layer flux balance
(Seinfeld and Pandis, 1998); however, it is not a physically representative term, but
rather a direct artifact of the mathematical manipulation of the multilayer resistance analogy
system of equations with settling acting through all layers. Strictly speaking, neither
Zhang et al. (2001) nor Emerson et al. (2020) use this term. Both follow Slinn (1982)'s
derivation where settling is treated purely in parallel. Since drydep_params_t is explicitly
parameterized to switch between Z01-and E20 coefficient sets, retaining the cross
term would implement neither parameterization as published.

Applied in all three places: scenario_loss_rate_drydep
(particle/sectional), scenario_integrated_loss_rate_drydep (modal,
analytic), and dep_vel_integrand (modal, QUADPACK).

New spec-file option

do_aero_dilution (sectional runs, optional, loss_function drydep only): when
set to no, skips both background-exchange dilution and mixing-layer-growth
dilution, so dry deposition can be studied with a time-varying mixing height. It
defaults to yes, so existing spec files are unaffected. The modal
model has no dilution treatment, so this is what makes the
modal and sectional results directly comparable.

Other sectional changes

  • The coagulation kernel is only computed when do_coagulation is yes, so
    do_coagulation no now works.
  • do_optical is only read when do_mosaic is yes, matching run_part.
  • scenario_binned_loss() asserts a single aerosol species which run_sect()
    currently requires.

Tests

  • test_loss_16 — sectional dry deposition regression test
  • test_loss_17 — checks sectional against particle-resolved

Reference files for test_loss_13, test_loss_14 (QUADPACK), and
test_loss_16 are regenerated due to dry deposition velocity formula update.

Example scenario

scenarios/7_drydep now demonstrates both modal and sectional representations. The
sectional case is added as drydep_sect.spec with 1_run_sect.sh and
2_process_sect.sh, mirroring the existing modal scripts. It uses the
standard extract_sectional_* tools.

The initial distribution was changed from a narrow 10 nm mode (σg ≈ 1.1) to a
larger, broader 100 nm mode (σg ≈ 1.8). scenarios/7_drydep/out/ is
now in .gitignore, and the tot_mass_conc unit label in
drydep_modal_process is corrected to kg m⁻³.

@codecov

codecov Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.92771% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.49%. Comparing base (7984020) to head (401c5a4).

Files with missing lines Patch % Lines
src/run_sect.F90 76.19% 10 Missing ⚠️
src/scenario.F90 90.62% 3 Missing ⚠️
src/output.F90 75.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #230   +/-   ##
=======================================
  Coverage   78.49%   78.49%           
=======================================
  Files          56       56           
  Lines        9755     9812   +57     
=======================================
+ Hits         7657     7702   +45     
- Misses       2098     2110   +12     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zdaq12
zdaq12 marked this pull request as ready for review September 9, 2026 16:46
@jcurtis2
jcurtis2 self-requested a review September 9, 2026 20:40

@jcurtis2 jcurtis2 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks straightforward to get this merged. Here are my comments:

  • As I can't offer suggestions on files you haven't touched: quickly just add the output directory scenarios/7_drydep/out to the .gitignore. Looks like we've gotten lazy about this for new scenarios but lets at least fix this one here.
  • You've added this do_aero_dilution to the sectional spec file to disable dilution because the modal lacks dilution entirely so that you can compare the two fairly. In general, this is likely unnecessary as we typically disable dilution by having our input files set in a particular way that causes this process to be zero. Dilution depends on (1) background mixing rate and (2) mixing height changes So for (1) we've controlled it by having rate = 0 in aero_back.dat so that there is no mixing, but we've keep mixing from changes in box height in height.dat. Mixing height does impact the dry deposition rates and the results will change if we change height.dat to lose our boundary layer evolution. I don't know if we consider that important for this scenario at this time. So this feels like a workaround for a deficiency in modal model by introducing something permanent in the sectional model. But this all isn't 100% without impact, its just whether or not that impact matters.
  • Possibly worth a sentence in the PR description that you change the particle size distribution (larger size, broader distribution) where you discuss the example scenario.
  • Not directly related to your changes but since you are making edits in that scenario directory and comparing the modal to sectional, you have the units of tot_mass_conc in the modal processing code to be micrograms per cubic meter.

Comment thread src/run_sect.F90 Outdated
Comment thread src/scenario.F90 Outdated
Comment thread src/run_sect.F90 Outdated
Comment thread src/run_sect.F90 Outdated
Comment thread src/run_sect.F90 Outdated
Comment thread src/scenario.F90 Outdated
Comment thread src/output.F90
Comment thread scenarios/7_drydep/README Outdated
Comment thread test/loss/run_drydep_sect_dil.spec Outdated
Comment thread test/loss/test_loss_17.sh
@zdaq12

zdaq12 commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author

Mostly looks straightforward to get this merged. Here are my comments:

  • As I can't offer suggestions on files you haven't touched: quickly just add the output directory scenarios/7_drydep/out to the .gitignore. Looks like we've gotten lazy about this for new scenarios but lets at least fix this one here.
  • You've added this do_aero_dilution to the sectional spec file to disable dilution because the modal lacks dilution entirely so that you can compare the two fairly. In general, this is likely unnecessary as we typically disable dilution by having our input files set in a particular way that causes this process to be zero. Dilution depends on (1) background mixing rate and (2) mixing height changes So for (1) we've controlled it by having rate = 0 in aero_back.dat so that there is no mixing, but we've keep mixing from changes in box height in height.dat. Mixing height does impact the dry deposition rates and the results will change if we change height.dat to lose our boundary layer evolution. I don't know if we consider that important for this scenario at this time. So this feels like a workaround for a deficiency in modal model by introducing something permanent in the sectional model. But this all isn't 100% without impact, its just whether or not that impact matters.
  • Possibly worth a sentence in the PR description that you change the particle size distribution (larger size, broader distribution) where you discuss the example scenario.
  • Not directly related to your changes but since you are making edits in that scenario directory and comparing the modal to sectional, you have the units of tot_mass_conc in the modal processing code to be micrograms per cubic meter.

Thank you for the review, @jcurtis2 ! All great points, and I believe I have resolved all of your comments. Main points:

  • .gitignore: Added scenarios/7_drydep/out/.
  • do_aero_dilution option: I agree it shouldn't be a permanent part of every sectional run, so I have changed the structure . do_aero_dilution is now an optional line that defaults to yes and is only accepted with loss_function drydep so that dilution will function as normal if the option is omitted.
  • PR description: Edited the description to reflect the changes requested.

@zdaq12
zdaq12 requested a review from jcurtis2 September 27, 2026 22:36

@jcurtis2 jcurtis2 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks in order now except for these minor things. Fix them up and we will get this merged.

Comment thread src/scenario.F90 Outdated
Comment thread src/scenario.F90 Outdated
Comment thread src/run_sect.F90
zdaq12 and others added 3 commits October 10, 2026 12:44
Co-authored-by: Jeffrey Curtis <jcurtis2@illinois.edu>
Co-authored-by: Jeffrey Curtis <jcurtis2@illinois.edu>
@zdaq12
zdaq12 requested a review from jcurtis2 October 10, 2026 17:29

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants