From 11578f83b98920d4a3fae8ec5151021b91c76317 Mon Sep 17 00:00:00 2001 From: Sylwester Arabas Date: Fri, 25 Sep 2026 17:31:49 +0200 Subject: [PATCH 1/7] bump PartMC submodule --- gitmodules/json | 2 +- gitmodules/nanobind | 2 +- gitmodules/netcdf-c | 2 +- gitmodules/netcdf-fortran | 2 +- gitmodules/partmc | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gitmodules/json b/gitmodules/json index 9cca280a..d6efe672 160000 --- a/gitmodules/json +++ b/gitmodules/json @@ -1 +1 @@ -Subproject commit 9cca280a4d0ccf0c08f47a99aa71d1b0e52f8d03 +Subproject commit d6efe672b577098623f7a9ea28ccb777d04aa0cf diff --git a/gitmodules/nanobind b/gitmodules/nanobind index 780a2d71..7d13bfc2 160000 --- a/gitmodules/nanobind +++ b/gitmodules/nanobind @@ -1 +1 @@ -Subproject commit 780a2d71c85b10897da6f4afe40bf27cc87155ad +Subproject commit 7d13bfc2581b9a34be2f3ab32c035fd182ffe407 diff --git a/gitmodules/netcdf-c b/gitmodules/netcdf-c index 7cb42a67..4c297e0c 160000 --- a/gitmodules/netcdf-c +++ b/gitmodules/netcdf-c @@ -1 +1 @@ -Subproject commit 7cb42a673903e9fd80008f9cff0cb0ca8c6f08ed +Subproject commit 4c297e0c7c4aaff75a31c528206e985f6695ee5d diff --git a/gitmodules/netcdf-fortran b/gitmodules/netcdf-fortran index 38819c2f..5f02e6a0 160000 --- a/gitmodules/netcdf-fortran +++ b/gitmodules/netcdf-fortran @@ -1 +1 @@ -Subproject commit 38819c2fa66cf07bc32df2e87519be9bcea9bbce +Subproject commit 5f02e6a08432062cfcf98c85bf0d71e71408820c diff --git a/gitmodules/partmc b/gitmodules/partmc index e6356e77..79840201 160000 --- a/gitmodules/partmc +++ b/gitmodules/partmc @@ -1 +1 @@ -Subproject commit e6356e7739f0aa45d33ef4b07b3a701f79c4305d +Subproject commit 79840201c39fb1ca3dace78cf21232996a3acfdb From d74f62e3569c394a3563e3683749596ec4e1800c Mon Sep 17 00:00:00 2001 From: Sylwester Arabas Date: Fri, 25 Sep 2026 17:34:58 +0200 Subject: [PATCH 2/7] bump non-partmc modules to versions on main --- gitmodules/json | 2 +- gitmodules/nanobind | 2 +- gitmodules/netcdf-c | 2 +- gitmodules/netcdf-fortran | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gitmodules/json b/gitmodules/json index d6efe672..9cca280a 160000 --- a/gitmodules/json +++ b/gitmodules/json @@ -1 +1 @@ -Subproject commit d6efe672b577098623f7a9ea28ccb777d04aa0cf +Subproject commit 9cca280a4d0ccf0c08f47a99aa71d1b0e52f8d03 diff --git a/gitmodules/nanobind b/gitmodules/nanobind index 7d13bfc2..780a2d71 160000 --- a/gitmodules/nanobind +++ b/gitmodules/nanobind @@ -1 +1 @@ -Subproject commit 7d13bfc2581b9a34be2f3ab32c035fd182ffe407 +Subproject commit 780a2d71c85b10897da6f4afe40bf27cc87155ad diff --git a/gitmodules/netcdf-c b/gitmodules/netcdf-c index 4c297e0c..7cb42a67 160000 --- a/gitmodules/netcdf-c +++ b/gitmodules/netcdf-c @@ -1 +1 @@ -Subproject commit 4c297e0c7c4aaff75a31c528206e985f6695ee5d +Subproject commit 7cb42a673903e9fd80008f9cff0cb0ca8c6f08ed diff --git a/gitmodules/netcdf-fortran b/gitmodules/netcdf-fortran index 5f02e6a0..38819c2f 160000 --- a/gitmodules/netcdf-fortran +++ b/gitmodules/netcdf-fortran @@ -1 +1 @@ -Subproject commit 5f02e6a08432062cfcf98c85bf0d71e71408820c +Subproject commit 38819c2fa66cf07bc32df2e87519be9bcea9bbce From e9083a5517d50a950ee7d9b852eac088e5b9685b Mon Sep 17 00:00:00 2001 From: Sylwester Arabas Date: Fri, 25 Sep 2026 17:50:44 +0200 Subject: [PATCH 3/7] adapt to renamed scenario_loss_rate_dry_dep to scenario_loss_rate_drydep (+new argument) --- src/scenario.F90 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/scenario.F90 b/src/scenario.F90 index a832300e..d1e97828 100644 --- a/src/scenario.F90 +++ b/src/scenario.F90 @@ -67,7 +67,8 @@ subroutine f_scenario_loss_rate( & end subroutine - subroutine f_scenario_loss_rate_dry_dep( & + subroutine f_scenario_loss_rate_drydep( & + scenario_ptr_c &, vol, & density, & aero_data_ptr_c, & @@ -75,20 +76,23 @@ subroutine f_scenario_loss_rate_dry_dep( & rate & ) bind(C) + type(scenario_t), pointer :: scenario_ptr_f => null() type(aero_data_t), pointer :: aero_data_ptr_f => null() type(env_state_t), pointer :: env_state_ptr_f => null() real(c_double), intent(in) :: vol, density type(c_ptr), intent(in) :: aero_data_ptr_c, env_state_ptr_c real(c_double), intent(out) :: rate + call c_f_pointer(scenario_ptr_c, scenario_ptr_f) call c_f_pointer(aero_data_ptr_c, aero_data_ptr_f) call c_f_pointer(env_state_ptr_c, env_state_ptr_f) - rate = scenario_loss_rate_dry_dep( & + rate = scenario_loss_rate_drydep( & vol, & density, & aero_data_ptr_f, & - env_state_ptr_f & + env_state_ptr_f, & + scenario_ptr_f & ) end subroutine From d190b125d301a3756c3eedf1c6ed8c30814dd6dd Mon Sep 17 00:00:00 2001 From: Sylwester Arabas Date: Fri, 25 Sep 2026 17:52:20 +0200 Subject: [PATCH 4/7] Rename loss_rate_dry_dep to loss_rate_drydep --- src/scenario.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/scenario.cpp b/src/scenario.cpp index 1e6bb1cf..db8489b7 100644 --- a/src/scenario.cpp +++ b/src/scenario.cpp @@ -25,14 +25,16 @@ double loss_rate( return rate; } -double loss_rate_dry_dep( +double loss_rate_drydep( + const Scenario &scenario, const double vol, const double density, const AeroData &aero_data, const EnvState &env_state ) { double rate; - f_scenario_loss_rate_dry_dep( + f_scenario_loss_rate_drydep( + &scenario.ptr, &vol, &density, &aero_data.ptr, From 94b182775957626ddc460a95919d0385bb3de5a0 Mon Sep 17 00:00:00 2001 From: Sylwester Arabas Date: Fri, 25 Sep 2026 17:53:08 +0200 Subject: [PATCH 5/7] Rename loss_rate_dry_dep to loss_rate_drydep --- src/pypartmc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pypartmc.cpp b/src/pypartmc.cpp index 08d62bf8..4ac786f7 100644 --- a/src/pypartmc.cpp +++ b/src/pypartmc.cpp @@ -646,7 +646,7 @@ NB_MODULE(_PyPartMC, m) { ); m.def( - "loss_rate_dry_dep", &loss_rate_dry_dep, nb::rv_policy::copy, + "loss_rate_drydep", &loss_rate_drydep, nb::rv_policy::copy, "Compute and return the dry deposition rate for a given particle." ); From 78ac07167b3de7c83012ae55f2581c499d443d05 Mon Sep 17 00:00:00 2001 From: Sylwester Arabas Date: Fri, 25 Sep 2026 21:58:28 +0200 Subject: [PATCH 6/7] follow up fixes --- src/scenario.F90 | 4 ++-- src/scenario.hpp | 5 +++-- tests/test_help.py | 2 +- tests/test_loss_rate.py | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/scenario.F90 b/src/scenario.F90 index d1e97828..6e335598 100644 --- a/src/scenario.F90 +++ b/src/scenario.F90 @@ -68,7 +68,7 @@ subroutine f_scenario_loss_rate( & end subroutine subroutine f_scenario_loss_rate_drydep( & - scenario_ptr_c &, + scenario_ptr_c, & vol, & density, & aero_data_ptr_c, & @@ -80,7 +80,7 @@ subroutine f_scenario_loss_rate_drydep( & type(aero_data_t), pointer :: aero_data_ptr_f => null() type(env_state_t), pointer :: env_state_ptr_f => null() real(c_double), intent(in) :: vol, density - type(c_ptr), intent(in) :: aero_data_ptr_c, env_state_ptr_c + type(c_ptr), intent(in) :: scenario_ptr_c, aero_data_ptr_c, env_state_ptr_c real(c_double), intent(out) :: rate call c_f_pointer(scenario_ptr_c, scenario_ptr_f) diff --git a/src/scenario.hpp b/src/scenario.hpp index 1b8b6bb4..e080a0f0 100644 --- a/src/scenario.hpp +++ b/src/scenario.hpp @@ -32,7 +32,8 @@ extern "C" void f_scenario_loss_rate( const void *env_state, double *rate ) noexcept; -extern "C" void f_scenario_loss_rate_dry_dep( +extern "C" void f_scenario_loss_rate_drydep( + const void *scenario, const double *vol, const double *density, const void *aero_data, @@ -212,7 +213,7 @@ double loss_rate( const EnvState &env_state ); -double loss_rate_dry_dep( +double loss_rate_drydep( const double vol, const double density, const AeroData &aero_data, diff --git a/tests/test_help.py b/tests/test_help.py index c35f9073..7e979ba9 100644 --- a/tests/test_help.py +++ b/tests/test_help.py @@ -31,7 +31,7 @@ ppmc.input_sectional, ppmc.input_state, ppmc.loss_rate, - ppmc.loss_rate_dry_dep, + ppmc.loss_rate_drydep, ppmc.output_state, ppmc.pow2_above, ppmc.rad2diam, diff --git a/tests/test_loss_rate.py b/tests/test_loss_rate.py index 96b49dc6..1a97408b 100644 --- a/tests/test_loss_rate.py +++ b/tests/test_loss_rate.py @@ -60,7 +60,7 @@ def test_loss_rate(loss_function_params: str): assert rate is not nan @staticmethod - def test_loss_rate_dry_dep(): + def test_loss_rate_drydep(): # arrange aero_data = ppmc.AeroData(AERO_DATA_CTOR_ARG_MINIMAL) env_state = ppmc.EnvState(ENV_STATE_CTOR_ARG_MINIMAL) @@ -74,7 +74,7 @@ def test_loss_rate_dry_dep(): aero_data.vol_fill_factor = 1 # act - rate = ppmc.loss_rate_dry_dep(vol, density, aero_data, env_state) + rate = ppmc.loss_rate_drydep(vol, density, aero_data, env_state) # assert assert rate is not nan From d37ce1447f89f3fadf37ccd81317ef1efb1eeff7 Mon Sep 17 00:00:00 2001 From: Sylwester Arabas Date: Fri, 25 Sep 2026 22:28:46 +0200 Subject: [PATCH 7/7] one more fix --- src/scenario.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/scenario.hpp b/src/scenario.hpp index e080a0f0..343f99f5 100644 --- a/src/scenario.hpp +++ b/src/scenario.hpp @@ -214,6 +214,7 @@ double loss_rate( ); double loss_rate_drydep( + const Scenario &scenario, const double vol, const double density, const AeroData &aero_data,