-
Notifications
You must be signed in to change notification settings - Fork 18
Add minimal modal run to model dry deposition #211
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
34
commits into
compdyn:master
Choose a base branch
from
zdaq12:final_modal
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
34 commits
Select commit
Hold shift + click to select a range
0f786d4
adding scaffolding for modal run
zdaq12 9e60333
add modal run to driver
zdaq12 3d70db2
add run_modal.F90 to CMakeLists
zdaq12 8ac4cd2
add input and output routines for modal run
zdaq12 6526f22
add input and output routines for modal parameters
zdaq12 f3dd453
fix use statements and typos
zdaq12 2872bdc
fix typos
zdaq12 fbe3daf
add subroutines for computing integrated deposition velocities for th…
zdaq12 b27627f
add support for QUADPACK; comment out dry dep scenario for now
zdaq12 e530f6f
remove debugging code for modal run
zdaq12 562c066
clean up implementation of numerical integration with QUADPACK
zdaq12 374d571
formatting
zdaq12 537b2c3
remove unused flag for emissions/dilution
zdaq12 6da5eeb
fix conditional for inputting dry deposition parameterization
zdaq12 bdc2de6
allow for reading drydep_params from text file otherwise fall back on…
zdaq12 ca4142b
remove debugging and commented code
zdaq12 a855f69
update MPI routines to handle drydep parameters
zdaq12 093b334
update processing script for modal runs and add exectuable
zdaq12 cc7ff7e
update aero_dist netcdf input and output for modal runs to operate wi…
zdaq12 6f186e9
remove duplicated line
zdaq12 cd9d90e
update dockerignore
zdaq12 ed72197
dry_dep --> drydep
zdaq12 d2191d5
add input files and scripts for modal drydep runs
zdaq12 02c7e11
update doc for spec_file_read_drydep_params
zdaq12 1c3610c
fix aero_dist naming convention
zdaq12 eeb1c47
drydep_params.dat comments update
zdaq12 e7e23ea
text file clean up
zdaq12 bd9f931
newlines at end of files
zdaq12 d3444d6
minor refactor
zdaq12 3e3b5ec
Merge branch 'master' into final_modal
zdaq12 65c9d9b
Update src/scenario.F90
zdaq12 2f48c41
Update src/scenario.F90
zdaq12 291a957
Update scenarios/7_drydep/aero_data.dat
zdaq12 ba97adb
Update src/scenario.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
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 data | ||
|
|
||
| ../../build/partmc drydep_modal.spec | ||
|
|
||
| # Now run ./2_process_drydep_modal.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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #!/bin/sh | ||
|
|
||
| # exit on error | ||
| set -e | ||
| # turn on command echoing | ||
| set -v | ||
|
|
||
| # The data should have already been generated by ./1_run_dry_dep_modal.sh | ||
|
|
||
| ../../build/drydep_modal_process | ||
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,6 @@ | ||
| # time (s) | ||
| # rate (s^{-1}) | ||
| # aerosol distribution filename | ||
| time 0 | ||
| rate 0 | ||
| dist aero_back_dist.dat |
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 @@ | ||
| # no background distribution |
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,2 @@ | ||
| # dens (kg/m^3) ions in soln (1) molec wght (kg/mole) kappa (1) abifm_m (1) abifm_c (1) | ||
| SO4 1800 0 96d-3 0.65 0. 0. |
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,6 @@ | ||
| # time (s) | ||
| # rate (s^{-1}) | ||
| # aerosol distribution filename | ||
| time 0 | ||
| rate 0 | ||
| dist aero_emit_dist.dat |
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 @@ | ||
| # no emissions |
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,2 @@ | ||
| # mass fractions | ||
| SO4 1 |
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,7 @@ | ||
| mode_name init_mode | ||
| 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 |
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,33 @@ | ||
| run_type modal # modal run | ||
| output_prefix data/modal_dpg_00001000000000000000_sig_2_5_emerson_grass | ||
|
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. Suggest that you change the directory to out (consistent with other scenarios and also specified in the dockerignore) |
||
|
|
||
| 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) | ||
|
|
||
| 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 | ||
| 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) | ||
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,110 @@ | ||
| !> Read NetCDF output files from a modal runn and process them. | ||
|
|
||
| program process | ||
|
|
||
| use pmc_output | ||
| use pmc_stats | ||
| use pmc_aero_dist | ||
| use pmc_scenario | ||
|
|
||
| implicit none | ||
|
|
||
| character(len=PMC_MAX_FILENAME_LEN) :: prefix | ||
| character(len=PMC_MAX_FILENAME_LEN) :: in_filename, out_filename | ||
| type(bin_grid_t) :: bin_grid | ||
| type(aero_dist_t) :: aero_dist | ||
| type(aero_binned_t) :: aero_binned | ||
| type(aero_data_t) :: aero_data | ||
| type(env_state_t) :: env_state | ||
| type(gas_data_t) :: gas_data | ||
| type(gas_state_t) :: gas_state | ||
| type(scenario_t) :: scenario | ||
| integer :: ncid, index, i_mode, i_index, dum, n_index | ||
| real(kind=dp) :: time, del_t, tot_num_conc, density, tot_mass_conc | ||
| character(len=PMC_UUID_LEN) :: uuid | ||
| real(kind=dp), allocatable :: times(:), num_conc(:) | ||
| type(stats_1d_t) :: stats_tot_num_conc, stats_num_conc, stats_velocities_0, & | ||
| stats_velocities_3, stats_tot_mass_conc | ||
| real(kind=dp), allocatable :: velocities_0(:), velocities_3(:) | ||
| character(len=PMC_MAX_FILENAME_LEN), allocatable :: file_list(:) | ||
|
|
||
| call pmc_mpi_init() | ||
|
|
||
| call get_command_argument(1, prefix) | ||
| if (len_trim(prefix) == 0) & | ||
| call die_msg(192837465, "usage: drydep_modal_process <output_prefix>") | ||
|
|
||
| call input_filename_list(prefix, file_list) | ||
| n_index = size(file_list) | ||
|
|
||
| allocate(times(n_index)) | ||
|
|
||
| do i_index = 1,n_index | ||
| call make_filename(in_filename, prefix, ".nc", i_index) | ||
| write(*,*) "Processing " // trim(in_filename) | ||
| call input_modal(in_filename, index, time, del_t, uuid, aero_dist=aero_dist, & | ||
| aero_binned=aero_binned, aero_data=aero_data, env_state=env_state, & | ||
| gas_data=gas_data, gas_state=gas_state, bin_grid=bin_grid, scenario=scenario) | ||
| times(i_index) = time | ||
|
|
||
| density = aero_data%density(1) | ||
|
|
||
| num_conc = aero_binned%num_conc * bin_grid%widths | ||
| tot_num_conc = sum(num_conc) | ||
|
|
||
| tot_mass_conc = sum(aero_binned%vol_conc(:,1) * bin_grid%widths) * aero_data%density(1) | ||
|
|
||
| if (.not. allocated(velocities_0)) allocate(velocities_0(aero_dist_n_mode(aero_dist))) | ||
| if (.not. allocated(velocities_3)) allocate(velocities_3(aero_dist_n_mode(aero_dist))) | ||
|
|
||
| call scenario_modal_drydep_velocities(scenario, aero_dist, 0.0d0, density, & | ||
| env_state, velocities_0) | ||
| call stats_1d_add(stats_velocities_0, velocities_0) | ||
| call scenario_modal_drydep_velocities(scenario, aero_dist, 3.0d0, density, & | ||
| env_state, velocities_3) | ||
| call stats_1d_add(stats_velocities_3, velocities_3) | ||
|
|
||
| call stats_1d_add(stats_num_conc, num_conc) | ||
| call stats_1d_add_entry(stats_tot_num_conc, tot_num_conc, i_index) | ||
|
|
||
| call stats_1d_add_entry(stats_tot_mass_conc, tot_mass_conc, i_index) | ||
|
|
||
| call make_filename(out_filename, prefix, "_process.nc", index) | ||
| write(*,*) "Writing " // trim(out_filename) | ||
| call pmc_nc_open_write(out_filename, ncid) | ||
| call pmc_nc_write_info(ncid, uuid, "7_drydep modal process") | ||
| call env_state_output_netcdf(env_state, ncid) | ||
| call aero_data_output_netcdf(aero_data, ncid) | ||
| call aero_dist_output_netcdf(aero_dist, ncid) | ||
| call aero_binned_output_netcdf(aero_binned, ncid, bin_grid, aero_data) | ||
|
|
||
| call stats_1d_output_netcdf(stats_num_conc, ncid, "num concs. per bin", & | ||
| dim_name="diam", unit="m^{-3}") | ||
| call stats_1d_output_netcdf(stats_velocities_0, ncid, "loss_velocities_0", & | ||
| dim_name="modes", unit="m s^{-1}") | ||
| call stats_1d_output_netcdf(stats_velocities_3, ncid, "loss_velocities_3", & | ||
| dim_name="modes", unit="m s^{-1}") | ||
|
|
||
| call aero_binned_zero(aero_binned) | ||
|
|
||
| call stats_1d_clear(stats_num_conc) | ||
| call stats_1d_clear(stats_velocities_0) | ||
| call stats_1d_clear(stats_velocities_3) | ||
|
|
||
| call pmc_nc_close(ncid) | ||
| end do | ||
|
|
||
| call make_filename(out_filename, prefix, "_process.nc") | ||
| write(*,*) "Writing " // trim(out_filename) | ||
| call pmc_nc_open_write(out_filename, ncid) | ||
| call pmc_nc_write_info(ncid, uuid, "7_drydep modal process") | ||
| call pmc_nc_write_real_1d(ncid, times, "time", dim_name="time", unit="s") | ||
| call stats_1d_output_netcdf(stats_tot_num_conc, ncid, "tot_num_conc", & | ||
| dim_name="time", unit="m^{-3}") | ||
| call stats_1d_output_netcdf(stats_tot_mass_conc, ncid, "tot_mass_conc", & | ||
| dim_name="time", unit="ug m^{-3}") | ||
| call pmc_nc_close(ncid) | ||
|
|
||
| call pmc_mpi_finalize() | ||
|
|
||
| end program process |
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 @@ | ||
| z_ref 10.0 # reference height (m) | ||
| u_mean 2.0 # mean wind speed at the reference height (m) | ||
| z_rough 3.8 # surface roughness length (m) | ||
| A 0.0024 # characteristic radius of collectors (m) | ||
| alpha 5.0 # parameter used in impaction efficiency | ||
| eps_0 6.0 # emprical constant used in surface resistance | ||
| gamma .756 # exponent for Brownian diffusion collection efficiency | ||
| C_B 0.82 # coefficient for Brownian diffusion | ||
| C_IN 92.5 # coefficient for interception | ||
| C_IM 10.4 # coefficient for impaction | ||
| nu 11.8 # exponent for interception collection efficiency | ||
| beta 12.7 # exponent for impaction collection efficiency |
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,79 @@ | ||
| # time (s) | ||
| # rate (s^{-1}) | ||
| # concentrations (ppb) | ||
| time 0 | ||
| rate 1.5e-5 | ||
| NO 0.1E+00 | ||
| NO2 1.0E+00 | ||
| NO3 0.0E+00 | ||
| N2O5 0.0E+00 | ||
| HONO 0.0E+00 | ||
| HNO3 1.0E+00 | ||
| HNO4 0.0E+00 | ||
| O3 5.0E+01 | ||
| O1D 0.0E+00 | ||
| O3P 0.0E+00 | ||
| OH 0.0E+00 | ||
| HO2 0.0E+00 | ||
| H2O2 1.1E+00 | ||
| CO 2.1E+02 | ||
| SO2 0.8E+00 | ||
| H2SO4 0.0E+00 | ||
| NH3 0.5E+00 | ||
| HCl 0.7E+00 | ||
| CH4 2.2E+03 | ||
| C2H6 1.0E+00 | ||
| CH3O2 0.0E+00 | ||
| ETHP 0.0E+00 | ||
| HCHO 1.2E+00 | ||
| CH3OH 1.2E-01 | ||
| CH3OOH 0.5E+00 | ||
| ETHOOH 0.0E+00 | ||
| ALD2 1.0E+00 | ||
| HCOOH 0.0E+00 | ||
| PAR 2.0E+00 | ||
| AONE 1.0E+00 | ||
| MGLY 0.0E+00 | ||
| ETH 0.2E+00 | ||
| OLET 2.3E-02 | ||
| OLEI 3.1E-04 | ||
| TOL 0.1E+00 | ||
| XYL 0.1E+00 | ||
| CRES 0.0E+00 | ||
| TO2 0.0E+00 | ||
| CRO 0.0E+00 | ||
| OPEN 0.0E+00 | ||
| ONIT 0.1E+00 | ||
| PAN 0.8E+00 | ||
| RCOOH 0.2E+00 | ||
| ROOH 2.5E-02 | ||
| C2O3 0.0E+00 | ||
| RO2 0.0E+00 | ||
| ANO2 0.0E+00 | ||
| NAP 0.0E+00 | ||
| ARO1 0.0E+00 | ||
| ARO2 0.0E+00 | ||
| ALK1 0.0E+00 | ||
| OLE1 0.0E+00 | ||
| XO2 0.0E+00 | ||
| XPAR 0.0E+00 | ||
| ISOP 0.5E+00 | ||
| API 0.0E+00 | ||
| LIM 0.0E+00 | ||
| API1 0.0E+00 | ||
| API2 0.0E+00 | ||
| LIM1 0.0E+00 | ||
| LIM2 0.0E+00 | ||
| ISOPRD 0.0E+00 | ||
| ISOPP 0.0E+00 | ||
| ISOPN 0.0E+00 | ||
| ISOPO2 0.0E+00 | ||
| DMS 0.0E+00 | ||
| MSA 0.0E+00 | ||
| DMSO 0.0E+00 | ||
| DMSO2 0.0E+00 | ||
| CH3SO2H 0.0E+00 | ||
| CH3SCH2OO 0.0E+00 | ||
| CH3SO2 0.0E+00 | ||
| CH3SO3 0.0E+00 | ||
| CH3SO2OO 0.0E+00 |
Oops, something went wrong.
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.
Complains that it needs an output prefix.