c     ******************************************************************
      PROGRAM ifspppl_driver
c
      IMPLICIT NONE
c
      integer switches(32), ipin, ipout, iptmp, screen, ii, ierr
      parameter (ipin=7,iptmp=8,ipout=9,screen=6)
      real znine, zncne, znbne, zrlt, zrln, zq, zshat, zeps,
     &       ne19, tekev, tikev, rmajor, grhoi, gvti, gnu,
     &       chii, chie, zkappa, btesla, gtau, omegaexb,
     &       zchiicyc, zchii1, zchii2, zchie1, zchie2,
     &       zrlt1, zrlt2
c
      namelist /input/ znine, zncne, znbne, zrlt, zrln,
     &     zq, zshat, zeps, zkappa, omegaexb,
     &     ne19, tekev, tikev, rmajor, btesla,
     &     grhoi, gvti, gnu, gtau,
     &     switches
c
      open(ipin,  file='ipin',  status='old')
      open(iptmp, file='iptmp', status='unknown')
      open(ipout, file='ipout', status='unknown')
c
c     Strip the annotation out of ipin
c
      call stripx (ipin, iptmp, ipout)
c
c  read in and write data
c  default values:  (Cyclone DIII-D case)
c
      do ii = 1, 32
         switches(ii) = 0
      end do
c
      znine = 1.0
      zncne = 0.0
      znbne = 0.0
      zrlt = 6.9
      zrln = 2.2
      zq = 1.4
      zshat = 0.78
      zeps = 0.18
      zkappa = 1.0
c
      ne19 = 4.7
      tekev = 3.5
      tikev = 3.5
      rmajor = 1.69
      btesla = 1.91
      omegaexb = 0.0
c
      grhoi = 0.0045
      gvti = 4.1e5
      gnu = 1.36
      gtau = 1.0
c
      read (iptmp,input)
c
c     Force output channels
c
      switches(1) = 1
      switches(30) = ipout
      switches(31) = screen
      switches(32) = 0
c
c     Force quasi-neutrality by calculating the beam fraction
c
      znbne = 1.0 - znine - 6.0*zncne
c
c     Call the IFS/PPPL model
c
      call IFSPPPL( znine, zncne, znbne, zrlt, zrln,
     &     zq, zshat, zeps, zkappa, omegaexb,
     &     ne19, tekev, tikev, rmajor, btesla,
     &     switches, grhoi, gvti, gnu, gtau,
     &     chii, chie,
     &     zchiicyc, zchii1, zchii2, zchie1, zchie2,
     &     zrlt1, zrlt2, ierr )
c
c     No output is necessary from here -- the subroutine will do it
c
      stop
      end
c
