c
      PROGRAM radiation
C
      IMPLICIT REAL*8(A-H,O-Z)
c
c      DIP=90.d0
c      RAK=0.d0
c      write(*,*)'Dip and Rake angles (deg)=',DIP,RAK
c
      pi2=datan(1.d0)*8.d0
      OPEN (UNIT=9,FILE='S-radiation.csv')
      write(9,*)'dip,rake,SH,SV,Total-S'
c
      do 100 idip=0,18
      do 100 irak=0,18
      
        DIPd=dfloat(idip)*5.d0
        RAKd=dfloat(irak)*5.d0
c
        DIP=DIPd*pi2/360.d0
        RAK=RAKd*pi2/360.d0
c
        SDP= DSIN(DIP)
        SDP2=SDP*SDP
        CDP= DCOS(DIP)
        CDP2=CDP*CDP
        CDP4= DCOS(4.d0*DIP)
        CDP22=(1.d0+CDP4)/2.d0
        SDP22=(1.d0-CDP4)/2.d0
c
        CRK= DCOS(RAK)
        SRK= DSIN(RAK)
        CRK2=CRK*CRK
        SRK2=SRK*SRK
c
        FshH=2.d0*CRK2*(1.d0+SDP2)+SRK2*(1.d0+CDP22)
        FshH=dsqrt(FshH/3.d0)/2.d0
        FsvH=CRK2*(4.d0+10.d0*CDP2)+SRK2*(14.d0+5.d0*SDP22)
        FsvH=dsqrt(FsvH/15.d0)/2.d0
c
        SFH=dsqrt(FshH*FshH+FsvH*FsvH)
        write(9,*)DIPd,',',RAKd,',',FshH,',', FsvH,',',SFH
c
  100 continue
c
      stop
      end

