kim-api  2.1.4-git+v2.1.3-git-1-g7847914a.GNU
An Application Programming Interface (API) for the Knowledgebase of Interatomic Models (KIM).
Data Types | Functions/Subroutines | Variables
kim_model_module Module Reference

Provides the primary interface to a KIM API Model object and is meant to be used by simulators. More...

Functions/Subroutines

recursive subroutine, public kim_model_create (numbering, requested_length_unit, requested_energy_unit, requested_charge_unit, requested_temperature_unit, requested_time_unit, model_name, requested_units_accepted, model_handle, ierr)
 Create a new KIM API Model object. More...
 
recursive subroutine, public kim_model_destroy (model_handle)
 Destroy a previously Model::Create'd object. More...
 
recursive subroutine kim_model_get_influence_distance (model_handle, influence_distance)
 Get the Model's influence distance. More...
 
recursive subroutine kim_model_get_number_of_neighbor_lists (model_handle, number_of_neighbor_lists)
 Get Model's number of neighbor lists. More...
 
recursive subroutine kim_model_get_neighbor_list_values (model_handle, cutoffs, model_will_not_request_neighbors_of_noncontributing_particles, ierr)
 Get Model's neighbor list values. More...
 
recursive subroutine kim_model_get_units (model_handle, length_unit, energy_unit, charge_unit, temperature_unit, time_unit)
 Get the Model's base unit values. More...
 
recursive subroutine kim_model_compute_arguments_create (model_handle, compute_arguments_handle, ierr)
 Create a new ComputeArguments object for the Model object. More...
 
recursive subroutine kim_model_compute_arguments_destroy (model_handle, compute_arguments_handle, ierr)
 Destroy a previously Model::ComputeArgumentsCreate'd object. More...
 
recursive subroutine kim_model_compute (model_handle, compute_arguments_handle, ierr)
 Call the Model's MODEL_ROUTINE_NAME::Compute routine. More...
 
recursive subroutine kim_model_extension (model_handle, extension_id, extension_structure, ierr)
 Call the Model's MODEL_ROUTINE_NAME::Extension routine. More...
 
recursive subroutine kim_model_clear_then_refresh (model_handle, ierr)
 Clear influence distance and neighbor list pointers and refresh Model object after parameter changes. More...
 
recursive subroutine kim_model_write_parameterized_model (model_handle, path, model_name, ierr)
 Call the Model's MODEL_ROUTINE_NAME::WriteParameterizedModel routine. More...
 
recursive subroutine kim_model_get_species_support_and_code (model_handle, species_name, species_is_supported, code, ierr)
 Get the Model's support and code for the requested SpeciesName. More...
 
recursive subroutine kim_model_get_number_of_parameters (model_handle, number_of_parameters)
 Get the number of parameter arrays provided by the Model. More...
 
recursive subroutine kim_model_get_parameter_metadata (model_handle, parameter_index, data_type, extent, name, description, ierr)
 Get the metadata associated with one of the Model's parameter arrays. More...
 
recursive subroutine kim_model_get_parameter_integer (model_handle, parameter_index, array_index, parameter_value, ierr)
 Get a parameter value from the Model. More...
 
recursive subroutine kim_model_get_parameter_double (model_handle, parameter_index, array_index, parameter_value, ierr)
 Get a parameter value from the Model. More...
 
recursive subroutine kim_model_set_parameter_integer (model_handle, parameter_index, array_index, parameter_value, ierr)
 Set a parameter value for the Model. More...
 
recursive subroutine kim_model_set_parameter_double (model_handle, parameter_index, array_index, parameter_value, ierr)
 Set a parameter value for the Model. More...
 
recursive subroutine kim_model_set_simulator_buffer_pointer (model_handle, ptr)
 Set the Simulator's buffer pointer within the Model object. More...
 
recursive subroutine kim_model_get_simulator_buffer_pointer (model_handle, ptr)
 Get the Simulator's buffer pointer from the Model object. More...
 
recursive subroutine kim_model_to_string (model_handle, string)
 Get a string representing the internal state of the Model object. More...
 
recursive subroutine kim_model_set_log_id (model_handle, log_id)
 Set the identity of the Log object associated with the Model object. More...
 
recursive subroutine kim_model_push_log_verbosity (model_handle, log_verbosity)
 Push a new LogVerbosity onto the Model object's Log object verbosity stack. More...
 
recursive subroutine kim_model_pop_log_verbosity (model_handle)
 Pop a LogVerbosity from the Model object's Log object verbosity stack. More...
 

Variables

type(kim_model_handle_type), save, public, protected kim_model_null_handle
 NULL handle for use in comparisons. More...
 

Detailed Description

Provides the primary interface to a KIM API Model object and is meant to be used by simulators.

See also
KIM::Model, KIM_Model
Since
2.0

Function/Subroutine Documentation

◆ kim_model_clear_then_refresh()

recursive subroutine kim_model_module::kim_model_clear_then_refresh ( type(kim_model_handle_type), intent(in)  model_handle,
integer(c_int), intent(out)  ierr 
)

Clear influence distance and neighbor list pointers and refresh Model object after parameter changes.

A Fortran PM may need to provide a KIM::MODEL_ROUTINE_NAME::Refresh routine. The interface for this is given here (see also KIM::ModelRefreshFunction, KIM_ModelRefreshFunction).

interface
recursive subroutine refresh(model_refresh_handle, ierr) bind(c)
use, intrinsic :: iso_c_binding
implicit none
type(kim_model_refresh_handle_type), intent(in) :: model_refresh_handle
integer(c_int), intent(out) :: ierr
end subroutine refresh
end interface
See also
KIM::Model::ClearThenRefresh, KIM_Model_ClearThenRefresh
Since
2.0

Definition at line 942 of file kim_model_module.f90.

◆ kim_model_compute()

recursive subroutine kim_model_module::kim_model_compute ( type(kim_model_handle_type), intent(in)  model_handle,
type(kim_compute_arguments_handle_type), intent(in)  compute_arguments_handle,
integer(c_int), intent(out)  ierr 
)

Call the Model's MODEL_ROUTINE_NAME::Compute routine.

A Fortran PM must provide a KIM::MODEL_ROUTINE_NAME::Compute routine. The interface for this is given here (see also KIM::ModelComputeFunction, KIM_ModelComputeFunction).

interface
recursive subroutine compute(model_compute_handle, &
model_compute_arguments_handle, ierr) bind(c)
use, intrinsic :: iso_c_binding
implicit none
type(kim_model_compute_handle_type), intent(in) :: model_compute_handle
type(kim_model_compute_arguments_handle_type), intent(in) :: &
model_compute_arguments_handle
integer(c_int), intent(out) :: ierr
end subroutine compute
end interface
See also
KIM::Model::Compute, KIM_Model_Compute
Since
2.0

Definition at line 843 of file kim_model_module.f90.

◆ kim_model_compute_arguments_create()

recursive subroutine kim_model_module::kim_model_compute_arguments_create ( type(kim_model_handle_type), intent(in)  model_handle,
type(kim_compute_arguments_handle_type), intent(out)  compute_arguments_handle,
integer(c_int), intent(out)  ierr 
)

Create a new ComputeArguments object for the Model object.

A Fortran PM must provide a KIM::MODEL_ROUTINE_NAME::ComputeArgumentsCreate routine. The interface for this is given here (see also KIM::ModelComputeArgumentsCreateFunction, KIM_ModelComputeArgumentsCreateFunction).

interface
recursive subroutine compute_arguments_create(model_compute_handle, &
model_compute_arguments_create_handle, ierr) bind(c)
use, intrinsic :: iso_c_binding
implicit none
type(kim_model_compute_handle_type), intent(in) :: model_compute_handle
type(kim_model_compute_arguments_create_handle_type), intent(in) &
:: model_compute_arguments_create_handle
integer(c_int), intent(out) :: ierr
end subroutine compute_arguments_create
end interface
See also
KIM::Model::ComputeArgumentsCreate, KIM_Model_ComputeArgumentsCreate
Since
2.0

Definition at line 731 of file kim_model_module.f90.

◆ kim_model_compute_arguments_destroy()

recursive subroutine kim_model_module::kim_model_compute_arguments_destroy ( type(kim_model_handle_type), intent(in)  model_handle,
type(kim_compute_arguments_handle_type), intent(inout)  compute_arguments_handle,
integer(c_int), intent(out)  ierr 
)

Destroy a previously Model::ComputeArgumentsCreate'd object.

A Fortran PM must provide a KIM::MODEL_ROUTINE_NAME::ComputeArgumentsDestroy routine. The interface for this is given here (see also KIM::ModelComputeArgumentsDestroyFunction, KIM_ModelComputeArgumentsDestroyFunction).

interface
recursive subroutine compute_arguments_destroy(model_compute_handle, &
model_compute_arguments_destroy_handle, ierr) bind(c)
use, intrinsic :: iso_c_binding
implicit none
type(kim_model_compute_handle_type), intent(in) :: model_compute_handle
type(kim_model_compute_arguments_destroy_handle_type), intent(in) &
:: model_compute_arguments_destroy_handle
integer(c_int), intent(out) :: ierr
end interface
See also
KIM::Model::ComputeArgumentsDestroy, KIM_Model_ComputeArgumentsDestroy
Since
2.0

Definition at line 788 of file kim_model_module.f90.

◆ kim_model_create()

recursive subroutine, public kim_model_module::kim_model_create ( type(kim_numbering_type), intent(in)  numbering,
type(kim_length_unit_type), intent(in)  requested_length_unit,
type(kim_energy_unit_type), intent(in)  requested_energy_unit,
type(kim_charge_unit_type), intent(in)  requested_charge_unit,
type(kim_temperature_unit_type), intent(in)  requested_temperature_unit,
type(kim_time_unit_type), intent(in)  requested_time_unit,
character(len=*, kind=c_char), intent(in)  model_name,
integer(c_int), intent(out)  requested_units_accepted,
type(kim_model_handle_type), intent(out)  model_handle,
integer(c_int), intent(out)  ierr 
)

Create a new KIM API Model object.

A Fortran PM must provide a KIM::MODEL_ROUTINE_NAME::Create routine. The interface for this is given here.

A PM not employing a MD should use the following interface (see also KIM::ModelCreateFunction, KIM_ModelCreateFunction)

interface
recursive subroutine create(model_create_handle, requested_length_unit, &
requested_energy_unit, requested_charge_unit, &
requested_temperature_unit, requested_time_unit, ierr) bind(c)
use, intrinsic :: iso_c_binding
implicit none
type(kim_model_create_handle_type), intent(in) :: model_create_handle
type(kim_length_unit_type), intent(in), value :: requested_length_unit
type(kim_energy_unit_type), intent(in), value :: requested_energy_unit
type(kim_charge_unit_type), intent(in), value :: requested_charge_unit
type(kim_temperature_unit_type), intent(in), value :: &
requested_temperature_unit
type(kim_time_unit_type), intent(in), value :: requested_time_unit
integer(c_int), intent(out) :: ierr
end subroutine create
end interface

A MD should use the following interface (see also KIM::ModelDriverCreateFunction, KIM_ModelDriverCreateFunction)

interface
recursive subroutine create(model_driver_create_handle, &
requested_length_unit, requested_energy_unit, requested_charge_unit, &
requested_temperature_unit, requested_time_unit, ierr) bind(c)
use, intrinsic :: iso_c_binding
implicit none
type(kim_model_driver_create_handle_type), intent(in) :: &
model_create_handle
type(kim_length_unit_type), intent(in), value :: requested_length_unit
type(kim_energy_unit_type), intent(in), value :: requested_energy_unit
type(kim_charge_unit_type), intent(in), value :: requested_charge_unit
type(kim_temperature_unit_type), intent(in), value :: &
requested_temperature_unit
type(kim_time_unit_type), intent(in), value :: requested_time_unit
integer(c_int), intent(out) :: ierr
end subroutine create
end interface
See also
KIM::Model::Create, KIM_Model_Create
Since
2.0

Definition at line 400 of file kim_model_module.f90.

◆ kim_model_destroy()

recursive subroutine, public kim_model_module::kim_model_destroy ( type(kim_model_handle_type), intent(inout)  model_handle)

Destroy a previously Model::Create'd object.

A Fortran PM must provide a KIM::MODEL_ROUTINE_NAME::Destroy routine. The interface for this is given here (see also KIM::ModelDestroyFunction, KIM_ModelDestroyFunction).

interface
recursive subroutine destroy(model_destroy_handle, ierr) bind(c)
use, intrinsic :: iso_c_binding
implicit none
type(kim_model_destroy_handle_type), intent(in) :: model_destroy_handle
integer(c_int), intent(out) :: ierr
end subroutine destroy
end interface
See also
KIM::Model::Destroy, KIM_Model_Destroy
Since
2.0

Definition at line 470 of file kim_model_module.f90.

◆ kim_model_extension()

recursive subroutine kim_model_module::kim_model_extension ( type(kim_model_handle_type), intent(in)  model_handle,
character(len=*, kind=c_char), intent(in)  extension_id,
type(c_ptr), intent(in)  extension_structure,
integer(c_int), intent(out)  ierr 
)

Call the Model's MODEL_ROUTINE_NAME::Extension routine.

A Fortran PM may provide a KIM::MODEL_ROUTINE_NAME::Extension routine. The interface for this is given here (see also KIM::ModelExtensionFunction, KIM_ModelExtensionFunction).

interface
recursive subroutine extension(model_extension_handle, &
extension_structure, ierr) bind(c)
use, intrinsic :: iso_c_binding
implicit none
type(kim_model_extension_handle_type), intent(in) :: &
model_extension_handle
type(c_ptr), intent(in), value :: extension_structure
integer(c_int), intent(out) :: ierr
end subroutine extension
end interface
See also
KIM::Model::Extension, KIM_Model_Extension
Since
2.0

Definition at line 896 of file kim_model_module.f90.

◆ kim_model_get_influence_distance()

recursive subroutine kim_model_module::kim_model_get_influence_distance ( type(kim_model_handle_type), intent(in)  model_handle,
real(c_double), intent(out)  influence_distance 
)

Get the Model's influence distance.

See also
KIM::Model::GetInfluenceDistance, KIM_Model_GetInfluenceDistance
Since
2.0

Definition at line 529 of file kim_model_module.f90.

◆ kim_model_get_neighbor_list_values()

recursive subroutine kim_model_module::kim_model_get_neighbor_list_values ( type(kim_model_handle_type), intent(in)  model_handle,
real(c_double), dimension(:), intent(out)  cutoffs,
integer(c_int), dimension(:), intent(out)  model_will_not_request_neighbors_of_noncontributing_particles,
integer(c_int), intent(out)  ierr 
)

Get Model's neighbor list values.

See also
KIM::Model::GetNeighborListPointers, KIM_Model_GetNeighborListPointers
Since
2.0

Definition at line 592 of file kim_model_module.f90.

◆ kim_model_get_number_of_neighbor_lists()

recursive subroutine kim_model_module::kim_model_get_number_of_neighbor_lists ( type(kim_model_handle_type), intent(in)  model_handle,
integer(c_int), intent(out)  number_of_neighbor_lists 
)

Get Model's number of neighbor lists.

See also
KIM::Model::GetNeighborListPointers, KIM_Model_GetNeighborListPointers
Since
2.0

Definition at line 556 of file kim_model_module.f90.

◆ kim_model_get_number_of_parameters()

recursive subroutine kim_model_module::kim_model_get_number_of_parameters ( type(kim_model_handle_type), intent(in)  model_handle,
integer(c_int), intent(out)  number_of_parameters 
)

Get the number of parameter arrays provided by the Model.

See also
KIM::Model::GetNumberOfParameters, KIM_Model_GetNumberOfParameters
Since
2.0

Definition at line 1056 of file kim_model_module.f90.

◆ kim_model_get_parameter_double()

recursive subroutine kim_model_module::kim_model_get_parameter_double ( type(kim_model_handle_type), intent(in)  model_handle,
integer(c_int), intent(in)  parameter_index,
integer(c_int), intent(in)  array_index,
real(c_double), intent(out)  parameter_value,
integer(c_int), intent(out)  ierr 
)

Get a parameter value from the Model.

See also
KIM::Model::GetParameter, KIM_Model_GetParameterDouble
Since
2.0

Definition at line 1162 of file kim_model_module.f90.

◆ kim_model_get_parameter_integer()

recursive subroutine kim_model_module::kim_model_get_parameter_integer ( type(kim_model_handle_type), intent(in)  model_handle,
integer(c_int), intent(in)  parameter_index,
integer(c_int), intent(in)  array_index,
integer(c_int), intent(out)  parameter_value,
integer(c_int), intent(out)  ierr 
)

Get a parameter value from the Model.

See also
KIM::Model::GetParameter, KIM_Model_GetParameterInteger
Since
2.0

Definition at line 1128 of file kim_model_module.f90.

◆ kim_model_get_parameter_metadata()

recursive subroutine kim_model_module::kim_model_get_parameter_metadata ( type(kim_model_handle_type), intent(in)  model_handle,
integer(c_int), intent(in)  parameter_index,
type(kim_data_type_type), intent(out)  data_type,
integer(c_int), intent(out)  extent,
character(len=*, kind=c_char), intent(out)  name,
character(len=*, kind=c_char), intent(out)  description,
integer(c_int), intent(out)  ierr 
)

Get the metadata associated with one of the Model's parameter arrays.

See also
KIM::Model::GetParameterMetadata, KIM_Model_GetParameterMetadata
Since
2.0

Definition at line 1083 of file kim_model_module.f90.

◆ kim_model_get_simulator_buffer_pointer()

recursive subroutine kim_model_module::kim_model_get_simulator_buffer_pointer ( type(kim_model_handle_type), intent(in)  model_handle,
type(c_ptr), intent(out)  ptr 
)

Get the Simulator's buffer pointer from the Model object.

See also
KIM::Model::GetSimulatorBufferPointer, KIM_Model_GetSimulatorBufferPointer
Since
2.0

Definition at line 1291 of file kim_model_module.f90.

◆ kim_model_get_species_support_and_code()

recursive subroutine kim_model_module::kim_model_get_species_support_and_code ( type(kim_model_handle_type), intent(in)  model_handle,
type(kim_species_name_type), intent(in)  species_name,
integer(c_int), intent(out)  species_is_supported,
integer(c_int), intent(out)  code,
integer(c_int), intent(out)  ierr 
)

Get the Model's support and code for the requested SpeciesName.

See also
KIM::Model::GetSpeciesSupportAndCode, KIM_Model_GetSpeciesSupportAndCode
Since
2.0

Definition at line 1020 of file kim_model_module.f90.

◆ kim_model_get_units()

recursive subroutine kim_model_module::kim_model_get_units ( type(kim_model_handle_type), intent(in)  model_handle,
type(kim_length_unit_type), intent(out)  length_unit,
type(kim_energy_unit_type), intent(out)  energy_unit,
type(kim_charge_unit_type), intent(out)  charge_unit,
type(kim_temperature_unit_type), intent(out)  temperature_unit,
type(kim_time_unit_type), intent(out)  time_unit 
)

Get the Model's base unit values.

See also
KIM::Model::GetUnits, KIM_Model_GetUnits
Since
2.0

Definition at line 669 of file kim_model_module.f90.

◆ kim_model_pop_log_verbosity()

recursive subroutine kim_model_module::kim_model_pop_log_verbosity ( type(kim_model_handle_type), intent(in)  model_handle)

Pop a LogVerbosity from the Model object's Log object verbosity stack.

See also
KIM::Model::, KIM_Model_PopLogVerbosity
Since
2.0

Definition at line 1400 of file kim_model_module.f90.

◆ kim_model_push_log_verbosity()

recursive subroutine kim_model_module::kim_model_push_log_verbosity ( type(kim_model_handle_type), intent(in)  model_handle,
type(kim_log_verbosity_type), intent(in)  log_verbosity 
)

Push a new LogVerbosity onto the Model object's Log object verbosity stack.

See also
KIM::Model::PushLogVerbosity, KIM_Model_PushLogVerbosity
Since
2.0

Definition at line 1372 of file kim_model_module.f90.

◆ kim_model_set_log_id()

recursive subroutine kim_model_module::kim_model_set_log_id ( type(kim_model_handle_type), intent(in)  model_handle,
character(len=*, kind=c_char), intent(in)  log_id 
)

Set the identity of the Log object associated with the Model object.

See also
KIM::Model::SetLogID, KIM_Model_SetLogID
Since
2.0

Definition at line 1346 of file kim_model_module.f90.

◆ kim_model_set_parameter_double()

recursive subroutine kim_model_module::kim_model_set_parameter_double ( type(kim_model_handle_type), intent(in)  model_handle,
integer(c_int), intent(in)  parameter_index,
integer(c_int), intent(in)  array_index,
real(c_double), intent(in)  parameter_value,
integer(c_int), intent(out)  ierr 
)

Set a parameter value for the Model.

See also
KIM::Model::SetParameter, KIM_Model_SetParameterDouble
Since
2.0

Definition at line 1230 of file kim_model_module.f90.

◆ kim_model_set_parameter_integer()

recursive subroutine kim_model_module::kim_model_set_parameter_integer ( type(kim_model_handle_type), intent(in)  model_handle,
integer(c_int), intent(in)  parameter_index,
integer(c_int), intent(in)  array_index,
integer(c_int), intent(in)  parameter_value,
integer(c_int), intent(out)  ierr 
)

Set a parameter value for the Model.

See also
KIM::Model::SetParameter, KIM_Model_SetParameterInteger
Since
2.0

Definition at line 1196 of file kim_model_module.f90.

◆ kim_model_set_simulator_buffer_pointer()

recursive subroutine kim_model_module::kim_model_set_simulator_buffer_pointer ( type(kim_model_handle_type), intent(in)  model_handle,
type(c_ptr), intent(in)  ptr 
)

Set the Simulator's buffer pointer within the Model object.

See also
KIM::Model::SetSimulatorBufferPointer, KIM_Model_SetSimulatorBufferPointer
Since
2.0

Definition at line 1264 of file kim_model_module.f90.

◆ kim_model_to_string()

recursive subroutine kim_model_module::kim_model_to_string ( type(kim_model_handle_type), intent(in)  model_handle,
character(len=*, kind=c_char), intent(out)  string 
)

Get a string representing the internal state of the Model object.

See also
KIM::Model::ToString, KIM_Model_ToString
Since
2.0

Definition at line 1317 of file kim_model_module.f90.

◆ kim_model_write_parameterized_model()

recursive subroutine kim_model_module::kim_model_write_parameterized_model ( type(kim_model_handle_type), intent(in)  model_handle,
character(len=*, kind=c_char), intent(in)  path,
character(len=*, kind=c_char), intent(in)  model_name,
integer(c_int), intent(out)  ierr 
)

Call the Model's MODEL_ROUTINE_NAME::WriteParameterizedModel routine.

A Fortran PM using a MD may provide a KIM::MODEL_ROUTINE_NAME::WriteParameterizedMdoel routine. The interface for this is given here (see also KIM::ModelWriteParameterizedModelFunction, KIM_ModelWriteParameterizedModelFunction).

interface
recursive subroutine write_parameterized_model( &
model_write_parameterized_model_handle, ierr) bind(c)
use, intrinsic :: iso_c_binding
implicit none
type(kim_model_write_parameterized_model_handle_type), intent(in) &
:: model_write_parameterized_model_handle
integer(c_int), intent(out) :: ierr
end interface
See also
KIM::Model::WriteParameterizedModel, KIM_Model_WriteParameterizedModel
Since
2.0

Definition at line 988 of file kim_model_module.f90.

Variable Documentation

◆ kim_model_null_handle

type(kim_model_handle_type), save, public, protected kim_model_module::kim_model_null_handle

NULL handle for use in comparisons.

Since
2.0

Definition at line 92 of file kim_model_module.f90.