-
Notifications
You must be signed in to change notification settings - Fork 16
/
TODO
199 lines (141 loc) · 7.63 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
######################################################################
Time
####
Clean up time handling. At the moment we have times from midnight, times
from start of run, times from time of restarted run, time within
condensation timestep, etc.
Change times in the env_data arrays to be seconds since midnight on
start_day, so we can easily change start_time without needing to
rewrite all the emit/height/etc data. It makes more sense for these to
be absolute real times, rather than relative to start of
simulation. Would also help with restarted simulations.
Add env%day_of_year (days since jan 1) and env%time_of_day (secs since
midnight) and shift info on start day, start time, etc to
env_data. Change mosaic_timestep() to just read time/day info out of
env directly. Update this info in env_data_update_state(). Should
probably store full date/time info, with timezone as +-HH:MM, etc.
Add separate del_t for mosaic, coag, and cond. Check on input that
t_output, etc are multiples of del_t so that the n_time header
information is actually correct.
######################################################################
MPI
###
All mpi_recv calls should use MPI_TAG_ANY and MPI_SOURCE_ANY but then
assert() that they are correct, so that we die rather than
deadlocking.
Change gas mixing to be by diffusion, rather than allreduce, also env.
Switch to using mpi structures rather than pack/unpack?
In aero_state_mix(), if expected number of particles to send to each
other processor is less than one, switch to a
"send-individual-particles" mode, which should be more efficient.
######################################################################
Build
#####
Sometimes cmake seems to rebuild even if no source files have changed
at all? Maybe has to do with the fact that the module files are being
put into the build/ directory?
######################################################################
Add entrainment switch as a function of time.
Implement a better poisson distribution generator. We should probably
generate a poisson sample per-bin, rather than doing a total sample
and then using a slow sampling to pick samples one-by-one.
Fix calling convention for aerosol_optical from mosaic.f90. Do we do
it every timestep, or just when needed, or what? What about
coagulation? Does this come in the right order? We should really be
able to do aerosol_optical as a post-processing step.
Change numeric_average.f90 to be numeric_reduce.f90 with option
"mean", "stddev", "min", "max", "median", "perc_rank" (percentile
rank).
Change sample_disc_pdf() and sample_cts_pdf() to use cumulative
distributions.
Store all events (particle loss, creation, coagulation, etc) in the
output file, to allow detailed post-processing. Record full
information for each event, including the complete state of all
involved particles (e.g., before and after coagulation states).
Add new run-mode to make an output directory, copy input files into
it, etc. Not so easy, given that fortran has no mkdir. We could call
the C mkdir() directly, or via our own C code (probably easier to
match mode_t types, etc), but requires Fortran 2003.
Change "rate" line in gas_profile/aero_profile to be "scaling" (so it
makes sense for background as well), or just delete it. Will need to
add a dilution rate profile somewhere --- better anyway to unify it.
Separate out numerical parameters into
run_part_opt/run_sect_opt/run_exact_opt and scenario parameters into
another structure (to replace env_data --- maybe call it
scenario_t). Add spec_file_read_run_part_opt() etc to input the
numerical parameters.
Shift spec file reading into run_part.F95, etc. Have a
spec_file_read_run_part() or similar, that just takes a filename. The
main partmc program would then just read the first line of the file,
close it, then call the correct run_*() reader. This would enable
other driver programs to be easily written. run_part() should also
take a callback function, with a t_callback timestep parameter, to
enable in-run processing.
Switch to allocatable structure members, rather than pointers. Also
test for allocated() inside my_type_allocate(), and deallocate first
if needed. Then don't need to deallocate before allocating in
subroutines. Then don't need to pre-allocate before calling
subroutines which are just going to reallocate anyway. Will need to
clearly indicate which procedures can be passed unallocated
structures.
Fix sources to work with MPI.
Change check_event() to always return false if the t_freq is 0, so
run_part can change to not testing this itself.
Rename aero_sorted to aero_sort.
Parallel method should just generate n_samp for all pairs, then
request these as blocks, not one-by-one. Also, don't bother sending
coagulation products to other processors, just keep them. Can we
analyze how expensive this is, compared to mixing?
We could ensure that bin_grids are always aligned to same base grid,
so that when we extend the bin_grid, we don't need to recompute the
sort, and we only need to recompute some parts of k_max.
Don't synchronize aero_state_rebalance() across all processes --- just
do it locally. This will mess up things like 32 parts/proc, but will
work well for large n_part/proc.
Rename valid_sort -> sort_valid.
Change aero_particle_allocate_size() to just take aero_data, not
individual n_*.
Change constants to use format 3_dp rather than 3d0.
Change kind=dp to kind=wp for "working precision".
Make numeric_diff work even with extra spaces at the end of lines.
Shift aero_data inside aero_state, like in partmc.py, to avoid having
to remember when to pass it around.
Unify extract_* programs further (maybe into just partmc executable?).
Use a better Poisson generator method for the non-GSL case (just use
the GSL method, that seems to be approximate anyway?).
Parallel input_state(), input_filename_list(), and input_sectional().
Parallel_dist does not do accelerated coagulation yet.
partmc.py can have histogram_1d() and histogram_2d() replaced by
numpy.histogram() and numpy.histogram2d().
Rename env_state%start_time to start_time_of_day.
Fix "use only" in f90_mod_deps or doc/Makefile or wherever.
Use find_unnecessary_line_breaks and fix them.
Add accessor functions for finding dimensions, rather than storing
them directly. E.g., aero_state.n_part(), aero_weight_array.n_set(),
etc.
Make nucleation look just like another emission, but of a
mono-disperse aero_dist with a rate that is computed from the
gas_state and env_state.
What should we be doing instead of "new_source_name(i) =
name(1:AERO_SOURCE_NAME_LEN)" and similar. This dies at runtime if
"name" has length less than AERO_SOURCE_NAME_LEN, which it might have
because we only say "character(len=*), intent(in) :: name".
Add check for height being <= 0.
Change aero_state_add_particles() to either check that
aero_state_delta has identical weights to aero_state, or (perhaps
better) to selectively sample based on the weight ratio. If we do the
second of these, we could adjust the cloud parcel routine in
scenario.F90 to allow equilib() to reweight, and thus remove the
do_reweight argument to equilib().
In getopt.F90, Dick needed to add "integer, external :: iargc" in
three places.
In util.F90, Dick needed to change "write( ret_val, '(i30)' ) val" to
free format to avoid a crash.
Rename bin_grid to rad_grid or similar (or replace with diam_grid).
Add aero_data_validate() or _check() and similar to check consistency
in dimensions, valid data, etc. Call after loading from netcdf files.
Change integer_varray%n_entry to _n_entry. Same for
aero_particle_array%n_part and similar.
Change pmc_mpi_pack_size_real_array_2d() etc to take allocatables that
might not be allocated, and deal correctly with them. Use this in
pmg_mpi_pack_aero_state(), etc.