9 l =
ltrunc(string,len(string))
10 if(l.gt.132)
call exitti(
'invalid string length$',l)
12 call blank (initc(1),132)
13 call chcopy (initc(1),string,l)
26 real l2(lx1,ly1,lz1,1)
28 parameter(lxyz=lx1*ly1*lz1)
30 real gije(lxyz,ldim,ldim)
31 real vv(ldim,ldim),ss(ldim,ldim),oo(ldim,ldim),w(ldim,ldim)
39 call comp_gije(gije,vx(1,1,1,ie),vy(1,1,1,ie),vz(1,1,1,ie),ie)
45 ss(i,j) = 0.5*(gije(l,i,j)+gije(l,j,i))
46 oo(i,j) = 0.5*(gije(l,i,j)-gije(l,j,i))
50 call rzero(vv,ldim*ldim)
54 vv(i,j) = vv(i,j) + ss(i,k)*ss(k,j) + oo(i,k)*oo(k,j)
79 real aa(ldim,ldim),lam(ldim),w(ldim,ldim),lam2
83 common /ecmnr/ a,b,c,d,e,f,f2,ef,df,r0,r1
85 common /ecmnl/ iffout,ifdefl
120 d = 0.5*(aa(1,2)+aa(2,1))
121 e = 0.5*(aa(1,3)+aa(3,1))
122 f = 0.5*(aa(2,3)+aa(3,2))
136 a2 = (a*b+b*c+a*c) - (d*d+e*e+f*f)
137 a3 = a*f*f + b*e*e + c*d*d - a*b*c - 2*d*e*f
139 call cubic (lam,a1,a2,a3,ierr)
173 if (d.gt.0) d = sqrt(d)
177 x2 = -( d+b ) / (2.*a)
179 x1 = ( d-b ) / (2.*a)
183 10
format(
'ERROR: Both a & b zero in routine quadratic NO ROOTS.'
185 11
format(
'ERROR: a = 0 in routine quadratic, only one root.'
187 12
format(
'ERROR: negative discriminate in routine quadratic.'
193 subroutine cubic(xo,ai1,ai2,ai3,ierr)
194 real xo(3),ai1,ai2,ai3
195 complex*16 x(3),a1,a2,a3,q,r,d,arg,t1,t2,t3,theta,sq,a13
204 data twopi /6.283185307179586476925286766/
213 q = (a1*a1 - 3*a2)/9.
216 r = (2*a1*a1*a1 - 9*a1*a2 + 27*a3)/54.
226 if (abs(arg).gt.1)
goto 999
227 theta = acos(abs(arg))
230 t2 = (theta + twopi) / 3.
231 t3 = (theta + 2.*twopi) / 3.
235 x(1) = sq*cos(t1) - a13
236 x(2) = sq*cos(t2) - a13
237 x(3) = sq*cos(t3) - a13
261 real gije(lx1*ly1*lz1,ldim,ldim)
266 real ur (lx1*ly1*lz1)
267 real us (lx1*ly1*lz1)
268 real ut (lx1*ly1*lz1)
278 if (k.eq.1)
call local_grad3(ur,us,ut,u,n,1,dxm1,dxtm1)
279 if (k.eq.2)
call local_grad3(ur,us,ut,v,n,1,dxm1,dxtm1)
280 if (k.eq.3)
call local_grad3(ur,us,ut,w,n,1,dxm1,dxtm1)
287 $ ur(i)*rxm1(i,1,1,e)+us(i)*sxm1(i,1,1,e)+ut(i)*txm1(i,1,1,e))
290 $ ur(i)*rym1(i,1,1,e)+us(i)*sym1(i,1,1,e)+ut(i)*tym1(i,1,1,e))
293 $ ur(i)*rzm1(i,1,1,e)+us(i)*szm1(i,1,1,e)+ut(i)*tzm1(i,1,1,e))
299 if(nid.eq.0)
write(6,*)
300 &
'ABORT: comp_gije no axialsymmetric support for now'
305 if (k.eq.1)
call local_grad2(ur,us,u,n,1,dxm1,dxtm1)
306 if (k.eq.2)
call local_grad2(ur,us,v,n,1,dxm1,dxtm1)
310 gije(i,k,1)=dj*(ur(i)*rxm1(i,1,1,e)+us(i)*sxm1(i,1,1,e))
312 gije(i,k,2)=dj*(ur(i)*rym1(i,1,1,e)+us(i)*sym1(i,1,1,e))
324 parameter(lxyz=lx1*ly1*lz1)
326 real fh(nx*nx),fht(nx*nx),tf(nx)
334 call copy(w1,scalar,lxyz*nel)
336 call tens3d1(scalar(1,ie),w1(1,ie),fh,fht,lx1,lx1)
350 parameter(l1=lx1*lx1)
351 real intdv(l1),intuv(l1),intdp(l1),intup(l1),intv(l1),intp(l1)
352 save intdv ,intuv ,intdp ,intup ,intv ,intp
355 common /screv/ wk1,wk2
356 common /scrvh/ zgmv,wgtv,zgmp,wgtp,tmax(100)
359 real wk1 (lx1,lx1,lx1,lelt)
360 real wk2 (lx1,lx1,lx1)
361 real zgmv (lx1),wgtv(lx1),zgmp(lx1),wgtp(lx1)
379 call filterq(scalar,intv,lx1,lz1,wk1,wk2,intt,if3d,fmax)
382 if (nio.eq.0)
write(6,1) istep,fmax,name5
383 1
format(i8,
' sfilt:',1pe12.4,a10)
395 parameter(lw=4*lx1*lx1*lz1)
396 common /ctensor/ w1(lw),w2(lw)
398 real v(nv,nv,nv),u(nu,nu,nu)
401 if (nu*nu*nv.gt.lw)
then
402 write(6,*) nid,nu,nv,lw,
' ERROR in tens3d1. Increase lw.'
409 call mxm(f,nv,u,nu,w1,nu*nu)
413 call mxm(w1(k),nv,ft,nu,w2(l),nv)
417 call mxm(w2,nvv,ft,nu,v,nv)
419 call mxm(f ,nv,u,nu,w1,nu)
420 call mxm(w1,nv,ft,nu,v,nv)
431 real fh(nx,nx),fht(nx,nx),trnsfr(nx)
435 common /cfiltr/ phi(lm2),pht(lm2),diag(lm2),rmult(lm),lj(lm)
439 common /cfilti/ indr(lm),indc(lm),ipiv(lm)
442 write(6,*)
'ABORT in set_filt:',nx,lm
446 call zwgll(zpts,rmult,nx)
459 pht(kj) = lj(k)-lj(k-2)
463 call copy (pht,phi,nx*nx)
464 call gaujordf (pht,nx,nx,indr,indc,ipiv,ierr,rmult)
466 call rzero(diag,nx*nx)
473 call mxm (diag,nx,pht,nx,fh,nx)
474 call mxm (phi ,nx,fh,nx,pht,nx)
476 call copy (fh,pht,nx*nx)
484 write(6,6)
'flt amp',(pht(k),k=1,nx*nx,np1)
485 write(6,6)
'flt trn',(diag(k),k=1,nx*nx,np1)
486 6
format(a8,16f7.4,6(/,8x,16f7.4))
499 REAL mag (lx1*ly1*lz1)
500 REAL aije(lx1*ly1*lz1,ldim,ldim)
509 mag(l) = mag(l) + 0.5*aije(l,i,j)*aije(l,i,j)
524 real gije(lx1*ly1*lz1,ldim,ldim)
533 gije(l,i,j) = 0.5*(gije(l,i,j)+gije(l,j,i))
534 gije(l,j,i) = gije(l,i,j)
548 real ur(1),u(lx1*ly1*lz1,1)
569 common /cmap2d/ j(l*l),jt(l*l),w(l*l),z(l)
575 if (m.gt.l)
call exitti(
'map2reg_2di_e memory 1$',m)
576 if (n.gt.l)
call exitti(
'map2reg_2di_e memory 2$',n)
578 if (m.ne.mo .or. n.ne.no )
then
587 call mxm(j,n,uc,m,w ,m)
588 call mxm(w,n,jt,m,uf,n)
595 real uf(n,n,n),uc(m,m,m)
598 common /cmap3d/ j(l*l),jt(l*l),v(l*l*l),w(l*l*l),z(l)
604 if (m.gt.l)
call exitti(
'map2reg_3di_e memory 1$',m)
605 if (n.gt.l)
call exitti(
'map2reg_3di_e memory 2$',n)
607 if (m.ne.mo .or. n.ne.no )
then
620 call mxm(j,n,uc,m,v ,mm)
624 call mxm(v(iv),n,jt,m,w(iw),n)
628 call mxm(w,nn,jt,m,uf,n)
642 real j(n,m),jt(m,n),g(n),z(m)
680 data test / 6.54321 /
690 call byte_open(
'newre2.re2' // char(0), ierr)
693 write(hdr,112) nelgt,ldim,nelgv
695 write(hdr,111) nelgt,ldim,nelgv
697 111
format(
'#v001',i9,i3,i9,
' hdr')
698 112
format(
'#v002',i9,i3,i9,
' hdr')
702 call err_chk(ierr,
'Error opening in gen_re2$')
712 call err_chk(ierr,
'Error closing in gen_re2$')
721 parameter(lv=2**ldim,lblock=1000)
722 common /scrns/ xyz(lv,ldim,lblock),wk(lv*ldim*lblock)
723 common /scruz/ igr(lblock)
725 integer e,eb,eg,ierr,wdsiz2
729 data isym2pre / 1 , 2 , 4 , 3 , 5 , 6 , 8 , 7 /
733 equivalence(buf,buf2)
741 if(wdsize.eq.8) wdsiz2=8
742 nblock = lv*ldim*lblock
747 nemax = min(eb+lblock-1,nelgt)
748 call rzero(xyz,nblock)
749 call izero(igr,lblock)
756 if (mid.eq.nid.and.if3d)
then
763 xyz(li,1,kb) = xm1(1+i*nxs,1+j*nys,1+k*nzs,e)
764 xyz(li,2,kb) = ym1(1+i*nxs,1+j*nys,1+k*nzs,e)
765 xyz(li,3,kb) = zm1(1+i*nxs,1+j*nys,1+k*nzs,e)
769 elseif (mid.eq.nid)
then
775 xyz(li,1,kb) = xm1(1+i*nxs,1+j*nys,1,e)
776 xyz(li,2,kb) = ym1(1+i*nxs,1+j*nys,1,e)
781 call gop(xyz,wk,
'+ ',nblock)
782 call igop(igr,wk,
'+ ',lblock)
784 if (nid.eq.0.and.ierr.eq.0)
then
794 buf2(1) = xyz(1,1,kb)
795 buf2(2) = xyz(2,1,kb)
796 buf2(3) = xyz(3,1,kb)
797 buf2(4) = xyz(4,1,kb)
799 buf2(5) = xyz(5,1,kb)
800 buf2(6) = xyz(6,1,kb)
801 buf2(7) = xyz(7,1,kb)
802 buf2(8) = xyz(8,1,kb)
804 buf2(9) = xyz(1,2,kb)
805 buf2(10)= xyz(2,2,kb)
806 buf2(11)= xyz(3,2,kb)
807 buf2(12)= xyz(4,2,kb)
809 buf2(13)= xyz(5,2,kb)
810 buf2(14)= xyz(6,2,kb)
811 buf2(15)= xyz(7,2,kb)
812 buf2(16)= xyz(8,2,kb)
814 buf2(17)= xyz(1,3,kb)
815 buf2(18)= xyz(2,3,kb)
816 buf2(19)= xyz(3,3,kb)
817 buf2(20)= xyz(4,3,kb)
819 buf2(21)= xyz(5,3,kb)
820 buf2(22)= xyz(6,3,kb)
821 buf2(23)= xyz(7,3,kb)
822 buf2(24)= xyz(8,3,kb)
826 buf2(1) = xyz(1,1,kb)
827 buf2(2) = xyz(2,1,kb)
828 buf2(3) = xyz(3,1,kb)
829 buf2(4) = xyz(4,1,kb)
831 buf2(5) = xyz(1,2,kb)
832 buf2(6) = xyz(2,2,kb)
833 buf2(7) = xyz(3,2,kb)
834 buf2(8) = xyz(4,2,kb)
853 buf(10) = xyz(2,2,kb)
854 buf(11) = xyz(3,2,kb)
855 buf(12) = xyz(4,2,kb)
857 buf(13) = xyz(5,2,kb)
858 buf(14) = xyz(6,2,kb)
859 buf(15) = xyz(7,2,kb)
860 buf(16) = xyz(8,2,kb)
862 buf(17) = xyz(1,3,kb)
863 buf(18) = xyz(2,3,kb)
864 buf(19) = xyz(3,3,kb)
865 buf(20) = xyz(4,3,kb)
867 buf(21) = xyz(5,3,kb)
868 buf(22) = xyz(6,3,kb)
869 buf(23) = xyz(7,3,kb)
870 buf(24) = xyz(8,3,kb)
892 call err_chk(ierr,
'Error writing to newre2.re2 in gen_re2_xyz$')
907 integer e,eb,eg,wdsiz2
912 equivalence(buf,buf2)
914 parameter(lblock=500)
915 common /scrns/ vcurve(5,12,lblock),wk(5*12*lblock)
916 common /scruz/ icurve(12,lblock)
919 if(wdsize.eq.8) wdsiz2=8
927 if (imid.eq.2)
call blank(ccurve,12*lelt)
934 nedge = 4 + 8*(ldim-2)
939 if (ccurve(i,e).ne.
' ') ncurvn = ncurvn+1
946 if(nid.eq.0.and.wdsiz2.eq.8)
then
949 elseif(nid.eq.0)
then
955 nemax = min(eb+lblock-1,nelgt)
956 call izero(icurve,12*lblock)
957 call rzero(vcurve,60*lblock)
967 if (ccurve(i,e).eq.
'C') icurve(i,kb) = 1
968 if (ccurve(i,e).eq.
's') icurve(i,kb) = 2
969 if (ccurve(i,e).eq.
'm') icurve(i,kb) = 3
970 call copy(vcurve(1,i,kb),curve(1,i,e),5)
974 call igop(icurve,wk,
'+ ',12*lblock)
975 call gop(vcurve,wk,
'+ ',60*lblock)
985 if (ii.eq.1) cc(1)=
'C'
986 if (ii.eq.2) cc(1)=
's'
987 if (ii.eq.3) cc(1)=
'm'
993 call copy (buf2(3),vcurve(1,i,kb),5)
994 call blank(buf2(8),8)
998 call icopy(buf(1),eg,1)
999 call icopy(buf(2), i,1)
1000 call copyx4(buf(3),vcurve(1,i,kb),5)
1001 call blank(buf(8),4)
1013 call err_chk(ierr,
'Error writing to newre2.re2 in gen_re2_curve$')
1023 integer e,eb,eg,wdsiz2
1025 parameter(lblock=500)
1026 common /scrns/ vbc(5,6,lblock),wk(5*6*lblock)
1027 common /scruz/ ibc(6,lblock)
1041 equivalence(buf,buf2)
1050 if(wdsize.eq.8) wdsiz2=8
1054 if (ifld.eq.1.and..not.ifflow)
then
1055 if(nid.eq.0.and.wdsiz2.eq.4)
call byte_write(nbc,1,ierr)
1056 if(nid.eq.0.and.wdsiz2.eq.8)
call byte_write(rbc,2,ierr)
1057 call err_chk(ierr,
'Error writing to newre2.re2 in gen_re2_bc$')
1063 if(cbc(jj,ii,ifld).ne.
'E ')nbc=nbc+1
1066 call igop(nbc,wk,
'+ ', 1 )
1067 if(nid.eq.0.and.wdsiz2.eq.8)
then
1070 elseif(nid.eq.0)
then
1075 nemax = min(eb+lblock-1,nlg)
1076 call izero(ibc, 6*lblock)
1077 call rzero(vbc,30*lblock)
1083 if (mid.eq.nid)
then
1086 call chcopy(s4,cbc(i,e,ifld),3)
1088 call copy(vbc(1,i,kb),bc(1,i,e,ifld),5)
1092 call igop(ibc,wk,
'+ ', 6*lblock)
1093 call gop(vbc,wk,
'+ ',30*lblock)
1102 if (s3.ne.
'E ')
then
1104 if(wdsiz2.eq.8)
then
1107 call copy (buf2(3),vbc(1,i,eg),5)
1108 call blank (buf2(8),8)
1109 call chcopy (buf2(8),s3,3)
1110 if(nlg.ge.1000000)
then
1111 call icopy(i_vbc,vbc(1,i,eg),1)
1116 call icopy (buf(1),eg,1)
1117 call icopy (buf(2),i,1)
1118 call copyx4 (buf(3),vbc(1,i,eg),5)
1119 call blank (buf(8),4)
1120 if(nlg.ge.1000000)
call icopy(buf(3),vbc(1,i,eg),1)
1121 call chcopy (buf(8),s3,3)
1132 call err_chk(ierr,
'Error writing to newre2.re2 in gen_re2_bc$')
1146 if (nid.eq.0)
open(unit=10,
file=
'newrea.out',status=
'unknown')
1152 if (nid.eq.0)
write(10,*)
' ***** BOUNDARY CONDITIONS *****'
1157 if (nid.eq.0)
close(10)
1166 parameter(lv=2**ldim,lblock=1000)
1167 common /scrns/ xyz(lv,ldim,lblock),wk(lv*ldim*lblock)
1168 common /scruz/ igr(lblock)
1175 data isym2pre / 1 , 2 , 4 , 3 , 5 , 6 , 8 , 7 /
1183 nblock = lv*ldim*lblock
1186 $
write(10,
'(i12,i3,i12,'' NEL,ldim,NELV'')') nelgt,ldim,nelgv
1188 do eb=1,nelgt,lblock
1189 nemax = min(eb+lblock-1,nelgt)
1190 call rzero(xyz,nblock)
1191 call izero(igr,lblock)
1198 if (mid.eq.nid.and.if3d)
then
1205 xyz(li,1,kb) = xm1(1+i*nxs,1+j*nys,1+k*nzs,e)
1206 xyz(li,2,kb) = ym1(1+i*nxs,1+j*nys,1+k*nzs,e)
1207 xyz(li,3,kb) = zm1(1+i*nxs,1+j*nys,1+k*nzs,e)
1211 elseif (mid.eq.nid)
then
1217 xyz(li,1,kb) = xm1(1+i*nxs,1+j*nys,1,e)
1218 xyz(li,2,kb) = ym1(1+i*nxs,1+j*nys,1,e)
1223 call gop(xyz,wk,
'+ ',nblock)
1224 call igop(igr,wk,
'+ ',lblock)
1231 write(10,
'(a15,i12,a2,i5,a1,a10,i6)')
1232 $
' ELEMENT ',eg,
' [',numapt,letapt,
'] GROUP',igr(kb)
1236 write(10,
'(4g15.7)')(xyz(ic,1,kb),ic=1,4)
1237 write(10,
'(4g15.7)')(xyz(ic,2,kb),ic=1,4)
1238 write(10,
'(4g15.7)')(xyz(ic,3,kb),ic=1,4)
1240 write(10,
'(4g15.7)')(xyz(ic,1,kb),ic=5,8)
1241 write(10,
'(4g15.7)')(xyz(ic,2,kb),ic=5,8)
1242 write(10,
'(4g15.7)')(xyz(ic,3,kb),ic=5,8)
1246 write(10,
'(4g15.7)')(xyz(ic,1,kb),ic=1,4)
1247 write(10,
'(4g15.7)')(xyz(ic,2,kb),ic=1,4)
1271 parameter(lblock=500)
1272 common /scrns/ vcurve(5,12,lblock),wk(5*12*lblock)
1273 common /scruz/ icurve(12,lblock)
1281 if (imid.eq.2)
call blank(ccurve,12*lelt)
1289 nedge = 4 + 8*(ldim-2)
1294 if (ccurve(i,e).ne.
' ') ncurvn = ncurvn+1
1297 ncurvn =
iglsum(ncurvn,1)
1300 WRITE(10,*)
' ***** CURVED SIDE DATA *****'
1301 WRITE(10,
'(I10,A20,A33)') ncurvn,
' Curved sides follow',
1302 $
' IEDGE,IEL,CURVE(I),I=1,5, CCURVE'
1305 do eb=1,nelgt,lblock
1307 nemax = min(eb+lblock-1,nelgt)
1308 call izero(icurve,12*lblock)
1309 call rzero(vcurve,60*lblock)
1316 if (mid.eq.nid)
then
1319 if (ccurve(i,e).eq.
'C') icurve(i,kb) = 1
1320 if (ccurve(i,e).eq.
's') icurve(i,kb) = 2
1321 if (ccurve(i,e).eq.
'm') icurve(i,kb) = 3
1322 call copy(vcurve(1,i,kb),curve(1,i,e),5)
1326 call igop(icurve,wk,
'+ ',12*lblock)
1327 call gop(vcurve,wk,
'+ ',60*lblock)
1340 if (nelgt.lt.1000)
then
1341 write(10,
'(i3,i3,5g14.6,1x,a1)') i,eg,
1342 $ (vcurve(k,i,kb),k=1,5),cc
1343 elseif (nelgt.lt.1000000)
then
1344 write(10,
'(i2,i6,5g14.6,1x,a1)') i,eg,
1345 $ (vcurve(k,i,kb),k=1,5),cc
1347 write(10,
'(i2,i12,5g14.6,1x,a1)') i,eg,
1348 $ (vcurve(k,i,kb),k=1,5),cc
1367 parameter(lblock=500)
1368 common /scrns/ vbc(5,6,lblock),wk(5*6*lblock)
1369 common /scruz/ ibc(6,lblock)
1385 if (ifld.eq.1.and..not.ifflow)
then
1386 if (nid.eq.0)
write(10,*)
1387 $
' ***** NO FLUID BOUNDARY CONDITIONS *****'
1389 elseif (ifld.eq.1.and.nid.eq.0)
then
1390 write(10,*)
' ***** FLUID BOUNDARY CONDITIONS *****'
1391 elseif (ifld.ge.2.and.nid.eq.0)
then
1392 write(10,*)
' ***** THERMAL BOUNDARY CONDITIONS *****'
1396 nemax = min(eb+lblock-1,nlg)
1397 call izero(ibc, 6*lblock)
1398 call rzero(vbc,30*lblock)
1404 if (mid.eq.nid)
then
1407 call chcopy(s4,cbc(i,e,ifld),3)
1409 call copy(vbc(1,i,kb),bc(1,i,e,ifld),5)
1413 call igop(ibc,wk,
'+ ', 6*lblock)
1414 call gop(vbc,wk,
'+ ',30*lblock)
1428 if (nlg.lt.1000)
then
1429 write(10,
'(a1,a3,2i3,5g14.6)')
1430 $ chtemp,s3,eg,i,(vbc(ii,i,kb),ii=1,5)
1431 elseif (nlg.lt.100000)
then
1432 write(10,
'(a1,a3,i5,i1,5g14.6)')
1433 $ chtemp,s3,eg,i,(vbc(ii,i,kb),ii=1,5)
1434 elseif (nlg.lt.1000000)
then
1435 write(10,
'(a1,a3,i6,5g14.6)')
1436 $ chtemp,s3,eg,(vbc(ii,i,kb),ii=1,5)
1438 write(10,
'(a1,a3,i12,5g18.11)')
1439 $ chtemp,s3,eg,(vbc(ii,i,kb),ii=1,5)
1454 common /scrns/ x3(27),y3(27),z3(27),xyz(3,3)
1455 character*1 ccrve(12)
1460 data e3 / 1, 2, 3, 3, 6, 9, 9, 8, 7, 7, 4, 1
1461 $ , 19,20,21, 21,24,27, 27,26,25, 25,22,19
1462 $ , 1,10,19, 3,12,21, 9,18,27, 7,16,25 /
1466 call chcopy(ccrve,ccurve(1,e),12)
1468 call map2reg(x3,3,xm1(1,1,1,e),1)
1469 call map2reg(y3,3,ym1(1,1,1,e),1)
1470 if (if3d)
call map2reg(z3,3,zm1(1,1,1,e),1)
1473 if (ccurve(5,e).eq.
's')
then
1474 call chcopy(ccrve(1),
'ssss',4)
1475 call chcopy(ccrve(5),
' ',1)
1477 if (ccurve(6,e).eq.
's')
then
1478 call chcopy(ccrve(5),
'ssss',4)
1483 nedge = 4 + 8*(ldim-2)
1486 if (ccrve(i).eq.
' ')
then
1488 xyz(1,j)=x3(e3(j,i))
1489 xyz(2,j)=y3(e3(j,i))
1490 xyz(3,j)=z3(e3(j,i))
1495 xmid = .5*(xyz(j,1)+xyz(j,3))
1496 h = h + (xyz(j,2)-xmid)**2
1497 len = len + (xyz(j,3)-xyz(j,1))**2
1499 if (h.gt.tol2*len) ccurve(i,e) =
'm'
1500 if (h.gt.tol2*len)
call copy(curve(1,i,e),xyz(1,2),ldim)
1518 parameter(nfldm=ldim+ldimt+1)
1520 real pts, fieldout, dist, rst
1521 common /c_hptsr/ pts(ldim,lhis)
1522 $ , fieldout(nfldm,lhis)
1526 common /nekmpi/ nidd,npp,nekcomm,nekgroup,nekreal
1528 integer rcode, elid, proc
1529 common /c_hptsi/ rcode(lhis),elid(lhis),proc(lhis)
1531 common /scrcg/ pm1(lx1,ly1,lz1,lelv)
1532 common /outtmp/ wrk(lx1*ly1*lz1*lelt,nfldm)
1537 integer icalld,npoints,npts
1538 save icalld,npoints,npts
1550 if(nio.eq.0)
write(6,*)
'dump history points'
1552 if(icalld.eq.0)
then
1554 call hpts_in(pts,npts,npoints)
1557 n = lx1*ly1*lz1*lelt
1563 call fgslib_findpts_setup(inth_hpts,nekcomm,np,ldim,
1564 & xm1,ym1,zm1,lx1,ly1,lz1,
1565 & nelt,nxf,nyf,nzf,bb_t,n,n,
1575 call copy(wrk(1,1),vx,ntot)
1576 call copy(wrk(1,2),vy,ntot)
1577 if(if3d)
call copy(wrk(1,3),vz,ntot)
1582 call copy(wrk(1,nflds),pm1,ntot)
1586 call copy(wrk(1,nflds),t,ntot)
1591 call copy(wrk(1,nflds),t(1,1,1,1,i+1),ntot)
1596 if(icalld.eq.0)
then
1597 call fgslib_findpts(inth_hpts,rcode,1,
1604 & pts(3,1),ldim,npts)
1609 if(rcode(i).eq.1)
then
1610 if(sqrt(dist(i)).gt.toldist)
then
1612 IF (nfail.LE.5)
WRITE(6,
'(a,1p4e15.7)')
1613 &
' WARNING: point on boundary or outside the mesh xy[z]d^2:'
1614 & ,(pts(k,i),k=1,ldim),dist(i)
1616 elseif(rcode(i).eq.2)
then
1618 if (nfail.le.5)
write(6,
'(a,1p3e15.7)')
1619 &
' WARNING: point not within mesh xy[z]: !',
1620 & (pts(k,i),k=1,ldim)
1629 call fgslib_findpts_eval(inth_hpts,fieldout(ifld,1),nfldm,
1637 call hpts_out(fieldout,nflds,nfldm,npoints,nbuff)
1650 real buffer(ldim,nbuf)
1654 write(6,*)
'reading history points'
1655 open(50,
file=hisfle,status=
'old',err=100)
1656 read(50,*,err=100) npoints
1664 &
write(6,*)
'Cannot open history file in subroutine hpts()'
1668 call bcast(npoints,isize)
1669 if(npoints.gt.(lhis-1)*np)
then
1670 if(nid.eq.0)
write(6,*)
'ABORT: Increase lhis in SIZE!'
1673 if(nid.eq.0)
write(6,*)
'found ', npoints,
' points'
1676 npass = npoints/nbuf +1
1677 n0 = mod(npoints,nbuf)
1683 len = wdsize*ldim*nbuf
1684 if (nid.gt.0.and.nid.lt.npass) msg_id=
irecv(nid,buffer,len)
1691 if(ipass.eq.npass) i1 = n0
1693 read(50,*) (buffer(j,i),j=1,ldim)
1695 if(ipass.lt.npass)
call csend(ipass,buffer,len,ipass,0)
1698 elseif (nid.lt.npass)
then
1712 parameter(lt2=2*lx1*ly1*lz1*lelt)
1713 common /scrns/ xyz(ldim,lt2)
1714 common /scruz/ mid(lt2)
1717 if (lt2.gt.npts)
then
1720 if(npoints.gt.np*npts)
then
1721 if(nid.eq.0)
write(6,*)
'ABORT in hpts(): npoints > NP*lhis!!'
1722 if(nid.eq.0)
write(6,*)
'Change SIZE: ',np,npts,npoints
1726 npmax = (npoints/npts)
1727 if(mod(npoints,npts).eq.0) npmax=npmax+1
1729 if(nid.gt.0.and.npp.gt.0)
then
1730 npts_b = lt2*(nid-1)
1731 nprc_b = npts_b/npts
1733 istart = mod(npts_b,npts)
1736 elseif(nid.eq.0)
then
1737 npts0 =
mod1(npoints,lt2)
1738 npts_b = npoints - npts0
1739 nprc_b = npts_b/npts
1741 istart = mod(npts_b,npts)
1748 if(ip.gt.npmax) ip = 0
1750 if (icount.eq.npts)
then
1756 call fgslib_crystal_tuple_transfer
1757 & (cr_h,npp,lt2,mid,1,pts,0,xyz,ldim,1)
1759 call copy(pts,xyz,ldim*npp)
1769 subroutine hpts_out(fieldout,nflds,nfldm,npoints,nbuff)
1774 real buf(nfldm,nbuff),fieldout(nfldm,nbuff)
1776 len = wdsize*nfldm*nbuff
1779 npass = npoints/nbuff + 1
1780 il = mod(npoints,nbuff)
1790 if(ipass.lt.npass)
then
1792 call crecv(ipass,buf,len)
1794 write(50,
'(1p20E15.7)') time,
1795 & (buf(i,ip), i=1,nflds)
1797 elseif(nid.eq.ipass)
then
1798 call csend(ipass,fieldout,len,0,nid)
1805 write(50,
'(1p20E15.7)') time,
1806 & (fieldout(i,ip), i=1,nflds)
1825 if (nid.eq.0)
open(unit=10,
file=
'newrea.rea',status=
'unknown')
1833 if (nid.eq.0)
write(10,*)
' ***** BOUNDARY CONDITIONS *****'
1840 if (nid.eq.0)
close(10)
1852 logical ifbswap,ifre2,parfound
1853 character*132 string
1854 character*72 string2
1855 integer idum(3*numsts+3)
1862 write(6,
'(A,A)')
' Reading ', reafle
1863 open (unit=9,
file=reafle,status=
'old', iostat=ierr)
1866 call bcast(ierr,isize)
1867 if (ierr .gt. 0)
call exitti(
'Cannot open .rea file!$',1)
1871 READ(9,
'(a)') string2
1872 write(10,
'(a)') string2
1873 READ(9,
'(a)') string2
1875 READ(9,
'(a)') string2
1877 READ(9,
'(a)') string2
1880 READ(string2,*) paramval
1884 READ(9,
'(a)') string2
1889 read(9,
'(a)') string2
1892 read(string2,*) paramval
1893 if (paramval.gt.0)
then
1895 READ(9,
'(a)') string2
1901 read(9,
'(a)') string2
1904 read(string2,*) paramval
1905 if (paramval.gt.0)
then
1907 READ(9,
'(a)') string2
1914 READ(9,
'(a)') string2
1932 logical ifbswap,ifre2,parfound
1933 character*132 string
1934 character*72 string2
1935 integer idum(3*numsts+3)
1936 integer paramval,i,j
1943 READ(9,
'(a)') string2
1944 READ(string2,*) n1,n2,n3
1945 if (n1.lt.0)
goto 1001
1947 READ(9,
'(a)') string2
1949 READ(9,
'(a)') string2
1953 READ(9,
'(a)') string2
1955 if (paramval.gt.0)
then
1957 READ(9,
'(a)') string2
1961 READ(9,
'(a)') string2
1963 READ(9,
'(a)') string2
1966 READ(9,
'(a)') string2
1970 READ(9,
'(a)') string2
1973 READ(9,
'(a)') string2
1982 READ(9,
'(a)') string2
1985 READ(9,
'(a)') string2
1987 read(string2,*) paramval
1988 if (paramval.gt.0)
then
1990 READ(9,
'(a)') string2
1995 READ(9,
'(a)') string2
1997 READ(9,
'(a)') string2
1999 read(string2,*) paramval
2001 if (paramval.gt.0)
then
2003 READ(9,
'(a)') string2
2009 read(9,
'(a)') string2
2011 read(9,
'(a)') string2
2013 read(string2,*) paramval
2014 if (paramval.gt.0)
then
2016 READ(9,
'(a)') string2
2022 read(9,
'(a)') string2
2024 read(9,
'(a)') string2
2027 read(string2,*) paramval
2028 if (paramval.gt.0)
then
2030 READ(9,
'(a)') string2
2036 read(9,
'(a)') string2
2039 read(9,
'(a)') string2
2041 read(string2,*) paramval
2042 if (paramval.gt.0)
then
2044 READ(9,
'(a)') string2
2051 READ(9,
'(a)') string2
2058 if (nid.eq.0)
close(9)
subroutine crecv(mtype, buf, lenm)
subroutine igop(x, w, op, n)
subroutine gop(x, w, op, n)
subroutine exitti(stringi, idata)
subroutine csend(mtype, buf, len, jnid, jpid)
subroutine bcast(buf, len)
function irecv(msgtag, x, len)
subroutine err_chk(ierr, string)
integer function gllel(ieg)
integer function gllnid(ieg)
subroutine fd_weights_full(xx, x, n, m, c)
subroutine transpose(a, lda, b, ldb)
subroutine icopy(a, b, n)
function ltrunc(string, l)
subroutine chcopy(a, b, n)
subroutine sort(a, ind, n)
subroutine mxm(a, n1, b, n2, c, n3)
subroutine build_new_filter(intv, zpts, nx, kut, wght, nio)
subroutine gaujordf(a, m, n, indr, indc, ipiv, ierr, rmult)
subroutine local_grad2(ur, us, u, N, e, D, Dt)
subroutine legendre_poly(L, x, N)
subroutine filterq(v, f, nx, nz, w1, w2, ft, if3d, dmax)
subroutine local_grad3(ur, us, ut, u, N, e, D, Dt)
subroutine quadratic(x1, x2, a, b, c, ierr)
subroutine hpts_in(pts, npts, npoints)
subroutine comp_gije(gije, u, v, w, e)
subroutine tens3d1(v, u, f, ft, nv, nu)
subroutine buffer_in(buffer, npp, npoints, nbuf)
subroutine build_1d_filt(fh, fht, trnsfr, nx, nio)
subroutine gen_int_gz(j, jt, g, n, z, m)
subroutine gen_rea_full(imid)
subroutine gen_rea_bottom
subroutine cubic(xo, ai1, ai2, ai3, ierr)
subroutine gen_rea_bc(ifld)
subroutine gen_rea_curve(imid)
subroutine filter_s1(scalar, tf, nx, nel)
subroutine gen_rea_midside_e(e)
subroutine find_lam3(lam, aa, w, ldim, ierr)
subroutine gen_re2_bc(ifld)
subroutine map2reg_3di_e(uf, n, uc, m)
subroutine hpts_out(fieldout, nflds, nfldm, npoints, nbuff)
subroutine map2reg_2di_e(uf, n, uc, m)
subroutine filter_s0(scalar, wght, ncut, name5)
subroutine comp_sije(gije)
subroutine load_fld(string)
subroutine gen_re2_curve(imid)
subroutine map2reg(ur, n, u, nel)
subroutine mag_tensor_e(mag, aije)
subroutine prepost_map(isave)
subroutine copyx4(a, b, n)
subroutine zwgll(Z, W, NP)