-
Notifications
You must be signed in to change notification settings - Fork 16
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
Change timestepping structure in run_part #176
Conversation
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.
Looks good to me! I left suggestions about separating out the CAMP arguments on a fine-grained level. This isn't required but I think it makes the code a bit clearer because it highlights what is actually different with CAMP. It might also make it simpler with future modifications because we only need to change one place rather than two.
src/run_part.F90
Outdated
#ifdef PMC_USE_CAMP | ||
subroutine run_part_timestep(scenario, env_state, aero_data, aero_state, & | ||
gas_data, gas_state, run_part_opt, camp_core, photolysis, i_time, & | ||
t_start, last_output_time, last_progress_time, i_output, & | ||
progress_n_samp, progress_n_coag, progress_n_emit, progress_n_dil_in, & | ||
progress_n_dil_out, progress_n_nuc) | ||
#else | ||
subroutine run_part_timestep(scenario, env_state, aero_data, aero_state, & | ||
gas_data, gas_state, run_part_opt, i_time, t_start, last_output_time, & | ||
last_progress_time, i_output, progress_n_samp, progress_n_coag, & | ||
progress_n_emit, progress_n_dil_in, progress_n_dil_out, & | ||
progress_n_nuc) | ||
#endif |
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.
Would it be cleaner (and safer for future modifications) to separate out the CAMP code on a more fine-grained level? This would match what we do below in the argument variable definitions. For example:
#ifdef PMC_USE_CAMP | |
subroutine run_part_timestep(scenario, env_state, aero_data, aero_state, & | |
gas_data, gas_state, run_part_opt, camp_core, photolysis, i_time, & | |
t_start, last_output_time, last_progress_time, i_output, & | |
progress_n_samp, progress_n_coag, progress_n_emit, progress_n_dil_in, & | |
progress_n_dil_out, progress_n_nuc) | |
#else | |
subroutine run_part_timestep(scenario, env_state, aero_data, aero_state, & | |
gas_data, gas_state, run_part_opt, i_time, t_start, last_output_time, & | |
last_progress_time, i_output, progress_n_samp, progress_n_coag, & | |
progress_n_emit, progress_n_dil_in, progress_n_dil_out, & | |
progress_n_nuc) | |
#endif | |
subroutine run_part_timestep(scenario, env_state, aero_data, aero_state, & | |
gas_data, gas_state, run_part_opt, & | |
#ifdef PMC_USE_CAMP | |
camp_core, photolysis, & | |
#endif | |
i_time, & | |
t_start, last_output_time, last_progress_time, i_output, & | |
progress_n_samp, progress_n_coag, progress_n_emit, progress_n_dil_in, & | |
progress_n_dil_out, progress_n_nuc) |
src/run_part.F90
Outdated
#ifdef PMC_USE_CAMP | ||
subroutine run_part_timeblock(scenario, env_state, aero_data, aero_state, & | ||
gas_data, gas_state, run_part_opt, camp_core, photolysis, i_cur, & | ||
i_next, t_start, last_output_time, last_progress_time, i_output, & | ||
progress_n_samp, progress_n_coag, progress_n_emit, progress_n_dil_in, & | ||
progress_n_dil_out, progress_n_nuc) | ||
#else | ||
subroutine run_part_timeblock(scenario, env_state, aero_data, aero_state, & | ||
gas_data, gas_state, run_part_opt, i_cur, i_next, t_start, & | ||
last_output_time, last_progress_time, i_output, progress_n_samp, & | ||
progress_n_coag, progress_n_emit, progress_n_dil_in, & | ||
progress_n_dil_out, progress_n_nuc) | ||
#endif |
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.
Could do a similar separation of just the CAMP arguments here.
src/run_part.F90
Outdated
#ifdef PMC_USE_CAMP | ||
call run_part_timestep(scenario, env_state, aero_data, aero_state, & | ||
gas_data, gas_state, run_part_opt, camp_core, photolysis, i_time, & | ||
t_start, last_output_time, last_progress_time, i_output, & | ||
progress_n_samp, progress_n_coag, progress_n_emit, & | ||
progress_n_dil_in, progress_n_dil_out, progress_n_nuc) | ||
#else | ||
call run_part_timestep(scenario, env_state, aero_data, aero_state, & | ||
gas_data, gas_state, run_part_opt, i_time, t_start, & | ||
last_output_time, last_progress_time, i_output, progress_n_samp, & | ||
progress_n_coag, progress_n_emit, progress_n_dil_in, & | ||
progress_n_dil_out, progress_n_nuc) | ||
#endif |
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.
Also here we could separate out just the CAMP arguments.
src/run_part.F90
Outdated
call run_part_timeblock(scenario, env_state, aero_data, aero_state, & | ||
gas_data, gas_state, run_part_opt, camp_core, photolysis, & | ||
i_cur, i_next, t_start, last_output_time, last_progress_time, & | ||
i_output, progress_n_samp, progress_n_coag, progress_n_emit, & | ||
progress_n_dil_in, progress_n_dil_out, progress_n_nuc) | ||
#else | ||
call run_part_timeblock(scenario, env_state, aero_data, aero_state, & | ||
gas_data, gas_state, run_part_opt, i_cur, i_next, t_start, & | ||
last_output_time, last_progress_time, i_output, progress_n_samp, & | ||
progress_n_coag, progress_n_emit, progress_n_dil_in, & | ||
progress_n_dil_out, progress_n_nuc) |
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.
Could also separate out the CAMP arguments here.
run_part
both controls the timestepping and calls all the functions individually to progress an entire simulation (from timerun_part_timeblock
which will simulate from timerun_part_timestep
which runs from time