Returns all the methods with the given class
(i.e., number of points in the formula).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | class |
the |
all the methods with the specified class
function get_all_methods_in_class(class) result(list_of_methods) implicit none integer,intent(in) :: class !! the `class` is the number of points in the !! finite different computation type(meth_array) :: list_of_methods !! all the methods with the specified `class` type(finite_diff_method) :: fd !! temp variable for getting a !! method from [[get_finite_difference_method]] integer :: id !! method id counter logical :: found !! status flag integer :: n !! temp size variable type(finite_diff_method),dimension(:),allocatable :: tmp !! for resizing `meth` array ! currently, the only way to do this is to call the ! get_finite_difference_method routine and see if there ! is one available. id = 0 do id = id + 1 call get_finite_difference_method(id,fd,found) if (found) then if (fd%class==class) then if (allocated(list_of_methods%meth)) then ! add to the list n = size(list_of_methods%meth) allocate(tmp(n+1)) tmp(1:n) = list_of_methods%meth tmp(n+1) = fd call move_alloc(tmp,list_of_methods%meth) ! ... this doesn't appear to work on Intel compiler ... !list_of_methods%meth = [list_of_methods%meth,fd] ! add to the list else ! first element: allocate(list_of_methods%meth(1)) list_of_methods%meth = fd end if elseif (fd%class>class) then ! we assume they are in increasing order exit end if else exit ! done end if end do end function get_all_methods_in_class