  subroutine rdsinyuk_saharan_dust(nopr,iout,indir,outdir,lstrn,iset,&
  lset,llset,nlines,wcm,wavelength,rndat,ridat,iwave)

! ****
! Will use netCDF f90 routines
  use netcdf

! param1.inc gives the maximum size of indices and extinction vectors
  include 'param1.inc'

! ****
! See rdinoutdir.f90
  character(len=60) :: indir,outdir
  integer :: nopr,iout,iset

! See main.f90
  integer :: nlines,iwave
  real :: wcm(nwavemax),wavelength(nwavemax)
  real :: rndat(nwavemax),ridat(nwavemax)
  character(len=100) :: lstrn,lset,filnm

! See rdindices.f90
  character(len=16) :: llset

! Used here
  integer,parameter :: ndat=7,ncomp=2
  integer :: id1,istat,noprf
  integer :: start(1),count(1),stride(1)
  real :: wcmdat(ndat),wavedat(ndat)
  real :: rival1(ndat),rival2(ndat)
  character(len=30) :: fil
  character(len=16) :: files(ncomp)

! *****
! The different compositions
!          '1234567890123456'
  files(1)='Sinyuk imag dust'
  files(2)='Patter imag dust'

  do i=1,ncomp
   write(0,fmt=150) i,files(i)
   150 format(2x,i3,2x,a40)
  end do

  write(0,fmt=160)
  160 format(2x,"Specify mset (1-2) ")

  read(5,*) mset
  mset=int(mset)

! The compound string
  llset=files(mset)

  write(0,fmt=170) mset,llset
  170 format(2x," mset,llset ",i4,2x,a16)

! Read in the data from the netCDF file
   lset=lstrn

! ***
! The input netCDF file
!     '123456789012345678901234567890'
  fil='sinyuk_saharan_dust.nc        '
!       '1234567890123456'
   noprf=1
  call getfilnm(noprf,iout,fil,indir,filnm)
  if (noprf .eq. 1) then  
!  stop
  end if

! *****
! Open the netCDF file
   ifile=1
  istat=nf90_open(filnm,nf90_nowrite,id1)
  call handle(iout,istat)

! ***
! Get dimension ids
   noprg=0
  istat=nf90_inq_varid(id1,'nwave',idnwave)
   call handle(iout,istat)
  istat=nf90_inq_varid(id1,'ntext',idntext)
   call handle(iout,istat)
  istat=nf90_inq_varid(id1,'n70',idn70)
   call handle(iout,istat)

! ***
! Get the dimensions
  istat=nf90_get_var(id1,idnwave,nwave)
   call handle(iout,istat)
  istat=nf90_get_var(id1,idntext,ntext)
   call handle(iout,istat)
  istat=nf90_get_var(id1,idn70,n70)
   call handle(iout,istat)

  if (nopr .eq. 1) then
   write(iout,fmt=500) nwave,ntext,n70
   500 format(/,2x,"nwave ",i4,/,2x,"ntext ",i4,/,2x,"n70 ",i4)
  end if

! ***
! Get variable ids 
  istat=nf90_inq_varid(id1,'wcmobs',idwcm)
   call handle(iout,istat)
  istat=nf90_inq_varid(id1,'wmicobs',idwave)
   call handle(iout,istat)
  istat=nf90_inq_varid(id1,'rsinyuki',idri1)
   call handle(iout,istat)
  istat=nf90_inq_varid(id1,'rpattersoni',idri2)
   call handle(iout,istat)

  istat=nf90_inq_varid(id1,'text',idtext)
   call handle(iout,istat)

  if (nopr .eq. 1) then
   write(iout,fmt=510) idwcm,idwave,idri1,idri2,idtext
   510 format(/,2x," idwcm,idwave,idri1,idri2,idtext ",/,&
   2x,5(1x,i4))
  end if

! ***
! Get data
   nlines=ndat
   start(1)=1
   count(1)=ndat
   stride(1)=1
  istat=nf90_get_var(id1,idwcm,wcmdat,start,count,stride)
   call handle(iout,istat)
  istat=nf90_get_var(id1,idwave,wavedat,start,count,stride)
   call handle(iout,istat)
  istat=nf90_get_var(id1,idri1,rival1,start,count,stride)
   call handle(iout,istat)
  istat=nf90_get_var(id1,idri2,rival2,start,count,stride)
   call handle(iout,istat)

! ****
! exit define mode
  istat=nf90_enddef(id1)

! Close the data set
  istat=nf90_close(id1)

! *****
! Put values into the output arrays
  do i=1,nlines
   wcm(i)=wcmdat(i)
   wavelength(i)=wavedat(i)
   rndat(i)=0.0
   if (mset .eq. 1) then
    ridat(i)=rival1(i)
   endif
   if (mset .eq. 2) then
    ridat(i)=rival2(i)
   endif
  end do

! *****
  if (nopr .eq. 1) then
   write(iout,fmt=200) mset,files(mset)
   200 format(/,2x,"rdsinyuk_saharan_dust: mset,files(mset)",/,&
   2x,i4,2x,a16)
   write(iout,fmt=230)
   230 format(2x,"rdsinyuk_saharan_dust: i,wcm,wavelength,rndat and ridat")
   do i=1,nlines
    write(iout,fmt=240) i,wcm(i),wavelength(i),rndat(i),ridat(i)
    240 format(2x,i4,1p,2(1x,e10.3),2x,2(1x,e10.3))
   end do
  end if

! ******
  return
  end
