Skip to content

Commit

Permalink
Require unablatedVolumeDynCell(iCell))>0.0_RKIND when applying ablati…
Browse files Browse the repository at this point in the history
…on in step 3

Require unablatedVolumeDynCell(iCell))>0.0_RKIND when applying ablation in step 3
in li_apply_front_ablation_velocity to avoid doing extra calculations where they
do not apply.
  • Loading branch information
trhille committed Apr 18, 2022
1 parent 77ec474 commit a4cfdad
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2107,7 +2107,7 @@ subroutine li_apply_front_ablation_velocity(meshPool, geometryPool, velocityPool
real(kind=RKIND), dimension(6) :: localInfo, globalInfo
real(kind=RKIND) :: edgeLengthScaling
real(kind=RKIND), parameter :: ablationSmallThk = 1.0e-8_RKIND ! in meters, a small thickness threshold
integer :: err_tmp, iter, nDynNeighbors
integer :: err_tmp, nDynNeighbors
err = 0
err_tmp = 0
Expand Down Expand Up @@ -2588,13 +2588,14 @@ subroutine li_apply_front_ablation_velocity(meshPool, geometryPool, velocityPool
! b. Apply ablation
do iCell = 1, nCells
if ((li_mask_is_dynamic_ice(cellMask(iCell))) .and. (bedTopography(iCell) <= config_sea_level) &
.and. (cellVolume(iCell) > 0.0_RKIND) )then
.and. (cellVolume(iCell) > 0.0_RKIND) .and. (unablatedVolumeDynCell(iCell) > 0.0_RKIND) ) then
removeVolumeHere = min(cellVolume(iCell), unablatedVolumeDynCell(iCell)) ! Don't use more than available
ablationThickness(iCell) = ablationThickness(iCell) + removeVolumeHere / areaCell(iCell) ! add to ablationThickness calculated in 2c
ablatedVolumeDynCell(iCell) = ablatedVolumeDynCell(iCell) + removeVolumeHere
unablatedVolumeDynCell(iCell) = unablatedVolumeDynCell(iCell) - removeVolumeHere
cellVolume(iCell) = cellVolume(iCell) - removeVolumeHere

! For debugging it may be helpful to add a separate metric for
! this step.
if (iCell <= nCellsSolve) ablationSubtotal2 = ablationSubtotal2 + removeVolumeHere
endif
enddo
Expand Down

0 comments on commit a4cfdad

Please sign in to comment.