build_c_species_names Subroutine

private subroutine build_c_species_names(params, c_names_flat, n_len)

Build a flattened C-compatible species-name buffer.

Arguments

Type IntentOptional Attributes Name
type(case_params_t), intent(in) :: params
character(kind=c_char, len=1), intent(out), allocatable :: c_names_flat(:)
integer, intent(out) :: n_len

Called by

proc~~build_c_species_names~~CalledByGraph proc~build_c_species_names mod_energy::build_c_species_names proc~enthalpy_from_temperature_cantera_point mod_energy::enthalpy_from_temperature_cantera_point proc~enthalpy_from_temperature_cantera_point->proc~build_c_species_names proc~recover_temperature_and_update_thermo_cantera mod_energy::recover_temperature_and_update_thermo_cantera proc~recover_temperature_and_update_thermo_cantera->proc~build_c_species_names proc~recover_temperature_cantera mod_energy::recover_temperature_cantera proc~recover_temperature_cantera->proc~build_c_species_names proc~update_thermo_from_temperature_cantera mod_energy::update_thermo_from_temperature_cantera proc~update_thermo_from_temperature_cantera->proc~build_c_species_names proc~advance_energy_transport mod_energy::advance_energy_transport proc~advance_energy_transport->proc~recover_temperature_and_update_thermo_cantera proc~boundary_enthalpy_from_temperature mod_energy::boundary_enthalpy_from_temperature proc~advance_energy_transport->proc~boundary_enthalpy_from_temperature proc~boundary_enthalpy_from_temperature->proc~enthalpy_from_temperature_cantera_point proc~initialize_energy mod_energy::initialize_energy proc~initialize_energy->proc~update_thermo_from_temperature_cantera program~lowmach_react_hex lowmach_react_hex program~lowmach_react_hex->proc~advance_energy_transport program~lowmach_react_hex->proc~initialize_energy

Source Code

   subroutine build_c_species_names(params, c_names_flat, n_len)
      type(case_params_t), intent(in) :: params
      character(kind=c_char), allocatable, intent(out) :: c_names_flat(:)
      integer, intent(out) :: n_len

      integer :: k, j, nsp

      nsp = max(1, params%nspecies)
      n_len = len(params%species_name(1))
      allocate(c_names_flat(n_len * nsp))
      c_names_flat = ' '

      do k = 1, nsp
         do j = 1, n_len
            c_names_flat((k-1)*n_len + j) = char(iachar(params%species_name(k)(j:j)), kind=c_char)
         end do
      end do
   end subroutine build_c_species_names