Could someone remind me how the sediment-bed-age is supposed to work? Is it supposed to be the date when the deposition BEGAN in the layer? or the date when deposition ENDED in the layer?
I want my sediment layers to be <~ NEWLAYER_THICK; and needed to change the age dating during depositional cycles in order for this to happen.
Not sure if I fixed a bug, or just modified the code to suit my own needs:
Without the changes shown in pink (just moving the age dating from one spot to the other); I did not create a new sediment bed layer in my simple test case that goes through a deposition / erosion / deposition cycle; and my surface layer got thicker than I want it to be.IF ((ero_flux(i,j,ised)-settling_flux(i,j,ised)).lt. &
& 0.0_r8) THEN
!
! If first time step of deposit, then store deposit material in
! temporary array, dep_mass.
!
IF ((time(ng).gt.(bed(i,j,1,iaged)+1.1_r8*dt(ng))).and. &
& (bed(i,j,1,ithck).gt.newlayer_thick(ng))) THEN
dep_mass(i,ised)=settling_flux(i,j,ised)- &
& ero_flux(i,j,ised)
bed(i,j,1,iaged)=time(ng)
END IF
! CKH: Jun 2009: think bed age should be set above, not here
! bed(i,j,1,iaged)=time(ng)
END IF
!
I have put those changes on one of my CSTMS SVN branch, but am continuing to fiddle around with the sediment bed layering; using some of JPaul Rinehimer's stuff as well as my own changes. The change described above is the only place that I thought I may have found a bug.
My goal is to not have any layers that are too thin, or too thick (except maybe the bottom-most layer).