load_rational_damping_api Function

public function load_rational_damping_api(verror, charptr, atm) result(vparam) bind(C, name=namespace//"load_rational_damping")

Load rational damping parameters from internal storage

Arguments

Type IntentOptional Attributes Name
type(c_ptr), value :: verror
character(kind=c_char, len=1), intent(in) :: charptr(*)
logical(kind=c_bool), intent(in), value :: atm

Return Value type(c_ptr)


Source Code

function load_rational_damping_api(verror, charptr, atm) &
      & result(vparam) &
      & bind(C, name=namespace//"load_rational_damping")
   !DEC$ ATTRIBUTES DLLEXPORT :: load_rational_damping_api
   type(c_ptr), value :: verror
   type(vp_error), pointer :: error
   character(kind=c_char), intent(in) :: charptr(*)
   logical(c_bool), value, intent(in) :: atm
   character(len=:, kind=c_char), allocatable :: method
   type(c_ptr) :: vparam
   type(vp_param), pointer :: param
   real(wp), allocatable :: s9
   class(damping_param), allocatable :: tmp

   if (debug) print'("[Info]",1x, a)', "load_rational_damping"

   vparam = c_null_ptr

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

   call c_f_character(charptr, method)

   if (atm) s9 = 1.0_wp
   call get_rational_damping(method, tmp, s9)
   if (.not.allocated(tmp)) then
      call fatal_error(error%ptr, "Functional '"//method//"' not known")
      return
   end if

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

end function load_rational_damping_api