152d6035fSJeremy L Thompson!----------------------------------------------------------------------- 252d6035fSJeremy L Thompson! 352d6035fSJeremy L Thompson! Header with common subroutine 452d6035fSJeremy L Thompson! 552bfb9bbSJeremy L Thompson include 't320-basis-f.h' 652d6035fSJeremy L Thompson!----------------------------------------------------------------------- 752d6035fSJeremy L Thompson subroutine setup(ctx,q,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,& 852d6035fSJeremy L Thompson& u15,u16,v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15,v16,ierr) 952d6035fSJeremy L Thompson real*8 ctx 1052d6035fSJeremy L Thompson real*8 u1(1) 1152d6035fSJeremy L Thompson real*8 u2(1) 1252d6035fSJeremy L Thompson real*8 v1(1) 1352d6035fSJeremy L Thompson integer q,ierr 1452d6035fSJeremy L Thompson 1552d6035fSJeremy L Thompson do i=1,q 1652d6035fSJeremy L Thompson v1(i)=u1(i)*(u2(i+q*0)*u2(i+q*3)-u2(i+q*1)*u2(i+q*2)) 1752d6035fSJeremy L Thompson enddo 1852d6035fSJeremy L Thompson 1952d6035fSJeremy L Thompson ierr=0 2052d6035fSJeremy L Thompson end 2152d6035fSJeremy L Thompson!----------------------------------------------------------------------- 2252d6035fSJeremy L Thompson subroutine mass(ctx,q,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,& 2352d6035fSJeremy L Thompson& u15,u16,v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15,v16,ierr) 2452d6035fSJeremy L Thompson real*8 ctx 2552d6035fSJeremy L Thompson real*8 u1(1) 2652d6035fSJeremy L Thompson real*8 u2(1) 2752d6035fSJeremy L Thompson real*8 v1(1) 2852d6035fSJeremy L Thompson integer q,ierr 2952d6035fSJeremy L Thompson 3052d6035fSJeremy L Thompson do i=1,q 3152d6035fSJeremy L Thompson v1(i)=u2(i)*u1(i) 3252d6035fSJeremy L Thompson enddo 3352d6035fSJeremy L Thompson 3452d6035fSJeremy L Thompson ierr=0 3552d6035fSJeremy L Thompson end 3652d6035fSJeremy L Thompson!----------------------------------------------------------------------- 3752d6035fSJeremy L Thompson program test 3852d6035fSJeremy L Thompson 3952d6035fSJeremy L Thompson include 'ceedf.h' 4052d6035fSJeremy L Thompson 4152d6035fSJeremy L Thompson integer ceed,err,i,j,k 4261dbc9d2Sjeremylt integer imode 4361dbc9d2Sjeremylt parameter(imode=ceed_noninterlaced) 44*15910d16Sjeremylt integer stridesutet(3),stridesuhex(3) 45*15910d16Sjeremylt integer erestrictxtet,erestrictutet,erestrictuitet,& 46*15910d16Sjeremylt& erestrictxhex,erestrictuhex,erestrictuihex 4752d6035fSJeremy L Thompson integer bxtet,butet,bxhex,buhex 4852d6035fSJeremy L Thompson integer qf_setuptet,qf_masstet,qf_setuphex,qf_masshex 4952d6035fSJeremy L Thompson integer op_setuptet,op_masstet,op_setuphex,op_masshex,op_setup,op_mass 5052d6035fSJeremy L Thompson integer qdatatet,qdatahex,x,u,v 5152d6035fSJeremy L Thompson integer nelemtet,nelemhex,ptet,phex,qtet,qhex,d 5252d6035fSJeremy L Thompson integer row,col,offset 5352d6035fSJeremy L Thompson parameter(nelemtet=6) 5452d6035fSJeremy L Thompson parameter(ptet=6) 5552d6035fSJeremy L Thompson parameter(qtet=4) 5652d6035fSJeremy L Thompson parameter(nelemhex=6) 5752d6035fSJeremy L Thompson parameter(phex=3) 5852d6035fSJeremy L Thompson parameter(qhex=4) 5952d6035fSJeremy L Thompson parameter(d=2) 6052d6035fSJeremy L Thompson integer ndofs,nqptstet,nqptshex,nqpts,nx,ny,nxtet,nytet,nxhex 6152d6035fSJeremy L Thompson parameter(nx=3) 6252d6035fSJeremy L Thompson parameter(ny=3) 6352d6035fSJeremy L Thompson parameter(nxtet=3) 6452d6035fSJeremy L Thompson parameter(nytet=1) 6552d6035fSJeremy L Thompson parameter(nxhex=3) 6652d6035fSJeremy L Thompson parameter(ndofs=(nx*2+1)*(ny*2+1)) 6752d6035fSJeremy L Thompson parameter(nqptstet=nelemtet*qtet) 6852d6035fSJeremy L Thompson parameter(nqptshex=nelemhex*qhex*qhex) 6952d6035fSJeremy L Thompson parameter(nqpts=nqptstet+nqptshex) 7052d6035fSJeremy L Thompson integer indxtet(nelemtet*ptet),indxhex(nelemhex*phex*phex) 7152d6035fSJeremy L Thompson real*8 arrx(d*ndofs) 72c8b9fe72Sjeremylt integer*8 voffset,xoffset 7352d6035fSJeremy L Thompson 7452d6035fSJeremy L Thompson real*8 qref(d*qtet) 7552d6035fSJeremy L Thompson real*8 qweight(qtet) 7652d6035fSJeremy L Thompson real*8 interp(ptet*qtet) 7752d6035fSJeremy L Thompson real*8 grad(d*ptet*qtet) 7852d6035fSJeremy L Thompson 7952d6035fSJeremy L Thompson real*8 hv(ndofs) 8052d6035fSJeremy L Thompson 8152d6035fSJeremy L Thompson character arg*32 8252d6035fSJeremy L Thompson 8352d6035fSJeremy L Thompson external setup,mass 8452d6035fSJeremy L Thompson 8552d6035fSJeremy L Thompson call getarg(1,arg) 8652d6035fSJeremy L Thompson 8752d6035fSJeremy L Thompson call ceedinit(trim(arg)//char(0),ceed,err) 8852d6035fSJeremy L Thompson 8952d6035fSJeremy L Thompson! DoF Coordinates 9052d6035fSJeremy L Thompson do i=0,ny*2 9152d6035fSJeremy L Thompson do j=0,nx*2 9252d6035fSJeremy L Thompson arrx(i+j*(ny*2+1)+0*ndofs+1)=1.d0*i/(2*ny) 9352d6035fSJeremy L Thompson arrx(i+j*(ny*2+1)+1*ndofs+1)=1.d0*j/(2*nx) 9452d6035fSJeremy L Thompson enddo 9552d6035fSJeremy L Thompson enddo 9652d6035fSJeremy L Thompson 9752d6035fSJeremy L Thompson call ceedvectorcreate(ceed,d*ndofs,x,err) 98c8b9fe72Sjeremylt xoffset=0 99c8b9fe72Sjeremylt call ceedvectorsetarray(x,ceed_mem_host,ceed_use_pointer,arrx,xoffset,err) 10052d6035fSJeremy L Thompson 10152d6035fSJeremy L Thompson! Qdata Vectors 10252d6035fSJeremy L Thompson call ceedvectorcreate(ceed,nqptstet,qdatatet,err) 10352d6035fSJeremy L Thompson call ceedvectorcreate(ceed,nqptshex,qdatahex,err) 10452d6035fSJeremy L Thompson 10552d6035fSJeremy L Thompson! Tet Elements 10652d6035fSJeremy L Thompson do i=0,2 10752d6035fSJeremy L Thompson col=mod(i,nx) 10852d6035fSJeremy L Thompson row=i/nx 10952d6035fSJeremy L Thompson offset=col*2+row*(nx*2+1)*2 11052d6035fSJeremy L Thompson 11152d6035fSJeremy L Thompson indxtet(i*2*ptet+1)=2+offset 11252d6035fSJeremy L Thompson indxtet(i*2*ptet+2)=9+offset 11352d6035fSJeremy L Thompson indxtet(i*2*ptet+3)=16+offset 11452d6035fSJeremy L Thompson indxtet(i*2*ptet+4)=1+offset 11552d6035fSJeremy L Thompson indxtet(i*2*ptet+5)=8+offset 11652d6035fSJeremy L Thompson indxtet(i*2*ptet+6)=0+offset 11752d6035fSJeremy L Thompson 11852d6035fSJeremy L Thompson indxtet(i*2*ptet+7)=14+offset 11952d6035fSJeremy L Thompson indxtet(i*2*ptet+8)=7+offset 12052d6035fSJeremy L Thompson indxtet(i*2*ptet+9)=0+offset 12152d6035fSJeremy L Thompson indxtet(i*2*ptet+10)=15+offset 12252d6035fSJeremy L Thompson indxtet(i*2*ptet+11)=8+offset 12352d6035fSJeremy L Thompson indxtet(i*2*ptet+12)=16+offset 12452d6035fSJeremy L Thompson enddo 12552d6035fSJeremy L Thompson 12652d6035fSJeremy L Thompson! -- Restrictions 12761dbc9d2Sjeremylt call ceedelemrestrictioncreate(ceed,imode,nelemtet,ptet,ndofs,d,& 128a8d32208Sjeremylt & ceed_mem_host,ceed_use_pointer,indxtet,erestrictxtet,err) 12961dbc9d2Sjeremylt call ceedelemrestrictioncreate(ceed,imode,nelemtet,ptet,ndofs,1,& 130a8d32208Sjeremylt & ceed_mem_host,ceed_use_pointer,indxtet,erestrictutet,err) 1317509a596Sjeremylt stridesutet=[1,qtet,qtet] 1327509a596Sjeremylt call ceedelemrestrictioncreatestrided(ceed,nelemtet,qtet,nqptstet,& 1337509a596Sjeremylt & 1,stridesutet,erestrictuitet,err) 13452d6035fSJeremy L Thompson 13552d6035fSJeremy L Thompson! -- Bases 13652d6035fSJeremy L Thompson call buildmats(qref,qweight,interp,grad) 13752d6035fSJeremy L Thompson call ceedbasiscreateh1(ceed,ceed_triangle,d,ptet,qtet,interp,grad,qref,& 13852d6035fSJeremy L Thompson & qweight,bxtet,err) 13952d6035fSJeremy L Thompson call buildmats(qref,qweight,interp,grad) 14052d6035fSJeremy L Thompson call ceedbasiscreateh1(ceed,ceed_triangle,1,ptet,qtet,interp,grad,qref,& 14152d6035fSJeremy L Thompson & qweight,butet,err) 14252d6035fSJeremy L Thompson 14352d6035fSJeremy L Thompson! -- QFunctions 14452d6035fSJeremy L Thompson call ceedqfunctioncreateinterior(ceed,1,setup,& 1452d50dd3dSjeremylt &SOURCE_DIR& 146872c4ebbSjeremylt &//'t510-operator.h:setup'//char(0),qf_setuptet,err) 14752d6035fSJeremy L Thompson call ceedqfunctionaddinput(qf_setuptet,'_weight',1,ceed_eval_weight,err) 1484d537eeaSYohann call ceedqfunctionaddinput(qf_setuptet,'dx',d*d,ceed_eval_grad,err) 14952d6035fSJeremy L Thompson call ceedqfunctionaddoutput(qf_setuptet,'rho',1,ceed_eval_none,err) 15052d6035fSJeremy L Thompson 15152d6035fSJeremy L Thompson call ceedqfunctioncreateinterior(ceed,1,mass,& 1522d50dd3dSjeremylt &SOURCE_DIR& 153872c4ebbSjeremylt &//'t510-operator.h:mass'//char(0),qf_masstet,err) 15452d6035fSJeremy L Thompson call ceedqfunctionaddinput(qf_masstet,'rho',1,ceed_eval_none,err) 15552d6035fSJeremy L Thompson call ceedqfunctionaddinput(qf_masstet,'u',1,ceed_eval_interp,err) 15652d6035fSJeremy L Thompson call ceedqfunctionaddoutput(qf_masstet,'v',1,ceed_eval_interp,err) 15752d6035fSJeremy L Thompson 15852d6035fSJeremy L Thompson! -- Operators 15952d6035fSJeremy L Thompson! ---- Setup Tet 160442e7f0bSjeremylt call ceedoperatorcreate(ceed,qf_setuptet,ceed_qfunction_none,& 161442e7f0bSjeremylt & ceed_qfunction_none,op_setuptet,err) 162*15910d16Sjeremylt call ceedoperatorsetfield(op_setuptet,'_weight',& 163*15910d16Sjeremylt & ceed_elemrestriction_none,bxtet,ceed_vector_none,err) 16452d6035fSJeremy L Thompson call ceedoperatorsetfield(op_setuptet,'dx',erestrictxtet,& 165a8d32208Sjeremylt & bxtet,ceed_vector_active,err) 16652d6035fSJeremy L Thompson call ceedoperatorsetfield(op_setuptet,'rho',erestrictuitet,& 167a8d32208Sjeremylt & ceed_basis_collocated,qdatatet,err) 16852d6035fSJeremy L Thompson! ---- Mass Tet 169442e7f0bSjeremylt call ceedoperatorcreate(ceed,qf_masstet,ceed_qfunction_none,& 170442e7f0bSjeremylt & ceed_qfunction_none,op_masstet,err) 17152d6035fSJeremy L Thompson call ceedoperatorsetfield(op_masstet,'rho',erestrictuitet,& 172a8d32208Sjeremylt & ceed_basis_collocated,qdatatet,err) 17352d6035fSJeremy L Thompson call ceedoperatorsetfield(op_masstet,'u',erestrictutet,& 174a8d32208Sjeremylt & butet,ceed_vector_active,err) 17552d6035fSJeremy L Thompson call ceedoperatorsetfield(op_masstet,'v',erestrictutet,& 176a8d32208Sjeremylt & butet,ceed_vector_active,err) 17752d6035fSJeremy L Thompson 17852d6035fSJeremy L Thompson! Hex Elements 17952d6035fSJeremy L Thompson do i=0,nelemhex-1 18052d6035fSJeremy L Thompson col=mod(i,nx) 18152d6035fSJeremy L Thompson row=i/nx 18252d6035fSJeremy L Thompson offset=(nxtet*2+1)*(nytet*2)*(1+row)+col*2 18352d6035fSJeremy L Thompson do j=0,phex-1 18452d6035fSJeremy L Thompson do k=0,phex-1 18552d6035fSJeremy L Thompson indxhex(phex*(phex*i+k)+j+1)=offset+k*(nxhex*2+1)+j 18652d6035fSJeremy L Thompson enddo 18752d6035fSJeremy L Thompson enddo 18852d6035fSJeremy L Thompson enddo 18952d6035fSJeremy L Thompson 19052d6035fSJeremy L Thompson! -- Restrictions 19161dbc9d2Sjeremylt call ceedelemrestrictioncreate(ceed,imode,nelemhex,phex*phex,ndofs,d,& 19252d6035fSJeremy L Thompson & ceed_mem_host,ceed_use_pointer,indxhex,erestrictxhex,err) 19352d6035fSJeremy L Thompson 19461dbc9d2Sjeremylt call ceedelemrestrictioncreate(ceed,imode,nelemhex,phex*phex,ndofs,1,& 19552d6035fSJeremy L Thompson & ceed_mem_host,ceed_use_pointer,indxhex,erestrictuhex,err) 1967509a596Sjeremylt stridesuhex=[1,qhex*qhex,qhex*qhex] 1977509a596Sjeremylt call ceedelemrestrictioncreatestrided(ceed,nelemhex,qhex*qhex,& 1987509a596Sjeremylt & nqptshex,1,stridesuhex,erestrictuihex,err) 19952d6035fSJeremy L Thompson 20052d6035fSJeremy L Thompson! -- Bases 20152d6035fSJeremy L Thompson call ceedbasiscreatetensorh1lagrange(ceed,d,d,phex,qhex,ceed_gauss,& 20252d6035fSJeremy L Thompson & bxhex,err) 20352d6035fSJeremy L Thompson call ceedbasiscreatetensorh1lagrange(ceed,d,1,phex,qhex,ceed_gauss,& 20452d6035fSJeremy L Thompson & buhex,err) 20552d6035fSJeremy L Thompson 20652d6035fSJeremy L Thompson! -- QFunctions 20752d6035fSJeremy L Thompson call ceedqfunctioncreateinterior(ceed,1,setup,& 2082d50dd3dSjeremylt &SOURCE_DIR& 209a05f9790Sjeremylt &//'t510-operator.h:setup'//char(0),qf_setuphex,err) 21052d6035fSJeremy L Thompson call ceedqfunctionaddinput(qf_setuphex,'_weight',1,ceed_eval_weight,err) 2114d537eeaSYohann call ceedqfunctionaddinput(qf_setuphex,'dx',d*d,ceed_eval_grad,err) 21252d6035fSJeremy L Thompson call ceedqfunctionaddoutput(qf_setuphex,'rho',1,ceed_eval_none,err) 21352d6035fSJeremy L Thompson 21452d6035fSJeremy L Thompson call ceedqfunctioncreateinterior(ceed,1,mass,& 2152d50dd3dSjeremylt &SOURCE_DIR& 216a05f9790Sjeremylt &//'t510-operator.h:mass'//char(0),qf_masshex,err) 21752d6035fSJeremy L Thompson call ceedqfunctionaddinput(qf_masshex,'rho',1,ceed_eval_none,err) 21852d6035fSJeremy L Thompson call ceedqfunctionaddinput(qf_masshex,'u',1,ceed_eval_interp,err) 21952d6035fSJeremy L Thompson call ceedqfunctionaddoutput(qf_masshex,'v',1,ceed_eval_interp,err) 22052d6035fSJeremy L Thompson 22152d6035fSJeremy L Thompson! -- Operators 22252d6035fSJeremy L Thompson! ---- Setup Hex 223442e7f0bSjeremylt call ceedoperatorcreate(ceed,qf_setuphex,ceed_qfunction_none,& 224442e7f0bSjeremylt & ceed_qfunction_none,op_setuphex,err) 225*15910d16Sjeremylt call ceedoperatorsetfield(op_setuphex,'_weight',& 226*15910d16Sjeremylt & ceed_elemrestriction_none,bxhex,ceed_vector_none,err) 22752d6035fSJeremy L Thompson call ceedoperatorsetfield(op_setuphex,'dx',erestrictxhex,& 228a8d32208Sjeremylt & bxhex,ceed_vector_active,err) 22952d6035fSJeremy L Thompson call ceedoperatorsetfield(op_setuphex,'rho',erestrictuihex,& 230a8d32208Sjeremylt & ceed_basis_collocated,qdatahex,err) 23152d6035fSJeremy L Thompson! ---- Mass Hex 232442e7f0bSjeremylt call ceedoperatorcreate(ceed,qf_masshex,ceed_qfunction_none,& 233442e7f0bSjeremylt & ceed_qfunction_none,op_masshex,err) 23452d6035fSJeremy L Thompson call ceedoperatorsetfield(op_masshex,'rho',erestrictuihex,& 235a8d32208Sjeremylt & ceed_basis_collocated,qdatahex,err) 23652d6035fSJeremy L Thompson call ceedoperatorsetfield(op_masshex,'u',erestrictuhex,& 237a8d32208Sjeremylt & buhex,ceed_vector_active,err) 23852d6035fSJeremy L Thompson call ceedoperatorsetfield(op_masshex,'v',erestrictuhex,& 239a8d32208Sjeremylt & buhex,ceed_vector_active,err) 24052d6035fSJeremy L Thompson 24152d6035fSJeremy L Thompson! Composite Operators 24252d6035fSJeremy L Thompson call ceedcompositeoperatorcreate(ceed,op_setup,err) 24352d6035fSJeremy L Thompson call ceedcompositeoperatoraddsub(op_setup,op_setuptet,err) 24452d6035fSJeremy L Thompson call ceedcompositeoperatoraddsub(op_setup,op_setuphex,err) 24552d6035fSJeremy L Thompson 24652d6035fSJeremy L Thompson call ceedcompositeoperatorcreate(ceed,op_mass,err) 24752d6035fSJeremy L Thompson call ceedcompositeoperatoraddsub(op_mass,op_masstet,err) 24852d6035fSJeremy L Thompson call ceedcompositeoperatoraddsub(op_mass,op_masshex,err) 24952d6035fSJeremy L Thompson 25052d6035fSJeremy L Thompson! Apply Setup Operator 251e97ff134Sjeremylt call ceedoperatorapply(op_setup,x,ceed_vector_none,& 252e97ff134Sjeremylt & ceed_request_immediate,err) 25352d6035fSJeremy L Thompson 25452d6035fSJeremy L Thompson! Apply Mass Operator 25552d6035fSJeremy L Thompson call ceedvectorcreate(ceed,ndofs,u,err) 25652d6035fSJeremy L Thompson call ceedvectorsetvalue(u,0.d0,err) 25752d6035fSJeremy L Thompson call ceedvectorcreate(ceed,ndofs,v,err) 25852d6035fSJeremy L Thompson 25952d6035fSJeremy L Thompson call ceedoperatorapply(op_mass,u,v,ceed_request_immediate,err) 26052d6035fSJeremy L Thompson 26152d6035fSJeremy L Thompson! Check Output 26252d6035fSJeremy L Thompson call ceedvectorgetarrayread(v,ceed_mem_host,hv,voffset,err) 26352d6035fSJeremy L Thompson do i=1,ndofs 26452d6035fSJeremy L Thompson if (abs(hv(voffset+i))>1.0d-10) then 265a2546046Sjeremylt! LCOV_EXCL_START 26652d6035fSJeremy L Thompson write(*,*) '[',i,'] v ',hv(voffset+i),' != 0.0' 267de996c55Sjeremylt! LCOV_EXCL_STOP 26852d6035fSJeremy L Thompson endif 26952d6035fSJeremy L Thompson enddo 27052d6035fSJeremy L Thompson call ceedvectorrestorearrayread(v,hv,voffset,err) 27152d6035fSJeremy L Thompson 27252d6035fSJeremy L Thompson! Cleanup 27352d6035fSJeremy L Thompson call ceedqfunctiondestroy(qf_setuptet,err) 27452d6035fSJeremy L Thompson call ceedqfunctiondestroy(qf_masstet,err) 27552d6035fSJeremy L Thompson call ceedoperatordestroy(op_setuptet,err) 27652d6035fSJeremy L Thompson call ceedoperatordestroy(op_masstet,err) 27752d6035fSJeremy L Thompson call ceedqfunctiondestroy(qf_setuphex,err) 27852d6035fSJeremy L Thompson call ceedqfunctiondestroy(qf_masshex,err) 27952d6035fSJeremy L Thompson call ceedoperatordestroy(op_setuphex,err) 28052d6035fSJeremy L Thompson call ceedoperatordestroy(op_masshex,err) 28152d6035fSJeremy L Thompson call ceedoperatordestroy(op_setup,err) 28252d6035fSJeremy L Thompson call ceedoperatordestroy(op_mass,err) 28352d6035fSJeremy L Thompson call ceedelemrestrictiondestroy(erestrictutet,err) 28452d6035fSJeremy L Thompson call ceedelemrestrictiondestroy(erestrictxtet,err) 28552d6035fSJeremy L Thompson call ceedelemrestrictiondestroy(erestrictuitet,err) 28652d6035fSJeremy L Thompson call ceedelemrestrictiondestroy(erestrictuhex,err) 28752d6035fSJeremy L Thompson call ceedelemrestrictiondestroy(erestrictxhex,err) 28852d6035fSJeremy L Thompson call ceedelemrestrictiondestroy(erestrictuihex,err) 28952d6035fSJeremy L Thompson call ceedbasisdestroy(butet,err) 29052d6035fSJeremy L Thompson call ceedbasisdestroy(bxtet,err) 29152d6035fSJeremy L Thompson call ceedbasisdestroy(buhex,err) 29252d6035fSJeremy L Thompson call ceedbasisdestroy(bxhex,err) 29352d6035fSJeremy L Thompson call ceedvectordestroy(x,err) 29452d6035fSJeremy L Thompson call ceedvectordestroy(u,err) 29552d6035fSJeremy L Thompson call ceedvectordestroy(v,err) 29652d6035fSJeremy L Thompson call ceedvectordestroy(qdatatet,err) 29752d6035fSJeremy L Thompson call ceedvectordestroy(qdatahex,err) 29852d6035fSJeremy L Thompson call ceeddestroy(ceed,err) 29952d6035fSJeremy L Thompson end 30052d6035fSJeremy L Thompson!----------------------------------------------------------------------- 301