36 logical identity,bresse,jump
39 integer nelem,nactdog(0:3,*),node1,node2,nodem,indexup,i,
40 & ielprop(*),nodef(*),idirf(*),index,iflag,mi(*),nsol,
41 & inv,numf,nodesg,nelemdown,nelemup,node0,kon(*),ipkon(*)
43 real*8 prop(*),v(0:mi(2),*),xflow,f,
df(*),b,d,c,p,
44 & h1,h2,rho,dvi,friction,reynolds,dg,
b1,b2,
45 & g(3),dl,xks,
z1,z2,co(3,*),xflow2,dyg3dbj,dyg4dbj,
46 & s0,sqrts0,hk,form_fact,h1ns,h2ns,h0,dyg3deta,dyg4deta,
47 & dh3dh1,dh4dh2,dh3dm,dh4dm,eta,da3deta,da4deta,bj,
48 & theta,cth,tth,um1,um2,a1,a2,p1,p2,d1,d2,da1dh1,da2dh2,
49 & dp1dh1,dp2dh2,dd1dh1,dd2dh2,h3,h4,dh3deta,xn1,xn2,xt1,xt2,
50 & dh4deta,yg3,yg4,dyg3dh3,dyg4dh4,a3,a4,da3dh3,da4dh4,
51 & dum1dh1,dum2dh2,
c1,c2,dbds,dbjdeta,e0,e1,e2,e3,
52 & dyg3dm,dyg4dm,da3dm,da4dm,dyg3dh1,dyg4dh2,
53 & da3dh1,da4dh2,solreal(3),solimag(3),
dist 64 if(nactdog(2,node1).ne.0)
then 66 elseif(nactdog(2,node2).ne.0)
then 68 elseif(nactdog(1,nodem).ne.0)
then 72 elseif((iflag.eq.1).or.(iflag.eq.2))
then 79 z1=-g(1)*co(1,node1)-g(2)*co(2,node1)-g(3)*co(3,node1)
80 z2=-g(1)*co(1,node2)-g(2)*co(2,node2)-g(3)*co(3,node2)
82 dg=dsqrt(g(1)*g(1)+g(2)*g(2)+g(3)*g(3))
89 if(lakon(nelem)(6:7).eq.
'SG')
then 98 sqrts0=dsqrt(1.d0-s0*s0)
102 if(dabs(xflow).lt.1.d-30)
then 106 if(nactdog(2,node1).ne.0)
then 112 xflow=2.d0*dg*(rho*b*h2)**2*(h1-h2*sqrts0)
113 if(xflow.lt.0.d0)
then 114 write(*,*)
'*ERROR in liquidchannel: water level' 115 write(*,*)
' upstream of sluice gate is ' 116 write(*,*)
' smaller than downstream heigh 128 call hcrit(xflow,rho,b,theta,dg,sqrts0,hk)
134 if(nactdog(2,node1).ne.0) v(2,node1)=3.d0*hk/2.d0
140 if(nactdog(2,node1).ne.0) v(2,node1)=
141 & xflow**2/(2.d0*dg*(rho*b*h2)**2)+h2*sqrts0
145 elseif(lakon(nelem)(6:7).eq.
'WE')
then 155 if(dabs(xflow).lt.1.d-30)
then 159 if(nactdog(2,node1).ne.0)
then 166 write(*,*)
'*ERROR in liquidchannel' 167 write(*,*)
' weir height exceeds' 168 write(*,*)
' upstream level' 171 xflow=rho*c*b*(h1-p)**(1.5d0)
178 call hcrit(xflow,rho,b,theta,dg,sqrts0,hk)
183 if(nactdog(2,node1).ne.0) v(2,node1)=p+3.d0*hk/2.d0
190 elseif(lakon(nelem)(6:7).eq.
'DS')
then 191 if(dabs(xflow).lt.1.d-30)
then 206 sqrts0=dsqrt(1.d0-s0*s0)
209 call hcrit(xflow,rho,b,theta,dg,sqrts0,hk)
230 if((lakon(nelem)(6:7).eq.
'SG').or.
231 & (lakon(nelem)(6:7).eq.
'SO').or.
232 & (lakon(nelem)(6:7).eq.
'WO').or.
233 & (lakon(nelem)(6:7).eq.
'RE').or.
234 & (lakon(nelem)(6:7).eq.
' ').or.
235 & (lakon(nelem)(6:7).eq.
'DS').or.
236 & (lakon(nelem)(6:7).eq.
'DO'))
then 242 sqrts0=dsqrt(1.d0-s0*s0)
243 if(lakon(nelem)(6:7).ne.
'SG')
then 248 dl=dsqrt((co(1,node2)-co(1,node1))**2+
249 & (co(2,node2)-co(2,node1))**2+
250 & (co(3,node2)-co(3,node1))**2)
255 elseif(lakon(nelem)(6:7).eq.
'WE')
then 261 elseif((lakon(nelem)(6:7).eq.
'CO').or.
262 & (lakon(nelem)(6:7).eq.
'EL'))
then 269 sqrts0=dsqrt(1.d0-s0*s0)
273 dl=dsqrt((co(1,node2)-co(1,node1))**2+
274 & (co(2,node2)-co(2,node1))**2+
275 & (co(3,node2)-co(3,node1))**2)
282 elseif((lakon(nelem)(6:7).eq.
'ST').or.
283 & (lakon(nelem)(6:7).eq.
'DR'))
then 290 sqrts0=dsqrt(1.d0-s0*s0)
294 dl=dsqrt((co(1,node2)-co(1,node1))**2+
295 & (co(2,node2)-co(2,node1))**2+
296 & (co(3,node2)-co(3,node1))**2)
306 if(xflow.ge.0.d0)
then 323 if(lakon(nelem)(6:7).eq.
'SG')
then 331 call hcrit(xflow,rho,b,theta,dg,sqrts0,hk)
335 nelemdown=nint(prop(index+5))
336 h3=v(2,kon(ipkon(nelemdown)+3))
337 call hns(b,theta,rho,dg,sqrts0,xflow,h2,h2ns)
348 df(1)=2.d0*dg*(rho*b*h2)**2
350 f=
df(1)*(h1-h2*sqrts0)
351 df(3)=2.d0*f/h2-
df(1)*sqrts0
362 f=prop(index+4)-0.5d0
365 elseif(lakon(nelem)(6:7).eq.
'SO')
then 370 nelemup=nint(prop(index+6))
371 node0=kon(ipkon(nelemup)+1)
373 h1=prop(ielprop(nelemup)+3)
377 call hcrit(xflow,rho,b,theta,dg,sqrts0,hk)
381 call hns(b,theta,rho,dg,sqrts0,xflow,h1,h1ns)
396 h1=prop(ielprop(nelemup)+3)
412 df(4)=2.d0*dg*(rho*b*h1)**2
415 f=
df(4)*(h0-h2*sqrts0)
425 df(4)=2.d0*dg*(rho*b*h2)**2
428 f=
df(4)*(h0-h2*sqrts0)
429 df(3)=
df(3)+2.d0*f/h2
434 elseif(lakon(nelem)(6:7).eq.
'WE')
then 439 nelemdown=nint(prop(index+5))
440 h3=v(2,kon(ipkon(nelemdown)+3))
444 call hcrit(xflow,rho,b,theta,dg,sqrts0,hk)
457 f=rho*c*b*(h1-p)**(1.5d0)
458 df(1)=3.d0*f/(2.d0*(h1-p))
471 f=prop(index+4)-0.5d0
474 elseif(lakon(nelem)(6:7).eq.
'WO')
then 479 nelemup=nint(prop(index+6))
480 node0=kon(ipkon(nelemup)+1)
483 p=prop(ielprop(nelemup)+2)
487 call hcrit(xflow,rho,b,theta,dg,sqrts0,hk)
497 p=prop(ielprop(nelemup)+2)
498 s0=dasin(p/dsqrt(dl**2+p**2))
500 sqrts0=dsqrt(1.d0-s0*s0)
516 elseif(lakon(nelem)(6:7).eq.
'DS')
then 521 call hcrit(xflow,rho,b,theta,dg,sqrts0,hk)
525 nelemdown=nint(prop(index+8))
526 h3=v(2,kon(ipkon(nelemdown)+3))
550 f=prop(index+7)-0.5d0
560 nelemup=nint(prop(index+6))
562 nodef(1)=kon(ipkon(nelemup)+2)
564 f=prop(index+7)-0.5d0
567 elseif(lakon(nelem)(6:7).eq.
'DO')
then 573 call hcrit(xflow,rho,b,theta,dg,sqrts0,hk)
576 nelemup=nint(prop(index+6))
577 node0=kon(ipkon(nelemup)+1)
604 v(2,node1)=(h0+h2)/2.d0
619 v(2,node1)=(h0+h2)/2.d0
621 elseif(lakon(nelem)(6:7).eq.
'RE')
then 626 call hcrit(xflow,rho,b,theta,dg,sqrts0,hk)
640 call hns(b,theta,rho,dg,sqrts0,xflow,h1,h1ns)
647 nelemup=nint(prop(index+6))
648 nodesg=kon(ipkon(nelemup)+2)
655 index=ielprop(nelemup)
656 if(lakon(nelemup)(6:7).eq.
'SG')
then 657 f=prop(index+4)-0.5d0
658 elseif(lakon(nelemup)(6:7).eq.
'WE')
then 659 f=prop(index+4)-0.5d0
660 elseif(lakon(nelemup)(6:7).eq.
'DS')
then 661 f=prop(index+7)-0.5d0
670 elseif(lakon(nelem)(6:7).eq.
'CO')
then 674 call hcrit(xflow,rho,b2,theta,dg,sqrts0,hk)
678 if((h1.gt.hk).and.(h2.lt.hk))
then 682 if((h1.lt.hk).and.(h2.gt.hk))
then 692 df(1)=
b1*(2.d0*xflow2+
c1*
b1*b2*h2**3)
693 df(3)=b2*(2.d0*xflow2+
c1*
b1*
b1*h1**3)
697 df(2)=4.d0*(
b1*h1-b2*h2)*xflow
699 elseif(lakon(nelem)(6:7).eq.
'EL')
then 703 call hcrit(xflow,rho,b2,theta,dg,sqrts0,hk)
707 if((h1.gt.hk).and.(h2.lt.hk))
then 711 if((h1.lt.hk).and.(h2.gt.hk))
then 721 df(1)=
b1*(2.d0*xflow2+
c1*b2*b2*h2**3)
722 df(3)=b2*(2.d0*xflow2+
c1*
b1*b2*h1**3)
724 df(1)=
df(1)-3.d0*
c1*c2*b2*h1
725 df(3)=3.d0*
c1*c2*b2*h2-
df(3)
726 df(2)=4.d0*(
b1*h1-b2*h2)*xflow
728 elseif(lakon(nelem)(6:7).eq.
'DR')
then 732 call hcrit(xflow,rho,b,theta,dg,sqrts0,hk)
736 if((h1.gt.hk).and.(h2.lt.hk))
then 740 if((h1.lt.hk).and.(h2.gt.hk))
then 747 df(1)=2.d0*xflow2+
c1*b*b*h2**3
748 df(3)=2.d0*xflow2+
c1*b*b*h1*(h1+d)**2
750 df(1)=
df(1)-
c1*b*b*h2*(3.d0*h1+d)*(h1+d)
751 df(3)=3.d0*
c1*b*b*h1*h2*h2-
df(3)
752 df(2)=4.d0*(h1-h2)*xflow
754 elseif(lakon(nelem)(6:7).eq.
'ST')
then 758 call hcrit(xflow,rho,b,theta,dg,sqrts0,hk)
762 if((h1.gt.hk).and.(h2.lt.hk))
then 766 if((h1.lt.hk).and.(h2.gt.hk))
then 773 df(1)=2.d0*xflow2+
c1*b*b*h2*(h2+d)**2
774 df(3)=2.d0*xflow2+
c1*b*b*h1**3
776 df(1)=
df(1)-3.d0*
c1*b*b*h1*h1*h2
777 df(3)=
c1*b*b*h1*(3.d0*h2+d)*(h2+d)-
df(3)
778 df(2)=4.d0*(h1-h2)*xflow
780 elseif(lakon(nelem)(6:7).eq.
' ')
then 788 if((bresse).or.(jump))
then 797 reynolds=4.d0*xflow/(b*dvi)
804 call hcrit(xflow,rho,b,theta,dg,sqrts0,hk)
807 if((h1.gt.hk).and.(h2.lt.hk))
then 811 if((h1.lt.hk).and.(h2.gt.hk))
then 826 if(lakon(nelem)(6:7).eq.
' ')
then 837 d2=b2+dl*dbds+h2*dd2dh2
842 a2=h2*(b2+dl*dbds+h2*tth)
849 p2=b2+dl*dbds+2.d0*h2/cth
863 um1=xks*xks*dg*(p1/a1)**(1.d0/3.d0)
864 um2=xks*xks*dg*(p2/a2)**(1.d0/3.d0)
866 & (p1**(-2.d0/3.d0)*dp1dh1*a1**(1.d0/3.d0)-
867 & a1**(-2.d0/3.d0)*da1dh1*p1**(1.d0/3.d0))/
868 & (3.d0*a1**(2.d0/3d0))
870 & (p2**(-2.d0/3.d0)*dp2dh2*a2**(1.d0/3.d0)-
871 & a2**(-2.d0/3.d0)*da2dh2*p2**(1.d0/3.d0))/
872 & (3.d0*a2**(2.d0/3d0))
886 nelemup=prop(index+6)
887 indexup=ielprop(nelemup)
888 if(lakon(nelemup)(6:7).eq.
'SG')
then 890 prop(indexup+7)=nelem
891 elseif(lakon(nelemup)(6:7).eq.
'WE')
then 893 prop(indexup+7)=nelem
894 elseif(lakon(nelemup)(6:7).eq.
'DS')
then 896 prop(indexup+9)=nelem
903 xt1=
c1*a1**3+(h1*dbds-um1*p1)*xflow2
904 xt2=
c1*a2**3+(h2*dbds-um2*p2)*xflow2
908 xn1=c2*a1**3-d1*xflow2
909 xn2=c2*a2**3-d2*xflow2
914 h4=h2-dl*xt2/xn2*(1.d0-eta)
928 da3dh3=bj+2.d0*h3*tth
929 da4dh4=bj+2.d0*h4*tth
933 yg3=h3*(3.d0*bj+2.d0*h3*tth)/(6.d0*(bj+h3*tth))
934 yg4=h4*(3.d0*bj+2.d0*h4*tth)/(6.d0*(bj+h4*tth))
935 dyg3dh3=((3.d0*bj+4.d0*h3*tth)*(bj+tth)
936 & -tth*h3*(3.d0*bj+2.d0*h3*tth))/
937 & (6.d0*(bj+h3*tth)**2)
938 dyg4dh4=((3.d0*bj+4.d0*h4*tth)*(bj+tth)
939 & -tth*h4*(3.d0*bj+2.d0*h4*tth))/
940 & (6.d0*(bj+h4*tth)**2)
941 dyg3dbj=h3*h3*tth/(6.d0*(bj+h3*tth)**2)
942 dyg4dbj=h4*h4*tth/(6.d0*(bj+h4*tth)**2)
947 dh3dh1=1.d0+((3.d0*
c1*a1*a1*da1dh1
948 & +(dbds-dum1dh1*p1-um1*dp1dh1)*xflow2)*xn1
949 & -(3.d0*c2*a1*a1*da1dh1-dd1dh1*xflow2)*xt1)/
951 dh4dh2=1.d0-((3.d0*
c1*a2*a2*da2dh2
952 & +(dbds-dum2dh2*p2-um2*dp2dh2)*xflow2)*xn2
953 & -(3.d0*c2*a2*a2*da2dh2-dd2dh2*xflow2)*xt2)/
954 & (xn2*xn2)*(1.d0-eta)*dl
959 dyg3dh1=dyg3dh3*dh3dh1
960 dyg4dh2=dyg4dh4*dh4dh2
965 dh3dm=((dbds*h1-um1*p1)*xn1+d1*xt1)*2.d0*xflow/
967 dh4dm=-((dbds*h2-um2*p2)*xn2+d2*xt2)*2.d0*xflow/
968 & (xn2*xn2)*(1.d0-eta)*dl
987 da3deta=da3dh3*dh3deta+h3*dbjdeta
988 da4deta=da4dh4*dh4deta+h4*dbjdeta
989 dyg3deta=dyg3dh3*dh3deta+dyg3dbj*dbjdeta
990 dyg4deta=dyg4dh4*dh4deta+dyg4dbj*dbjdeta
994 nodef(4)=kon(ipkon(nelemup)+2)
998 f=a4*xflow2+c2*(a3*a3*a4*yg3-a3*a4*a4*yg4)
1000 df(1)=c2*(2.d0*a3*da3dh1*a4*yg3+a3*a3*a4*dyg3dh1
1001 & -da3dh1*a4*a4*yg4)-da3dh1*xflow2
1002 df(2)=2.d0*xflow*(a4-a3)+
1003 & (c2*(2.d0*a3*a4*yg3-a4*a4*yg4)-xflow2)*da3dm+
1004 & (c2*(a3*a3*yg3-2.d0*a3*a4*yg4)+xflow2)*da4dm+
1005 & c2*a3*a3*a4*dyg3dm-c2*a3*a4*a4*dyg4dm
1006 df(3)=c2*(a3*a3*da4dh2*yg3-2.d0*a3*a4*da4dh2*yg4
1007 & -a3*a4*a4*dyg4dh2)+da4dh2*xflow2
1008 df(4)=da4deta*xflow2+
1009 & c2*(2.d0*a3*da3deta*a4*yg3+a3*a3*da4deta*yg3
1010 & +a3*a3*a4*dyg3deta-da3deta*a4*a4*yg4
1011 & -a3*2.d0*a4*da4deta*yg4-a3*a4*a4*dyg4deta)
1013 elseif(lakon(nelem)(6:7).eq.
'CO')
then 1014 f=b2*h4*(2.d0*xflow2+c2*
b1*
b1*h3**3)-
1015 &
b1*h3*(2.d0*xflow2+c2*
b1*b2*h4**3)
1017 df(1)=3.d0*b2*h4*c2*
b1*
b1*h3*h3-
1018 &
b1*(2.d0*xflow2+c2*
b1*b2*h4**3)
1020 df(3)=b2*(2.d0*xflow2+c2*
b1*
b1*h3**3)-
1021 & 3.d0*
b1*h3*c2*
b1*b2*h4*h4
1023 df(2)=4.d0*xflow*(b2*h4-
b1*h3)+
1024 &
df(1)*dh3dm+
df(3)*dh4dm
1026 df(4)=
df(1)*dh3deta+
df(3)*dh4deta
1031 elseif(lakon(nelem)(6:7).eq.
'EL')
then 1032 f=b2*h4*(2.d0*xflow2+c2*
b1*b2*h3**3)-
1033 &
b1*h3*(2.d0*xflow2+c2*b2*b2*h4**3)
1035 df(1)=3.d0*b2*h4*c2*
b1*b2*h3*h3-
1036 &
b1*(2.d0*xflow2+c2*b2*b2*h4**3)
1038 df(3)=b2*(2.d0*xflow2+c2*
b1*b2*h3**3)-
1039 & 3.d0*
b1*h3*c2*b2*b2*h4*h4
1041 df(2)=4.d0*xflow*(b2*h4-
b1*h3)+
1042 &
df(1)*dh3dm+
df(3)*dh4dm
1044 df(4)=
df(1)*dh3deta+
df(3)*dh4deta
1049 elseif(lakon(nelem)(6:7).eq.
'DR')
then 1050 f=h4*(2.d0*xflow2+c2*b*b*h3*(h3+d)**2)-
1051 & h3*(2.d0*xflow2+c2*b*b*h4**3)
1053 df(1)=h4*c2*b*b*(3.d0*h3+d)*(h3+d)-
1054 & (2.d0*xflow2+c2*b*b*h4**3)
1056 df(3)=(2.d0*xflow2+c2*b*b*h3*(h3+d)**2)-
1057 & 3.d0*h3*c2*b*b*h4*h4
1059 df(2)=4.d0*xflow*(h4-h3)+
1060 &
df(1)*dh3dm+
df(3)*dh4dm
1062 df(4)=
df(1)*dh3deta+
df(3)*dh4deta
1067 elseif(lakon(nelem)(6:7).eq.
'ST')
then 1068 f=h4*(2.d0*xflow2+c2*b*b*h3**3)-
1069 & h3*(2.d0*xflow2+c2*b*b*h4*(h4+d)**2)
1071 df(1)=3.d0*h4*c2*b*b*h3*h3-
1072 & (2.d0*xflow2+c2*b*b*h4*(h4+d)**2)
1074 df(3)=(2.d0*xflow2+c2*b*b*h3**3)-
1075 & h3*c2*b*b*(3.d0*h4+d)*(h4+d)
1077 df(2)=4.d0*xflow*(h4-h3)+
1078 &
df(1)*dh3dm+
df(3)*dh4dm
1080 df(4)=
df(1)*dh3deta+
df(3)*dh4deta
1090 f=c2*(a1**3+a2**3)-xflow2*(d1+d2)
1091 df(1)=-f+(h2-h1)*(c2*da1dh1*3.d0*a1*a1-xflow2*dd1dh1)
1092 & -dl*(
c1*3.d0*a1*a1*da1dh1
1093 & -(dum1dh1*p1+um1*dp1dh1-dbds)*xflow2)
1094 df(2)=(-(h2-h1)*(d1+d2)
1095 & +dl*(um1*p1+um2*p2-(h1+h2)*dbds))*2.d0*xflow
1096 df(3)=f+(h2-h1)*(c2*da2dh2*3.d0*a2*a2-xflow2*dd2dh2)
1097 & -dl*(
c1*3.d0*a2*a2*da2dh2
1098 & -(dum2dh2*p2+um2*dp2dh2-dbds)*xflow2)
1099 f=(h2-h1)*f-dl*(
c1*(a1**3+a2**3)
1100 & -(um1*p1+um2*p2-(h1+h2)*dbds)*xflow2)
1104 elseif(iflag.eq.3)
then 1111 index=ielprop(nelem)
1117 z1=-g(1)*co(1,node1)-g(2)*co(2,node1)-g(3)*co(3,node1)
1118 z2=-g(1)*co(1,node2)-g(2)*co(2,node2)-g(3)*co(3,node2)
1120 dg=dsqrt(g(1)*g(1)+g(2)*g(2)+g(3)*g(3))
1126 nelemup=prop(index+6)
1127 indexup=ielprop(nelemup)
1128 if(lakon(nelemup)(6:7).eq.
'SG')
then 1130 prop(indexup+4)=0.5d0
1131 prop(indexup+7)=0.d0
1132 elseif(lakon(nelemup)(6:7).eq.
'WE')
then 1134 prop(indexup+4)=0.5d0
1135 prop(indexup+7)=0.d0
1136 elseif(lakon(nelemup)(6:7).eq.
'DS')
then 1138 prop(indexup+7)=0.5d0
1139 prop(indexup+9)=0.d0
1144 if((lakon(nelem)(6:7).eq.
'SG').or.
1145 & (lakon(nelem)(6:7).eq.
'SO').or.
1146 & (lakon(nelem)(6:7).eq.
'RE').or.
1147 & (lakon(nelem)(6:7).eq.
' ').or.
1148 & (lakon(nelem)(6:7).eq.
'DS').or.
1149 & (lakon(nelem)(6:7).eq.
'DO'))
then 1152 if(s0.lt.-1.d0)
then 1153 s0=dasin((
z1-z2)/dl)
1155 sqrts0=dsqrt(1.d0-s0*s0)
1156 if(lakon(nelem)(6:7).ne.
'SG')
then 1161 dl=dsqrt((co(1,node2)-co(1,node1))**2+
1162 & (co(2,node2)-co(2,node1))**2+
1163 & (co(3,node2)-co(3,node1))**2)
1168 elseif(lakon(nelem)(6:7).eq.
'WE')
then 1172 elseif((lakon(nelem)(6:7).eq.
'CO').or.
1173 & (lakon(nelem)(6:7).eq.
'EL'))
then 1176 if(s0.lt.-1.d0)
then 1177 s0=dasin((
z1-z2)/dl)
1179 sqrts0=dsqrt(1.d0-s0*s0)
1181 elseif((lakon(nelem)(6:7).eq.
'DR').or.
1182 & (lakon(nelem)(6:7).eq.
'ST'))
then 1185 if(s0.lt.-1.d0)
then 1186 s0=dasin((
z1-z2)/dl)
1188 sqrts0=dsqrt(1.d0-s0*s0)
1196 if((lakon(nelem)(6:7).eq.
'CO').or.
1197 & (lakon(nelem)(6:7).eq.
'EL').or.
1198 & (lakon(nelem)(6:7).eq.
'DR').or.
1199 & (lakon(nelem)(6:7).eq.
'ST'))
then 1200 c2=rho*rho*dg*sqrts0
1202 if(eta.gt.1.d0)
then 1206 if(lakon(nelem)(6:7).eq.
'CO')
then 1208 e0=2.d0*
b1*h1*xflow2/e3
1209 e1=-(2.d0*xflow2+c2*
b1*
b1*h1**3)*b2/e3
1211 elseif(lakon(nelem)(6:7).eq.
'EL')
then 1213 e0=2.d0*
b1*h1*xflow2/e3
1214 e1=-(2.d0*xflow2+c2*
b1*b2*h1**3)*b2/e3
1216 elseif(lakon(nelem)(6:7).eq.
'DR')
then 1218 e0=h1*2.d0*xflow2/e3
1219 e1=-(2.d0*xflow2+c2*b*b*h1*(h1+d)**2)/e3
1221 elseif(lakon(nelem)(6:7).eq.
'ST')
then 1223 e0=h1*2.d0*xflow2/e3
1224 e1=(h1*c2*b*b*d*d-(2.d0*xflow2+c2*b*b*h1**3))/e3
1225 e2=h1*c2*b*b*2.d0*d/e3
1230 call cubic(e0,e1,e2,solreal,solimag,nsol)
1236 if(dabs(solreal(i)-h1).lt.
dist)
then 1237 dist=dabs(solreal(i)-h1)
1241 if(nactdog(2,node2).ne.0) v(2,node2)=h2
1242 elseif(eta.lt.0.d0)
then 1246 if(lakon(nelem)(6:7).eq.
'CO')
then 1248 e0=2.d0*xflow2*b2*h2/e3
1249 e1=-
b1*(2.d0*xflow2+c2*
b1*b2*h2**3)/e3
1251 elseif(lakon(nelem)(6:7).eq.
'EL')
then 1253 e0=2.d0*xflow2*b2*h2/e3
1254 e1=-
b1*(2.d0*xflow2+c2*b2*b2*h2**3)/e3
1256 elseif(lakon(nelem)(6:7).eq.
'DR')
then 1258 e0=2.d0*xflow2*h2/e3
1259 e1=(c2*b*b*d*d*h2-(2.d0*xflow2+c2*b*b*h2**3))/e3
1260 e2=c2*b*b*2.d0*d*h2/e3
1261 elseif(lakon(nelem)(6:7).eq.
'ST')
then 1263 e0=2.d0*xflow2*h2/e3
1264 e1=-(2.d0*xflow2+c2*b*b*h2*(h2+d)**2)/e3
1270 call cubic(e0,e1,e2,solreal,solimag,nsol)
1281 if(dabs(solreal(i)-h2).lt.
dist)
then 1282 dist=dabs(solreal(i)-h2)
1286 if(nactdog(2,node1).ne.0) v(2,node1)=h1
1291 if(xks.gt.0.d0)
then 1298 reynolds=4.d0*xflow/(b*dvi)
1311 if(lakon(nelem)(6:7).eq.
' ')
then 1322 d2=b+dl*dbds+h2*dd2dh2
1327 a2=h2*(b+dl*dbds+h2*tth)
1332 p2=b+dl*dbds+2.d0*h2/cth
1336 if(xks.gt.0.d0)
then 1342 um1=xks*xks*dg*(p1/a1)**(1.d0/3.d0)
1343 um2=xks*xks*dg*(p2/a2)**(1.d0/3.d0)
1352 if(eta.gt.1.d0)
then 1353 xt1=
c1*a1**3+(h1*dbds-um1*p1)*xflow2
1354 xn1=c2*a2**3-d2*xflow2
1355 if(nactdog(2,node2).ne.0) v(2,node2)=h1+dl*xt1/xn1
1357 elseif(eta.lt.0.d0)
then 1358 xt2=
c1*a2**3+(h2*dbds-um2*p2)*xflow2
1359 xn2=c2*a2**3-d2*xflow2
1360 if(nactdog(2,node1).ne.0)
1361 & v(2,node1)=h2-dl*xt2/xn2
static double * z1
Definition: filtermain.c:48
subroutine df(x, u, uprime, rpar, nev)
Definition: subspace.f:133
static double * c1
Definition: mafillvcompmain.c:30
subroutine hns(b, theta, rho, dg, sqrts0, xflow, h1, h2)
Definition: hns.f:20
subroutine friction_coefficient(l, d, ks, reynolds, form_fact, lambda)
Definition: friction_coefficient.f:26
static double * dist
Definition: radflowload.c:42
subroutine cubic(a0, a1, a2, solreal, solimag, n)
Definition: cubic.f:20
subroutine hcrit(xflow, rho, b, theta, dg, sqrts0, hk)
Definition: hcrit.f:20
static double * b1
Definition: mafillkmain.c:30