new_cso_damping_api Function

public function new_cso_damping_api(verror, s6, s9, a1, a2, a3, a4, alp) result(vparam) bind(C, name=namespace//"new_cso_damping")

Create new CSO damping parameters

Arguments

Type IntentOptional Attributes Name
type(c_ptr), value :: verror
real(kind=c_double), intent(in), value :: s6
real(kind=c_double), intent(in), value :: s9
real(kind=c_double), intent(in), value :: a1
real(kind=c_double), intent(in), value :: a2
real(kind=c_double), intent(in), value :: a3
real(kind=c_double), intent(in), value :: a4
real(kind=c_double), intent(in), value :: alp

Return Value type(c_ptr)


Source Code

function new_cso_damping_api(verror, s6, s9, a1, a2, a3, a4, alp) &
      & result(vparam) &
      & bind(C, name=namespace//"new_cso_damping")
   type(c_ptr), value :: verror
   type(vp_error), pointer :: error
   real(c_double), value, intent(in) :: s6
   real(c_double), value, intent(in) :: s9
   real(c_double), value, intent(in) :: a1
   real(c_double), value, intent(in) :: a2
   real(c_double), value, intent(in) :: a3
   real(c_double), value, intent(in) :: a4
   real(c_double), value, intent(in) :: alp
   type(c_ptr) :: vparam
   type(cso_damping_param), allocatable :: tmp
   type(vp_param), pointer :: param

   vparam = c_null_ptr

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

   allocate(tmp)
   call new_cso_damping(tmp, d3_param(s6=s6, s9=s9, a1=a1, a2=a2, &
      & rs6=a3, rs8=a4, alp=alp))

   allocate(param)
   call move_alloc(tmp, param%ptr)
   vparam = c_loc(param)

end function new_cso_damping_api