! GeParticleIndex.f90 ! ! Returns particle index for given particle name ! ! Detlef Irmscher, Thomas Ullrich, Uni Heidelberg, September 1993 ! Last update: 16.3.95 tu ! integer function GeParticleIndex (pname) use genesis_m, self=>GeParticleIndex implicit none character(len=*), intent(in) :: pname integer :: ipart do ipart = 1, size(particleList) if (particleList(ipart)%name == pname) exit enddo if (ipart > size(particleList)) then GeParticleIndex = -1 write (errmess, *) 'particle ', pname, ' not found' call GeErrorMessage ("GeParticleIndex", errmess) else GeParticleIndex = ipart endif end function GeParticleIndex