@@ -36,7 +36,7 @@ subroutine f_aero_particle_init(ptr_c, aero_data_ptr_c, arr_data, arr_size) bind
3636 real (c_double), dimension (arr_size), intent (in ) :: arr_data
3737 call c_f_pointer(ptr_c, ptr_f)
3838 call c_f_pointer(aero_data_ptr_c, aero_data_ptr_f)
39- allocate (ptr_f% vol(arr_size) )
39+ call aero_particle_zero (ptr_f, aero_data_ptr_f )
4040 call aero_particle_set_vols(ptr_f, arr_data)
4141 end subroutine
4242
@@ -193,4 +193,198 @@ subroutine f_aero_particle_solute_kappa(aero_particle_ptr_c, aero_data_ptr_c, ka
193193 kappa = aero_particle_solute_kappa(aero_particle_ptr_f, aero_data_ptr_f)
194194 end subroutine
195195
196+ subroutine f_aero_particle_moles (aero_particle_ptr_c , aero_data_ptr_c , moles ) bind(C)
197+ type (aero_particle_t), pointer :: aero_particle_ptr_f = > null ()
198+ type (aero_data_t), pointer :: aero_data_ptr_f = > null ()
199+ type (c_ptr), intent (in ) :: aero_particle_ptr_c, aero_data_ptr_c
200+ real (c_double), intent (out ) :: moles
201+
202+ call c_f_pointer(aero_particle_ptr_c, aero_particle_ptr_f)
203+ call c_f_pointer(aero_data_ptr_c, aero_data_ptr_f)
204+
205+ moles = aero_particle_moles(aero_particle_ptr_f, aero_data_ptr_f)
206+ end subroutine
207+
208+ subroutine f_aero_particle_mobility_diameter ( &
209+ aero_particle_ptr_c , &
210+ aero_data_ptr_c , &
211+ env_state_ptr_c , &
212+ mobility_diameter &
213+ ) bind(C)
214+
215+ type (aero_particle_t), pointer :: aero_particle_ptr_f = > null ()
216+ type (aero_data_t), pointer :: aero_data_ptr_f = > null ()
217+ type (env_state_t), pointer :: env_state_ptr_f = > null ()
218+ type (c_ptr), intent (in ) :: aero_particle_ptr_c, aero_data_ptr_c, &
219+ env_state_ptr_c
220+ real (c_double), intent (out ) :: mobility_diameter
221+
222+ call c_f_pointer(aero_particle_ptr_c, aero_particle_ptr_f)
223+ call c_f_pointer(aero_data_ptr_c, aero_data_ptr_f)
224+ call c_f_pointer(env_state_ptr_c, env_state_ptr_f)
225+
226+ mobility_diameter = aero_particle_mobility_diameter( &
227+ aero_particle_ptr_f, &
228+ aero_data_ptr_f, &
229+ env_state_ptr_f &
230+ )
231+ end subroutine
232+
233+ subroutine f_aero_particle_density ( &
234+ aero_particle_ptr_c , &
235+ aero_data_ptr_c , &
236+ density &
237+ ) bind(C)
238+
239+ type (aero_particle_t), pointer :: aero_particle_ptr_f = > null ()
240+ type (aero_data_t), pointer :: aero_data_ptr_f = > null ()
241+ type (c_ptr), intent (in ) :: aero_particle_ptr_c, aero_data_ptr_c
242+ real (c_double), intent (out ) :: density
243+
244+ call c_f_pointer(aero_particle_ptr_c, aero_particle_ptr_f)
245+ call c_f_pointer(aero_data_ptr_c, aero_data_ptr_f)
246+
247+ density = aero_particle_density( &
248+ aero_particle_ptr_f, &
249+ aero_data_ptr_f &
250+ )
251+ end subroutine
252+
253+ subroutine f_aero_particle_approx_crit_rel_humid ( &
254+ aero_particle_ptr_c , &
255+ aero_data_ptr_c , &
256+ env_state_ptr_c , &
257+ approx_crit_rel_humid &
258+ ) bind(C)
259+
260+ type (aero_particle_t), pointer :: aero_particle_ptr_f = > null ()
261+ type (aero_data_t), pointer :: aero_data_ptr_f = > null ()
262+ type (env_state_t), pointer :: env_state_ptr_f = > null ()
263+ type (c_ptr), intent (in ) :: aero_particle_ptr_c, aero_data_ptr_c, &
264+ env_state_ptr_c
265+ real (c_double), intent (out ) :: approx_crit_rel_humid
266+
267+ call c_f_pointer(aero_particle_ptr_c, aero_particle_ptr_f)
268+ call c_f_pointer(aero_data_ptr_c, aero_data_ptr_f)
269+ call c_f_pointer(env_state_ptr_c, env_state_ptr_f)
270+
271+ approx_crit_rel_humid = aero_particle_approx_crit_rel_humid( &
272+ aero_particle_ptr_f, &
273+ aero_data_ptr_f, &
274+ env_state_ptr_f &
275+ )
276+ end subroutine
277+
278+ subroutine f_aero_particle_crit_rel_humid ( &
279+ aero_particle_ptr_c , &
280+ aero_data_ptr_c , &
281+ env_state_ptr_c , &
282+ crit_rel_humid &
283+ ) bind(C)
284+
285+ type (aero_particle_t), pointer :: aero_particle_ptr_f = > null ()
286+ type (aero_data_t), pointer :: aero_data_ptr_f = > null ()
287+ type (env_state_t), pointer :: env_state_ptr_f = > null ()
288+ type (c_ptr), intent (in ) :: aero_particle_ptr_c, aero_data_ptr_c, &
289+ env_state_ptr_c
290+ real (c_double), intent (out ) :: crit_rel_humid
291+
292+ call c_f_pointer(aero_particle_ptr_c, aero_particle_ptr_f)
293+ call c_f_pointer(aero_data_ptr_c, aero_data_ptr_f)
294+ call c_f_pointer(env_state_ptr_c, env_state_ptr_f)
295+
296+ crit_rel_humid = aero_particle_crit_rel_humid( &
297+ aero_particle_ptr_f, &
298+ aero_data_ptr_f, &
299+ env_state_ptr_f &
300+ )
301+ end subroutine
302+
303+ subroutine f_aero_particle_crit_diameter ( &
304+ aero_particle_ptr_c , &
305+ aero_data_ptr_c , &
306+ env_state_ptr_c , &
307+ crit_diameter &
308+ ) bind(C)
309+
310+ type (aero_particle_t), pointer :: aero_particle_ptr_f = > null ()
311+ type (aero_data_t), pointer :: aero_data_ptr_f = > null ()
312+ type (env_state_t), pointer :: env_state_ptr_f = > null ()
313+ type (c_ptr), intent (in ) :: aero_particle_ptr_c, aero_data_ptr_c, &
314+ env_state_ptr_c
315+ real (c_double), intent (out ) :: crit_diameter
316+
317+ call c_f_pointer(aero_particle_ptr_c, aero_particle_ptr_f)
318+ call c_f_pointer(aero_data_ptr_c, aero_data_ptr_f)
319+ call c_f_pointer(env_state_ptr_c, env_state_ptr_f)
320+
321+ crit_diameter = aero_particle_crit_diameter( &
322+ aero_particle_ptr_f, &
323+ aero_data_ptr_f, &
324+ env_state_ptr_f &
325+ )
326+ end subroutine
327+
328+ subroutine f_aero_particle_coagulate ( &
329+ aero_particle_1_ptr_c , &
330+ aero_particle_2_ptr_c , &
331+ aero_particle_new_ptr_c &
332+ ) bind(C)
333+
334+ type (aero_particle_t), pointer :: aero_particle_1_ptr_f = > null ()
335+ type (aero_particle_t), pointer :: aero_particle_2_ptr_f = > null ()
336+ type (aero_particle_t), pointer :: aero_particle_new_ptr_f = > null ()
337+ type (c_ptr), intent (in ) :: aero_particle_1_ptr_c, aero_particle_2_ptr_c
338+ type (c_ptr), intent (inout ) :: aero_particle_new_ptr_c
339+
340+ call c_f_pointer(aero_particle_1_ptr_c, aero_particle_1_ptr_f)
341+ call c_f_pointer(aero_particle_2_ptr_c, aero_particle_2_ptr_f)
342+ call c_f_pointer(aero_particle_new_ptr_c, aero_particle_new_ptr_f)
343+
344+ call aero_particle_coagulate( &
345+ aero_particle_1_ptr_f, &
346+ aero_particle_2_ptr_f, &
347+ aero_particle_new_ptr_f &
348+ )
349+
350+ aero_particle_new_ptr_c = c_loc(aero_particle_new_ptr_f)
351+ end subroutine
352+
353+ subroutine f_aero_particle_zero ( &
354+ aero_particle_ptr_c , &
355+ aero_data_ptr_c &
356+ ) bind(C)
357+
358+ type (aero_particle_t), pointer :: aero_particle_ptr_f = > null ()
359+ type (aero_data_t), pointer :: aero_data_ptr_f = > null ()
360+ type (c_ptr), intent (in ) :: aero_particle_ptr_c, aero_data_ptr_c
361+
362+ call c_f_pointer(aero_particle_ptr_c, aero_particle_ptr_f)
363+ call c_f_pointer(aero_data_ptr_c, aero_data_ptr_f)
364+
365+ call aero_particle_zero( &
366+ aero_particle_ptr_f, &
367+ aero_data_ptr_f &
368+ )
369+ end subroutine
370+
371+ subroutine f_aero_particle_set_vols ( &
372+ aero_particle_ptr_c , &
373+ vol_size , &
374+ volumes &
375+ ) bind(C)
376+
377+ type (aero_particle_t), pointer :: aero_particle_ptr_f = > null ()
378+ type (c_ptr), intent (in ) :: aero_particle_ptr_c
379+ integer (c_int), intent (in ) :: vol_size
380+ real (c_double), dimension (vol_size), intent (in ) :: volumes
381+
382+ call c_f_pointer(aero_particle_ptr_c, aero_particle_ptr_f)
383+
384+ call aero_particle_set_vols( &
385+ aero_particle_ptr_f, &
386+ volumes &
387+ )
388+ end subroutine
389+
196390end module
0 commit comments