12 public scattwall,trextwall,absorwall,scattcoeffintwall,&
13 trextcoeffintwall,abscoeffintwall,filmconst
17 subroutine filmconst(lambda,theta,h,Rwin,Twin,Awin)
18 real(dp),
intent(in) :: lambda
19 real(dp),
intent(in) :: theta
20 real(dp),
intent(in) :: h
21 real(dp),
intent(out) :: Rwin
22 real(dp),
intent(out) :: Twin
23 real(dp),
intent(out) :: Awin
37 call optconst(lambda,n2,k2)
49 p=sqrt((sqrt((n2**2-k2**2-n1**2*sin(theta)**2)**2+4*n2**2*k2**2)+&
50 (n2**2-k2**2-n1**2*sin(theta)**2))/2)
51 q=sqrt((sqrt((n2**2-k2**2-n1**2*sin(theta)**2)**2+4*n2**2*k2**2)-&
52 (n2**2-k2**2-n1**2*sin(theta)**2))/2)
53 theta2=atan(sin(theta)*n1/p)
54 rho12=((n1*cos(theta)-p)**2+q**2)/((n1*cos(theta)+p)**2+q**2)
55 rho12=rho12*(1+((p-n1*sin(theta)*tan(theta))**2+q**2)/&
56 ((p+n1*sin(theta)*tan(theta))**2+q**2))/2
64 dzeta=4*pi*n2*h/lambda
65 rwin=(r12**2+2*r12*r23*exp(-kappa2*h)*cos(dzeta)+r23**2*exp(-2*kappa2*h))/&
66 (1+2*r12*r23*exp(-kappa2*h)*cos(dzeta)+r12**2*r23**2*exp(-2*kappa2*h))
67 twin=(tau12*tau23*exp(-kappa2*h))/&
68 (1+2*r12*r23*exp(-kappa2*h)*cos(dzeta)+r12**2*r23**2*exp(-2*kappa2*h))
73 theta2=asin(sin(theta)/n2)
74 rho12=(((cos(theta2)-n2*cos(theta))/(cos(theta2)+n2*cos(theta)))**2+&
75 ((cos(theta)-n2*cos(theta2))/(cos(theta)+n2*cos(theta2)))**2)/2
76 rho23=(((n2*cos(theta)-cos(theta2))/(n2*cos(theta)+cos(theta2)))**2+&
77 ((n2*cos(theta2)-cos(theta))/(n2*cos(theta2)+cos(theta)))**2)/2
79 rwin=(rho12+(1-2*rho12)*rho23*tau12**2)/(1-rho12*rho23*tau12**2)
80 twin=(1-rho12)*(1-rho23)*tau12/(1-rho12*rho23*tau12**2)
84 cn=cmplx(n2,-k2,kind=dp)
85 theta2=asin(sin(theta)/n2)
86 rho12=(((cos(theta2)-n2*cos(theta))/(cos(theta2)+n2*cos(theta)))**2+&
87 ((cos(theta)-n2*cos(theta2))/(cos(theta)+n2*cos(theta2)))**2)/2
88 rho23=(((n2*cos(theta)-cos(theta2))/(n2*cos(theta)+cos(theta2)))**2+&
89 ((n2*cos(theta2)-cos(theta))/(n2*cos(theta2)+cos(theta)))**2)/2
96 beta=2*pi*cn*h*cos(theta2)/lambda
97 rc=(r12+r23*exp(-iu*2*beta))/(1+r12*r23*exp(-iu*2*beta))
98 tc=(t12*t23*exp(-iu*beta))/(1+r12*r23*exp(-iu*2*beta))
104 cn=cmplx(n2,-k2,kind=dp)
105 theta2=asin(sin(theta)/n2)
106 r12=(cos(theta2)-n2*cos(theta))/(cos(theta2)+n2*cos(theta))
111 beta=2*pi*cn*h*cos(theta2)/lambda
112 rc=(r12+r23*exp(-iu*2*beta))/(1+r12*r23*exp(-iu*2*beta))
113 tc=(t12*exp(-iu*beta))/(1+r12*r23*exp(-iu*2*beta))
114 r12=(cos(theta)-n2*cos(theta2))/(cos(theta)+n2*cos(theta2))
118 rc2=(r12+r23*exp(-iu*2*beta))/(1+r12*r23*exp(-iu*2*beta))
119 tc2=(t12*exp(-iu*beta))/(1+r12*r23*exp(-iu*2*beta))
120 rwin=(abs(rc)**2+abs(rc2)**2)/2
121 twin=(abs(tc)**2+abs(tc2)**2)/2
124 stop
'unknown method for calculation of slab reflectivity' 126 end subroutine filmconst
132 real(dp) function scattwall ( dw )
134 real(dp),
intent(in) :: dw
135 real(dp) :: wtweight,dwold
140 real(dp),
parameter :: epsabs = 0.0e0_dp
141 real(dp),
parameter :: epsrel = 1e-3_dp
148 wtweight=1/(sqrt(2*pi)*wsdev*dw)*exp(-(log(dw)-log(dwall))**2/(2*wsdev**2))
151 call qags(scattcoeffintwall, a, b, epsabs, epsrel, res, abserr, neval, ier)
153 write(*,*)
'qags returned',ier
154 write(*,*)
'wall thickness',dw
155 write(*,*)
'scattering coefficient of walls not calculated' 158 scattwall=res*(1-por)/dwall*wtweight
160 end function scattwall
166 real(dp) function trextwall ( dw )
168 real(dp),
intent(in) :: dw
169 real(dp) :: wtweight,dwold
174 real(dp),
parameter :: epsabs = 0.0e0_dp
175 real(dp),
parameter :: epsrel = 0.001e0_dp
182 wtweight=1/(sqrt(2*pi)*wsdev*dw)*exp(-(log(dw)-log(dwall))**2/(2*wsdev**2))
185 call qags(trextcoeffintwall, a, b, epsabs, epsrel, res, abserr, neval, ier)
187 write(*,*)
'qags returned',ier
188 write(*,*)
'wall thickness',dw
189 write(*,*)
'transport extinction coefficient of walls not calculated' 192 trextwall=res*(1-por)/dwall*wtweight
194 end function trextwall
200 real(dp) function absorwall ( dw )
202 real(dp),
intent(in) :: dw
203 real(dp) :: wtweight,dwold
208 real(dp),
parameter :: epsabs = 0.0e0_dp
209 real(dp),
parameter :: epsrel = 0.001e0_dp
216 wtweight=1/(sqrt(2*pi)*wsdev*dw)*exp(-(log(dw)-log(dwall))**2/(2*wsdev**2))
219 call qags ( abscoeffintwall, a, b, epsabs, epsrel, res, abserr, neval, ier )
221 write(*,*)
'qags returned',ier
222 write(*,*)
'wall thickness',dw
223 write(*,*)
'absorption coefficient of walls not calculated' 226 absorwall=res*(1-por)/dwall*wtweight
228 end function absorwall
234 real(dp) function scattcoeffintwall ( theta )
235 real(dp),
intent(in) :: theta
236 real(dp) :: Rwin,Twin,Awin
237 call filmconst(
lambda,theta,dwall,rwin,twin,awin)
238 scattcoeffintwall=rwin*sin(theta)*cos(theta)
239 end function scattcoeffintwall
245 real(dp) function trextcoeffintwall ( theta )
246 real(dp),
intent(in) :: theta
247 real(dp) :: Rwin,Twin,Awin
248 call filmconst(
lambda,theta,dwall,rwin,twin,awin)
249 trextcoeffintwall=(1-twin+rwin*cos(2*theta))*sin(theta)*cos(theta)
250 end function trextcoeffintwall
256 real(dp) function abscoeffintwall ( theta )
257 real(dp),
intent(in) :: theta
258 real(dp) :: Rwin,Twin,Awin
259 call filmconst(
lambda,theta,dwall,rwin,twin,awin)
260 abscoeffintwall=awin*sin(theta)*cos(theta)
261 end function abscoeffintwall
double lambda
Latent heat of blowing agent, J/kg.