-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathprecice.f90
More file actions
382 lines (307 loc) · 16.8 KB
/
Copy pathprecice.f90
File metadata and controls
382 lines (307 loc) · 16.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
module precice
use, intrinsic :: iso_c_binding, only: c_char, c_int, c_double
implicit none
interface
subroutine precicef_create(participantName, configFileName, &
& solverProcessIndex, solverProcessSize, &
& participantNameLength, configFileNameLength) &
& bind(c, name='precicef_create_')
import :: c_int, c_char
character(kind=c_char), dimension(*), intent(in) :: participantName
character(kind=c_char), dimension(*), intent(in) :: configFileName
integer(kind=c_int), intent(in) :: solverProcessIndex
integer(kind=c_int), intent(in) :: solverProcessSize
integer(kind=c_int), value, intent(in) :: participantNameLength
integer(kind=c_int), value, intent(in) :: configFileNameLength
end subroutine precicef_create
subroutine precicef_create_with_communicator(participantName, configFileName, &
& solverProcessIndex, solverProcessSize, &
& communicator, &
& participantNameLength, configFileNameLength) &
& bind(c, name='precicef_create_with_communicator_')
import :: c_char, c_int
character(kind=c_char), dimension(*), intent(in) :: participantName
character(kind=c_char), dimension(*), intent(in) :: configFileName
integer(kind=c_int), intent(in) :: solverProcessIndex
integer(kind=c_int), intent(in) :: solverProcessSize
integer(kind=c_int), intent(in) :: communicator
integer(kind=c_int), value, intent(in) :: participantNameLength
integer(kind=c_int), value, intent(in) :: configFileNameLength
end subroutine precicef_create_with_communicator
subroutine precicef_initialize() &
& bind(c, name='precicef_initialize_')
end subroutine precicef_initialize
subroutine precicef_advance(timestepLengthLimit) &
& bind(c, name='precicef_advance_')
import :: c_double
real(kind=c_double), intent(in) :: timestepLengthLimit
end subroutine precicef_advance
subroutine precicef_finalize() &
& bind(c, name='precicef_finalize_')
end subroutine precicef_finalize
subroutine precicef_requires_reading_checkpoint(isRequired) &
& bind(c, name='precicef_requires_reading_checkpoint_')
import :: c_int
integer(kind=c_int), intent(out) :: isRequired
end subroutine precicef_requires_reading_checkpoint
subroutine precicef_requires_writing_checkpoint(isRequired) &
& bind(c, name='precicef_requires_writing_checkpoint_')
import :: c_int
integer(kind=c_int), intent(out) :: isRequired
end subroutine precicef_requires_writing_checkpoint
subroutine precicef_get_mesh_dimensions(meshName, dimensions, &
& meshNameLength) &
& bind(c, name='precicef_get_mesh_dimensions_')
import :: c_int, c_char
character(kind=c_char), dimension(*), intent(in) :: meshName
integer(kind=c_int), intent(out) :: dimensions
integer(kind=c_int), value, intent(in) :: meshNameLength
end subroutine precicef_get_mesh_dimensions
subroutine precicef_get_data_dimensions(meshName, dataName, &
& dimensions, meshNameLength, dataNameLength) &
& bind(c, name='precicef_get_data_dimensions_')
import :: c_int, c_char
character(kind=c_char), dimension(*), intent(in) :: meshName
character(kind=c_char), dimension(*), intent(in) :: dataName
integer(kind=c_int), intent(out) :: dimensions
integer(kind=c_int), value, intent(in) :: meshNameLength
integer(kind=c_int), value, intent(in) :: dataNameLength
end subroutine precicef_get_data_dimensions
subroutine precicef_is_coupling_ongoing(isOngoing) &
& bind(c, name='precicef_is_coupling_ongoing_')
import :: c_int
integer(kind=c_int), intent(out) :: isOngoing
end subroutine precicef_is_coupling_ongoing
subroutine precicef_is_time_window_complete(isComplete) &
& bind(c, name='precicef_is_time_window_complete_')
import :: c_int
integer(kind=c_int), intent(out) :: isComplete
end subroutine precicef_is_time_window_complete
subroutine precicef_get_max_time_step_size(maxTimeStepSize) &
& bind(c, name='precicef_get_max_time_step_size_')
import :: c_double
real(kind=c_double), intent(out) :: maxTimeStepSize
end subroutine precicef_get_max_time_step_size
subroutine precicef_requires_mesh_connectivity_for(meshName, required, meshNameLength) &
& bind(c, name='precicef_requires_mesh_connectivity_for_')
import :: c_int, c_char
character(kind=c_char), dimension(*), intent(in) :: meshName
integer(kind=c_int), intent(out) :: required
integer(kind=c_int), value, intent(in) :: meshNameLength
end subroutine precicef_requires_mesh_connectivity_for
subroutine precicef_set_mesh_vertex(meshName, coordinates, id, meshNameLength) &
& bind(c, name='precicef_set_mesh_vertex_')
import :: c_int, c_char, c_double
character(kind=c_char), dimension(*), intent(in) :: meshName
real(kind=c_double), intent(in) :: coordinates(3)
integer(kind=c_int), intent(out) :: id
integer(kind=c_int), value, intent(in) :: meshNameLength
end subroutine precicef_set_mesh_vertex
subroutine precicef_get_mesh_vertex_size(meshName, meshSize, meshNameLength) &
& bind(c, name='precicef_get_mesh_vertex_size_')
import :: c_int, c_char
character(kind=c_char), dimension(*), intent(in) :: meshName
integer(kind=c_int), intent(out) :: meshSize
integer(kind=c_int), value, intent(in) :: meshNameLength
end subroutine precicef_get_mesh_vertex_size
subroutine precicef_set_mesh_vertices(meshName, size, coordinates, ids, meshNameLength) &
& bind(c, name='precicef_set_mesh_vertices_')
import :: c_int, c_char, c_double
character(kind=c_char), dimension(*), intent(in) :: meshName
integer(kind=c_int), intent(in) :: size
real(kind=c_double), intent(in) :: coordinates(*)
integer(kind=c_int), intent(out) :: ids(*)
integer(kind=c_int), value, intent(in) :: meshNameLength
end subroutine precicef_set_mesh_vertices
subroutine precicef_set_mesh_edge(meshName, firstVertexID, secondVertexID, &
& meshNameLength) &
& bind(c, name='precicef_set_mesh_edge_')
import :: c_int, c_char
character(kind=c_char), dimension(*), intent(in) :: meshName
integer(kind=c_int), intent(in) :: firstVertexID
integer(kind=c_int), intent(in) :: secondVertexID
integer(kind=c_int), value, intent(in) :: meshNameLength
end subroutine precicef_set_mesh_edge
subroutine precicef_set_mesh_edges(meshName, size, ids, meshNameLength) &
& bind(c, name='precicef_set_mesh_edges_')
import :: c_int, c_char
character(kind=c_char), dimension(*), intent(in) :: meshName
integer(kind=c_int), intent(in) :: size
integer(kind=c_int), intent(in) :: ids(*)
integer(kind=c_int), value, intent(in) :: meshNameLength
end subroutine precicef_set_mesh_edges
subroutine precicef_set_mesh_triangle(meshName, firstEdgeID, secondEdgeID, &
& thirdEdgeID, meshNameLength) &
& bind(c, name='precicef_set_mesh_triangle_')
import :: c_int, c_char
character(kind=c_char), dimension(*), intent(in) :: meshName
integer(kind=c_int), intent(in) :: firstEdgeID
integer(kind=c_int), intent(in) :: secondEdgeID
integer(kind=c_int), intent(in) :: thirdEdgeID
integer(kind=c_int), value, intent(in) :: meshNameLength
end subroutine precicef_set_mesh_triangle
subroutine precicef_set_mesh_triangles(meshName, size, ids, meshNameLength) &
& bind(c, name='precicef_set_mesh_triangles_')
import :: c_int, c_char
character(kind=c_char), dimension(*), intent(in) :: meshName
integer(kind=c_int), intent(in) :: size
integer(kind=c_int), intent(in) :: ids(*)
integer(kind=c_int), value, intent(in) :: meshNameLength
end subroutine precicef_set_mesh_triangles
subroutine precicef_set_mesh_quad(meshName, firstVertexID, secondVertexID, &
& thirdVertexID, fourthVertexID, &
& meshNameLength ) &
& bind(c, name='precicef_set_mesh_quad_')
import :: c_int, c_char
character(kind=c_char), dimension(*), intent(in) :: meshName
integer(kind=c_int), intent(in) :: firstVertexID
integer(kind=c_int), intent(in) :: secondVertexID
integer(kind=c_int), intent(in) :: thirdVertexID
integer(kind=c_int), intent(in) :: fourthVertexID
integer(kind=c_int), value, intent(in) :: meshNameLength
end subroutine precicef_set_mesh_quad
subroutine precicef_set_mesh_quads(meshName, size, ids, meshNameLength) &
& bind(c, name='precicef_set_mesh_quads_')
import :: c_int, c_char
character(kind=c_char), dimension(*), intent(in) :: meshName
integer(kind=c_int), intent(in) :: size
integer(kind=c_int), intent(in) :: ids(*)
integer(kind=c_int), value, intent(in) :: meshNameLength
end subroutine precicef_set_mesh_quads
subroutine precicef_set_mesh_tetrahedron(meshName, firstVertexID, secondVertexID, &
& thirdVertexID, fourthVertexID, &
& meshNameLength) &
& bind(c, name='precicef_set_mesh_tetrahedron_')
import :: c_int, c_char
character(kind=c_char), dimension(*), intent(in) :: meshName
integer(kind=c_int), intent(in) :: firstVertexID
integer(kind=c_int), intent(in) :: secondVertexID
integer(kind=c_int), intent(in) :: thirdVertexID
integer(kind=c_int), intent(in) :: fourthVertexID
integer(kind=c_int), value, intent(in) :: meshNameLength
end subroutine precicef_set_mesh_tetrahedron
subroutine precicef_set_mesh_tetrahedra(meshName, size, ids, meshNameLength) &
& bind(c, name='precicef_set_mesh_tetrahedra_')
import :: c_int, c_char
character(kind=c_char), dimension(*), intent(in) :: meshName
integer(kind=c_int), intent(in) :: size
integer(kind=c_int), intent(in) :: ids(*)
integer(kind=c_int), value, intent(in) :: meshNameLength
end subroutine precicef_set_mesh_tetrahedra
subroutine precicef_requires_initial_data(isRequired) &
& bind(c, name='precicef_requires_initial_data_')
import :: c_int
integer(kind=c_int), intent(out) :: isRequired
end subroutine precicef_requires_initial_data
subroutine precicef_write_data(meshName, dataName, size, ids, &
& values, meshNameLength, dataNameLength) &
& bind(c, name='precicef_write_data_')
import :: c_int, c_char, c_double
character(kind=c_char), dimension(*), intent(in) :: meshName
character(kind=c_char), dimension(*), intent(in) :: dataName
integer(kind=c_int), intent(in) :: size
integer(kind=c_int), intent(in) :: ids(*)
real(kind=c_double), intent(in) :: values(*)
integer(kind=c_int), value, intent(in) :: meshNameLength
integer(kind=c_int), value, intent(in) :: dataNameLength
end subroutine precicef_write_data
subroutine precicef_read_data(meshName, dataName, size, ids, &
& relativeReadTime, values, meshNameLength, &
& dataNameLength) &
& bind(c, name='precicef_read_data_')
import :: c_int, c_char, c_double
character(kind=c_char), dimension(*), intent(in) :: meshName
character(kind=c_char), dimension(*), intent(in) :: dataName
integer(kind=c_int), intent(in) :: size
integer(kind=c_int), intent(in) :: ids(*)
real(kind=c_double), intent(in) :: relativeReadTime
real(kind=c_double), intent(out) :: values(*)
integer(kind=c_int), value, intent(in) :: meshNameLength
integer(kind=c_int), value, intent(in) :: dataNameLength
end subroutine precicef_read_data
subroutine precicef_write_and_map_data(meshName, dataName, size, coordinates, &
& values, meshNameLength, dataNameLength) &
& bind(c, name='precicef_write_and_map_data_')
import :: c_int, c_char, c_double
character(kind=c_char), dimension(*), intent(in) :: meshName
character(kind=c_char), dimension(*), intent(in) :: dataName
integer(kind=c_int), intent(in) :: size
real(kind=c_double), intent(in) :: coordinates(*)
real(kind=c_double), intent(in) :: values(*)
integer(kind=c_int), value, intent(in) :: meshNameLength
integer(kind=c_int), value, intent(in) :: dataNameLength
end subroutine precicef_write_and_map_data
subroutine precicef_map_and_read_data(meshName, dataName, size, coordinates, &
& relativeReadTime, values, meshNameLength, &
& dataNameLength) &
& bind(c, name='precicef_map_and_read_data_')
import :: c_int, c_char, c_double
character(kind=c_char), dimension(*), intent(in) :: meshName
character(kind=c_char), dimension(*), intent(in) :: dataName
integer(kind=c_int), intent(in) :: size
real(kind=c_double), intent(in) :: coordinates(*)
real(kind=c_double), intent(in) :: relativeReadTime
real(kind=c_double), intent(out) :: values(*)
integer(kind=c_int), value, intent(in) :: meshNameLength
integer(kind=c_int), value, intent(in) :: dataNameLength
end subroutine precicef_map_and_read_data
subroutine precicef_set_mesh_access_region(meshName, boundingBox, &
& meshNameLength) &
& bind(c, name='precicef_set_mesh_access_region_')
import :: c_int, c_char, c_double
character(kind=c_char), dimension(*), intent(in) :: meshName
real(kind=c_double), intent(in) :: boundingBox(*)
integer(kind=c_int), value, intent(in) :: meshNameLength
end subroutine precicef_set_mesh_access_region
subroutine precicef_get_mesh_vertex_ids_and_coordinates(meshName, size, &
& ids, coordinates, &
& meshNameLength) &
& bind(c, name='precicef_get_mesh_vertex_ids_and_coordinates_')
import :: c_int, c_char, c_double
character(kind=c_char), dimension(*), intent(in) :: meshName
integer(kind=c_int), intent(in) :: size
integer(kind=c_int), intent(out) :: ids(*)
real(kind=c_double), intent(out) :: coordinates(*)
integer(kind=c_int), value, intent(in) :: meshNameLength
end subroutine precicef_get_mesh_vertex_ids_and_coordinates
subroutine precicef_requires_gradient_data_for(meshName, dataName, &
& required, meshNameLength, &
& dataNameLength) &
& bind(c, name='precicef_requires_gradient_data_for_')
import :: c_int, c_char
character(kind=c_char), dimension(*), intent(in) :: meshName
character(kind=c_char), dimension(*), intent(in) :: dataName
integer(kind=c_int), intent(out) :: required
integer(kind=c_int), value, intent(in) :: meshNameLength
integer(kind=c_int), value, intent(in) :: dataNameLength
end subroutine precicef_requires_gradient_data_for
subroutine precicef_write_gradient_data(meshName, dataName, size, ids, &
& gradients, meshNameLength, &
& dataNameLength) &
& bind(c, name='precicef_write_gradient_data_')
import :: c_int, c_char, c_double
character(kind=c_char), dimension(*), intent(in) :: meshName
character(kind=c_char), dimension(*), intent(in) :: dataName
integer(kind=c_int), intent(in) :: size
integer(kind=c_int), intent(in) :: ids(*)
real(kind=c_double), intent(in) :: gradients(*)
integer(kind=c_int), value, intent(in) :: meshNameLength
integer(kind=c_int), value, intent(in) :: dataNameLength
end subroutine precicef_write_gradient_data
subroutine precicef_start_profiling_section(sectionName, sectionNameLength) &
& bind(c, name="precicef_start_profiling_section_")
import :: c_int, c_char
character(kind=c_char), dimension(*), intent(in) :: sectionName
integer(kind=c_int), value, intent(in) :: sectionNameLength
end subroutine precicef_start_profiling_section
subroutine precicef_stop_last_profiling_section() &
& bind(c, name="precicef_stop_last_profiling_section_")
end subroutine precicef_stop_last_profiling_section
subroutine precicef_get_version_information(versionInfo, lengthVersionInfo) &
& bind(c, name="precicef_get_version_information_")
import :: c_int, c_char
character(kind=c_char), dimension(*), intent(out) :: versionInfo
integer(kind=c_int), value, intent(in) :: lengthVersionInfo
end subroutine precicef_get_version_information
end interface
end module precice