!23456789a123456789b123456789c123456789d123456789e123456789f123456789g12
!
! Copyright D.J. Jeffery, 2006jan01.
!
!  solar2.f is extracting the Grevesse & Sauval composition. 
!
!   References:
!
!     \bibitem[Metcalf et al.(2004)]{metcalf2004} Metcalf, M., Reid, J., \&~Cohen, M. 2004,
!          Fortran 95/2003 Explained
!          (Oxford:  Oxford University Press) (MRC)
!          % Pretty good reference book.
!
!23456789a123456789b123456789c123456789d123456789e123456789f123456789g12
!
      program solar2 
      use numerical
      use physical
      use astronomical
      use atomic_mod
      implicit none
!
      character :: record*80 
      character :: afmt*80='(48x,f5.2,11x,f5.2)'
      real (kind=nprecision) :: abund(natom) 
      real (kind=nprecision) :: tmp1=10.d0 
      real (kind=nprecision) :: tmp2=0.d0 
      integer :: idata
!
      open(unit=1,                                                        &
     &  file='/home/jeffery/public_html/astro/atomic/sad.txt',            &
     &     status='old',action='read')
        call readcopy(1,0,0,'',idata)  
        do410 : do i=1,natom
!          read(1,'(a80)') record 
!          write(*,'(a80)') record 
          read(1,afmt) abund(i),tmp2 
          write(*,afmt) abund(i),tmp2
!          if(i .eq. 4) stop
          if(abs(tmp2) .gt.  .000001) abund(i)=tmp2 
          if(abs(abund(i)) .lt.  .000001) abund(i)=-30
        end do do410
      close(unit=1)
!
!      abund(:)=10.d0**abund(:) 
!
      do430 : do i=5,natom+3,5
        write(*,'(5f8.2)') (abund(j),j=i-4,min(i,natom))
      end do do430
!
      end program solar2


