20 integer mid,mp,nekcomm,nekgroup,nekreal
21 common /nekmpi/ mid,mp,nekcomm,nekgroup,nekreal
43 logical if_byte_swap_test
44 integer igl_running_sum
48 character*3 str1, str2
65 bname = trim(adjustl(session))
68 write(str,
'(i5.5)') fidl
69 fname =
'DATA/'//trim(fname)//trim(str)
74 fname = trim(fname)//char(0)
77 if (nid.eq.pid00)
then
81 call blank (hdr,iheadersize)
86 if_byte_sw = if_byte_swap_test(test_pattern,ierr)
92 $
'Error reading header file in pstat_mfi_crd2D.')
95 call bcast(hdr,iheadersize)
96 call bcast(if_byte_sw,lsize)
99 read(hdr,*) sdummy,wdsizr,nelr,nelgr,timer,istepr,
103 if (nelgr.gt.(mp*lelt))
call mntr_abort(pstat_id,
104 $
'Insufficient array sizes in pstat_mfi_crd2D.')
109 $
'Only MPI I/O supported in pstat_mfi_crd2D.')
115 offs0 = iheadersize + 4
120 do il = 0,mod(nelgr,np)-1
121 if(il.eq.nid) nelr = nelr + 1
123 nelbr = igl_running_sum(nelr) - nelr
128 $
'Error parrallel opening file in pstat_mfi_crd2D.')
131 offs = offs0 + nelbr*isize
135 $
'Error reading glnel in pstat_mfi_crd2D.')
138 pstat_gnel(il) = er(il)
142 offs = offs0 + (nelgr+nelbr)*isize
146 $
'Error reading level in pstat_mfi_crd2D.')
149 pstat_lev(il) = er(il)
153 offs = offs0 + 2*nelgr*isize+ nelbr*2*wdsizr
158 $
'Error reading element centres in pstat_mfi_crd2D.')
160 if (wdsizr.eq.4)
then
161 call copy4r(pstat_cnt,rbuff,2*nelr)
163 call copy (pstat_cnt,rbuff,2*nelr)
168 $
'Error parrallel closing file in pstat_mfi_crd2D.')
179 write(str1,
'(i3.3)') nid
180 write(str2,
'(i3.3)') icalld
181 open(unit=iunit,
file=
'CRDmsh.txt'//str1//
'i'//str2)
183 write(iunit,*) nelgr, nelr
185 write(iunit,*) il,pstat_gnel(il),pstat_lev(il),
186 $ (pstat_cnt(jl,il),jl=1,2)
209 integer mid,mp,nekcomm,nekgroup,nekreal
210 common /nekmpi/ mid,mp,nekcomm,nekgroup,nekreal
218 real rtmp_pts(ldim,lhis)
219 real*4 rbuffl(2*ldim*lhis)
229 logical if_byte_swap_test
233 character*3 str1, str2
243 if (nid.eq.pid00)
then
249 call blank (hdr,hdrl)
251 if (ierr.ne.0)
goto 101
255 if(ierr.ne.0)
goto 101
256 if_byte_sw = if_byte_swap_test(bytetest,ierr)
257 if(ierr.ne.0)
goto 101
260 read(hdr,*,iostat=ierr) dummy, wdsizr, ldiml, nptsr
266 $
'pstat_mfi_interp: Error opening point files')
269 call bcast(wdsizr,isize)
270 call bcast(ldiml,isize)
271 call bcast(nptsr,isize)
272 call bcast(if_byte_sw,lsize)
276 $
'pstat_mfi_interp: Inconsisten dimension.')
282 if (pstat_npt.gt.0)
then
283 pstat_npt1 = mod(pstat_nptot,mp)
285 pstat_npt1 = pstat_nptot
287 if (nid.lt.pstat_npt1) pstat_npt = pstat_npt +1
291 $
'Interpolation point number :', pstat_nptot)
294 if (pstat_npt.gt.lhis) ierr = 1
296 $
'pstat_mfi_interp: lhis too small')
301 if (nid.eq.pid00)
then
302 if (pstat_nptot.gt.0)
then
304 ldiml = ldim*pstat_npt*wdsizr/4
317 ldiml = ldim*pstat_npt
318 if (wdsizr.eq.4)
then
319 call copy4r(pstat_int_pts,rbuffl,ldiml)
321 call copy(pstat_int_pts,rbuffl,ldiml)
325 npass = min(mp,pstat_nptot)
328 if (pstat_npt1.gt.0.and.il.ge.pstat_npt1)
then
332 ldiml = ldim*nptsr*wdsizr/4
346 if (wdsizr.eq.4)
then
347 call copy4r(rtmp_pts,rbuffl,ldiml)
349 call copy(rtmp_pts,rbuffl,ldiml)
354 call csend(il,rtmp_pts,ldiml,il,jl)
358 if (pstat_npt.gt.0)
then
359 call crecv2(nid,pstat_int_pts,ldim*pstat_npt*wdsize,0)
364 if (nid.eq.pid00)
then
373 write(str1,
'(i3.3)') nid
374 write(str2,
'(i3.3)') icalld
375 open(unit=iunit,
file=
'INTpos.txt'//str1//
'i'//str2)
377 write(iunit,*) pstat_nptot, pstat_npt
379 write(iunit,*) il, (pstat_int_pts(jl,il),jl=1,ldim)
402 integer mid,mp,nekcomm,nekgroup,nekreal
403 common /nekmpi/ mid,mp,nekcomm,nekgroup,nekreal
412 parameter(test=6.54321)
417 real rtmpv(lhis*ldim), rtmpv1(lhis*ldim), rtmp
418 real*4 rtmpv2(2*lhis*ldim)
419 equivalence(rtmpv1,rtmpv2)
435 il = lx1*ly1*lz1*nelt
436 lx = glmax(xm1,il) - glmin(xm1,il)
437 ly = glmax(ym1,il) - glmin(ym1,il)
439 lz = glmax(zm1,il) - glmin(zm1,il)
450 rtmp = pstat_etime-pstat_stime
454 if (nid.eq.pid00)
then
459 if (ierr.ne.0)
goto 20
462 ftm=
"('#iv1',1x,i1,1x,"//
463 $
"1p,'(Re =',e17.9,') (Lx, Ly, Lz =',3e17.9,"//
464 $
"') (nelx, nely, nelz =',3i9,') (Polynomial order =',3i9,"//
465 $
"') (Nstat =',i9,') (Nderiv =',i9,') (start time =',e17.9,"//
466 $
"') (end time =',e17.9,') (effective average time =',e17.9,"//
467 $
"') (time step =',e17.9,') (nrec =',i9"//
468 $
"') (time interval =',e17.9,') (npoints =',i9,')')"
469 write(head,ftm) wdsize,
470 $ 1.0/param(2),lx,ly,lz,nlx,nly,nlz,lx1,ly1,lz1,
471 $ pstat_svar,pstat_dvar,pstat_stime,pstat_etime,rtmp/iavfr,
472 $ rtmp/pstat_istepr,pstat_istepr/iavfr,rtmp,pstat_nptot
478 if (ierr.ne.0)
goto 20
504 $
'Error opening interpolation file in pstat_mfo_interp.')
510 call copy(rtmpv1,pstat_int_pts,pstat_npt*ldim)
511 call byte_write(rtmpv2,pstat_npt*ldim*wdsl,ierr)
513 call copyx4(rtmpv2,pstat_int_pts,pstat_npt*ldim)
518 npass = min(mp,pstat_nptot)
521 if (pstat_npt1.gt.0.and.jl.ge.pstat_npt1)
then
524 call csend(jl,itmp,isize,jl,kl)
525 call crecv2(jl,rtmpv,npts*ldim*wdsize,jl)
529 call copy(rtmpv1,rtmpv,npts*ldim)
532 call copyx4(rtmpv2,rtmpv,npts*ldim)
538 if (pstat_npt.gt.0)
then
539 call crecv2(nid,itmp,isize,0)
540 call csend(nid,pstat_int_pts,pstat_npt*ldim*wdsize,0,itmp)
550 call copy(rtmpv1,pstat_int_avg(1,il),pstat_npt)
553 call copyx4(rtmpv2,pstat_int_avg(1,il),pstat_npt)
558 npass = min(mp,pstat_nptot)
561 if (pstat_npt1.gt.0.and.jl.ge.pstat_npt1)
then
564 call csend(jl,itmp,isize,jl,kl)
565 call crecv2(jl,rtmpv,npts*wdsize,jl)
569 call copy(rtmpv1,rtmpv,npts)
572 call copyx4(rtmpv2,rtmpv,npts)
578 if (pstat_npt.gt.0)
then
579 call crecv2(nid,itmp,isize,0)
580 call csend(nid,pstat_int_avg(1,il),pstat_npt*wdsize,0,
587 $
'Error writing interpolated stat. file in pstat_mfo_interp.')
594 call copy(rtmpv1,pstat_int_der(1,il),pstat_npt)
597 call copyx4(rtmpv2,pstat_int_der(1,il),pstat_npt)
602 npass = min(mp,pstat_nptot)
605 if (pstat_npt1.gt.0.and.jl.ge.pstat_npt1)
then
608 call csend(jl,itmp,isize,jl,kl)
609 call crecv2(jl,rtmpv,npts*wdsize,jl)
613 call copy(rtmpv1,rtmpv,npts)
616 call copyx4(rtmpv2,rtmpv,npts)
622 if (pstat_npt.gt.0)
then
623 call crecv2(nid,itmp,isize,0)
624 call csend(nid,pstat_int_der(1,il),pstat_npt*wdsize,0,
631 $
'Error writing interpolated deriv. file in pstat_mfo_interp.')
634 if (nid.eq.pid00)
then
639 $
'Error closing interpolation file in pstat_mfo_interp.')
subroutine byte_open_mpi(fnamei, mpi_fh, ifro, ierr)
subroutine byte_read_mpi(buf, icount, iorank, mpi_fh, ierr)
subroutine byte_close_mpi(mpi_fh, ierr)
subroutine byte_set_view(ioff_in, mpi_fh)
subroutine crecv2(mtype, buf, lenm, jnid)
subroutine csend(mtype, buf, len, jnid, jpid)
subroutine bcast(buf, len)
subroutine mntr_logi(mid, priority, logs, ivar)
Write log message adding single integer.
subroutine mntr_abort(mid, logs)
Abort simulation.
subroutine mntr_check_abort(mid, ierr, logs)
Abort simulation.
subroutine pstat2d_mfi_crd2d(fidl)
Read nonconforming data from the file.
subroutine pstat2d_mfo_interp
Geather data and write it down.
subroutine pstat2d_mfi_interp
Read interpolation points position and redistribute them.
subroutine addfid(fname, fid)
subroutine copy4r(a, b, n)
subroutine copyx4(a, b, n)