@@ -27,15 +27,33 @@ subroutine f_aero_state_dtor(ptr_c) bind(C)
2727 deallocate (ptr_f)
2828 end subroutine
2929
30- subroutine f_aero_state_set_n_part_ideal (ptr_c , n_part ) bind(C)
30+ subroutine f_aero_state_init (ptr_c , n_part , aero_data_ptr_c ) bind(C)
3131 type (aero_state_t), pointer :: ptr_f = > null ()
32- type (c_ptr), intent (in ) :: ptr_c
32+ type (aero_data_t), pointer :: aero_data_ptr_f = > null ()
33+ type (c_ptr), intent (in ) :: ptr_c, aero_data_ptr_c
3334 real (c_double), intent (in ) :: n_part
3435
3536 call c_f_pointer(ptr_c, ptr_f)
36- print * , n_part
37- ! TODO
38- ! call aero_state_set_n_part_ideal(ptr_f, n_part)
37+ call c_f_pointer(aero_data_ptr_c, aero_data_ptr_f)
38+
39+ call aero_state_zero(ptr_f)
40+ call aero_state_set_weight(ptr_f, aero_data_ptr_f, AERO_STATE_WEIGHT_FLAT)
41+ call aero_state_set_n_part_ideal(ptr_f, n_part)
42+ ! call aero_state_add_aero_dist_sample(aero_state, aero_data_ptr_f, &
43+ ! aero_dist_init, 1d0, 0d0, &
44+ ! .false. & ! TODO run_part_opt%allow_doubling, &
45+ ! .false. & ! TODO run_part_opt%allow_halving)
46+ ! )
47+
48+ end subroutine
49+
50+ subroutine f_aero_state_len (ptr_c , len ) bind(C)
51+ type (aero_state_t), pointer :: ptr_f = > null ()
52+ type (c_ptr), intent (in ) :: ptr_c
53+ integer (c_int), intent (out ) :: len
54+
55+ call c_f_pointer(ptr_c, ptr_f)
56+ len = aero_state_n_part(ptr_f)
3957 end subroutine
4058
4159end module
0 commit comments