2 subroutine char_conv(p0,u,ulag,bm,bmlag,msk,c,cs,gsl)
13 real p0(1),u(1),ulag(1),bm(1),bmlag(1),msk(1),c(1),cs(0:1)
16 common /scrns/ ct(lxd*lyd*lzd*lelv*ldim)
18 common /scrvh/ bmsk(lx1*ly1*lz1*lelv)
19 $ , bdwt(lx1*ly1*lz1*lelv)
20 $ , bmst(lx1*ly1*lz1*lelv)
21 $ , u1(lx1*ly1*lz1*lelv)
23 common /scrmg/ r1(lx1*ly1*lz1*lelv)
24 $ , r2(lx1*ly1*lz1*lelv)
25 $ , r3(lx1*ly1*lz1*lelv)
26 $ , r4(lx1*ly1*lz1*lelv)
29 if (ifield.eq.ifldmhd) nelc = nelfld(ifield)
34 n = lx1*ly1*lz1*nelfld(ifield)
35 m = lxd*lyd*lzd*nelc*ldim
38 call char_conv1 (p0,u,bmnv,n,ulag,ln,gsl,c,m,cs(1),nc,ct
39 $ ,u1,r1,r2,r3,r4,bmsk,bdivw,bdwt,bmass,bmst,bm,bmlag)
44 subroutine char_conv1 (p0,u,bmnv,n,ulag,ln,gsl,c,m,cs,nc,ct
45 $ ,u1,r1,r2,r3,r4,bmsk,bdivw,bdwt,bmass,bmst,bm,bmlag)
51 real p0(n),u(n),bmnv(n,1),ulag(ln,1),c(m,0:nc),cs(0:nc),bdivw(n,1)
54 real ct(m),u1(n),r1(n),r2(n),r3(n),r4(n),bmsk(n),bdwt(n)
79 tau = time-
vlsum(dtlag,nbd)
80 call int_vel (ct ,tau,c ,m,nc,cs,nid)
81 call int_vel (bmsk,tau,bmnv ,n,nc,cs,nid)
82 call int_vel (bmst,tau,bmass,n,nc,cs,nid)
83 call int_vel (bdwt,tau,bdivw,n,nc,cs,nid)
92 p0(i) = p0(i)+bd(ilag+1)*u(i)*bm(i)
98 p0(i) = p0(i)+bd(ilag+1)*ulag(i,ilag-1)*bmlag(i,ilag-1)
99 um=max(um,ulag(i,ilag-1))
103 p0(i) = p0(i)+bd(ilag+1)*ulag(i,ilag-1)*bm(i)
104 um=max(um,ulag(i,ilag-1))
109 dtau = dtlag(ilag)/ntaubd
120 call conv_rhs(r1,u1,ct,bmsk,bmst,bdwt,gsl)
121 call col2 (r1,bmst,n)
123 call add3s12 (u1,p0,r1,c1,c2,n)
124 call int_vel (bmst,th,bmass,n,nc,cs,nid)
127 call int_vel (ct ,th,c ,m,nc,cs,nid)
128 call int_vel (bmsk,th,bmnv ,n,nc,cs,nid)
129 call int_vel (bdwt,th,bdivw,n,nc,cs,nid)
130 call conv_rhs(r2,u1,ct,bmsk,bmst,bdwt,gsl)
131 call col2 (r2,bmst,n)
133 call add3s12 (u1,p0,r2,c1,c2,n)
135 call conv_rhs(r3,u1,ct,bmsk,bmst,bdwt,gsl)
136 call col2 (r3,bmst,n)
138 call add3s12 (u1,p0,r3,c1,c3,n)
139 call int_vel (bmst,tau1,bmass,n,nc,cs,nid)
142 call int_vel (ct ,tau1,c ,m,nc,cs,nid)
143 call int_vel (bmsk,tau1,bmnv ,n,nc,cs,nid)
144 call int_vel (bdwt,tau1,bdivw,n,nc,cs,nid)
145 call conv_rhs(r4,u1,ct,bmsk,bmst,bdwt,gsl)
146 call col2 (r4,bmst,n)
151 p0(i) = p0(i)+c1*(r1(i)+r4(i))+c2*(r2(i)+r3(i))
169 real c_t(n),c(n,0:nc),ct(0:nc)
174 if (nc.gt.lwtmax)
then
175 write(6,*) nid,
'ERROR int_vel: lwtmax too small',lwtmax,nc
185 c_t(j) = c_t(j) + wt(i)*c(j,i)
199 real du(1),u(1),c(1),bmsk(1),bdwt(1)
209 if (ifdgfld(ifield))
then
225 call fgslib_gs_op (gsl,du,1,1,0)
227 call col2 (du,bmsk,n)
242 real du(mx*mx*mx,nel)
244 real c(md*md*md,nel,3)
245 parameter(ldd=lxd*lyd*lzd)
246 common /ctmp1/ ur(ldd),us(ldd),ut(ldd),ud(ldd)
253 if (md.ne.mx) ifd=.true.
257 call lim_chk(nrstd,ldd,
'urus ',
'ldd ',
'convop_fst')
260 call grad_rstd(ur,us,ut,u(1,e),mx,md,if3d,ud)
264 ud(i) = c(i,e,1)*ur(i)+c(i,e,2)*us(i)+c(i,e,3)*ut(i)
270 du(i,e) = c(i,e,1)*ur(i)+c(i,e,2)*us(i)+c(i,e,3)*ut(i)
287 parameter(ldd=lxd*lyd*lzd)
288 common /ctmp1/ ur(ldd),us(ldd),ut(ldd),ud(ldd)
295 if (md.ne.mx) ifd=.true.
299 call lim_chk(nrstd,ldd,
'urus ',
'ldd ',
'convop_fst')
302 call grad_rstd(ur,us,ut,u(1,e),mx,md,if3d,ud)
306 ud(i) = c(i,e,1)*ur(i)+c(i,e,2)*us(i)
312 du(i,e) = c(i,e,1)*ur(i)+c(i,e,2)*us(i)
325 real ur(1),us(1),ut(1),u(1),ju(1)
328 parameter(ldg=lxd**3,lwkd=4*lxd*lxd)
329 common /dgrad/ d(ldg),dt(ldg),dg(ldg),dgt(ldg),jgl(ldg),jgt(ldg)
357 parameter(ldg=lxd**3,lwkd=4*lxd*lxd)
358 common /dgrad/ d(ldg),dt(ldg),dg(ldg),dgt(ldg),jgl(ldg),jgt(ldg)
363 common /ctmp0/ w(ld**ldim,2)
365 call lim_chk(md,ld,
'md ',
'ld ',
'grad_rstd ')
366 call lim_chk(mx,ld,
'mx ',
'ld ',
'grad_rstd ')
373 call specmpn(ju,md,u,mx,jgl(i),jgt(i),if3d,w,ldw)
375 call specmpn(ju,mx,u,md,jgt(i),jgl(i),if3d,w,ldw)
393 real jgl(mp,np),jgt(np*mp),w(1)
398 call zwgll (w(iz),jgt,np)
399 call zwgl (w(id),jgt,mp)
427 real dgl(mp,np),dgt(np*mp),w(1)
433 call zwgl (w(iz),dgt,np)
434 call zwgl (w(id),dgt,mp)
438 call lim_chk(ndgt,ldgt,
'ldgt ',
'dgt ',
'gen_dgl ')
453 subroutine lim_chk(n,m,avar5,lvar5,sub_name10)
455 character*5 avar5,lvar5
456 character*10 sub_name10
459 write(6,1) nid,n,m,avar5,lvar5,sub_name10
460 1
format(i8,
' ERROR: :',2i12,2(1x,a5),1x,a10)
461 call exitti(
'lim_chk problem. $',n)
473 parameter(ldg=lxd**3,lwkd=4*lxd*lxd)
474 common /dgrad/ d(ldg),dt(ldg),dg(ldg),dgt(ldg),jgl(ldg),jgt(ldg)
479 common /igrad/ pd(0:ld*ld)
482 integer pd , pdg , pjgl
491 nstore = nstore + md*mx
496 call lim_chk(nstore,ldg ,
'jgl ',
'ldg ',
'get_int_pt')
497 call lim_chk(nwrkd ,lwkd,
'wkd ',
'lwkd ',
'get_int_pt')
499 call gen_int(jgl(ip),jgt(ip),md,mx,wkd)
511 parameter(ldg=lxd**3,lwkd=4*lxd*lxd)
512 common /dgrad/ d(ldg),dt(ldg),dg(ldg),dgt(ldg),jgl(ldg),jgt(ldg)
517 common /jgrad/ pd(0:ld*ld)
520 integer pd , pdg , pjgl
529 nstore = nstore + md*mx
534 call lim_chk(nstore,ldg ,
'dg ',
'ldg ',
'get_dgl_pt')
535 call lim_chk(nwrkd ,lwkd,
'wkd ',
'lwkd ',
'get_dgl_pt')
537 call gen_dgl(dg(ip),dgt(ip),md,mx,wkd)
549 real ux(1),uy(1),uz(1)
553 numr = lxd*lyd*lzd*lelv*ldim*(lorder+1)
554 denr = lxd*lyd*lzd*nelv*ldim
555 nconv_max = numr/denr
556 if (nconv_max.lt.nbdinp+1)
558 $
'ABORT: not enough memory for characteristics scheme!$',
563 m = lxd*lyd*lzd*nelc*ldim
566 $ (ct,c,m,ux,uy,uz,tau,nc,nconv_max,nelc,ifnew)
574 subroutine set_ct_cvx(ct,c,m,u,v,w,tau,nc,mc,nelc,ifnew)
592 call copy(c(1,i),c(1,i-1),m)
600 iy = ix + lxd*lyd*lzd*nelc
601 iz = iy + lxd*lyd*lzd*nelc
619 real ur(1),us(1),ut(1),u(1)
622 parameter(ldg=lxd**3,lwkd=4*lxd*lxd)
623 common /dgrad/ d(ldg),dt(ldg),dg(ldg),dgt(ldg),jgl(ldg),jgt(ldg)
645 real bdu(1),u(1),cx(1),cy(1),cz(1)
648 parameter(lxy=lx1*ly1*lz1,ltd=lxd*lyd*lzd)
649 common /scrcv/ fx(ltd),fy(ltd),fz(ltd)
650 $ , ur(ltd),us(ltd),ut(ltd)
651 $ , tr(ltd,3),uf(ltd)
661 if (ifuf) nxyzu = nxyzd
664 if (ifcf) nxyzc = nxyzd
675 call copy(tr(1,1),cx(ic),nxyzd)
676 call copy(tr(1,2),cy(ic),nxyzd)
677 if (if3d)
call copy(tr(1,3),cz(ic),nxyzd)
683 if (if3d)
call intp_rstd(fz,cz(ic),lx1,lxd,if3d,0)
688 tr(i,1)=rx(i,1,e)*fx(i)+rx(i,2,e)*fy(i)+rx(i,3,e)*fz(i)
689 tr(i,2)=rx(i,4,e)*fx(i)+rx(i,5,e)*fy(i)+rx(i,6,e)*fz(i)
690 tr(i,3)=rx(i,7,e)*fx(i)+rx(i,8,e)*fy(i)+rx(i,9,e)*fz(i)
696 tr(i,1)=rx(i,1,e)*fx(i)+rx(i,2,e)*fy(i)
697 tr(i,2)=rx(i,3,e)*fx(i)+rx(i,4,e)*fy(i)
705 call grad_rst(ur,us,ut,u(iu),lxd,if3d)
713 uf(i) = tr(i,1)*ur(i)+tr(i,2)*us(i)+tr(i,3)*ut(i)
717 uf(i) = tr(i,1)*ur(i)+tr(i,2)*us(i)
720 call intp_rstd(bdu(ib),uf,lx1,lxd,if3d,1)
741 real bdu(1),u(1),cx(1),cy(1),cz(1)
745 parameter(lxy=lx1*ly1*lz1,ltd=lxd*lyd*lzd)
746 common /scrcv/ uf(ltd),cf(ltd),cu(ltd)
747 $ , cr(ltd),cs(ltd),ct(ltd)
758 if (ifuf) nxyzu = nxyzd
761 if (ifcf) nxyzc = nxyzd
780 if (i.eq.1)
call intp_rstd(cf,cx(ic),lx1,lxd,if3d,0)
781 if (i.eq.2)
call intp_rstd(cf,cy(ic),lx1,lxd,if3d,0)
782 if (i.eq.3)
call intp_rstd(cf,cz(ic),lx1,lxd,if3d,0)
784 call col2(cf,uf,nxyzd)
792 $ +cr(j)*rx(j,i,e)+cs(j)*rx(j,i+3,e)+ct(j)*rx(j,i+6,e)
799 $ +cr(j)*rx(j,i,e)+cs(j)*rx(j,i+2,e)
806 call intp_rstd(bdu(ib),cu,lx1,lxd,if3d,1)
825 parameter(lxy=lx1*ly1*lz1,ltd=lxd*lyd*lzd)
827 real cx(ltd,1),cy(ltd,1),cz(ltd,1)
828 real ux(lxy,1),uy(lxy,1),uz(lxy,1)
836 call intp_rstd(cx(1,e),ux(1,e),lx1,lxd,if3d,0)
837 call intp_rstd(cy(1,e),uy(1,e),lx1,lxd,if3d,0)
838 if (if3d)
call intp_rstd(cz(1,e),uz(1,e),lx1,lxd,if3d,0)
854 parameter(lxy=lx1*ly1*lz1,ltd=lxd*lyd*lzd)
856 real cr(ltd,1),cs(ltd,1),ct(ltd,1)
857 real ux(lxy,1),uy(lxy,1),uz(lxy,1)
859 common /scrcv/ fx(ltd),fy(ltd),fz(ltd)
860 $ , ur(ltd),us(ltd),ut(ltd)
861 $ , tr(ltd,3),uf(ltd)
876 call intp_rstd(fx,ux(1,e),lx1,lxd,if3d,0)
877 call intp_rstd(fy,uy(1,e),lx1,lxd,if3d,0)
878 if (if3d)
call intp_rstd(fz,uz(1,e),lx1,lxd,if3d,0)
885 cr(i,e)=rx(i,1,e)*fx(i)+rx(i,2,e)*fy(i)+rx(i,3,e)*fz(i)
886 cs(i,e)=rx(i,4,e)*fx(i)+rx(i,5,e)*fy(i)+rx(i,6,e)*fz(i)
887 ct(i,e)=rx(i,7,e)*fx(i)+rx(i,8,e)*fy(i)+rx(i,9,e)*fz(i)
893 cr(i,e)=rx(i,1,e)*fx(i)+rx(i,2,e)*fy(i)
894 cs(i,e)=rx(i,3,e)*fx(i)+rx(i,4,e)*fy(i)
917 common /cchar/ ct_vx(0:lorder)
919 common /scruz/ phx(lx1*ly1*lz1*lelt)
920 $ , phy(lx1*ly1*lz1*lelt)
921 $ , phz(lx1*ly1*lz1*lelt)
922 $ , hmsk(lx1*ly1*lz1*lelt)
924 if (icalld.eq.0) tadvc=0.0
932 call char_conv(phx,vx,vxlag,bm1,bm1lag,hmsk,c_vx,ct_vx,gsh_fld(1))
933 call char_conv(phy,vy,vylag,bm1,bm1lag,hmsk,c_vx,ct_vx,gsh_fld(1))
935 $ (phz,vz,vzlag,bm1,bm1lag,hmsk,c_vx,ct_vx,gsh_fld(1))
937 call cfill(hmsk,dti,n)
938 if(.not. iflomach)
call col2(hmsk,vtrans,n)
944 bfx(i,1,1,1) = bfx(i,1,1,1)+phx(i)*h2i
945 bfy(i,1,1,1) = bfy(i,1,1,1)+phy(i)*h2i
946 bfz(i,1,1,1) = bfz(i,1,1,1)+phz(i)*h2i
953 bfx(i,1,1,1) = bfx(i,1,1,1)+phx(i)*h2i
954 bfy(i,1,1,1) = bfy(i,1,1,1)+phy(i)*h2i
977 common /cchar/ ct_vx(0:lorder)
979 common /scruz/ phi(lx1*ly1*lz1*lelt)
980 $ , hmsk(lx1*ly1*lz1*lelt)
982 if (icalld.eq.0) tadvc=0.0
990 if(nid.eq.0 .and. loglevel.gt.2)
write(6,*)
'convch', ifield
991 call char_conv(phi,t(1,1,1,1,ifield-1),tlag(1,1,1,1,1,ifield-1)
992 $ ,bm1,bm1lag,hmsk,c_vx,ct_vx,gsh_fld(1))
995 bq(i,1,1,1,ifield-1) = bq(i,1,1,1,ifield-1)
996 $ + phi(i)*vtrans(i,1,1,1,ifield)*dti
1014 real du(mx*mx*mx,nel)
1015 real u(mx*mx*mx,nel)
1016 real c(md*md*md,nel,3)
1017 parameter(ldd=lxd*lyd*lzd)
1018 common /ctmp1/ ur(ldd),us(ldd),ut(ldd),ju(ldd),ud(ldd),tu(ldd)
1026 if (md.ne.mx) ifd=.true.
1030 call lim_chk(nrstd,ldd,
'urus ',
'ldd ',
'convp_cons')
1035 call rzero (ud,nrstd)
1039 tu(i)=c(i,e,j)*ju(i)
1048 $ +rx(i,j0,e)*ur(i)+rx(i,j3,e)*us(i)+rx(i,j6,e)*ut(i)
1073 parameter(ldd=lxd*lyd*lzd)
1074 common /ctmp1/ ur(ldd),us(ldd),ut(ldd),ju(ldd),ud(ldd),tu(ldd)
1082 if (md.ne.mx) ifd=.true.
1085 call lim_chk(nrstd,ldd,
'urus ',
'ldd ',
'convp_cons')
1087 if (nio.eq.0.and.istep.lt.3)
write(6,*)
'convp_cons',istep
1092 call rzero (ud,nrstd)
1100 tu(i)=c(i,e,j)*ju(i)
1107 ud(i)=ud(i)+rx(i,j0,e)*ur(i)+rx(i,j2,e)*us(i)
1122 integer*8 fa(lx1*lz1,2*ldim,nel),va(0:lx1+1,0:ly1+1,jz0:jz1,nel)
1125 n = lx1*lz1*2*ldim*nel
1131 if (ldim.eq.2) mz1=1
1136 call facind (kx1,kx2,ky1,ky2,kz1,kz2,lx1,ly1,lz1,f)
1141 elseif (f.eq.2)
then
1144 elseif (f.eq.3)
then
1147 elseif (f.eq.4)
then
1150 elseif (f.eq.5)
then
1153 elseif (f.eq.6)
then
1163 fa(i,f,e)=va(ix,iy,iz,e)
1180 real bmnv(n,lorder),hmsk(n)
1183 call copy(bmnv(1,i),bmnv(1,i-1),n)
1186 call copy (bmnv,bm1,n)
1188 call fgslib_gs_op(gsh_fld(1),bmnv,1,1,0)
1191 bmnv(i,1)=hmsk(i)/bmnv(i,1)
1204 common /scruz/ cx(lx1*ly1*lz1*lelt)
1205 $ , cy(lx1*ly1*lz1*lelt)
1206 $ , cz(lx1*ly1*lz1*lelt)
1208 real bdivw(n,lorder),hmsk(n)
1211 call copy(bdivw(1,i),bdivw(1,i-1),n)
1214 call gradm1 (bdivw,cy ,cz , wx )
1215 call gradm1 (cx ,cy ,cz , wy )
1216 call add2 (bdivw,cy , n )
1218 call gradm1 (cx ,cy ,cz , wz )
1219 call add2 (bdivw,cz , n )
1221 call col2(bdivw,bm1,n)
1232 real bmass(n,lorder),hmsk(n)
1235 call copy(bmass(1,i),bmass(1,i-1),n)
1238 call copy (bmass,bm1,n)
1250 integer dgh,vertex(1)
1252 parameter(lf=lx1*lz1*2*ldim*lelt)
1253 common /c_is1/ glo_num_face(lf)
1254 $ , glo_num_vol((lx1+2)*(ly1+2)*(lz1+2)*lelt)
1255 integer*8 glo_num_face,glo_num_vol,ngv
1257 common /nekmpi/ mid,mp,nekcomm,nekgroup,nekreal
1260 call set_vert(glo_num_vol,ngv,mx,nel,vertex,.false.)
1265 if (if3d) mz1 = lz1+1
1268 nf = lx1*lz1*2*ldim*nelt
1269 call fgslib_gs_setup(dgh,glo_num_face,nf,nekcomm,np)
1283 call dsset(lx1,ly1,lz1)
1288 nxzf = lx1*lz1*nface
1298 jskip1 = skpdat(3,f)
1301 jskip2 = skpdat(6,f)
1304 do j2=js2,jf2,jskip2
1305 do j1=js1,jf1,jskip1
1308 k = i+nxz*(ef-1)+nxzf*(e-1)
1309 dg_face(k) = j1+lx1*(j2-1)+nxyz*(e-1)
1316 ndg_facex = nxzf*nelv
1326 real faceary(lx1*lz1,2*ldim,lelt)
1327 real vol_ary(lx1,ly1,lz1,lelt)
1332 faceary(j,1,1) = vol_ary(i,1,1,1)
1344 real faceary(lx1*lz1,2*ldim,lelt)
1345 real vol_ary(lx1,ly1,lz1,lelt)
1348 n=lx1*ly1*lz1*nelfld(ifield)
1349 call rzero(vol_ary,n)
1353 vol_ary(i,1,1,1) = vol_ary(i,1,1,1)+faceary(j,1,1)
1364 real faceary(lx1*lz1,2*ldim,lelt)
1365 real vol_ary(lx1,ly1,lz1,lelt)
1370 vol_ary(i,1,1,1) = vol_ary(i,1,1,1)+faceary(j,1,1)
1383 real du(1),u(1),c(1)
1385 parameter(lf=lx1*lz1*2*ldim*lelt)
1386 common /scrdg/ uf(lf),uxf(lf),uyf(lf),uzf(lf),upwind_wgt(lf)
1390 n = lx1*ly1*lz1*nelv
1391 nf = lx1*lz1*2*ldim*nelt
1406 if (.not.if3d)
call rzero(uzf,nf)
1412 if (istep.le.5.and.nio.eq.0)
write(6,*) beta_u,
' dg upwind'
1423 beta = ( unx(i,1,f,e)*uxf(k)
1424 $ + uny(i,1,f,e)*uyf(k)
1425 $ + unz(i,1,f,e)*uzf(k))
1427 uf(k) = -beta*area(i,1,f,e)*uf(k)
1430 if (beta.gt.0) upwind_wgt(k) = 0.0
1431 upwind_wgt(k) = 0.5*(1-beta_u) + upwind_wgt(k)*beta_u
1432 if (beta.eq.0) upwind_wgt(k) = 0.5
1438 call fgslib_gs_op(dg_hndlx,uf,1,1,0)
1439 call col2 (uf,upwind_wgt,nf)
1459 parameter(ldg=lxd**3,lwkd=4*lxd*lxd)
1460 common /dgrad/ d(ldg),dt(ldg),dg(ldg),dgt(ldg),jgl(ldg),jgt(ldg)
1465 common /ctmp0/ w(ld**ldim,2)
1467 call lim_chk(md,ld,
'md ',
'ld ',
'map_faced ')
1468 call lim_chk(mx,ld,
'mx ',
'ld ',
'map_faced ')
1477 call mxm(jgl(i),md,u,mx,wkd,mx)
1478 call mxm(wkd,md,jgt(i),mx,ju,md)
1480 call mxm(jgl(i),md,u,mx,ju,1)
1484 call mxm(jgt(i),mx,u,md,wkd,md)
1485 call mxm(wkd,mx,jgl(i),md,ju,mx)
1487 call mxm(jgt(i),mx,u,md,ju,1)
1499 real rhs(lx1,ly1,lz1,lelt)
1501 common /cfbinv/ qn(lx1),alpha_n,beta_n
1502 $ ,s1(ly1,lz1),bnv(lx1)
1503 $ ,tmp(lx1*ly1*lz1*lelt)
1510 n = lx1*ly1*lz1*nelfld(ifield)
1513 rhs(i,1,1,1)=rhs(i,1,1,1)/bm1(i,1,1,1)
1524 real ur(1),us(1),ut(1),u(1)
1528 parameter(ldg=lxd**3,lwkd=4*lxd*lxd)
1529 common /dgrad/ d(ldg),dt(ldg),dg(ldg),dgt(ldg),jgl(ldg),jgt(ldg)
1534 call gradrta (du,ur,us,ut,dgt(ip),dg(ip),dg(ip),md,md,md,if3d)
1548 common /finewts/ zptf(lxd),wgtf(lxd),wghtf(lxd*lzd),wghtc(lx1*lz1)
1550 if (icalld.eq.0)
then
1554 call zwgl(zptf,wgtf,lxd)
1560 wghtc(k)=wxm1(i)*wzm1(j)
1567 wghtf(k)=wgtf(i)*wgtf(j)
1571 call copy(wghtc,wxm1,lx1)
1572 call copy(wghtf,wgtf,lxd)
1586 parameter(ldd=lxd*lyd*lzd)
1587 real du(1),u(1),c(ldd*lelv,3)
1589 parameter(lf=lx1*lz1*2*ldim*lelt)
1590 common /scrdg/ uf(lf),uxf(lf),uyf(lf),uzf(lf),upwind_wgt(lf)
1591 $ , beta_c(lx1*lz1),jaco_c(lx1*lz1)
1592 $ , beta_f(lxd*lzd),jaco_f(lxd*lzd)
1595 common /finewts/ zptf(lxd),wgtf(lxd),wghtf(lxd*lzd),wghtc(lx1*lz1)
1600 n = lx1*ly1*lz1*lelv
1601 nf = lx1*lz1*2*ldim*lelt
1609 if (.not.if3d)
call rzero(uzf,nf)
1615 if (istep.le.5.and.nio.eq.0)
write(6,*) beta_u,
' dg upwind'
1629 beta = ( unx(i,1,f,e)*uxf(k)
1630 $ + uny(i,1,f,e)*uyf(k)
1631 $ + unz(i,1,f,e)*uzf(k))
1634 if (beta.gt.0) upwind_wgt(k) = 0.0
1635 upwind_wgt(k) = 0.5*(1-beta_u) + upwind_wgt(k)*beta_u
1638 jaco_c(i) = area(i,1,f,e)/wghtc(i)
1643 call map_faced(beta_f,beta_c ,lx1,lxd,fdim,0)
1644 call map_faced(jaco_f,jaco_c ,lx1,lxd,fdim,0)
1645 call map_faced(ufine,uf(kface),lx1,lxd,fdim,0)
1648 ufine(i)=wghtf(i)*jaco_f(i)*beta_f(i)*ufine(i)
1650 call map_faced(uf(kface),ufine,lx1,lxd,fdim,1)
1655 call fgslib_gs_op(dg_hndlx,uf,1,1,0)
1657 call col2 (uf,upwind_wgt,nf)
1669 real du(1),u(1),cr(1),cs(1),ct(1)
1686 parameter(lxx=lx1*ly1*lz1,ldd=lxd*lyd*lzd)
1689 real cr(ldd,nel),cs(ldd,nel),ct(ldd,nel)
1690 common /ctmp1/ ur(ldd),us(ldd),ut(ldd),ju(ldd),ud(ldd),tu(ldd)
1698 call lim_chk(nrstd,ldd,
'urus5',
'ldd ',
'convp_cons')
1718 call intp_rstd (du(1,e),ud,mx,md,if3d,1)
1720 du(i,e) = -du(i,e)*binvdg(i,e)
1739 parameter(lf=lx1*lz1*2*ldim*lelt)
1740 common /scrdg/uf(lf),uxf(lf),uyf(lf),uzf(lf),upwind_wgt(lf),us(lf)
1741 $ ,beta_c(lx1*lz1),jaco_c(lx1*lz1)
1742 $ ,beta_f(lxd*lzd),jaco_f(lxd*lzd)
1746 common /finewts/ zptf(lxd),wgtf(lxd),wghtf(lxd*lzd),wghtc(lx1*lz1)
1750 n = lx1*ly1*lz1*nelv
1751 nf = lx1*lz1*2*ldim*nelt
1757 if (.not.if3d)
call rzero(uzf,nf)
1769 if (fw(f,e).gt.0.6)
then
1775 beta = ( unx(i,1,f,e)*uxf(k)
1776 $ + uny(i,1,f,e)*uyf(k)
1777 $ + unz(i,1,f,e)*uzf(k))
1780 if (beta.lt.0) upwind_wgt(k) = 1.0
1783 jaco_c(i) = area(i,1,f,e)/wghtc(i)
1788 call map_faced(beta_f,beta_c ,lx1,lxd,fdim,0)
1789 call map_faced(jaco_f,jaco_c ,lx1,lxd,fdim,0)
1790 call map_faced(ufine,uf(kface),lx1,lxd,fdim,0)
1793 ufine(i)=wghtf(i)*jaco_f(i)*beta_f(i)*ufine(i)
1795 call map_faced(uf(kface),ufine,lx1,lxd,fdim,1)
1809 du(i) = du(i) - ( upwind_wgt(j)*uf(j) )
1824 real du(1),u(1),cr(1),cs(1),ct(1)
1826 parameter(lf=lx1*lz1*2*ldim*lelt)
1827 common /scrdg/uf(lf),uxf(lf),uyf(lf),uzf(lf),upwind_wgt(lf),us(lf)
1828 $ ,beta_c(lx1*lz1),jaco_c(lx1*lz1)
1829 $ ,beta_f(lxd*lzd),jaco_f(lxd*lzd)
1833 common /finewts/ zptf(lxd),wgtf(lxd),wghtf(lxd*lzd),wghtc(lx1*lz1)
1837 n = lx1*ly1*lz1*lelv
1838 nf = lx1*lz1*2*ldim*lelt
1847 if (.not.if3d)
call rzero(uzf,nf)
1852 if (istep.le.5.and.nio.eq.0)
write(6,*) beta_u,
' dg upwind'
1864 beta = ( unx(i,1,f,e)*uxf(k)
1865 $ + uny(i,1,f,e)*uyf(k)
1866 $ + unz(i,1,f,e)*uzf(k) )
1869 if (beta.gt.0) upwind_wgt(k) = 1.0
1870 upwind_wgt(k) = 0.5*(1-beta_u) + beta_u*(1-upwind_wgt(k))
1872 if (fw(f,e).gt.0.6 .and. beta.lt.0) upwind_wgt(k)=1.
1873 if (fw(f,e).gt.0.6 .and. beta.gt.0) upwind_wgt(k)=0.
1876 jaco_c(i) = area(i,1,f,e)/wghtc(i)
1880 call map_faced(beta_f,beta_c ,lx1,lxd,fdim,0)
1881 call map_faced(jaco_f,jaco_c ,lx1,lxd,fdim,0)
1882 call map_faced(ufine,uf(kface),lx1,lxd,fdim,0)
1885 ufine(i)=wghtf(i)*jaco_f(i)*beta_f(i)*ufine(i)
1887 call map_faced(uf(kface),ufine,lx1,lxd,fdim,1)
1888 call copy (us(kface),uf(kface),lx1*lz1)
1893 call fgslib_gs_op(dg_hndlx,uf,1,1,0)
1897 du(i) = du(i) + ( us(j)-upwind_wgt(j)*uf(j) )*binvdg(i,1)
subroutine exitti(stringi, idata)
real *8 function dnekclock()
subroutine facind(kx1, kx2, ky1, ky2, kz1, kz2, nx, ny, nz, iface)
subroutine dsset(nx, ny, nz)
subroutine set_dealias_rx
subroutine conv_rhs(du, u, c, bmsk, bmst, bdwt, gsl)
subroutine iface_vert_int8(fa, va, jz0, jz1, nel)
subroutine convop_cons_3d(du, u, c, mx, md, nel)
subroutine set_conv_char(ct, c, ux, uy, uz, nelc, tau, ifnew)
subroutine char_conv1(p0, u, bmnv, n, ulag, ln, gsl, c, m, cs, nc, ct, u1, r1, r2, r3, r4, bmsk, bdivw, bdwt, bmass, bmst, bm, bmlag)
subroutine set_binv(bmnv, hmsk, n)
subroutine convop_fst_3d(du, u, c, mx, md, nel)
subroutine set_bdivw(bdivw, hmsk, n)
subroutine conv_rhs_dg(du, u, c)
subroutine get_dgl_ptr(ip, mx, md)
subroutine gen_int(jgl, jgt, mp, np, w)
subroutine int_vel(c_t, t0, c, n, nc, ct, nid)
subroutine set_convect_new(cr, cs, ct, ux, uy, uz)
subroutine conv_rhs_dg_weak(du, u, cr, cs, ct)
subroutine full2face(faceary, vol_ary)
subroutine face2full(vol_ary, faceary)
subroutine get_int_ptr(ip, mx, md)
subroutine intp_rstd(ju, u, mx, md, if3d, idir)
subroutine convop_fst_2d(du, u, c, mx, md, nel)
subroutine gen_dgl(dgl, dgt, mp, np, w)
subroutine grad_rstd(ur, us, ut, u, mx, md, if3d, ju)
subroutine convop_cons_2d(du, u, c, mx, md, nel)
subroutine add_face2full(vol_ary, faceary)
subroutine set_convect_cons(cx, cy, cz, ux, uy, uz)
subroutine convect_dg(du, u, ifuf, cr, cs, ct, ifcf)
subroutine set_ct_cvx(ct, c, m, u, v, w, tau, nc, mc, nelc, ifnew)
subroutine convect_cons(bdu, u, ifuf, cx, cy, cz, ifcf)
subroutine conv_rhs_dg_aliased(du, u, c)
subroutine set_bmass(bmass, hmsk, n)
subroutine setup_dg_gs(dgh, nx, ny, nz, nel, melg, vertex)
subroutine map_faced(ju, u, mx, md, fdim, idir)
subroutine char_conv(p0, u, ulag, bm, bmlag, msk, c, cs, gsl)
subroutine grad_rstd_ta(du, ur, us, ut, md, if3d)
subroutine convop_weak(du, u, cr, cs, ct, mx, md, nel)
subroutine lim_chk(n, m, avar5, lvar5, sub_name10)
subroutine convect_new(bdu, u, ifuf, cx, cy, cz, ifcf)
subroutine grad_rst(ur, us, ut, u, md, if3d)
subroutine conv_bdry_dg_weak(du, u)
subroutine fd_weights_full(xx, x, n, m, c)
subroutine gradrta(u, ur, us, ut, Drt, Ds, Dt, nr, ns, nt, if3d)
subroutine invcol2(a, b, n)
subroutine transpose(a, lda, b, ldb)
subroutine add3s12(x, y, z, c1, c2, n)
real function vlsum(vec, n)
subroutine subcol3(a, b, c, n)
subroutine cfill(a, b, n)
subroutine invcol3(a, b, c, n)
subroutine mxm(a, n1, b, n2, c, n3)
subroutine local_grad2(ur, us, u, N, e, D, Dt)
subroutine local_grad3(ur, us, ut, u, N, e, D, Dt)
subroutine gradm1(ux, uy, uz, u)
subroutine set_vert(glo_num, ngv, nx, nel, vertex, ifcenter)
subroutine specmpn(b, nb, a, na, ba, ab, if3d, w, ldw)
subroutine zwgl(Z, W, NP)
subroutine zwgll(Z, W, NP)