Simulation Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

174 lines
8.3 KiB

  1. ! BSD 2-Clause License
  2. !
  3. ! Copyright (c) 2021-2022, Hewlett Packard Enterprise
  4. ! All rights reserved.
  5. !
  6. ! Redistribution and use in source and binary forms, with or without
  7. ! modification, are permitted provided that the following conditions are met:
  8. !
  9. ! 1. Redistributions of source code must retain the above copyright notice, this
  10. ! list of conditions and the following disclaimer.
  11. !
  12. ! 2. Redistributions in binary form must reproduce the above copyright notice,
  13. ! this list of conditions and the following disclaimer in the documentation
  14. ! and/or other materials provided with the distribution.
  15. !
  16. ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  17. ! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  18. ! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. ! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  20. ! FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  21. ! DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  22. ! SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  23. ! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  24. ! OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  25. ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. interface
  27. function use_list_ensemble_prefix_c(c_client, use_prefix) bind(c, name="use_list_ensemble_prefix")
  28. use iso_c_binding, only : c_ptr, c_bool
  29. import :: enum_kind
  30. integer(kind=enum_kind) :: use_list_ensemble_prefix_c
  31. type(c_ptr), value :: c_client !< Pointer to the initialize C client
  32. logical(kind=c_bool), value :: use_prefix !< If true, prefix aggregation with the ensemble prefix
  33. end function use_list_ensemble_prefix_c
  34. end interface
  35. interface
  36. function append_to_list_c(c_client, list_name, list_name_length, dataset) bind(c, name="append_to_list")
  37. use iso_c_binding, only : c_ptr, c_char, c_size_t
  38. import :: enum_kind
  39. integer(kind=enum_kind) :: append_to_list_c
  40. type(c_ptr), value :: c_client !< Pointer to the initialize C client
  41. character(kind=c_char) :: list_name(*) !< Name of list to append to
  42. integer(kind=c_size_t), value :: list_name_length !< Number of characters in list name
  43. type(c_ptr), value :: dataset !< The dataset to append
  44. end function append_to_list_c
  45. end interface
  46. interface
  47. function delete_list_c(c_client, list_name, list_name_length) bind(c, name="delete_list")
  48. use iso_c_binding, only : c_ptr, c_char, c_size_t
  49. import :: enum_kind
  50. integer(kind=enum_kind) :: delete_list_c
  51. type(c_ptr), value :: c_client !< Pointer to the initialize C client
  52. character(kind=c_char) :: list_name(*) !< Name of list to append to
  53. integer(kind=c_size_t), value :: list_name_length !< Number of characters in list name
  54. end function delete_list_c
  55. end interface
  56. interface
  57. function copy_list_c(c_client, src_name, src_name_length, dest_name, dest_name_length) bind(c, name="copy_list")
  58. use iso_c_binding, only : c_ptr, c_char, c_size_t
  59. import :: enum_kind
  60. integer(kind=enum_kind) :: copy_list_c
  61. type(c_ptr), value :: c_client !< Pointer to the initialize C client
  62. character(kind=c_char) :: src_name(*) !< Name of list to copy from
  63. integer(kind=c_size_t), value :: src_name_length !< Number of characters in source list name
  64. character(kind=c_char) :: dest_name(*) !< Name of list to copy to
  65. integer(kind=c_size_t), value :: dest_name_length !< Number of characters in destination list name
  66. end function copy_list_c
  67. end interface
  68. interface
  69. function rename_list_c(c_client, src_name, src_name_length, dest_name, dest_name_length) bind(c, name="rename_list")
  70. use iso_c_binding, only : c_ptr, c_char, c_size_t
  71. import :: enum_kind
  72. integer(kind=enum_kind) :: rename_list_c
  73. type(c_ptr), value :: c_client !< Pointer to the initialize C client
  74. character(kind=c_char) :: src_name(*) !< Name of list to rename from
  75. integer(kind=c_size_t), value :: src_name_length !< Number of characters in source list name
  76. character(kind=c_char) :: dest_name(*) !< Name of list to rename to
  77. integer(kind=c_size_t), value :: dest_name_length !< Number of characters in destination list name
  78. end function rename_list_c
  79. end interface
  80. interface
  81. function get_list_length_c(c_client, list_name, list_name_length, result_length) bind(c, name="get_list_length")
  82. use iso_c_binding, only : c_ptr, c_char, c_size_t, c_int
  83. import :: enum_kind
  84. integer(kind=enum_kind) :: get_list_length_c
  85. type(c_ptr), value :: c_client !< Pointer to the initialize C client
  86. character(kind=c_char) :: list_name(*) !< Name of list to append to
  87. integer(kind=c_size_t), value :: list_name_length !< Number of characters in list name
  88. integer(kind=c_int) :: result_length !< The length of the list
  89. end function get_list_length_c
  90. end interface
  91. interface
  92. function poll_list_length_c(client, name, name_length, list_length, poll_frequency_ms, num_tries, exists) &
  93. bind(c, name="poll_list_length")
  94. use iso_c_binding, only : c_ptr, c_char, c_bool, c_size_t, c_int
  95. import :: enum_kind
  96. integer(kind=enum_kind) :: poll_list_length_c
  97. type(c_ptr), value :: client
  98. character(kind=c_char) :: name(*)
  99. integer(kind=c_size_t), value :: name_length
  100. integer(kind=c_int), value :: list_length
  101. integer(kind=c_int), value :: poll_frequency_ms
  102. integer(kind=c_int), value :: num_tries
  103. logical(kind=c_bool) :: exists
  104. end function poll_list_length_c
  105. end interface
  106. interface
  107. function poll_list_length_gte_c(client, name, name_length, list_length, poll_frequency_ms, num_tries, exists) &
  108. bind(c, name="poll_list_length_gte")
  109. use iso_c_binding, only : c_ptr, c_char, c_bool, c_size_t, c_int
  110. import :: enum_kind
  111. integer(kind=enum_kind) :: poll_list_length_gte_c
  112. type(c_ptr), value :: client
  113. character(kind=c_char) :: name(*)
  114. integer(kind=c_size_t), value :: name_length
  115. integer(kind=c_int), value :: list_length
  116. integer(kind=c_int), value :: poll_frequency_ms
  117. integer(kind=c_int), value :: num_tries
  118. logical(kind=c_bool) :: exists
  119. end function poll_list_length_gte_c
  120. end interface
  121. interface
  122. function poll_list_length_lte_c(client, name, name_length, list_length, poll_frequency_ms, num_tries, exists) &
  123. bind(c, name="poll_list_length_lte")
  124. use iso_c_binding, only : c_ptr, c_char, c_bool, c_size_t, c_int
  125. import :: enum_kind
  126. integer(kind=enum_kind) :: poll_list_length_lte_c
  127. type(c_ptr), value :: client
  128. character(kind=c_char) :: name(*)
  129. integer(kind=c_size_t), value :: name_length
  130. integer(kind=c_int), value :: list_length
  131. integer(kind=c_int), value :: poll_frequency_ms
  132. integer(kind=c_int), value :: num_tries
  133. logical(kind=c_bool) :: exists
  134. end function poll_list_length_lte_c
  135. end interface
  136. interface
  137. function get_datasets_from_list_c(client, list_name, list_name_length, datasets, num_datasets) &
  138. bind(c, name="get_datasets_from_list")
  139. use iso_c_binding, only : c_ptr, c_char, c_bool, c_size_t, c_int
  140. import :: enum_kind
  141. integer(kind=enum_kind) :: get_datasets_from_list_c
  142. type(c_ptr), value :: client
  143. character(kind=c_char) :: list_name(*)
  144. integer(kind=c_size_t), value :: list_name_length
  145. type(c_ptr), dimension(:) :: datasets
  146. integer(kind=c_size_t) :: num_datasets
  147. end function get_datasets_from_list_c
  148. end interface
  149. interface
  150. function get_dataset_list_range_allocated_c(client, list_name, list_name_length, start_index, end_index, &
  151. datasets) bind(c, name="_get_dataset_list_range_allocated")
  152. use iso_c_binding, only : c_ptr, c_char, c_bool, c_size_t, c_int
  153. import :: enum_kind
  154. integer(kind=enum_kind) :: get_dataset_list_range_c
  155. type(c_ptr), value :: client
  156. character(kind=c_char) :: list_name(*)
  157. integer(kind=c_size_t), value :: list_name_length
  158. integer(kind=c_int), value :: start_index
  159. integer(kind=c_int), value :: end_index
  160. type(c_ptr), value :: datasets
  161. end function get_dataset_list_range_allocated_c
  162. end interface