6 use kinds, only : dp, i8
7 use size_m
, only : lx1, ly1, lz1, lelv, ldimt, ldimt1
8 use size_m
, only : nx1, ny1, nz1, nelt, nx2, ny2, nz2, nelv
9 use size_m
, only : nid, lpert, nfield
10 use geom, only : ifvcor, xm1, ym1, zm1
11 use input, only : ifheat, ifsplit, ifflow, ifmhd, ifpert, ifmodel, ifkeps
12 use input, only : param, ifmvbd, npscal
13 use input, only : iftmsh, ifldmhd, ifadvc
14 use mvgeom, only : wx, wy, wz
16 use soln, only : vx, vy, vz, pr, t, jp, vmult, bx, by, bz
17 use soln, only : tmult
18 use tstep, only : ifield, nbdinp, time, timeio, nelfld, ntdump
22 logical iffort( ldimt1,0:lpert) &
23 , ifrest(0:ldimt1,0:lpert) &
24 , ifprsl( ldimt1,0:lpert)
27 real(DP),
allocatable :: work(:,:,:,:)
28 integer(i8) :: ntotg,nn
30 real(DP) :: psmax(ldimt)
32 integer :: nxyz2, ntot2, nxyz1, ntott, ntotv, irst, maxfld, mfldt
33 integer :: itest, nbdmax, nbdsav, i, ntot, ifldsave, nfiles
34 real(DP) :: rdif, rtotg, vxmax, vymax, vzmax, prmax, ttmax, small
35 real(DP) :: xxmax, yymax, zzmax
36 real(DP),
external :: glsum, glamax, glmin, glmax
38 if(nid == 0)
write(6,*)
'set initial conditions'
47 vx = 0._dp; vy = 0._dp; vz = 0._dp; pr = 0._dp; t = 0._dp
70 call
slogic(iffort,ifrest,ifprsl,nfiles)
75 IF (ifmodel) CALL pretmic
83 DO 100 ifield=2,nfield
84 IF (ifprsl(ifield,jp))
THEN
85 IF (nid == 0)
WRITE(6,101) ifield
89 101
FORMAT(2x,
'Using PRESOLVE option for field',i2,
'.')
93 if (ifmodel .AND. ifkeps) maxfld = nfield-2
94 if (ifmhd) maxfld = npscal+3
107 do 200 ifield=2,maxfld
108 if (iffort(ifield,jp))
then
109 if (nid == 0)
write(6,*)
'call nekuic for ifld ', ifield
117 if (nid == 0)
write(6,*)
'nekuicP',ifield,jp,iffort(ifield,jp)
118 if (iffort(ifield,jp)) call
nekuic
141 if (param(69) > 0)
then
142 if (nid == 0)
write(6,*)
'trying to load restart files'
145 if (nid == 0)
write(6,*)
'call nekuic for all fields'
152 if (iffort(ifield,jp))
then
153 if (nid == 0)
write(6,*)
'call nekuic for vel '
160 if (iffort(ifield,jp)) call
nekuic
161 if (nid == 0)
write(6,*)
'ic vel pert:',iffort(1,jp),jp
167 ntotv = nx1*ny1*nz1*nelv
170 if (ifmodel .AND. ifkeps)
then
172 do 300 ifield=mfldt,nfield
173 if (iffort(ifield,jp)) call
nekuic
178 if (ifmvbd) call
opcopy(wx,wy,wz,vx,vy,vz)
185 if (ifmodel) call postmic
192 if ( .NOT. ifflow .AND. ifheat)
then
194 DO 400 ifield=2,nfield
195 IF (ifadvc(ifield)) itest=1
209 if (nid /= 0) time=0.0
212 if (timeio /= 0.0) ntdump = int( time/timeio )
223 if (ifflow) ifield = 1
224 allocate(work(lx1,ly1,lz1,lelv))
229 rdif = glsum(work,ntotv)
232 rdif = (rdif-rtotg)/rtotg
233 if (abs(rdif) > 1e-14)
then
234 if (nid == 0)
write(*,*)
'ERROR: dssum test has failed!',rdif
238 vxmax = glamax(vx,ntotv)
239 vymax = glamax(vy,ntotv)
240 vzmax = glamax(vz,ntotv)
241 prmax = glamax(pr,ntot2)
243 ntot = nxyz1*nelfld(2)
244 ttmax = glamax(t ,ntot)
247 ntot = nx1*ny1*nz1*nelfld(i+2)
248 psmax(i) = glamax(t(1,1,1,1,i+1),ntot)
260 ntot = nxyz1*nelfld(i+2)
268 vx = vx * vmult; vy = vy * vmult; vz = vz * vmult
269 if (ifsplit) call
dsavg(pr)
270 if (ifvcor) call
ortho(pr)
277 bx = bx * vmult; by = by * vmult; bz = bz * vmult
285 call
dssum(t(1,1,1,1,i-1))
286 if(iftmsh(ifield))
then
287 t(:,:,:,:,i-1) = t(:,:,:,:,i-1) * tmult(:,:,:,:,1)
290 t(:,:,:,:,i-1) = t(:,:,:,:,i-1) * vmult
300 call
opdssum(vxp(1,jp),vyp(1,jp),vzp(1,jp))
301 call
opcolv(vxp(1,jp),vyp(1,jp),vzp(1,jp),vmult)
303 call
dssum(tp(1,1,jp))
304 call col2(tp(1,1,jp),tmult,ntotv)
306 vxmax = glamax(vxp(1,jp),ntotv)
307 vymax = glamax(vyp(1,jp),ntotv)
308 if (nid == 0)
write(6,111) jp,vxmax,vymax
309 111
format(i5,1p2e12.4,
' max pert vel')
316 xxmax = glmin(xm1,ntott)
317 yymax = glmin(ym1,ntott)
318 zzmax = glmin(zm1,ntott)
320 vxmax = glmin(vx,ntotv)
321 vymax = glmin(vy,ntotv)
322 vzmax = glmin(vz,ntotv)
323 prmax = glmin(pr,ntot2)
325 ntot = nxyz1*nelfld(2)
326 ttmax = glmin(t ,ntott)
329 ntot = nxyz1*nelfld(i+2)
330 psmax(i) = glmin(t(1,1,1,1,i+1),ntot)
334 write(6,19) xxmax,yymax,zzmax
335 19
format(
' xyz min ',5g13.5)
338 write(6,20) vxmax,vymax,vzmax,prmax,ttmax
339 20
format(
' uvwpt min',5g13.5)
341 if (ldimt-1 > 0)
then
342 if (nid == 0)
write(6,21) (psmax(i),i=1,ldimt-1)
343 21
format(
' PS min ',50g13.5)
347 xxmax = glmax(xm1,ntott)
348 yymax = glmax(ym1,ntott)
349 zzmax = glmax(zm1,ntott)
351 vxmax = glmax(vx,ntotv)
352 vymax = glmax(vy,ntotv)
353 vzmax = glmax(vz,ntotv)
354 prmax = glmax(pr,ntot2)
356 ntot = nxyz1*nelfld(2)
357 ttmax = glmax(t ,ntott)
360 ntot = nxyz1*nelfld(i+2)
361 psmax(i) = glmax(t(1,1,1,1,i+1),ntot)
365 write(6,16) xxmax,yymax,zzmax
366 16
format(
' xyz max ',5g13.5)
370 write(6,17) vxmax,vymax,vzmax,prmax,ttmax
371 17
format(
' uvwpt max',5g13.5)
374 if (ldimt-1 > 0)
then
376 write(6,18) (psmax(i),i=1,ldimt-1)
377 18
format(
' PS max ',50g13.5)
382 if (ifrest(0,jp))
then
383 if (nid == 0)
write(6,*)
'Restart: recompute geom. factors.'
396 write(6,*)
'done :: set initial conditions'
406 subroutine slogic (iffort,ifrest,ifprsl,nfiles)
407 use size_m
, only : nfield, npert, nid, ldimt1, lpert
408 use input, only : ifmhd, initc, npscal, ifpert
409 use restart, only : ifgetx, ifgetu, ifgett, ifgtps
413 logical iffort( ldimt1,0:lpert) &
414 , ifrest(0:ldimt1,0:lpert) &
415 , ifprsl( ldimt1,0:lpert)
417 character(132) :: line,fname,cdum
419 character(1) :: line1(132)
420 equivalence(line1,line)
422 integer :: ifield, ndumps, iline, ip, ll, l, nfldt, jp, ifld, nfiles
427 if (ifmhd) nfldt = nfield+1
430 ifrest(0,jp) = .false.
432 iffort(ifld,jp) = .true.
433 ifrest(ifld,jp) = .false.
434 ifprsl(ifld,jp) = .false.
446 IF (
indx1(line,
'PRESOLV',7) /= 0)
THEN
448 CALL
blank(initc(iline),132)
450 CALL
csplit(cdum,line,
' ',1)
452 IF (
ltrunc(line,132) == 0)
THEN
453 IF (nid == 0)
WRITE(6,700)
454 700
FORMAT(/,2x,
'Presolve options: ALL')
456 DO 800 ifield=1,nfldt
457 ifprsl(ifield,jp) = .true.
458 iffort(ifield,jp) = .false.
464 IF (nid == 0)
WRITE(6,810) (line1(l),l=1,ll)
465 810
FORMAT(/,2x,
'Presolve options: ',132a1)
468 ifprsl(1,jp) = .true.
469 iffort(1,jp) = .false.
473 ifprsl(2,jp) = .true.
474 iffort(2,jp) = .false.
477 DO 900 ifield=3,npscal+2
481 ifprsl(ifield,jp) = .true.
482 iffort(ifield,jp) = .false.
494 if (ifpert) jp=iline-1
496 IF (
ltrunc(line,132) /= 0)
THEN
501 IF (nid == 0 .AND. nfiles == 1)
WRITE(6,1010) line
502 1010
FORMAT(1x,
'Checking restart options: ',a132)
507 call
sioflag(ndumps,fname,line)
510 ifrest(0,jp) = .true.
513 iffort(1,jp) = .false.
514 ifprsl(1,jp) = .false.
515 ifrest(1,jp) = .true.
518 iffort(2,jp) = .false.
519 ifprsl(2,jp) = .false.
520 ifrest(2,jp) = .true.
522 do 1900 ifield=3,nfldt
524 if (ifgtps(ifield-2))
then
525 iffort(ifield,jp) = .false.
526 ifprsl(ifield,jp) = .false.
527 ifrest(ifield,jp) = .true.
548 use kinds, only : dp, r4
549 use size_m
, only : lx1, ly1, lz1, lelt, ldimt, ldimt1
550 use size_m
, only : nid, nx1, ny1, nz1, nx2, ny2, nz2
551 use restart, only : nxr, nyr, nzr
552 use restart, only : ifgetx, ifgetz, ifgetu, ifgetw, ifgetp, ifgett, ifgtim
554 use geom, only : xm1, ym1, zm1
555 use input, only : ifpert, ifmhd, if3d, npscal, param, initc
557 use soln, only : vx, vy, vz, t
559 use tstep, only : time
562 integer,
intent(in) :: nfiles
566 integer,
parameter :: LXR=LX1+6
567 integer,
parameter :: LYR=LY1+6
568 integer,
parameter :: LZR=LZ1+6
569 integer,
parameter :: LXYZR=LXR*LYR*LZR
570 integer,
parameter :: LXYZT=LX1*LY1*LZ1*LELT
571 integer,
parameter :: LPSC9=LDIMT+9
573 real(DP),
allocatable :: sdump(:,:)
576 real(r4),
allocatable :: tdump(:,:)
578 REAL(DP),
allocatable :: SDMP2(:,:)
582 character(30) :: excoder
583 character(1) :: excoder1(30)
584 equivalence(excoder,excoder1)
586 character(132) :: fname
587 character(1) :: fname1(132)
588 equivalence(fname1,fname)
590 integer :: hnami (30)
591 character(132) :: hname
593 CHARACTER(132) :: header
596 logical :: ifok,iffmat
597 integer :: iposx,iposz,iposu,iposw,iposp,ipost,ipsps(ldimt1)
599 logical :: ifbytsw, if_byte_swap_test
602 real(DP) :: p67, rstime, cdump
603 integer :: ifile, ndumps, ierr, len, idump, neltr, istepr, i, icase, ipass
604 integer :: nxyz2, mid, ieg, nerr, ips, ii, nxyzr, ixyzz, nouts
605 integer :: jxyz, ntotv, ntott
606 integer :: nxyz1, lname, is, nps0, nps1, i1, iposv, iposy, nps
612 if(nfiles < 1)
return
614 if(nid == 0)
write(6,*)
'Reading checkpoint data'
615 allocate(tdump(lxyzr,lpsc9))
620 write(*,*)
"Oops: p67"
623 call
sioflag(ndumps,fname,initc(ifile))
624 call mfi(fname,ifile)
635 if (param(67) < 1.0)
then
641 do 6000 ifile=1,nfiles
642 call
sioflag(ndumps,fname,initc(ifile))
647 open (unit=91,file=fname,status=
'old',err=500)
651 open (unit=91,file=hname &
652 ,form=
'unformatted',status=
'old',err=500)
655 if(ierr /= 0) goto 500
662 if ( .NOT. ifok) goto 5000
668 DO 1000 idump=1,ndumps
674 if(mod(param(67),1._dp) == 0)
then
675 if(nelgt < 10000)
then
676 read(91,91,err=10,end=10) &
677 neltr,nxr,nyr,nzr,rstime,istepr,(excoder1(i),i=1,30)
678 91
format(4i4,1x,g13.4,i5,1x,30a1)
681 read(91,92,err=10,end=10) &
682 neltr,nxr,nyr,nzr,rstime,istepr,(excoder1(i),i=1,30)
683 92
format(i10,3i4,1p1e18.9,i9,1x,30a1)
687 read(91,
'(A132)',err=10,end=10) header
689 neltr,nxr,nyr,nzr,rstime,istepr,excoder
693 if(mod(param(67),1._dp) == 0)
then
695 if(ierr /= 0) goto 10
697 if (nelgt < 10000) icase = 1
703 read(hname,
'(4i4,1x,g13.4,i5,1x,30a1)', &
705 neltr,nxr,nyr,nzr,rstime,istepr, &
709 read(hname,
'(i10,3i4,1P1e18.9,i9,1x,30a1)', &
711 neltr,nxr,nyr,nzr,rstime,istepr, &
724 if(ierr /= 0) goto 10
726 neltr,nxr,nyr,nzr,rstime,istepr,excoder
730 if(ierr /= 0) goto 10
731 ifbytsw = if_byte_swap_test(bytetest,ierr)
732 if(ierr /= 0) goto 10
738 write(6,*)
'Read mode: ', param(67)
739 write(6,333)
'neltr,nxr,nyr,nzr: ', neltr,nxr,nyr,nzr
741 call
chcopy(mesg(5),excoder1,20)
744 10 call
err_chk(ierr,
'Error reading restart header. Abort.$')
753 call
chcopy(excoder1,mesg(5),20)
761 'ABORT: Attempt to map from',i3, &
762 ' to N=',i3,
'.',/,2x, &
763 'NEK5000 currently supports mapping from N+6 or less.' &
764 ,/,2x,
'Increase N or LXR in IC.FOR.')
786 IF (excoder1(i) ==
'X')
THEN
796 IF (excoder1(i) ==
'U')
THEN
806 IF (excoder1(i) ==
'P')
THEN
810 IF (excoder1(i) ==
'T')
THEN
814 IF(mod(param(67),1._dp) == 0.0)
THEN
816 if (0 < i1 .AND. i1 < 10)
then
817 if (i1 <= ldimt1)
then
821 if (nid == 0)
write(6,2) i1,i,excoder1(i)
822 2
format(2i4,a1,
' PROBLEM W/ RESTART DATA')
826 IF(excoder1(i) ==
'S')
THEN
827 READ(excoder1(i+1),
'(I1)') nps1
828 READ(excoder1(i+2),
'(I1)') nps0
839 IF (nps > (ldimt-1))
THEN
842 'ERROR: restart file has a NSPCAL > LDIMT'
844 'Change LDIMT in SIZE'
850 if (nid == 0)
write(6,61) (fname1(i),i=1,lname)
851 if (nid == 0)
write(6,62) &
852 iposu,iposv,iposw,iposp,ipost,nps,nouts
853 61
FORMAT(/,2x,
'Restarting from file ',132a1)
854 62
FORMAT(2x,
'Columns for restart data U,V,W,P,T,S,N: ',7i4)
857 if (iposx == 0) ifgetx= .false.
858 if (iposy == 0) ifgetx= .false.
859 if (iposz == 0) ifgetz= .false.
860 if (iposu == 0) ifgetu= .false.
861 if (iposv == 0) ifgetu= .false.
862 if (iposw == 0) ifgetw= .false.
863 if (iposp == 0) ifgetp= .false.
864 if (ipost == 0) ifgett= .false.
866 if (ipsps(i) == 0) ifgtps(i)= .false.
879 READ(91,
'(6G11.4)',end=15)(cdump,i=1,neltr)
884 if( .NOT. ifok) goto 1600
895 nelrr = min(nelgt,neltr)
900 IF (mod(ieg,10000) == 1)
WRITE(6,*)
'Reading',ieg
902 READ(91,*,err=70,end=70) &
903 ((tdump(ixyzz,ii),ii=1,nouts),ixyzz=1,nxyzr)
908 write(6,*)
"Error reading xyz restart data"
920 IF ( .NOT. ifok) goto 1600
921 write(*,*)
"Oops: ifok"
931 (sdump(1,1),tdump(1,iposx),ieg,nxr,nyr,nzr,ifbytsw)
933 (sdump(1,2),tdump(1,iposy),ieg,nxr,nyr,nzr,ifbytsw)
935 (sdump(1,3),tdump(1,iposz),ieg,nxr,nyr,nzr,ifbytsw)
937 (sdump(1,4),tdump(1,iposu),ieg,nxr,nyr,nzr,ifbytsw)
939 (sdump(1,5),tdump(1,iposv),ieg,nxr,nyr,nzr,ifbytsw)
941 (sdump(1,6),tdump(1,iposw),ieg,nxr,nyr,nzr,ifbytsw)
943 (sdump(1,7),tdump(1,iposp),ieg,nxr,nyr,nzr,ifbytsw)
945 (sdmp2(1,1),tdump(1,ipost),ieg,nxr,nyr,nzr,ifbytsw)
949 if (ifgtps(ips)) call
mapdmp(sdmp2(1,ips+1) &
950 ,tdump(1,ipsps(ips)),ieg,nxr,nyr,nzr,ifbytsw)
960 if (mid == nid) nerr = nerr+1
969 if (ifmhd .AND. ifile == 2)
then
970 write(*,*)
"Oops: ifmhd"
972 if (ifgetu) call
copy(bx,sdump(1,4),ntott)
973 if (ifgetu) call
copy(by,sdump(1,5),ntott)
974 if (ifgetw) call
copy(bz,sdump(1,6),ntott)
976 if (nid == 0)
write(6,*)
'getting restart pressure'
978 call
copy( pm,sdump(1,7),ntotv)
981 iiel = (iel-1)*nxyz1+1
982 call map12(pm(1,1,1,iel),sdump(iiel,7),iel)
986 if (ifaxis .AND. ifgett) &
987 call
copy(t(1,1,1,1,2),sdmp2(1,1),ntott)
989 elseif (ifpert .AND. ifile >= 2)
then
990 write(*,*)
"Oops: ifpert"
993 if (ifgetu) call
copy(vxp(1,j),sdump(1,4),ntotv)
994 if (ifgetu) call
copy(vyp(1,j),sdump(1,5),ntotv)
995 if (ifgetw) call
copy(vzp(1,j),sdump(1,6),ntotv)
997 if (nid == 0)
write(6,*)
'getting restart pressure'
999 call
copy(prp(1,j),sdump(1,7),ntotv)
1002 ie1 = (ie-1)*nxyz1+1
1003 ie2 = (ie-1)*nxyz2+1
1004 call map12(prp(ie2,j),sdump(ie1,7),ie)
1008 if (ifgett) call
copy(tp(1,1,j),sdmp2(1,1),ntott)
1012 call
copy(tp(1,ips+1,j),sdmp2(1,ips+1),ntott)
1016 allocate(sdump(lxyzt,7))
1017 if (ifgetx) call
copy(xm1,sdump(1,1),ntott)
1018 if (ifgetx) call
copy(ym1,sdump(1,2),ntott)
1019 if (ifgetz) call
copy(zm1,sdump(1,3),ntott)
1020 if (ifgetu) call
copy(vx ,sdump(1,4),ntotv)
1021 if (ifgetu) call
copy(vy ,sdump(1,5),ntotv)
1022 if (ifgetw) call
copy(vz ,sdump(1,6),ntotv)
1024 if (ifgett) call
copy(t,sdmp2(1,1),ntott)
1026 allocate(sdmp2(lxyzt,ldimt))
1029 call
copy(t(1,1,1,1,i+1),sdmp2(1,i+1),ntott)
1035 if (ifgtim) time=rstime
1043 IF (idump == 1 .AND. nid == 0)
THEN
1045 write(6,1701) ieg,ixyzz
1047 ((tdump(jxyz,ii),ii=1,nouts),jxyz=ixyzz-1,ixyzz)
1048 1700
FORMAT(5x,
'WARNING: No data read in for file ',a132)
1049 1701
FORMAT(5x,
'Failed on element',i4,
', point',i5,
'.')
1050 1702
FORMAT(5x,
'Last read dump:',/,5g15.7)
1051 write(6,*) nid,
'call exitt 1702a',idump
1053 ELSEIF (idump == 1)
THEN
1054 write(6,*) nid,
'call exitt 1702b',idump
1058 IF (nid == 0)
WRITE(6,1800) idump
1059 1800
FORMAT(2x,
'Successfully read data from dump number',i3,
'.')
1062 if (nid == 0)
close(unit=91)
1066 call
err_chk(ierr,
'Error closing restart file in restart$')
1072 if (nid == 0)
write(6,5001) fname
1073 5001
FORMAT(2x,
' ******* ERROR ******* ' &
1074 ,/,2x,
' ******* ERROR ******* ' &
1075 ,/,2x,
' Could not open restart file:' &
1077 ,//,2x,
'Quitting in routine RESTART.')
1080 IF (nid == 0)
WRITE(6,5001) hname
1093 use kinds, only : dp
1094 use size_m
, only : ldimt, nfield
1095 use input, only : if3d, ifadvc, ifflow, ifheat
1096 use restart, only : ifgetx, ifgetu, ifgett, ifgetp, ifgetz, ifgetw
1097 use restart, only : ifgtps, ifgtim
1099 use tstep, only : time
1102 character(132) :: rsopts,fname
1106 logical :: ifdeft,ifanyc
1107 CHARACTER(132) :: RSOPT ,LINE
1108 CHARACTER(1) :: RSOPT1(132),LINE1(132)
1109 equivalence(rsopt1,rsopt)
1110 equivalence(line1,line)
1112 integer :: len, len1, len4
1113 integer :: i, ndumps, ito, it1, it8, ita, itb, ixo, ivo, ipo
1114 real(DP) :: ttime, tdumps
1123 call
csplit(fname,rsopt,
' ',1)
1125 if (
indx1(fname,
'.',1) == 0)
then
1129 fname(len1:len4)=
'.fld'
1154 CALL
capit(rsopt,132)
1156 IF (
ltrunc(rsopt,132) /= 0)
THEN
1166 CALL
blank(line,132)
1167 CALL
chcopy(line,rsopt1(it1),it8)
1168 IF (
ifgtrl(ttime,line))
THEN
1174 CALL
blank(rsopt1(ito),ita)
1176 it1=
indx1(line,
' ',1)
1178 CALL
chcopy(rsopt1(ito),line1(it1),itb)
1187 IF (if3d) ifgetz= .true.
1194 IF (if3d) ifgetw= .true.
1220 if (
ifgtrl(tdumps,rsopt)) ndumps=int(tdumps)
1226 IF (if3d) ifgetz= .true.
1229 IF (ifadvc(i)) ifanyc= .true.
1231 IF (ifflow .OR. ifanyc)
THEN
1233 IF (if3d) ifgetw= .true.
1235 IF (ifflow) ifgetp= .true.
1236 IF (ifheat) ifgett= .true.
1246 subroutine mapdmp(sdump,tdump,ieg,nxr,nyr,nzr,if_byte_sw)
1247 use kinds, only : dp, r4
1248 use size_m
, only : lx1, ly1, lz1, nx1, ny1, nz1, nid, lelt
1252 integer,
parameter :: LXYZ1=LX1*LY1*LZ1
1253 integer,
PARAMETER :: LXR=LX1+6
1254 integer,
PARAMETER :: LYR=LY1+6
1255 integer,
PARAMETER :: LZR=LZ1+6
1256 integer,
PARAMETER :: LXYZR=LXR*LYR*LZR
1258 REAL(DP),
allocatable :: SDUMP(:,:)
1259 REAL(r4) :: TDUMP(lxyzr)
1260 integer :: ieg, nxr, nyr, nzr
1261 logical :: if_byte_sw
1263 integer :: nxyz, nxyr, ierr, jnid, mtype, len, le1, ie
1274 allocate(sdump(lxyz1,lelt))
1277 if(ierr /= 0) call
exitti(
"Error in mapdmp")
1278 IF (nxr == nx1 .AND. nyr == ny1 .AND. nzr == nz1)
THEN
1279 CALL
copy4r(sdump(1,ieg),tdump,nxyz)
1282 call
mapab4r(sdump(1,ieg),tdump,nxr,1)
1293 IF (nid == 0 .AND. jnid /= 0)
THEN
1295 CALL
csend(mtype,tdump,le1,jnid,nullpid)
1296 CALL
crecv(mtype,dummy,le1)
1297 CALL
csend(mtype,tdump,len,jnid,nullpid)
1298 ELSEIF (nid /= 0 .AND. jnid == nid)
THEN
1300 CALL
crecv(mtype,dummy,le1)
1301 CALL
csend(mtype,tdump,le1,0,nullpid)
1302 CALL
crecv(mtype,tdump,len)
1308 IF (jnid == nid)
THEN
1309 allocate(sdump(lxyz1,lelt))
1312 IF (nxr == nx1 .AND. nyr == ny1 .AND. nzr == nz1)
THEN
1313 CALL
copy4r(sdump(1,ie),tdump,nxyz)
1315 call
mapab4r(sdump(1,ie),tdump,nxr,1)
1318 call
err_chk(ierr,
'Error using byte_reverse in mapdmp.$')
1332 use kinds, only : dp, r4
1333 use size_m
, only : nid, ndim
1334 use size_m
, only : nx1, ny1, nz1, lx1, ly1, lz1
1335 use wz_m, only : zgm1
1340 REAL(DP) :: X(nx1,ny1,nz1,nel)
1341 REAL(r4) :: Y(nxr,nxr,nxr,nel)
1343 integer,
parameter :: LXR=LX1+6
1344 integer,
parameter :: LYR=LY1+6
1345 integer,
parameter :: LZR=LZ1+6
1346 integer,
parameter :: LXYZR=LXR*LYR*LZR
1348 real(DP) :: xa(lxyzr) ,xb(lx1,ly1,lzr) ,xc(lxyzr) &
1349 , zgmr(lxr) ,wgtr(lxr)
1350 real(DP),
allocatable :: ires(:,:), itres(:,:)
1352 integer :: nzr, nyzr, nxy1, nxyzr
1353 integer :: ie, iz, izoff
1354 integer,
save :: NOLD = 0
1356 allocate(ires(lxr,lxr), itres(lxr,lxr))
1364 IF (nxr /= nold)
THEN
1366 CALL
zwgll(zgmr,wgtr,nxr)
1367 CALL
igllm(ires,itres,zgmr,zgm1,nxr,nx1,nxr,nx1)
1368 IF (nid == 0)
WRITE(6,10) nxr,nx1
1369 10
FORMAT(2x,
'Mapping restart data from Nold=',i2 &
1370 ,
' to Nnew=',i2,
'.')
1374 call
copy4r(xc,y(1,1,1,ie),nxyzr)
1375 CALL
mxm(ires,nx1,xc,nxr,xa,nyzr)
1377 izoff = 1 + (iz-1)*nx1*nxr
1378 CALL
mxm(xa(izoff),nx1,itres,nxr,xb(1,1,iz),ny1)
1381 CALL
mxm(xb,nxy1,itres,nzr,x(1,1,1,ie),nz1)
1383 CALL
copy(x(1,1,1,ie),xb,nxy1)
1394 use size_m
, only : nx1, ny1, nz1
1395 use input, only : ifmodel, ifkeps
1396 use nekuse, only : turbk, turbe, ux, uy, uz, temp
1398 use soln, only : vx, vy, vz, t, vxp, vyp, vzp, tp, jp
1399 use tstep, only : ifield, nelfld
1400 use turbo, only : ifldk, iflde
1403 integer :: nel, ijke, i, j, k, iel, ieg
1405 nel = nelfld(ifield)
1407 IF (ifmodel .AND. ifkeps .AND. ifield == ifldk)
THEN
1415 CALL useric(i,j,k,ieg)
1416 t(i,j,k,iel,ifield-1) = turbk
1422 ELSEIF (ifmodel .AND. ifkeps .AND. ifield == iflde)
THEN
1430 CALL useric(i,j,k,ieg)
1431 t(i,j,k,iel,ifield-1) = turbe
1445 CALL useric(i,j,k,ieg)
1451 t(i,j,k,iel,1) = temp
1453 IF (ifield == 1)
THEN
1457 ELSEIF (ifield == ifldmhd)
THEN
1462 t(i,j,k,iel,ifield-1) = temp
1466 ijke = i+nx1*((j-1)+ny1*((k-1) + nz1*(iel-1)))
1467 IF (ifield == 1)
THEN
1472 tp(ijke,ifield-1,jp) = temp
1487 use kinds, only : dp, r4
1491 real(r4) :: bytetest
1495 real(r4),
save :: test_pattern
1496 real(DP) :: eps, etest
1498 test_pattern = 6.54321_r4
1500 etest = abs(test_pattern-bytetest)
1514 use kinds, only : dp
1515 use size_m
, only : lx1, ly1, lz1, lelt, lx3
1516 use size_m
, only : nx1, ny1, nz1, nelt, nid
1521 real(DP),
allocatable :: XM3 (:,:,:,:), YM3(:,:,:,:), ZM3(:,:,:,:)
1525 if(nid == 0)
write(6,*)
'regenerate geometry data',icall
1527 ntot = nx1*ny1*nz1*nelt
1529 if (lx3 == lx1)
then
1532 allocate(xm3(lx1,ly1,lz1,lelt), ym3(lx1,ly1,lz1,lelt), zm3(lx1,ly1,lz1,lelt))
1534 call map13_all(xm3,xm1)
1535 call map13_all(ym3,ym1)
1536 if (if3d) call map13_all(zm3,zm1)
1537 CALL
geom1(xm3,ym3,zm3)
1539 deallocate(xm3,ym3,zm3)
1550 write(6,*)
'done :: regenerate geometry data',icall
1560 use kinds, only : dp
1561 use size_m
, only : nx1, ny1, nz1, nelv, nelt
1562 use size_m
, only : lx1, ly1, lz1, lelt
1563 use input, only : ifflow
1564 use soln, ONLY : vmult, tmult
1565 use tstep, only : ifield
1568 real(DP) :: u(lx1,ly1,lz1,lelt)
1570 integer :: ifieldo, ntot
1576 ntot = nx1*ny1*nz1*nelv
1581 ntot = nx1*ny1*nz1*nelt
1583 u = u * tmult(:,:,:,:,1)
1588 end subroutine dsavg
1593 use size_m
, only : nid
1594 use iso_c_binding
, only : c_null_char
1596 use tstep, only : istep
1601 character(132) :: hname
1603 character(8) :: fmt,s8
1604 character(8),
save :: eight =
"????????"
1606 character(132) :: fname
1608 integer :: len, ipass, k, i1, ierr
1611 call
chcopy(fname,hname,len)
1612 fname(len+1:len+1) = c_null_char
1616 i1 =
indx1(fname,eight,k)
1619 1
format(
'(i',i1,
'.',i1,
')')
1621 call
chcopy(fname(i1:),s8,k)
1630 if(nid == 0)
write(6,6) istep,(fname(k:k),k=1,len)
1631 6
format(1i8,
' OPEN: ',132a1)
1635 write(6,6) nid,istep,(fname(k:k),k=1,len)
1636 6
format(2i8,
' OPEN: ',132a1)
integer function gllel(ieg)
subroutine nekuic
User specified fortran function (=0 if not specified)
subroutine mapab4r(x, y, nxr, nel)
Interpolate Y(NXR,NYR,NZR,NEL) to X(NX1,NY1,NZ1,NEL) (assumes that NXR=NYR=NZR, or NXR=NYR...
subroutine dssum(u)
Direct stiffness sum.
subroutine bcast(buf, len)
subroutine lbcast(ifif)
Broadcast logical variable to all processors.
integer function i1_from_char(s1)
subroutine slogic(iffort, ifrest, ifprsl, nfiles)
Set up logicals for initial conditions.
subroutine, public load_ic()
Load initial condition from a previous multi-file output.
subroutine mxm(a, n1, b, n2, c, n3)
Compute matrix-matrix product C = A*B.
real(dp) function glmax(a, n)
subroutine mbyte_open(hname, fid, ierr)
open blah000.fldnn
subroutine opcopy(a1, a2, a3, b1, b2, b3)
subroutine crecv(mtype, buf, lenm)
subroutine geom_reset(icall)
Generate geometry data.
subroutine ortho(respr)
Orthogonalize the residual in the pressure solver with respect to (1,1,...,1)T (only if all Dirichlet...
subroutine dsavg(u)
Take direct stiffness avg of u.
logical function if_byte_swap_test(bytetest, ierr)
integer function indx1(S1, S2, L2)
subroutine setics
Set initial conditions.
subroutine opcolv(a1, a2, a3, c)
subroutine setup_convect(igeom)
integer function indx_cut(S1, S2, L2)
INDX_CUT is returned with the location of S2 in S1 (0 if not found) S1 is returned with 1st occurance...
integer function lglel(iel)
subroutine sfastax()
For undeformed elements, set up appropriate elemental matrices and geometric factors for fast evaluat...
integer function gllnid(ieg)
subroutine sioflag(ndumps, fname, rsopts)
Set IO flags according to Restart Options File, RSOPTS.
logical function ifgtrl(VALUE, LINE)
Read VALUE from LINE and set IFGTRL to .TRUE. if successful, IFGTRL to .FALSE. otherwise. This complicated function is necessary thanks to the Ardent, which won't allow free formatted reads (*) from internal strings!
subroutine capit(lettrs, n)
Capitalizes string of length n.
subroutine blank(A, N)
blank a string
subroutine restart_driver(nfiles)
driver for restarts (1) Open restart file(s) (2) Check previous spatial discretization (3) Map (K1...
subroutine copy4r(a, b, n)
subroutine, public zwgll(Z, W, NP)
subroutine csplit(s0, s1, s2, l0)
split string S1 into two parts, delimited by S2.
subroutine setinvm()
Invert the mass matrix. 1) Copy BM1 to BINVM1 2) Perform direct stiffness summation on BINVM1 3) Comp...
subroutine nekasgn(IX, IY, IZ, IEL)
Assign NEKTON variables for definition (by user) of boundary conditions at collocation point (IX...
subroutine opdssum(a, b, c)
subroutine mapdmp(sdump, tdump, ieg, nxr, nyr, nzr, if_byte_sw)
subroutine volume
Compute the volume based on mesh M1 and mesh M2.
subroutine geom2
Routine to generate all elemental geometric data for mesh 2 (Gauss-Legendre mesh). RXM2, RYM2, RZM2 - dr/dx, dr/dy, dr/dz SXM2, SYM2, SZM2 - ds/dx, ds/dy, ds/dz TXM2, TYM2, TZM2 - dt/dx, dt/dy, dt/dz JACM2 - Jacobian BM2 - Mass matrix.
subroutine chcopy(a, b, n)
subroutine err_chk(ierr, istring)
subroutine ljust(string)
left justify string
integer function ltrunc(string, l)
subroutine geom1()
Routine to generate all elemental geometric data for mesh 1. Velocity formulation : global-to-local m...
subroutine setdef()
Set up deformed element logical switches.
subroutine exitti(stringi, idata)
subroutine lagvel
Keep old velocity field(s)
subroutine csend(mtype, buf, len, jnid, jpid)
subroutine byte_open_mpi(fname, mpi_fh, ierr)
subroutine, public igllm(I12, IT12, Z1, Z2, NZ1, NZ2, ND1, ND2)