| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | value | :: | handle | |||
| integer(kind=c_int), | value | :: | nsrc | |||
| type(c_ptr), | value | :: | source_heights_ptr | |||
| real(kind=c_double), | value | :: | area_xy |
integer(c_int) function beach_zero_mode_build(handle, nsrc, source_heights_ptr, area_xy) & bind(C, name='beach_zero_mode_build') result(status) type(c_ptr), value :: handle integer(c_int), value :: nsrc type(c_ptr), value :: source_heights_ptr real(c_double), value :: area_xy type(periodic_zero_mode_handle), pointer :: zero real(c_double), pointer :: source_heights(:, :) integer(i32) :: plan_status character(len=128) :: message status = get_zero_mode(handle, zero) if (status /= beach_zero_mode_ok) return if (.not. count_is_addressable(nsrc, 3_i64, 2_i64) .or. nsrc == 0_c_int .or. & .not. c_associated(source_heights_ptr) .or. .not. ieee_is_finite(area_xy) .or. & area_xy <= 0.0_c_double) then status = beach_zero_mode_invalid_argument return end if call c_f_pointer(source_heights_ptr, source_heights, [3, int(nsrc)]) if (any(.not. ieee_is_finite(source_heights))) then status = beach_zero_mode_invalid_argument return end if call build_periodic_zero_mode_height_plan( & real(source_heights, dp), real(area_xy, dp), zero%plan, plan_status, message & ) if (plan_status /= periodic_zero_mode_ok) then zero%built = .false. zero%charged = .false. status = beach_zero_mode_invalid_argument return end if zero%built = .true. zero%charged = .false. status = beach_zero_mode_ok end function beach_zero_mode_build