kim-api  2.1.4-git+v2.1.3-git-3-g4c859c7f.GNU
An Application Programming Interface (API) for the Knowledgebase of Interatomic Models (KIM).
kim_model_create_module.f90
Go to the documentation of this file.
1 !
2 ! CDDL HEADER START
3 !
4 ! The contents of this file are subject to the terms of the Common Development
5 ! and Distribution License Version 1.0 (the "License").
6 !
7 ! You can obtain a copy of the license at
8 ! http://www.opensource.org/licenses/CDDL-1.0. See the License for the
9 ! specific language governing permissions and limitations under the License.
10 !
11 ! When distributing Covered Code, include this CDDL HEADER in each file and
12 ! include the License file in a prominent location with the name LICENSE.CDDL.
13 ! If applicable, add the following below this CDDL HEADER, with the fields
14 ! enclosed by brackets "[]" replaced with your own identifying information:
15 !
16 ! Portions Copyright (c) [yyyy] [name of copyright owner]. All rights reserved.
17 !
18 ! CDDL HEADER END
19 !
20 
21 !
22 ! Copyright (c) 2016--2019, Regents of the University of Minnesota.
23 ! All rights reserved.
24 !
25 ! Contributors:
26 ! Ryan S. Elliott
27 !
28 
29 !
30 ! Release: This file is part of the kim-api.git repository.
31 !
32 
33 
40  use, intrinsic :: iso_c_binding
41  implicit none
42  private
43 
44  public &
45  ! Derived types
46  kim_model_create_handle_type, &
47 
48  ! Constants
50 
51  ! Routines
52  operator (.eq.), &
53  operator (.ne.), &
54  kim_set_model_numbering, &
55  kim_set_influence_distance_pointer, &
56  kim_set_neighbor_list_pointers, &
57  kim_set_routine_pointer, &
58  kim_set_species_code, &
59  kim_set_parameter_pointer, &
60  kim_set_model_buffer_pointer, &
61  kim_set_units, &
62  kim_convert_unit, &
63  kim_log_entry, &
64  kim_to_string
65 
66 
72  type, bind(c) :: kim_model_create_handle_type
73  type(c_ptr) :: p = c_null_ptr
74  end type kim_model_create_handle_type
75 
79  type(kim_model_create_handle_type), protected, save &
81 
85  interface operator (.eq.)
86  module procedure kim_model_create_handle_equal
87  end interface operator (.eq.)
88 
92  interface operator (.ne.)
93  module procedure kim_model_create_handle_not_equal
94  end interface operator (.ne.)
95 
101  interface kim_set_model_numbering
102  module procedure kim_model_create_set_model_numbering
103  end interface kim_set_model_numbering
104 
111  interface kim_set_influence_distance_pointer
113  end interface kim_set_influence_distance_pointer
114 
121  interface kim_set_neighbor_list_pointers
123  end interface kim_set_neighbor_list_pointers
124 
130  interface kim_set_routine_pointer
131  module procedure kim_model_create_set_routine_pointer
132  end interface kim_set_routine_pointer
133 
139  interface kim_set_species_code
140  module procedure kim_model_create_set_species_code
141  end interface kim_set_species_code
142 
150  interface kim_set_parameter_pointer
153  end interface kim_set_parameter_pointer
154 
161  interface kim_set_model_buffer_pointer
163  end interface kim_set_model_buffer_pointer
164 
170  interface kim_set_units
171  module procedure kim_model_create_set_units
172  end interface kim_set_units
173 
179  interface kim_convert_unit
180  module procedure kim_model_create_convert_unit
181  end interface kim_convert_unit
182 
188  interface kim_log_entry
189  module procedure kim_model_create_log_entry
190  end interface kim_log_entry
191 
197  interface kim_to_string
198  module procedure kim_model_create_to_string
199  end interface kim_to_string
200 
201 contains
205  logical recursive function kim_model_create_handle_equal(lhs, rhs)
206  implicit none
207  type(kim_model_create_handle_type), intent(in) :: lhs
208  type(kim_model_create_handle_type), intent(in) :: rhs
209 
210  if ((.not. c_associated(lhs%p)) .and. (.not. c_associated(rhs%p))) then
211  kim_model_create_handle_equal = .true.
212  else
213  kim_model_create_handle_equal = c_associated(lhs%p, rhs%p)
214  end if
215  end function kim_model_create_handle_equal
216 
220  logical recursive function kim_model_create_handle_not_equal(lhs, rhs)
221  implicit none
222  type(kim_model_create_handle_type), intent(in) :: lhs
223  type(kim_model_create_handle_type), intent(in) :: rhs
224 
225  kim_model_create_handle_not_equal = .not. (lhs .eq. rhs)
226  end function kim_model_create_handle_not_equal
227 
233  recursive subroutine kim_model_create_set_model_numbering( &
234  model_create_handle, numbering, ierr)
235  use kim_numbering_module, only : kim_numbering_type
236  use kim_interoperable_types_module, only : kim_model_create_type
237  implicit none
238  interface
239  integer(c_int) recursive function set_model_numbering(model_create, &
240  numbering) bind(c, name="KIM_ModelCreate_SetModelNumbering")
241  use, intrinsic :: iso_c_binding
242  use kim_numbering_module, only : kim_numbering_type
243  use kim_interoperable_types_module, only : kim_model_create_type
244  implicit none
245  type(kim_model_create_type), intent(in) :: model_create
246  type(kim_numbering_type), intent(in), value :: numbering
247  end function set_model_numbering
248  end interface
249  type(kim_model_create_handle_type), intent(in) :: model_create_handle
250  type(kim_numbering_type), intent(in) :: numbering
251  integer(c_int), intent(out) :: ierr
252  type(kim_model_create_type), pointer :: model_create
253 
254  call c_f_pointer(model_create_handle%p, model_create)
255  ierr = set_model_numbering(model_create, numbering)
256  end subroutine kim_model_create_set_model_numbering
257 
265  model_create_handle, influence_distance)
266  use kim_interoperable_types_module, only : kim_model_create_type
267  implicit none
268  interface
269  recursive subroutine set_influence_distance_pointer(model_create, &
270  influence_distance) &
271  bind(c, name="KIM_ModelCreate_SetInfluenceDistancePointer")
272  use, intrinsic :: iso_c_binding
273  use kim_interoperable_types_module, only : kim_model_create_type
274  implicit none
275  type(kim_model_create_type), intent(in) :: model_create
276  type(c_ptr), intent(in), value :: influence_distance
277  end subroutine set_influence_distance_pointer
278  end interface
279  type(kim_model_create_handle_type), intent(in) :: model_create_handle
280  real(c_double), intent(in), target :: influence_distance
281  type(kim_model_create_type), pointer :: model_create
282 
283  call c_f_pointer(model_create_handle%p, model_create)
284  call set_influence_distance_pointer(model_create, &
285  c_loc(influence_distance))
287 
294  recursive subroutine kim_model_create_set_neighbor_list_pointers( &
295  model_create_handle, number_of_neighbor_lists, cutoffs, &
296  model_will_not_request_neighbors_of_noncontributing_particles)
297  use kim_interoperable_types_module, only : kim_model_create_type
298  implicit none
299  interface
300  recursive subroutine set_neighbor_list_pointers(model_create, &
301  number_of_neighbor_lists, cutoffs_ptr, &
302  model_will_not_request_neighbors_of_noncontributing_particles) &
303  bind(c, name="KIM_ModelCreate_SetNeighborListPointers")
304  use, intrinsic :: iso_c_binding
305  use kim_interoperable_types_module, only : kim_model_create_type
306  implicit none
307  type(kim_model_create_type), intent(in) :: model_create
308  integer(c_int), intent(in), value :: number_of_neighbor_lists
309  type(c_ptr), intent(in), value :: cutoffs_ptr
310  type(c_ptr), intent(in), value :: &
311  model_will_not_request_neighbors_of_noncontributing_particles
312  end subroutine set_neighbor_list_pointers
313  end interface
314  type(kim_model_create_handle_type), intent(in) :: model_create_handle
315  integer(c_int), intent(in) :: number_of_neighbor_lists
316  real(c_double), intent(in), target :: cutoffs(number_of_neighbor_lists)
317  integer(c_int), intent(in), target :: &
318  model_will_not_request_neighbors_of_noncontributing_particles( &
319  number_of_neighbor_lists)
320  type(kim_model_create_type), pointer :: model_create
321 
322  call c_f_pointer(model_create_handle%p, model_create)
323  call set_neighbor_list_pointers(model_create, number_of_neighbor_lists, &
324  c_loc(cutoffs), &
325  c_loc(model_will_not_request_neighbors_of_noncontributing_particles))
327 
333  recursive subroutine kim_model_create_set_routine_pointer( &
334  model_create_handle, model_routine_name, language_name, required, fptr, &
335  ierr)
336  use kim_model_routine_name_module, only : kim_model_routine_name_type
337  use kim_language_name_module, only : kim_language_name_type
338  use kim_interoperable_types_module, only : kim_model_create_type
339  implicit none
340  interface
341  integer(c_int) recursive function set_routine_pointer(model_create, &
342  model_routine_name, language_name, required, fptr) &
343  bind(c, name="KIM_ModelCreate_SetRoutinePointer")
344  use, intrinsic :: iso_c_binding
345  use kim_model_routine_name_module, only : kim_model_routine_name_type
346  use kim_language_name_module, only : kim_language_name_type
347  use kim_interoperable_types_module, only : kim_model_create_type
348  implicit none
349  type(kim_model_create_type), intent(in) :: model_create
350  type(kim_model_routine_name_type), intent(in), value &
351  :: model_routine_name
352  type(kim_language_name_type), intent(in), value :: language_name
353  integer(c_int), intent(in), value :: required
354  type(c_funptr), intent(in), value :: fptr
355  end function set_routine_pointer
356  end interface
357  type(kim_model_create_handle_type), intent(in) :: model_create_handle
358  type(kim_model_routine_name_type), intent(in) :: model_routine_name
359  type(kim_language_name_type), intent(in) :: language_name
360  integer(c_int), intent(in) :: required
361  type(c_funptr), intent(in), value :: fptr ! must be left as "value"!?!
362  integer(c_int), intent(out) :: ierr
363  type(kim_model_create_type), pointer :: model_create
364 
365  call c_f_pointer(model_create_handle%p, model_create)
366  ierr = set_routine_pointer(model_create, model_routine_name, &
367  language_name, required, fptr)
369 
375  recursive subroutine kim_model_create_set_species_code(model_create_handle, &
376  species_name, code, ierr)
377  use kim_species_name_module, only : kim_species_name_type
378  use kim_interoperable_types_module, only : kim_model_create_type
379  implicit none
380  interface
381  integer(c_int) recursive function set_species_code(model_create, &
382  species_name, code) &
383  bind(c, name="KIM_ModelCreate_SetSpeciesCode")
384  use, intrinsic :: iso_c_binding
385  use kim_species_name_module, only : kim_species_name_type
386  use kim_interoperable_types_module, only : kim_model_create_type
387  implicit none
388  type(kim_model_create_type), intent(in) :: model_create
389  type(kim_species_name_type), intent(in), value :: species_name
390  integer(c_int), intent(in), value :: code
391  end function set_species_code
392  end interface
393  type(kim_model_create_handle_type), intent(in) :: model_create_handle
394  type(kim_species_name_type), intent(in) :: species_name
395  integer(c_int), intent(in) :: code
396  integer(c_int), intent(out) :: ierr
397  type(kim_model_create_type), pointer :: model_create
398 
399  call c_f_pointer(model_create_handle%p, model_create)
400  ierr = set_species_code(model_create, species_name, code)
401  end subroutine kim_model_create_set_species_code
402 
409  recursive subroutine kim_model_create_set_parameter_pointer_integer( &
410  model_create_handle, int1, name, description, ierr)
411  use kim_interoperable_types_module, only : kim_model_create_type
412  implicit none
413  type(kim_model_create_handle_type), intent(in) :: model_create_handle
414  integer(c_int), intent(in), target :: int1(:)
415  character(len=*, kind=c_char), intent(in) :: name
416  character(len=*, kind=c_char), intent(in) :: description
417  integer(c_int), intent(out) :: ierr
418  type(kim_model_create_type), pointer :: model_create
419 
420  call c_f_pointer(model_create_handle%p, model_create)
421  call set_parameter(model_create, size(int1, 1, c_int), int1, name, &
422  description, ierr)
423  return
424 
425  contains
426  recursive subroutine set_parameter(model_create, extent, int1, name, &
427  description, ierr)
428  use kim_interoperable_types_module, only : kim_model_create_type
429  implicit none
430  interface
431  integer(c_int) recursive function set_parameter_pointer_integer( &
432  model_create, extent, ptr, name, description) &
433  bind(c, name="KIM_ModelCreate_SetParameterPointerInteger")
434  use, intrinsic :: iso_c_binding
435  use kim_interoperable_types_module, only : kim_model_create_type
436  implicit none
437  type(kim_model_create_type), intent(in) :: model_create
438  integer(c_int), intent(in), value :: extent
439  type(c_ptr), intent(in), value :: ptr
440  character(c_char), intent(in) :: name(*)
441  character(c_char), intent(in) :: description(*)
442  end function set_parameter_pointer_integer
443  end interface
444  type(kim_model_create_type), intent(in) :: model_create
445  integer(c_int), intent(in) :: extent
446  integer(c_int), intent(in), target :: int1(extent)
447  character(len=*, kind=c_char), intent(in) :: name
448  character(len=*, kind=c_char), intent(in) :: description
449  integer(c_int), intent(out) :: ierr
450 
451  ierr = set_parameter_pointer_integer(model_create, extent, &
452  c_loc(int1), trim(name)//c_null_char, &
453  trim(description)//c_null_char)
454  end subroutine set_parameter
456 
463  recursive subroutine kim_model_create_set_parameter_pointer_double( &
464  model_create_handle, double1, name, description, ierr)
465  use kim_interoperable_types_module, only : kim_model_create_type
466  implicit none
467  type(kim_model_create_handle_type), intent(in) :: model_create_handle
468  real(c_double), intent(in), target :: double1(:)
469  character(len=*, kind=c_char), intent(in) :: name
470  character(len=*, kind=c_char), intent(in) :: description
471  integer(c_int), intent(out) :: ierr
472  type(kim_model_create_type), pointer :: model_create
473 
474  call c_f_pointer(model_create_handle%p, model_create)
475  call set_parameter(model_create, size(double1, 1, c_int), double1, &
476  name, description, ierr)
477  return
478 
479  contains
480  recursive subroutine set_parameter(model_create, extent, double1, name, &
481  description, ierr)
482  implicit none
483  interface
484  integer(c_int) recursive function set_parameter_pointer_double( &
485  model_create, extent, ptr, name, description) &
486  bind(c, name="KIM_ModelCreate_SetParameterPointerDouble")
487  use, intrinsic :: iso_c_binding
488  use kim_interoperable_types_module, only : kim_model_create_type
489  implicit none
490  type(kim_model_create_type), intent(in) :: model_create
491  integer(c_int), intent(in), value :: extent
492  type(c_ptr), intent(in), value :: ptr
493  character(c_char), intent(in) :: name(*)
494  character(c_char), intent(in) :: description(*)
495  end function set_parameter_pointer_double
496  end interface
497  type(kim_model_create_type), intent(in) :: model_create
498  integer(c_int), intent(in) :: extent
499  real(c_double), intent(in), target :: double1(extent)
500  character(len=*, kind=c_char), intent(in) :: name
501  character(len=*, kind=c_char), intent(in) :: description
502  integer(c_int), intent(out) :: ierr
503 
504  ierr = set_parameter_pointer_double(model_create, extent, &
505  c_loc(double1), trim(name)//c_null_char, &
506  trim(description)//c_null_char)
507  end subroutine set_parameter
509 
516  recursive subroutine kim_model_create_set_model_buffer_pointer( &
517  model_create_handle, ptr)
518  use kim_interoperable_types_module, only : kim_model_create_type
519  implicit none
520  interface
521  recursive subroutine set_model_buffer_pointer(model_create, ptr) &
522  bind(c, name="KIM_ModelCreate_SetModelBufferPointer")
523  use, intrinsic :: iso_c_binding
524  use kim_interoperable_types_module, only : kim_model_create_type
525  implicit none
526  type(kim_model_create_type), intent(in) :: model_create
527  type(c_ptr), intent(in), value :: ptr
528  end subroutine set_model_buffer_pointer
529  end interface
530  type(kim_model_create_handle_type), intent(in) :: model_create_handle
531  type(c_ptr), intent(in) :: ptr
532  type(kim_model_create_type), pointer :: model_create
533 
534  call c_f_pointer(model_create_handle%p, model_create)
535  call set_model_buffer_pointer(model_create, ptr)
537 
543  recursive subroutine kim_model_create_set_units(model_create_handle, &
544  length_unit, energy_unit, charge_unit, temperature_unit, time_unit, ierr)
546  kim_length_unit_type, &
547  kim_energy_unit_type, &
548  kim_charge_unit_type, &
549  kim_temperature_unit_type, &
550  kim_time_unit_type
551  use kim_interoperable_types_module, only : kim_model_create_type
552  implicit none
553  interface
554  integer(c_int) recursive function set_units(model_create, length_unit, &
555  energy_unit, charge_unit, temperature_unit, time_unit) &
556  bind(c, name="KIM_ModelCreate_SetUnits")
557  use, intrinsic :: iso_c_binding
558  use kim_unit_system_module, only : &
559  kim_length_unit_type, &
560  kim_energy_unit_type, &
561  kim_charge_unit_type, &
562  kim_temperature_unit_type, &
563  kim_time_unit_type
564  use kim_interoperable_types_module, only : kim_model_create_type
565  implicit none
566  type(kim_model_create_type), intent(in) :: model_create
567  type(kim_length_unit_type), intent(in), value :: length_unit
568  type(kim_energy_unit_type), intent(in), value :: energy_unit
569  type(kim_charge_unit_type), intent(in), value :: charge_unit
570  type(kim_temperature_unit_type), intent(in), value :: temperature_unit
571  type(kim_time_unit_type), intent(in), value :: time_unit
572  end function set_units
573  end interface
574  type(kim_model_create_handle_type), intent(in) :: model_create_handle
575  type(kim_length_unit_type), intent(in) :: length_unit
576  type(kim_energy_unit_type), intent(in) :: energy_unit
577  type(kim_charge_unit_type), intent(in) :: charge_unit
578  type(kim_temperature_unit_type), intent(in) :: temperature_unit
579  type(kim_time_unit_type), intent(in) :: time_unit
580  integer(c_int), intent(out) :: ierr
581  type(kim_model_create_type), pointer :: model_create
582 
583  call c_f_pointer(model_create_handle%p, model_create)
584  ierr = set_units(model_create, length_unit, energy_unit, &
585  charge_unit, temperature_unit, time_unit)
586  end subroutine kim_model_create_set_units
587 
593  recursive subroutine kim_model_create_convert_unit( &
594  from_length_unit, from_energy_unit, &
595  from_charge_unit, from_temperature_unit, from_time_unit, &
596  to_length_unit, to_energy_unit, to_charge_unit, to_temperature_unit, &
597  to_time_unit, length_exponent, energy_exponent, charge_exponent, &
598  temperature_exponent, time_exponent, conversion_factor, ierr)
599  use kim_unit_system_module, only : kim_length_unit_type
600  use kim_unit_system_module, only : kim_energy_unit_type
601  use kim_unit_system_module, only : kim_charge_unit_type
602  use kim_unit_system_module, only : kim_temperature_unit_type
603  use kim_unit_system_module, only : kim_time_unit_type
604  implicit none
605  interface
606  integer(c_int) recursive function convert_unit( &
607  from_length_unit, from_energy_unit, &
608  from_charge_unit, from_temperature_unit, from_time_unit, &
609  to_length_unit, to_energy_unit, to_charge_unit, to_temperature_unit, &
610  to_time_unit, length_exponent, energy_exponent, charge_exponent, &
611  temperature_exponent, time_exponent, conversion_factor) &
612  bind(c, name="KIM_ModelCreate_ConvertUnit")
613  use, intrinsic :: iso_c_binding
614  use kim_unit_system_module, only : kim_length_unit_type
615  use kim_unit_system_module, only : kim_energy_unit_type
616  use kim_unit_system_module, only : kim_charge_unit_type
617  use kim_unit_system_module, only : kim_temperature_unit_type
618  use kim_unit_system_module, only : kim_time_unit_type
619  implicit none
620  type(kim_length_unit_type), intent(in), value :: from_length_unit
621  type(kim_energy_unit_type), intent(in), value :: from_energy_unit
622  type(kim_charge_unit_type), intent(in), value :: from_charge_unit
623  type(kim_temperature_unit_type), intent(in), value :: &
624  from_temperature_unit
625  type(kim_time_unit_type), intent(in), value :: from_time_unit
626  type(kim_length_unit_type), intent(in), value :: to_length_unit
627  type(kim_energy_unit_type), intent(in), value :: to_energy_unit
628  type(kim_charge_unit_type), intent(in), value :: to_charge_unit
629  type(kim_temperature_unit_type), intent(in), value :: &
630  to_temperature_unit
631  type(kim_time_unit_type), intent(in), value :: to_time_unit
632  real(c_double), intent(in), value :: length_exponent
633  real(c_double), intent(in), value :: energy_exponent
634  real(c_double), intent(in), value :: charge_exponent
635  real(c_double), intent(in), value :: temperature_exponent
636  real(c_double), intent(in), value :: time_exponent
637  real(c_double), intent(out) :: conversion_factor
638  end function convert_unit
639  end interface
640  type(kim_length_unit_type), intent(in) :: from_length_unit
641  type(kim_energy_unit_type), intent(in) :: from_energy_unit
642  type(kim_charge_unit_type), intent(in) :: from_charge_unit
643  type(kim_temperature_unit_type), intent(in) :: from_temperature_unit
644  type(kim_time_unit_type), intent(in) :: from_time_unit
645  type(kim_length_unit_type), intent(in) :: to_length_unit
646  type(kim_energy_unit_type), intent(in) :: to_energy_unit
647  type(kim_charge_unit_type), intent(in) :: to_charge_unit
648  type(kim_temperature_unit_type), intent(in) :: to_temperature_unit
649  type(kim_time_unit_type), intent(in) :: to_time_unit
650  real(c_double), intent(in) :: length_exponent
651  real(c_double), intent(in) :: energy_exponent
652  real(c_double), intent(in) :: charge_exponent
653  real(c_double), intent(in) :: temperature_exponent
654  real(c_double), intent(in) :: time_exponent
655  real(c_double), intent(out) :: conversion_factor
656  integer(c_int), intent(out) :: ierr
657 
658  ierr = convert_unit(from_length_unit, &
659  from_energy_unit, from_charge_unit, from_temperature_unit, &
660  from_time_unit, to_length_unit, to_energy_unit, to_charge_unit, &
661  to_temperature_unit, to_time_unit, length_exponent, energy_exponent, &
662  charge_exponent, temperature_exponent, time_exponent, conversion_factor)
663  end subroutine kim_model_create_convert_unit
664 
670  recursive subroutine kim_model_create_log_entry(model_create_handle, &
671  log_verbosity, message)
672  use kim_log_verbosity_module, only : kim_log_verbosity_type
673  use kim_interoperable_types_module, only : kim_model_create_type
674  implicit none
675  interface
676  recursive subroutine log_entry(model_create, log_verbosity, message, &
677  line_number, file_name) bind(c, name="KIM_ModelCreate_LogEntry")
678  use, intrinsic :: iso_c_binding
679  use kim_log_verbosity_module, only : kim_log_verbosity_type
680  use kim_interoperable_types_module, only : kim_model_create_type
681  implicit none
682  type(kim_model_create_type), intent(in) :: model_create
683  type(kim_log_verbosity_type), intent(in), value :: log_verbosity
684  character(c_char), intent(in) :: message(*)
685  integer(c_int), intent(in), value :: line_number
686  character(c_char), intent(in) :: file_name(*)
687  end subroutine log_entry
688  end interface
689  type(kim_model_create_handle_type), intent(in) :: model_create_handle
690  type(kim_log_verbosity_type), intent(in) :: log_verbosity
691  character(len=*, kind=c_char), intent(in) :: message
692  type(kim_model_create_type), pointer :: model_create
693 
694  call c_f_pointer(model_create_handle%p, model_create)
695  call log_entry(model_create, log_verbosity, trim(message)//c_null_char, &
696  0, ""//c_null_char)
697  end subroutine kim_model_create_log_entry
698 
704  recursive subroutine kim_model_create_to_string(model_create_handle, string)
705  use kim_convert_string_module, only : kim_convert_c_char_ptr_to_string
706  use kim_interoperable_types_module, only : kim_model_create_type
707  implicit none
708  interface
709  type(c_ptr) recursive function model_create_string(model_create) &
710  bind(c, name="KIM_ModelCreate_ToString")
711  use, intrinsic :: iso_c_binding
712  use kim_interoperable_types_module, only : kim_model_create_type
713  implicit none
714  type(kim_model_create_type), intent(in) :: model_create
715  end function model_create_string
716  end interface
717  type(kim_model_create_handle_type), intent(in) :: model_create_handle
718  character(len=*, kind=c_char), intent(out) :: string
719  type(kim_model_create_type), pointer :: model_create
720 
721  type(c_ptr) :: p
722 
723  call c_f_pointer(model_create_handle%p, model_create)
724  p = model_create_string(model_create)
725  call kim_convert_c_char_ptr_to_string(p, string)
726  end subroutine kim_model_create_to_string
727 end module kim_model_create_module
recursive subroutine kim_model_create_set_influence_distance_pointer(model_create_handle, influence_distance)
Set the Model's influence distance data pointer.
recursive subroutine kim_model_create_set_model_buffer_pointer(model_create_handle, ptr)
Set the Model's buffer pointer within the Model object.
recursive subroutine kim_model_create_set_parameter_pointer_integer(model_create_handle, int1, name, description, ierr)
Set the next parameter data pointer to be provided by the model.
int model_create(KIM_ModelCreate *const modelCreate, KIM_LengthUnit const requestedLengthUnit, KIM_EnergyUnit const requestedEnergyUnit, KIM_ChargeUnit const requestedChargeUnit, KIM_TemperatureUnit const requestedTemperatureUnit, KIM_TimeUnit const requestedTimeUnit)
An Extensible Enumeration for the ModelRoutineName's supported by the KIM API.
Provides the interface to a KIM API Model object for use by models within their MODEL_ROUTINE_NAME::C...
An Extensible Enumeration for the Numbering's supported by the KIM API.
recursive subroutine kim_model_create_set_species_code(model_create_handle, species_name, code, ierr)
Set integer code for supported SpeciesName.
recursive subroutine kim_model_create_set_units(model_create_handle, length_unit, energy_unit, charge_unit, temperature_unit, time_unit, ierr)
Set the Model's base unit values.
recursive subroutine kim_model_create_set_neighbor_list_pointers(model_create_handle, number_of_neighbor_lists, cutoffs, model_will_not_request_neighbors_of_noncontributing_particles)
Set the Model's neighbor list data pointers.
An Extensible Enumeration for the LanguageName's supported by the KIM API.
recursive subroutine kim_model_create_set_parameter_pointer_double(model_create_handle, double1, name, description, ierr)
Set the next parameter data pointer to be provided by the model.
recursive subroutine kim_model_create_log_entry(model_create_handle, log_verbosity, message)
Write a log entry into the log file.
An Extensible Enumeration for the SpeciesName's supported by the KIM API.
recursive subroutine set_parameter(model_create, extent, int1, name, description, ierr)
recursive subroutine kim_model_create_to_string(model_create_handle, string)
Get a string representing the internal state of the Model object.
recursive subroutine kim_model_create_convert_unit(from_length_unit, from_energy_unit, from_charge_unit, from_temperature_unit, from_time_unit, to_length_unit, to_energy_unit, to_charge_unit, to_temperature_unit, to_time_unit, length_exponent, energy_exponent, charge_exponent, temperature_exponent, time_exponent, conversion_factor, ierr)
Get the multiplicative factor to convert between a derived unit represented in two different sets of ...
type(kim_model_create_handle_type), save, public, protected kim_model_create_null_handle
NULL handle for use in comparisons.
An Extensible Enumeration for the LogVerbosity's supported by the KIM API.
recursive subroutine kim_model_create_set_routine_pointer(model_create_handle, model_routine_name, language_name, required, fptr, ierr)
Set the function pointer for the ModelRoutineName of interest.