Go to the documentation of this file.
22 character(len=1000) :: in_filename, out_prefix
29 integer :: n_bin, index, i_repeat, output_type
30 real(kind=
dp) :: d_min, d_max, time, del_t
31 character(len=1000) :: tmp_str
32 logical :: record_removals, dry_volume, record_optical
33 character(len=PMC_UUID_LEN) :: uuid
36 if (command_argument_count() .ne. 6)
then
37 write(6,*)
'Usage: bin_average_comp <d_min> <d_max> <n_bin> ' &
38 //
'<"wet" or "dry"> <input_filename> <output_prefix>'
40 write(6,*)
' d_min: minimum bin diameter (m)'
41 write(6,*)
' d_max: maximum bin diameter (m)'
42 write(6,*)
' n_bin: number of bins'
43 write(6,*)
' wet/dry: average wet or dry sizes'
44 write(6,*)
' input_filename: like scenario_0001_00000001.nc'
45 write(6,*)
' output_prefix: like scenario_comp_average'
48 call get_command_argument(1, tmp_str)
50 call get_command_argument(2, tmp_str)
52 call get_command_argument(3, tmp_str)
54 call get_command_argument(4, tmp_str)
55 if (trim(tmp_str) ==
"wet")
then
57 elseif (trim(tmp_str) ==
"dry")
then
60 write(6,*)
'Argument 4 must be "wet" or "dry", not ' &
64 call get_command_argument(5, in_filename)
65 call get_command_argument(6, out_prefix)
72 call input_state(in_filename, index, time, del_t, i_repeat, uuid, &
73 aero_data, aero_state, gas_data, gas_state, env_state)
82 record_removals = .false.
83 record_optical = .true.
84 call output_state(out_prefix, output_type, aero_data, aero_state, &
85 gas_data, gas_state, env_state, index, time, del_t, i_repeat, &
86 record_removals, record_optical, uuid)
subroutine aero_state_bin_average_comp(aero_state, bin_grid, aero_data)
Set each aerosol particle to have its original total volume, but species volume ratios given by the t...
subroutine pmc_mpi_init()
Initialize MPI.
subroutine aero_state_make_dry(aero_state, aero_data)
Make all particles dry (water set to zero).
subroutine input_state(filename, index, time, del_t, i_repeat, uuid, aero_data, aero_state, gas_data, gas_state, env_state)
Read the current state.
The gas_data_t structure and associated subroutines.
integer, parameter dp
Kind of a double precision real number.
subroutine output_state(prefix, output_type, aero_data, aero_state, gas_data, gas_state, env_state, index, time, del_t, i_repeat, record_removals, record_optical, uuid)
Write the current state.
Current environment state.
integer function string_to_integer(string)
Convert a string to an integer.
The aero_state_t structure and assocated subroutines.
The gas_state_t structure and associated subroutines.
subroutine pmc_mpi_finalize()
Shut down MPI.
real(kind=dp) elemental function diam2rad(d)
Convert diameter (m) to radius (m).
integer, parameter output_type_single
Type code for single output (one file for all processes, written by process 0).
Random number generators.
The env_state_t structure and associated subroutines.
Current state of the gas mixing ratios in the system.
Aerosol material properties and associated data.
Write data in NetCDF format.
The bin_grid_t structure and associated subroutines.
program bin_average_comp
Read a NetCDF file, average the composition of all particles within each bin, and write the data out ...
The aero_data_t structure and associated subroutines.
1D grid, either logarithmic or linear.
integer, parameter bin_grid_type_log
Logarithmically spaced bin grid.
subroutine bin_grid_make(bin_grid, type, n_bin, min, max)
Generates the bin grid given the range and number of bins.
The current collection of aerosol particles.
real(kind=dp) function string_to_real(string)
Convert a string to a real.