OpenFAST
Wind turbine multiphysics simulator
Data Types | Functions/Subroutines
integerlist Module Reference

Module providing suport for an integer list stored as an array and not a chained list Used since registry does not support pointer with recursive types. More...

Data Types

interface  find
 
interface  init_list
 
interface  pop
 
interface  unique
 

Functions/Subroutines

subroutine concatenate_lists (I1, I2, I3, ErrStat, ErrMsg)
 Concatenate lists: I3=[I1,I2]. More...
 
subroutine concatenate_3lists (I1, I2, I3, I4, ErrStat, ErrMsg)
 
subroutine lists_difference (I1, I2, I3, ErrStat, ErrMsg)
 Set difference: I3=I1-I2 (assumes I1 is biggger than I2), elements of I1 not in I2. More...
 
subroutine init_list_n_def (L, n, default_val, ErrStat, ErrMsg)
 Initialize an integer list. More...
 
subroutine init_list_vect (L, vect, ErrStat, ErrMsg)
 
subroutine, public destroy_list (L, ErrStat, ErrMsg)
 Deallocate list. More...
 
integer function, public len (L)
 Returns list length.
 
subroutine, public append (L, e, ErrStat, ErrMsg)
 Append element to list. More...
 
integer function, public get (L, i, ErrStat, ErrMsg)
 Get element i from list. More...
 
integer function pop_last (L, ErrStat, ErrMsg)
 Pop last element of the list and reduce list size by 1. More...
 
integer function pop_item (L, i, ErrStat, ErrMsg)
 Pop element i from the list and reduce the size of the list by 1. More...
 
subroutine, public sort (L, ErrStat, ErrMsg)
 Sort list. More...
 
subroutine, public reverse (L, ErrStat, ErrMsg)
 Reverse list. More...
 
integer(intki) function find_list (L, e, ErrStat, ErrMsg)
 Returns index of element e in L, returns 0 if not found NOTE: list but be sorted to call this function. More...
 
subroutine unique_list (L, ErrStat, ErrMsg)
 Unique, in place. More...
 
subroutine print_list (L, varname, u_opt)
 Print.
 
pure subroutine sort_in_place (a)
 Sort integer array in place.
 
integer(intki) function binary_search (x, x0)
 Performs binary search and return the largest index such that x(i) <= x0 allows equlity. More...
 
integer(intki) function find_intarray (Array, Val)
 Returns index of val in Array (val is an integer!) More...
 
subroutine unique_intarray (v, res)
 return in res the unique values of v
 
subroutine unique_intarray_in_place (v)
 
subroutine resize_array (array, nNewSize, default_val)
 Resize integer array of dimension 1.
 
subroutine append_arrays (array1, n1, array2, n2)
 Append two integer arrays of dimension 1. More...
 

Detailed Description

Module providing suport for an integer list stored as an array and not a chained list Used since registry does not support pointer with recursive types.

Function/Subroutine Documentation

◆ append()

subroutine, public integerlist::append ( type(ilist), intent(inout)  L,
integer(intki), intent(in)  e,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

Append element to list.

Parameters
[out]errstatError status of the operation
[out]errmsgError message if ErrStat / = ErrID_None

◆ append_arrays()

subroutine integerlist::append_arrays ( integer(intki), dimension(:), allocatable  array1,
integer(intki), intent(inout)  n1,
integer(intki), dimension(:)  array2,
integer(intki), intent(in)  n2 
)

Append two integer arrays of dimension 1.

Parameters
[in,out]n1SIDE EFFECTS

◆ binary_search()

integer(intki) function integerlist::binary_search ( integer(intki), dimension(:), intent(in)  x,
integer(intki), intent(in)  x0 
)

Performs binary search and return the largest index such that x(i) <= x0 allows equlity.

Parameters
[in]xx sorted vector

◆ concatenate_3lists()

subroutine integerlist::concatenate_3lists ( integer(intki), dimension(:), intent(in)  I1,
integer(intki), dimension(:), intent(in)  I2,
integer(intki), dimension(:), intent(in)  I3,
integer(intki), dimension(:), intent(out)  I4,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
Parameters
[out]errstatError status of the operation
[out]errmsgError message if ErrStat / = ErrID_None

◆ concatenate_lists()

subroutine integerlist::concatenate_lists ( integer(intki), dimension(:), intent(in)  I1,
integer(intki), dimension(:), intent(in)  I2,
integer(intki), dimension(:), intent(out)  I3,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

Concatenate lists: I3=[I1,I2].

Parameters
[out]errstatError status of the operation
[out]errmsgError message if ErrStat / = ErrID_None

◆ destroy_list()

subroutine, public integerlist::destroy_list ( type(ilist), intent(inout)  L,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

Deallocate list.

Parameters
[in,out]lList
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ find_intarray()

integer(intki) function integerlist::find_intarray ( integer(intki), dimension(:), intent(in)  Array,
integer(intki), intent(in)  Val 
)

Returns index of val in Array (val is an integer!)

Parameters
[in]arrayArray to search in
Returns
Index of joint in joint table

◆ find_list()

integer(intki) function integerlist::find_list ( type(ilist), intent(inout)  L,
integer(intki), intent(in)  e,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

Returns index of element e in L, returns 0 if not found NOTE: list but be sorted to call this function.

Parameters
[out]errstatError status of the operation
[out]errmsgError message if ErrStat / = ErrID_None

◆ get()

integer function, public integerlist::get ( type(ilist), intent(inout)  L,
integer(intki), intent(in)  i,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

Get element i from list.

Parameters
[out]errstatError status of the operation
[out]errmsgError message if ErrStat / = ErrID_None

◆ init_list_n_def()

subroutine integerlist::init_list_n_def ( type(ilist), intent(inout)  L,
integer(intki), intent(in)  n,
integer(intki), intent(in)  default_val,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

Initialize an integer list.

Parameters
[in,out]lList
[in]nnumber of initial values
[in]default_valdefault values
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ init_list_vect()

subroutine integerlist::init_list_vect ( type(ilist), intent(inout)  L,
integer(intki), dimension(:), intent(in)  vect,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
Parameters
[in,out]lList
[in]vectnumber of initial values
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ lists_difference()

subroutine integerlist::lists_difference ( integer(intki), dimension(:), intent(in)  I1,
integer(intki), dimension(:), intent(in)  I2,
integer(intki), dimension(:), intent(out)  I3,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

Set difference: I3=I1-I2 (assumes I1 is biggger than I2), elements of I1 not in I2.

Parameters
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ pop_item()

integer function integerlist::pop_item ( type(ilist), intent(inout)  L,
integer(intki), intent(in)  i,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

Pop element i from the list and reduce the size of the list by 1.

Parameters
[out]errstatError status of the operation
[out]errmsgError message if ErrStat / = ErrID_None

◆ pop_last()

integer function integerlist::pop_last ( type(ilist), intent(inout)  L,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

Pop last element of the list and reduce list size by 1.

Parameters
[out]errstatError status of the operation
[out]errmsgError message if ErrStat / = ErrID_None

◆ reverse()

subroutine, public integerlist::reverse ( type(ilist), intent(inout)  L,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

Reverse list.

Parameters
[out]errstatError status of the operation
[out]errmsgError message if ErrStat / = ErrID_None

◆ sort()

subroutine, public integerlist::sort ( type(ilist), intent(inout)  L,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

Sort list.

Parameters
[out]errstatError status of the operation
[out]errmsgError message if ErrStat / = ErrID_None

◆ unique_list()

subroutine integerlist::unique_list ( type(ilist), intent(inout)  L,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

Unique, in place.

Parameters
[out]errstatError status of the operation
[out]errmsgError message if ErrStat / = ErrID_None