-
Notifications
You must be signed in to change notification settings - Fork 20
add support for sectional dry deposition #230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
zdaq12
wants to merge
6
commits into
compdyn:master
Choose a base branch
from
zdaq12:sect_drydep
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3ed79e3
add dry deposition support to the sectional model
zdaq12 584d763
Remove duplicate use pmc_scenario
zdaq12 ef0f528
update initial distribution for 7_drydep scenario
zdaq12 ff22072
Fix typo in dry deposition README
zdaq12 86892a0
Update src/run_sect.F90
zdaq12 75a7cae
Update src/run_sect.F90
zdaq12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | ||
|
|
||
| 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. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
@@ -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). | ||
|
|
@@ -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 | ||
|
|
@@ -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 | ||
|
|
@@ -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 | ||
|
|
||
|
|
@@ -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 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is called unconditionally but should be guarded. The but |
||
|
|
||
| call pmc_nc_close(ncid) | ||
|
|
||
| end subroutine input_sectional | ||
|
|
@@ -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)) | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.