generate_fragment_list Subroutine

public recursive subroutine generate_fragment_list(monomers, max_level, polymers, count)

Generate all possible fragments (combinations of monomers) up to max_level Uses int64 for count to handle large numbers of fragments that overflow int32.

Arguments

Type IntentOptional Attributes Name
integer(kind=default_int), intent(in) :: monomers(:)
integer(kind=default_int), intent(in) :: max_level
integer(kind=default_int), intent(inout) :: polymers(:,:)
integer(kind=int64), intent(inout) :: count

Calls

proc~~generate_fragment_list~~CallsGraph proc~generate_fragment_list generate_fragment_list proc~combine combine proc~generate_fragment_list->proc~combine proc~combine_util combine_util proc~combine->proc~combine_util proc~combine_util->proc~combine_util

Called by

proc~~generate_fragment_list~~CalledByGraph proc~generate_fragment_list generate_fragment_list proc~run_fragmented_calculation run_fragmented_calculation proc~run_fragmented_calculation->proc~generate_fragment_list proc~run_calculation run_calculation proc~run_calculation->proc~run_fragmented_calculation proc~compute_energy_and_forces compute_energy_and_forces proc~compute_energy_and_forces->proc~run_calculation proc~run_multi_molecule_calculations run_multi_molecule_calculations proc~run_multi_molecule_calculations->proc~run_calculation program~main main program~main->proc~run_calculation program~main->proc~run_multi_molecule_calculations

Variables

Type Visibility Attributes Name Initial
integer(kind=default_int), private :: n
integer(kind=default_int), private :: r

Source Code

   recursive subroutine generate_fragment_list(monomers, max_level, polymers, count)
      !! Generate all possible fragments (combinations of monomers) up to max_level
      !! Uses int64 for count to handle large numbers of fragments that overflow int32.
      integer(default_int), intent(in) :: monomers(:), max_level
      integer(default_int), intent(inout) :: polymers(:, :)
      integer(int64), intent(inout) :: count
      integer(default_int) :: r, n

      n = size(monomers, 1)
      do r = 2, max_level
         call combine(monomers, n, r, polymers, count)
      end do
   end subroutine generate_fragment_list