12 character(132) :: load_name =
'NONE' !>
24 use soln, only : vx, vy, vz, pr, t
26 use size_m
, only : nx1, ny1, nz1
27 use tstep, only : time
30 integer :: word_size_load !>
33 integer,
parameter :: pad_size = 1
34 real(DP),
allocatable :: padding(:,:,:,:)
37 if (load_name ==
'NONE')
then
49 if (nid == pid0 .and. skip_x)
then
50 allocate(padding(nx1, ny1, nz1, pad_size))
51 do i = 1, nelo, pad_size
52 call
byte_read(padding, word_size_load *
size(padding) / 4, ierr)
53 call
byte_read(padding, word_size_load *
size(padding) / 4, ierr)
54 call
byte_read(padding, word_size_load *
size(padding) / 4, ierr)
59 call
mfo_read_vector(vx, vy, vz,
size(vx,4),
size(vx,1),
size(vx,2),
size(vx,3), word_size_load)
62 call
mfo_read_scalar(pr(:,:,:,:),
size(pr, 4),
size(pr,1),
size(pr,2),
size(pr,3), word_size_load)
63 call
mfo_read_scalar(t(:,:,:,:,1),
size(t, 4),
size(t,1),
size(t,2),
size(t,3), word_size_load)
73 use input, only : ifreguo, series, param
74 use restart, only : nfileo, ifdiro
78 character(132) :: fname
79 character(1) :: fnam1(132)
81 character(6),
save :: six =
"??????"
84 character(1),
save :: slash =
'/', dot =
'.'
86 integer :: k, len, ndigit
87 integer,
external :: i_find_prefix, mod1
97 ndigit = int(log10(rfileo) + 1)
101 call
chcopy(fnam1(1),
'A',1)
102 call
chcopy(fnam1(2),six,ndigit)
104 call
chcopy(fnam1(k),slash,1)
109 call
chcopy(fnam1(k),series,len)
114 call
chcopy(fnam1(k),
'_reg',len)
118 call
chcopy(fnam1(k),six,ndigit)
121 call
chcopy(fnam1(k ),dot,1)
122 call
chcopy(fnam1(k+1),
'f',1)
125 write(str,4) int(param(69))
127 call
chcopy(fnam1(k),str,5)
130 call
chcopy(fname(1:132),fnam1(1),k-1)
137 use kinds, only : r4, dp
138 use size_m
, only : nid, nelt, lelt
140 use restart, only : nfileo, pid0, pid1
141 use restart, only : iheadersize
144 integer,
intent(out) :: nelo
145 integer,
intent(out) :: word_size_file
146 real(DP),
intent(out) :: time
147 logical,
intent(out) :: skip_x
149 integer :: nelo_file !>
150 real(r4) :: test_pattern
151 real(r4),
allocatable :: padding(:)
152 integer :: lglist(0:lelt)
153 character(1) :: rdcode1(10)
154 integer :: fid0, istep, nelgt
155 character(132) :: hdr
157 integer :: idum, nfileoo, j, mtype, inelp, ierr, i
160 integer :: nxo, nyo, nzo
170 call
csend(mtype,idum,4,j,0)
171 call
crecv(mtype,inelp,4)
176 call
crecv(mtype,idum,4)
177 call
csend(mtype,nelt,4,pid0,0)
182 pad_size = (8 * (2**20) - (iheadersize + 4) ) / 4
183 allocate(padding(pad_size)); padding = 0.
185 read(hdr, 1) word_size_file,nxo,nyo,nzo,nelo_file,nelgt,time,istep,fid0,nfileoo &
186 , (rdcode1(i),i=1,10)
187 1
format(5x,i1,1x,i2,1x,i2,1x,i2,1x,i10,1x,i10,1x,e20.13, &
188 & 1x,i9,1x,i6,1x,i6,1x,10a)
194 if (rdcode1(1) ==
'X')
then
199 call
bcast(word_size_file, isize)
202 call
err_chk(ierr,
'Error writing header in mfo_write_hdr. $')
209 call
csend(mtype,idum,4,j,0)
211 call
crecv(mtype,lglist,len)
214 pad_size = pad_size - lglist(0)
219 do while (pad_size < 0)
220 pad_size = pad_size + (8 * (2**20)) / 4
222 allocate(padding(pad_size)); padding = 0.
228 call
crecv(mtype,idum,4)
236 call
csend(mtype,lglist,len,pid0,0)
239 call
err_chk(ierr,
'Error reading global nums in mfo_write_hdr$')
246 use kinds, only : dp, r4
247 use size_m
, only : nid, lelt, lxo
251 integer,
intent(in) :: nel, mx, my, mz, wdsizo
252 real(DP),
intent(in) :: u(mx,my,mz,1)
254 real(r4),
allocatable :: u4(:)
255 real(DP),
allocatable :: u8(:)
257 integer :: nxyz, ntot, idum, ierr, nout, k, mtype
260 if(mx > lxo .OR. my > lxo .OR. mz > lxo)
then
261 if(nid == 0)
write(6,*)
'ABORT: lxo too small'
271 if (wdsizo == 4)
then
272 allocate(u4(2+lxo*lxo*lxo*2*lelt))
274 allocate(u8(1+lxo*lxo*lxo*1*lelt))
277 if (nid == pid0)
then
279 nout = wdsizo/4 * nxyz * idum
280 if(wdsizo == 4 .and. ierr == 0)
then
282 elseif(ierr == 0)
then
286 if (wdsizo == 4)
then
287 call
copy4r(u,u4,nxyz * idum)
289 call
copy(u,u8,nxyz * idum)
297 call
csend(mtype,idum,4,k,0)
298 call
crecv(mtype,idum,4)
300 nout = wdsizo/4 * nxyz * idum
301 if (wdsizo == 4 .AND. ierr == 0)
then
303 call
csend(mtype, u4, nout*4, k, 0)
304 elseif(ierr == 0)
then
306 call
csend(mtype, u8, nout*4, k, 0)
312 call
crecv(mtype,idum,4)
313 call
csend(mtype, nel, 4, pid0, 0)
315 if (wdsizo == 4)
then
316 call
crecv(mtype, u4, nxyz * nel *wdsizo)
317 call
copy4r(u, u4, nxyz * nel)
319 call
crecv(mtype, u8, nxyz * nel *wdsizo)
320 call
copy(u, u8, nxyz * nel)
325 call
err_chk(ierr,
'Error writing data to .f00 in mfo_outs. $')
333 use kinds, only : dp, r4
334 use size_m
, only : nid, ndim, lxo, lelt
335 use input, only : if3d
339 integer,
intent(in) :: mx, my, mz, wdsizo
340 real(DP),
intent(in) :: u(mx*my*mz,*),v(mx*my*mz,*),w(mx*my*mz,*)
342 real(r4),
allocatable :: u4(:)
343 real(DP),
allocatable :: u8(:)
345 integer :: nxyz, nel, idum, ierr
346 integer :: j, iel, nout, k, mtype
349 if(mx > lxo .OR. my > lxo .OR. mz > lxo)
then
350 if(nid == 0)
write(6,*)
'ABORT: lxo too small'
358 if (wdsizo == 4)
then
359 allocate(u4(2+lxo*lxo*lxo*6*lelt))
361 allocate(u8(1+lxo*lxo*lxo*3*lelt))
364 if (nid == pid0)
then
365 nout = wdsizo/4 * ndim * nel * nxyz
366 if (wdsizo == 4 .and. ierr == 0)
then
368 elseif (ierr == 0)
then
373 if (wdsizo == 4)
then
375 call
copy4r(u(1,iel), u4(j+1),nxyz)
377 call
copy4r(v(1,iel), u4(j+1),nxyz)
380 call
copy4r(w(1, iel), u4(j+1),nxyz)
386 call
copy(u(1,iel), u8(j+1),nxyz)
388 call
copy(v(1,iel), u8(j+1),nxyz)
391 call
copy(w(1,iel), u8(j+1),nxyz)
400 call
csend(mtype,idum,4,k,0)
401 call
crecv(mtype,idum,4)
403 nout = wdsizo/4 * ndim*nxyz * idum
404 if (wdsizo == 4 .AND. ierr == 0)
then
406 call
csend(mtype,u4,nout*4, k, 0)
407 elseif(ierr == 0)
then
409 call
csend(mtype,u8,nout*4, k, 0)
414 call
crecv(mtype,idum,4)
415 call
csend(mtype,nel,4,pid0,0)
417 if (wdsizo == 4)
then
418 call
crecv(mtype,u4,wdsizo*(nel*nxyz*ndim))
422 call
copy4r(u(1,iel), u4(j+1),nxyz)
424 call
copy4r(v(1,iel), u4(j+1),nxyz)
427 call
copy4r(w(1,iel), u4(j+1),nxyz)
433 call
crecv(mtype,u8,wdsizo*(nel*nxyz*ndim))
436 call
copy(u(1,iel), u8(j+1),nxyz)
438 call
copy(v(1,iel), u8(j+1),nxyz)
441 call
copy(w(1,iel), u8(j+1),nxyz)
448 call
err_chk(ierr,
'Error writing data to .f00 in mfo_outv. $')
subroutine mfo_read_vector(u, v, w, nel, mx, my, mz, wdsizo)
Read a vector field.
subroutine bcast(buf, len)
subroutine, public load_ic()
Load initial condition from a previous multi-file output.
subroutine mbyte_open(hname, fid, ierr)
open blah000.fldnn
subroutine crecv(mtype, buf, lenm)
subroutine get_restart_name(fname)
subroutine mfo_read_scalar(u, nel, mx, my, mz, wdsizo)
Read a scalar field.
subroutine mfo_read_header(nelo, word_size_file, time, skip_x)
Read header and return number of elements and word size.
integer function lglel(iel)
subroutine copy4r(a, b, n)
subroutine chcopy(a, b, n)
subroutine err_chk(ierr, istring)
integer function ltrunc(string, l)
subroutine csend(mtype, buf, len, jnid, jpid)