1 subroutine setupds(gs_handle,nx,ny,nz,nel,melg,vertex,glo_num)
9 integer*8 glo_num(1),ngv
11 common /nekmpi/ mid,mp,nekcomm,nekgroup,nekreal
16 call set_vert(glo_num,ngv,nx,nel,vertex,.false.)
20 call fgslib_gs_setup(gs_handle,glo_num,ntot,nekcomm,mp)
26 write(6,1) t1,gs_handle,nx,ngv,melg
27 1
format(
' setupds time',1pe11.4,
' seconds ',2i3,2i12)
42 parameter(lface=lx1*ly1)
43 common /nonctmp/ uin(lface,2*ldim),uout(lface)
47 if (ifldt.eq.ifldmhd) ifldt = 1
76 if (gsh_fld(ifldt).ge.0)
then
77 if (nio.eq.0.and.loglevel.gt.5)
78 $
write(6,*)
'dssum', ifldt
79 call fgslib_gs_op(gsh_fld(ifldt),u,1,1,0)
93 tdsmx=max(timee,tdsmx)
94 tdsmn=min(timee,tdsmn)
133 if (ifldt.eq.ifldmhd) ifldt = 1
140 if (op.eq.
'+ ')
call fgslib_gs_op(gsh_fld(ifldt),u,1,1,0)
141 if (op.eq.
'sum')
call fgslib_gs_op(gsh_fld(ifldt),u,1,1,0)
142 if (op.eq.
'SUM')
call fgslib_gs_op(gsh_fld(ifldt),u,1,1,0)
144 if (op.eq.
'* ')
call fgslib_gs_op(gsh_fld(ifldt),u,1,2,0)
145 if (op.eq.
'mul')
call fgslib_gs_op(gsh_fld(ifldt),u,1,2,0)
146 if (op.eq.
'MUL')
call fgslib_gs_op(gsh_fld(ifldt),u,1,2,0)
148 if (op.eq.
'm ')
call fgslib_gs_op(gsh_fld(ifldt),u,1,3,0)
149 if (op.eq.
'min')
call fgslib_gs_op(gsh_fld(ifldt),u,1,3,0)
150 if (op.eq.
'mna')
call fgslib_gs_op(gsh_fld(ifldt),u,1,3,0)
151 if (op.eq.
'MIN')
call fgslib_gs_op(gsh_fld(ifldt),u,1,3,0)
152 if (op.eq.
'MNA')
call fgslib_gs_op(gsh_fld(ifldt),u,1,3,0)
154 if (op.eq.
'M ')
call fgslib_gs_op(gsh_fld(ifldt),u,1,4,0)
155 if (op.eq.
'max')
call fgslib_gs_op(gsh_fld(ifldt),u,1,4,0)
156 if (op.eq.
'mxa')
call fgslib_gs_op(gsh_fld(ifldt),u,1,4,0)
157 if (op.eq.
'MAX')
call fgslib_gs_op(gsh_fld(ifldt),u,1,4,0)
158 if (op.eq.
'MXA')
call fgslib_gs_op(gsh_fld(ifldt),u,1,4,0)
182 if (icalld.eq.0) tvdss=0.0d0
183 if (icalld.eq.0) tgsum=0.0d0
196 if (ifldt.eq.ifldmhd) ifldt = 1
198 call fgslib_gs_op_many(gsh_fld(ifldt),u,v,w,u,u,u,ldim,1,1,0)
203 tdsmx=max(timee,tdsmx)
204 tdsmn=min(timee,tdsmn)
234 if (ifldt.eq.ifldmhd) ifldt = 1
239 if (op.eq.
'+ ' .or. op.eq.
'sum' .or. op.eq.
'SUM')
240 $
call fgslib_gs_op_many(gsh_fld(ifldt),u,v,w,u,u,u,ldim,1,1,0)
243 if (op.eq.
'* ' .or. op.eq.
'mul' .or. op.eq.
'MUL')
244 $
call fgslib_gs_op_many(gsh_fld(ifldt),u,v,w,u,u,u,ldim,1,2,0)
247 if (op.eq.
'm ' .or. op.eq.
'min' .or. op.eq.
'mna'
248 $ .or. op.eq.
'MIN' .or. op.eq.
'MNA')
249 $
call fgslib_gs_op_many(gsh_fld(ifldt),u,v,w,u,u,u,ldim,1,3,0)
252 if (op.eq.
'M ' .or. op.eq.
'max' .or. op.eq.
'mxa'
253 $ .or. op.eq.
'MAX' .or. op.eq.
'MXA')
254 $
call fgslib_gs_op_many(gsh_fld(ifldt),u,v,w,u,u,u,ldim,1,4,0)
268 integer n,stride,gs_handle
277 call fgslib_gs_op_fields(gs_handle,u,stride,n,1,1,0)
282 tdsmx=max(timee,tdsmx)
283 tdsmn=min(timee,tdsmn)
290 subroutine matvec3(uout,Jmat,uin,iftrsp,n1,n2)
299 common /matvtmp/ utmp(lx1,ly1)
302 call mxm (jmat(1,1,1),n1,uin,n1,uout,n2)
307 call copy (uout,uin,n1*n2)
309 call mxm (jmat(1,1,1),n1,uout,n1,utmp,n2)
310 call mxm (utmp,n2,jmat(1,1,2),n1,uout,n1)
325 common /matvtmp/ utmp(lx1*ly1)
328 call mxm (jmat(1,1,2),n1,utmp,n1,uout,n2)
329 call mxm (uout,n2,jmat(1,1,1),n1,utmp,n1)
331 call copy (uout,utmp,n1*n2)
340 dimension d(n1,n2),out(1),vec(1)
347 call mxm(vec,1,d,n1,out,n2)
369 dimension b(nx,ny,nz,1)
370 CALL facind (kx1,kx2,ky1,ky2,kz1,kz2,nx,ny,nz,iface)
376 b(ix,iy,iz,ie) = b(ix,iy,iz,ie) + a(k,1)
386 dimension b(nx,ny,nz,1)
387 CALL facind (kx1,kx2,ky1,ky2,kz1,kz2,nx,ny,nz,iface)
403 dimension b(nx,ny,nz,1)
404 CALL facind (kx1,kx2,ky1,ky2,kz1,kz2,nx,ny,nz,iface)
410 a(k,1)=b(ix,iy,iz,ie)
423 CALL facind (kx1,kx2,ky1,ky2,kz1,kz2,nx,ny,nz,iface)
429 a(k,1)=b(ix,iy,iz,ie)
441 CALL facind (kx1,kx2,ky1,ky2,kz1,kz2,nx,ny,nz,iface)
447 b(ix,iy,iz,ie) = a(k,1)
458 integer B(NX,NY,NZ,1)
459 CALL facind (kx1,kx2,ky1,ky2,kz1,kz2,nx,ny,nz,iface)
465 a(k,1)=b(ix,iy,iz,ie)
476 integer B(NX,NY,NZ,1)
477 CALL facind (kx1,kx2,ky1,ky2,kz1,kz2,nx,ny,nz,iface)
483 b(ix,iy,iz,ie) = a(k,1)
497 parameter(lface=lx1*ly1)
498 common /nonctmp/ uin(lface,2*ldim),uout(lface)
508 do iface = 1 , 2*ldim
509 im = mortar(iface,ie)
511 call ftovec_0(uin(1,iface),u,ie,iface,nx,ny,nz)
515 im = mortar(iface,ie)
519 $ (uout,jmat(1,1,1,im),uin(1,iface),ifjt(im),nx,nx)
521 call matvect (uout,jmat(1,1,1,im),uin(1,iface),nx,nx)
540 parameter(lface=lx1*ly1)
541 common /nonctmp/ uin(lface,2*ldim),uout(lface)
547 do iface = 1 , 2*ldim
548 im = mortar(iface,ie)
550 call ftovec(uin(1,iface),u,ie,iface,nx,ny,nz)
554 im = mortar(iface,ie)
557 $ (uout,jmat(1,1,1,im),uin(1,iface),ifjt(im),nx,nz)
558 call vectof (u,uout,ie,iface,nx,ny,nz)
575 parameter(lface=lx1*ly1)
576 common /nonctmp/ uin(lface,2*ldim),uout(lface)
581 if (icalld.eq.0)
then
592 if (ifield.ge.2) nel=nelt
604 call col2 (u,umult,ntot)
609 call fgslib_gs_op(gsh_fld(ifldt),u,1,1,0)
621 tdsmx=max(timee,tdsmx)
622 tdsmn=min(timee,tdsmn)
637 parameter(lface=lx1*ly1)
638 common /nonctmp/ uin(lface,2*ldim),uout(lface)
643 if (icalld.eq.0)
then
654 if (ifield.ge.2) nel=nelt
673 call fgslib_gs_op(gsh_fld(ifldt),u,1,1,0)
674 call col2 (u,mask,ntot)
686 tdsmx=max(timee,tdsmx)
687 tdsmn=min(timee,tdsmn)
700 real u(1),mask(1),binv(1)
702 parameter(lface=lx1*ly1)
703 common /nonctmp/ uin(lface,2*ldim),uout(lface)
708 if (icalld.eq.0)
then
720 if (ifield.ge.2) nel=nelt
740 call fgslib_gs_op(gsh_fld(ifldt),u,1,1,0)
741 call col3 (u,mask,binv,ntot)
753 tdsmx=max(timee,tdsmx)
754 tdsmn=min(timee,tdsmn)
771 if (op.eq.
'+ ' .or. op.eq.
'sum' .or. op.eq.
'SUM')
then
772 call fgslib_gs_op(hndl,u,1,1,0)
773 elseif (op.eq.
'* ' .or. op.eq.
'mul' .or. op.eq.
'MUL')
then
774 call fgslib_gs_op(hndl,u,1,2,0)
775 elseif (op.eq.
'm ' .or. op.eq.
'min' .or. op.eq.
'mna'
776 & .or. op.eq.
'MIN' .or. op.eq.
'MNA')
then
777 call fgslib_gs_op(hndl,u,1,3,0)
778 elseif (op.eq.
'M ' .or. op.eq.
'max' .or. op.eq.
'mxa'
779 & .or. op.eq.
'MAX' .or. op.eq.
'MXA')
then
780 call fgslib_gs_op(hndl,u,1,4,0)
782 call exitti(
'gtpp_gs_op: invalid operation!$',1)
793 integer hndl,nelgx,nelgy,nelgz,idir
795 common /nekmpi/ mid,mp,nekcomm,nekgroup,nekreal
796 common /c_is1/ glo_num(lx1,ly1,lz1,lelv)
797 integer e,ex,ey,ez,eg
798 integer*8 glo_num,ex_g
800 nelgxyz = nelgx*nelgy*nelgz
801 if (nelgxyz .ne. nelgv)
802 $
call exitti(
'gtpp_gs_setup: invalid gtp mesh dimensions!$',
814 call get_exyz(ex,ey,ez,eg,nelgx,nelgyz,1)
819 glo_num(i,j,k,e) = j+ny1*(k-1) + ny1*nz1*(ex_g-1)
824 elseif (idir.eq.2)
then
828 call get_exyz(ex,ey,ez,eg,nelgx,nelgy,nelgz)
829 ex_g = (ez-1)*nelgx+ex
833 glo_num(i,j,k,e) = k+nz1*(i-1) + nx1*nz1*(ex_g-1)
838 elseif (idir.eq.3)
then
842 call get_exyz(ex,ey,ez,eg,nelgxy,1,1)
847 glo_num(i,j,k,e) = i+nx1*(j-1) + nx1*ny1*(ex_g-1)
855 call fgslib_gs_setup(hndl,glo_num,n,nekcomm,np)
869 common /c_is1/ glo_num(lx1*ly1*lz1*lelt)
877 ii = i + nx*(j-1) + nx*ny*(k-1) + nx*ny*nz*(e-1)
878 glo_num(ii) = i + nx*(j-1) + nx*ny*(k-1) +
886 call fgslib_gs_setup(hndl,glo_num,n,iglobalcomm,np_global)
906 if (op.eq.
'+ ' .or. op.eq.
'sum' .or. op.eq.
'SUM')
then
907 call fgslib_gs_op(hndl,u,1,1,0)
908 else if (op.eq.
'* ' .or. op.eq.
'mul' .or. op.eq.
'MUL')
then
909 call fgslib_gs_op(hndl,u,1,2,0)
910 else if (op.eq.
'm ' .or. op.eq.
'min' .or. op.eq.
'mna'
911 & .or. op.eq.
'MIN' .or. op.eq.
'MNA')
then
912 call fgslib_gs_op(hndl,u,1,3,0)
913 else if (op.eq.
'M ' .or. op.eq.
'max' .or. op.eq.
'mxa'
914 & .or. op.eq.
'MAX' .or. op.eq.
'MXA')
then
915 call fgslib_gs_op(hndl,u,1,4,0)
917 call exitti(
'gs_op_ms: invalid operation!$',1)
subroutine exitti(stringi, idata)
real *8 function dnekclock()
subroutine facind(kx1, kx2, ky1, ky2, kz1, kz2, nx, ny, nz, iface)
subroutine vec_dssum(u, v, w, nx, ny, nz)
subroutine ftovec(a, b, ie, iface, nx, ny, nz)
subroutine gs_op_ms(u, op, hndl)
subroutine dssum_msk2(u, mask, binv, nx, ny, nz)
subroutine apply_j(u, nx, ny, nz, nel)
subroutine ftoveci(a, b, ie, iface, nx, ny, nz)
subroutine matvec3t(uout, Jmat, uin, iftrsp, n1, n2)
subroutine nvec_dssum(u, stride, n, gs_handle)
subroutine vectof_add(b, a, ie, iface, nx, ny, nz)
subroutine matvec3(uout, Jmat, uin, iftrsp, n1, n2)
subroutine gtpp_gs_op(u, op, hndl)
subroutine zero_f(b, ie, iface, nx, ny, nz)
subroutine ftovec_0(a, b, ie, iface, nx, ny, nz)
subroutine gtpp_gs_setup(hndl, nelgx, nelgy, nelgz, idir)
subroutine apply_jt(u, nx, ny, nz, nel)
subroutine h1_proj(u, nx, ny, nz)
subroutine dssum_msk(u, mask, nx, ny, nz)
subroutine gs_setup_ms(hndl, nel, nx, ny, nz)
subroutine vectof(b, a, ie, iface, nx, ny, nz)
subroutine dsop(u, op, nx, ny, nz)
subroutine setupds(gs_handle, nx, ny, nz, nel, melg, vertex, glo_num)
subroutine vec_dsop(u, v, w, nx, ny, nz, op)
subroutine dssum(u, nx, ny, nz)
subroutine matvect(out, d, vec, n1, n2)
subroutine vectofi(b, a, ie, iface, nx, ny, nz)
subroutine col3(a, b, c, n)
subroutine transpose(a, lda, b, ldb)
subroutine mxm(a, n1, b, n2, c, n3)
subroutine get_exyz(ex, ey, ez, eg, nelx, nely, nelz)
subroutine set_vert(glo_num, ngv, nx, nel, vertex, ifcenter)