Create new custom D4 dispersion model
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(c_ptr), | value | :: | verror | |||
type(c_ptr), | value | :: | vmol | |||
real(kind=c_double), | intent(in), | value | :: | ga | ||
real(kind=c_double), | intent(in), | value | :: | gc | ||
real(kind=c_double), | intent(in), | value | :: | wf |
function custom_d4_model_api(verror, vmol, ga, gc, wf) & & result(vdisp) & & bind(C, name=namespace//"custom_d4_model") !DEC$ ATTRIBUTES DLLEXPORT :: custom_d4_model_api type(c_ptr), value :: verror type(vp_error), pointer :: error type(c_ptr), value :: vmol type(vp_structure), pointer :: mol type(c_ptr) :: vdisp type(vp_model), pointer :: disp real(c_double), value, intent(in) :: ga real(c_double), value, intent(in) :: gc real(c_double), value, intent(in) :: wf type(d4_model), allocatable :: tmp if (debug) print'("[Info]",1x, a)', "custom_d4_model" vdisp = c_null_ptr if (.not.c_associated(verror)) return call c_f_pointer(verror, error) if (.not.c_associated(vmol)) then call fatal_error(error%ptr, "Molecular structure data is missing") return end if call c_f_pointer(vmol, mol) allocate(tmp) call new_d4_model(error%ptr, tmp, mol%ptr, ga=ga, gc=gc, wf=wf) if (allocated(error%ptr)) then deallocate(tmp) else allocate(disp) call move_alloc(tmp, disp%ptr) vdisp = c_loc(disp) end if end function custom_d4_model_api