15 subroutine optconst(lambda,n,k)
18 real(dp),
intent(in) :: lambda
19 real(dp),
intent(out) :: n
20 real(dp),
intent(out) :: k
25 real(dp),
parameter :: epsabs = 0.0e0_dp
26 real(dp),
parameter :: epsrel = 0.001e0_dp
35 b=lambdan(
size(lambdan))
37 write(*,*)
'No data for such low wavelength.' 38 write(*,*)
'Minimum wavelength is',a
40 elseif (lambda>b)
then 41 call qag ( nwew, a, b, epsabs, epsrel, 1, res, abserr, neval, ier )
43 write(*,*)
'qag returned',ier
44 write(*,*)
'wavelength',lambda
45 write(*,*)
'new real part of refractive index not calculated' 49 call qag ( kwew, a, b, epsabs, epsrel, 1, res, abserr, neval, ier )
51 write(*,*)
'qag returned',ier
52 write(*,*)
'wavelength',lambda
53 write(*,*)
'new imaginery part of refractive index not calculated' 57 call qag ( planck2, a, b, epsabs, epsrel, 1, res, abserr, neval, ier )
59 write(*,*)
'qag returned',ier
60 write(*,*)
'wavelength',lambda
61 write(*,*)
'new refractive index not calculated' 68 call pwl_interp_1d (
size(lambdan), lambdan, nwl, ni, xi, yi )
70 call pwl_interp_1d (
size(lambdak), lambdak, kwl, ni, xi, yi )
73 end subroutine optconst
79 real(dp) function nwew ( lambda )
88 call pwl_interp_1d (
size(lambdan), lambdan, nwl, ni, xi, yi )
89 nwew=yi(1)*planck(tmean,lambda)
96 real(dp) function kwew ( lambda )
105 call pwl_interp_1d (
size(lambdak), lambdak, kwl, ni, xi, yi )
106 kwew=yi(1)*planck(tmean,lambda)
113 real(dp) function planck(temp,lambda)
115 real(dp),
intent(in) :: temp
116 real(dp),
intent(in) :: lambda
121 planck=2*pi*hpc*c0**2/(n**2*lambda**5*(exp(hpc*c0/(n*lambda*kb*temp))-1))
128 real(dp) function planck2(lambda)
130 real(dp),
intent(in) :: lambda
132 planck2=planck(tmean,lambda)