18 logical,
private,
parameter :: itm_amns_c_debug = .false.
25 type(c_ptr
),
intent(out) :: handle
31 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_SETUP: enter"
36 handle = c_loc(lhandle)
37 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_SETUP: return"
43 type(c_ptr
),
intent(out) :: handle
50 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_SETUP_VERSION: enter"
55 handle = c_loc(lhandle)
56 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_SETUP_VERSION: return"
62 type(c_ptr
),
intent(inout) :: handle
68 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_FINISH: enter"
69 call c_f_pointer(handle, lhandle)
73 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_FINISH: return"
79 type(c_ptr
),
intent(inout) :: handle_rx
85 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_FINISH_TABLE: enter"
86 call c_f_pointer(handle_rx, lhandle_rx)
88 deallocate(lhandle_rx)
89 handle_rx = c_null_ptr
90 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_FINISH_TABLE: return"
95 subroutine itm_amns_c_set(handle,set,error_status) bind(c,name="ITM_AMNS_C_SET")
96 type(c_ptr
),
intent(in), value :: handle
103 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_SET: enter"
104 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_SET: set%string ='"//set%string//
"'"
105 call c_f_pointer(handle, lhandle)
107 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_SET: return"
112 subroutine itm_amns_c_query(handle,query,answer,error_status) bind(c,name="ITM_AMNS_C_QUERY")
113 type(c_ptr
),
intent(in), value :: handle
121 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_QUERY: enter"
122 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_QUERY: query%string ='"//
query%string//
"'"
123 call c_f_pointer(handle, lhandle)
125 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_QUERY: answer%string ='"//
answer%string//
"'"
126 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_QUERY: answer%number =",
answer%number
127 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_QUERY: return"
132 subroutine itm_amns_c_setup_table(handle, reaction_type, reactant, handle_rx, error_status) bind(c, name="ITM_AMNS_C_SETUP_TABLE")
133 type(c_ptr
),
intent(in), value :: handle
135 type(c_ptr
),
intent(in), value :: reactant
136 type(c_ptr
),
intent(out) :: handle_rx
144 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_SETUP_TABLE: enter"
145 call c_f_pointer(handle, lhandle)
146 call c_f_pointer(reactant, lreactant)
149 handle_rx = c_loc(lhandle_rx)
150 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_SETUP_TABLE: return"
156 type(c_ptr
),
intent(in), value :: handle_rx
164 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_QUERY_TABLE: enter"
165 call c_f_pointer(handle_rx, lhandle_rx)
167 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_QUERY_TABLE: return"
173 type(c_ptr
),
intent(in), value :: handle_rx
180 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_SET_TABLE: enter"
181 call c_f_pointer(handle_rx, lhandle_rx)
183 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_SET_TABLE: return"
191 type(c_ptr
),
intent(in), value :: handle_rx
192 real (kind=R8),
intent(out) :: out
193 real (kind=R8),
intent(in), value :: arg1
198 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_RX_0_A: enter"
199 call c_f_pointer(handle_rx, lhandle_rx)
201 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_RX_0_A: return"
207 subroutine itm_amns_c_rx_0_b(handle_rx,out,arg1,arg2,error_status) bind(c,name="ITM_AMNS_C_RX_0_B")
208 type(c_ptr
),
intent(in), value :: handle_rx
209 real (kind=R8),
intent(out) :: out
210 real (kind=R8),
intent(in), value :: arg1,arg2
215 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_RX_0_B: enter"
216 call c_f_pointer(handle_rx, lhandle_rx)
218 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_RX_0_B: return"
224 subroutine itm_amns_c_rx_0_c(handle_rx,out,arg1,arg2,arg3,error_status) bind(c,name="ITM_AMNS_C_RX_0_C")
225 type(c_ptr
),
intent(in), value :: handle_rx
226 real (kind=R8),
intent(out) :: out
227 real (kind=R8),
intent(in), value :: arg1,arg2,arg3
232 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_RX_0_C: enter"
233 call c_f_pointer(handle_rx, lhandle_rx)
235 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_RX_0_C: return"
242 subroutine itm_amns_c_rx_1_a(handle_rx,nx,out,arg1,error_status) bind(c,name="ITM_AMNS_C_RX_1_A")
243 type(c_ptr
),
intent(in), value :: handle_rx
244 integer(c_int),
intent(in), value :: nx
245 real (c_double),
intent(out) :: out(0:nx-1)
246 real (c_double),
intent(in) :: arg1(0:nx-1)
252 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_RX_1_A: enter"
253 call c_f_pointer(handle_rx, lhandle_rx)
255 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_RX_1_A: return"
261 subroutine itm_amns_c_rx_1_b(handle_rx,nx,out,arg1,arg2,error_status) bind(c,name="ITM_AMNS_C_RX_1_B")
262 type(c_ptr
),
intent(in), value :: handle_rx
263 integer(c_int),
intent(in), value :: nx
264 real (c_double),
intent(out) :: out(0:nx-1)
265 real (c_double),
intent(in) :: arg1(0:nx-1), arg2(0:nx-1)
271 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_RX_1_B: enter"
272 call c_f_pointer(handle_rx, lhandle_rx)
274 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_RX_1_B: return"
280 subroutine itm_amns_c_rx_1_c(handle_rx,nx,out,arg1,arg2,arg3,error_status) bind(c,name="ITM_AMNS_C_RX_1_C")
281 type(c_ptr
),
intent(in), value :: handle_rx
282 integer(c_int),
intent(in), value :: nx
283 real (c_double),
intent(out) :: out(0:nx-1)
284 real (c_double),
intent(in) :: arg1(0:nx-1), arg2(0:nx-1), arg3(0:nx-1)
290 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_RX_1_C: enter"
291 call c_f_pointer(handle_rx, lhandle_rx)
293 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_RX_1_C: return"
300 subroutine itm_amns_c_rx_2_a(handle_rx,nx,ny,out,arg1,error_status) bind(c,name="ITM_AMNS_C_RX_2_A")
301 type(c_ptr
),
intent(in), value :: handle_rx
302 integer(c_int),
intent(in), value :: nx, ny
303 real (c_double),
intent(out) :: out(0:nx-1,0:ny-1)
304 real (c_double),
intent(in) :: arg1(0:nx-1,0:ny-1)
310 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_RX_2_A: enter"
311 call c_f_pointer(handle_rx, lhandle_rx)
313 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_RX_2_A: return"
319 subroutine itm_amns_c_rx_2_b(handle_rx,nx,ny,out,arg1,arg2,error_status) bind(c,name="ITM_AMNS_C_RX_2_B")
320 type(c_ptr
),
intent(in), value :: handle_rx
321 integer(c_int),
intent(in), value :: nx, ny
322 real (c_double),
intent(out) :: out(0:nx-1,0:ny-1)
323 real (c_double),
intent(in) :: arg1(0:nx-1,0:ny-1), arg2(0:nx-1,0:ny-1)
329 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_RX_2_B: enter"
330 call c_f_pointer(handle_rx, lhandle_rx)
332 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_RX_2_B: return"
338 subroutine itm_amns_c_rx_2_c(handle_rx,nx,ny,out,arg1,arg2,arg3,error_status) bind(c,name="ITM_AMNS_C_RX_2_C")
339 type(c_ptr
),
intent(in), value :: handle_rx
340 integer(c_int),
intent(in), value :: nx, ny
341 real (c_double),
intent(out) :: out(0:nx-1,0:ny-1)
342 real (c_double),
intent(in) :: arg1(0:nx-1,0:ny-1), arg2(0:nx-1,0:ny-1), arg3(0:nx-1,0:ny-1)
348 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_RX_2_C: enter"
349 call c_f_pointer(handle_rx, lhandle_rx)
351 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_RX_2_C: return"
358 subroutine itm_amns_c_rx_3_a(handle_rx,nx,ny,nz,out,arg1,error_status) bind(c,name="ITM_AMNS_C_RX_3_A")
359 type(c_ptr
),
intent(in), value :: handle_rx
360 integer(c_int),
intent(in), value :: nx, ny, nz
361 real (c_double),
intent(out) :: out(0:nx-1,0:ny-1,0:nz-1)
362 real (c_double),
intent(in) :: arg1(0:nx-1,0:ny-1,0:nz-1)
368 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_RX_3_A: enter"
369 call c_f_pointer(handle_rx, lhandle_rx)
371 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_RX_3_A: return"
377 subroutine itm_amns_c_rx_3_b(handle_rx,nx,ny,nz,out,arg1,arg2,error_status) bind(c,name="ITM_AMNS_C_RX_3_B")
378 type(c_ptr
),
intent(in), value :: handle_rx
379 integer(c_int),
intent(in), value :: nx, ny, nz
380 real (c_double),
intent(out) :: out(0:nx-1,0:ny-1,0:nz-1)
381 real (c_double),
intent(in) :: arg1(0:nx-1,0:ny-1,0:nz-1), arg2(0:nx-1,0:ny-1,0:nz-1)
387 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_RX_3_B: enter"
388 call c_f_pointer(handle_rx, lhandle_rx)
390 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_RX_3_B: return"
396 subroutine itm_amns_c_rx_3_c(handle_rx,nx,ny,nz,out,arg1,arg2,arg3,error_status) bind(c,name="ITM_AMNS_C_RX_3_C")
397 type(c_ptr
),
intent(in), value :: handle_rx
398 integer(c_int),
intent(in), value :: nx, ny, nz
399 real (c_double),
intent(out) :: out(0:nx-1,0:ny-1,0:nz-1)
400 real (c_double),
intent(in) :: arg1(0:nx-1,0:ny-1,0:nz-1), arg2(0:nx-1,0:ny-1,0:nz-1), arg3(0:nx-1,0:ny-1,0:nz-1)
406 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_RX_3_C: enter"
407 call c_f_pointer(handle_rx, lhandle_rx)
409 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_RX_3_C: return"
417 type(c_ptr
),
intent(out) :: reactants_handle
418 character(kind=c_char),
intent(in) :: string(*)
419 integer(c_int),
intent(in), value :: index, n_reactants
425 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_SETUP_REACTANTS: enter, string"
427 allocate(lreactants%components(n_reactants))
428 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_SETUP_REACTANTS: ", lreactants%string
430 allocate(lreactants%string(1))
431 lreactants%string(1) =
''
432 do i=1,
len(lreactants%string(1))
433 if(string(
i) .EQ. c_null_char)
exit
434 lreactants%string(1)(
i:
i) = string(
i)
436 lreactants%index = index
438 reactants_handle = c_loc(lreactants)
439 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_SETUP_REACTANTS: return"
446 type(c_ptr
),
intent(in), value :: reactants_handle
447 integer(c_int),
intent(in), value :: reactant_index
453 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_SET_REACTANT: enter"
454 call c_f_pointer(reactants_handle, lreactants)
455 lreactants%components(reactant_index) = reactant
456 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_SET_REACTANT: return"
463 type(c_ptr
),
intent(in), value :: reactants_handle
464 integer(c_int),
intent(in), value :: reactant_index
470 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_GET_REACTANT: enter"
471 call c_f_pointer(reactants_handle, lreactants)
472 reactant = lreactants%components(reactant_index)
473 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_GET_REACTANT: return"
481 type(c_ptr
),
intent(inout) :: reactants_handle
486 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_FINISH_REACTANTS: enter"
487 call c_f_pointer(reactants_handle, lreactants)
488 deallocate(lreactants%components)
489 deallocate(lreactants)
490 reactants_handle = c_null_ptr
491 if (itm_amns_c_debug)
write (*,*)
"ITM_AMNS_C_FINISH_REACTANTS: return"
subroutine itm_amns_rx_2(handle_rx, out, arg1, arg2, arg3, error_status)
get the rates associated with the input (2d) args for a particular reaction
subroutine itm_amns_query_table(handle_rx, query, answer, error_status)
query routine for a particular reaction
Type for specifying the AMNS version ("interoperable" version)
subroutine itm_amns_c_rx_3_b(handle_rx, nx, ny, nz, out, arg1, arg2, error_status)
get the rates associated with the input (3d) args for a particular reaction Expanded into three separ...
subroutine itm_amns_c_query_table(handle_rx, query, answer, error_status)
provides ITM_AMNS_C_QUERY_TABLE by calling ITM_AMNS_QUERY_TABLE
subroutine itm_amns_c_rx_0_c(handle_rx, out, arg1, arg2, arg3, error_status)
get the rates associated with the input (0d) args for a particular reaction Expanded into three separ...
subroutine itm_amns_c_rx_1_c(handle_rx, nx, out, arg1, arg2, arg3, error_status)
get the rates associated with the input (1d) args for a particular reaction Expanded into three separ...
subroutine itm_amns_c_rx_2_a(handle_rx, nx, ny, out, arg1, error_status)
get the rates associated with the input (2d) args for a particular reaction Expanded into three separ...
subroutine itm_amns_c_setup_version(handle, version, error_status)
provides ITM_AMNS_C_SETUP by calling ITM_AMNS_SETUP with version argument
subroutine itm_amns_c_rx_0_a(handle_rx, out, arg1, error_status)
get the rates associated with the input (0d) args for a particular reaction Expanded into three separ...
subroutine itm_amns_c_rx_1_b(handle_rx, nx, out, arg1, arg2, error_status)
get the rates associated with the input (1d) args for a particular reaction Expanded into three separ...
subroutine itm_amns_c_finish(handle, error_status)
provides ITM_AMNS_C_FINISH by calling ITM_AMNS_FINISH
subroutine itm_amns_c_set(handle, set, error_status)
provides ITM_AMNS_C_SET by calling ITM_AMNS_SET
type for the AMNS handle (opaque for user codes) NOT interoperable with C.
Type for answers from queries in the AMNS package ("interoperable" version)
Type for error returns from the AMNS interface ("interoperable" version)
subroutine itm_amns_rx_0(handle_rx, out, arg1, arg2, arg3, error_status)
get the rates associated with the input (0d) args for a particular reaction
subroutine itm_amns_c_set_table(handle_rx, set, error_status)
provides ITM_AMNS_C_SET_TABLE by calling ITM_AMNS_SET_TABLE
subroutine itm_amns_c_set_reactant(reactants_handle, reactant_index, reactant)
Additional helper routines not contained in amns_module, but required for using the type amns_reactan...
subroutine itm_amns_c_rx_0_b(handle_rx, out, arg1, arg2, error_status)
get the rates associated with the input (0d) args for a particular reaction Expanded into three separ...
subroutine itm_amns_setup(handle, version, error_status)
initialization call for the AMNS package
subroutine itm_amns_finish(handle, error_status)
finalization call for the AMNS package
subroutine itm_amns_rx_3(handle_rx, out, arg1, arg2, arg3, error_status)
get the rates associated with the input (3d) args for a particular reaction
subroutine itm_amns_rx_1(handle_rx, out, arg1, arg2, arg3, error_status)
get the rates associated with the input (1d) args for a particular reaction
subroutine itm_amns_setup_table(handle, reaction_type, reactants, handle_rx, error_status)
initialization call for a particular reaction
subroutine itm_amns_c_rx_3_c(handle_rx, nx, ny, nz, out, arg1, arg2, arg3, error_status)
get the rates associated with the input (3d) args for a particular reaction Expanded into three separ...
subroutine itm_amns_c_setup_table(handle, reaction_type, reactant, handle_rx, error_status)
provides ITM_AMNS_C_SETUP_TABLE by calling ITM_AMNS_SETUP_TABLE
subroutine itm_amns_c_rx_3_a(handle_rx, nx, ny, nz, out, arg1, error_status)
get the rates associated with the input (3d) args for a particular reaction Expanded into three separ...
subroutine itm_amns_c_rx_2_b(handle_rx, nx, ny, out, arg1, arg2, error_status)
get the rates associated with the input (2d) args for a particular reaction Expanded into three separ...
Type used for specifying reactions when using the AMNS interface ("interoperable" version) ...
Type for the AMNS RX handle (opaque for user codes) NOT interoperable with C.
subroutine itm_amns_set(handle, set, error_status)
set a parameter for the AMNS package
subroutine itm_amns_set_table(handle_rx, set, error_status)
set a parameter for a particular reaction
Type for querying parameters in the AMNS package ("interoperable" version)
Type for indicating a single reactant or product when using the AMNS interface.
subroutine itm_amns_c_finish_table(handle_rx, error_status)
provides ITM_AMNS_C_FINISH_TABLE by calling ITM_AMNS_FINISH_TABLE
Type for setting parameters in the AMNS package ("interoperable" version)
subroutine itm_amns_c_rx_1_a(handle_rx, nx, out, arg1, error_status)
get the rates associated with the input (1d) args for a particular reaction Expanded into three separ...
subroutine itm_amns_finish_table(handle_rx, error_status)
finalization call for a particular reaction
if error_status & error_status
subroutine itm_amns_c_get_reactant(reactants_handle, reactant_index, reactant)
Additional helper routines not contained in amns_module, but required for using the type amns_reactan...
subroutine itm_amns_c_setup(handle, error_status)
provides ITM_AMNS_C_SETUP by calling ITM_AMNS_SETUP
if error_status len(self._reactants))
subroutine itm_amns_c_query(handle, query, answer, error_status)
provides ITM_AMNS_C_QUERY by calling ITM_AMNS_QUERY
Type for indicating the reactants when using the AMNS interface NOT interoperable with C...
subroutine itm_amns_c_setup_reactants(reactants_handle, string, index, n_reactants)
Additional helper routines not contained in amns_module, but required for using the type amns_reactan...
subroutine itm_amns_query(handle, query, answer, error_status)
query routine for the AMNS package
The derived types defined here are meant to be interoperable with C. The ones for this is not the cas...
subroutine itm_amns_c_rx_2_c(handle_rx, nx, ny, out, arg1, arg2, arg3, error_status)
get the rates associated with the input (2d) args for a particular reaction Expanded into three separ...
subroutine itm_amns_c_finish_reactants(reactants_handle)
Additional helper routines not contained in amns_module, but required for using the type amns_reactan...