new_d3_model_api Function

public function new_d3_model_api(verror, vmol) result(vdisp) bind(C, name=namespace//"new_d3_model")

Create new D3 dispersion model

Arguments

Type IntentOptional Attributes Name
type(c_ptr), value :: verror
type(c_ptr), value :: vmol

Return Value type(c_ptr)


Source Code

function new_d3_model_api(verror, vmol) &
      & result(vdisp) &
      & bind(C, name=namespace//"new_d3_model")
   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

   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(disp)
   call new_d3_model(disp%ptr, mol%ptr)
   vdisp = c_loc(disp)

end function new_d3_model_api