set_model_realspace_cutoff_api Subroutine

public subroutine set_model_realspace_cutoff_api(verror, vdisp, disp2, disp3, cn) bind(C, name=namespace//"set_model_realspace_cutoff")

Set realspace cutoffs for usage in dispersion calculations

Arguments

Type IntentOptional Attributes Name
type(c_ptr), value :: verror
type(c_ptr), value :: vdisp
real(kind=c_double), intent(in), value :: disp2
real(kind=c_double), intent(in), value :: disp3
real(kind=c_double), intent(in), value :: cn

Source Code

subroutine set_model_realspace_cutoff_api(verror, vdisp, disp2, disp3, cn) &
      & bind(C, name=namespace//"set_model_realspace_cutoff")
   !DEC$ ATTRIBUTES DLLEXPORT :: set_model_realspace_cutoff_api
   type(c_ptr), value :: verror
   type(vp_error), pointer :: error
   type(c_ptr), value :: vdisp
   type(vp_model), pointer :: disp
   real(c_double), value, intent(in) :: disp2
   real(c_double), value, intent(in) :: disp3
   real(c_double), value, intent(in) :: cn

   if (.not.c_associated(verror)) return
   call c_f_pointer(verror, error)

   if (.not.c_associated(vdisp)) then
      call fatal_error(error%ptr, "Dispersion model is missing")
      return
   end if
   call c_f_pointer(vdisp, disp)

   disp%cutoff = realspace_cutoff(disp2=disp2, disp3=disp3, cn=cn)
end subroutine set_model_realspace_cutoff_api