From e182483457ced6521416eed7e45d39ad4cfd17a0 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Thu, 21 Nov 2024 00:19:18 -0800 Subject: [PATCH 1/5] Adjust calving scheme to handle narrow fjords MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes two adjustments: 1. When deciding if an edge should experience calving, include neighbors above sea level instead of just open ocean neighbors. This ensures fjord walls don’t “block” the calving expected at a cell based on its calvingVelocity 2. Adjust the scale_edge_length function to zero edges that are oriented in the opposite direction of the velocity. Previously orientation was ignored but this is now necessary to avoid calving at edges that have neighbors above sea level (item 1) facing the opposite direction as the velocity. # Please enter the commit message for your changes. Lines starting --- .../src/mode_forward/mpas_li_calving.F | 57 +++++++++++-------- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/components/mpas-albany-landice/src/mode_forward/mpas_li_calving.F b/components/mpas-albany-landice/src/mode_forward/mpas_li_calving.F index 1637c7d697df..61b7a57c9b1c 100644 --- a/components/mpas-albany-landice/src/mode_forward/mpas_li_calving.F +++ b/components/mpas-albany-landice/src/mode_forward/mpas_li_calving.F @@ -1378,7 +1378,6 @@ subroutine eigencalving(domain, err) real (kind=RKIND), dimension(:), pointer :: eigencalvingParameter real (kind=RKIND), dimension(:), pointer :: calvingVelocity real (kind=RKIND), dimension(:), pointer :: eMax, eMin - real (kind=RKIND), dimension(:), pointer :: angleEdge real (kind=RKIND), dimension(:), pointer :: thickness real (kind=RKIND), dimension(:), pointer :: calvingThickness real (kind=RKIND), pointer :: calvingCFLdt @@ -1429,7 +1428,6 @@ subroutine eigencalving(domain, err) ! get fields call mpas_pool_get_array(meshPool, 'deltat', deltat) - call mpas_pool_get_array(meshPool, 'angleEdge', angleEdge) call mpas_pool_get_array(geometryPool, 'cellMask', cellMask) call mpas_pool_get_array(geometryPool, 'calvingFrontMask', calvingFrontMask) call mpas_pool_get_array(geometryPool, 'eigencalvingParameter', eigencalvingParameter) @@ -1602,7 +1600,6 @@ subroutine specified_calving_velocity(domain, err) character (len=StrKIND), pointer :: config_calving_specified_source real (kind=RKIND), dimension(:), pointer :: calvingVelocity real (kind=RKIND), dimension(:), pointer :: calvingVelocityData - real (kind=RKIND), dimension(:), pointer :: angleEdge real (kind=RKIND), dimension(:), pointer :: thickness real (kind=RKIND), dimension(:), pointer :: calvingThickness real (kind=RKIND), pointer :: calvingCFLdt @@ -1643,7 +1640,6 @@ subroutine specified_calving_velocity(domain, err) ! get fields call mpas_pool_get_array(meshPool, 'deltat', deltat) - call mpas_pool_get_array(meshPool, 'angleEdge', angleEdge) call mpas_pool_get_array(geometryPool, 'cellMask', cellMask) call mpas_pool_get_array(geometryPool, 'calvingFrontMask', calvingFrontMask) call mpas_pool_get_array(geometryPool, 'calvingVelocity', calvingVelocity) @@ -2495,7 +2491,7 @@ subroutine li_apply_front_ablation_velocity(meshPool, geometryPool, velocityPool real (kind=RKIND), pointer :: config_calving_error_threshold logical, pointer :: config_distribute_unablatedVolumeDynCell real (kind=RKIND), dimension(:), pointer :: dvEdge, dcEdge - real (kind=RKIND), dimension(:), pointer :: angleEdge + real (kind=RKIND), dimension(:), pointer :: xCell, yCell, xEdge, yEdge real (kind=RKIND), dimension(:), pointer :: calvingVelocity, faceMeltSpeed real (kind=RKIND), dimension(:), pointer :: areaCell real (kind=RKIND), dimension(:,:), pointer :: uReconstructX @@ -2536,7 +2532,10 @@ subroutine li_apply_front_ablation_velocity(meshPool, geometryPool, velocityPool call mpas_pool_get_array(meshPool, 'cellsOnEdge', cellsOnEdge) call mpas_pool_get_array(meshPool, 'dvEdge', dvEdge) call mpas_pool_get_array(meshPool, 'dcEdge', dcEdge) - call mpas_pool_get_array(meshPool, 'angleEdge', angleEdge) + call mpas_pool_get_array(meshPool, 'xCell', xCell) + call mpas_pool_get_array(meshPool, 'yCell', yCell) + call mpas_pool_get_array(meshPool, 'xEdge', xEdge) + call mpas_pool_get_array(meshPool, 'yEdge', yEdge) call mpas_pool_get_dimension(meshPool, 'nEdges', nEdges) call mpas_pool_get_dimension(meshPool, 'nEdgesSolve', nEdgesSolve) call mpas_pool_get_dimension(meshPool, 'nCells', nCells) @@ -2850,10 +2849,9 @@ subroutine li_apply_front_ablation_velocity(meshPool, geometryPool, velocityPool do iNeighbor = 1, nEdgesOnCell(iCell) iEdge = edgesOnCell(iNeighbor, iCell) jCell = cellsOnCell(iNeighbor, iCell) - if (li_mask_is_margin(edgeMask(iEdge)) .and. & !< edge is a margin - .not. li_mask_is_ice(cellMask(jCell)) .and. bedTopography(jCell) < config_sea_level & ! ensure margin is w/ocn - ) then - edgeLengthScaling = scale_edge_length(angleEdge(iEdge), uvelForAblation(iCell), vvelForAblation(iCell)) + if (li_mask_is_margin(edgeMask(iEdge)) .or. & + (li_mask_is_ice(cellMask(jCell)) .and. bedTopography(jCell) > config_sea_level)) then + edgeLengthScaling = scale_edge_length(xCell(iCell), yCell(iCell), xEdge(iEdge), yEdge(iEdge), uvelForAblation(iCell), vvelForAblation(iCell)) requiredAblationVolumeNonDynEdge(iEdge) = ablationVelocity(iCell) * & edgeLengthScaling * dvEdge(iEdge) * thicknessForAblation(iCell) * deltat requiredAblationVolumeNonDynCell(iCell) = requiredAblationVolumeNonDynCell(iCell) + & @@ -2913,9 +2911,10 @@ subroutine li_apply_front_ablation_velocity(meshPool, geometryPool, velocityPool .and. li_mask_is_margin(cellMask(iCell)) ) then ! that is at the edge of the ice do iNeighbor = 1, nEdgesOnCell(iCell) jCell = cellsOnCell(iNeighbor, iCell) - if ((.not. li_mask_is_ice(cellMask(jCell))) .and. (bedTopography(jCell) < config_sea_level)) then + if ((.not. li_mask_is_ice(cellMask(jCell))) .and. (bedTopography(jCell) < config_sea_level) .or. & + (bedTopography(jCell) > config_sea_level) ) then iEdge = edgesOnCell(iNeighbor, iCell) - edgeLengthScaling = scale_edge_length(angleEdge(iEdge), uvelForAblation(iCell), vvelForAblation(iCell)) + edgeLengthScaling = scale_edge_length(xCell(iCell), yCell(iCell), xEdge(iEdge), yEdge(iEdge), uvelForAblation(iCell), vvelForAblation(iCell)) requiredAblationVolumeDynEdge(iEdge) = ablationVelocity(iCell) * & edgeLengthScaling * dvEdge(iEdge) * thicknessForAblation(iCell) * deltat endif @@ -2939,7 +2938,7 @@ subroutine li_apply_front_ablation_velocity(meshPool, geometryPool, velocityPool do iNeighbor = 1, nEdgesOnCell(iCell) iEdge = edgesOnCell(iNeighbor, iCell) if (li_mask_is_dynamic_ice(edgeMask(iEdge))) then - edgeLengthScaling = scale_edge_length(angleEdge(iEdge), uvelForAblation(iCell), vvelForAblation(iCell)) + edgeLengthScaling = scale_edge_length(xCell(iCell), yCell(iCell), xEdge(iEdge), yEdge(iEdge), uvelForAblation(iCell), vvelForAblation(iCell)) ablateLengthEdge = edgeLengthScaling * dvEdge(iEdge) ablateLengthCell = ablateLengthCell + ablateLengthEdge endif @@ -2951,7 +2950,7 @@ subroutine li_apply_front_ablation_velocity(meshPool, geometryPool, velocityPool iEdge = edgesOnCell(iNeighbor, iCell) jCell = cellsOnCell(iNeighbor, iCell) if (li_mask_is_dynamic_ice(edgeMask(iEdge))) then - edgeLengthScaling = scale_edge_length(angleEdge(iEdge), uvelForAblation(iCell), vvelForAblation(iCell)) + edgeLengthScaling = scale_edge_length(xCell(iCell), yCell(iCell), xEdge(iEdge), yEdge(iEdge), uvelForAblation(iCell), vvelForAblation(iCell)) ablateLengthEdge = edgeLengthScaling * dvEdge(iEdge) if (requiredAblationVolumeDynEdge(iEdge) > 0.0_RKIND) then call mpas_log_write("Unexpectedly found a dynamic edge that already has calving assigned to it." // & @@ -3178,18 +3177,30 @@ end subroutine li_apply_front_ablation_velocity ! Helper function for subroutine li_apply_front_ablation_velocity ! Calculates the amount to scale an edge length based on the orientation of the edge with the surface velocity - function scale_edge_length(angleEdgeHere, u, v) - real(kind=RKIND), intent(in) :: angleEdgeHere - real(kind=RKIND), intent(in) :: u - real(kind=RKIND), intent(in) :: v + function scale_edge_length(xc, yc, xe, ye, vx, vy) + real(kind=RKIND), intent(in) :: xc, yc ! x,y coords of cell center + real(kind=RKIND), intent(in) :: xe, ye ! x,y coords of edge neighboring cell + real(kind=RKIND), intent(in) :: vx, vy ! x,y components of velocity vector real(kind=RKIND) :: scale_edge_length - real(kind=RKIND) :: mag + real(kind=RKIND) :: ux, uy, umag, vmag + + ! Calculate vector pointing from cell center to edge + ux = xe - xc + uy = ye - yc + umag = sqrt(ux**2 + uy**2) + + ! avoid divide by zero + if (umag == 0.0_RKIND) umag = 1.0_RKIND + vmag = sqrt(vx**2 + vy**2) + if (vmag == 0.0_RKIND) vmag = 1.0_RKIND + + ! dot product of unit vectors + scale_edge_length = (ux / umag) * (vx / vmag) + (uy / umag) * (vy / vmag) + ! set scale to 0 where vectors are not pointing the same way + ! (i.e. where vector to edge points away from flow direction) + scale_edge_length = max(0.0, scale_edge_length) - mag = sqrt(u**2 + v**2) - if (mag == 0.0_RKIND) mag = 1.0_RKIND - scale_edge_length = abs(u/mag * cos(angleEdgeHere) + v/mag * sin(angleEdgeHere)) ! dot product of unit vectors - !scale_edge_length = abs(cos(angleEdgeHere - atan2(v, u))) end function scale_edge_length From 9962299f902713ff7edee637828b8343c42307d6 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Thu, 21 Nov 2024 10:49:58 -0800 Subject: [PATCH 2/5] Add specified_retreat_velocity option It leverages the existing specified_calving_velocity option and simply adds the flow velocity to the desired retreat velocity to obtain the appropriate calvingVelocity. --- .../mpas-albany-landice/src/Registry.xml | 8 ++++---- .../src/mode_forward/mpas_li_calving.F | 18 ++++++++++++++++-- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/components/mpas-albany-landice/src/Registry.xml b/components/mpas-albany-landice/src/Registry.xml index d41539915214..05f666f6c630 100644 --- a/components/mpas-albany-landice/src/Registry.xml +++ b/components/mpas-albany-landice/src/Registry.xml @@ -162,7 +162,7 @@ \brief use a specified calving velocity given by input data +!> \brief use a specified calving or retreat velocity given by input data !> \author Matthew Hoffman !> \date Feb. 2018 !> \details we can specify the calving velocity by i) a constant value !> given by config_calving_velocity_const in namelist and ii) source data !> specified by calvingVelocityData +!> This subroutine handles both the specified_calving_velocity and +!> specified_retreat_velocity options. In the latter case, the flow speed +!> is added to the specified retreat rate to obtain a calving rate that will +!> yield the desired retreat rate. !----------------------------------------------------------------------- subroutine specified_calving_velocity(domain, err) @@ -1595,6 +1600,7 @@ subroutine specified_calving_velocity(domain, err) type (mpas_pool_type), pointer :: velocityPool type (mpas_pool_type), pointer :: scratchPool logical, pointer :: config_print_calving_info + character (len=StrKIND), pointer :: config_calving real(kind=RKIND), pointer :: config_calving_thickness real(kind=RKIND), pointer :: config_calving_velocity_const character (len=StrKIND), pointer :: config_calving_specified_source @@ -1602,6 +1608,7 @@ subroutine specified_calving_velocity(domain, err) real (kind=RKIND), dimension(:), pointer :: calvingVelocityData real (kind=RKIND), dimension(:), pointer :: thickness real (kind=RKIND), dimension(:), pointer :: calvingThickness + real (kind=RKIND), dimension(:), pointer :: xvelmean, yvelmean real (kind=RKIND), pointer :: calvingCFLdt real (kind=RKIND), pointer :: dtCalvingCFLratio integer, dimension(:,:), pointer :: cellsOnCell ! list of cells that neighbor each cell @@ -1620,6 +1627,7 @@ subroutine specified_calving_velocity(domain, err) err = 0 + call mpas_pool_get_config(liConfigs, 'config_calving', config_calving) call mpas_pool_get_config(liConfigs, 'config_print_calving_info', config_print_calving_info) call mpas_pool_get_config(liConfigs, 'config_calving_thickness', config_calving_thickness) call mpas_pool_get_config(liConfigs, 'config_calving_velocity_const', config_calving_velocity_const) @@ -1671,6 +1679,12 @@ subroutine specified_calving_velocity(domain, err) realArgs=(/minval(calvingVelocity), maxval(calvingVelocity)/)) endif + if (trim(config_calving) == 'specified_retreat_velocity') then + call mpas_pool_get_array(geometryPool, 'xvelmean', xvelmean) + call mpas_pool_get_array(geometryPool, 'yvelmean', yvelmean) + calvingVelocity = calvingVelocity + sqrt(xvelmean**2.0_RKIND + yvelmean**2.0_RKIND) + endif + ! Convert calvingVelocity to calvingThickness call li_apply_front_ablation_velocity(meshPool, geometryPool, velocityPool, calvingThickness, calvingVelocity, & applyToGrounded=.true., applyToFloating=.true., applyToGroundingLine=.false., & From 81d8d56288fc9c1e3b3cf0a7c892c6b1a93ac497 Mon Sep 17 00:00:00 2001 From: Andrew Nolan Date: Fri, 22 Nov 2024 13:49:35 -0800 Subject: [PATCH 3/5] Get velocities from velocityPool not geometryPool --- .../mpas-albany-landice/src/mode_forward/mpas_li_calving.F | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/mpas-albany-landice/src/mode_forward/mpas_li_calving.F b/components/mpas-albany-landice/src/mode_forward/mpas_li_calving.F index a248bde9d475..ad68ee2301b7 100644 --- a/components/mpas-albany-landice/src/mode_forward/mpas_li_calving.F +++ b/components/mpas-albany-landice/src/mode_forward/mpas_li_calving.F @@ -1680,8 +1680,8 @@ subroutine specified_calving_velocity(domain, err) endif if (trim(config_calving) == 'specified_retreat_velocity') then - call mpas_pool_get_array(geometryPool, 'xvelmean', xvelmean) - call mpas_pool_get_array(geometryPool, 'yvelmean', yvelmean) + call mpas_pool_get_array(velocityPool, 'xvelmean', xvelmean) + call mpas_pool_get_array(velocityPool, 'yvelmean', yvelmean) calvingVelocity = calvingVelocity + sqrt(xvelmean**2.0_RKIND + yvelmean**2.0_RKIND) endif From 66e95707af18f54e26a942411546780d1e24587e Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Mon, 25 Nov 2024 13:59:01 -0800 Subject: [PATCH 4/5] Add error check to calving edge length scaling Neither vector should ever have magnitude zero, and if it does, it should be an error. --- .../src/mode_forward/mpas_li_calving.F | 50 ++++++++++++++----- 1 file changed, 38 insertions(+), 12 deletions(-) diff --git a/components/mpas-albany-landice/src/mode_forward/mpas_li_calving.F b/components/mpas-albany-landice/src/mode_forward/mpas_li_calving.F index ad68ee2301b7..05a770d0fc28 100644 --- a/components/mpas-albany-landice/src/mode_forward/mpas_li_calving.F +++ b/components/mpas-albany-landice/src/mode_forward/mpas_li_calving.F @@ -2865,7 +2865,9 @@ subroutine li_apply_front_ablation_velocity(meshPool, geometryPool, velocityPool jCell = cellsOnCell(iNeighbor, iCell) if (li_mask_is_margin(edgeMask(iEdge)) .or. & (li_mask_is_ice(cellMask(jCell)) .and. bedTopography(jCell) > config_sea_level)) then - edgeLengthScaling = scale_edge_length(xCell(iCell), yCell(iCell), xEdge(iEdge), yEdge(iEdge), uvelForAblation(iCell), vvelForAblation(iCell)) + call scale_edge_length(xCell(iCell), yCell(iCell), xEdge(iEdge), yEdge(iEdge), & + uvelForAblation(iCell), vvelForAblation(iCell), edgeLengthScaling, err_tmp) + err = ior(err, err_tmp) requiredAblationVolumeNonDynEdge(iEdge) = ablationVelocity(iCell) * & edgeLengthScaling * dvEdge(iEdge) * thicknessForAblation(iCell) * deltat requiredAblationVolumeNonDynCell(iCell) = requiredAblationVolumeNonDynCell(iCell) + & @@ -2928,7 +2930,9 @@ subroutine li_apply_front_ablation_velocity(meshPool, geometryPool, velocityPool if ((.not. li_mask_is_ice(cellMask(jCell))) .and. (bedTopography(jCell) < config_sea_level) .or. & (bedTopography(jCell) > config_sea_level) ) then iEdge = edgesOnCell(iNeighbor, iCell) - edgeLengthScaling = scale_edge_length(xCell(iCell), yCell(iCell), xEdge(iEdge), yEdge(iEdge), uvelForAblation(iCell), vvelForAblation(iCell)) + call scale_edge_length(xCell(iCell), yCell(iCell), xEdge(iEdge), yEdge(iEdge), & + uvelForAblation(iCell), vvelForAblation(iCell), edgeLengthScaling, err_tmp) + err = ior(err, err_tmp) requiredAblationVolumeDynEdge(iEdge) = ablationVelocity(iCell) * & edgeLengthScaling * dvEdge(iEdge) * thicknessForAblation(iCell) * deltat endif @@ -2952,7 +2956,9 @@ subroutine li_apply_front_ablation_velocity(meshPool, geometryPool, velocityPool do iNeighbor = 1, nEdgesOnCell(iCell) iEdge = edgesOnCell(iNeighbor, iCell) if (li_mask_is_dynamic_ice(edgeMask(iEdge))) then - edgeLengthScaling = scale_edge_length(xCell(iCell), yCell(iCell), xEdge(iEdge), yEdge(iEdge), uvelForAblation(iCell), vvelForAblation(iCell)) + call scale_edge_length(xCell(iCell), yCell(iCell), xEdge(iEdge), yEdge(iEdge), & + uvelForAblation(iCell), vvelForAblation(iCell), edgeLengthScaling, err_tmp) + err = ior(err, err_tmp) ablateLengthEdge = edgeLengthScaling * dvEdge(iEdge) ablateLengthCell = ablateLengthCell + ablateLengthEdge endif @@ -2964,7 +2970,9 @@ subroutine li_apply_front_ablation_velocity(meshPool, geometryPool, velocityPool iEdge = edgesOnCell(iNeighbor, iCell) jCell = cellsOnCell(iNeighbor, iCell) if (li_mask_is_dynamic_ice(edgeMask(iEdge))) then - edgeLengthScaling = scale_edge_length(xCell(iCell), yCell(iCell), xEdge(iEdge), yEdge(iEdge), uvelForAblation(iCell), vvelForAblation(iCell)) + call scale_edge_length(xCell(iCell), yCell(iCell), xEdge(iEdge), yEdge(iEdge), & + uvelForAblation(iCell), vvelForAblation(iCell), edgeLengthScaling, err_tmp) + err = ior(err, err_tmp) ablateLengthEdge = edgeLengthScaling * dvEdge(iEdge) if (requiredAblationVolumeDynEdge(iEdge) > 0.0_RKIND) then call mpas_log_write("Unexpectedly found a dynamic edge that already has calving assigned to it." // & @@ -3191,31 +3199,49 @@ end subroutine li_apply_front_ablation_velocity ! Helper function for subroutine li_apply_front_ablation_velocity ! Calculates the amount to scale an edge length based on the orientation of the edge with the surface velocity - function scale_edge_length(xc, yc, xe, ye, vx, vy) + subroutine scale_edge_length(xc, yc, xe, ye, vx, vy, scale_factor, err) real(kind=RKIND), intent(in) :: xc, yc ! x,y coords of cell center real(kind=RKIND), intent(in) :: xe, ye ! x,y coords of edge neighboring cell real(kind=RKIND), intent(in) :: vx, vy ! x,y components of velocity vector - real(kind=RKIND) :: scale_edge_length + real(kind=RKIND), intent(out) :: scale_factor + integer, intent(out) :: err real(kind=RKIND) :: ux, uy, umag, vmag + err = 0 + scale_factor = 0.0_RKIND + ! Calculate vector pointing from cell center to edge ux = xe - xc uy = ye - yc umag = sqrt(ux**2 + uy**2) - ! avoid divide by zero - if (umag == 0.0_RKIND) umag = 1.0_RKIND vmag = sqrt(vx**2 + vy**2) - if (vmag == 0.0_RKIND) vmag = 1.0_RKIND + + ! check for 0-magnitude vectors + if (umag == 0.0_RKIND) then + call mpas_log_write("In scale_edge_length, cell to edge vector has magnitude zero", MPAS_LOG_ERR) + err = 1 + return + endif + if (vmag == 0.0_RKIND) then + call mpas_log_write("In scale_edge_length, velocity vector has magnitude zero", MPAS_LOG_ERR) + err = 1 + return + endif ! dot product of unit vectors - scale_edge_length = (ux / umag) * (vx / vmag) + (uy / umag) * (vy / vmag) + scale_factor = (ux / umag) * (vx / vmag) + (uy / umag) * (vy / vmag) ! set scale to 0 where vectors are not pointing the same way ! (i.e. where vector to edge points away from flow direction) - scale_edge_length = max(0.0, scale_edge_length) + scale_factor = max(0.0, scale_factor) + + if (scale_factor > 1.0_RKIND) then + call mpas_log_write("In scale_edge_length, scale_factor is greater than 1.", MPAS_LOG_ERR) + err = 1 + endif - end function scale_edge_length + end subroutine scale_edge_length !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| From 90d709f9203a999cb4801c2f4f111d50236f4086 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Mon, 25 Nov 2024 13:59:49 -0800 Subject: [PATCH 5/5] Support specified_retreat_velocity in adaptive timestepper --- .../src/mode_forward/mpas_li_time_integration_fe_rk.F | 1 + 1 file changed, 1 insertion(+) diff --git a/components/mpas-albany-landice/src/mode_forward/mpas_li_time_integration_fe_rk.F b/components/mpas-albany-landice/src/mode_forward/mpas_li_time_integration_fe_rk.F index e6051a3ec753..567e834d89a4 100644 --- a/components/mpas-albany-landice/src/mode_forward/mpas_li_time_integration_fe_rk.F +++ b/components/mpas-albany-landice/src/mode_forward/mpas_li_time_integration_fe_rk.F @@ -1354,6 +1354,7 @@ subroutine set_timestep(allowableAdvecDt, allowableDiffDt, calvingCFLdt, faceMel ! Only include calving CFL if requested and we are using a calving option that calculates it if (config_adaptive_timestep_include_calving .and. ( & trim(config_calving) == 'specified_calving_velocity' .or. & + trim(config_calving) == 'specified_retreat_velocity' .or. & trim(config_calving) == 'eigencalving' .or. & trim(config_calving) == 'von_Mises_stress' .or. & trim(config_calving) == 'ismip6_retreat' .or. &