5#include "test_macros.inc"
12#define NOP(x) associate( x => x ); end associate
16 use,
INTRINSIC :: iso_c_binding
25 SUBROUTINE utest_c_free ( ptr ) bind ( c, name='free' )
27 use,
INTRINSIC :: iso_c_binding, only : c_ptr
29 TYPE ( c_ptr ),
INTENT(IN),
VALUE :: ptr
31 END SUBROUTINE utest_c_free
37 REAL(kind=c_double),
PARAMETER :: &
38 yac_rad = 0.017453292519943295769_c_double
40 TYPE(c_ptr) :: basic_grid_empty
41 TYPE(c_ptr) :: basic_grid_reg_2d
42 TYPE(c_ptr) :: basic_grid_reg_2d_deg
43 TYPE(c_ptr) :: basic_grid_curve_2d
44 TYPE(c_ptr) :: basic_grid_curve_2d_deg
45 TYPE(c_ptr) :: basic_grid_unstruct
46 TYPE(c_ptr) :: basic_grid_unstruct_deg
47 TYPE(c_ptr) :: basic_grid_unstruct_ll
48 TYPE(c_ptr) :: basic_grid_unstruct_ll_deg
49 TYPE(c_ptr) :: basic_grid_unstruct_edge
50 TYPE(c_ptr) :: basic_grid_unstruct_edge_deg
51 TYPE(c_ptr) :: basic_grid_unstruct_edge_ll
52 TYPE(c_ptr) :: basic_grid_unstruct_edge_ll_deg
53 TYPE(c_ptr) :: basic_grid_cloud
54 TYPE(c_ptr) :: basic_grid_cloud_deg
55 TYPE(c_ptr) :: basic_grid_reg_2d_rot
56 TYPE(c_ptr) :: basic_grid_reg_2d_rot_deg
57 INTEGER(kind=c_size_t) :: num_cells
58 INTEGER(kind=c_size_t) :: num_corners
59 INTEGER(kind=c_size_t) :: num_edges
60 REAL(kind=c_double),
ALLOCATABLE :: cell_areas(:)
62 REAL(kind=c_double) :: &
63 cell_coords(3) = (/1.0_c_double, 0.0_c_double, 0.0_c_double/)
64 INTEGER(kind=c_int) :: cell_mask(1) = (/1_c_int/)
65 INTEGER(kind=c_size_t) :: cell_coord_idx, cell_coord_ll_idx
66 INTEGER(kind=c_size_t) :: cell_mask_idx, cell_mask_ll_idx
68 TYPE(c_ptr) :: grid_pair
69 TYPE(c_ptr) :: interp_grid
70 TYPE(c_ptr) :: interp_stack_config
71 TYPE(c_ptr) :: interp_stack_config_cpy
74 TYPE(c_ptr) :: scale_config
75 TYPE(c_ptr) :: spmap_config
76 TYPE(c_ptr) :: src_point_selection
77 TYPE(c_ptr) :: source_cell_area_config, target_cell_area_config
78 TYPE(c_ptr) :: overwrite_spmap_config
79 TYPE(c_ptr) :: overwrite_config
80 TYPE(c_ptr),
TARGET :: overwrite_configs(2)
82 INTEGER(kind=c_int) :: compare_value, test_value
83 LOGICAL :: ltest_value
85 INTEGER,
TARGET :: do_search_call_count
86 INTEGER,
TARGET :: constructor_call_count
88 TYPE(c_ptr) :: interp_weights
89 TYPE(c_ptr) :: collection_selection
90 TYPE(c_ptr) :: interpolation_gen_config
91 TYPE(c_ptr) :: interpolation_gen_config_copy
92 TYPE(c_ptr) :: interpolation
93 TYPE(c_ptr) :: interpolation_frac
94 TYPE(c_ptr) :: interpolation_ext
96 REAL(kind=c_double),
TARGET :: src_cell_data(1)
97 TYPE(c_ptr),
TARGET :: src_field_(1)
98 TYPE(c_ptr),
TARGET :: src_field_collection(1)
99 REAL(kind=c_double),
TARGET :: src_frac_mask(1)
100 TYPE(c_ptr),
TARGET :: src_frac_mask_(1)
101 TYPE(c_ptr),
TARGET :: src_frac_mask_collection(1)
102 REAL(kind=c_double),
TARGET :: tgt_cell_data(1)
103 TYPE(c_ptr),
TARGET :: tgt_field_collection(1)
105 INTEGER(kind=c_int) :: has_mismatched_coordinates
108 SUBROUTINE utest_c_unlink ( path ) bind ( c, name='unlink' )
109 use,
INTRINSIC :: iso_c_binding, only : c_char
110 CHARACTER(KIND=c_char),
DIMENSION(*) :: path
111 END SUBROUTINE utest_c_unlink
116 TYPE,
BIND(C) :: instr_test_ctx_t
117 INTEGER(kind=c_int) :: create_calls
118 INTEGER(kind=c_int) :: start_calls
119 INTEGER(kind=c_int) :: stop_calls
120 INTEGER(kind=c_int) :: destroy_calls
121 INTEGER(kind=c_int) :: last_start_depth
122 INTEGER(kind=c_int) :: last_stop_depth
123 INTEGER(kind=c_int) :: bad_handle_count
127 CHARACTER(len=:),
ALLOCATABLE :: instr_name
128 INTEGER(kind=c_int) :: instr_start_calls_global
132 CALL utest_start_test(
'fortran_api')
143 CALL test(instr_name ==
"target field computation (SpMV)")
145 instr_ctx%create_calls = 0_c_int
146 instr_ctx%start_calls = 0_c_int
147 instr_ctx%stop_calls = 0_c_int
148 instr_ctx%destroy_calls = 0_c_int
149 instr_ctx%last_start_depth = -1_c_int
150 instr_ctx%last_stop_depth = -1_c_int
151 instr_ctx%bad_handle_count = 0_c_int
156 c_funloc(utest_instrument_create_cb), &
157 c_funloc(utest_instrument_start_cb), &
158 c_funloc(utest_instrument_stop_cb), &
159 c_funloc(utest_instrument_destroy_cb), &
168 CALL test(num_cells == 0_c_int)
171 basic_grid_reg_2d = &
173 "reg_2d_grid" // c_null_char, &
174 (/2_c_size_t, 2_c_size_t/), (/0_c_int, 0_c_int/), &
175 (/-0.1_c_double, 0.1_c_double/), (/-0.1_c_double, 0.1_c_double/))
179 CALL test(num_corners == 4_c_int)
186 cell_areas(:) = -1.0_c_double
188 CALL test(all(cell_areas(:) /= -1.0_c_double))
189 DEALLOCATE(cell_areas)
192 basic_grid_reg_2d_deg = &
194 "reg_2d_grid_deg" // c_null_char, &
195 (/2_c_size_t, 2_c_size_t/), (/0_c_int, 0_c_int/), &
196 (/-0.1_c_double, 0.1_c_double/), (/-0.1_c_double, 0.1_c_double/))
200 CALL test(num_corners == 4_c_int)
203 basic_grid_curve_2d = &
205 "curve_2d_grid" // c_null_char, &
206 (/2_c_size_t, 2_c_size_t/), (/0_c_int, 0_c_int/), &
207 (/-0.1_c_double, 0.1_c_double, -0.1_c_double, 0.1_c_double/), &
208 (/-0.1_c_double, -0.1_c_double, 0.1_c_double, 0.1_c_double/))
212 CALL test(num_edges == 4_c_int)
215 basic_grid_curve_2d_deg = &
217 "curve_2d_grid_deg" // c_null_char, &
218 (/2_c_size_t, 2_c_size_t/), (/0_c_int, 0_c_int/), &
219 (/-0.1_c_double, 0.1_c_double, -0.1_c_double, 0.1_c_double/), &
220 (/-0.1_c_double, -0.1_c_double, 0.1_c_double, 0.1_c_double/))
224 CALL test(num_edges == 4_c_int)
227 basic_grid_unstruct = &
229 "unstruct_grid" // c_null_char, &
230 4_c_size_t, 1_c_size_t, (/4_c_int/), &
231 (/-0.1_c_double, 0.1_c_double, 0.1_c_double, -0.1_c_double/), &
232 (/-0.1_c_double, -0.1_c_double, 0.1_c_double, 0.1_c_double/), &
233 (/0_c_int, 1_c_int, 2_c_int, 3_c_int/))
237 CALL test(num_edges == 4_c_int)
240 basic_grid_unstruct_deg = &
242 "unstruct_grid_deg" // c_null_char, &
243 4_c_size_t, 1_c_size_t, (/4_c_int/), &
244 (/-0.1_c_double, 0.1_c_double, 0.1_c_double, -0.1_c_double/), &
245 (/-0.1_c_double, -0.1_c_double, 0.1_c_double, 0.1_c_double/), &
246 (/0_c_int, 1_c_int, 2_c_int, 3_c_int/))
250 CALL test(num_edges == 4_c_int)
253 basic_grid_unstruct_ll = &
255 "unstruct_grid_ll" // c_null_char, &
256 4_c_size_t, 1_c_size_t, (/4_c_int/), &
257 (/-0.1_c_double, 0.1_c_double, 0.1_c_double, -0.1_c_double/), &
258 (/-0.1_c_double, -0.1_c_double, 0.1_c_double, 0.1_c_double/), &
259 (/0_c_int, 1_c_int, 2_c_int, 3_c_int/))
263 CALL test(num_edges == 4_c_int)
266 basic_grid_unstruct_ll_deg = &
268 "unstruct_grid_ll_deg" // c_null_char, &
269 4_c_size_t, 1_c_size_t, (/4_c_int/), &
270 (/-0.1_c_double, 0.1_c_double, 0.1_c_double, -0.1_c_double/), &
271 (/-0.1_c_double, -0.1_c_double, 0.1_c_double, 0.1_c_double/), &
272 (/0_c_int, 1_c_int, 2_c_int, 3_c_int/))
276 CALL test(num_edges == 4_c_int)
279 basic_grid_unstruct_edge = &
281 "unstruct_edge_grid" // c_null_char, &
282 4_c_size_t, 1_c_size_t, 4_c_size_t, (/4_c_int/), &
283 (/-0.1_c_double, 0.1_c_double, 0.1_c_double, -0.1_c_double/), &
284 (/-0.1_c_double, -0.1_c_double, 0.1_c_double, 0.1_c_double/), &
285 (/0_c_int, 1_c_int, 2_c_int, 3_c_int/), &
286 (/0_c_int, 1_c_int, 1_c_int, 2_c_int, &
287 2_c_int, 3_c_int, 3_c_int, 0_c_int/))
291 CALL test(num_edges == 4_c_int)
294 basic_grid_unstruct_edge_deg = &
296 "unstruct_grid_edge_deg" // c_null_char, &
297 4_c_size_t, 1_c_size_t, 4_c_size_t, (/4_c_int/), &
298 (/-0.1_c_double, 0.1_c_double, 0.1_c_double, -0.1_c_double/), &
299 (/-0.1_c_double, -0.1_c_double, 0.1_c_double, 0.1_c_double/), &
300 (/0_c_int, 1_c_int, 2_c_int, 3_c_int/), &
301 (/0_c_int, 1_c_int, 1_c_int, 2_c_int, &
302 2_c_int, 3_c_int, 3_c_int, 0_c_int/))
306 CALL test(num_edges == 4_c_int)
309 basic_grid_unstruct_edge_ll = &
311 "unstruct_grid_edge_ll" // c_null_char, &
312 4_c_size_t, 1_c_size_t, 4_c_size_t, (/4_c_int/), &
313 (/-0.1_c_double, 0.1_c_double, 0.1_c_double, -0.1_c_double/), &
314 (/-0.1_c_double, -0.1_c_double, 0.1_c_double, 0.1_c_double/), &
315 (/0_c_int, 1_c_int, 2_c_int, 3_c_int/), &
316 (/0_c_int, 1_c_int, 1_c_int, 2_c_int, &
317 2_c_int, 3_c_int, 3_c_int, 0_c_int/))
321 CALL test(num_edges == 4_c_int)
324 basic_grid_unstruct_edge_ll_deg = &
326 "unstruct_grid_edge_ll_deg" // c_null_char, &
327 4_c_size_t, 1_c_size_t, 4_c_size_t, (/4_c_int/), &
328 (/-0.1_c_double, 0.1_c_double, 0.1_c_double, -0.1_c_double/), &
329 (/-0.1_c_double, -0.1_c_double, 0.1_c_double, 0.1_c_double/), &
330 (/0_c_int, 1_c_int, 2_c_int, 3_c_int/), &
331 (/0_c_int, 1_c_int, 1_c_int, 2_c_int, &
332 2_c_int, 3_c_int, 3_c_int, 0_c_int/))
335 basic_grid_unstruct_edge_ll_deg, int(
yac_loc_edge, c_int))
336 CALL test(num_edges == 4_c_int)
341 "cloud_grid" // c_null_char, 4_c_size_t, &
342 (/-0.1_c_double, 0.1_c_double, 0.1_c_double, -0.1_c_double/), &
343 (/-0.1_c_double, -0.1_c_double, 0.1_c_double, 0.1_c_double/))
353 CALL test(num_cells == 0_c_int)
354 CALL test(num_corners == 4_c_int)
355 CALL test(num_edges == 0_c_int)
358 basic_grid_cloud_deg = &
360 "cloud_grid" // c_null_char, 4_c_size_t, &
361 (/-0.1_c_double, 0.1_c_double, 0.1_c_double, -0.1_c_double/), &
362 (/-0.1_c_double, -0.1_c_double, 0.1_c_double, 0.1_c_double/))
372 CALL test(num_cells == 0_c_int)
373 CALL test(num_corners == 4_c_int)
374 CALL test(num_edges == 0_c_int)
377 basic_grid_reg_2d_rot = &
379 "reg_2d_grid_deg" // c_null_char, &
380 (/2_c_size_t, 2_c_size_t/), (/0_c_int, 0_c_int/), &
381 (/-0.5_c_double, 0.5_c_double/) * yac_rad, &
382 (/-0.5_c_double, 0.5_c_double/) * yac_rad, &
383 180.0_c_double * yac_rad, 45.0_c_double * yac_rad)
387 CALL test(num_corners == 4_c_int)
390 basic_grid_reg_2d_rot_deg = &
392 "reg_2d_grid_deg" // c_null_char, &
393 (/2_c_size_t, 2_c_size_t/), (/0_c_int, 0_c_int/), &
394 (/-0.5_c_double, 0.5_c_double/), &
395 (/-0.5_c_double, 0.5_c_double/), &
396 180.0_c_double, 45.0_c_double)
400 CALL test(num_corners == 4_c_int)
405 basic_grid_unstruct,
yac_loc_cell, cell_coords, 1_c_size_t)
406 cell_coord_ll_idx = &
408 basic_grid_unstruct_ll,
yac_loc_cell, cell_coords, 1_c_size_t)
411 basic_grid_unstruct,
yac_loc_cell, cell_mask, 1_c_size_t, &
412 "cell_mask" // c_null_char)
415 basic_grid_unstruct_ll,
yac_loc_cell, cell_mask, 1_c_size_t, &
416 "cell_mask_ll" // c_null_char)
418 has_mismatched_coordinates = &
420 basic_grid_unstruct, is_fatal=0_c_int)
421 CALL test(has_mismatched_coordinates == 0_c_int)
426 basic_grid_unstruct, basic_grid_unstruct_ll, mpi_comm_world)
431 grid_pair,
"unstruct_grid" // c_null_char, &
432 "unstruct_grid_ll" // c_null_char, &
433 1_c_size_t, (/
yac_loc_cell/), (/cell_coord_idx/), (/cell_mask_idx/), &
438 c_funloc(utest_constructor_callback), c_loc(constructor_call_count), &
439 "constructor_callback" // c_null_char)
441 c_funloc(utest_do_search_callback), c_loc(do_search_call_count), &
442 "do_search_callback" // c_null_char)
445 source_cell_area_config = &
448 target_cell_area_config = &
454 source_cell_area_config, target_cell_area_config)
455 src_point_selection = &
457 0.0_c_double, 0.0_c_double, 0.1_c_double)
464 overwrite_spmap_config = &
472 src_point_selection, overwrite_spmap_config)
473 overwrite_configs = (/overwrite_config, c_null_ptr/)
476 constructor_call_count = 0
477 do_search_call_count = 0
480 interp_stack_config,
"constructor_callback" // c_null_char, &
481 "do_search_callback" // c_null_char)
486 interp_stack_config_cpy = &
525 interp_stack_config, spmap_config, c_loc(overwrite_configs(1)))
528 interp_stack_config,
"test_fortran_api_weights.nc" // c_null_char, &
532 interp_stack_config, -1.0_c_double)
550 interp_stack_config, interp_stack_config_cpy)
551 CALL test(compare_value /= 0_c_int)
554 CALL test(constructor_call_count == 0)
557 CALL test(constructor_call_count == 1)
560 CALL test(do_search_call_count == 0)
564 interp_weights,
"test_fortran_api_weights.nc" // c_null_char, &
565 "unstruct_grid" // c_null_char,
"unstruct_grid_ll" // c_null_char, &
567 CALL test(do_search_call_count == 1)
574 1.0_c_double, 0.0_c_double, c_null_char, 1_c_int, 1_c_int)
575 interpolation_frac = &
578 0.0_c_double, 1.0_c_double, 0.0_c_double, c_null_char, 1_c_int, 1_c_int)
582 CALL test(ltest_value)
585 collection_selection = &
590 collection_selection = &
598 interpolation_gen_config, 1_c_size_t)
600 interpolation_gen_config, collection_selection)
602 interpolation_gen_config, 1.0_c_double)
604 interpolation_gen_config, 2.0_c_double)
606 interpolation_gen_config, 2.0_c_double)
608 interpolation_gen_config,
"" // c_null_char)
609 interpolation_gen_config_copy = &
613 interpolation_ext = &
615 interp_weights, interpolation_gen_config, 1_c_int, 1_c_int)
617 src_field_(1) = c_loc(src_cell_data(1))
618 src_field_collection(1) = c_loc(src_field_(1))
619 src_frac_mask_(1) = c_loc(src_frac_mask)
620 src_frac_mask_collection(1) = c_loc(src_frac_mask_(1))
621 tgt_field_collection(1) = c_loc(tgt_cell_data(1))
622 src_cell_data(1) = 1.0_c_double
623 src_frac_mask(1) = 0.0_c_double
625 tgt_cell_data(1) = -1.0_c_double
627 interpolation, c_loc(src_field_collection), c_loc(tgt_field_collection))
628 CALL test(tgt_cell_data(1) == src_cell_data(1))
630 tgt_cell_data(1) = -1.0_c_double
632 interpolation_frac, c_loc(src_field_collection), &
633 c_loc(src_frac_mask_collection), c_loc(tgt_field_collection))
634 CALL test(tgt_cell_data(1) == 0.0_c_double)
636 tgt_cell_data(1) = -1.0_c_double
638 CALL test(test_value == 1_c_int)
640 interpolation, c_loc(src_field_collection))
642 interpolation, c_loc(tgt_field_collection))
643 CALL test(tgt_cell_data(1) == src_cell_data(1))
645 tgt_cell_data(1) = -1.0_c_double
647 interpolation_frac, c_loc(tgt_field_collection))
649 CALL test(test_value == 0_c_int)
650 CALL mpi_barrier(mpi_comm_world, ierror)
652 interpolation_frac, c_loc(src_field_collection), &
653 c_loc(src_frac_mask_collection))
655 CALL test(tgt_cell_data(1) == 0.0_c_double)
656 tgt_cell_data(1) = -1.0_c_double
665 CALL utest_c_unlink(
"test_fortran_api_weights.nc" // c_null_char)
696 TYPE(c_ptr) :: method_config
697 INTEGER(kind=c_int) :: n_val
701 "nnn" // c_null_char)
703 method_config,
"n" // c_null_char, 7_c_int)
705 method_config,
"n" // c_null_char)
706 CALL test(n_val == 7_c_int)
712 TYPE(c_ptr) :: method_config
713 REAL(kind=c_double) :: d_val
717 "nnn" // c_null_char)
719 method_config,
"max_search_distance" // c_null_char, 0.5_c_double)
721 method_config,
"max_search_distance" // c_null_char)
722 CALL test(d_val == 0.5_c_double)
728 TYPE(c_ptr) :: method_config
729 CHARACTER(kind=c_char, len=64) :: str_buf
732 yac_interp_method_config_default_from_name_new_c( &
733 "nnn" // c_null_char)
734 CALL yac_interp_method_config_set_param_str_c( &
735 method_config,
"weighted" // c_null_char, &
736 "gauss_weighted" // c_null_char)
737 CALL yac_interp_method_config_get_param_str_c( &
738 method_config,
"weighted" // c_null_char, &
739 str_buf, int(len(str_buf), c_int))
740 CALL test(str_buf(1:14) ==
"gauss_weighted")
741 CALL yac_interp_method_config_delete_c(method_config)
746 TYPE(c_ptr) :: method_config
747 REAL(kind=c_double) :: d_val
750 yac_interp_method_config_default_from_name_new_c( &
751 "dnn" // c_null_char)
752 CALL yac_interp_method_config_set_param_dble_c( &
753 method_config,
"search_distance.fixed" // c_null_char, &
754 1.0_c_double * yac_rad)
755 d_val = yac_interp_method_config_get_param_dble_c( &
756 method_config,
"search_distance.fixed" // c_null_char)
757 CALL test(d_val == 1.0_c_double * yac_rad)
758 CALL yac_interp_method_config_delete_c(method_config)
763 TYPE(c_ptr) :: method_config, stack
766 yac_interp_method_config_default_from_name_new_c( &
767 "nnn" // c_null_char)
768 CALL yac_interp_method_config_set_param_int_c( &
769 method_config,
"n" // c_null_char, 3_c_int)
770 stack = yac_interp_stack_config_new_c()
771 CALL yac_interp_stack_config_add_c(stack, method_config)
772 CALL yac_interp_stack_config_delete_c(stack)
777 TYPE(c_ptr) :: method_config
778 INTEGER(kind=c_size_t) :: list_sz, idx0, idx1
779 REAL(kind=c_double) :: sd0, sd1
782 yac_interp_method_config_default_from_name_new_c( &
783 "spmap" // c_null_char)
786 list_sz = yac_interp_method_config_get_list_size_c( &
787 method_config,
"overwrite" // c_null_char)
788 CALL test(list_sz == 0_c_size_t)
791 idx0 = yac_interp_method_config_append_list_element_c( &
792 method_config,
"overwrite" // c_null_char)
793 CALL test(idx0 == 0_c_size_t)
796 CALL yac_interp_method_config_set_param_dble_c( &
797 method_config,
"overwrite.0.spread_distance" // c_null_char, 0.05_c_double)
798 sd0 = yac_interp_method_config_get_param_dble_c( &
799 method_config,
"overwrite.0.spread_distance" // c_null_char)
800 CALL test(sd0 == 0.05_c_double)
803 idx1 = yac_interp_method_config_append_list_element_c( &
804 method_config,
"overwrite" // c_null_char)
805 CALL test(idx1 == 1_c_size_t)
807 CALL yac_interp_method_config_set_param_dble_c( &
808 method_config,
"overwrite.1.spread_distance" // c_null_char, 0.10_c_double)
809 sd1 = yac_interp_method_config_get_param_dble_c( &
810 method_config,
"overwrite.1.spread_distance" // c_null_char)
811 CALL test(sd1 == 0.10_c_double)
814 sd0 = yac_interp_method_config_get_param_dble_c( &
815 method_config,
"overwrite.0.spread_distance" // c_null_char)
816 CALL test(sd0 == 0.05_c_double)
818 CALL yac_interp_method_config_delete_c(method_config)
831 CALL test(instr_ctx%start_calls == instr_ctx%stop_calls)
832 CALL test(instr_ctx%bad_handle_count == 0_c_int)
833 CALL test(instr_ctx%destroy_calls == 0_c_int)
834 IF (instr_ctx%start_calls > 0_c_int) &
835 CALL test(instr_ctx%last_start_depth >= 0_c_int)
836 IF (instr_ctx%stop_calls > 0_c_int) &
837 CALL test(instr_ctx%last_stop_depth >= 0_c_int)
839 CALL mpi_allreduce( &
840 instr_ctx%start_calls, instr_start_calls_global, 1, mpi_integer, &
841 mpi_sum, mpi_comm_world, ierror)
842 CALL test(instr_start_calls_global > 0)
844 CALL yac_instrument_clear_callbacks_c()
846 CALL test(instr_ctx%destroy_calls == instr_ctx%create_calls)
848 CALL yac_mpi_cleanup_c()
849 CALL yac_mpi_finalize_c()
852 CALL utest_exit_tests
856 SUBROUTINE utest_constructor_callback(user_data)
BIND(C)
858 TYPE(c_ptr),
value :: user_data
860 INTEGER,
POINTER :: constructor_call_count
862 CALL c_f_pointer(user_data, constructor_call_count)
864 constructor_call_count = constructor_call_count + 1
866 END SUBROUTINE utest_constructor_callback
868 SUBROUTINE utest_do_search_callback( &
869 global_ids, coordinates_xyz, count, user_data)
BIND(C)
871 TYPE(c_ptr),
value :: global_ids
872 TYPE(c_ptr),
value :: coordinates_xyz
873 INTEGER(kind=c_size_t),
value :: count
874 TYPE(c_ptr),
value :: user_data
876 INTEGER,
POINTER :: do_search_call_count
882 CALL c_f_pointer(user_data, do_search_call_count)
884 do_search_call_count = do_search_call_count + 1
888 FUNCTION utest_instrument_create_cb(id, user_data)
BIND(C) RESULT(handle)
890 INTEGER(kind=c_int),
VALUE :: id
891 TYPE(c_ptr),
VALUE :: user_data
892 TYPE(c_ptr) :: handle
898 CALL c_f_pointer(user_data, ctx)
899 ctx%create_calls = ctx%create_calls + 1
908 END FUNCTION utest_instrument_create_cb
910 SUBROUTINE utest_instrument_start_cb( &
911 id, region_handle, depth, user_data)
BIND(C)
913 INTEGER(kind=c_int),
VALUE :: id
914 TYPE(c_ptr),
VALUE :: region_handle
915 INTEGER(kind=c_int),
VALUE :: depth
916 TYPE(c_ptr),
VALUE :: user_data
922 CALL c_f_pointer(user_data, ctx)
923 ctx%start_calls = ctx%start_calls + 1
924 ctx%last_start_depth = depth
925 IF (.NOT. c_associated(region_handle, user_data)) &
926 ctx%bad_handle_count = ctx%bad_handle_count + 1
928 END SUBROUTINE utest_instrument_start_cb
930 SUBROUTINE utest_instrument_stop_cb( &
931 id, region_handle, depth, user_data)
BIND(C)
933 INTEGER(kind=c_int),
VALUE :: id
934 TYPE(c_ptr),
VALUE :: region_handle
935 INTEGER(kind=c_int),
VALUE :: depth
936 TYPE(c_ptr),
VALUE :: user_data
942 CALL c_f_pointer(user_data, ctx)
943 ctx%stop_calls = ctx%stop_calls + 1
944 ctx%last_stop_depth = depth
945 IF (.NOT. c_associated(region_handle, user_data)) &
946 ctx%bad_handle_count = ctx%bad_handle_count + 1
948 END SUBROUTINE utest_instrument_stop_cb
950 SUBROUTINE utest_instrument_destroy_cb(id, region_handle, user_data)
BIND(C)
952 INTEGER(kind=c_int),
VALUE :: id
953 TYPE(c_ptr),
VALUE :: region_handle
954 TYPE(c_ptr),
VALUE :: user_data
960 CALL c_f_pointer(user_data, ctx)
961 ctx%destroy_calls = ctx%destroy_calls + 1
962 IF (.NOT. c_associated(region_handle, user_data)) &
963 ctx%bad_handle_count = ctx%bad_handle_count + 1
965 END SUBROUTINE utest_instrument_destroy_cb
integer(kind=c_int), parameter yac_interp_ncc_partial_coverage_default_f
character(kind=c_char, len= *), parameter yac_interp_spmap_varname_default_f
integer(kind=c_int), parameter yac_interp_dnn_weight_type_default_f
integer(kind=c_int), parameter yac_interp_dnn_search_distance_type_default_f
type(c_ptr) function yac_collection_selection_new_c(collection_size, selection_indices)
integer(kind=c_int), parameter yac_interp_nnn_weighted_default_f
integer(kind=c_int), parameter yac_interp_avg_partial_coverage_default_f
@ yac_instr_compute_tgt_field
real(kind=c_double), parameter yac_interp_nnn_max_search_distance_default_f
@ yac_weight_file_overwrite
integer(kind=c_int), parameter yac_interp_conserv_normalisation_default_f
integer(kind=c_int), parameter yac_interp_avg_weight_type_default_f
integer(kind=c_size_t), parameter yac_interp_rbf_n_default_f
integer(kind=c_int), parameter yac_interp_file_on_missing_file_default_f
real(kind=c_double), parameter yac_interp_dnn_scale_default_f
real(kind=c_double), parameter yac_interp_rbf_scale_default_f
integer(kind=c_int), parameter yac_interp_spmap_min_global_id_default_f
integer(kind=c_int), parameter yac_interp_ncc_weight_type_default_f
type(c_ptr), parameter yac_interp_spmap_overwrite_default_f
integer(kind=c_int), parameter yac_interp_spmap_weighted_default_f
integer(kind=c_int), parameter yac_interp_conserv_order_default_f
character(kind=c_char, len= *), parameter yac_interp_spmap_filename_default_f
real(kind=c_double), parameter yac_interp_spmap_spread_distance_default_f
character(len=:) function, allocatable yac_instrument_region_name_c(id)
real(kind=c_double), parameter yac_interp_nnn_gauss_scale_default_f
character(kind=c_char, len= *), parameter yac_interp_check_constructor_key_default_f
integer(kind=c_int), parameter yac_interp_file_on_success_default_f
integer(kind=c_int), parameter yac_interp_conserv_partial_coverage_default_f
real(kind=c_double), parameter yac_interp_spmap_sphere_radius_default_f
integer(kind=c_int), parameter yac_interp_conserv_enforced_conserv_default_f
integer(kind=c_size_t), parameter yac_interp_nnn_n_default_f
real(kind=c_double), parameter yac_interp_rbf_max_search_distance_default_f
real(kind=c_double), parameter yac_interp_dnn_search_distance_default_f
type(c_ptr), parameter yac_interp_spmap_config_default_f
real(kind=c_double), parameter yac_interp_spmap_max_search_distance_default_f
integer(kind=c_int), parameter yac_interp_creep_distance_default_f
character(kind=c_char, len= *), parameter yac_interp_check_do_search_key_default_f
integer(kind=c_int), parameter yac_interp_spmap_scale_type_default_f