151 subroutine vcoord_gen(levs,lupp,pbot,psig,ppre,pupp,ptop,&
152 dpbot,dpsig,dppre,dpupp,dptop,pmin,ak,bk)
154 integer,
intent(in):: levs,lupp
155 real,
intent(in):: pbot,psig,ppre,pupp,ptop
156 real,
intent(in):: dpbot,dpsig,dppre,dpupp,dptop
157 real,
intent(out):: pmin,ak(0:levs),bk(0:levs)
158 integer,
parameter:: lo=100,li=10
213 c1=log(-sig2*(1-sig1)/sig1/(sig2-1))/lupp
214 c2=log((sig2-1)/(1-sig1))
216 dsig=(sig2-sig)*(sig-sig1)*c1/(sig1-sig2)
219 dsig=(sig2-sig)*(sig-sig1)*c1/(sig1-sig2)
223 delbio=delbio0+(delb-delbio0)*io/lo
224 deltio=deltio0+(delt-deltio0)*io/lo
226 c1sig1=-1/(sig1*(1-sig1)*lupp)
227 c1sig2=-1/(sig2*(sig2-1)*lupp)
229 dsig=(sig2-sig)*(sig-sig1)*c1/(sig1-sig2)
231 fjac(1,1)=((-c1*(sig+sig2)+(sig-sig1)*c1sig1*(sig1+sig2)) &
232 *(sig2-sig)/(sig1+sig2)**2)
233 fjac(1,2)=((c1*(sig+sig1)+(sig2-sig)*c1sig2*(sig1+sig2)) &
234 *(sig-sig1)/(sig1+sig2)**2)
236 dsig=(sig2-sig)*(sig-sig1)*c1/(sig1-sig2)
238 fjac(2,1)=((-c1*(sig+sig2)+(sig-sig1)*c1sig1*(sig1+sig2)) &
239 *(sig2-sig)/(sig1+sig2)**2)
240 fjac(2,2)=((c1*(sig+sig1)+(sig2-sig)*c1sig2*(sig1+sig2)) &
241 *(sig-sig1)/(sig1+sig2)**2)
242 call ludcmp(fjac,2,2,indx,d)
243 call lubksb(fjac,2,2,indx,p)
246 c1=log(-sig2*(1-sig1)/sig1/(sig2-1))/lupp
247 c2=log((sig2-1)/(1-sig1))
254 spre=(ppre-pupp)/pdif
255 spred=(ppred-pupp)/pdif
256 rkpre=(log((spre-sig2)/(sig1-spre))-c2)/c1
257 rkpred=(log((spred-sig2)/(sig1-spred))-c2)/c1
258 pkpre=pdif*c1*(sig2-spre)*(spre-sig1)/(sig1-sig2)
259 pkkpre=pkpre*c1*(sig2+sig1-2*spre)/(sig1-sig2)
261 ssig=(psig-pupp)/pdif
262 ssigd=(psigd-pupp)/pdif
263 rksig=(log((ssig-sig2)/(sig1-ssig))-c2)/c1
264 rksigd=(log((ssigd-sig2)/(sig1-ssigd))-c2)/c1
265 pksig=pdif*c1*(sig2-ssig)*(ssig-sig1)/(sig1-sig2)
266 pkksig=pksig*c1*(sig2+sig1-2*ssig)/(sig1-sig2)
300 a2(9,1)=(rkpre-rkpred)
301 a2(9,2)=(rkpre**2-rkpred**2)/2
302 a2(9,3)=(rkpre**3-rkpred**3)/3
303 a2(9,4)=(rkpred-rksigd)
304 a2(9,5)=(rkpred**2-rksigd**2)/2
305 a2(9,6)=(rksigd-rksig)
306 a2(9,7)=(rksigd**2-rksig**2)/2
307 a2(9,8)=(rksigd**3-rksig**3)/3
309 call ludcmp(a2,9,9,indx2,d)
310 call lubksb(a2,9,9,indx2,x2)
314 +x2(6)*(rksigd-rksig) &
315 +x2(7)*(rksigd**2-rksig**2)/2 &
316 +x2(8)*(rksigd**3-rksig**3)/3
318 +x2(4)*(rkpred-rksigd) &
319 +x2(5)*(rkpred**2-rksigd**2)/2
322 if(lupp.lt.levs)
then 323 pkupp=pdif*c1*(sig2-0)*(0-sig1)/(sig1-sig2)
324 pkkupp=pkupp*c1*(sig2+sig1-2*0)/(sig1-sig2)
329 x3(2)=pkkupp*pupp-pkupp**2
331 x3(3)=log((ptop+dptop)/pupp)
333 a3(3,2)=(levs-1-lupp)**2/2
334 a3(3,3)=(levs-1-lupp)**3/3
335 call ludcmp(a3,3,3,indx3,d)
336 call lubksb(a3,3,3,indx3,x3)
345 p1=pupp*exp(x3(1)*(k-lupp)+x3(2)*(k-lupp)**2/2+x3(3)*(k-lupp)**3/3)
347 p1=(sig1*exp(c1*k+c2)+sig2)/(exp(c1*k+c2)+1)*pdif+pupp
351 elseif(k.ge.rkpred)
then 352 p2=p2pred+x2(1)*(k-rkpred) &
353 +x2(2)*(k**2-rkpred**2)/2 &
354 +x2(3)*(k**3-rkpred**3)/3
355 elseif(k.ge.rksigd)
then 356 p2=p2sigd+x2(4)*(k-rksigd) &
357 +x2(5)*(k**2-rksigd**2)/2
358 elseif(k.ge.rksig)
then 359 p2=p2sig+x2(6)*(k-rksig) &
360 +x2(7)*(k**2-rksig**2)/2 &
361 +x2(8)*(k**3-rksig**3)/3
365 ak(k)=(p2*pbot-p1*pmin)/(pbot-pmin)
366 bk(k)=(p1-p2)/(pbot-pmin)
subroutine ludcmp(a, n, np, indx, d)
This subprogram decomposes a matrix into a product of lower and upper triangular matrices.
subroutine vcoord_gen(levs, lupp, pbot, psig, ppre, pupp, ptop, dpbot, dpsig, dppre, dpupp, dptop, pmin, ak, bk)
This subprogram generates hybrid coordinate interface profiles from a few given parameters.
subroutine lubksb(a, n, np, indx, b)
Lower and upper triangular back substitution.