Skip to content

Commit

Permalink
(#435; #55) use lower resolution in dust growth tests; remove ifdefs
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljprice committed Jun 14, 2023
1 parent 008e3e8 commit 4693d80
Showing 1 changed file with 20 additions and 34 deletions.
54 changes: 20 additions & 34 deletions src/tests/test_growth.F90
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ module testgrowth
!
use testutils, only:checkval,update_test_scores
use io, only:id,master
#ifdef DUST
#ifdef DUSTGROWTH
use testdust, only:test_dustybox
#endif
#endif
implicit none
public :: test_growth

Expand All @@ -38,23 +34,22 @@ module testgrowth
!+
!-----------------------------------------------------------------------
subroutine test_growth(ntests,npass)
#ifdef DUST
#ifdef DUSTGROWTH
use growth, only:init_growth,get_growth_rate,ifrag,isnow
use physcon, only:solarm,au
use units, only:set_units
use mpiutils, only:barrier_mpi
#endif
#endif
use dim, only:use_dust,use_dustgrowth
use growth, only:init_growth,get_growth_rate,ifrag,isnow
use physcon, only:solarm,au
use units, only:set_units
use mpiutils, only:barrier_mpi
integer, intent(inout) :: ntests,npass

#ifdef DUST
#ifdef DUSTGROWTH
integer :: nfailed(5),ierr !don't forget the dimension of nfailed
logical, dimension(2) :: logic = (/.false., .true./)
integer :: i,j

if (id==master) write(*,"(/,a)") '--> TESTING DUSTGROWTH MODULE'
if (use_dust .and. use_dustgrowth) then
if (id==master) write(*,"(/,a)") '--> TESTING DUSTGROWTH MODULE'
else
if (id==master) write(*,"(/,a)") '--> SKIPPING DUSTGROWTH TEST (REQUIRES -DDUST -DDUSTGROWTH)'
return
endif

call set_units(mass=solarm,dist=au,G=1.d0)

Expand Down Expand Up @@ -86,24 +81,18 @@ subroutine test_growth(ntests,npass)
enddo

if (id==master) write(*,"(/,a)") '<-- DUSTGROWTH TEST COMPLETE'
#else
if (id==master) write(*,"(/,a)") '--> SKIPPING DUSTGROWTH TEST (REQUIRES -DDUST -DDUSTGROWTH)'
#endif
#endif

end subroutine test_growth

#ifdef DUST
#ifdef DUSTGROWTH

!-------------------
!-------------------
!-------------------

subroutine test_farmingbox(ntests,npass,frag,onefluid)
use boundary, only:set_boundary,xmin,xmax,ymin,ymax,zmin,zmax,dxbound,dybound,dzbound
use kernel, only:hfact_default
use part, only:init_part,igas,idust,npart,xyzh,vxyzu,npartoftype,massoftype,set_particle_type,&
use part, only:init_part,igas,idust,npart,xyzh,vxyzu,npartoftype,&
massoftype,set_particle_type,&
fxyzu,fext,Bevol,dBevol,dustprop,ddustprop,&
dustfrac,dustevol,ddustevol,iphase,maxtypes,&
VrelVf,dustgasprop,Omega_k,alphaind,iamtype,&
Expand Down Expand Up @@ -136,12 +125,13 @@ subroutine test_farmingbox(ntests,npass,frag,onefluid)
integer :: ncheck(4),nerr(4)
real :: errmax(4)
integer :: ierr,iam
integer, parameter :: ngrid = 20000

logical :: do_output = .false.
real :: deltax,dz,hfact,totmass,rhozero
real :: Stcomp(20000),Stini(20000)
real :: cscomp(20000),tau(20000)
real :: s(20000),time,timelim(20000)
real :: Stcomp(ngrid),Stini(ngrid)
real :: cscomp(ngrid),tau(ngrid)
real :: s(ngrid),time,timelim(ngrid)
real :: sinit,dens,t,tmax,dt,dtext,dtnew,guillaume,dtgratio,rhog,rhod

real, parameter :: tolst = 5.e-4
Expand Down Expand Up @@ -180,9 +170,8 @@ subroutine test_farmingbox(ntests,npass,frag,onefluid)
endif
dens = 1./unit_density

write(*,*)'--> testing FARMINGBOX using: ',trim(stringfrag),' and ',trim(stringmethod), ' dust method'
write(*,*)'------------------------------------------------------------------------'

write(*,"(/,a)") '--> testing FARMINGBOX using: '//trim(stringfrag)//&
' and '//trim(stringmethod)//' dust method'
!
! initialise
!
Expand All @@ -191,7 +180,7 @@ subroutine test_farmingbox(ntests,npass,frag,onefluid)
!
! setup for dustybox problem
!
nx = 32
nx = 16
deltax = 1./nx
dz = 2.*sqrt(6.)/nx
call set_boundary(-0.5,0.5,-0.25,0.25,-dz,dz)
Expand Down Expand Up @@ -400,7 +389,4 @@ subroutine write_file_err(step,t,xyzh,size,size_exact,St,St_exact,npart,prefix)

end subroutine write_file_err

#endif
#endif

end module testgrowth

0 comments on commit 4693d80

Please sign in to comment.