Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ target_link_libraries(numeric_diff partmclib)
add_executable(numeric_average src/numeric_average.F90)

######################################################################
# scenarios/1_urban_plume/urban_plum_process
# scenarios/1_urban_plume/urban_plume_process

add_executable(urban_plume_process
scenarios/1_urban_plume/urban_plume_process.F90)
Expand Down
12 changes: 12 additions & 0 deletions scenarios/7_drydep/1_run_sect.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

# exit on error
set -e
# turn on command echoing
set -v

mkdir -p out

../../build/partmc drydep_sect.spec

# Now run ./2_process_sect.sh to process the data
2 changes: 1 addition & 1 deletion scenarios/7_drydep/2_process_modal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ set -v

# The data should have already been generated by ./1_run_modal.sh

../../build/drydep_modal_process out/modal_dpg_00001000000000000000_sig_2_5_emerson_grass
../../build/drydep_modal_process out/drydep_modal
12 changes: 12 additions & 0 deletions scenarios/7_drydep/2_process_sect.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

# exit on error
set -e
# turn on command echoing
set -v

# The data should have already been generated by ./1_run_sect.sh

../../build/extract_sectional_aero_time out/drydep_sect
../../build/extract_sectional_aero_size --num out/drydep_sect
../../build/extract_sectional_aero_size --mass out/drydep_sect
56 changes: 56 additions & 0 deletions scenarios/7_drydep/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Dry deposition scenario
=======================

Demonstrates dry deposition of aerosol particles using both the
modal and the sectional (binned) representations. Both are run
with identical inputs so that their results can be compared directly.

Running
-------

Modal:

./1_run_modal.sh
./2_process_modal.sh

Sectional:

./1_run_sect.sh
./2_process_sect.sh

Each simulates 8 hours with hourly output. The modal case is
post-processed by drydep_modal_process, which writes total number and
mass concentration time series to out/drydep_modal_process.nc. The
sectional case uses the standard extract_sectional_* tools.

Configuration
-------------

Both runs share:

aero_init_dist.dat single log-normal mode, 3.2e9 m^-3, geometric
mean diameter 100 nm, sigma (geom_std_dev)= 1.8
aero_data.dat single species (SO4)
drydep_params.dat deposition parameters (see below)
temp.dat, pres.dat, height.dat, gas_*.dat, aero_back*.dat,
aero_emit*.dat meteorology, emissions and background

Emissions and background rates are zero. Condensation and all
other microphysical processes are disabled, so dry deposition is the
only active process. The sectional case runs with the zero
coagulation kernel. It also sets do_aero_dilution to no; the modal
representation has no dilution treatment.
Comment on lines +40 to +42

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.

Just a note to edit this if changes are made regarding coagulation or dilution.


Deposition parameters
---------------------

drydep_params.dat holds the coefficients of the size-resolved
deposition scheme (Zhang et al. 2001; Emerson et al. 2020). The
dry deposition velocity equation is

V_d = V_s + 1 / (R_a + R_s)

following Slinn (1982), as used by both parameterizations. The
land-use-dependent quantities (z_rough, A, alpha, gamma) and the
scheme coefficients (C_B, C_IN, C_IM, nu, beta) are all read from
this file.
4 changes: 2 additions & 2 deletions scenarios/7_drydep/aero_init_dist.dat
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ mass_frac aero_init_comp.dat # composition proportions of species
diam_type geometric # type of diameter specified
mode_type log_normal # type of distribution
num_conc 3.2e9 # particle number concentration (#/m^3)
geom_mean_diam 1e-8 # geometric mean diameter (m)
log10_geom_std_dev 0.041 # log_10 of geometric std dev of diameter
geom_mean_diam 1e-7 # geometric mean diameter (m)
log10_geom_std_dev 0.255 # log_10 of geometric std dev of diameter
10 changes: 5 additions & 5 deletions scenarios/7_drydep/drydep_modal.spec
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
run_type modal # modal run
output_prefix out/modal_dpg_10_0_sig_2_5_emerson_broad
output_prefix out/drydep_modal # prefix of output files

t_max 28800 # total simulation time (s)
del_t 60 # timestep (s)
t_output 3600 # output interval (0 disables) (s)
t_progress 0 # progress printing interval (0 disables) (s)

n_bin 1000 # number of bins (for processing purposes)
d_min 4e-8 # minimum diameter (m)
d_max 2.5e-3 # maximum diameter (m)
d_min 1e-10 # minimum diameter (m)
d_max 1e-3 # maximum diameter (m)

do_camp_chem no # whether to use CAMP for chemistry (yes/no)
do_tchem no # whether to use TChem for chemistry (yes/no)

gas_data gas_data.dat # file containing gas data
aerosol_data aero_data.dat # file containing aerosol data
do_fractal no # whether to do fractal treatment (yes/no)
aerosol_init aero_init_run.dat
aerosol_init aero_init_dist.dat # aerosol initial condition file

temp_profile temp.dat # temperature profile file
pressure_profile pres.dat # pressure profile file
Expand All @@ -26,7 +26,7 @@ gas_background gas_back.dat # background gas concentrations file
aero_emissions aero_emit.dat # aerosol emissions file
aero_background aero_back.dat # aerosol background file
loss_function drydep # loss function specification
drydep_params drydep_broad_emerson.dat
drydep_params drydep_params.dat # dry deposition parameters

rel_humidity 0.95 # initial relative humidity (1)
latitude 0 # latitude (degrees, -90 to 90)
Expand Down
45 changes: 45 additions & 0 deletions scenarios/7_drydep/drydep_sect.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
run_type sectional # sectional (binned) run
output_prefix out/drydep_sect # prefix of output files

t_max 28800 # total simulation time (s)
del_t 60 # timestep (s)
t_output 3600 # output interval (0 disables) (s)
t_progress 0 # progress printing interval (0 disables) (s)

n_bin 1000 # number of bins
d_min 1e-10 # minimum diameter (m)
d_max 1e-3 # maximum diameter (m)

do_camp_chem no # whether to use CAMP for chemistry (yes/no)
do_tchem no # whether to use TChem for chemistry (yes/no)

gas_data gas_data.dat # file containing gas data
aerosol_data aero_data.dat # file containing aerosol data
do_fractal no # whether to do fractal treatment (yes/no)
aerosol_init aero_init_dist.dat # aerosol initial condition file

temp_profile temp.dat # temperature profile file
pressure_profile pres.dat # pressure profile file
height_profile height.dat # height profile file
gas_emissions gas_emit.dat # gas emissions file
gas_background gas_back.dat # background gas concentrations file
aero_emissions aero_emit.dat # aerosol emissions file
aero_background aero_back.dat # aerosol background file
loss_function drydep # loss function specification
drydep_params drydep_params.dat # dry deposition parameters

rel_humidity 0.95 # initial relative humidity (1)
latitude 0 # latitude (degrees, -90 to 90)
longitude 0 # longitude (degrees, -180 to 180)
altitude 0 # altitude (m)
start_time 21600 # start time (s since 00:00 UTC)
start_day 200 # start day of year (UTC)

do_aero_dilution no # whether to do aerosol dilution (yes/no)
do_coagulation yes # whether to do coagulation (yes/no)
coag_kernel zero # coagulation kernel (zero = no coagulation)
do_condensation no # whether to do condensation (yes/no)
do_mosaic no # whether to do MOSAIC (yes/no)
do_optical no # whether to compute optical props (yes/no)
do_nucleation no # whether to do nucleation (yes/no)
do_immersion_freezing no # whether to do freezing (yes/no)
21 changes: 18 additions & 3 deletions src/output.F90
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ end subroutine input_n_files

!> Write the current sectional data.
subroutine output_sectional(prefix, bin_grid, aero_data, aero_binned, &
gas_data, gas_state, env_state, index, time, del_t, uuid)
gas_data, gas_state, env_state, scenario, index, time, del_t, uuid)

!> Prefix of filename to write
character(len=*), intent(in) :: prefix
Expand All @@ -678,6 +678,8 @@ subroutine output_sectional(prefix, bin_grid, aero_data, aero_binned, &
type(gas_state_t), intent(in) :: gas_state
!> Environment state.
type(env_state_t), intent(in) :: env_state
!> Scenario data.
type(scenario_t), intent(in) :: scenario
!> Filename index.
integer, intent(in) :: index
!> Current time (s).
Expand Down Expand Up @@ -705,6 +707,10 @@ subroutine output_sectional(prefix, bin_grid, aero_data, aero_binned, &
call aero_binned_output_netcdf(aero_binned, ncid, bin_grid, &
aero_data)

if (scenario%loss_function_type == SCENARIO_LOSS_FUNCTION_DRYDEP) then
call drydep_params_output_netcdf(scenario%drydep, ncid)
end if

call pmc_nc_check(nf90_close(ncid))

end subroutine output_sectional
Expand All @@ -713,7 +719,7 @@ end subroutine output_sectional

!> Input sectional data.
subroutine input_sectional(filename, index, time, del_t, uuid, bin_grid, &
aero_data, aero_binned, gas_data, gas_state, env_state)
aero_data, aero_binned, gas_data, gas_state, env_state, scenario)

!> Filename to read.
character(len=*), intent(in) :: filename
Expand All @@ -737,6 +743,8 @@ subroutine input_sectional(filename, index, time, del_t, uuid, bin_grid, &
type(gas_state_t), optional, intent(inout) :: gas_state
!> Environment state.
type(env_state_t), optional, intent(inout) :: env_state
!> Scenario data.
type(scenario_t), optional, intent(inout) :: scenario

integer :: ncid

Expand Down Expand Up @@ -779,6 +787,10 @@ subroutine input_sectional(filename, index, time, del_t, uuid, bin_grid, &
call env_state_input_netcdf(env_state, ncid)
end if

if (present(scenario)) then
call drydep_params_input_netcdf(scenario%drydep, ncid)
end if

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.

This is called unconditionally but should be guarded. The drydep_params_output_netcdf is only called when the loss process is dry deposition

    if (scenario%loss_function_type == SCENARIO_LOSS_FUNCTION_DRYDEP) then
       call drydep_params_output_netcdf(scenario%drydep, ncid)
    end if

but drydep_params_input_netcdf would always expect it provided scenario is passed to input_sectional.


call pmc_nc_close(ncid)

end subroutine input_sectional
Expand Down Expand Up @@ -834,7 +846,10 @@ subroutine output_modal(prefix, aero_binned, aero_dist, aero_data, &
call gas_state_output_netcdf(gas_state, ncid, gas_data)
call aero_data_output_netcdf(aero_data, ncid)
call bin_grid_output_netcdf(bin_grid, ncid, "diam", unit="m")
call drydep_params_output_netcdf(scenario%drydep, ncid)

if (scenario%loss_function_type == SCENARIO_LOSS_FUNCTION_DRYDEP) then
call drydep_params_output_netcdf(scenario%drydep, ncid)
end if

call pmc_nc_check(nf90_close(ncid))

Expand Down
6 changes: 6 additions & 0 deletions src/partmc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,11 @@ subroutine partmc_sect(file)
!! format should be \subpage input_format_aero_dist
!! - \subpage input_format_scenario
!! - \subpage input_format_env_state
!! - \b do_aero_dilution (logical): whether to apply aerosol
!! dilution. If \c no, both the background-exchange dilution and
!! the mixing-layer-growth correction are skipped, which allows
!! other processes (for example dry deposition) to be studied in
!! isolation.
!! - \b do_coagulation (logical): whether to perform particle
!! coagulation. If \c do_coagulation is \c yes, then the
!! following parameters must also be provided:
Expand Down Expand Up @@ -771,6 +776,7 @@ subroutine partmc_sect(file)
!! start_time 0 # start time (s since 00:00 UTC)
!! start_day 1 # start day of year (UTC)
!!
!! do_aero_dilution yes # whether to do dilution (yes/no)
!! do_coagulation yes # whether to do coagulation (yes/no)
!! kernel brown # coagulation kernel
!! </pre>
Expand Down
4 changes: 2 additions & 2 deletions src/run_exact.F90
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ subroutine run_exact(bin_grid, scenario, env_state, aero_data, &
run_exact_opt%coag_kernel_type, aero_dist_init, scenario, &
env_state, time, aero_binned)
call output_sectional(run_exact_opt%prefix, bin_grid, aero_data, &
aero_binned, gas_data, gas_state, env_state, i_time + 1, &
time, run_exact_opt%t_output, run_exact_opt%uuid)
aero_binned, gas_data, gas_state, env_state, scenario, &
i_time + 1, time, run_exact_opt%t_output, run_exact_opt%uuid)
end do

end subroutine run_exact
Expand Down
Loading