Hello neks
I have been trying to compile a 3D case that I recieved for 3oP30N Airfoil.
I have been getting an error while compiling the case and I found out that the erroe comes from the user file, however I coudn't know exctly why am I getting this error.
Is there a chance that I can get an assist to locate where the error is coming from
This is what in the user file and I have uploaded the files as well:
!-----------------------------------------------------------------------
!
! USER SPECIFIED ROUTINES:
!
! - boundary conditions
! - initial conditions
! - variable properties
! - local acceleration for fluid (a)
! - forcing function for passive scalar (q)
! - general purpose routine for checking errors etc.
!
!-----------------------------------------------------------------------
subroutine uservp (ix,iy,iz,ieg)
include 'SIZE'
include 'TOTAL'
include 'NEKUSE'
udiff =0.
utrans=0.
return
end
!-----------------------------------------------------------------------
subroutine userf (ix,iy,iz,ieg)
include 'SIZE'
include 'TOTAL'
include 'NEKUSE'
! Note: this is an acceleration term, NOT a force!
! Thus, ffx will subsequently be multiplied by rho(x,t).
integer iel
ffx = 0.0
ffy = 0.0
ffz = 0.0
! add sponge
call spng_forcing(FFX,FFY,FFZ,ix,iy,iz,ieg)
return
end
!-----------------------------------------------------------------------
subroutine userq (ix,iy,iz,ieg)
include 'SIZE'
include 'TOTAL'
include 'NEKUSE'
qvol = 0.0
return
end
!-----------------------------------------------------------------------
subroutine userchk
implicit none
include 'SIZE'
include 'TSTEP'
include 'INPUT'
include 'SOLN'
! local variables
integer lt,n
real vort, w1, w2, w3
real scale
real x0(3)
save x0
data x0 /3*0/
parameter (lt=lx1*ly1*lz1*lelv)
common /scrns/ vort(lt,3), w1(lt), w2(lt)
n = nx1*ny1*nz1*nelv
if (ISTEP.eq.0) then
call set_obj ! define objects for surface integrals
! start framework
call frame_start
endif
! monitor simulation
call frame_monitor
! save/load files for full-restart
call chkpt_main
! add noise
call nseb_noise_add
call estimate_strouhal
scale = 2. ! Cd = F/(.5 rho U^2 ) = 2*F
if (mod(ISTEP,10).eq.0) call torque_calc(scale,x0,.true.,.false.)
! write out probes
! if (mod(ISTEP,int(UPARAM(1))).eq.0) call hpts()
! if (ISTEP.eq.1) call hpts()
! finalise framework
if (ISTEP.eq.NSTEPS.or.LASTEP.eq.1) then
call frame_end
endif
ifreguo = .true. ! dump on regular (uniform) grid instead of GLL
if (mod(ISTEP,int(UPARAM(1))).eq.0) then
call comp_vort3(vort,w1,w2,vx,vy,vz)
call outpost(vort(1,1),vort(1,2),vort(1,3),pr,t,'vrt')
endif
return
end
!-----------------------------------------------------------------------
subroutine userbc (ix,iy,iz,iside,ieg)
! NOTE ::: This subroutine MAY NOT be called by every process
include 'SIZE'
include 'TOTAL'
include 'NEKUSE'
ux=0.99756405026
uy=0.06975647374
uz=0.0
temp=0.0
return
end
!----------------------------------------------------------------------
subroutine useric (ix,iy,iz,ieg)
include 'SIZE'
include 'TOTAL'
include 'NEKUSE'
ux=0.99756405026
uy=0.06975647374
uz=0.0
temp=0
return
end
!-----------------------------------------------------------------------
subroutine usrdat
include 'SIZE'
include 'TOTAL'
! call platform_timer(0) ! not too verbose
! call platform_timer(1) ! mxm, ping-pong, and all_reduce timer
return
end
!-----------------------------------------------------------------------
subroutine usrdat2
include 'SIZE'
include 'TOTAL'
! param(66) = 4. ! These give the std nek binary i/o and are
! param(67) = 4. ! good default values
common /USRBC/ bcflag(lx1,ly1,lz1,lelt)
integer iel,ifc,id_face
integer isideset1
ntot = nx1*ny1*nz1*nelv
call rzero(bcflag,ntot)
c isideset1 = 0
do iel=1,nelv
do ifc=1,2*ndim
c if(cbc(ifc,iel,1).eq.'MSH') then
c cbc(ifc,iel,1) = 'W '
c endif
id_face = bc(5,ifc,iel,1)
if (id_face.eq.1) then
cbc(ifc,iel,1) = 'v '
elseif (id_face.eq.2) then
cbc(ifc,iel,1) = 'O '
elseif (id_face.eq.3) then
cbc(ifc,iel,1) = 'SYM'
elseif (id_face.eq.4) then
cbc(ifc,iel,1) = 'SYM'
elseif (id_face.eq.5) then
cbc(ifc,iel,1) = 'W '
endif
enddo
enddo
cc do iel=1,nelv
cc do ifc=1,2*ndim
cc if(cbc(ifc,iel,1).eq.'EXO') then
cc call facind(i0,i1,j0,j1,k0,k1,nx1,ny1,nz1,ifc)
cc do k=k0,k1
cc do j=j0,j1
cc do i=i0,i1
cc bcflag(i,j,k,iel) = 1.0
cc enddo
cc enddo
cc enddo
cc cbc(ifc,iel,1) = 'W '
cc endif
cc enddo
cc enddo
CC isideset1 = glsum(isideset1,1)
C write(6,*) "isideset1 = ", isideset1
return
end
!-----------------------------------------------------------------------
subroutine usrdat3
include 'SIZE'
include 'TOTAL'
return
end
!----------------------------------------------------------------------
subroutine estimate_strouhal
include 'SIZE'
include 'TOTAL'
real tlast,vlast,tcurr,vcurr,t0,t1
save tlast,vlast,tcurr,vcurr,t0,t1
data tlast,vlast,tcurr,vcurr,t0,t1 / 6*0 /
integer e,eg,eg0,e0
eg0 = 622 ! Identify element/processor in wake
mid = gllnid(eg0)
e0 = gllel (eg0)
st = 0
if (nid.eq.mid) then
tlast = tcurr
vlast = vcurr
tcurr = time
vcurr = vy (1,ny1,1,e0)
xcurr = xm1(1,ny1,1,e0)
ycurr = ym1(1,ny1,1,e0)
write(6,2) istep,time,vcurr,xcurr,ycurr
2 format(i9,1p4e13.5,' vcurr')
if (vlast.gt.0.and.vcurr.le.0) then ! zero crossing w/ negative slope
t0 = t1
t1 = tlast + (tcurr-tlast)*(vlast-0)/(vlast-vcurr)
per = t1-t0
if (per.gt.0) st = 1./per
endif
endif
st = glmax(st,1)
n = nx1*ny1*nz1*nelv
ux = glamax(vx,n)
uy = glamax(vy,n)
if (nid.eq.0.and.st.gt.0) write(6,1) istep,time,st,ux,uy
1 format(i5,1p4e12.4,' Strouhal')
return
end
!-----------------------------------------------------------------------
subroutine set_obj ! define objects for surface integrals
include 'SIZE'
include 'TOTAL'
integer e,f,eg
nobj = 1
iobj = 0
do ii=nhis+1,nhis+nobj
iobj = iobj+1
hcode(10,ii) = 'I'
hcode( 1,ii) = 'F'
hcode( 2,ii) = 'F'
hcode( 3,ii) = 'F'
lochis(1,ii) = iobj
enddo
nhis = nhis + nobj
if (maxobj.lt.nobj) call exitti('increase maxobj in SIZE$',nobj)
nxyz = nx1*ny1*nz1
nface = 2*ndim
do e=1,nelv
do f=1,nface
if (cbc(f,e,1).eq.'W ') then
iobj = 1
if (iobj.gt.0) then
nmember(iobj) = nmember(iobj) + 1
mem = nmember(iobj)
eg = lglel(e)
object(iobj,mem,1) = eg
object(iobj,mem,2) = f
! write(6,1) iobj,mem,f,eg,e,nid,' OBJ'
! 1 format(6i9,a4)
endif
endif
enddo
enddo
! write(6,*) 'number',(nmember(k),k=1,4)
return
end
!======================================================================
!> @brief Register user specified modules
subroutine frame_usr_register
implicit none
include 'SIZE'
include 'FRAMELP'
!-----------------------------------------------------------------------
! register modules
call io_register
call chkpt_register
call spng_register
call nseb_register
return
end subroutine
!======================================================================
!> @brief Initialise user specified modules
subroutine frame_usr_init
implicit none
include 'SIZE'
include 'FRAMELP'
include 'SOLN'
!-----------------------------------------------------------------------
! initialise modules
call chkpt_init
call spng_init(vx,vy,vz)
call nseb_init
return
end subroutine
!======================================================================
!> @brief Finalise user specified modules
subroutine frame_usr_end
implicit none
include 'SIZE'
include 'FRAMELP'
!-----------------------------------------------------------------------
return
end subroutine
!======================================================================
Thank you!