This example shows how a 2D fld result file, 'ext_cyl.fld17' in this case, can be used as an initial condition for a 3D case using the subroutine extrfld defined in the usr file. Below is a summary and the changes that were made to the usr file: Assumptions: 1. The 2D result files are output in .fld format using param(66) = 0 2. lx1 is kept the same as that used to generate 2D result file at the beginning of 3D calculation. Procedure: 1. Begin by including the following lines in the usrchk subroutine in the usr file: c----------------------------------------------------------------------- character*20 resname integer nel2m c !!!enter file name here and number of 2D elements for restart resname = 'ext_cyl.fld17' nel2m = 1472 resname = trim(resname) if (istep.eq.0) call extrfld(resname,nel2m) c----------------------------------------------------------------------- In the lines above, resname is used as the string to specify the restart file name; 'ext_cyl.fld17' in this case. Please make sure that the "character*20 resname" declaration is made at the beginning of usrchk subroutine with other variables defined in usrchk. 2. Copy the following two subroutine at the end of the usr file. This subroutine will copy the results from 2D fld file to 3D nodes and start the nek calculation. c----------------------------------------------------------------------- c---------------------------------------------------------------------- c---------------------------------------------------------------------- subroutine extrfld(str,nel2m) include 'SIZE' include 'TOTAL' include 'ZPER' include 'RESTART' character*20 str integer nel2m real u2(lx1,ly1,nel2m) real v2(lx1,ly1,nel2m) real pmd(lx1,ly1,nel2m) real t2(lx1,ly1,nel2m) real pm1(lx1,ly1,lz1,nelv) integer en,en3,eg,tel sum = nelt call nekgsync() tel = GLSUM(sum,1) if (nid.eq.0) then call fld2copy(str,u2,v2,pmd,t2,tel,nel2m) endif call nekgsync() nbytes = 8*lx1*ly1*nel2m call bcast(u2,nbytes) call bcast(v2,nbytes) call bcast(pmd,nbytes) call bcast(t2,nbytes) call nekgsync() do en3 = 1,nelv eg = lglel(en3) en = mod1(eg,nel2m) do k=1,nz1 do j=1,ny1 do i=1,nx1 vx(i,j,k,en3) = u2(i,j,en) vy(i,j,k,en3) = v2(i,j,en) pm1(i,j,k,en3) = pmd(i,j,en) if (nfield.eq.2) t(i,j,k,en3,1) = t2(i,j,en) enddo enddo enddo enddo do en=1,nelv if (if_full_pres) then call copy (pr(1,1,1,en),pm1(1,1,1,en),nxyz2) else call map12 (pr(1,1,1,en),pm1(1,1,1,en),en) endif enddo call outpost(vx,vy,vz,pr,t,' ') c call exitti('Quit in usrdat2',5) return end c------------------------------------------------------------------ subroutine fld2copy(str,u2,v2,pmd,t2,tel,nel2m) include 'SIZE' include 'TOTAL' include 'RESTART' include 'ZPER' character*20 str integer nzlayers integer nn2,en,en3,sum,sume3,nlines,nlines1,sum2,eg real u2(lx1*ly1*nel2m) real v2(lx1*ly1*nel2m) real t2(lx1*ly1*nel2m) real pmd(lx1*ly1*nel2m) integer tel str = trim(str) nx1=lx1 ny1=ly1 nz1=lz1 nxyz2 = nx2*ny2*nz2 nzlayers = tel/nel2m nn2 = nel2m*nx1*ny1 c calculate top lines of fld 2d file that is garbage nlines1 = nel2m/6 if (mod(nel2m,6).gt.0.0) then nlines = nlines1+2 else nlines = nlines1+1 endif c "nlines" is the number of lines at top of fld that has c the header and 0.000 nel2 times (6 times per line). c write(6,*) nlines c skip past the lines of fld file with garbage open(unit=20,file=str) do ii = 1,nlines read(20,*) enddo c start reading velocity and pressure data c read the data from the fld file sum = 0 do i=1,nx1*ny1*nel2m if (nfield.eq.1) then read(20,*) u2(i),v2(i) $ ,pmd(i) else read(20,*) u2(i),v2(i) $ ,pmd(i),t2(i) endif enddo close(20) return end c---------------------------------------------------------------------