28 common /ctmp0/ intw,intt
30 $ , zgmv,wgtv,zgmp,wgtp,tmax(100),omax(103)
34 real wk1 (lx1,lx1,lx1,lelt)
35 real wk2 (lx1,lx1,lx1)
36 real zgmv(lx1),wgtv(lx1),zgmp(lx1),wgtp(lx1)
39 parameter(lt=lx1*ly1*lz1*lelv)
40 common /scruz/ w1(lt),w2(lt),w3(lt),wt(lt)
53 if(ifaxis)
call exitti(
'Filtering not supported w/ IFAXIS!$',1)
54 if(nid.eq.0 .and. loglevel.gt.2)
write(6,*)
'apply q_filter ',
63 elseif (icalld.lt.0)
then
65 call zwgll(zgmv,wgtv,lxv)
66 call igllm(intuv,intw,zgmv,zgm1,lxv,lx1,lxv,lx1)
67 call igllm(intdv,intw,zgm1,zgmv,lx1,lxv,lx1,lxv)
69 call zwgl (zgmp,wgtp,lxp)
70 call iglm (intup,intw,zgmp,zgm2,lxp,lx2,lxp,lx2)
71 call iglm (intdp,intw,zgm2,zgmp,lx2,lxp,lx2,lxp)
75 call mxm(intup,lx2,intdp,lxp,intp,lx2)
76 call mxm(intuv,lx1,intdv,lxv,intv,lx1)
83 call add2sxy(intp,wght,intup,w0,lx2*lx2)
85 call ident (intuv,lx1)
86 call add2sxy (intv ,wght,intuv,w0,lx1*lx1)
94 if ( ifflow .and. .not. ifmhd ) if_fltv = .true.
95 if ( ifmhd ) if_fltv = .true.
96 if ( .not.ifbase ) if_fltv = .false.
97 if ( .not. iffilter(1) ) if_fltv = .false.
100 call filterq(vx,intv,lx1,lz1,wk1,wk2,intt,if3d,umax)
101 call filterq(vy,intv,lx1,lz1,wk1,wk2,intt,if3d,vmax)
103 $
call filterq(vz,intv,lx1,lz1,wk1,wk2,intt,if3d,wmax)
105 if (ifsplit.and..not.iflomach)
106 $
call filterq(pr,intv,lx1,lz1,wk1,wk2,intt,if3d,pmax)
110 call filterq(vxp(1,j),intv,lx1,lz1,wk1,wk2,intt,if3d,umax)
111 call filterq(vyp(1,j),intv,lx1,lz1,wk1,wk2,intt,if3d,vmax)
113 $
call filterq(vzp(1,j),intv,lx1,lz1,wk1,wk2,intt,if3d,wmax)
118 if (ifmhd.and.ifield.eq.ifldmhd)
then
119 call filterq(bx,intv,lx1,lz1,wk1,wk2,intt,if3d,umax)
120 call filterq(by,intv,lx1,lz1,wk1,wk2,intt,if3d,vmax)
122 $
call filterq(bz,intv,lx1,lz1,wk1,wk2,intt,if3d,wmax)
137 if (.not. iffilter(ifield))
goto 10
138 call filterq(t(1,1,1,1,ifld),intv,
139 $ lx1,lz1,wk1,wk2,intt,if3d,tmax(ifld))
142 call filterq(tp(1,j,1),intv,lx1,lz1,wk1,wk2,intt,if3d,
166 subroutine filterq(v,f,nx,nz,w1,w2,ft,if3d,dmax)
171 real v(nx*nx*nz,nelt),w1(1),w2(1)
174 real f(nx,nx),ft(nx,nx)
183 if (nio.eq.0 .and. loglevel.gt.2)
write(6,*)
'call filterq',ifield
189 call copy(w2,v(1,e),nxyz)
190 call mxm(f,nx,w2,nx,w1,nx*nx)
194 call mxm(w1(i),nx,ft,nx,w2(j),nx)
198 call mxm (w2,nx*nx,ft,nx,w1,nx)
199 call sub3(w2,v(1,e),w1,nxyz)
200 call copy(v(1,e),w1,nxyz)
202 dmax = max(dmax,abs(smax))
208 call copy(w1,v(1,e),nxyz)
209 call mxm(f ,nx,w1,nx,w2,nx)
210 call mxm(w2,nx,ft,nx,w1,nx)
212 call sub3(w2,v(1,e),w1,nxyz)
213 call copy(v(1,e),w1,nxyz)
215 dmax = max(dmax,abs(smax))
226 open(unit=io,
file=name)
240 real pm1(lx1,ly1,lz1,lelv),pm2(lx2,ly2,lz2,lelv)
241 $ ,pa (lx1,ly2,lz2) ,pb (lx1,ly1,lz2)
245 nglob1 = lx1*ly1*lz1*nelv
251 CALL copy(pm1,pm2,nglob1)
254 CALL mxm (ixm21,lx1,pm2(1,1,1,iel),lx2,pa(1,1,1),nyz2)
256 CALL mxm (pa(1,1,iz),lx1,iytm21,ly2,pb(1,1,iz),ly1)
258 CALL mxm (pb(1,1,1),nxy1,iztm21,lz2,pm1(1,1,1,iel),lz1)
263 CALL dssum (pm1,lx1,ly1,lz1)
264 CALL col2 (pm1,vmult,nglob1)
280 real a(lx1,lz1,6,lelt),area(lx1,lz1,6,lelt)
286 sum = sum + a(i,1,f,e)*area(i,1,f,e)
303 real a(lx1,ly1,lz1,lelt),area(lx1,lz1,6,lelt)
307 call dsset(lx1,ly1,lz1)
311 jskip1 = skpdat(3,fd)
314 jskip2 = skpdat(6,fd)
318 do 100 j2=js2,jf2,jskip2
319 do 100 j1=js1,jf1,jskip1
321 sum = sum + a(j1,j2,1,e)*area(i,1,f,e)
340 dimension a(lx1,ly1,lz1,lelv)
342 $ ,area(lx1,lz1,6,lelv)
346 CALL dsset(lx1,ly1,lz1)
348 js1 = skpdat(1,iface)
349 jf1 = skpdat(2,iface)
350 jskip1 = skpdat(3,iface)
351 js2 = skpdat(4,iface)
352 jf2 = skpdat(5,iface)
353 jskip2 = skpdat(6,iface)
357 DO 100 j2=js2,jf2,jskip2
358 DO 100 j1=js1,jf1,jskip1
360 sum = sum + a(j1,j2,1,ie)*b(i,1,ifc,ie)*area(i,1,ifc,ie)
372 dimension a(lx1,ly1,lz1,lelv)
373 $ , b(lx1,lz1,6,lelv)
374 $ , c(lx1,lz1,6,lelv)
375 $ , area(lx1,lz1,6,lelv)
376 call dsset(lx1,ly1,lz1)
378 js1 = skpdat(1,iface)
379 jf1 = skpdat(2,iface)
380 jskip1 = skpdat(3,iface)
381 js2 = skpdat(4,iface)
382 jf2 = skpdat(5,iface)
383 jskip2 = skpdat(6,iface)
389 sum=sum+a(j1,j2,1,ie)*b(i,1,ifc,ie)*c(i,1,ifc,ie)
406 write(6,1) name9,n,nnz
407 1
format(/,
'CSR Mat:',a9,3x,
'n =',i5,3x,
'nnz =',i5,/)
418 if (a.ne.0..and.j.le.n16)
write(s(j),9) a
420 write(6,16) (s(k),k=1,n16)
430 real ur(0:N,0:N,0:N),us(0:N,0:N,0:N),ut(0:N,0:N,0:N)
431 real u (0:N,0:N,0:N,1)
432 real D (0:N,0:N),Dt(0:N,0:N)
438 call mxm(d ,m1,u(0,0,0,e),m1,ur,m2)
440 call mxm(u(0,0,k,e),m1,dt,m1,us(0,0,k),m1)
442 call mxm(u(0,0,0,e),m2,dt,m1,ut,m1)
449 real ur(0:N,0:N),us(0:N,0:N)
451 real D (0:N,0:N),Dt(0:N,0:N)
456 call mxm(d ,m1,u(0,0,e),m1,ur,m1)
457 call mxm(u(0,0,e),m1,dt,m1,us,m1)
472 parameter(lxyz=lx1*ly1*lz1)
473 real ux(lxyz,1),uy(lxyz,1),uz(lxyz,1),u(lxyz,1)
475 common /ctmp1/ ur(lxyz),us(lxyz),ut(lxyz)
487 ux(i,e) = jacmi(i,e)*(ur(i)*rxm1(i,1,1,e)
488 $ + us(i)*sxm1(i,1,1,e)
489 $ + ut(i)*txm1(i,1,1,e) )
490 uy(i,e) = jacmi(i,e)*(ur(i)*rym1(i,1,1,e)
491 $ + us(i)*sym1(i,1,1,e)
492 $ + ut(i)*tym1(i,1,1,e) )
493 uz(i,e) = jacmi(i,e)*(ur(i)*rzm1(i,1,1,e)
494 $ + us(i)*szm1(i,1,1,e)
495 $ + ut(i)*tzm1(i,1,1,e) )
498 if (ifaxis)
call setaxdy (ifrzer(e))
501 ux(i,e) =jacmi(i,e)*(ur(i)*rxm1(i,1,1,e)
502 $ + us(i)*sxm1(i,1,1,e) )
503 uy(i,e) =jacmi(i,e)*(ur(i)*rym1(i,1,1,e)
504 $ + us(i)*sym1(i,1,1,e) )
517 parameter(lt=lx1*ly1*lz1*lelv)
518 real vort(lt,3),work1(1),work2(1),u(1),v(1),w(1)
520 parameter(lx=lx1*ly1*lz1)
521 real ur(lx),us(lx),ut(lx)
522 $ ,vr(lx),vs(lx),vt(lx)
523 $ ,wr(lx),ws(lx),wt(lx)
524 common /ctmp0/ ur,us,ut,vr,vs,vt,wr,ws,wt
529 ntot = lx1*ly1*lz1*nelt
542 vuy=ur(i)*rym1(i,1,1,e)+us(i)*sym1(i,1,1,e)+ut(i)*tym1(i,1,1,e)
543 vuz=ur(i)*rzm1(i,1,1,e)+us(i)*szm1(i,1,1,e)+ut(i)*tzm1(i,1,1,e)
544 vvx=vr(i)*rxm1(i,1,1,e)+vs(i)*sxm1(i,1,1,e)+vt(i)*txm1(i,1,1,e)
546 vvz=vr(i)*rzm1(i,1,1,e)+vs(i)*szm1(i,1,1,e)+vt(i)*tzm1(i,1,1,e)
547 vwx=wr(i)*rxm1(i,1,1,e)+ws(i)*sxm1(i,1,1,e)+wt(i)*txm1(i,1,1,e)
548 vwy=wr(i)*rym1(i,1,1,e)+ws(i)*sym1(i,1,1,e)+wt(i)*tym1(i,1,1,e)
552 vort(k,1) = (vwy-vvz)*jacmil
553 vort(k,2) = (vuz-vwx)*jacmil
554 vort(k,3) = (vvx-vuy)*jacmil
567 vuy=ur(i)*rym1(i,1,1,e)+us(i)*sym1(i,1,1,e)+ut(i)*tym1(i,1,1,e)
568 vvx=vr(i)*rxm1(i,1,1,e)+vs(i)*sxm1(i,1,1,e)+vt(i)*txm1(i,1,1,e)
572 vort(k,1) = (vvx-vuy)*jacmi(i,e)
583 call col2 (vort(1,idim),bm1,ntot)
584 call dssum (vort(1,idim),lx1,ly1,lz1)
585 call col2 (vort(1,idim),binvm1,ntot)
588 call col2 (vort,bm1,ntot)
589 call dssum (vort,lx1,ly1,lz1)
590 call col2 (vort,binvm1,ntot)
603 real a(lx1,ly1,lz1,1)
607 call dsset(lx1,ly1,lz1)
610 js1 = skpdat(1,iface)
611 jf1 = skpdat(2,iface)
612 jskip1 = skpdat(3,iface)
613 js2 = skpdat(4,iface)
614 jf2 = skpdat(5,iface)
615 jskip2 = skpdat(6,iface)
621 do 100 j2=js2,jf2,jskip2
622 do 100 j1=js1,jf1,jskip1
624 sarea = sarea+area(i,1,f,e)
625 sint = sint +area(i,1,f,e)*a(j1,j2,1,e)
638 parameter(l=lx1*ly1*lz1)
640 real qx(l,1),qy(l,1),qz(l,1),w(lx1,ly1,lz1)
643 call faccl3 (w,qx(1,e),unx(1,1,f,e),f)
644 call faddcl3 (w,qy(1,e),uny(1,1,f,e),f)
645 if (if3d)
call faddcl3 (w,qz(1,e),unz(1,1,f,e),f)
647 call dsset(lx1,ly1,lz1)
649 js1 = skpdat(1,iface)
650 jf1 = skpdat(2,iface)
651 jskip1 = skpdat(3,iface)
652 js2 = skpdat(4,iface)
653 jf2 = skpdat(5,iface)
654 jskip2 = skpdat(6,iface)
658 do 100 j2=js2,jf2,jskip2
659 do 100 j1=js1,jf1,jskip1
661 dq = dq + area(i,1,f,e)*w(j1,j2,1)
667 subroutine gaujordf(a,m,n,indr,indc,ipiv,ierr,rmult)
679 integer indr(m),indc(n),ipiv(n)
694 if (ipiv(i).ne.1)
then
696 if (ipiv(j).eq.0)
then
697 if (abs(a(i,j)).ge.amx)
then
702 elseif (ipiv(j).gt.1)
then
709 ipiv(jc) = ipiv(jc) + 1
723 if (abs(a(jc,jc)).lt.eps)
then
724 write(6 ,*)
'small Gauss Jordan Piv:',jc,a(jc,jc)
725 write(28,*)
'small Gauss Jordan Piv:',jc,a(jc,jc)
733 a(jc,j) = a(jc,j)*piv
748 a(i,j) = a(i,j) - rmult(i)*a(1,j)
772 if (indr(j).ne.indc(j))
then
775 a(i,indr(j))=a(i,indc(j))
794 l(j) = ( (2*j-1) * x * l(j-1) - (j-1) * l(j-2) ) / j
824 real intv(nx,nx),zpts(nx)
828 real phi(lm2),pht(lm2),diag(lm2),rmult(lm),Lj(lm)
829 integer indr(lm),indc(lm),ipiv(lm)
832 write(6,*)
'ABORT in build_new_filter:',nx,lm
847 pht(kj) = lj(k)-lj(k-2)
851 call copy (pht,phi,nx*nx)
852 call gaujordf (pht,nx,nx,indr,indc,ipiv,ierr,rmult)
861 amp = wght*(k-k0)*(k-k0)/(kut*kut)
865 call mxm (diag,nx,pht,nx,intv,nx)
866 call mxm (phi ,nx,intv,nx,pht,nx)
867 call copy (intv,pht,nx*nx)
874 write(6,6)
'filt amp',(pht(k),k=1,nx*nx,np1)
875 write(6,6)
'filt trn',(diag(k),k=1,nx*nx,np1)
876 6
format(a8,16f7.4,6(/,8x,16f7.4))
909 if (ax1.ne.lx1 .or. ay1.ne.ly1 .or. az1.ne.lz1)
then
910 if(nid.eq.0)
write(6,*)
911 $
'ABORT: wrong size of ax1,ay1,az1 in avg_all(), check SIZE!'
914 if (ax2.ne.lx2 .or. ay2.ne.ay2 .or. az2.ne.lz2)
then
915 if(nid.eq.0)
write(6,*)
916 $
'ABORT: wrong size of ax2,ay2,az2 in avg_all(), check SIZE!'
920 ntot = lx1*ly1*lz1*nelv
921 ntott = lx1*ly1*lz1*nelt
922 nto2 = lx2*ly2*lz2*nelv
925 if (icalld.eq.0)
then
930 call rzero(uavg,ntot)
931 call rzero(vavg,ntot)
932 call rzero(wavg,ntot)
933 call rzero(pavg,nto2)
935 call rzero(tavg(1,1,1,1,i),ntott)
938 call rzero(urms,ntot)
939 call rzero(vrms,ntot)
940 call rzero(wrms,ntot)
941 call rzero(prms,nto2)
943 call rzero(trms(1,1,1,1,i),ntott)
946 call rzero(vwms,ntot)
947 call rzero(wums,ntot)
948 call rzero(uvms,ntot)
952 atime = atime + dtime
956 if (iastep.eq.0) iastep=param(15)
957 if (iastep.eq.0) iastep=500
960 if (istep.le.10) ifverbose=.true.
961 if (mod(istep,iastep).eq.0) ifverbose=.true.
963 if (atime.ne.0..and.dtime.ne.0.)
then
964 if(nio.eq.0)
write(6,*)
'Compute statistics ...'
968 call avg1 (uavg,vx,alpha,beta,ntot ,
'um ',ifverbose)
969 call avg1 (vavg,vy,alpha,beta,ntot ,
'vm ',ifverbose)
970 call avg1 (wavg,vz,alpha,beta,ntot ,
'wm ',ifverbose)
971 call avg1 (pavg,pr,alpha,beta,nto2 ,
'prm ',ifverbose)
972 call avg1 (tavg,t ,alpha,beta,ntott,
'tm ',ifverbose)
974 call avg1 (tavg(1,1,1,1,i),t(1,1,1,1,i),alpha,beta,
975 & ntott,
'psav',ifverbose)
979 call avg2 (urms,vx,alpha,beta,ntot ,
'ums ',ifverbose)
980 call avg2 (vrms,vy,alpha,beta,ntot ,
'vms ',ifverbose)
981 call avg2 (wrms,vz,alpha,beta,ntot ,
'wms ',ifverbose)
982 call avg2 (prms,pr,alpha,beta,nto2 ,
'prms',ifverbose)
983 call avg2 (trms,t ,alpha,beta,ntott,
'tms ',ifverbose)
985 call avg2 (trms(1,1,1,1,i),t(1,1,1,1,i),alpha,beta,
986 & ntott,
'psms',ifverbose)
990 call avg3 (uvms,vx,vy,alpha,beta,ntot,
'uvm ',ifverbose)
991 call avg3 (vwms,vy,vz,alpha,beta,ntot,
'vwm ',ifverbose)
992 call avg3 (wums,vz,vx,alpha,beta,ntot,
'wum ',ifverbose)
996 if ( (mod(istep,iastep).eq.0.and.istep.gt.1) .or.lastep.eq.1)
then
1003 call outpost2(uavg,vavg,wavg,pavg,tavg,ldimt,
'avg')
1004 call outpost2(urms,vrms,wrms,prms,trms,ldimt,
'rms')
1005 call outpost (uvms,vwms,wums,prms,trms,
'rm2')
1018 subroutine avg1(avg,f,alpha,beta,n,name,ifverbose)
1027 avg(k) = alpha*avg(k) + beta*f(k)
1031 avgmax =
glmax(avg,n)
1032 avgmin =
glmin(avg,n)
1033 if (nio.eq.0)
write(6,1) istep,time,avgmin,avgmax
1035 1
format(i9,1p5e13.5,1x,a4,
' av1mnx')
1041 subroutine avg2(avg,f,alpha,beta,n,name,ifverbose)
1050 avg(k) = alpha*avg(k) + beta*f(k)*f(k)
1054 avgmax =
glmax(avg,n)
1055 avgmin =
glmin(avg,n)
1056 if (nio.eq.0)
write(6,1) istep,time,avgmin,avgmax
1058 1
format(i9,1p5e13.5,1x,a4,
' av2mnx')
1064 subroutine avg3(avg,f,g,alpha,beta,n,name,ifverbose)
1068 real avg(n),f(n),g(n)
1073 avg(k) = alpha*avg(k) + beta*f(k)*g(k)
1077 avgmax =
glmax(avg,n)
1078 avgmin =
glmin(avg,n)
1079 if (nio.eq.0)
write(6,1) istep,time,avgmin,avgmax
1081 1
format(i9,1p5e13.5,1x,a4,
' av3mnx')
1089 real Lj(nx*nx),Ljt(nx*nx),zpts(nx)
1092 integer indr(lm),indc(lm),ipiv(lm)
1096 write(6,*)
'ABORT in build_legend_transform:',nx,lm
1110 call gaujordf (lj,nx,nx,indr,indc,ipiv,ierr,rmult)
1121 real err(5,2),u(1),uh(nx,nx,nx),w(1),Lj(1),Ljt(1)
1127 utot =
vlsc2(u,u,nxyz)
1128 if (utot.eq.0)
return
1130 call tensr3(uh,nx,u,nx,lj,ljt,ljt,w)
1142 amp2_l = amp2_l + uh(i,j,k)**2
1153 amp2_t = amp2_t + uh(i,j,k)**2
1162 amp2_s = amp2_s + uh(i,j,k)**2
1171 amp2_r = amp2_r + uh(i,j,k)**2
1180 amp2_h = amp2_h + uh(i,j,k)**2
1185 etot = amp2_l + amp2_r + amp2_s + amp2_t + amp2_h
1187 relr = amp2_r / (amp2_r + amp2_l)
1188 rels = amp2_s / (amp2_s + amp2_l)
1189 relt = amp2_t / (amp2_t + amp2_l)
1190 relh = (amp2_r + amp2_s + amp2_t + amp2_h) / etot
1197 amp2_l = amp2_l + uh(i,j,k)**2
1200 if (amp2_l.eq.0)
return
1209 amp2_s = amp2_s + uh(i,j,k)**2
1216 amp2_r = amp2_r + uh(i,j,k)**2
1223 amp2_h = amp2_h + uh(i,j,k)**2
1227 etot = amp2_l + amp2_r + amp2_s + amp2_h
1229 relr = amp2_r / (amp2_r + amp2_l)
1230 rels = amp2_s / (amp2_s + amp2_l)
1232 relh = (amp2_r + amp2_s + amp2_h) / etot
1236 err(1,1) = sqrt(relr)
1237 err(2,1) = sqrt(rels)
1238 if (if3d) err(3,1) = sqrt(relt)
1239 err(4,1) = sqrt(relh)
1240 err(5,1) = sqrt(etot)
1242 err(1,2) = sqrt(amp2_r)
1243 err(2,2) = sqrt(amp2_s)
1244 if (if3d) err(3,2) = sqrt(amp2_t)
1245 err(4,2) = sqrt(amp2_h)
1246 err(5,2) = sqrt(utot)
1256 ez = 1 + (eg-1)/nelxy
1258 ey = 1 + (ey-1)/nelx
1269 character*2 excode(15)
1273 character*1 fhdfle1(132)
1274 character*132 fhdfle
1275 equivalence(fhdfle,fhdfle1)
1278 if (jstep.gt.10000) jstep = jstep / 10
1279 if (jstep.gt.10000) jstep = jstep / 10
1280 if (jstep.gt.10000) jstep = jstep / 10
1281 if (jstep.gt.10000) jstep = jstep / 10
1282 if (jstep.gt.10000) jstep = jstep / 10
1293 IF (p66.EQ.1.0)
THEN
1296 $ nlxy,nx,ny,nzz,time,jstep,(excode(i),i=1,15)
1297 ELSEIF (p66.EQ.3.0)
THEN
1299 WRITE(27,
'(4I4,1pe14.7,I5,1X,15A2,1X,A12)')
1300 $ nlxy,nx,ny,nzz,time,jstep,(excode(i),i=1,15),
1302 ELSEIF (p66.eq.4.0)
THEN
1304 WRITE(fhdfle,
'(4I4,1pe14.7,I5,1X,15A2,1X,A12)')
1305 $ nlxy,nx,ny,nzz,time,jstep,(excode(i),i=1,15),
1308 ELSEIF (p66.eq.5.0)
THEN
1310 WRITE(fhdfle,
'(4I4,1pe14.7,I5,1X,15A2,1X,A12)')
1311 $ nlxy,nx,ny,nzz,time,jstep,(excode(i),i=1,15),
1316 WRITE(24,
'(4I4,1pe14.7,I5,1X,15A2,1X,A12)')
1317 $ nlxy,nx,ny,nzz,time,jstep,(excode(i),i=1,15),
1322 IF (p66.EQ.1.0)
THEN
1324 WRITE(24)(cdrror,i=1,nlxy)
1325 ELSEIF (p66.eq.3. .or. p66.eq.4.0)
then
1327 test_pattern = 6.54321
1329 ELSEIF (p66.eq.5.)
then
1330 test_pattern8 = 6.54321
1334 WRITE(24,
'(6G11.4)')(cdrror,i=1,nlxy)
1340 subroutine outfld2d_p(u,v,w,nx,ny,nlx,nly,name,ifld,jid,npido,ir)
1349 real u(nx*ny*nlx*nly)
1350 real v(nx*ny*nlx*nly)
1351 real w(nx*ny*nlx*nly)
1354 character*2 excode(15)
1356 character*20 outfile
1358 character*1 slash,dot
1360 data slash,dot /
'/' ,
'.' /
1364 call blank(excode,30)
1371 call blank(outfile,20)
1372 if (npido.lt.100)
then
1373 if (ifld.lt.100)
then
1374 write(outfile,22) jid,slash,name,ifld
1375 22
format(
'B',i2.2,a1,a4,
'.fld',i2.2)
1376 elseif (ifld.lt.1000)
then
1377 write(outfile,23) jid,slash,name,ifld
1378 23
format(
'B',i2.2,a1,a4,
'.fld',i3)
1379 elseif (ifld.lt.10000)
then
1380 write(outfile,24) jid,slash,name,ifld
1381 24
format(
'B',i2.2,a1,a4,
'.fld',i4)
1382 elseif (ifld.lt.100000)
then
1383 write(outfile,25) jid,slash,name,ifld
1384 25
format(
'B',i2.2,a1,a4,
'.fld',i5)
1385 elseif (ifld.lt.1000000)
then
1386 write(outfile,26) jid,slash,name,ifld
1387 26
format(
'B',i2.2,a1,a4,
'.fld',i6)
1390 if (ifld.lt.100)
then
1391 write(outfile,32) jid,slash,name,ifld
1392 32
format(
'B',i3.3,a1,a4,
'.fld',i2.2)
1393 elseif (ifld.lt.1000)
then
1394 write(outfile,33) jid,slash,name,ifld
1395 33
format(
'B',i3.3,a1,a4,
'.fld',i3)
1396 elseif (ifld.lt.10000)
then
1397 write(outfile,34) jid,slash,name,ifld
1398 34
format(
'B',i3.3,a1,a4,
'.fld',i4)
1399 elseif (ifld.lt.100000)
then
1400 write(outfile,35) jid,slash,name,ifld
1401 35
format(
'B',i3.3,a1,a4,
'.fld',i5)
1402 elseif (ifld.lt.1000000)
then
1403 write(outfile,36) jid,slash,name,ifld
1404 36
format(
'B',i3.3,a1,a4,
'.fld',i6)
1408 if (icalld.le.4)
write(6,*) nid,outfile,
' OPEN',nlx,nly
1409 open(unit=24,
file=outfile,status=
'unknown')
1413 write(fm,10) nthings
1414 write(24,fm) (u(i),v(i),w(i),i=1,n)
1415 10
format(
'(1p',i1,
'e14.6)')
1426 real u(nx*ny*nlx*nly)
1427 real v(nx*ny*nlx*nly)
1428 real w(nx*ny*nlx*nly)
1431 character*2 excode(15)
1433 character*20 outfile
1437 call blank(excode,30)
1453 call blank(outfile,20)
1454 if (ifld.lt.100)
then
1455 write(outfile,2) name,ifld
1456 2
format(a3,
'2d.fld',i2.2)
1457 elseif (ifld.lt.1000)
then
1458 write(outfile,3) name,ifld
1459 3
format(a3,
'2d.fld',i3)
1460 elseif (ifld.lt.10000)
then
1461 write(outfile,4) name,ifld
1462 4
format(a3,
'2d.fld',i4)
1463 elseif (ifld.lt.100000)
then
1464 write(outfile,5) name,ifld
1465 5
format(a3,
'2d.fld',i5)
1466 elseif (ifld.lt.1000000)
then
1467 write(outfile,6) name,ifld
1468 6
format(a3,
'2d.fld',i6)
1470 open(unit=24,
file=outfile,status=
'unknown')
1474 write(fm,10) nthings
1477 write(24,fm) (u(i),v(i),w(i),i=1,n)
1478 10
format(
'(1p',i1,
'e14.6)')
1484 call err_chk(ierr,
'Error using byte_write,outfld2d. Abort.$')
1489 subroutine drgtrq(dgtq,xm0,ym0,zm0,sij,pm1,visc,f,e)
1498 real xm0 (lx1,ly1,lz1,lelt)
1499 real ym0 (lx1,ly1,lz1,lelt)
1500 real zm0 (lx1,ly1,lz1,lelt)
1501 real sij (lx1,ly1,lz1,3*ldim-3,lelv)
1502 real pm1 (lx1,ly1,lz1,lelv)
1503 real visc(lx1,ly1,lz1,lelv)
1510 call dsset(lx1,ly1,lz1)
1514 jskip1 = skpdat(3,pf)
1517 jskip2 = skpdat(6,pf)
1521 if (if3d.or.ifaxis)
then
1524 do j2=js2,jf2,jskip2
1525 do j1=js1,jf1,jskip1
1527 n1 = unx(i,1,f,e)*area(i,1,f,e)
1528 n2 = uny(i,1,f,e)*area(i,1,f,e)
1529 n3 = unz(i,1,f,e)*area(i,1,f,e)
1530 a = a + area(i,1,f,e)
1534 s11 = sij(j1,j2,1,1,e)
1535 s21 = sij(j1,j2,1,4,e)
1536 s31 = sij(j1,j2,1,6,e)
1538 s12 = sij(j1,j2,1,4,e)
1539 s22 = sij(j1,j2,1,2,e)
1540 s32 = sij(j1,j2,1,5,e)
1542 s13 = sij(j1,j2,1,6,e)
1543 s23 = sij(j1,j2,1,5,e)
1544 s33 = sij(j1,j2,1,3,e)
1546 dg(1,1) = pm1(j1,j2,1,e)*n1
1547 dg(2,1) = pm1(j1,j2,1,e)*n2
1548 dg(3,1) = pm1(j1,j2,1,e)*n3
1550 dg(1,2) = -v*(s11*n1 + s12*n2 + s13*n3)
1551 dg(2,2) = -v*(s21*n1 + s22*n2 + s23*n3)
1552 dg(3,2) = -v*(s31*n1 + s32*n2 + s33*n3)
1560 dgtq(k,l) = dgtq(k,l) + dg(k,l)
1564 dgtq(1,3) = dgtq(1,3) + (r2*dg(3,1)-r3*dg(2,1))
1565 dgtq(2,3) = dgtq(2,3) + (r3*dg(1,1)-r1*dg(3,1))
1566 dgtq(3,3) = dgtq(3,3) + (r1*dg(2,1)-r2*dg(1,1))
1568 dgtq(1,4) = dgtq(1,4) + (r2*dg(3,2)-r3*dg(2,2))
1569 dgtq(2,4) = dgtq(2,4) + (r3*dg(1,2)-r1*dg(3,2))
1570 dgtq(3,4) = dgtq(3,4) + (r1*dg(2,2)-r2*dg(1,2))
1578 do j2=js2,jf2,jskip2
1579 do j1=js1,jf1,jskip1
1581 n1 = unx(i,1,f,e)*area(i,1,f,e)
1582 n2 = uny(i,1,f,e)*area(i,1,f,e)
1583 a = a + area(i,1,f,e)
1586 s11 = sij(j1,j2,1,1,e)
1587 s12 = sij(j1,j2,1,3,e)
1588 s21 = sij(j1,j2,1,3,e)
1589 s22 = sij(j1,j2,1,2,e)
1591 dg(1,1) = pm1(j1,j2,1,e)*n1
1592 dg(2,1) = pm1(j1,j2,1,e)*n2
1595 dg(1,2) = -v*(s11*n1 + s12*n2)
1596 dg(2,2) = -v*(s21*n1 + s22*n2)
1605 dgtq(k,l) = dgtq(k,l) + dg(k,l)
1611 dgtq(3,3) = dgtq(3,3) + (r1*dg(2,1)-r2*dg(1,1))
1615 dgtq(3,4) = dgtq(3,4) + (r1*dg(2,2)-r2*dg(1,2))
1634 common /cvflow_r/ flow_rate,base_flow,domain_length,xsec
1638 real x0(3),w1(0:maxobj)
1639 logical ifdout,iftout
1641 common /scrns/ sij(lx1*ly1*lz1*6*lelv)
1642 common /scrcg/ pm1(lx1,ly1,lz1,lelv)
1643 common /scrsf/ xm0(lx1,ly1,lz1,lelt)
1644 $, ym0(lx1,ly1,lz1,lelt)
1645 $, zm0(lx1,ly1,lz1,lelt)
1647 parameter(lr=lx1*ly1*lz1)
1648 common /scruz/ ur(lr),us(lr),ut(lr)
1649 $ , vr(lr),vs(lr),vt(lr)
1650 $ , wr(lr),ws(lr),wt(lr)
1652 n = lx1*ly1*lz1*nelv
1654 call mappr(pm1,pr,xm0,ym0)
1658 if (param(55).ne.0)
then
1659 dpdx_mean = -scale_vf(1)
1660 dpdy_mean = -scale_vf(2)
1661 dpdz_mean = -scale_vf(3)
1664 call add2s2(pm1,xm1,dpdx_mean,n)
1665 call add2s2(pm1,ym1,dpdy_mean,n)
1666 call add2s2(pm1,zm1,dpdz_mean,n)
1671 if (if3d.or.ifaxis) nij=6
1672 call comp_sij(sij,nij,vx,vy,vz,ur,us,ut,vr,vs,vt,wr,ws,wt)
1677 if (istep.lt.1)
call cfill(vdiff,param(2),n)
1679 call cadd2(xm0,xm1,-x0(1),n)
1680 call cadd2(ym0,ym1,-x0(2),n)
1681 call cadd2(zm0,zm1,-x0(3),n)
1683 x1min=
glmin(xm0(1,1,1,1),n)
1684 x2min=
glmin(ym0(1,1,1,1),n)
1685 x3min=
glmin(zm0(1,1,1,1),n)
1687 x1max=
glmax(xm0(1,1,1,1),n)
1688 x2max=
glmax(ym0(1,1,1,1),n)
1689 x3max=
glmax(zm0(1,1,1,1),n)
1715 memtot = nmember(iobj)
1717 ieg = object(iobj,mem,1)
1718 ifc = object(iobj,mem,2)
1719 if (
gllnid(ieg).eq.nid)
then
1721 call drgtrq(dgtq,xm0,ym0,zm0,sij,pm1,vdiff,ifc,ie)
1725 dragpx(iobj) = dragpx(iobj) + dgtq(1,1)
1726 dragpy(iobj) = dragpy(iobj) + dgtq(2,1)
1727 dragpz(iobj) = dragpz(iobj) + dgtq(3,1)
1729 dragvx(iobj) = dragvx(iobj) + dgtq(1,2)
1730 dragvy(iobj) = dragvy(iobj) + dgtq(2,2)
1731 dragvz(iobj) = dragvz(iobj) + dgtq(3,2)
1733 torqpx(iobj) = torqpx(iobj) + dgtq(1,3)
1734 torqpy(iobj) = torqpy(iobj) + dgtq(2,3)
1735 torqpz(iobj) = torqpz(iobj) + dgtq(3,3)
1737 torqvx(iobj) = torqvx(iobj) + dgtq(1,4)
1738 torqvy(iobj) = torqvy(iobj) + dgtq(2,4)
1739 torqvz(iobj) = torqvz(iobj) + dgtq(3,4)
1746 call gop(dragpx,w1,
'+ ',maxobj+1)
1747 call gop(dragpy,w1,
'+ ',maxobj+1)
1748 call gop(dragpz,w1,
'+ ',maxobj+1)
1749 call gop(dragvx,w1,
'+ ',maxobj+1)
1750 call gop(dragvy,w1,
'+ ',maxobj+1)
1751 call gop(dragvz,w1,
'+ ',maxobj+1)
1753 call gop(torqpx,w1,
'+ ',maxobj+1)
1754 call gop(torqpy,w1,
'+ ',maxobj+1)
1755 call gop(torqpz,w1,
'+ ',maxobj+1)
1756 call gop(torqvx,w1,
'+ ',maxobj+1)
1757 call gop(torqvy,w1,
'+ ',maxobj+1)
1758 call gop(torqvz,w1,
'+ ',maxobj+1)
1761 dragx(i) = dragpx(i) + dragvx(i)
1762 dragy(i) = dragpy(i) + dragvy(i)
1763 dragz(i) = dragpz(i) + dragvz(i)
1765 torqx(i) = torqpx(i) + torqvx(i)
1766 torqy(i) = torqpy(i) + torqvy(i)
1767 torqz(i) = torqpz(i) + torqvz(i)
1769 dragpx(0) = dragpx(0) + dragpx(i)
1770 dragvx(0) = dragvx(0) + dragvx(i)
1771 dragx(0) = dragx(0) + dragx(i)
1773 dragpy(0) = dragpy(0) + dragpy(i)
1774 dragvy(0) = dragvy(0) + dragvy(i)
1775 dragy(0) = dragy(0) + dragy(i)
1777 dragpz(0) = dragpz(0) + dragpz(i)
1778 dragvz(0) = dragvz(0) + dragvz(i)
1779 dragz(0) = dragz(0) + dragz(i)
1781 torqpx(0) = torqpx(0) + torqpx(i)
1782 torqvx(0) = torqvx(0) + torqvx(i)
1783 torqx(0) = torqx(0) + torqx(i)
1785 torqpy(0) = torqpy(0) + torqpy(i)
1786 torqvy(0) = torqvy(0) + torqvy(i)
1787 torqy(0) = torqy(0) + torqy(i)
1789 torqpz(0) = torqpz(0) + torqpz(i)
1790 torqvz(0) = torqvz(0) + torqvz(i)
1791 torqz(0) = torqz(0) + torqz(i)
1796 if (if3d.or.ifaxis)
then
1798 write(6,6) istep,time,dragx(i),dragpx(i),dragvx(i),i,
'dragx'
1799 write(6,6) istep,time,dragy(i),dragpy(i),dragvy(i),i,
'dragy'
1800 write(6,6) istep,time,dragz(i),dragpz(i),dragvz(i),i,
'dragz'
1803 write(6,6) istep,time,torqx(i),torqpx(i),torqvx(i),i,
'torqx'
1804 write(6,6) istep,time,torqy(i),torqpy(i),torqvy(i),i,
'torqy'
1805 write(6,6) istep,time,torqz(i),torqpz(i),torqvz(i),i,
'torqz'
1809 write(6,6) istep,time,dragx(i),dragpx(i),dragvx(i),i,
'dragx'
1810 write(6,6) istep,time,dragy(i),dragpy(i),dragvy(i),i,
'dragy'
1813 write(6,6) istep,time,torqz(i),torqpz(i),torqvz(i),i,
'torqz'
1817 6
format(i8,1p4e19.11,2x,i5,a5)
1823 subroutine comp_sij(sij,nij,u,v,w,ur,us,ut,vr,vs,vt,wr,ws,wt)
1833 real sij(lx1*ly1*lz1,nij,lelv)
1834 real u (lx1*ly1*lz1,lelv)
1835 real v (lx1*ly1*lz1,lelv)
1836 real w (lx1*ly1*lz1,lelv)
1837 real ur (1) , us (1) , ut (1)
1838 $ , vr (1) , vs (1) , vt (1)
1839 $ , wr (1) , ws (1) , wt (1)
1857 $ 2*(ur(i)*rxm1(i,1,1,e)+us(i)*sxm1(i,1,1,e)+ut(i)*txm1(i,1,1,e))
1860 $ 2*(vr(i)*rym1(i,1,1,e)+vs(i)*sym1(i,1,1,e)+vt(i)*tym1(i,1,1,e))
1863 $ 2*(wr(i)*rzm1(i,1,1,e)+ws(i)*szm1(i,1,1,e)+wt(i)*tzm1(i,1,1,e))
1866 $ (ur(i)*rym1(i,1,1,e)+us(i)*sym1(i,1,1,e)+ut(i)*tym1(i,1,1,e) +
1867 $ vr(i)*rxm1(i,1,1,e)+vs(i)*sxm1(i,1,1,e)+vt(i)*txm1(i,1,1,e) )
1870 $ (wr(i)*rym1(i,1,1,e)+ws(i)*sym1(i,1,1,e)+wt(i)*tym1(i,1,1,e) +
1871 $ vr(i)*rzm1(i,1,1,e)+vs(i)*szm1(i,1,1,e)+vt(i)*tzm1(i,1,1,e) )
1874 $ (ur(i)*rzm1(i,1,1,e)+us(i)*szm1(i,1,1,e)+ut(i)*tzm1(i,1,1,e) +
1875 $ wr(i)*rxm1(i,1,1,e)+ws(i)*sxm1(i,1,1,e)+wt(i)*txm1(i,1,1,e) )
1880 elseif (ifaxis)
then
1903 $ 2*(ur(i)*rxm1(i,1,1,e)+us(i)*sxm1(i,1,1,e))
1906 $ 2*(vr(i)*rym1(i,1,1,e)+vs(i)*sym1(i,1,1,e))
1909 sij(i,3,e) = v(i,e)/r
1912 $ 2*(vr(i)*rym1(i,1,1,e)+vs(i)*sym1(i,1,1,e))
1916 $ ( ur(i)*rym1(i,1,1,e)+us(i)*sym1(i,1,1,e) +
1917 $ vr(i)*rxm1(i,1,1,e)+vs(i)*sxm1(i,1,1,e) )
1921 $ ( wr(i)*rym1(i,1,1,e)+ws(i)*sym1(i,1,1,e) )
1928 $ ( wr(i)*rxm1(i,1,1,e)+ws(i)*sxm1(i,1,1,e) )
1943 $ 2*(ur(i)*rxm1(i,1,1,e)+us(i)*sxm1(i,1,1,e))
1946 $ 2*(vr(i)*rym1(i,1,1,e)+vs(i)*sym1(i,1,1,e))
1949 $ (ur(i)*rym1(i,1,1,e)+us(i)*sym1(i,1,1,e) +
1950 $ vr(i)*rxm1(i,1,1,e)+vs(i)*sxm1(i,1,1,e) )
1969 character*127 fname127
1972 parameter(lt=lx1*ly1*lz1*lelt)
1973 common /scravg/ ua(lt),va(lt),wa(lt),pa(lt)
1974 common /scrsf/ ta(lt,ldimt)
1977 equivalence(s1,initc)
1980 ib=
indx1(fname127,
' ',1)-1
1981 call chcopy(f1,fname127,ib)
1982 write(6,2) (f1(k),k=1,ib)
1983 2
format(
'Open file: ',127a1)
1987 if (nid.eq.0)
open(77,
file=fname127,status=
'old',err=199)
1989 if (ierr.gt.0)
goto 199
1990 n = lx1*ly1*lz1*nelt
1991 n2= lx2*ly2*lz2*nelt
1998 call rzero (ta(1,k),n)
2004 call blank(initc,127)
2006 if (nid.eq.0)
read(77,127,
end=998) initc(1)
2007 998
call bcast(initc,127)
2010 iblank =
indx1(initc,
' ',1)-1
2011 if (nio.eq.0)
write(6,1) ipass,(s1(k),k=1,iblank)
2012 1
format(i8,
'Reading: ',127a1)
2014 if (
indx1(initc,
'done ',5).eq.0)
then
2019 call opadd2 (ua,va,wa,vx,vy,vz)
2020 call add2 (pa,pr,n2)
2022 call add2(ta(1,k),t(1,1,1,1,k),n)
2033 if (nid.eq.0)
close(77)
2047 if (nid.eq.0) ierr =
iglmax(ierr,1)
2048 call exitti(
'Auto averager did not find list file.$',ierr)
2058 common /cmesh/ xt(2**ldim,ldim)
2060 len = wdsize*ldim*(2**ldim)
2062 if (nid.eq.0)
open(unit=29,
file=
'rea.new')
2069 if (jnid.eq.0 .and. nid.eq.0)
then
2070 call get_el(xt,xm1(1,1,1,e),ym1(1,1,1,e),zm1(1,1,1,e))
2072 elseif (nid.eq.0)
then
2073 call crecv2(mtype,xt,len,jnid)
2075 elseif (jnid.eq.nid)
then
2076 call get_el(xt,xm1(1,1,1,e),ym1(1,1,1,e),zm1(1,1,1,e))
2077 call csend(mtype,xt,len,0,0)
2082 if (nid.eq.0)
close(29)
2093 real xt(2**ldim,ldim)
2098 data ed / 1,2,4,3 , 5,6,8,7 /
2101 write(29,2) ((xt(ed(k),j),k=1,4),j=1,ldim)
2102 write(29,2) ((xt(ed(k),j),k=5,8),j=1,ldim)
2104 1
format(12x,
'ELEMENT',i6,
' [ 1 ] GROUP 0')
2114 real xt(2**ldim,ldim)
2115 real x(lx1,ly1,lz1),y(lx1,ly1,lz1),z(lx1,ly1,lz1)
2118 do k=1,lz1,max(lz1-1,1)
2143 real strsmx(maxobj),x0(3),w1(0:maxobj)
2144 logical ifdout,iftout
2146 common /cvflow_r/ flow_rate,base_flow,domain_length,xsec
2150 common /scrns/ sij(lx1*ly1*lz1*6*lelv)
2151 common /scrcg/ pm1(lx1,ly1,lz1,lelv)
2152 common /scrsf/ xm0(lx1,ly1,lz1,lelt)
2153 $, ym0(lx1,ly1,lz1,lelt)
2154 $, zm0(lx1,ly1,lz1,lelt)
2156 parameter(lr=lx1*ly1*lz1)
2157 common /scruz/ ur(lr),us(lr),ut(lr)
2158 $ , vr(lr),vs(lr),vt(lr)
2159 $ , wr(lr),ws(lr),wt(lr)
2162 n = lx1*ly1*lz1*nelv
2164 call mappr(pm1,pr,xm0,ym0)
2168 if (param(55).ne.0)
then
2169 dpdx_mean = -scale_vf(1)
2170 dpdy_mean = -scale_vf(2)
2171 dpdz_mean = -scale_vf(3)
2174 call add2s2(pm1,xm1,dpdx_mean,n)
2175 call add2s2(pm1,ym1,dpdy_mean,n)
2176 call add2s2(pm1,zm1,dpdz_mean,n)
2181 if (if3d.or.ifaxis) nij=6
2182 call comp_sij(sij,nij,vx,vy,vz,ur,us,ut,vr,vs,vt,wr,ws,wt)
2187 if (istep.lt.1)
call cfill(vdiff,param(2),n)
2189 call cadd2(xm0,xm1,-x0(1),n)
2190 call cadd2(ym0,ym1,-x0(2),n)
2191 call cadd2(zm0,zm1,-x0(3),n)
2193 x1min=
glmin(xm0(1,1,1,1),n)
2194 x2min=
glmin(ym0(1,1,1,1),n)
2195 x3min=
glmin(zm0(1,1,1,1),n)
2197 x1max=
glmax(xm0(1,1,1,1),n)
2198 x2max=
glmax(ym0(1,1,1,1),n)
2199 x3max=
glmax(zm0(1,1,1,1),n)
2201 call rzero(strsmx,maxobj)
2207 memtot = nmember(iobj)
2209 ieg = object(iobj,mem,1)
2210 ifc = object(iobj,mem,2)
2211 if (
gllnid(ieg).eq.nid)
then
2213 call get_strsmax(strsmxl,xm0,ym0,zm0,sij,pm1,vdiff,ifc,ie)
2215 strsmx(ii)=max(strsmx(ii),strsmxl)
2222 call gop(strsmx,w1,
'M ',maxobj)
2236 real xm0 (lx1,ly1,lz1,lelt)
2237 real ym0 (lx1,ly1,lz1,lelt)
2238 real zm0 (lx1,ly1,lz1,lelt)
2239 real sij (lx1,ly1,lz1,3*ldim-3,lelv)
2240 real pm1 (lx1,ly1,lz1,lelv)
2241 real visc(lx1,ly1,lz1,lelv)
2246 call dsset(lx1,ly1,lz1)
2250 jskip1 = skpdat(3,pf)
2253 jskip2 = skpdat(6,pf)
2255 if (if3d.or.ifaxis)
then
2258 do j2=js2,jf2,jskip2
2259 do j1=js1,jf1,jskip1
2267 s11 = sij(j1,j2,1,1,e)
2268 s21 = sij(j1,j2,1,4,e)
2269 s31 = sij(j1,j2,1,6,e)
2271 s12 = sij(j1,j2,1,4,e)
2272 s22 = sij(j1,j2,1,2,e)
2273 s32 = sij(j1,j2,1,5,e)
2275 s13 = sij(j1,j2,1,6,e)
2276 s23 = sij(j1,j2,1,5,e)
2277 s33 = sij(j1,j2,1,3,e)
2279 stress1 = -v*(s11*n1 + s12*n2 + s13*n3)
2280 stress2 = -v*(s21*n1 + s22*n2 + s23*n3)
2281 stress3 = -v*(s31*n1 + s32*n2 + s33*n3)
2283 strsnrm = stress1*stress1+stress2*stress2+stress3*stress3
2284 strsmax = max(strsmax,strsnrm)
2293 do j2=js2,jf2,jskip2
2294 do j1=js1,jf1,jskip1
2296 n1 = unx(i,1,f,e)*area(i,1,f,e)
2297 n2 = uny(i,1,f,e)*area(i,1,f,e)
2300 s11 = sij(j1,j2,1,1,e)
2301 s12 = sij(j1,j2,1,3,e)
2302 s21 = sij(j1,j2,1,3,e)
2303 s22 = sij(j1,j2,1,2,e)
2305 stress1 = -v*(s11*n1 + s12*n2)
2306 stress2 = -v*(s21*n1 + s22*n2)
2308 strsnrm = stress1*stress1+stress2*stress2
2309 strsmax = max(strsmax,strsnrm)
2316 if (strsmax.gt.0) strsmax = sqrt(strsmax)
2326 parameter(lt = lx1*ly1*lz1)
2327 common /scrns/ xb(lt,lelt),yb(lt,lelt),zb(lt,lelt)
2328 common /scruz/ tmsk(lt,lelt),tmlt(lt,lelt),w1(lt),w2(lt)
2333 n = lx1*ly1*lz1*nelt
2337 if (nelgv.ne.nelgt .or. .not.ifflow) ifield = 2
2340 call dssum (tmlt,lx1,ly1,lz1)
2346 if (cb.eq.
'P ')
call facev (tmsk,e,f,0.0,lx1,ly1,lz1)
2349 call dsop(tmsk,
'* ',lx1,ly1,lz1)
2350 call dsop(tmsk,
'* ',lx1,ly1,lz1)
2351 call dsop(tmsk,
'* ',lx1,ly1,lz1)
2358 call copy (xb,xm1,n)
2359 call copy (yb,ym1,n)
2360 call copy (zb,zm1,n)
2361 call dssum (xb,lx1,ly1,lz1)
2362 call dssum (yb,lx1,ly1,lz1)
2363 call dssum (zb,lx1,ly1,lz1)
2376 xb(i,e) = xb(i,e) - xm1(i,1,1,e)
2377 yb(i,e) = yb(i,e) - ym1(i,1,1,e)
2378 zb(i,e) = zb(i,e) - zm1(i,1,1,e)
2379 xb(i,e) = xb(i,e)*tmsk(i,e)
2380 yb(i,e) = yb(i,e)*tmsk(i,e)
2381 zb(i,e) = zb(i,e)*tmsk(i,e)
2383 xm = max(xm,abs(xb(i,e)))
2384 ym = max(ym,abs(yb(i,e)))
2385 zm = max(zm,abs(zb(i,e)))
2388 if (kpass.le.ldim)
then
2396 if (kpass.le.ldim)
then
2410 if (nio.eq.0)
write(6,1) xm,ym,zm,xx,yx,zx,kpass
2411 1
format(1p6e12.4,
' xyz repair',i2)
2424 real x(1),zg(1),e(1),v(1)
2458 si = 0.5*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
2459 sj = 0.5*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
2460 v(i,j) = v(i,j) + si*sj*x(ii,jj)
2465 if (gh_type.eq.1)
then
2479 hj = 0.5*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
2480 e(i,j) = e(i,j) + hj*(x(i,jj)-v(i,jj))
2490 hi = 0.5*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
2491 e(i,j) = e(i,j) + hi*(x(ii,j)-v(ii,j))
2496 call add3(x,e,v,ntot)
2526 si = 0.5*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
2527 sj = 0.5*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
2528 sk = 0.5*((n-kk)*(1-zg(k))+(kk-1)*(1+zg(k)))/(n-1)
2529 v(i,j,k) = v(i,j,k) + si*sj*sk*x(ii,jj,kk)
2536 if (gh_type.eq.1)
then
2552 hj = 0.5*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
2553 hk = 0.5*((n-kk)*(1-zg(k))+(kk-1)*(1+zg(k)))/(n-1)
2554 e(i,j,k) = e(i,j,k) + hj*hk*(x(i,jj,kk)-v(i,jj,kk))
2568 hi = 0.5*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
2569 hk = 0.5*((n-kk)*(1-zg(k))+(kk-1)*(1+zg(k)))/(n-1)
2570 e(i,j,k) = e(i,j,k) + hi*hk*(x(ii,j,kk)-v(ii,j,kk))
2584 hi = 0.5*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
2585 hj = 0.5*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
2586 e(i,j,k) = e(i,j,k) + hi*hj*(x(ii,jj,k)-v(ii,jj,k))
2595 if (gh_type.eq.2)
then
2610 hi = 0.5*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
2611 v(i,j,k) = v(i,j,k) + hi*(x(ii,j,k)-e(ii,j,k))
2623 hj = 0.5*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
2624 v(i,j,k) = v(i,j,k) + hj*(x(i,jj,k)-e(i,jj,k))
2636 hk = 0.5*((n-kk)*(1-zg(k))+(kk-1)*(1+zg(k)))/(n-1)
2637 v(i,j,k) = v(i,j,k) + hk*(x(i,j,kk)-e(i,j,kk))
2651 integer idum,ia,im,iq,ir,ntab,ndiv
2652 real ran1,am,eps,rnmx
2654 parameter(ia=16807,im=2147483647,am=1./im,iq=127773,ir=2836)
2655 parameter(ntab=32,ndiv=1+(im-1)/ntab,eps=1.2e-7,rnmx=1.-eps)
2662 data iv,iy /ntab*0,0/
2664 if (idum.le.0.or.iy.eq.0)
then
2668 idum = ia*(idum-k*iq)-ir*k
2669 if(idum.lt.0) idum = idum+im
2670 if (j.le.ntab) iv(j) = idum
2675 idum = ia*(idum-k*iq)-ir*k
2676 if(idum.lt.0) idum = idum+im
2680 ran1 = min(am*iy,rnmx)
2705 n = lx1*ly1*lz1*nelt
2709 if (xmax.le.xmin)
return
2711 scale = (x1-x0)/(xmax-xmin)
2713 x(i) = x0 +
scale*(x(i)-xmin)
2722 real f(nx,nx),diag(nx),zpts(nx)
2725 parameter(lm2=lm*lm)
2727 common /cfilt1/ phi,pht,ft,rmult,lj,gpts,indr,indc,ipiv
2728 real phi(lm2),pht(lm2),ft(lm2),rmult(lm),Lj(lm),gpts(lm)
2729 integer indr(lm),indc(lm),ipiv(lm)
2735 if (nx.gt.lm)
call exitti(
'ABORT in build_filter:$',nx)
2741 call zwgll (gpts,f,nx)
2754 pht(kj) = lj(k)-lj(k-2)
2759 call copy (pht,phi,nx*nx)
2760 call gaujordf (pht,nx,nx,indr,indc,ipiv,ierr,rmult)
2768 ft(ij) = diag(i)*pht(ij)
2772 call mxm (phi,nx,ft,nx,f,nx)
2786 parameter(lxx=lx1*lx1,lxyz=lx1*ly1*lz1)
2787 common /ctmp0/ f(lxx),wk1(lxyz),wk2(lxyz),wk3(lxyz)
2793 call filterq(u,f,lx1,lz1,wk1,wk2,wk3,if3d,umax)
2809 parameter(lxx=lx1*lx1,lxyz=lx1*ly1*lz1)
2810 common /ctmp0/ f(lxx),wk1(lxyz),wk2(lxyz),wk3(lxyz),diag(lx1)
2821 call filterq(u,f,lx1,lz1,wk1,wk2,wk3,if3d,umax)
2833 parameter(lt=lx1*ly1*lz1)
2837 common /ctmp1/ w(lt,lelt),ur(lt),us(lt),ut(lt),w1(2*lt)
2841 n = lx1*ly1*lz1*nelt
2843 nel = nelfld(ifield)
2851 ur(i) = ur(i)*w3m1(i,1,1)
2852 us(i) = us(i)*w3m1(i,1,1)
2853 ut(i) = ut(i)*w3m1(i,1,1)
2863 w(i,e) = wght*w(i,e)/w3m1(i,1,1)
2867 ur(i) = ur(i)*w3m1(i,1,1)
2868 us(i) = us(i)*w3m1(i,1,1)
2869 ut(i) = ut(i)*w3m1(i,1,1)
2879 v(i,e) = v(i,e) - wght*w(i,e)/w3m1(i,1,1)
2888 ur(i) = ur(i)*w3m1(i,1,1)
2889 us(i) = us(i)*w3m1(i,1,1)
2896 wght = 200./(lx1**4)
2899 w(i,e) = wght*w(i,e)/w3m1(i,1,1)
2903 ur(i) = ur(i)*w3m1(i,1,1)
2904 us(i) = us(i)*w3m1(i,1,1)
2914 v(i,e) = v(i,e) - wght*w(i,e)/w3m1(i,1,1)
2921 if (nio.eq.0)
write(6,1) istep,time,vmax,bmax,
' filter max'
2922 1
format(i9,1p3e12.4,a11)
2929 d = (a-x)**2 + (b-y)**2 + (c-z)**2
2932 if (d.gt.0)
dist3d = sqrt(d)
2939 d = (a-x)**2 + (b-y)**2
2942 if (d.gt.0)
dist2d = sqrt(d)
2952 n = lx1*ly1*lz1*nelt
2989 real d(lx1,ly1,lz1,lelt)
3000 xmn = min(xmin,ymin)
3001 xmx = max(xmax,ymax)
3002 if (if3d) xmn = min(xmn ,zmin)
3003 if (if3d) xmx = max(xmx ,zmax)
3012 if (cbc(f,e,ifld).eq.b)
call facev(d,e,f,0.,lx1,ly1,lz1)
3034 dtmp = d(ii,jj,kk,e) +
dist3d(
3035 $ xm1(ii,jj,kk,e),ym1(ii,jj,kk,e),zm1(ii,jj,kk,e)
3036 $ ,xm1(i ,j ,k ,e),ym1(i ,j ,k ,e),zm1(i ,j ,k ,e))
3038 dtmp = d(ii,jj,kk,e) +
dist2d(
3039 $ xm1(ii,jj,kk,e),ym1(ii,jj,kk,e)
3040 $ ,xm1(i ,j ,k ,e),ym1(i ,j ,k ,e))
3043 if (dtmp.lt.d(i,j,k,e))
then
3046 dmax = max(dmax,d(i,j,k,e))
3056 call fgslib_gs_op(gsh_fld(ifld),d,1,3,0)
3057 nchange =
iglsum(nchange,1)
3058 dmax =
glmax(dmax,1)
3059 if (nio.eq.0.and.loglevel.gt.2)
write(6,1) ipass,nchange,dmax,b
3060 1
format(i9,i12,1pe12.4,
' max distance b: ',a3)
3061 if (nchange.eq.0)
goto 1000
3066 subroutine distf(d,ifld,b,dmin,emin,xn,yn,zn)
3085 real d(lx1,ly1,lz1,lelt)
3088 real dmin(lx1,ly1,lz1,lelt),emin(lx1,ly1,lz1,lelt)
3089 real xn(lx1,ly1,lz1,lelt),yn(lx1,ly1,lz1,lelt)
3090 real zn(lx1,ly1,lz1,lelt)
3100 xmn = min(xmin,ymin)
3101 xmx = max(xmax,ymax)
3102 if (if3d) xmn = min(xmn ,zmin)
3103 if (if3d) xmx = max(xmx ,zmax)
3106 call cfill (d,big,n)
3108 call opcopy(xn,yn,zn,xm1,ym1,zm1)
3113 if (cbc(f,e,1).eq.b)
call facev(d,e,f,0.,lx1,ly1,lz1)
3137 dneigh = d(ii,jj,kk,e)
3138 if (dneigh.lt.dself)
then
3139 d2 = (xm1(i,j,k,e)-xn(ii,jj,kk,e))**2
3140 $ + (ym1(i,j,k,e)-yn(ii,jj,kk,e))**2
3141 if (if3d) d2 = d2 + (zm1(i,j,k,e)-zn(ii,jj,kk,e))**2
3142 if (d2.gt.0) d2 = sqrt(d2)
3143 if (d2.lt.dself)
then
3146 xn(i,j,k,e) = xn(ii,jj,kk,e)
3147 yn(i,j,k,e) = yn(ii,jj,kk,e)
3148 zn(i,j,k,e) = zn(ii,jj,kk,e)
3149 dmax = max(dmax,d(i,j,k,e))
3161 call cfill(emin(1,1,1,e),re,nxyz)
3162 call copy (dmin(1,1,1,e),d(1,1,1,e),nxyz)
3165 nchange =
iglsum(nchange,1)
3167 call fgslib_gs_op(gsh_fld(ifld),dmin,1,3,0)
3173 if (dmin(i,1,1,e).ne.d(i,1,1,e))
then
3174 nchange2 = nchange2+1
3180 nchange2 =
iglsum(nchange2,1)
3181 nchange = nchange + nchange2
3182 call fgslib_gs_op(gsh_fld(ifld),emin,1,4,0)
3187 if (eg.ne.lglel(e))
then
3194 call fgslib_gs_op(gsh_fld(ifld),xn,1,1,0)
3195 call fgslib_gs_op(gsh_fld(ifld),yn,1,1,0)
3196 call fgslib_gs_op(gsh_fld(ifld),zn,1,1,0)
3198 dmax =
glmax(dmax,1)
3199 if (nio.eq.0)
write(6,1) ipass,nchange,dmax
3200 1
format(i9,i12,1pe12.4,
' max wall distance 2')
3201 if (nchange.eq.0)
goto 1000
3238 real d(lx2,ly2,lz2,lelt),m1(lx1*ly1*lz1,lelt)
3240 parameter(lw = 3*lx1*ly1*lz1)
3241 common /ctmp1/ w(lw)
3243 integer icalld,noutf,e,f
3245 data icalld,noutf /0,0/
3253 n = lx1*ly1*lz1*nelv
3254 n2 = lx2*ly2*lz2*nelv
3258 if (icalld.eq.0)
then
3272 if (cbc(f,e,1).eq.b) ifout = .true.
3273 if (cbc(f,e,1).eq.b) noutf = noutf+1
3276 if (lx2.lt.lx1)
then
3277 call maph1_to_l2(d(1,1,1,e),lx2,m1(1,e),lx1,if3d,w,lw)
3279 call copy(d(1,1,1,e),m1(1,e),nxyz)
3281 dmax =
vlmax(m1(1,e),nxyz)
3282 ddmax = max(ddmax,dmax)
3283 call rzero(m1(1,e),nxyz)
3285 call rone (m1(1,e),nxyz)
3294 if (cbc(f,e,1).eq.b) ifout = .true.
3298 d(i,1,1,e) = (ddmax - d(i,1,1,e))/ddmax
3305 if (noutf.eq.0)
return
3310 ubar =
glsc3(vx,bm1,m1,n)
3311 vbar =
glsc3(vy,bm1,m1,n)
3312 wbar =
glsc3(vz,bm1,m1,n)
3313 volu =
glsc2(bm1,m1,n)
3314 ubar = abs(ubar)+abs(vbar)
3315 if (if3d) ubar = abs(ubar)+abs(wbar)
3319 cs = 3*(rq-1.)*(ubar/ddmax)
3320 if (.not.ifsplit) cs = cs*bd(1)/dt
3323 usrdiv(i,1,1,1) = cs*(d(i,1,1,1)**2)
3336 character*3 f2tbc(2,nbc)
3369 character*3 f2tbc(2,nbc)
3375 if (nio.eq.0)
write(6,*)
'add temp: ',nfld,nfield,istep
3377 nelfld(nfld) = nelfld(nfield)
3378 nel = nelfld(nfield)
3379 call copy (bc(1,1,1,nfld),bc(1,1,1,nfield),30*nel)
3380 call chcopy(cbc(1,1,nfld),cbc(1,1,nfield),3*6*nel)
3383 cpfld(nfld,k)=cpfld(nfield,k)
3384 call copy (cpgrp(-5,nfld,k),cpgrp(-5,nfield,k),16)
3386 call icopy(matype(-5,nfld),matype(-5,nfield),16)
3392 ifadvc(nfld) = .true.
3393 iftmsh(nfld) = .true.
3394 ifvarp(nfld) = ifvarp(nfield)
3395 ifdeal(nfld) = ifdeal(nfield)
3396 ifprojfld(nfld) = ldimt_proj.ge.(nfld-1).and.ifprojfld(nfield)
3398 if (nfld.eq.2) ifto = .true.
3399 if (nfld.gt.2) ifpsco(nfld-2) = .true.
3400 if (nfld.gt.2) npscal = npscal+1
3402 ifldmhd = npscal + 3
3410 if (cbc(f,e,nfld).eq.f2tbc(1,k)) cbc(f,e,nfld)=f2tbc(2,k)
3439 common /scrcg/ wrk(lx1*ly1*lz1*lelv)
3441 n = nx1*ny1*nz1*nelv
3443 call copy(wrk,bm1,n)
3444 call fgslib_gs_op(hndl,wrk,1,1,0)
3448 ua(i) = bm1(i,1,1,1)*u(i)*wrk(i)
3451 call fgslib_gs_op(hndl,ua,1,1,0)
subroutine crecv2(mtype, buf, lenm, jnid)
subroutine gop(x, w, op, n)
subroutine exitti(stringi, idata)
subroutine csend(mtype, buf, len, jnid, jpid)
subroutine bcast(buf, len)
subroutine err_chk(ierr, string)
subroutine facev(a, ie, iface, val, nx, ny, nz)
subroutine dsset(nx, ny, nz)
subroutine scale(xyzl, nl)
integer function gllel(ieg)
integer function gllnid(ieg)
subroutine dsop(u, op, nx, ny, nz)
subroutine dssum(u, nx, ny, nz)
subroutine tensr3(v, nv, u, nu, A, Bt, Ct, w)
subroutine restart(nfiles)
subroutine geom_reset(icall)
integer function indx1(S1, S2, L2)
subroutine transpose(a, lda, b, ldb)
subroutine icopy(a, b, n)
function glsc3(a, b, mult, n)
real function vlamax(vec, n)
subroutine add2s2(a, b, c1, n)
real function vlmax(vec, n)
subroutine add2sxy(x, a, y, b, n)
subroutine add3(a, b, c, n)
real function vlsc2(x, y, n)
subroutine cadd2(a, b, const, n)
subroutine transpose1(a, n)
subroutine sub3(a, b, c, n)
subroutine cmult(a, const, n)
real function glamax(a, n)
subroutine chcopy(a, b, n)
subroutine cfill(a, b, n)
subroutine mxm(a, n1, b, n2, c, n3)
subroutine local_grad3_t(u, ur, us, ut, N, e, D, Dt, w)
subroutine opcopy(a1, a2, a3, b1, b2, b3)
subroutine opadd2(a1, a2, a3, b1, b2, b3)
subroutine local_grad2_t(u, ur, us, N, e, D, Dt, w)
function facint_v(a, area, f, e)
subroutine build_new_filter(intv, zpts, nx, kut, wght, nio)
subroutine rand_fld_h1(x)
subroutine cheap_dist(d, ifld, b)
subroutine comp_sij(sij, nij, u, v, w, ur, us, ut, vr, vs, vt, wr, ws, wt)
subroutine build_legend_transform(Lj, Ljt, zpts, nx)
subroutine drgtrq(dgtq, xm0, ym0, zm0, sij, pm1, visc, f, e)
subroutine avg1(avg, f, alpha, beta, n, name, ifverbose)
subroutine domain_size(xmin, xmax, ymin, ymax, zmin, zmax)
subroutine outmatx(a, m, n, io, name)
function facint2(a, b, c, area, ifc, ie)
subroutine turb_outflow(d, m1, rq, uin)
subroutine add_temp(f2tbc, nbc, npass)
subroutine gaujordf(a, m, n, indr, indc, ipiv, ierr, rmult)
subroutine planar_avg(ua, u, hndl)
subroutine shear_calc_max(strsmx, scale, x0, ifdout, iftout)
function facint(a, b, area, ifc, ie)
subroutine q_filter(wght)
subroutine local_grad2(ur, us, u, N, e, D, Dt)
subroutine mappr(pm1, pm2, pa, pb)
subroutine dump_header2d(excode, nx, ny, nlx, nly, ierr)
subroutine rescale_x(x, x0, x1)
subroutine cut_off_filter(u, mx, ifld)
subroutine g_filter(u, diag, ifld)
subroutine auto_averager(fname127)
subroutine gh_face_extend_2d(x, zg, n, gh_type, e, v)
subroutine out_csrmats(acsr, ia, ja, n, name9)
subroutine filter_d2(v, nx, nz, wgt, ifd4)
subroutine get_el(xt, x, y, z)
subroutine legendre_poly(L, x, N)
function dist2d(a, b, x, y)
subroutine get_exyz(ex, ey, ez, eg, nelx, nely, nelz)
subroutine gh_face_extend_3d(x, zg, n, gh_type, e, v)
subroutine outfld2d_p(u, v, w, nx, ny, nlx, nly, name, ifld, jid, npido, ir)
subroutine avg2(avg, f, alpha, beta, n, name, ifverbose)
function facint_a(a, area, f, e)
subroutine local_err_est(err, u, nx, Lj, Ljt, uh, w, if3d)
subroutine filterq(v, f, nx, nz, w1, w2, ft, if3d, dmax)
subroutine outfld2d(u, v, w, nx, ny, nlx, nly, name, ifld)
subroutine local_grad3(ur, us, ut, u, N, e, D, Dt)
function dist3d(a, b, c, x, y, z)
subroutine build_filter(f, diag, nx)
subroutine torque_calc(scale, x0, ifdout, iftout)
subroutine distf(d, ifld, b, dmin, emin, xn, yn, zn)
subroutine comp_vort3(vort, work1, work2, u, v, w)
subroutine avg3(avg, f, g, alpha, beta, n, name, ifverbose)
subroutine surface_int(sint, sarea, a, e, f)
subroutine gradm1(ux, uy, uz, u)
subroutine gh_face_extend(x, zg, n, gh_type, e, v)
subroutine surface_flux(dq, qx, qy, qz, e, f, w)
subroutine add_temp_1(f2tbc, nbc)
subroutine get_strsmax(strsmax, xm0, ym0, zm0, sij, pm1, visc, f, e)
subroutine maph1_to_l2(a, na, b, nb, if3d, w, ldw)
subroutine outpost(v1, v2, v3, vp, vt, name3)
subroutine outpost2(v1, v2, v3, vp, vt, nfldt, name3)
subroutine zwgl(Z, W, NP)
subroutine zwgll(Z, W, NP)
subroutine iglm(I12, IT12, Z1, Z2, lz1, lz2, ND1, ND2)
subroutine igllm(I12, IT12, Z1, Z2, lz1, lz2, ND1, ND2)
subroutine faddcl3(a, b, c, iface1)
subroutine setaxdy(ifaxdy)
subroutine faccl3(a, b, c, iface1)
subroutine cmult2(A, B, CONST, N)