Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: 827c4eaf8a
Fetching contributors…

Cannot retrieve contributors at this time

117 lines (100 sloc) 4.25 kB
!This is a program that will find clusters in a data set that is loaded into the
!file totalsucc.bin. The clusters will be referenced against how closely they
!cluster and how close they are to elements of the fail set contained in
!1. If we want to print to stdout specify printing=.true.
!3. If we want to shuffle the success and fail sets and do a run, then
!4. If we want to find clusters based off of eps~H, ie the approximate size of
!a quantum fluctuation only, then find_min=.true.
!5. If we want to go from a large eps to a smaller eps, at each stage removing
!the previously found elements from the set, then reduce=.true.
program findclusters
use fcluster
use sorters, only : heapsort
use rng, only : shuffle_cut
use types, only : dp
use features, only : newunit
implicit none
real(dp), dimension(:,:), allocatable :: success, fail
integer :: i,j, check, kend
integer :: length_s, length_f, width_s, width_f
real(dp), dimension(:,:), allocatable :: insulatedpts
real(dp), dimension(:), allocatable :: eps, scaling
integer :: dencrit, u
logical :: printing, shuffling, find_min, find_all, reduce
real :: ratio
real(dp) :: energy_scale, mplanck
namelist /tablel/ length_s, length_f, width_s, width_f, printing, &
&shuffling, find_min, find_all, reduce
namelist /phy_param/ energy_scale, mplanck
!Reads file sizes from input file "setsizes.txt".
open(unit=newunit(u), file="setsizes.txt", status="old", delim="apostrophe")
read(unit=u, nml=tablel)
read(unit=u, nml=phy_param)
!Read succ and fail sets from file.
if (printing) print*, "Reading files."
call read_succ(success, "totalsucc.bin","unformatted")
call read_fail(fail, "totalfail.bin","unformatted")
!If comparing vs a shuffled set, then shuffle.
if (shuffling) then
if (printing) print*,"Shuffling the data set."
call shuffle_cut(success,fail)
end if
!Sort the success and fail sets by value in first column.
if (printing) print*, "Sorting files."
call heapsort(success)
call heapsort(fail)
!Get the core points.
if (printing) print*,"*********************************"
if (printing) print*," Getting core points."
if (printing) print*,"*********************************"
!Set eps in each dimn.
!Find clusters where eps is set to the minimum size ~ on order of quant fluct.
if (find_min) then
!Set eps to order of Hubble parameter, i.e. the size of quantum fluctuations
!in the fields.
dencrit=1 !No other nearby points necessary.
!Get the corepoints at the minimum value for epsilon.
call get_insulatedcorepts(insulatedpts,success,fail,&
call print_corepoints(success, insulatedpts, printing,eps)
else if (find_all) then
!Find clusters in a top-down approach: start with very large clusters, then
!remove these progressively from the data set until we reach the smallest
!possible eps~H.
!Set loop end st numb pts in box ~ size(success,1)/20
!Fixes problem with naming format for cluster file.
if (kend>9999) kend=9998
!Auto set eps to n times avg spatial distance.
call set_eps(success,eps,(100*kend+1))
!How much to scale every step by
!Loop from largest to smallest ball, removing the chosen points at each
call cluster_reduce(success, fail, eps, printing, scaling, kend)
!Find large clusters, which should find only those in the inflationary
!valley. Then look for those at the minimum level that aren't in the large
!cluster set.
!Max size
call set_eps(success,eps,(100*kend+1))
call large_small_reduce(success, fail, eps, printing, kend, energy_scale,&
& mplanck)
end if
if(allocated(eps)) deallocate(eps)
if(allocated(success)) deallocate(success)
if(allocated(fail)) deallocate(fail)
end program findclusters
Jump to Line
Something went wrong with that request. Please try again.