atomic_structure_center Function

public function atomic_structure_center(self, weight) result(r)

Uses

  • proc~~atomic_structure_center~~UsesGraph proc~atomic_structure_center atomic_structure%atomic_structure_center module~strings strings proc~atomic_structure_center->module~strings iso_c_binding iso_c_binding module~strings->iso_c_binding

Type Bound

atomic_structure

Arguments

Type IntentOptional Attributes Name
class(atomic_structure) :: self
character(len=*), optional :: weight

Return Value real(kind=c_double), (3)


Calls

proc~~atomic_structure_center~~CallsGraph proc~atomic_structure_center atomic_structure%atomic_structure_center proc~to_upper to_upper proc~atomic_structure_center->proc~to_upper

Called by

proc~~atomic_structure_center~~CalledByGraph proc~atomic_structure_center atomic_structure%atomic_structure_center proc~get_td_transition_dipole get_td_transition_dipole proc~get_td_transition_dipole->proc~atomic_structure_center proc~get_transition_dipole get_transition_dipole proc~get_transition_dipole->proc~atomic_structure_center proc~tdhf_energy tdhf_energy proc~tdhf_energy->proc~get_td_transition_dipole proc~tdhf_mrsf_energy tdhf_mrsf_energy proc~tdhf_mrsf_energy->proc~get_transition_dipole proc~tdhf_sf_energy tdhf_sf_energy proc~tdhf_sf_energy->proc~get_transition_dipole proc~tdhf_energy_c tdhf_energy_C proc~tdhf_energy_c->proc~tdhf_energy proc~tdhf_mrsf_energy_c tdhf_mrsf_energy_C proc~tdhf_mrsf_energy_c->proc~tdhf_mrsf_energy proc~tdhf_sf_energy_c tdhf_sf_energy_C proc~tdhf_sf_energy_c->proc~tdhf_sf_energy

Source Code

  function atomic_structure_center(self, weight) result(r)
    use strings, only: to_upper
    implicit none
    class(atomic_structure) :: self
    character(len=*), optional :: weight
    real(c_double) :: r(3)
    character(len=8) :: wtype
    character(len=8), parameter :: WTYPE_NONE = 'NONE'
    character(len=8), parameter :: WTYPE_MASS = 'MASS'

    wtype = WTYPE_NONE

    if (present(weight)) wtype = to_upper(weight)

    r = 0

    select case (wtype)

    case(WTYPE_NONE)
      r = sum(self%xyz,2)/ubound(self%xyz,2)

    case(WTYPE_MASS)
      r = matmul(self%xyz,self%mass)/sum(self%mass)

    case default
      error stop "Unknown weight type in atomic_structure_center: "//wtype
    end select

  end function atomic_structure_center