23 $
'module ['//trim(io_name)//
'] already registered')
32 $
'Parent module ['//
'FRAME'//
'] not registered')
64 inquire(unit=iunit,opened=ifcnnd,iostat=ierr)
72 if (iunit.gt.io_iunit_max) io_iunit_max = iunit
90 do iunit = io_iunit_min, io_iunit_max
91 inquire(unit=iunit,opened=ifcnnd,iostat=ierr)
92 if(ifcnnd)
close(iunit)
94 io_iunit_max = io_iunit_min
119 character*132 fname, bname
128 parameter(six=
'??????')
140 ndigit = log10(rfileo) + 1
143 if (ifdiro) fname =
'A'//six(1:ndigit)//
'/'
146 if (prefix(1:1).ne.
' '.and.prefix(2:2).ne.
' '
147 $ .and.prefix(3:3).ne.
' ')
148 $ fname = trim(fname)//trim(adjustl(prefix))
151 fname = trim(fname)//trim(adjustl(bname))
153 if (ifreguo) fname = trim(fname)//
'_reg'
156 itmp = len_trim(fname)
158 call mntr_error(io_id,
'io_mfo_fname; zero lenght fname.')
161 elseif ((itmp+ndigit+2+5).gt.132)
then
162 call mntr_error(io_id,
'io_mfo_fname; fname too long.')
168 fname = trim(fname)//six(1:ndigit)//
'.f'
201 fname = trim(adjustl(hname))
204 itmp = len_trim(fname)
206 call mntr_error(io_id,
'io_mbyte_open; zero lenght fname.')
214 call mntr_log(io_id,lp_ess,
'Opening file: '//trim(fname))
219 fname = trim(fname)//char(0)
249 if (nid.eq.pid0)
then
271 subroutine io_mfov(offs,lvx,lvy,lvz,lnx,lny,lnz,
283 integer lnx,lny,lnz,lnel,lnelg,lndim
284 real lvx(lnx,lny,lnz,lnel), lvy(lnx,lny,lnz,lnel),
285 $ lvz(lnx,lny,lnz,lnel)
291 real rvx(lxo*lxo*(1 + (ldim-2)*(lxo-1))*lelt),
292 $ rvy(lxo*lxo*(1 + (ldim-2)*(lxo-1))*lelt),
293 $ rvz(lxo*lxo*(1 + (ldim-2)*(lxo-1))*lelt)
294 common /scruz/ rvx, rvy, rvz
300 $
'io_mfov; nrg too large, reset to lxo!')
337 itmp = 1 + (lndim-2)*(nrg-1)
339 loffs = offs + int(nelb,8)*int(lndim*wdsizo*nrg*nrg*itmp,8)
343 call mfo_outv(rvx,rvy,rvz,lnel,nrg,nrg,itmp)
346 offs = offs + int(lnelg,8)*int(lndim*wdsizo*nrg*nrg*itmp,8)
350 loffs = offs + int(nelb,8)*int(lndim*wdsizo*lnx*lny*lnz,8)
354 call mfo_outv(lvx,lvy,lvz,lnel,lnx,lny,lnz)
357 offs = offs + int(lnelg,8)*int(lndim*wdsizo*lnx*lny*lnz,8)
374 subroutine io_mfos(offs,lvs,lnx,lny,lnz,lnel,lnelg,lndim)
385 integer lnx,lny,lnz,lnel,lnelg,lndim
386 real lvs(lnx,lny,lnz,lnel)
392 real rvs(lxo*lxo*(1 + (ldim-2)*(lxo-1))*lelt)
399 $
'io_mfos; nrg too large, reset to lxo!')
421 itmp = 1 + (lndim-2)*(nrg-1)
423 loffs = offs + int(nelb,8)*int(wdsizo*nrg*nrg*itmp,8)
427 call mfo_outs(rvs,lnel,nrg,nrg,itmp)
430 offs = offs + int(lnelg,8)*int(wdsizo*nrg*nrg*itmp,8)
434 loffs = offs + int(nelb,8)*int(wdsizo*lnx*lny*lnz,8)
441 offs = offs + int(lnelg,8)*int(wdsizo*lnx*lny*lnz,8)
457 subroutine io_mfiv(offs,uf,vf,wf,lnx,lny,lnz,lnel,ifskip)
468 integer lnx,lny,lnz,lnel
469 real uf(lnx*lny*lnz,lnel),vf(lnx*lny*lnz,lnel),
470 $ wf(lnx*lny*lnz,lnel)
474 integer lndim, nxyzr, nxyzw, nxyzv, mlen
475 integer num_recv, num_avail, nread, nelrr
476 integer el, il, kl, ll, ierr
477 integer ei, eg, jnid, jeln
483 parameter(lrbs=20*lx1*ly1*lz1*lelt)
489 parameter(lwk = 14*lx1*ly1*lz1*lelt)
494 integer irecv, iglmax
499 if ((nxr.ne.lnx).or.(nyr.ne.lny).or.(nzr.ne.lnz))
then
500 call mntr_abort(io_id,
'io_mfiv, wrong element size')
509 nxyzr = lndim*lnx*lny*lnz
511 if (wdsizr.eq.8)
then
518 i8tmp = offs + int(nelbr,8)*int(mlen,8)
524 call lim_chk(num_recv,num_avail,
' ',
' ',
'io_mfiv a')
527 if (nid.eq.pid0r)
then
528 i8tmp = int(nxyzw,8)*int(nelr,8)
529 nread = i8tmp/int(lrbs,8)
530 if (mod(i8tmp,int(lrbs,8)).ne.0) nread = nread + 1
531 if(ifmpiio) nread = iglmax(nread,1)
535 call lim_chk(nxyzw*nelrr,lrbs,
' ',
' ',
'io_mfiv b')
542 if (nid.eq.pid0r)
then
546 if (il.eq.nread)
then
547 nelrr = nelr - (nread-1)*nelrr
548 if (nelrr.lt.0) nelrr = 0
568 msg_id(el) = irecv(el,wk(ll),mlen)
573 if (nid.eq.pid0r.and.np.gt.1)
then
577 if (il.eq.nread)
then
578 nelrr = nelr - (nread-1)*nelrr
579 if (nelrr.lt.0) nelrr = 0
592 do el = kl+1,kl+nelrr
595 if(ierr.ne.0)
call rzero(w2(ll),mlen)
596 call csend(jeln,w2(ll),mlen,jnid,0)
601 elseif (np.eq.1)
then
611 if (wdsizr.eq.8)
then
626 if (wdsizr.eq.8)
then
633 if (wdsizr.eq.4)
then
634 call copy4r(uf(1,ei),wk(ll),nxyzv)
635 call copy4r(vf(1,ei),wk(ll + nxyzw),nxyzv)
637 $
call copy4r(wf(1,ei),wk(ll + 2*nxyzw),nxyzv)
639 call copy(uf(1,ei),wk(ll),nxyzv)
640 call copy(vf(1,ei),wk(ll + nxyzw),nxyzv)
642 $
call copy(wf(1,ei),wk(ll + 2*nxyzw),nxyzv)
650 offs = offs + int(nelgr,8)*int(mlen,8)
652 call err_chk(ierr,
'Error reading restart data,in io_mfiv.$')
666 subroutine io_mfis(offs,uf,lnx,lny,lnz,lnel,ifskip)
677 integer lnx,lny,lnz,lnel
678 real uf(lnx*lny*lnz,lnel)
682 integer nxyzr, nxyzw, mlen
683 integer num_recv, num_avail, nread, nelrr
684 integer el, il, kl, ll, ierr
685 integer ei, eg, jnid, jeln
691 parameter(lrbs=20*lx1*ly1*lz1*lelt)
697 parameter(lwk = 14*lx1*ly1*lz1*lelt)
702 integer irecv, iglmax
707 if ((nxr.ne.lnx).or.(nyr.ne.lny).or.(nzr.ne.lnz))
then
708 call mntr_abort(io_id,
'io_mfis, wrong element size')
713 if (wdsizr.eq.8)
then
720 i8tmp = offs + int(nelbr,8)*int(mlen,8)
726 call lim_chk(num_recv,num_avail,
' ',
' ',
'io_mfis a')
729 if (nid.eq.pid0r)
then
730 i8tmp = int(nxyzw,8)*int(nelr,8)
731 nread = i8tmp/int(lrbs,8)
732 if (mod(i8tmp,int(lrbs,8)).ne.0) nread = nread + 1
733 if(ifmpiio) nread = iglmax(nread,1)
737 call lim_chk(nxyzw*nelrr,lrbs,
' ',
' ',
'io_mfis b')
744 if (nid.eq.pid0r)
then
748 if (il.eq.nread)
then
749 nelrr = nelr - (nread-1)*nelrr
750 if (nelrr.lt.0) nelrr = 0
770 msg_id(el) = irecv(el,wk(ll),mlen)
775 if (nid.eq.pid0r.and.np.gt.1)
then
779 if (il.eq.nread)
then
780 nelrr = nelr - (nread-1)*nelrr
781 if (nelrr.lt.0) nelrr = 0
794 do el = kl+1,kl+nelrr
797 if(ierr.ne.0)
call rzero(w2(ll),mlen)
798 call csend(jeln,w2(ll),mlen,jnid,0)
803 elseif (np.eq.1)
then
820 if (wdsizr.eq.8)
then
827 if (wdsizr.eq.4)
then
828 call copy4r(uf(1,ei),wk(ll),nxyzr)
830 call copy (uf(1,ei),wk(ll),nxyzr)
838 offs = offs + int(nelgr,8)*int(mlen,8)
840 call err_chk(ierr,
'Error reading restart data,in io_mfis.$')
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 csend(mtype, buf, len, jnid, jpid)
subroutine bcast(buf, len)
subroutine err_chk(ierr, string)
subroutine lim_chk(n, m, avar5, lvar5, sub_name10)
integer function gllel(ieg)
integer function gllnid(ieg)
subroutine mntr_warn(mid, logs)
Write warning message.
subroutine mntr_mod_is_name_reg(mid, mname)
Check if module name is registered and return its id.
subroutine mntr_abort(mid, logs)
Abort simulation.
subroutine mntr_log(mid, priority, logs)
Write log message.
subroutine mntr_error(mid, logs)
Write error message.
subroutine mntr_mod_reg(mid, pmid, mname, mdscr)
Register new module.
subroutine addfid(fname, fid)
subroutine map2reg_3di_e(uf, n, uc, m)
subroutine map2reg_2di_e(uf, n, uc, m)
subroutine mfo_outv(u, v, w, nel, mx, my, mz)
subroutine copy4r(a, b, n)
subroutine mfo_outs(u, nel, mx, my, mz)