Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ $(info FFTW=$(FFTW))
FILTER := $(if $(FILTER),$(FILTER),0)
$(info FILTER=$(FILTER))

# weighting scheme: number-weighted (0), mass-weighted (1), or volume-weighted (2)
# weighting scheme: number-weighted (0), mass-weighted (1), volume-weighted (2), or emissivity-weighted (3)
WEIGHT := $(if $(WEIGHT),$(WEIGHT),0)
$(info WEIGHT=$(WEIGHT))

# kernel family (0: cubic spline; 1: Wendland C4; 2: Wendland C6)
KERNEL := $(if $(KERNEL),$(KERNEL),0)
$(info KERNEL=$(KERNEL))

# weighting scheme for the multiscale filter (0: volume-weighted; 1: mass-weighted)
# weighting scheme for the multiscale filter (0: volume-weighted; 1: mass-weighted, 2: emissivity-weighted)
WEIGHT_FILTER := $(if $(WEIGHT_FILTER),$(WEIGHT_FILTER),0)
$(info WEIGHT_FILTER=$(WEIGHT_FILTER))

Expand Down
27 changes: 26 additions & 1 deletion src/filter.f
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,10 @@ subroutine multiscale_filter(nx,ny,nz,nl,npatch,pare,
REAL DENSI_IN0(0:nmax+1,0:nmay+1,0:nmaz+1)
REAL DENSI_IN1(NAMRX,NAMRY,NAMRZ,NPALEV)
COMMON /DENSI/ DENSI_IN0,DENSI_IN1
#elif weight_filter == 2
REAL EMISS_IN0(0:nmax+1,0:nmay+1,0:nmaz+1)
REAL EMISS_IN1(NAMRX,NAMRY,NAMRZ,NPALEV)
COMMON /EMISS/ EMISS_IN0,EMISS_IN1
#endif

* Auxiliary variables
Expand Down Expand Up @@ -1045,7 +1049,7 @@ subroutine multiscale_filter(nx,ny,nz,nl,npatch,pare,

lado0 = nx * dx

* DENS0, DENS1 PROPORTIONAL TO CELLS MASSES or VOLUME!!!
* DENS0, DENS1 PROPORTIONAL TO CELLS MASSES, VOLUME, OR EMISSIVITY!!!
dens0 = 1.0
do ir=1,nl
low1=sum(npatch(0:ir-1))+1
Expand Down Expand Up @@ -1078,6 +1082,27 @@ subroutine multiscale_filter(nx,ny,nz,nl,npatch,pare,
dens1(:,:,:,i) = densi_in1(:,:,:,i) * dens1(:,:,:,i)
end do
end do
#elif weight_filter == 2
!$omp parallel do shared(nx,ny,nz,emiss_in0,dens0),
!$omp+ private(i,j,k),
!$omp+ default(none)
do k=1,nz
do j=1,ny
do i=1,nx
dens0(i,j,k) = emiss_in0(i,j,k) * dens0(i,j,k)
end do
end do
end do

do ir=1,nl
low1=sum(npatch(0:ir-1))+1
low2=sum(npatch(0:ir))
!$omp parallel do shared(low1,low2,emiss_in1,dens1,ir),
!$omp+ private(i), default(none)
do i=low1,low2
dens1(:,:,:,i) = emiss_in1(:,:,:,i) * dens1(:,:,:,i)
end do
end do
#endif

write(*,*) 'in filter'
Expand Down
10 changes: 8 additions & 2 deletions src/particle_data.f
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,18 @@ MODULE PARTICLE_DATA
REAL ABVC
#endif

#if weight_scheme == 2
#if weight_scheme == 2 || weight_filter == 2
REAL,ALLOCATABLE::VOL(:)
#else
! Dummy variable
REAL VOL
#endif
#endif

#if weight_scheme == 3 || weight_filter == 2
REAL,ALLOCATABLE::EMISSIVITY(:)
#else
REAL EMISSIVITY
#endif

INTEGER,ALLOCATABLE::LIHAL(:)
INTEGER,ALLOCATABLE::LIHAL_IX(:),LIHAL_JY(:),LIHAL_KZ(:)
Expand Down
Loading