7 use size_m
, only : lx1, ly1, lz1, lelv, nid
9 use input, only : schfle, ifschclob, ifpsco
10 use tstep, only : iostep, timeio, istep, nsteps, lastep, time, ntdump
14 character(3) :: prefin
19 character(3) :: prefix
21 logical,
save :: ifdoit = .FALSE.
23 real(DP),
allocatable :: pm1(:,:,:,:)
27 integer,
save :: maxstep = 999999999
28 integer :: ierr, iiidmp, idummy
31 if (iostep < 0 .OR. timeio < 0)
return
42 if (prefin ==
'his') ifhis = .true.
43 if (prefix ==
'his') prefix =
' '
48 write(6,*)
'schfile:',schfle
50 open(unit=26,file=schfle,err=44,form=
'formatted')
52 open(unit=26,file=schfle,err=44,form=
'formatted', &
59 call
err_chk(ierr,
'.sch file already exists. Use IFSCHCLOB=F to &
60 & disable this check BUT BEWARE!!!!!!$')
63 allocate(pm1(lx1,ly1,lz1,lelv))
66 if(istep >= nsteps) lastep=1
70 if(time >= (ntdump + 1) * timeio)
then
76 if (istep > 0 .AND. iostep > 0)
then
77 if(mod(istep,iostep) == 0) ifdoit= .true.
83 if (nid == 0 .AND. (mod(istep,10) == 0 .OR. istep < 200))
then
84 open(unit=87,file=
'ioinfo',status=
'old',err=88)
85 read(87,*,end=87,err=87) idummy
86 if (iiidmp == 0) iiidmp=idummy
95 if (iiidmp /= 0)
write(6,*)
'Output:',iiidmp
99 call
gop(tdmp,tdmp(3),
'+ ',1)
101 if (iiidmp < 0) maxstep=abs(iiidmp)
102 if (istep >= maxstep .OR. iiidmp == -2) lastep=1
103 if (iiidmp == -2)
return
104 if (iiidmp < 0) iiidmp = 0
106 if (ifdoin) ifdoit= .true.
107 if (iiidmp /= 0 .OR. lastep == 1 .OR. timdump == 1.) ifdoit= .true.
110 if (ifdoit .AND. nid == 0)
write(6,*)
'call outfld: ifpsco:',ifpsco(1)
111 if (ifdoit) call
outfld(prefix, pm1)
117 if (lastep == 1 .AND. nid == 0)
close(unit=26)
130 subroutine prepost_map(isave, pm1) ! isave=0-->fwd, isave=1-->bkwd
132 use size_m
, only : lx1, ly1, lz1, lelv, ly2, lz2
133 use size_m
, only : nx1, ny1, nz1, nelv, nx2, ny2, nz2
134 use input, only : ifaxis, ifsplit
135 use ixyz, only : ixm21, iytm21, iztm21
137 use tstep, only : if_full_pres
140 integer,
intent(in) :: isave
141 real(DP),
intent(out) :: pm1 (lx1,ly1,lz1,lelv)
144 real(DP) :: pa(lx1,ly2,lz2),pb(lx1,ly1,lz2)
146 integer :: ntot1, nyz2, nxy1, nxyz, nxyz2, iz
151 write(*,*)
"Oops: ifaxis"
153 ntotm1 = nx1*ny1*nelt
154 call
copy(yax,ym1,ntotm1)
157 call
mxm(ym1(1,1,1,e),nx1,iatjl1,ny1,pb,ny1)
158 call
copy(ym1(1,1,1,e),pb,nx1*ny1)
162 ntotm1 = nx1*ny1*nelv
163 ntotm2 = nx2*ny2*nelv
164 call
copy(vxax,vx,ntotm1)
165 call
copy(vyax,vy,ntotm1)
166 call
copy(prax,pr,ntotm2)
169 call
mxm(vx(1,1,1,e),nx1,iatjl1,ny1,pb,ny1)
170 call
copy(vx(1,1,1,e),pb,nx1*ny1)
171 call
mxm(vy(1,1,1,e),nx1,iatjl1,ny1,pb,ny1)
172 call
copy(vy(1,1,1,e),pb,nx1*ny1)
173 call
mxm(pr(1,1,1,e),nx2,iatjl2,ny2,pb,ny2)
174 call
copy(pr(1,1,1,e),pb,nx2*ny2)
179 ntotm1 = nx1*ny1*nelt
180 do 15 ifldt=1,npscal+1
181 call
copy(tax(1,1,1,ifldt),t(1,1,1,1,ifldt),ntotm1)
185 do 25 ifldt=1,npscal+1
186 call
mxm(t(1,1,1,e,ifldt),nx1,iatjl1,ny1, &
188 call
copy(t(1,1,1,e,ifldt),pb,nx1*ny1)
197 ntot1 = nx1*ny1*nz1*nelv
204 call
copy(pm1,pr,ntot1)
205 elseif (if_full_pres)
then
208 call
copy(pm1(1,1,1,e),pr(1,1,1,e),nxyz2)
212 call
mxm(ixm21,nx1,pr(1,1,1,e),nx2,pa(1,1,1),nyz2)
214 call
mxm(pa(1,1,iz),nx1,iytm21,ny2,pb(1,1,iz),ny1)
216 call
mxm(pb(1,1,1),nxy1,iztm21,nz2,pm1(1,1,1,e),nz1)
222 write(*,*)
"Oops: ifaxis"
225 call
copy(ym1,yax,ntot1)
229 call
copy(vx,vxax,ntot1)
230 call
copy(vy,vyax,ntot1)
231 call
copy(pr,prax,ntot2)
235 do 3000 ifldt=1,npscal+1
236 call
copy(t(1,1,1,1,ifldt),tax(1,1,1,ifldt),ntot1)
250 use size_m
, only : lx1, ly1, lz1, lelv, nid
251 use input, only : param
252 use tstep, only : istep, time
257 character(3),
intent(in) :: prefix
259 real(DP),
intent(in) :: pm1 (lx1,ly1,lz1,lelv)
264 WRITE(6,1001) istep,time
265 1001
FORMAT(/,i9,1pe12.4,
' Write checkpoint:')
276 write(*,*)
"Oops: p66 /= 6"
286 nopen(iprefix)=nopen(iprefix)+1
288 if (prefix ==
' ' .AND. nopen(iprefix) == 1) ifxyo = .true.
290 if (prefix ==
'rst' .AND. max_rst > 0) &
291 nopen(iprefix) =
mod1(nopen(iprefix),max_rst)
293 call file2(nopen(iprefix),prefix)
295 open(unit=24,file=fldfle,form=
'formatted',status=
'unknown')
299 call
chcopy(fldfile2,fldfle,len)
302 call
blank(fhdfle,132)
305 call
bcast(ifxyo,lsize)
307 call
err_chk(ierr,
'Error opening file in outfld. Abort. $')
310 CALL
blank(excode,30)
313 if (mod(p66,1.0) == 0.0)
then
342 if (ifpsco(iip))
then
343 write(excode(iip+
i) ,
'(i1)') iip
344 write(excode(iip+
i+1),
'(a1)')
' '
369 if(ifpsco(k)) npscalo = npscalo + 1
371 IF (npscalo > 0)
THEN
373 WRITE(excode(
i+1),
'(I1)') npscalo/10
374 WRITE(excode(
i+2),
'(I1)') npscalo-(npscalo/10)*10
382 if (nid == 0) call dump_header(excode,p66,ierr)
383 call
err_chk(ierr,
'Error dumping header in outfld. Abort. $')
397 call fill_tmp(tdump,
id,ie)
402 call
csend(mtype,dum1,wdsize,jnid,nullpid)
403 call
crecv(mtype,tdump,len)
405 if(ierr == 0) call out_tmp(
id,p66,ierr)
406 elseif (nid == jnid)
then
407 call fill_tmp(tdump,
id,ie)
412 call
crecv(mtype,dum1,wdsize)
413 call
csend(mtype,tdump,len,node0,nullpid)
416 call
err_chk(ierr,
'Error writing file in outfld. Abort. $')
420 if (nid == 0) call close_fld(p66,ierr)
421 call
err_chk(ierr,
'Error closing file in outfld. Abort. $')
431 use size_m
, only : lx1, ly1, lz1, lelv
432 use size_m
, only : nx1, ny1, nz1, nelv, nid
433 use geom, only : xm1, ym1, zm1
434 use input, only : param, nhis, hcode, lochis, if3d, qinteg
436 use soln, only : jp, vx, vy, vz, t
437 use tstep, only : istep, dt, time
440 real(DP) :: pm1 (lx1,ly1,lz1,lelv)
442 real(DP) :: hdump(25)
443 real(DP) :: xpart(10),ypart(10),zpart(10)
446 integer,
save :: icalld = 0
447 integer :: iohis, nvar, ih, ii, ihisps, mtype, len, iobj, isk, iq
448 integer :: ipart, i, iel, k, j, ip, kp, ielp, ix, iy, iz, ieg, jnid, ie
449 real(DP) :: rmin, x, y, z, r, one
450 real(DP),
external :: glmax
453 if (param(52) >= 1) iohis = int(param(52))
454 if (mod(istep,iohis) == 0 .AND. ifhis)
then
458 IF(hcode(10,i) ==
'P')
then
459 if (ipart <= 10) ipart=ipart+1
463 xm1(lochis(1,i),lochis(2,i),lochis(3,i),lochis(4,i))
465 ym1(lochis(1,i),lochis(2,i),lochis(3,i),lochis(4,i))
467 zm1(lochis(1,i),lochis(2,i),lochis(3,i),lochis(4,i))
471 ip = 1; jp = 1; kp = 1; ielp = 1
479 r=sqrt( (x-xpart(ipart))**2 + (y-ypart(ipart))**2 &
480 + (z-zpart(ipart))**2 )
492 xpart(ipart) = xpart(ipart) + dt * vx(ip,jp,kp,ielp)
493 ypart(ipart) = ypart(ipart) + dt * vy(ip,jp,kp,ielp)
494 zpart(ipart) = zpart(ipart) + dt * vz(ip,jp,kp,ielp)
498 WRITE(26,
'(4G14.6,A10)')time,xpart(ipart),ypart(ipart) &
499 ,zpart(ipart),
' Particle'
503 IF(hcode(10,i) ==
'H')
then
517 if (icalld == 0)
then
518 one = glmax((/one/),1)
519 IF (nid == jnid)
then
520 IF (
np > 1 .AND. .NOT. if3d) &
521 WRITE(6,22) nid,i,ix,iy,ie,ieg &
522 ,xm1(ix,iy,iz,ie),ym1(ix,iy,iz,ie)
523 IF (
np > 1 .AND. if3d) &
524 WRITE(6,23) nid,i,ix,iy,iz,ie,ieg,xm1(ix,iy,iz,ie) &
525 ,ym1(ix,iy,iz,ie),zm1(ix,iy,iz,ie)
526 IF (
np == 1 .AND. .NOT. if3d) &
527 WRITE(6,32) i,ix,iy,ie,ieg &
528 ,xm1(ix,iy,iz,ie),ym1(ix,iy,iz,ie)
529 IF (
np == 1 .AND. if3d) &
530 WRITE(6,33) i,ix,iy,iz,ie,ieg,xm1(ix,iy,iz,ie) &
531 ,ym1(ix,iy,iz,ie),zm1(ix,iy,iz,ie)
532 22
FORMAT(i6,
' History point:',i3,
' at (',2(i2,
','), &
533 & 2(i4,
','),
'); X,Y,Z = (',g12.4,
',',g12.4,
',',g12.4,
').')
534 23
FORMAT(i6,
' History point:',i3,
' at (',3(i2,
','), &
535 & 2(i4,
','),
'); X,Y,Z = (',g12.4,
',',g12.4,
',',g12.4,
').')
536 32
FORMAT(2x,
' History point:',i3,
' at (',2(i2,
','), &
537 & 2(i4,
','),
'); X,Y,Z = (',g12.4,
',',g12.4,
',',g12.4,
').')
538 33
FORMAT(2x,
' History point:',i3,
' at (',3(i2,
','), &
539 & 2(i4,
','),
'); X,Y,Z = (',g12.4,
',',g12.4,
',',g12.4,
').')
544 IF(hcode(1,i) ==
'U')
then
546 hdump(nvar)=vx(ix,iy,iz,ie)
547 elseif(hcode(1,i) ==
'X')
then
549 hdump(nvar)=xm1(ix,iy,iz,ie)
551 IF(hcode(2,i) ==
'V')
then
553 hdump(nvar)=vy(ix,iy,iz,ie)
554 elseif(hcode(2,i) ==
'Y')
then
556 hdump(nvar)=ym1(ix,iy,iz,ie)
558 IF(hcode(3,i) ==
'W')
then
560 hdump(nvar)=vz(ix,iy,iz,ie)
561 elseif(hcode(3,i) ==
'Z')
then
563 hdump(nvar)=zm1(ix,iy,iz,ie)
565 IF(hcode(4,i) ==
'P')
then
567 hdump(nvar)=pm1(ix,iy,iz,ie)
569 IF(hcode(5,i) ==
'T')
then
571 hdump(nvar)=t(ix,iy,iz,ie,1)
573 IF(hcode(6,i) /=
' ' .AND. hcode(6,i) /=
'0')
then
574 READ(hcode(6,i),
'(I1)',err=13)ihisps
578 hdump(nvar)=t(ix,iy,iz,ie,ihisps+1)
588 IF (nvar > 0 .AND. nid /= 0 .AND. jnid == nid) &
589 call
csend(mtype,hdump,len,node0,nullpid)
592 IF (nvar > 0 .AND. nid == 0 .AND. jnid /= nid) &
593 call
crecv(mtype,hdump,len)
595 IF (nvar > 0 .AND. nid == 0) &
596 WRITE(26,
'(1p6e16.8)')time,(hdump(ii),ii=1,nvar)
607 IF(hcode(10,ih) ==
'I')
then
611 IF (hcode(iq,ih) /=
' ') isk=isk + 1
614 IF (hcode(iq,ih) /=
' ') isk=isk + 1
617 WRITE(26,
'(1p6e16.8)')time,(qinteg(ii,iobj),ii=1,isk)
631 use kinds, only : dp, r4
633 integer,
intent(in) :: n
634 REAL(r4),
intent(out) :: A(n)
635 REAL(DP),
intent(in) :: B(n)
638 a(i) =
real(B(I), kind=r4)
645 use kinds, only : dp, r4
660 character(3) :: prefix
663 character(3),
save :: prefixes(99)
664 data prefixes /99*
'...'/
665 integer,
save :: nprefix = 0
670 if (prefix == prefixes(i))
then
678 nprefix = nprefix + 1
679 prefixes(nprefix) = prefix
684 if (nprefix > 99 .OR. nprefix > imax)
then
685 write(6,*)
'Hey! nprefix too big! ABORT in i_find_prefix' &
696 use kinds, only : dp, i8
698 use size_m
, only : lx1, ly1, lz1, lelv, ldimt, lxo
699 use size_m
, only : nx1, ny1, nz1, nelt, nid, ndim
700 use restart, only : nxo, nyo, nzo, nrg, iheadersize, pid0, nelb, wdsizo
701 use restart, only : ifh_mbyte, nfileo
702 use geom, only : xm1, ym1, zm1
703 use input, only : ifxyo, ifxyo_, ifreguo, if3d, ifvo, ifpo, ifto, ifpsco
704 use parallel, only : isize, nelgt, lsize
705 use soln, only : vx, vy, vz, t
706 use tstep, only : istep, time
709 character(3),
intent(in) :: prefix
711 real(DP),
intent(in) :: pm1 (lx1,ly1,lz1,lelv)
713 integer(i8) :: offs0,offs,stride,strideB,nxyzo8
716 real(DP) :: tiostart, dnbyte, tio
717 real(DP),
external :: glsum
718 integer :: nout, ierr, ioflds, k
730 if (nid == 0)
write(6,*) &
731 'WARNING: nrg too large, reset to lxo!'
739 offs0 = iheadersize + 4 + isize*nelgt
742 if (nid == pid0)
then
745 call
err_chk(ierr,
'Error opening file in mfo_open_files. $')
746 call
bcast(ifxyo_,lsize)
753 strideb = nelb * nxyzo8*wdsizo
754 stride = nelgt* nxyzo8*wdsizo
760 offs = offs0 + ndim*strideb
763 write(*,*)
"Oops: ifreguo"
765 call map2reg(ur1,nrg,xm1,nout)
766 call map2reg(ur2,nrg,ym1,nout)
767 if (if3d) call map2reg(ur3,nrg,zm1,nout)
768 call
mfo_outv(ur1,ur2,ur3,nout,nxo,nyo,nzo)
771 call
mfo_outv(xm1,ym1,zm1,nout,nxo,nyo,nzo)
773 ioflds = ioflds + ndim
776 offs = offs0 + ioflds*stride + ndim*strideb
779 write(*,*)
"Oops: ifreguo"
781 call map2reg(ur1,nrg,vx,nout)
782 call map2reg(ur2,nrg,vy,nout)
783 if (if3d) call map2reg(ur3,nrg,vz,nout)
784 call
mfo_outv(ur1,ur2,ur3,nout,nxo,nyo,nzo)
787 call
mfo_outv(vx,vy,vz,nout,nxo,nyo,nzo)
789 ioflds = ioflds + ndim
792 offs = offs0 + ioflds*stride + strideb
795 write(*,*)
"Oops: ifreguo"
797 call map2reg(ur1,nrg,pm1,nout)
806 offs = offs0 + ioflds*stride + strideb
809 write(*,*)
"Oops: ifreguo"
811 call map2reg(ur1,nrg,t,nout)
821 offs = offs0 + ioflds*stride + strideb
824 write(*,*)
"Oops: ifreguo"
826 call map2reg(ur1,nrg,t(1,1,1,1,k+1),nout)
830 call
mfo_outs(t(1,1,1,1,k+1),nout,nxo,nyo,nzo)
835 dnbyte = 1.*ioflds*nout*wdsizo*nxo*nyo*nzo
838 offs0 = offs0 + ioflds*stride
844 offs = offs0 + ndim*strideb
847 ioflds = ioflds + ndim
850 offs = offs0 + ioflds*stride + ndim*strideb
853 ioflds = ioflds + ndim
856 offs = offs0 + ioflds*stride + strideb
862 offs = offs0 + ioflds*stride + strideb
868 offs = offs0 + ioflds*stride + strideb
870 if(ifpsco(k)) call
mfo_mdatas(t(1,1,1,1,k+1),nout)
873 dnbyte = dnbyte + 2.*ioflds*nout*wdsizo
877 if (nid == pid0)
then
884 call
err_chk(ierr,
'Error closing file in mfo_outfld. Abort. $')
887 dnbyte = glsum(dnbyte,1)
888 dnbyte = dnbyte + iheadersize + 4. + isize*nelgt
889 dnbyte = dnbyte/1024/1024
890 if(nid == 0)
write(6,7) istep,time,dnbyte,dnbyte/tio, &
892 7
format(/,i9,1pe12.4,
' done :: Write checkpoint',/, &
893 & 30x,
'file size = ',3pg14.2,
'MB',/, &
894 & 30x,
'avg data-throughput = ',0pf14.1,
'MB/s',/, &
895 & 30x,
'io-nodes = ',i5,/)
905 use size_m
, only : nid, lxo, nelt
906 use input, only : param, ifreguo
908 use restart, only : ifdiro, nfileo, nproc_o
909 use restart, only : fid0, pid0, pid1, wdsizo, nrg, nelb, pid00
913 integer,
external :: igl_running_sum
914 real(DP),
external :: glmin
921 nfileo = abs(param(65))
922 if(nfileo == 0) nfileo = 1
923 if(
np < nfileo) nfileo=
np
924 nproc_o =
np / nfileo
927 pid1 = min(
np-1,pid0+nproc_o-1)
938 if(param(65) < 0) ifdiro = .true.
939 nfileo = int(abs(param(65)))
940 if(nfileo == 0) nfileo = 1
941 if(
np < nfileo) nfileo=
np
942 nproc_o =
np / nfileo
945 pid1 = min(
np-1,pid0+nproc_o-1)
951 if (param(63) > 0) wdsizo = 8
952 if (wdsizo > wdsize)
then
953 if(nid == 0)
write(6,*)
'ABORT: wdsizo > wdsize!'
962 nelb = igl_running_sum(nn)
965 pid00 = int(glmin((/
real(pid0)/),1))
973 use input, only : ifreguo, ifxyo_, series, param
974 use restart, only : max_rst, nfileo, ifdiro, fid0
978 character(3) :: prefix
981 character(132) :: fname
982 character(1) :: fnam1(132)
983 equivalence(fnam1,fname)
985 character(6),
save :: six =
"??????"
988 character(1),
save :: slash =
'/', dot =
'.'
990 logical,
save :: init = .false.
991 integer,
save :: nopen(99,2) = 0
993 integer :: iprefix, nfld, k, len, ndigit
994 integer,
external :: i_find_prefix, mod1
998 nopen = int(param(69))
1002 call
blank(fname,132)
1004 iprefix = i_find_prefix(prefix,99)
1006 nopen(iprefix,2) = nopen(iprefix,2)+1
1007 nfld = nopen(iprefix,2)
1009 nopen(iprefix,1) = nopen(iprefix,1)+1
1010 nfld = nopen(iprefix,1)
1014 if (prefix ==
'rst' .AND. max_rst > 0) nfld = mod1(nfld,max_rst)
1017 if (prefix ==
' ' .AND. nfld == 1) ifxyo_ = .true.
1024 ndigit = int(log10(rfileo) + 1)
1028 call
chcopy(fnam1(1),
'A',1)
1029 call
chcopy(fnam1(2),six,ndigit)
1031 call
chcopy(fnam1(k),slash,1)
1035 if (prefix(1:1) /=
' ' .AND. prefix(2:2) /=
' ' .AND. &
1036 prefix(3:3) /=
' ')
then
1037 call
chcopy(fnam1(k),prefix,3)
1042 call
chcopy(fnam1(k),series,len)
1047 call
chcopy(fnam1(k),
'_reg',len)
1051 call
chcopy(fnam1(k),six,ndigit)
1054 call
chcopy(fnam1(k ),dot,1)
1055 call
chcopy(fnam1(k+1),
'f',1)
1060 call
chcopy(fnam1(k),str,5)
1128 character(3) :: prefix
1129 character(16),
save :: kst =
'0123456789abcdef'
1130 character(1) :: ks1(0:15),kin
1131 equivalence(ks1,kst)
1133 integer :: kfld, nfld, nfln
1134 integer,
external :: mod1
1136 if (
indx1(prefix,
'rs',2) == 1)
then
1140 if (ks1(kfld) == kin) goto 10
1142 10
if (kfld == 16) kfld=4
1143 nfln = mod1(nfld,kfld)
1144 write(6,*) nfln,nfld,kfld,
' kfld'
1153 use kinds, only : dp
1154 use input, only : ifto
1157 real(DP) :: v1(*),v2(*),v3(*),vp(*),vt(*)
1158 character(3) :: name3
1163 call
outpost2(v1,v2,v3,vp,vt,itmp,name3)
1170 use kinds, only : dp
1171 use size_m
, only : lx1, ly1, lz1, lelt, lelv, ldimt
1172 use size_m
, only : lx2, ly2, lz2
1173 use size_m
, only : nx1, ny1, nz1, nx2, ny2, nz2, nelv, nelt
1175 use input, only : ifto, ifpsco
1176 use soln, only : vx, vy, vz, pr, t
1179 integer,
parameter :: ltot1=lx1*ly1*lz1*lelt
1180 integer,
parameter :: ltot2=lx2*ly2*lz2*lelv
1181 real(DP),
allocatable :: w1(:), w2(:), w3(:), wp(:), wt(:,:)
1182 real(DP) :: v1(1),v2(1),v3(1),vp(1),vt(ltot1,1)
1183 character(3) :: name3
1184 logical :: if_save(ldimt)
1187 integer :: ntot1, ntot1t, ntot2, nfldt, i
1188 allocate(w1(ltot1),w2(ltot1),w3(ltot1),wp(ltot2),wt(ltot1,ldimt))
1192 ntot1 = nx1*ny1*nz1*nelv
1193 ntot1t = nx1*ny1*nz1*nelt
1194 ntot2 = nx2*ny2*nz2*nelv
1196 if(nfldt > ldimt)
then
1197 write(6,*)
'ABORT: outpost data too large (nfldt>ldimt)!'
1202 call
copy(w1,vx,ntot1)
1203 call
copy(w2,vy,ntot1)
1204 call
copy(w3,vz,ntot1)
1205 call
copy(wp,pr,ntot2)
1207 call
copy(wt(1,i),t(1,1,1,1,i),ntot1t)
1211 call
copy(vx,v1,ntot1)
1212 call
copy(vy,v2,ntot1)
1213 call
copy(vz,v3,ntot1)
1214 call
copy(pr,vp,ntot2)
1216 call
copy(t(1,1,1,1,i),vt(1,i),ntot1t)
1222 if(nfldt > 0) ifto = .true.
1224 if_save(i+1) = ifpsco(i)
1226 if(i+1 <= nfldt) ifpsco(i) = .true.
1235 ifpsco(i) = if_save(i+1)
1239 call
copy(vx,w1,ntot1)
1240 call
copy(vy,w2,ntot1)
1241 call
copy(vz,w3,ntot1)
1242 call
copy(pr,wp,ntot2)
1244 call
copy(t(1,1,1,1,i),wt(1,i),ntot1t)
1254 use kinds, only : dp, r4
1255 use size_m
, only : lx1, ly1, lz1, nx1, ny1, nz1, ndim, nelt, nid, lelt
1256 use input, only : if3d
1257 use restart, only : pid0, pid1
1260 real(DP),
intent(in) :: u(lx1*ly1*lz1,*),v(lx1*ly1*lz1,*),w(lx1*ly1*lz1,*)
1261 integer,
intent(in) :: nel
1263 real(r4) :: buffer(1+6*lelt)
1265 integer :: e, inelp, mtype, k, idum, nout, j, ierr, leo, len, nxyz, n
1271 len = 4 + 4*(n*lelt)
1272 leo = 4 + 4*(n*nelt)
1276 if (nid == pid0)
then
1279 buffer(j+0) =
real(minval(u(:,e)), kind=r4)
1280 buffer(j+1) =
real(maxval(u(:,e)), kind=r4)
1281 buffer(j+2) =
real(minval(v(:,e)), kind=r4)
1282 buffer(j+3) =
real(maxval(v(:,e)), kind=r4)
1285 buffer(j+0) =
real(minval(w(:,e)), kind=r4)
1286 buffer(j+1) =
real(maxval(w(:,e)), kind=r4)
1305 call
csend(mtype,idum,4,k,0)
1306 call
crecv(mtype,buffer,len)
1307 inelp = int(buffer(1))
1322 buffer(j+0) =
real(minval(u(:,e)), kind=r4)
1323 buffer(j+1) =
real(maxval(u(:,e)), kind=r4)
1324 buffer(j+2) =
real(minval(v(:,e)), kind=r4)
1325 buffer(j+3) =
real(maxval(v(:,e)), kind=r4)
1328 buffer(j+0) =
real(minval(w(:,e)), kind=r4)
1329 buffer(j+1) =
real(maxval(w(:,e)), kind=r4)
1336 call
crecv(mtype,idum,4)
1337 call
csend(mtype,buffer,leo,pid0,0)
1340 call
err_chk(ierr,
'Error writing data to .f00 in mfo_mdatav. $')
1347 use kinds, only : dp, r4
1348 use size_m
, only : lx1, ly1, lz1, lelt, nx1, ny1, nz1, nelt, nid
1349 use restart, only : pid0, pid1
1352 real(DP),
intent(in) :: u(lx1*ly1*lz1,*)
1353 integer,
intent(in) :: nel
1355 real(r4) :: buffer(1+2*lelt)
1357 integer :: e, inelp, mtype, k, idum, nout, j, ierr, leo, len, n, nxyz
1363 len = 4 + 4*(n*lelt)
1364 leo = 4 + 4*(n*nelt)
1368 if (nid == pid0)
then
1371 buffer(j+0) =
real(minval(u(:,e)), kind=r4)
1372 buffer(j+1) =
real(maxval(u(:,e)), kind=r4)
1389 call
csend(mtype,idum,4,k,0)
1390 call
crecv(mtype,buffer,len)
1391 inelp = int(buffer(1))
1406 buffer(j+0) =
real(minval(u(:,e)), kind=r4)
1407 buffer(j+1) =
real(maxval(u(:,e)), kind=r4)
1413 call
crecv(mtype,idum,4)
1414 call
csend(mtype,buffer,leo,pid0,0)
1417 call
err_chk(ierr,
'Error writing data to .f00 in mfo_mdatas. $')
1425 use kinds, only : dp, r4
1426 use size_m
, only : nid, lelt, lxo
1427 use restart, only : wdsizo, pid0, pid1
1430 integer,
intent(in) :: nel, mx, my, mz
1431 real(DP),
intent(in) :: u(mx,my,mz,1)
1433 real(r4),
allocatable :: u4(:)
1434 real(DP),
allocatable :: u8(:)
1436 integer :: nxyz, len, leo, ntot, idum, ierr, nout, k, mtype
1439 if(mx > lxo .OR. my > lxo .OR. mz > lxo)
then
1440 if(nid == 0)
write(6,*)
'ABORT: lxo too small'
1445 len = 8 + 8*(lelt*nxyz)
1446 leo = 8 + wdsizo*(nel*nxyz)
1452 if (wdsizo == 4)
then
1453 allocate(u4(2+lxo*lxo*lxo*2*lelt))
1455 allocate(u8(1+lxo*lxo*lxo*1*lelt))
1458 if (nid == pid0)
then
1460 if (wdsizo == 4)
then
1464 call
copy(u8,u,ntot)
1468 if(wdsizo == 4 .and. ierr == 0)
then
1469 nout = wdsizo/4 * ntot
1471 elseif(ierr == 0)
then
1472 nout = wdsizo/4 * ntot
1480 call
csend(mtype,idum,4,k,0)
1482 if (wdsizo == 4 .AND. ierr == 0)
then
1483 call
crecv(mtype,u4,len)
1484 nout = wdsizo/4 * nxyz * int(u4(1))
1486 elseif(ierr == 0)
then
1487 call
crecv(mtype,u8,len)
1488 nout = wdsizo/4 * nxyz * int(u8(1))
1496 if (wdsizo == 4)
then
1498 call
copyx4(u4(3),u,ntot)
1500 call
crecv(mtype,idum,4)
1501 call
csend(mtype,u4,leo,pid0,0)
1504 call
copy(u8(2),u,ntot)
1506 call
crecv(mtype,idum,4)
1507 call
csend(mtype,u8,leo,pid0,0)
1512 call
err_chk(ierr,
'Error writing data to .f00 in mfo_outs. $')
1520 use kinds, only : dp, r4
1521 use size_m
, only : nid, ndim, lxo, lelt
1522 use input, only : if3d
1523 use restart, only : wdsizo, pid0, pid1
1526 integer,
intent(in) :: mx, my, mz
1527 real(DP),
intent(in) :: u(mx*my*mz,*),v(mx*my*mz,*),w(mx*my*mz,*)
1529 real(r4),
allocatable :: u4(:)
1530 real(DP),
allocatable :: u8(:)
1532 integer :: nxyz, len, leo, nel, idum, ierr
1533 integer :: j, iel, nout, k, mtype
1536 if(mx > lxo .OR. my > lxo .OR. mz > lxo)
then
1537 if(nid == 0)
write(6,*)
'ABORT: lxo too small'
1542 len = 8 + 8*(lelt*nxyz*ndim)
1543 leo = 8 + wdsizo*(nel*nxyz*ndim)
1547 if (wdsizo == 4)
then
1548 allocate(u4(2+lxo*lxo*lxo*6*lelt))
1550 allocate(u8(1+lxo*lxo*lxo*3*lelt))
1553 if (nid == pid0)
then
1555 if (wdsizo == 4)
then
1557 call
copyx4(u4(j+1),u(1,iel),nxyz)
1559 call
copyx4(u4(j+1),v(1,iel),nxyz)
1562 call
copyx4(u4(j+1),w(1,iel),nxyz)
1568 call
copy(u8(j+1),u(1,iel),nxyz)
1570 call
copy(u8(j+1),v(1,iel),nxyz)
1573 call
copy(u8(j+1),w(1,iel),nxyz)
1578 nout = wdsizo/4 * ndim*nel * nxyz
1579 if (wdsizo == 4 .and. ierr == 0)
then
1581 elseif (ierr == 0)
then
1587 call
csend(mtype,idum,4,k,0)
1589 if (wdsizo == 4 .AND. ierr == 0)
then
1590 call
crecv(mtype,u4,len)
1591 nout = wdsizo/4 * ndim*nxyz * int(u4(1))
1593 elseif(ierr == 0)
then
1594 call
crecv(mtype,u8,len)
1595 nout = wdsizo/4 * ndim*nxyz * int(u8(1))
1601 if (wdsizo == 4)
then
1605 call
copyx4(u4(j+1),u(1,iel),nxyz)
1607 call
copyx4(u4(j+1),v(1,iel),nxyz)
1610 call
copyx4(u4(j+1),w(1,iel),nxyz)
1615 call
crecv(mtype,idum,4)
1616 call
csend(mtype,u4,leo,pid0,0)
1621 call
copy(u8(j+1),u(1,iel),nxyz)
1623 call
copy(u8(j+1),v(1,iel),nxyz)
1626 call
copy(u8(j+1),w(1,iel),nxyz)
1631 call
crecv(mtype,idum,4)
1632 call
csend(mtype,u8,leo,pid0,0)
1636 call
err_chk(ierr,
'Error writing data to .f00 in mfo_outv. $')
1643 use kinds, only : r4
1644 use size_m
, only : nid, nelt, lelt, ldimt
1645 use input, only : ifxyo, ifvo, ifpo, ifto, ifpsco, param
1647 use restart, only : nfileo, pid0, pid1, rdcode1, wdsizo, nxo, nyo, nzo
1648 use restart, only : fid0, iheadersize
1649 use tstep, only : istep, time
1652 real(r4) :: test_pattern
1653 real(r4),
allocatable :: padding(:)
1654 integer :: lglist(0:lelt)
1656 character(132) :: hdr
1659 integer :: idum, nfileoo, nelo, j, mtype, inelp, ierr, i, npscalo, k
1660 integer :: ibsw_out, len
1666 if (param(61) < 1)
then
1677 if(nid == pid0)
then
1681 call
csend(mtype,idum,4,j,0)
1682 call
crecv(mtype,inelp,4)
1687 call
crecv(mtype,idum,4)
1688 call
csend(mtype,nelt,4,pid0,0)
1693 if(nid == pid0)
then
1696 call
blank(rdcode1,10)
1717 if(ifpsco(k)) npscalo = npscalo + 1
1719 IF (npscalo > 0)
THEN
1721 WRITE(rdcode1(i+1),
'(I1)') npscalo/10
1722 WRITE(rdcode1(i+2),
'(I1)') npscalo-(npscalo/10)*10
1726 write(hdr,1) tag, wdsizo,nxo,nyo,nzo,nelo,nelgt,time,istep,fid0,nfileoo &
1727 , (rdcode1(i),i=1,10)
1728 1
format(a4,1x,i1,1x,i2,1x,i2,1x,i2,1x,i10,1x,i10,1x,e20.13, &
1729 & 1x,i9,1x,i6,1x,i6,1x,10a)
1737 test_pattern = 6.54321_r4
1739 pad_size = modulo(-(iheadersize + 4),int(2**param(61))) / 4
1740 allocate(padding(pad_size)); padding = 0.
1756 call
err_chk(ierr,
'Error writing header in mfo_write_hdr. $')
1759 if(nid == pid0)
then
1761 lglist(j) =
lglel(j)
1764 ioff = iheadersize + 4 + 4*pad_size + nelb*isize
1773 call
csend(mtype,idum,4,j,0)
1775 call
crecv(mtype,lglist,len)
1782 pad_size = pad_size - lglist(0)
1787 pad_size = modulo(pad_size*4,int(2**param(61))) / 4
1788 allocate(padding(pad_size)); padding = 0.
1798 call
crecv(mtype,idum,4)
1802 lglist(j) =
lglel(j)
1806 call
csend(mtype,lglist,len,pid0,0)
1811 call
err_chk(ierr,
'Error writing global nums in mfo_write_hdr$')
integer function gllel(ieg)
subroutine mfo_write_hdr
write hdr, byte key, els.
subroutine prepost_map(isave, pm1)
Store results for later postprocessing.
subroutine bcast(buf, len)
subroutine byte_set_view(ioff_in, mpi_fh)
integer function mod1(i, n)
Yields MOD(I,N) with the exception that if I=K*N, result is N.
subroutine outpost2(v1, v2, v3, vp, vt, nfldt, name3)
subroutine mxm(a, n1, b, n2, c, n3)
Compute matrix-matrix product C = A*B.
subroutine mfo_outv(u, v, w, nel, mx, my, mz)
output a vector field
subroutine mfo_mdatas(u, nel)
subroutine outhis(ifhis, pm1)
output time history info.
subroutine mbyte_open(hname, fid, ierr)
open blah000.fldnn
subroutine crecv(mtype, buf, lenm)
subroutine restart_nfld(nfld, prefix)
Check for Restart option and return proper nfld value. Also, convenient spot to explain restart strat...
real(dp) function dnekclock_sync()
integer function indx1(S1, S2, L2)
real(dp) function dnekclock()
integer function lglel(iel)
subroutine prepost(ifdoin, prefin)
Store results for later postprocessing. Recent updates: p65 now indicates the number of parallel i/o ...
integer function gllnid(ieg)
subroutine byte_close_mpi(mpi_fh, ierr)
subroutine mfo_outs(u, nel, mx, my, mz)
output a scalar field
subroutine mfo_outfld(prefix, pm1)
mult-file output
subroutine copyx4(a, b, n)
subroutine nek_comm_io(nn)
subroutine outpost(v1, v2, v3, vp, vt, name3)
subroutine mfo_mdatav(u, v, w, nel)
subroutine outfld(prefix, pm1)
output .fld file
subroutine blank(A, N)
blank a string
subroutine mfo_open_files(prefix, ierr)
subroutine copy4r(a, b, n)
subroutine gop(x, w, op, n)
Global vector commutative operation.
subroutine chcopy(a, b, n)
subroutine err_chk(ierr, istring)
integer function ltrunc(string, l)
integer function i_find_prefix(prefix, imax)
subroutine csend(mtype, buf, len, jnid, jpid)
subroutine byte_write_mpi(buf, icount, iorank, mpi_fh, ierr)