34 if (ifield.gt.1) mg_fld = 2
59 call semhat(ah,bh,ch,dh,zh,dph,jph,bgl,zglhat,dgl,jgl,n,wh)
60 call copy(mg_zh(1,mg_lmax),zglhat,n-1)
63 if(.not.if3d) mg_nhz(mg_lmax)=1
68 call semhat(ah,bh,ch,dh,zh,dph,jph,bgl,zglhat,dgl,jgl,n,wh)
69 call copy(mg_ah(1,l),ah,(n+1)*(n+1))
70 call copy(mg_bh(1,l),bh,n+1)
71 call copy(mg_dh(1,l),dh,(n+1)*(n+1))
73 call copy(mg_zh(1,l),zh,n+1)
96 $ mg_jh(1,l),mg_zh(1,l+1),mg_zh(1,l),nf,nc)
97 call transpose(mg_jht(1,l),nc,mg_jh(1,l),nf)
101 $ mg_jhfc(1,l),mg_zh(1,l),mg_zh(1,l+1),nc,nf)
102 call transpose(mg_jhfct(1,l),nf,mg_jhfc(1,l),nc)
110 real jh(nf,nc),zf(1),zc(1)
127 parameter(lxyz=(lx1+2)*(ly1+2)*(lz1+2))
128 common /c_is1/ glo_num(lxyz*lelv)
129 common /ivrtx/ vertex((2**ldim)*lelt)
146 call setupds(mg_gsh_handle(l,mg_fld),nx,ny,nz
147 $ ,nelv,nelgv,vertex,glo_num)
152 call setupds(mg_gsh_schwarz_handle(l,mg_fld),nx,ny,nz
153 $ ,nelv,nelgv,vertex,glo_num)
161 i = mg_mask_index(mg_lmax,mg_fld-1)
163 mg_rstr_wt_index(l,mg_fld)=i
164 mg_mask_index(l,mg_fld)=i
165 i=i+mg_nh(l)*mg_nhz(l)*2*ldim*nelv
166 if(i .gt. lmgs*lmg_rwt*2*ldim*lelv)
then
167 itmp = i/(2*ldim*lelv)
168 write(6,*)
'parameter lmg_rwt too small',i,itmp,lmg_rwt
172 $ mg_rstr_wt(mg_rstr_wt_index(l,mg_fld))
173 $ ,mg_nh(l),mg_nh(l),mg_nhz(l),l,mg_work)
175 $ mg_mask(mg_mask_index(l,mg_fld))
176 $ ,mg_nh(l),mg_nh(l),mg_nhz(l),l,mg_work)
178 mg_mask_index(l,mg_fld)=i
185 i = mg_mask_index(mg_lmax,mg_fld-1)
187 mg_rstr_wt_index(l,mg_fld)=i
188 mg_mask_index(l,mg_fld)=i
189 i=i+mg_nh(l)*mg_nhz(l)*2*ldim*nelv
190 if(i .gt. lmgs*lmg_rwt*2*ldim*lelv)
then
191 itmp = i/(2*ldim*lelv)
192 write(6,*)
'parameter lmg_rwt too small',i,itmp,lmg_rwt
196 $ mg_rstr_wt(mg_rstr_wt_index(l,mg_fld))
197 $ ,mg_nh(l),mg_nh(l),mg_nhz(l),l,mg_work)
199 $ mg_mask(mg_mask_index(l,mg_fld))
200 $ ,mg_nh(l),mg_nh(l),mg_nhz(l),l,mg_work)
202 mg_mask_index(l,mg_fld)=i
210 call hsmg_tnsr(uf,mg_nh(l+1),uc,mg_nh(l),mg_jh(1,l),mg_jht(1,l))
220 $
call hsmg_do_wt(uf,mg_rstr_wt(mg_rstr_wt_index(l+1,mg_fld))
221 $ ,mg_nh(l+1),mg_nh(l+1),mg_nhz(l+1))
222 call hsmg_tnsr(uc,mg_nh(l),uf,mg_nh(l+1),mg_jht(1,l),mg_jh(1,l))
233 $
call hsmg_do_wt(uf,mg_rstr_wt(mg_rstr_wt_index(l+1,mg_fld))
234 $ ,mg_nh(l+1),mg_nh(l+1),mg_nhz(l+1))
235 call hsmg_tnsr(uc,mg_nh(l),uf,mg_nh(l+1),mg_jht(1,l),mg_jh(1,l))
244 real v(1),u(1),A(1),At(1)
260 real v(nv*nv,nelv),u(nu*nu,nelv),A(1),Bt(1)
262 common /hsmgw/ work((lx1+2)*(lx1+2))
265 call mxm(a,nv,u(1,ie),nu,work,nu)
266 call mxm(work,nv,bt,nu,v(1,ie),nv)
276 real v(nv*nv*nv,nelv),u(nu*nu*nu,nelv),A(1),Bt(1),Ct(1)
278 parameter(lwk=(lx1+2)*(ly1+2)*(lz1+2))
279 common /hsmgw/ work(0:lwk-1),work2(0:lwk-1)
282 call mxm(a,nv,u(1,ie),nu,work,nu*nu)
284 call mxm(work(nv*nu*i),nv,bt,nu,work2(nv*nv*i),nv)
286 call mxm(work2,nv*nv,ct,nu,v(1,ie),nv)
296 real v(nv*nv),u(nu*nu),A(1),Bt(1)
298 common /hsmgw/ work((lx1+2)*(lx1+2))
300 call mxm(a,nv,u,nu,work,nu)
301 call mxm(work,nv,bt,nu,v,nv)
311 real v(nv*nv*nv),u(nu*nu*nu),A(1),Bt(1),Ct(1)
313 parameter(lwk=(lx1+2)*(ly1+2)*(lz1+2))
314 common /hsmgw/ work(0:lwk-1),work2(0:lwk-1)
317 call mxm(a,nv,u,nu,work,nu*nu)
319 call mxm(work(nv*nu*i),nv,bt,nu,work2(nv*nv*i),nv)
321 call mxm(work2,nv*nv,ct,nu,v,nv)
335 call fgslib_gs_op(mg_gsh_handle(l,mg_fld),u,1,1,0)
350 call fgslib_gs_op(mg_gsh_handle(l,mg_fld),u,1,2,0)
362 call fgslib_gs_op(mg_gsh_schwarz_handle(l,mg_fld),u,1,1,0)
371 integer l1,l2,nx,ny,nz
372 real arr1(nx,ny,nz,nelv),arr2(nx,ny,nz,nelv)
375 integer i,j,k,ie,i0,i1
382 arr1(l1+1 ,j,1,ie) = f1*arr1(l1+1 ,j,1,ie)
383 $ +f2*arr2(l2+1 ,j,1,ie)
384 arr1(nx-l1,j,1,ie) = f1*arr1(nx-l1,j,1,ie)
385 $ +f2*arr2(nx-l2,j,1,ie)
388 arr1(i,l1+1 ,1,ie) = f1*arr1(i,l1+1 ,1,ie)
389 $ +f2*arr2(i,l2+1 ,1,ie)
390 arr1(i,ny-l1,1,ie) = f1*arr1(i,ny-l1,1,ie)
391 $ +f2*arr2(i,nx-l2,1,ie)
398 arr1(l1+1 ,j,k,ie) = f1*arr1(l1+1 ,j,k,ie)
399 $ +f2*arr2(l2+1 ,j,k,ie)
400 arr1(nx-l1,j,k,ie) = f1*arr1(nx-l1,j,k,ie)
401 $ +f2*arr2(nx-l2,j,k,ie)
406 arr1(i,l1+1 ,k,ie) = f1*arr1(i,l1+1 ,k,ie)
407 $ +f2*arr2(i,l2+1 ,k,ie)
408 arr1(i,nx-l1,k,ie) = f1*arr1(i,nx-l1,k,ie)
409 $ +f2*arr2(i,nx-l2,k,ie)
414 arr1(i,j,l1+1 ,ie) = f1*arr1(i,j,l1+1 ,ie)
415 $ +f2*arr2(i,j,l2+1 ,ie)
416 arr1(i,j,nx-l1,ie) = f1*arr1(i,j,nx-l1,ie)
417 $ +f2*arr2(i,j,nx-l2,ie)
431 n = mg_h1_n(l,mg_fld)
435 call cmult (e,sigma,n)
448 integer enx,eny,enz,pm
454 n = mg_h1_n(l,mg_fld)
455 pm = p_mg_msk(l,mg_fld)
457 call h1mg_mask (r,mg_imask(pm),nelfld(ifield))
469 i = enx*eny*enz*nelv+1
472 call hsmg_extrude(mg_work,0,zero,mg_work,2,one,enx,eny,enz)
474 call hsmg_extrude(mg_work,0,one ,mg_work,2,onem,enx,eny,enz)
479 call hsmg_extrude(mg_work,0,zero,mg_work(i),0,one ,enx,eny,enz)
481 call hsmg_extrude(mg_work(i),0,one ,mg_work,0,onem,enx,eny,enz)
482 call hsmg_extrude(mg_work(i),2,one,mg_work(i),0,one,enx,eny,enz)
491 call h1mg_mask (e,mg_imask(pm),nelfld(ifield))
512 call hsmg_do_wt(r,mg_mask(mg_mask_index(l,mg_fld)),
513 $ mg_nh(l),mg_nh(l),mg_nhz(l))
526 i = enx*eny*enz*nelv+1
529 call hsmg_extrude(mg_work,0,zero,mg_work,2,one,enx,eny,enz)
531 call hsmg_extrude(mg_work,0,one ,mg_work,2,onem,enx,eny,enz)
536 call hsmg_extrude(mg_work,0,zero,mg_work(i),0,one ,enx,eny,enz)
538 call hsmg_extrude(mg_work(i),0,one ,mg_work,0,onem,enx,eny,enz)
539 call hsmg_extrude(mg_work(i),2,one,mg_work(i),0,one,enx,eny,enz)
550 call hsmg_do_wt(e,mg_mask(mg_mask_index(l,mg_fld)),
551 $ mg_nh(l),mg_nh(l),mg_nhz(l))
558 real a(0:n+1,0:n+1,nelv),b(n,n,nelv)
583 real a(0:n+1,0:n+1,0:n+1,nelv),b(n,n,n,nelv)
586 call rzero(a,(n+2)*(n+2)*(n+2)*nelv)
591 a(i,j,k,ie)=b(i,j,k,ie)
602 real a(0:n+1,0:n+1,nelv),b(n,n,nelv)
618 real a(0:n+1,0:n+1,0:n+1,nelv),b(n,n,n,nelv)
625 b(i,j,k,ie)=a(i,j,k,ie)
639 i = mg_fast_s_index(mg_lmax,mg_fld-1)
640 j = mg_fast_d_index(mg_lmax,mg_fld-1)
642 mg_fast_s_index(l,mg_fld)=i
644 i=i+nl*nl*2*ldim*nelv
645 if(i .gt. lmg_fasts*2*ldim*lelv)
then
646 itmp = i/(2*ldim*lelv)
647 write(6,*)
'lmg_fasts too small',i,itmp,lmg_fasts,l
650 mg_fast_d_index(l,mg_fld)=j
652 if(j .gt. lmg_fastd*lelv)
then
653 itmp = i/(2*ldim*lelv)
654 write(6,*)
'lmg_fastd too small',i,itmp,lmg_fastd,l
658 $ mg_fast_s(mg_fast_s_index(l,mg_fld))
659 $ ,mg_fast_d(mg_fast_d_index(l,mg_fld))
660 $ ,mg_nh(l)+2,mg_ah(1,l),mg_bh(1,l),mg_nx(l))
662 mg_fast_s_index(l,mg_fld)=i
663 mg_fast_d_index(l,mg_fld)=j
673 i = mg_fast_s_index(mg_lmax,mg_fld-1)
674 j = mg_fast_d_index(mg_lmax,mg_fld-1)
676 mg_fast_s_index(l,mg_fld)=i
678 i=i+nl*nl*2*ldim*nelv
679 if(i .gt. lmg_fasts*2*ldim*lelv)
then
680 itmp = i/(2*ldim*lelv)
681 write(6,*)
'lmg_fasts too small',i,itmp,lmg_fasts,l
684 mg_fast_d_index(l,mg_fld)=j
686 if(j .gt. lmg_fastd*lelv)
then
687 itmp = i/(2*ldim*lelv)
688 write(6,*)
'lmg_fastd too small',i,itmp,lmg_fastd,l
692 $ mg_fast_s(mg_fast_s_index(l,mg_fld))
693 $ ,mg_fast_d(mg_fast_d_index(l,mg_fld))
694 $ ,mg_nh(l)+2,mg_ah(1,l),mg_bh(1,l),mg_nx(l))
696 mg_fast_s_index(l,mg_fld)=i
697 mg_fast_d_index(l,mg_fld)=j
705 real s(nl*nl,2,ldim,nelv)
706 real d(nl**ldim,nelv)
708 common /ctmpf/ lr(2*lx1+4),ls(2*lx1+4),lt(2*lx1+4)
709 $ , llr(lelt),lls(lelt),llt(lelt)
710 $ , lmr(lelt),lms(lelt),lmt(lelt)
711 $ , lrr(lelt),lrs(lelt),lrt(lelt)
718 integer ie,il,nr,ns,nt
719 integer lbr,rbr,lbs,rbs,lbt,rbt,two
725 call get_fast_bc(lbr,rbr,lbs,rbs,lbt,rbt,ie,two,ierr)
730 $ ,llr(ie),lmr(ie),lrr(ie),ah,bh,n,ie)
732 $ ,lls(ie),lms(ie),lrs(ie),ah,bh,n,ie)
734 $ ,llt(ie),lmt(ie),lrt(ie),ah,bh,n,ie)
737 eps = 1.e-5*(
vlmax(lr(2),nr-2) +
vlmax(ls(2),ns-2))
741 if (diag.gt.eps)
then
746 2
format(i6,1x,a21,3i5,1p4e12.4)
753 eps = 1.e-5 * (
vlmax(lr(2),nr-2)
758 diag = lr(i)+ls(j)+lt(k)
759 if (diag.gt.eps)
then
764 3
format(i6,1x,a21,4i5,1p5e12.4)
775 if (ierrmx.gt.0)
then
776 if (ierr.gt.0)
write(6,*) nid,ierr,
' BC FAIL'
777 call exitti(
'A INVALID BC FOUND in genfast$',ierrmx)
783 subroutine hsmg_setup_fast1d(s,lam,nl,lbc,rbc,ll,lm,lr,ah,bh,n,ie)
785 real s(nl,nl,2),lam(nl),ll,lm,lr
786 real ah(0:n,0:n),bh(0:n)
790 common /ctmp0/ b(2*lxm*lxm),w(2*lxm*lxm)
797 if(lbc.gt.0)
call row_zero(s,nl,nl,1)
798 if(lbc.eq.1)
call row_zero(s,nl,nl,2)
799 if(rbc.gt.0)
call row_zero(s,nl,nl,nl)
800 if(rbc.eq.1)
call row_zero(s,nl,nl,nl-1)
808 real a(0:n+2,0:n+2),ll,lm,lr
818 call rzero(a,(n+3)*(n+3))
824 a(i+1,j+1)=fac*ah(i,j)
829 a(0,0)=fac*ah(n-1,n-1)
830 a(1,0)=fac*ah(n ,n-1)
831 a(0,1)=fac*ah(n-1,n )
832 a(1,1)=a(1,1)+fac*ah(n ,n )
838 a(n+1,n+1)=a(n+1,n+1)+fac*ah(0,0)
839 a(n+2,n+1)=fac*ah(1,0)
840 a(n+1,n+2)=fac*ah(0,1)
841 a(n+2,n+2)=fac*ah(1,1)
850 real b(0:n+2,0:n+2),ll,lm,lr
860 call rzero(b,(n+3)*(n+3))
870 b(1,1)=b(1,1)+fac*bh(n )
876 b(n+1,n+1)=b(n+1,n+1)+fac*bh(0)
890 $ mg_fast_s(mg_fast_s_index(l,mg_fld)),
891 $ mg_fast_d(mg_fast_d_index(l,mg_fld)),
900 real e(nl**ldim,nelv)
901 real r(nl**ldim,nelv)
902 real s(nl*nl,2,ldim,nelv)
903 real d(nl**ldim,nelv)
910 $ ,s(1,2,1,ie),s(1,1,2,ie))
912 r(i,ie)=d(i,ie)*e(i,ie)
915 $ ,s(1,1,1,ie),s(1,2,2,ie))
920 $ ,s(1,2,1,ie),s(1,1,2,ie),s(1,1,3,ie))
922 r(i,ie)=d(i,ie)*e(i,ie)
925 $ ,s(1,1,1,ie),s(1,2,2,ie),s(1,2,3,ie))
936 real u(nx,ny,nz,nelv)
937 real wt(nx,nz,2,ldim,nelv)
954 u( 1,j,1,ie)=u( 1,j,1,ie)*wt(j,1,1,1,ie)
955 u(nx,j,1,ie)=u(nx,j,1,ie)*wt(j,1,2,1,ie)
958 u(i, 1,1,ie)=u(i, 1,1,ie)*wt(i,1,1,2,ie)
959 u(i,ny,1,ie)=u(i,ny,1,ie)*wt(i,1,2,2,ie)
966 u( 1,j,k,ie)=u( 1,j,k,ie)*wt(j,k,1,1,ie)
967 u(nx,j,k,ie)=u(nx,j,k,ie)*wt(j,k,2,1,ie)
972 u(i, 1,k,ie)=u(i, 1,k,ie)*wt(i,k,1,2,ie)
973 u(i,ny,k,ie)=u(i,ny,k,ie)*wt(i,k,2,2,ie)
978 u(i,j, 1,ie)=u(i,j, 1,ie)*wt(i,j,1,3,ie)
979 u(i,j,nz,ie)=u(i,j,nz,ie)*wt(i,j,2,3,ie)
991 real w(nx,ny,nz,nelv)
992 real wt(nx,nz,2,ldim,nelv)
996 call rzero(w,nx*ny*nz*nelv)
1033 if (.not. if3d)
then
1036 wt(j,1,1,1,ie)=1.0/w(1,j,1,ie)
1037 wt(j,1,2,1,ie)=1.0/w(nx,j,1,ie)
1040 wt(i,1,1,2,ie)=1.0/w(i,1,1,ie)
1041 wt(i,1,2,2,ie)=1.0/w(i,ny,1,ie)
1048 wt(j,k,1,1,ie)=1.0/w(1,j,k,ie)
1049 wt(j,k,2,1,ie)=1.0/w(nx,j,k,ie)
1054 wt(i,k,1,2,ie)=1.0/w(i,1,k,ie)
1055 wt(i,k,2,2,ie)=1.0/w(i,ny,k,ie)
1060 wt(i,j,1,3,ie)=1.0/w(i,j,1,ie)
1061 wt(i,j,2,3,ie)=1.0/w(i,j,nz,ie)
1073 real w(nx,ny,nz,nelv)
1074 real wt(nx,nz,2,ldim,nelv)
1077 integer lbr,rbr,lbs,rbs,lbt,rbt,two
1087 call get_fast_bc(lbr,rbr,lbs,rbs,lbt,rbt,ie,two,ierr)
1090 call get_fast_bc(lbr,rbr,lbs,rbs,lbt,rbt,ie,two,ierr)
1144 if (.not. if3d)
then
1147 wt(j,1,1,1,ie)=w(1,j,1,ie)
1148 wt(j,1,2,1,ie)=w(nx,j,1,ie)
1151 wt(i,1,1,2,ie)=w(i,1,1,ie)
1152 wt(i,1,2,2,ie)=w(i,ny,1,ie)
1159 wt(j,k,1,1,ie)=w(1,j,k,ie)
1160 wt(j,k,2,1,ie)=w(nx,j,k,ie)
1165 wt(i,k,1,2,ie)=w(i,1,k,ie)
1166 wt(i,k,2,2,ie)=w(i,ny,k,ie)
1171 wt(j,k,1,3,ie)=w(i,j,1,ie)
1172 wt(j,k,2,3,ie)=w(i,j,nz,ie)
1179 if (ierrmx.gt.0)
then
1180 if (ierr.gt.0)
write(6,*) nid,ierr,
' BC FAIL'
1181 call exitti(
'B INVALID BC FOUND in genfast$',ierrmx)
1195 i = mg_schwarz_wt_index(mg_lmax,mg_fld-1)
1197 mg_schwarz_wt_index(l,mg_fld)=i
1201 i=i+nl*nlz*4*ldim*nelv
1202 if(i .gt. lmg_swt*4*ldim*lelv)
then
1203 itmp = i/(4*ldim*lelv)
1204 write(6,*)
'lmg_swt too small',i,itmp,lmg_swt,l
1209 $ mg_schwarz_wt(mg_schwarz_wt_index(l,mg_fld)),l,ifsqrt)
1212 mg_schwarz_wt_index(l,mg_fld)=i
1225 i = mg_schwarz_wt_index(mg_lmax,mg_fld-1)
1228 mg_schwarz_wt_index(l,mg_fld)=i
1231 i = i+nl*nlz*4*ldim*nelv
1233 if (i .gt. lmg_swt*4*ldim*lelv)
then
1234 itmp = i/(4*ldim*lelv)
1235 write(6,*)
'lmg_swt too small',i,itmp,lmg_swt,l
1240 $ mg_schwarz_wt(mg_schwarz_wt_index(l,mg_fld)),l,ifsqrt)
1244 mg_schwarz_wt_index(l,mg_fld)=i
1255 $ e,mg_schwarz_wt(mg_schwarz_wt_index(l,mg_fld)),mg_nh(l))
1257 $ e,mg_schwarz_wt(mg_schwarz_wt_index(l,mg_fld)),mg_nh(l))
1270 e(1 ,j,ie)=e(1 ,j,ie)*wt(j,1,1,ie)
1271 e(2 ,j,ie)=e(2 ,j,ie)*wt(j,2,1,ie)
1272 e(n-1,j,ie)=e(n-1,j,ie)*wt(j,3,1,ie)
1273 e(n ,j,ie)=e(n ,j,ie)*wt(j,4,1,ie)
1276 e(i,1 ,ie)=e(i,1 ,ie)*wt(i,1,2,ie)
1277 e(i,2 ,ie)=e(i,2 ,ie)*wt(i,2,2,ie)
1278 e(i,n-1,ie)=e(i,n-1,ie)*wt(i,3,2,ie)
1279 e(i,n ,ie)=e(i,n ,ie)*wt(i,4,2,ie)
1289 real wt(n,n,4,3,nelv)
1295 e(1 ,j,k,ie)=e(1 ,j,k,ie)*wt(j,k,1,1,ie)
1296 e(2 ,j,k,ie)=e(2 ,j,k,ie)*wt(j,k,2,1,ie)
1297 e(n-1,j,k,ie)=e(n-1,j,k,ie)*wt(j,k,3,1,ie)
1298 e(n ,j,k,ie)=e(n ,j,k,ie)*wt(j,k,4,1,ie)
1303 e(i,1 ,k,ie)=e(i,1 ,k,ie)*wt(i,k,1,2,ie)
1304 e(i,2 ,k,ie)=e(i,2 ,k,ie)*wt(i,k,2,2,ie)
1305 e(i,n-1,k,ie)=e(i,n-1,k,ie)*wt(i,k,3,2,ie)
1306 e(i,n ,k,ie)=e(i,n ,k,ie)*wt(i,k,4,2,ie)
1311 e(i,j,1 ,ie)=e(i,j,1 ,ie)*wt(i,j,1,3,ie)
1312 e(i,j,2 ,ie)=e(i,j,2 ,ie)*wt(i,j,2,3,ie)
1313 e(i,j,n-1,ie)=e(i,j,n-1,ie)*wt(i,j,3,3,ie)
1314 e(i,j,n ,ie)=e(i,j,n ,ie)*wt(i,j,4,3,ie)
1338 if (icalld.eq.0)
then
1349 call fgslib_crs_solve(xxth(ifield),e,r)
1361 i = mg_solve_index(mg_lmax+1,mg_fld-1)
1363 mg_solve_index(l,mg_fld)=i
1364 i=i+mg_nh(l)*mg_nh(l)*mg_nhz(l)*nelv
1365 if(i .gt. lmg_solve*lelv)
then
1367 write(6,*)
'lmg_solve too small',i,itmp,lmg_solve,l
1371 mg_solve_index(l,mg_fld)=i
1388 common /quick/ ecrs(2)
1393 common /scrhi/ h2inv(lx1,ly1,lz1,lelv)
1394 common /scrvh/ h1(lx1,ly1,lz1,lelv),
1395 $ h2(lx1,ly1,lz1,lelv)
1399 data ilstep,iter /0,0/
1401 real rhoavg,copt(2),copw(2)
1402 save rhoavg,copt1,copt2
1403 data rhoavg,copt1,copt2 /3*1./
1406 integer*8 ntotg,nxyz2
1411 if (ifield.gt.1) mg_fld = 2
1413 if (istep.ne.ilstep)
then
1415 ntot1 = lx1*ly1*lz1*nelv
1416 rhoavg =
glsc2(vtrans,bm1,ntot1)/volvm1
1419 n = lx2*ly2*lz2*nelv
1423 if (icalld.eq.0)
then
1447 nt = mg_nh(l)*mg_nh(l)*mg_nhz(l)*nelv
1460 rbd1dt = rhoavg*bd(1)/dt
1461 call cdabdtp(mg_work2,e,h1,h2,h2inv,1)
1462 call cmult (mg_work2,rbd1dt,nt)
1464 if (istep.eq.1)
then
1465 copt(1) =
vlsc2(r ,mg_work2,nt)
1466 copt(2) =
vlsc2(mg_work2,mg_work2,nt)
1467 call gop(copt,copw,
'+ ', 2)
1468 copt(1) = copt(1)/copt(2)
1472 if(nio.eq.0)
write(6,1)istep,iter,rbd1dt,copt(1),copt1,
'cpt1'
1473 1
format(2i6,1p3e14.5,2x,a4)
1477 mg_work2(i) = r(i) - copt1*mg_work2(i)
1479 ecrs2(i) = mg_work2(i)
1490 do l = mg_lmax-1,2,-1
1495 nt = mg_nh(l)*mg_nh(l)*mg_nhz(l)*nelv
1499 call hsmg_rstr(mg_solve_r(mg_solve_index(l,mg_fld)),mg_work2,l)
1503 call copy(mg_work2,mg_solve_r(mg_solve_index(l,mg_fld)),nt)
1507 $ mg_solve_e(mg_solve_index(l,mg_fld)),mg_work2,l)
1518 mg_work2(i+1) = mg_solve_r(mg_solve_index(l,mg_fld)+i)
1524 $ mg_solve_r(mg_solve_index(1,mg_fld)),mg_work2,1)
1528 call hsmg_do_wt(mg_solve_r(mg_solve_index(1,mg_fld)),
1529 $ mg_mask(mg_mask_index(1,mg_fld)),2,2,nzw)
1535 $ mg_solve_r(mg_solve_index(1,mg_fld)))
1537 call hsmg_do_wt(mg_solve_e(mg_solve_index(1,mg_fld)),
1538 $ mg_mask(mg_mask_index(1,mg_fld)),2,2,nzw)
1541 nt = mg_nh(l)*mg_nh(l)*mg_nhz(l)*nelv
1545 $ (mg_work2,mg_solve_e(mg_solve_index(l-1,mg_fld)),l-1)
1550 mg_solve_e(mg_solve_index(l,mg_fld)+i) =
1551 $ + mg_solve_e(mg_solve_index(l,mg_fld)+i) + mg_work2(i+1)
1555 nt = mg_nh(l)*mg_nh(l)*mg_nhz(l)*nelv
1560 $ mg_solve_e(mg_solve_index(l-1,mg_fld)),l-1)
1562 if (if_hybrid.and.istep.eq.1)
then
1564 call cdabdtp(ecrs,mg_work2,h1,h2,h2inv,1)
1565 call cmult (ecrs,rbd1dt,nt)
1566 copt(1) =
vlsc2(ecrs2,ecrs,nt)
1567 copt(2) =
vlsc2(ecrs ,ecrs,nt)
1568 call gop(copt,copw,
'+ ', 2)
1569 copt(1) = copt(1)/copt(2)
1573 if(nio.eq.0)
write(6,1)istep,iter,rbd1dt,copt(1),copt2,
'cpt2'
1578 e(i) = e(i) + copt2*mg_work2(i)
1583 taaaa = taaaa + (time_1 - time_0)
1584 tbbbb = tbbbb + (time_2 - time_1)
1585 tcccc = tcccc + (time_3 - time_2)
1586 tdddd = tdddd + (time_4 - time_3)
1587 teeee = teeee + (time_4 - time_0)
1616 data mgn2 / 1, 2, 2, 2, 2, 3, 3, 5, 5, 5/
1624 if (lx1.eq.4) mg_lmax = 2
1630 if (.not.if3d) mg_nz(1) = 0
1632 mglx2 = 2*(lx2/4) + 1
1633 if (lx1.eq.5) mglx2 = 3
1635 if (lx1.le.10) mglx2 = mgn2(lx1)
1636 if (lx1.eq.8) mglx2 = 4
1637 if (lx1.eq.8) mglx2 = 3
1645 if (.not.if3d) mg_nz(2) = 0
1650 if (.not.if3d) mg_nz(3) = 0
1652 mg_nx(mg_lmax) = lx1-1
1653 mg_ny(mg_lmax) = ly1-1
1654 mg_nz(mg_lmax) = lz1-1
1656 if (nio.eq.0)
write(*,*)
'mg_nx:',(mg_nx(i),i=1,mg_lmax)
1657 if (nio.eq.0)
write(*,*)
'mg_ny:',(mg_ny(i),i=1,mg_lmax)
1658 if (nio.eq.0)
write(*,*)
'mg_nz:',(mg_nz(i),i=1,mg_lmax)
1669 call izero( mg_rstr_wt_index , n )
1670 call izero( mg_mask_index , n )
1671 call izero( mg_solve_index , n )
1672 call izero( mg_fast_s_index , n )
1673 call izero( mg_fast_d_index , n )
1674 call izero( mg_schwarz_wt_index , n )
1688 if (idum.lt.0)
return
1693 if (n.gt.7.or.nelv.gt.16)
return
1694 xmin =
glmin(x,mtot)
1695 xmax =
glmax(x,mtot)
1698 snel = sqrt(rnel)+.1
1704 if (ie.eq.ne1)
write(m,116) txt10,k,ie,xmin,xmax,ichk,time
1707 if (n.eq.2)
write(m,102) ((x(i,j,k,e+l),i=1,n),e=1,ne)
1708 if (n.eq.3)
write(m,103) ((x(i,j,k,e+l),i=1,n),e=1,ne)
1709 if (n.eq.4)
write(m,104) ((x(i,j,k,e+l),i=1,n),e=1,ne)
1710 if (n.eq.5)
write(m,105) ((x(i,j,k,e+l),i=1,n),e=1,ne)
1711 if (n.eq.6)
write(m,106) ((x(i,j,k,e+l),i=1,n),e=1,ne)
1712 if (n.eq.7)
write(m,107) ((x(i,j,k,e+l),i=1,n),e=1,ne)
1713 if (n.eq.8)
write(m,108) ((x(i,j,k,e+l),i=1,n),e=1,ne)
1719 102
FORMAT(4(2f9.5,2x))
1720 103
FORMAT(4(3f9.5,2x))
1721 104
FORMAT(4(4f7.3,2x))
1722 105
FORMAT(5f9.5,10x,5f9.5)
1723 106
FORMAT(6f9.5,5x,6f9.5)
1724 107
FORMAT(7f8.4,5x,7f8.4)
1725 108
FORMAT(8f8.4,4x,8f8.4)
1727 116
FORMAT( /,5x,
' ^ ',/,
1730 $ 5x,
' +----> ',
'Plane = ',i2,
'/',i2,2x,2e12.4,/,
1731 $ 5x,
' X ',
'Step =',i9,f15.5)
1747 if (idum.lt.0)
return
1751 if (n.gt.7.or.nelv.gt.16)
return
1752 xmin =
glmin(x,mtot)
1753 xmax =
glmax(x,mtot)
1756 snel = sqrt(rnel)+.1
1762 if (ie.eq.ne1)
write(6,116) txt10,k,ie,xmin,xmax,ichk,time
1765 if (n.eq.2)
write(6,102) ((x(i,j,k,e+l),i=1,n),e=1,ne)
1766 if (n.eq.3)
write(6,103) ((x(i,j,k,e+l),i=1,n),e=1,ne)
1767 if (n.eq.4)
write(6,104) ((x(i,j,k,e+l),i=1,n),e=1,ne)
1768 if (n.eq.5)
write(6,105) ((x(i,j,k,e+l),i=1,n),e=1,ne)
1769 if (n.eq.6)
write(6,106) ((x(i,j,k,e+l),i=1,n),e=1,ne)
1770 if (n.eq.7)
write(6,107) ((x(i,j,k,e+l),i=1,n),e=1,ne)
1771 if (n.eq.8)
write(6,108) ((x(i,j,k,e+l),i=1,n),e=1,ne)
1777 102
FORMAT(4(2f9.5,2x))
1778 103
FORMAT(4(3f9.5,2x))
1779 104
FORMAT(4(4f7.3,2x))
1780 105
FORMAT(5f9.5,10x,5f9.5)
1781 106
FORMAT(6f9.5,5x,6f9.5)
1782 107
FORMAT(7f8.4,5x,7f8.4)
1783 108
FORMAT(8f8.4,4x,8f8.4)
1785 116
FORMAT( /,5x,
' ^ ',/,
1788 $ 5x,
' +----> ',
'Plane = ',i2,
'/',i2,2x,2e12.4,/,
1789 $ 5x,
' X ',
'Step =',i9,f15.5)
1806 if (p130.le.0)
return
1808 if (p130.gt.9) m = p130 + ifield
1810 ntot = lx1*ly1*lz1*nelfld(ifield)
1812 xmin =
glmin(x,ntot)
1813 xmax =
glmax(x,ntot)
1814 xavg =
glsum(x,ntot)/ntot
1816 if (abs(xavg).lt.eps) xavg = 0.
1818 if (nid.eq.0)
write(m,10) txt10,ichk,ntot,xavg,xmin,xmax
1820 10
format(3x,a10,2i8,
' pts, avg,min,max = ',1p3g14.6)
1835 if (p130.le.0)
return
1837 if (p130.gt.9) m = p130 + ifield
1841 xmin =
glmin(x,ntot)
1842 xmax =
glmax(x,ntot)
1843 xavg =
glsum(x,ntot)/ntot
1845 if (abs(xavg).lt.eps) xavg = 0.
1847 if (nid.eq.0)
write(m,10) txt10,ichk,ntot,xavg,xmin,xmax
1849 10
format(3x,a10,2i8,
' pts, avg,min,max = ',1p3g11.3)
1871 common /scrhi/ h2inv(lx1,ly1,lz1,lelv)
1872 common /scrvh/ h1(lx1,ly1,lz1,lelv),
1873 $ h2(lx1,ly1,lz1,lelv)
1874 parameter(lt=lx1*ly1*lz1*lelt)
1875 common /scrmg/ e(2*lt),w(lt),r(lt)
1882 nel = nelfld(ifield)
1887 if (if_hybrid) sigma = 2./3.
1890 n = mg_h1_n(l,mg_fld)
1896 if (if_hybrid)
call h1mg_axm(r,z,op,om,l,w)
1899 do l = mg_h1_lmax-1,2,-1
1901 n = mg_h1_n(l,mg_fld)
1909 if(if_hybrid)
call h1mg_axm(r,e(is),op,om,l,w)
1916 p_msk = p_mg_msk(l,mg_fld)
1919 call h1mg_mask(e(is),mg_imask(p_msk),nel)
1927 do l = 2,mg_h1_lmax-1
1930 n = mg_h1_n(l,mg_fld)
1934 e(i1+i) = e(i1+i) + w(i)
1939 n = mg_h1_n(l,mg_fld)
1966 real w(1),p(1),wk(1)
1968 integer p_h1,p_h2,p_g,p_b,p_msk
1971 p_h1 = p_mg_h1(l,mg_fld)
1972 p_h2 = p_mg_h2(l,mg_fld)
1973 p_g = p_mg_g(l,mg_fld)
1974 p_b = p_mg_b(l,mg_fld)
1975 p_msk = p_mg_msk(l,mg_fld)
1977 if (p_h1 .eq.0)
call mg_set_h1 (p_h1 ,l)
1978 if (p_h2 .eq.0)
call mg_set_h2 (p_h2 ,l)
1979 if (p_g .eq.0)
call mg_set_gb (p_g,p_b,l)
1983 if (p_h2.eq.0) ifh2 = .false.
1993 $ ,mg_h1(p_h1),mg_h2(p_h2),nx,ny,nz,nelfld(ifield)
1994 $ ,mg_g(p_g) , ng ,mg_b(p_b), mg_imask(p_msk),ifh2)
1999 n = nx*ny*nz*nelfld(ifield)
2006 $ (w,p,h1,h2,nx,ny,nz,nel,g,ng,b,mask,ifh2)
2019 real w (nx*ny*nz,nel), p (nx*ny*nz,nel)
2020 $ , h1(nx*ny*nz,nel), h2(nx*ny*nz,nel)
2021 $ , b (nx*ny*nz,nel), g (ng*nx*ny*nz,nel)
2026 parameter(lxyz=lx1*ly1*lz1)
2027 common /ctmp0/ ur(lxyz),us(lxyz),ut(lxyz)
2033 call axe(w(1,e),p(1,e),h1(1,e),h2(1,e),g(1,e),ng,b(1,e)
2034 $ ,nx,ny,nz,ur,us,ut,ifh2,ifrzer(e),e)
2074 $ (w,p,h1,h2,g,ng,b,nx,ny,nz,ur,us,ut,ifh2,ifrz,e)
2080 real w (nx*ny*nz), p (nx*ny*nz)
2081 $ , h1(nx*ny*nz), h2(nx*ny*nz)
2082 $ , b (nx*ny*nz), g (ng,nx*ny*nz)
2083 $ , ur(nx*ny*nz), us(nx*ny*nz), ut(nx*ny*nz)
2097 wr = g(1,i)*ur(i) + g(4,i)*us(i) + g(5,i)*ut(i)
2098 ws = g(4,i)*ur(i) + g(2,i)*us(i) + g(6,i)*ut(i)
2099 wt = g(5,i)*ur(i) + g(6,i)*us(i) + g(3,i)*ut(i)
2104 elseif (ifaxis)
then
2105 call exitti(
'Blame Paul for no gradl_rst support yet$',nx)
2108 wr = g(1,i)*ur(i) + g(3,i)*us(i)
2109 ws = g(3,i)*ur(i) + g(2,i)*us(i)
2127 w(i)=w(i)+h2(i)*b(i)*p(i)
2140 real v(1),A(1),At(1)
2143 if (.not. if3d)
then
2153 real v(1),A(1),Bt(1)
2155 common /hsmgw/ work(lx1*lx1)
2165 call mxm(a,nv,v(iu),nu,work,nu)
2166 call mxm(work,nv,bt,nu,v(iv),nv)
2174 call mxm(a,nv,v(iu),nu,work,nu)
2175 call mxm(work,nv,bt,nu,v(iv),nv)
2184 real v(1),A(1),Bt(1),Ct(1)
2186 parameter(lwk=(lx1+2)*(ly1+2)*(lz1+2))
2187 common /hsmgw/ work(0:lwk-1),work2(0:lwk-1)
2206 call mxm(a,nv,v(iu),nu,work,nu*nu)
2208 call mxm(work(nv*nu*i),nv,bt,nu,work2(nv*nv*i),nv)
2210 call mxm(work2,nv*nv,ct,nu,v(iv),nv)
2224 call hsmg_do_wt(r,mg_rstr_wt(mg_rstr_wt_index(l+1,mg_fld))
2225 $ ,mg_nh(l+1),mg_nh(l+1),mg_nhz(l+1))
2227 call hsmg_tnsr1(r,mg_nh(l),mg_nh(l+1),mg_jht(1,l),mg_jh(1,l))
2239 common /scrhi/ h2inv(lx1,ly1,lz1,lelt)
2240 common /scrvh/ h1(lx1,ly1,lz1,lelt),
2241 $ h2(lx1,ly1,lz1,lelt)
2243 integer p_h1,p_h2,p_g,p_b,p_msk
2249 n = lx1*ly1*lz1*nelt
2285 data mgn2 / 1, 2, 2, 2, 2, 3, 3, 5, 5, 5/
2293 if (lx1.eq.4) mg_h1_lmax = 2
2295 mg_lmax = mg_h1_lmax
2300 if (.not.if3d) mg_nz(1) = 0
2302 mglx2 = 2*(lx2/4) + 1
2303 if (lx1.eq.5) mglx2 = 3
2305 if (lx1.le.10) mglx2 = mgn2(lx1)
2306 if (lx1.eq.8) mglx2 = 4
2307 if (lx1.eq.8) mglx2 = 3
2309 mglx2 = min(3,mglx2)
2314 if (.not.if3d) mg_nz(2) = 0
2319 if (.not.if3d) mg_nz(3) = 0
2321 mg_nx(mg_h1_lmax) = lx1-1
2322 mg_ny(mg_h1_lmax) = ly1-1
2323 mg_nz(mg_h1_lmax) = lz1-1
2325 if (nio.eq.0)
write(*,*)
'h1_mg_nx:',(mg_nx(i),i=1,mg_h1_lmax)
2326 if (nio.eq.0)
write(*,*)
'h1_mg_ny:',(mg_ny(i),i=1,mg_h1_lmax)
2327 if (nio.eq.0)
write(*,*)
'h1_mg_nz:',(mg_nz(i),i=1,mg_h1_lmax)
2331 mg_h1_n(l,ifld)=(mg_nx(l)+1)
2333 $ *(mg_nz(l)+1)*nelfld(ifld)
2348 call semhat(ah,bh,ch,dh,zh,dph,jph,bgl,zglhat,dgl,jgl,n,wh)
2349 call copy(mg_ah(1,l),ah,(n+1)*(n+1))
2350 call copy(mg_bh(1,l),bh,n+1)
2351 call copy(mg_dh(1,l),dh,(n+1)*(n+1))
2353 call copy(mg_zh(1,l),zh,n+1)
2356 mg_nhz(l)=mg_nz(l)+1
2366 parameter(lxyz=(lx1+2)*(ly1+2)*(lz1+2))
2367 common /c_is1/ glo_num(lxyz*lelt)
2368 common /ivrtx/ vertex((2**ldim)*lelt)
2383 call setupds(mg_gsh_handle(l,mg_fld),nx,ny,nz
2384 $ ,nelv,nelgv,vertex,glo_num)
2389 call setupds(mg_gsh_schwarz_handle(l,mg_fld),nx,ny,nz
2390 $ ,nelv,nelgv,vertex,glo_num)
2403 p_mg_msk(l,mg_fld) = 0
2404 n = mg_h1_n(l,mg_fld)
2407 do l=mg_h1_lmax,1,-1
2412 p_msk = p_mg_msk(l,mg_fld)
2415 $ (mg_imask(p_msk),nm,nx,ny,nz,nelfld(ifield),l,mg_work)
2417 if (l.gt.1) p_mg_msk(l-1,mg_fld)=p_mg_msk(l,mg_fld)+nm
2421 p_msk = p_mg_msk(l0,mg_fld)
2432 real w(nx,ny,nz,nel)
2435 integer lbr,rbr,lbs,rbs,lbt,rbt,two
2447 call get_fast_bc(lbr,rbr,lbs,rbs,lbt,rbt,e,two,ierr)
2451 if (lbr.eq.1)
call facev(w,e,4,zero,nx,ny,nz)
2452 if (rbr.eq.1)
call facev(w,e,2,zero,nx,ny,nz)
2453 if (lbs.eq.1)
call facev(w,e,1,zero,nx,ny,nz)
2454 if (rbs.eq.1)
call facev(w,e,3,zero,nx,ny,nz)
2456 if (lbt.eq.1)
call facev(w,e,5,zero,nx,ny,nz)
2457 if (rbt.eq.1)
call facev(w,e,6,zero,nx,ny,nz)
2459 ierrmx = max(ierrmx,ierr)
2483 if (w(i,1,1,e).eq.0)
then
2487 mask(ptr) = i + nxyz*(e-1)
2501 ierrmx =
iglmax(ierrmx,1)
2502 if (ierrmx.gt.0)
then
2503 if (ierr.gt.0)
write(6,*) nid,ierr,
' BC FAIL h1'
2504 call exitti(
'D INVALID BC FOUND in h1mg_setup_mask$',ierrmx)
2517 common /scrvh/ h1(lx1,ly1,lz1,lelv)
2518 $ , h2(lx1,ly1,lz1,lelv)
2519 $ , h2inv(lx1,ly1,lz1,lelv)
2524 p_mg_h1(l,mg_fld) = 0
2525 n = mg_h1_n(l,mg_fld)
2527 call copy (mg_h1,h1,n)
2533 do l=mg_h1_lmax-1,1,-1
2535 p_mg_h1(l,mg_fld) = p_mg_h1(l+1,mg_fld) + n
2536 n = mg_h1_n(l ,mg_fld)
2538 pf = p_mg_h1(l+1,mg_fld)
2539 pc = p_mg_h1(l ,mg_fld)
2545 p_h1 = p_mg_h1(l0,mg_fld)
2556 common /scrvh/ h1(lx1,ly1,lz1,lelv)
2557 $ , h2(lx1,ly1,lz1,lelv)
2558 $ , h2inv(lx1,ly1,lz1,lelv)
2563 p_mg_h2(l,mg_fld) = 0
2564 n = mg_h1_n(l,mg_fld)
2566 call copy (mg_h2,h2,n)
2572 do l=mg_h1_lmax-1,1,-1
2574 p_mg_h2(l,mg_fld) = p_mg_h2(l+1,mg_fld) + n
2575 n = mg_h1_n(l ,mg_fld)
2577 pf = p_mg_h2(l+1,mg_fld)
2578 pc = p_mg_h2(l ,mg_fld)
2584 p_h2 = p_mg_h2(l0,mg_fld)
2599 call hsmg_tnsr(uc,nc,uf,nf,mg_jhfc(1,l),mg_jhfct(1,l))
2604 subroutine mg_intp_fc_e(uc,uf,nxc,nyc,nzc,nxf,nyf,nzf,e,l,w)
2609 real uf(nxf,nyf,nzf),uc(nxc,nyc,nzc),w(1)
2617 call mxm(uf,n1,mg_jhfct(1,l),n2,w,n3)
2628 call mxm(w(lf),n1,mg_jhfct(1,l),n2,w(lc),n3)
2637 call mxm(mg_jhfc(1,l),n1,w(lf),n2,uc,n3)
2644 call mxm(uf,n1,mg_jhfct(1,l),n2,w,n3)
2649 call mxm(mg_jhfc(1,l),n1,w,n2,uc,n3)
2656 subroutine mg_intp_gfc_e(gc,gf,ng,nxc,nyc,nzc,nxf,nyf,nzf,e,l,w)
2661 real gf(ng,nxf,nyf,nzf),gc(ng,nxc,nyc,nzc),w(1)
2670 call mxm(gf,n1,mg_jhfct(1,l),n2,w,n3)
2681 call mxm(w(lf),n1,mg_jhfct(1,l),n2,w(lc),n3)
2692 call mxm(w(lf),n1,mg_jhfct(1,l),n2,gc(1,1,k,1),n3)
2701 call mxm(gf,n1,mg_jhfct(1,l),n2,w,n3)
2710 call mxm(w(lf),n1,mg_jhfct(1,l),n2,gc(1,1,k,1),n3)
2724 real b(1),g(ng,1),wt(1),wk(1)
2727 common /ctmp0/ wi(2*lx1+4)
2731 if (nx.le.2*lx1)
then
2738 call exitti(
'mg_scale_mass: wi too small$',nx)
2755 g(1,k) = wk(k)*g(1,k)
2756 g(2,k) = wk(k)*g(2,k)
2757 g(3,k) = wk(k)*g(3,k)
2758 g(4,k) = wk(k)*g(4,k)
2759 g(5,k) = wk(k)*g(5,k)
2760 g(6,k) = wk(k)*g(6,k)
2774 g(1,k) = wk(k)*g(1,k)
2775 g(2,k) = wk(k)*g(2,k)
2776 g(3,k) = wk(k)*g(3,k)
2791 common /ctmp1/ w(lx1*ly1*lz1*lelt*2)
2794 p_mg_b(l,mg_fld) = 0
2795 p_mg_g(l,mg_fld) = 0
2796 n = mg_h1_n(l,mg_fld)
2801 do l=mg_h1_lmax-1,1,-1
2803 p_mg_b(l,mg_fld) = p_mg_b(l+1,mg_fld) + n
2804 p_mg_g(l,mg_fld) = p_mg_g(l+1,mg_fld) + n*ng
2805 n = mg_h1_n(l ,mg_fld)
2809 do e=1,nelfld(ifield)
2810 do l=mg_h1_lmax,1,-1
2817 p_g = p_mg_g(l,mg_fld) + ng*nx*ny*nz*(e-1)
2818 p_b = p_mg_b(l,mg_fld) + nx*ny*nz*(e-1)
2820 if (l.eq.mg_h1_lmax)
then
2821 call gxfer_e (mg_g(p_g) ,ng,e )
2822 call copy (mg_b(p_b) ,bm1(1,1,1,e),nxyz)
2824 $ (mg_b(p_b),mg_g(p_g),mg_bh(1,l),ng,nx,ny,nz,w,.true.)
2831 $ (mg_g(p_g),mg_g(l_g),ng,nx,ny,nz,nxl,nyl,nzl,e,l,w)
2834 $ (mg_b(p_b),mg_b(l_b) ,nx,ny,nz,nxl,nyl,nzl,e,l,w)
2837 $ (mg_b(l_b),mg_g(l_g),mg_bh(1,l+1),ng,nxl,nyl,nzl,w,.false.)
2851 $ (mg_b(l_b),mg_g(l_g),mg_bh(1,1),ng,nxl,nyl,nzl,w,.false.)
2856 p_b = p_mg_b(l0,mg_fld)
2857 p_g = p_mg_g(l0,mg_fld)
2875 g(1,i) = g1m1(i,1,1,e)
2876 g(2,i) = g2m1(i,1,1,e)
2877 g(3,i) = g3m1(i,1,1,e)
2878 g(4,i) = g4m1(i,1,1,e)
2879 g(5,i) = g5m1(i,1,1,e)
2880 g(6,i) = g6m1(i,1,1,e)
2884 g(1,i) = g1m1(i,1,1,e)
2885 g(2,i) = g2m1(i,1,1,e)
2886 g(3,i) = g4m1(i,1,1,e)
2899 write(6,*) mg_h1_lmax,ii,
' ',name3,
' CHKR'
2908 common /ctmp0/ w(100000)
2916 sum = sum + a(i,ii,1)
2919 write(6,1) name6,i,k,e,nx,ny,ng,sum
2920 1
format(a6,6i5,f12.5,
' outgmat')
2942 write(6,1) ie,name6,m,n,sum,sua
2943 1
format(i8,
' matrix: ',a6,2i5,1p2e12.4)
2947 write(6,6) ie,name6,(a(i,j),i=1,n12)
2949 6
format(i3,1x,a6,12f9.5)
2974 wt(j,1,1,ie)=1.0/work(1,j)
2975 wt(j,2,1,ie)=1.0/work(2,j)
2976 wt(j,3,1,ie)=1.0/work(n-1,j)
2977 wt(j,4,1,ie)=1.0/work(n,j)
2980 wt(i,1,2,ie)=1.0/work(i,1)
2981 wt(i,2,2,ie)=1.0/work(i,2)
2982 wt(i,3,2,ie)=1.0/work(i,n-1)
2983 wt(i,4,2,ie)=1.0/work(i,n)
2989 wt(i,j,ii,ie)=sqrt(wt(i,j,ii,ie))
3002 real wt(n,n,4,3,nelv)
3006 integer lbr,rbr,lbs,rbs,lbt,rbt
3011 wt(j,k,1,1,ie)=1.0/work(1,j,k)
3012 wt(j,k,2,1,ie)=1.0/work(2,j,k)
3013 wt(j,k,3,1,ie)=1.0/work(n-1,j,k)
3014 wt(j,k,4,1,ie)=1.0/work(n,j,k)
3019 wt(i,k,1,2,ie)=1.0/work(i,1,k)
3020 wt(i,k,2,2,ie)=1.0/work(i,2,k)
3021 wt(i,k,3,2,ie)=1.0/work(i,n-1,k)
3022 wt(i,k,4,2,ie)=1.0/work(i,n,k)
3027 wt(i,j,1,3,ie)=1.0/work(i,j,1)
3028 wt(i,j,2,3,ie)=1.0/work(i,j,2)
3029 wt(i,j,3,3,ie)=1.0/work(i,j,n-1)
3030 wt(i,j,4,3,ie)=1.0/work(i,j,n)
3038 wt(i,j,k,ii,ie)=sqrt(wt(i,j,k,ii,ie))
3057 integer enx,eny,enz,pm
3063 n = mg_h1_n(l,mg_fld)
3064 pm = p_mg_msk(l,mg_fld)
3070 ns = enx*eny*enz*nelfld(ifield)
3073 call rone(mg_work(i),ns)
3076 call hsmg_extrude(mg_work,0,zero,mg_work(i),0,one ,enx,eny,enz)
3078 call hsmg_extrude(mg_work(i),0,one ,mg_work,0,onem,enx,eny,enz)
3079 call hsmg_extrude(mg_work(i),2,one,mg_work(i),0,one,enx,eny,enz)
3096 do ie=1,nelfld(ifield)
subroutine gop(x, w, op, n)
subroutine exitti(stringi, idata)
real *8 function dnekclock()
subroutine facev(a, ie, iface, val, nx, ny, nz)
subroutine setupds(gs_handle, nx, ny, nz, nel, melg, vertex, glo_num)
subroutine row_zero(a, m, n, e)
subroutine semhat(a, b, c, d, z, dgll, jgll, bgl, zgl, dgl, jgl, n, w)
subroutine get_fast_bc(lbr, rbr, lbs, rbs, lbt, rbt, e, bsym, ierr)
subroutine fd_weights_full(xx, x, n, m, c)
subroutine local_solves_fdm(u, v)
subroutine generalev(a, b, lam, n, w)
subroutine outfldan(x, n, txt10, ichk)
subroutine h1mg_setup_schwarz_wt3d_2(wt, ie, n, work, ifsqrt)
subroutine hsmg_tnsr2d(v, nv, u, nu, A, Bt)
subroutine hsmg_rstr_no_dssum(uc, uf, l)
subroutine h1mg_setup_fdm()
subroutine mg_set_gb(p_g, p_b, l0)
subroutine h1mg_setup_wtmask
subroutine hsmg_extrude(arr1, l1, f1, arr2, l2, f2, nx, ny, nz)
subroutine hsmg_rstr(uc, uf, l)
subroutine hsmg_schwarz_toreg3d(b, a, n)
subroutine mg_set_msk(p_msk, l0)
subroutine outmatz(a, m, n, name6, ie)
subroutine hsmg_tnsr(v, nv, u, nu, A, At)
subroutine h1mg_setup_mg_nx()
subroutine hsmg_tnsr3d_el(v, nv, u, nu, A, Bt, Ct)
subroutine hsmg_intp(uf, uc, l)
subroutine h1mg_setup_schwarz_wt(ifsqrt)
subroutine mg_intp_gfc_e(gc, gf, ng, nxc, nyc, nzc, nxf, nyf, nzf, e, l, w)
subroutine h1mg_setup_schwarz_wt_1(wt, l, ifsqrt)
subroutine hsmg_tnsr3d(v, nv, u, nu, A, Bt, Ct)
subroutine h1mg_schwarz_part1(e, r, l)
subroutine hsmg_schwarz_wt3d(e, wt, n)
subroutine hsmg_setup_rstr_wt(wt, nx, ny, nz, l, w)
subroutine gxfer_e(g, ng, e)
subroutine mg_mask_e(w, mask)
subroutine mg_scale_mass(b, g, wt, ng, nx, ny, nz, wk, ifinv)
subroutine hsmg_tnsr1_2d(v, nv, nu, A, Bt)
subroutine hsmg_fdm(e, r, l)
subroutine hsmg_dssum(u, l)
subroutine hsmg_schwarz_toreg2d(b, a, n)
subroutine hsmg_setup_fast1d(s, lam, nl, lbc, rbc, ll, lm, lr, ah, bh, n, ie)
subroutine hsmg_tnsr1_3d(v, nv, nu, A, Bt, Ct)
subroutine hsmg_schwarz_dssum(u, l)
subroutine h1mg_rstr(r, l, ifdssum)
subroutine outgmat(a, ng, nx, ny, name6, k, e)
subroutine hsmg_schwarz(e, r, l)
subroutine h1mg_axm(w, p, aw, ap, l, wk)
subroutine mg_set_h1(p_h1, l0)
subroutine hsmg_setup_fast1d_a(a, lbc, rbc, ll, lm, lr, ah, n)
subroutine chkr(name3, ii)
subroutine mg_intp_fc_e(uc, uf, nxc, nyc, nzc, nxf, nyf, nzf, e, l, w)
subroutine outfldn0(x, n, txt10, ichk)
subroutine hsmg_setup_solve
subroutine outfldn(x, n, txt10, ichk)
subroutine h1mg_solve(z, rhs, if_hybrid)
subroutine hsmg_setup_mask(wt, nx, ny, nz, l, w)
subroutine h1mg_setup_mask(mask, nm, nx, ny, nz, nel, l, w)
subroutine axe(w, p, h1, h2, g, ng, b, nx, ny, nz, ur, us, ut, ifh2, ifrz, e)
subroutine hsmg_intp_fc(uc, uf, l)
subroutine h1mg_mask(w, mask, nel)
subroutine hsmg_setup_fdm()
subroutine hsmg_schwarz_wt(e, l)
subroutine hsmg_tnsr2d_el(v, nv, u, nu, A, Bt)
subroutine outflda(x, n, txt10, ichk)
subroutine hsmg_do_wt(u, wt, nx, ny, nz)
subroutine mg_set_h2(p_h2, l0)
subroutine hsmg_setup_semhat
subroutine h1mg_setup_schwarz_wt2d_2(wt, ie, n, work, ifsqrt)
subroutine h1mg_axml(w, p, h1, h2, nx, ny, nz, nel, g, ng, b, mask, ifh2)
subroutine hsmg_setup_intp
subroutine h1mg_schwarz(e, r, sigma, l)
subroutine hsmg_solve(e, r)
subroutine hsmg_setup_wtmask
subroutine hsmg_coarse_solve(e, r)
subroutine hsmg_setup_mg_nx()
subroutine hsmg_tnsr1(v, nv, nu, A, At)
subroutine hsmg_schwarz_wt2d(e, wt, n)
subroutine hsmg_setup_intpm(jh, zf, zc, nf, nc)
subroutine hsmg_setup_schwarz_wt(ifsqrt)
subroutine hsmg_do_fast(e, r, s, d, nl)
subroutine hsmg_setup_fast1d_b(b, lbc, rbc, ll, lm, lr, bh, n)
subroutine hsmg_setup_fast(s, d, nl, ah, bh, n)
subroutine hsmg_schwarz_toext2d(a, b, n)
subroutine h1mg_setup_semhat
subroutine hsmg_setup_dssum
subroutine h1mg_setup_schwarz_wt_2(wt, ie, n, work, ifsqrt)
subroutine hsmg_dsprod(u, l)
subroutine h1mg_setup_dssum
subroutine hsmg_schwarz_toext3d(a, b, n)
subroutine geom_reset(icall)
subroutine invers2(a, b, n)
subroutine transpose(a, lda, b, ldb)
real function vlmax(vec, n)
subroutine add2sxy(x, a, y, b, n)
real function vlsc2(x, y, n)
subroutine cmult(a, const, n)
subroutine mxm(a, n1, b, n2, c, n3)
subroutine gradl_rst(ur, us, ut, u, md, if3d)
subroutine gradl_rst_t(u, ur, us, ut, md, if3d)
subroutine cdabdtp(ap, wp, h1, h2, h2inv, intype)
subroutine avg1(avg, f, alpha, beta, n, name, ifverbose)
subroutine avg2(avg, f, alpha, beta, n, name, ifverbose)