17 character sourcefld*(*)
19 common /scrcg/ pm1(lx1*ly1*lz1,lelv)
20 common /nekmpi/ nidd,npp,nekcomm,nekgroup,nekreal
22 character*1 hdr(iHeaderSize)
26 logical if_byte_swap_test
30 if(nio.eq.0)
write(6,*)
'call gfldr ',trim(sourcefld)
35 open (90,
file=sourcefld,status=
'old',err=100)
40 call err_chk(ierr,
' Cannot open source fld file!$')
48 call err_chk(ierr,
' Invalid header!$')
49 ifbswp = if_byte_swap_test(bytetest,ierr)
50 call err_chk(ierr,
' Invalid endian tag!$')
61 if (ifgtim) time = timer
65 do i = 0,mod(nelgs,np)-1
66 if(i.eq.nid) nels = nels + 1
70 ntots_b = dtmp8*nxyzs*wdsizr
72 rankoff_b = rankoff_b*nxyzs*wdsizr
74 nsizefld_b = dtmp8*nxyzs*wdsizr
75 noff0_b = iheadersize + isize + isize*dtmp8
79 $
call exitti(
'ldim of source does not match target!$',0)
80 if(ntots_b/wdsize .gt. ltots)
then
82 lelt_req = dtmp8*nxs*nys*nzs / (np*ltots/lelt)
83 lelt_req = lelt_req + 1
84 if(nio.eq.0)
write(6,*)
85 $
'ABORT: buffer too small, increase lelt > ', lelt_req
95 call exitti(
'source does not contain a mesh!$',0)
99 call exitti(
'no support for if_full_pres!$',0)
106 nhash = nels*nxs*nys*nzs
109 call fgslib_findpts_setup(inth_gfldr,nekcomm,np,ldim,
110 & xm1s,ym1s,zm1s,nxs,nys,nzs,
111 & nels,nxf,nyf,nzf,bb_t,
112 & nhash,nhash,nmax,tol)
116 if(nid.eq.0 .and. loglevel.gt.2)
write(6,*)
'reading vel'
117 ntot = nx1*ny1*nz1*nelv
119 ifldpos = ifldpos + ldim
122 if(nid.eq.0 .and. loglevel.gt.2)
write(6,*)
'reading pr'
123 ntot = nx1*ny1*nz1*nelv
125 ifldpos = ifldpos + 1
129 if(ifgettr .and. ifheat)
then
130 if(nid.eq.0 .and. loglevel.gt.2)
write(6,*)
'reading temp'
131 ntot = nx1*ny1*nz1*nelfld(2)
132 call gfldr_getfld(t(1,1,1,1,1),dum,dum,ntot,1,ifldpos+1)
133 ifldpos = ifldpos + 1
137 if(nid.eq.0 .and. loglevel.gt.2)
138 $
write(6,*)
'reading scalar',i
139 ntot = nx1*ny1*nz1*nelfld(i+2)
140 call gfldr_getfld(t(1,1,1,1,i+1),dum,dum,ntot,1,ifldpos+1)
141 ifldpos = ifldpos + 1
147 call fgslib_findpts_free(inth_gfldr)
148 if(nio.eq.0)
write(6,
'(A,1(1g9.2),A)')
149 &
' done :: gfldr ', etime_t,
' sec'
167 ioff_b = noff0_b + ldim*rankoff_b
170 nread = ldim*ntots_b/4
212 ioff_b = noff0_b + (ifldpos-1)*nsizefld_b
213 ioff_b = ioff_b + nldim*rankoff_b
215 nread = nldim*ntots_b/4
223 call gfldr_buf2vi (buffld,1,bufr,nldim,wdsizr,nels,nxyzs)
225 if(nldim.eq.1)
return
227 call gfldr_buf2vi (buffld,2,bufr,nldim,wdsizr,nels,nxyzs)
229 if(nldim.eq.2)
return
232 call gfldr_buf2vi(buffld,3,bufr,nldim,wdsizr,nels,nxyzs)
248 k = (iel-1)*ldim*nxyz
250 if(index.eq.2) k = k+nxyz
251 if(index.eq.3) k = k+2*nxyz
253 if(wds.eq.4)
call copy4r(vi(j+1),buf(k+1) ,nxyz)
254 if(wds.eq.8)
call copy (vi(j+1),buf(2*k+1),nxyz)
271 integer*8 i8glsum,nfail,nfail_sum
276 if(wdsizr.eq.8) toldist = 5e-14
278 ntot = lx1*ly1*lz1*nelt
279 call fgslib_findpts(inth_gfldr,
290 if(grcode(i).eq.1 .and. sqrt(gdist(i)).gt.toldist)
292 if(grcode(i).eq.2) nfail = nfail + 1
295 nfail_sum = i8glsum(nfail,1)
296 if(nfail_sum.gt.0)
then
297 if(nio.eq.0)
write(6,*)
298 &
' WARNING: Unable to find all mesh points in source fld ',
305 call fgslib_findpts_eval(inth_gfldr,
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)
function igl_running_sum(in)
subroutine exitti(stringi, idata)
subroutine err_chk(ierr, string)
real *8 function dnekclock_sync()
subroutine gfldr_getxyz(xout, yout, zout)
subroutine gfldr_intp(fieldout, nout, fieldin, iffpts)
subroutine gfldr(sourcefld)
subroutine gfldr_buf2vi(vi, index, buf, ldim, wds, nel, nxyz)
subroutine gfldr_getfld(out1, out2, out3, nout, nldim, ifldpos)
subroutine mfi_parse_hdr(hdr, ierr)
subroutine axis_interp_ic(pm1)
subroutine map_pm1_to_pr(pm1, ifile)
subroutine copy4r(a, b, n)