      subroutine trxpl_species(nspec,iorder,ztype,ids)
 
      !  get species list and acquire profiles; add to lists
 
      implicit NONE
 
      integer, intent(in) :: nspec      ! no. of species (prior trx_nspec call)
      integer, intent(in) :: iorder     ! fit order (e.g. 1 for Hermite)
      character*(*), intent(in) :: ztype  ! type of data: "N", "T", ...
 
      integer, intent(out) :: ids(nspec) ! xplasma ids
 
      include 'trxpl.blk'
 
      !-------------------------------------
      integer :: igot   ! no. of species found (will match nspec)
      integer :: i,j,ierr,idum1,idum2,idup,ixid
      character*20 zlbl
      character*10 zuns
      !-------------------------------------
 
c  Acquire the ids for species densities
 
      ids=0
 
      call trx_spec_prof(nspec,igot,iorder,ztype,ids(1:nspec),
     >   ierr)
 
      if(ierr.ne.0) then
         write(6,*) ' ?trxpl_species:  error getting "'//ztype//
     >      '" profile ids'
      endif
 
      do i=1,nspec
         if(ids(i).gt.0) then
            call trx_uget(ids(i),ixid,zlbl,zuns,idum1,idum2)
            idup=0
            do j=1,numpro
               if(prolabs(1,j)//prolabs(2,j).eq.zlbl) idup=j
            enddo
            if(idup.eq.0) then
               numpro=numpro+1
               prolabs(1,numpro)=zlbl(1:10)
               prolabs(2,numpro)=zlbl(11:20)
               prolabs(3,numpro)=zuns
               id_pros(numpro)=ids(i)
               id_xaxis(numpro)=ixid
            endif
         endif
      enddo
 
      return
      end
