Skip to content

Commit

Permalink
Moved subpixel mixing stuff into the subpixel step and fixed the issu…
Browse files Browse the repository at this point in the history
…e where the mixing depth was not correctly computed.
  • Loading branch information
daminton committed Jan 9, 2023
1 parent 59cd270 commit 2d3699f
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 34 deletions.
20 changes: 10 additions & 10 deletions examples/global-lunar-bombardment/ctem.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
testflag F ! Set to T to create a single crater with user-defined impactor properties
testimp 15000.0 ! Diameter of test impactor (m)
testvel 18.3e3 ! Velocity of test crater (m/s)
testang 45.0 ! Impact angle of test crater (deg) - Default 90.0
testang 90.0 ! Impact angle of test crater (deg) - Default 90.0
testxoffset 0.0 ! x-axis offset of crater center from grid center (m) - Default 0.0
testyoffset 0.0 ! y-axis offset of crater center from grid center (m) - Default 0.0
tallyonly F ! Tally the craters without generating any craters
testtally F
quasimc T ! MC run constrained by non-MC 'real' craters given in a list
realcraterlist qmctest.in ! list of 'real' craters for Quasi-MC runs
realcraterlist craterlist.in ! list of 'real' craters for Quasi-MC runs



! IDL driver in uts
interval 0.1
interval 628
numintervals 1 ! Total number of intervals (total time = interval * numintervals) <--when runtype is 'single'
restart F ! Restart a previous run
impfile NPFextrap.dat ! Impactor SFD rate file (col 1: Dimp (m), col 2: ! impactors > D (m**(-2) y**(-1))
Expand All @@ -33,10 +33,10 @@ runtype single ! Run type: options are normal /
! statistical: surface is reset between intervals

! CTEM required inputs
seed 76535 ! Random number generator seed
gridsize 2000 ! Size of grid in pixels
seed 76539 ! Random number generator seed
gridsize 500 ! Size of grid in pixels
numlayers 10 ! Number of perched layers
pix 3.08e3 ! Pixel size (m)
pix 12.32e3 ! Pixel size (m)
mat rock ! Material (rock or ice)
! Bedrock scaling parameters
mu_b 0.55e0 ! Experimentally derived parameter for bedrock crater scaling law
Expand All @@ -60,16 +60,16 @@ doseismic F ! Perform seismic shaking calcul

! Optional inputF These have internally set default values that work reasonable well. Comment them out with
deplimit 9e99 ! Depth limit for craters (m) - Default is to ignore.
maxcrat 3.15e-2 ! Fraction of gridsize that maximum crater can be - Default 1.0
maxcrat 3.15e-2 ! Fraction of gridsize that maximum crater can be - Default 1.0 <--0.15 for full MC; 3.15e-2 for Quasi-MC
killatmaxcrater F ! Stop the run if a crater larger than the maximum is produced - Default F
basinimp 35.0e3 ! Size of impactor to switch to lunar basin scaling law - Default is to ignore
basinimp 35.0e6 ! Size of impactor to switch to lunar basin scaling law - Default is to ignore
docollapse T ! Do slope collapse - Default T
dosoftening T ! Do ejecta softening - Default T
dosoftening F ! Do ejecta softening - Default T
doangle T ! Vary the impact angle. Set to F to have only vertical impacts - Default T
Kd1 0.0001
psi 2.000
fe 4.00
ejecta_truncation 4.0
ejecta_truncation 30.0
doregotrack T
dorays F
superdomain F
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,41 @@


! Testing input. These are used to perform non-Monte Carlo tests.
testflag T! F ! Set to T to create a single crater with user-defined impactor properties
testimp 10 ! 15000.0 ! Diameter of test impactor (m)
testflag T! F ! Set to T to create a single crater with user-defined impactor properties
testimp 10 ! 15000.0 ! Diameter of test impactor (m)
testvel 18.3e3 ! Velocity of test crater (m/s)
testang 45.0 ! Impact angle of test crater (deg) - Default 90.0
testxoffset 0.0 ! x-axis offset of crater center from grid center (m) - Default 0.0
testyoffset 0.0 ! y-axis offset of crater center from grid center (m) - Default 0.0
tallyonly F ! Tally the craters without generating any craters
testtally F
quasimc F! T ! MC run constrained by non-MC 'real' craters given in a list
realcraterlist qmctest.in ! list of 'real' craters for Quasi-MC runs
quasimc F! T ! MC run constrained by non-MC 'real' craters given in a list
realcraterlist craterlist.in ! list of 'real' craters for Quasi-MC runs



! IDL driver in uts
interval 1 ! 0.1
numintervals 1 ! 1 ! Total number of interval 1 !s (total time = interval 1 ! * numintervals 1 !) <--when runtype is 'single'
interval 1 ! 6.280
numintervals 1 ! 100 ! Total number of interval 1 ! 1 !s (total time = interval 1 ! 1 ! * numintervals 1 ! 1 !) <--when runtype is 'single'
restart F ! Restart a previous run
impfile NPFextrap.dat ! Impactor SFD rate file (col 1: Dimp (m), col 2: ! impactors > D (m**(-2) y**(-1))
popupconsole F ! Pop up console window every output interval 1 !
popupconsole F ! Pop up console window every output interval 1 ! 1 !
saveshaded F ! Output shaded relief images
saverego T ! Output regolith map images
saverego F ! Output regolith map images
savepres F ! Output simplified console display images (presentation-compatible images)
savetruelist T ! Save the true cumulative crater distribution for each interval 1 ! (large file size)
savetruelist T ! Save the true cumulative crater distribution for each interval 1 ! 1 ! (large file size)
sfdcompare LOLASethCraterCatalogv8gt20-binned.dat ! File name for the SFD comparison file used in the console display
shadedminh -85.0 ! Minimum height for shaded relief map (m) (Default - automatic)
shadedmaxh 85.0 ! Maximum height for shaded relief map (m) (Default - automatic)
runtype single ! Run type: options are normal / statistical
! single: craters accumulate in successive interval 1 !s
! statistical: surface is reset between interval 1 !s
! single: craters accumulate in successive interval 1 ! 1 !s
! statistical: surface is reset between interval 1 ! 1 !s

! CTEM required inputs
seed 76535 ! Random number generator seed
gridsize 2000 ! Size of grid in pixels
gridsize 200 ! Size of grid in pixels
numlayers 10 ! Number of perched layers
pix 3.08e3 ! Pixel size (m)
pix 3.08e4 ! Pixel size (m)
mat rock ! Material (rock or ice)
! Bedrock scaling parameters
mu_b 0.55e0 ! Experimentally derived parameter for bedrock crater scaling law
Expand All @@ -52,7 +52,6 @@ ybar_r 0.00e6 ! Regolith strength (Pa)
gaccel 1.62e0 ! Gravitational acceleration at target (m/s**2)
trad 1737.35e3 ! Target radius (m)
prho 2500.0e0 ! Projectile density (kg/m**3)
sfdfile production.dat ! Impactor SFD file (col 1: Dimp (m), col 2: ! impactors > D
velfile lunar-MBA-impactor-velocities.dat ! Impactor velocity dist file

! Seismic shaking input (required if seismic shaking is set to T, otherwise ignored)
Expand All @@ -70,7 +69,7 @@ Kd1 0.0001
psi 2.000
fe 4.00
ejecta_truncation 4.0
doregotrack T
dorays F
doregotrack F
dorays T
superdomain F
dorealistic F
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ OPTREPORT = -qopt-report=5
IPRODUCTION = -g -traceback -no-wrap-margin -assume byterecl -O3 -qopt-prefetch=0 -sox $(PAR) $(SIMDVEC) $(HEAPARR)
#IDEBUG = -O0 -g -traceback -debug all -nogen-interfaces -assume byterecl -m64 -heap-arrays -FR -no-pie -no-ftz -fpe-all=0 -mp1 -fp-model strict -fpe0 -align all -pad -ip -prec-div -prec-sqrt -assume protect-parens -CB -no-wrap-margin -init=snan,arrays
IDEBUG = -O0 -g -traceback -debug all -nogen-interfaces -assume byterecl -m64 -heap-arrays -FR -no-pie -no-ftz -fpe-all=0 -mp1 -fp-model strict -fpe0 -align all -pad -ip -prec-sqrt -assume protect-parens -CB -no-wrap-margin -init=snan,arrays
AM_FCFLAGS = $(IPRODUCTION)
AM_FCFLAGS = $(IDEBUG)
#ifort debug flags

#gfortran optimized flags
Expand Down
15 changes: 8 additions & 7 deletions src/crater/crater_populate.f90
Original file line number Diff line number Diff line change
Expand Up @@ -316,13 +316,6 @@ subroutine crater_populate(user,surf,crater,domain,prod,production_list,vdist,nt

! Do sub-pixel craters vertical mixing
! Do superdomain ray deposits
finterval = 1.0_DP / real(ntotcrat,kind=DP)
if (user%doregotrack) then
call crater_superdomain(user,surf,age,age_resolution,prod,nflux,domain,finterval)
call regolith_depth_model(user,domain,finterval,nflux,p)
call regolith_subcrater_mix(user,surf,domain,nflux,finterval,p)
age = age - finterval * user%interval
end if

! Do periodic subpixel processes on the whole grid
if (.not.user%testflag) then
Expand All @@ -333,6 +326,14 @@ subroutine crater_populate(user,surf,crater,domain,prod,production_list,vdist,nt
craters_since_subpixel = icrater - icrater_last_subpixel
finterval = craters_since_subpixel / real(ntotcrat,kind=DP)
call crater_subpixel_diffusion(user,surf,nflux,domain,finterval,kdiff)

if (user%doregotrack) then
call crater_superdomain(user,surf,age,age_resolution,prod,nflux,domain,finterval)
call regolith_depth_model(user,domain,finterval,nflux,p)
call regolith_subcrater_mix(user,surf,domain,nflux,finterval,p)
age = age - finterval * user%interval
end if

icrater_last_subpixel = icrater
end if
! Intermediate tally step
Expand Down

0 comments on commit 2d3699f

Please sign in to comment.