From 70cdcda91fc7fe11a45aacc4273fb46f08125e77 Mon Sep 17 00:00:00 2001 From: David A Minton Date: Mon, 9 Jan 2023 15:38:11 -0500 Subject: [PATCH] Moved subpixel stuff to the subpixel step where it belongs --- src/crater/crater_populate.f90 | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/crater/crater_populate.f90 b/src/crater/crater_populate.f90 index 9be766c4..5e230b9c 100644 --- a/src/crater/crater_populate.f90 +++ b/src/crater/crater_populate.f90 @@ -314,15 +314,7 @@ subroutine crater_populate(user,surf,crater,domain,prod,production_list,vdist,nt end if end if - ! 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 @@ -333,6 +325,16 @@ 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) + + ! Do superdomain ray deposits + ! Do sub-pixel craters vertical mixing + 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