Skip to content

Modified logic to determine when FEM needs to be recomputed #453

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: landice/develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/core_landice/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ is the value of that variable from the *previous* time level!
<var name="dynamicThickening" type="real" dimensions="nCells Time" units="m a^{-1}"
description="diagnostic field of dynamic thickening rate (calculated as negative of flux divergence)"
/>
<var name="cellMask" type="integer" dimensions="nCells Time" units="none"
<var name="cellMask" type="integer" dimensions="nCells Time" units="none" time_levs="1"
description="bitmask indicating various properties about the ice sheet on cells. cellMask only needs to be a restart field if config_allow_additional_advance = false (to keep the mask of initial ice extent)"
/>
<var name="edgeMask" type="integer" dimensions="nEdges Time" units="none"
Expand Down Expand Up @@ -1137,6 +1137,10 @@ is the value of that variable from the *previous* time level!
units="none" description="flag needed by external velocity solvers that indicates if the region to solve on the block's domain has changed (treated as a logical)"
packages="higherOrderVelocity"
/>
<var name="cellIceMaskChanged" type="integer" dimensions="Time"
units="none" description="flag needed by external velocity solvers that indicates if the region to solve on the block's domain has changed (treated as a logical)"
packages="higherOrderVelocity"
/>
<var name="dirichletVelocityMask" type="integer" dimensions="nVertInterfaces nCells Time"
units="none" time_levs="2"
description="mask of where Dirichlet boundary conditions should be applied to the velocity solution. 1 means apply a Dirichlet boundary condition, 0 means do not. (higher-order dycores only)"
Expand All @@ -1149,9 +1153,14 @@ is the value of that variable from the *previous* time level!
<var name="floatingEdges"
type="integer" dimensions="nEdges Time"
units="unitless"
time_levs="2"
description="edges which are floating have a value of 1. non floating edges have a value of 0."
packages="higherOrderVelocity"
/>
<var name="floatingEdgesChanged" type="integer" dimensions="Time"
units="none" description="flag needed by external velocity solvers that indicates if the floating edges ids have changed (treated as a logical)"
packages="higherOrderVelocity"
/>
</var_struct>

<!-- ================ -->
Expand Down
2 changes: 1 addition & 1 deletion src/core_landice/analysis_members/mpas_li_global_stats.F
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ subroutine li_compute_global_stats(domain, memberName, timeLevel, err)
call mpas_pool_get_array(meshPool, 'dvEdge', dvEdge)
call mpas_pool_get_array(geometryPool, 'thickness', thickness)
call mpas_pool_get_array(geometryPool, 'bedTopography', bedTopography)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask, timeLevel=1)
call mpas_pool_get_array(geometryPool, 'sfcMassBalApplied', sfcMassBalApplied)
call mpas_pool_get_array(geometryPool, 'groundedSfcMassBalApplied', groundedSfcMassBalApplied)
call mpas_pool_get_array(geometryPool, 'basalMassBal', basalMassBal)
Expand Down
2 changes: 1 addition & 1 deletion src/core_landice/analysis_members/mpas_li_regional_stats.F
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ subroutine li_compute_regional_stats(domain, memberName, timeLevel, err)
call mpas_pool_get_array(meshPool, 'cellsOnEdge', cellsOnEdge)
call mpas_pool_get_array(geometryPool, 'thickness', thickness)
call mpas_pool_get_array(geometryPool, 'bedTopography', bedTopography)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask, timeLevel=1)
call mpas_pool_get_array(geometryPool, 'edgeMask', edgeMask)
call mpas_pool_get_array(geometryPool, 'sfcMassBalApplied', sfcMassBalApplied)
call mpas_pool_get_array(geometryPool, 'groundedSfcMassBalApplied', groundedSfcMassBalApplied)
Expand Down
4 changes: 2 additions & 2 deletions src/core_landice/mode_forward/mpas_li_advection.F
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ subroutine li_advection_thickness_tracers(&
call mpas_pool_get_array(geometryPool, 'floatingBasalMassBal', floatingBasalMassBal)
call mpas_pool_get_array(geometryPool, 'layerThickness', layerThickness)
call mpas_pool_get_array(geometryPool, 'layerThicknessEdge', layerThicknessEdge)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask, timeLevel = 1)
call mpas_pool_get_array(geometryPool, 'edgeMask', edgeMask)
call mpas_pool_get_array(geometryPool, 'dynamicThickening', dynamicThickening)
call mpas_pool_get_array(geometryPool, 'groundedToFloatingThickness', groundedToFloatingThickness)
Expand Down Expand Up @@ -630,7 +630,7 @@ subroutine li_update_geometry(geometryPool)

call mpas_pool_get_dimension(geometryPool, 'nCells', nCells)

call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask, timeLevel = 1)
call mpas_pool_get_array(geometryPool, 'thickness', thickness)
call mpas_pool_get_array(geometryPool, 'upperSurface', upperSurface)
call mpas_pool_get_array(geometryPool, 'lowerSurface', lowerSurface)
Expand Down
20 changes: 10 additions & 10 deletions src/core_landice/mode_forward/mpas_li_calving.F
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ subroutine li_restore_calving_front(domain, err)
call mpas_pool_get_array(geometryPool, 'bedTopography', bedTopography)
call mpas_pool_get_array(geometryPool, 'calvingThickness', calvingThickness)
call mpas_pool_get_array(geometryPool, 'restoreThickness', restoreThickness)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask, timeLevel = 1)

! get required fields from the thermal pool
call mpas_pool_get_array(thermalPool, 'temperature', temperature)
Expand Down Expand Up @@ -870,7 +870,7 @@ subroutine floating_calving(domain, calvingFraction, err)
call mpas_pool_get_subpool(block % structs, 'mesh', meshPool)
call mpas_pool_get_array(geometryPool, 'calvingThickness', calvingThickness)
call mpas_pool_get_array(geometryPool, 'thickness', thickness)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask, timeLevel = 1)

calvingThickness = 0.0_RKIND

Expand Down Expand Up @@ -929,7 +929,7 @@ subroutine remove_small_islands(meshPool, geometryPool)
call mpas_pool_get_array(meshPool, 'nEdgesOnCell', nEdgesOnCell)
call mpas_pool_get_array(geometryPool, 'calvingThickness', calvingThickness)
call mpas_pool_get_array(geometryPool, 'thickness', thickness)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask, timeLevel = 1)
call mpas_pool_get_array(geometryPool, 'bedTopography', bedTopography)

do iCell = 1, nCellsSolve
Expand Down Expand Up @@ -1039,7 +1039,7 @@ subroutine topographic_calving(domain, calvingFraction, err)
call mpas_pool_get_subpool(block % structs, 'mesh', meshPool)
call mpas_pool_get_array(geometryPool, 'calvingThickness', calvingThickness)
call mpas_pool_get_array(geometryPool, 'bedTopography', bedTopography)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask, timeLevel = 1)
call mpas_pool_get_array(geometryPool, 'thickness', thickness)

calvingThickness = 0.0_RKIND
Expand Down Expand Up @@ -1152,7 +1152,7 @@ subroutine eigencalving(domain, err)
call mpas_pool_get_array(meshPool, 'cellsOnCell', cellsOnCell)
call mpas_pool_get_array(meshPool, 'dvEdge', dvEdge)
call mpas_pool_get_array(geometryPool, 'calvingThickness', calvingThickness)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask, timeLevel = 1)
call mpas_pool_get_array(geometryPool, 'thickness', thickness)
call mpas_pool_get_array(geometryPool, 'bedTopography', bedTopography)
call mpas_pool_get_array(geometryPool, 'eigencalvingParameter', eigencalvingParameter)
Expand Down Expand Up @@ -1336,7 +1336,7 @@ subroutine distribute_calving_flux(meshPool, geometryPool, scratchPool, calvingF
! get fields
call mpas_pool_get_dimension(meshPool, 'nCells', nCells)
call mpas_pool_get_array(meshPool, 'deltat', deltat)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask, timeLevel = 1)
call mpas_pool_get_array(geometryPool, 'thickness', thickness)
call mpas_pool_get_array(geometryPool, 'calvingThickness', calvingThickness)
call mpas_pool_get_array(geometryPool, 'requiredCalvingVolumeRate', requiredCalvingVolumeRate)
Expand Down Expand Up @@ -1566,7 +1566,7 @@ subroutine calculate_calving_front_mask(meshPool, geometryPool, calvingFrontMask
call mpas_pool_get_dimension(meshPool, 'nCells', nCells)
call mpas_pool_get_array(meshPool, 'nEdgesOnCell', nEdgesOnCell)
call mpas_pool_get_array(meshPool, 'cellsOnCell', cellsOnCell)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask, timeLevel = 1)
call mpas_pool_get_array(geometryPool, 'bedTopography', bedTopography)

calvingFrontMask = 0 !initialize
Expand Down Expand Up @@ -1656,7 +1656,7 @@ subroutine remove_icebergs(domain)
call mpas_pool_get_subpool(block % structs, 'geometry', geometryPool)
call mpas_pool_get_subpool(block % structs, 'mesh', meshPool)
call mpas_pool_get_subpool(block % structs, 'velocity', velocityPool)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask, timeLevel = 1)
call mpas_pool_get_array(geometryPool, 'contiguousDynamicIce', contiguousDynamicIce)
call mpas_pool_get_dimension(meshPool, 'nCells', nCells)
call mpas_pool_get_dimension(geometryPool, 'nCellsSolve', nCellsSolve)
Expand Down Expand Up @@ -1710,7 +1710,7 @@ subroutine remove_icebergs(domain)
call mpas_pool_get_subpool(block % structs, 'geometry', geometryPool)
call mpas_pool_get_subpool(block % structs, 'mesh', meshPool)
call mpas_pool_get_subpool(block % structs, 'velocity', velocityPool)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask, timeLevel = 1)
call mpas_pool_get_array(geometryPool, 'contiguousDynamicIce', contiguousDynamicIce)
call mpas_pool_get_array(geometryPool, 'contiguousDynamicIceOld', contiguousDynamicIceOld)
call mpas_pool_get_dimension(meshPool, 'nCells', nCells)
Expand Down Expand Up @@ -1765,7 +1765,7 @@ subroutine remove_icebergs(domain)
block => domain % blocklist
do while (associated(block))
call mpas_pool_get_subpool(block % structs, 'geometry', geometryPool)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask, timeLevel = 1)
call mpas_pool_get_array(geometryPool, 'thickness', thickness)
call mpas_pool_get_array(geometryPool, 'calvingThickness', calvingThickness)
call mpas_pool_get_array(geometryPool, 'contiguousDynamicIce', contiguousDynamicIce)
Expand Down
3 changes: 1 addition & 2 deletions src/core_landice/mode_forward/mpas_li_diagnostic_vars.F
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,9 @@ subroutine li_calculate_apparent_diffusivity(meshPool, velocityPool, scratchPool
call mpas_pool_get_array(geometryPool, 'thickness', thickness, timeLevel=1)
call mpas_pool_get_array(geometryPool, 'layerThickness', layerThickness, timeLevel=1)
call mpas_pool_get_array(geometryPool, 'apparentDiffusivity', apparentDiffusivity)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask, timeLevel = 1)
call mpas_pool_get_array(velocityPool, 'uReconstructZonal', uReconstructAxis1)
call mpas_pool_get_array(velocityPool, 'uReconstructMeridional', uReconstructAxis2)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_field(scratchPool, 'workCell', slopeReconstructXField)
call mpas_allocate_scratch_field(slopeReconstructXField, .true.)
call mpas_pool_get_field(scratchPool, 'workCell2', slopeReconstructYField)
Expand Down
4 changes: 2 additions & 2 deletions src/core_landice/mode_forward/mpas_li_iceshelf_melt.F
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ subroutine li_basal_melt_floating_ice(domain, err)
call mpas_pool_get_array(geometryPool, 'thickness', thickness)
call mpas_pool_get_array(geometryPool, 'lowerSurface', lowerSurface)
call mpas_pool_get_array(geometryPool, 'bedTopography', bedTopography)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask, timeLevel = 1)
call mpas_pool_get_array(geometryPool, 'floatingBasalMassBal', floatingBasalMassBal)

! get fields from the scratch pool
Expand Down Expand Up @@ -853,7 +853,7 @@ subroutine calc_iceshelf_draft_info(domain, GLdepth, CFdepth, err)
call mpas_pool_get_subpool(block % structs, 'geometry', geometryPool)
call mpas_pool_get_subpool(block % structs, 'mesh', meshPool)
call mpas_pool_get_array(geometryPool, 'lowerSurface', lowerSurface)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask, timeLevel = 1)
call mpas_pool_get_array(meshPool, 'nEdgesOnCell', nEdgesOnCell)
call mpas_pool_get_array(meshPool, 'cellsOnCell', cellsOnCell)
call mpas_pool_get_array(meshPool, 'areaCell', areaCell)
Expand Down
2 changes: 1 addition & 1 deletion src/core_landice/mode_forward/mpas_li_sia.F
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ subroutine li_sia_solve(meshPool, geometryPool, thermalPool, velocityPool, err)
call mpas_pool_get_array(velocityPool, 'flowParamA', flowParamA)
call mpas_pool_get_array(geometryPool, 'thickness', thickness)
call mpas_pool_get_array(geometryPool, 'edgeMask', edgeMask)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask, timeLevel = 1)
call mpas_pool_get_array(geometryPool, 'slopeEdge', slopeEdge)
call mpas_pool_get_array(geometryPool, 'normalSlopeEdge', normalSlopeEdge)
call mpas_pool_get_array(thermalPool, 'temperature', temperature)
Expand Down
2 changes: 1 addition & 1 deletion src/core_landice/mode_forward/mpas_li_statistics.F
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ subroutine li_compute_statistics(domain, itimestep)
! Geometry arrays
call mpas_pool_get_array(geometryPool, 'bedTopography', bedTopography)
call mpas_pool_get_array(geometryPool, 'sfcMassBal', sfcMassBal)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask, timeLevel = 1)
call mpas_pool_get_array(geometryPool, 'edgeMask', edgeMask)
call mpas_pool_get_array(geometryPool, 'thickness', thickness, timeLevel = 1)
call mpas_pool_get_array(geometryPool, 'layerThickness', layerThickness, timeLevel = 1)
Expand Down
16 changes: 8 additions & 8 deletions src/core_landice/mode_forward/mpas_li_subglacial_hydro.F
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ subroutine li_SGH_init(domain, err)
waterPressure = max(0.0_RKIND, waterPressure)
waterPressure = min(waterPressure, rhoi * gravity * thickness)
! set pressure correctly under floating ice and open ocean
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask, timeLevel = 1)
call mpas_pool_get_array(geometryPool, 'bedTopography', bedTopography)
where ( (li_mask_is_floating_ice(cellMask)) .or. &
( (.not. li_mask_is_ice(cellMask)) .and. (bedTopography < config_sea_level) ) )
Expand Down Expand Up @@ -379,7 +379,7 @@ subroutine li_SGH_solve(domain, err)
call mpas_pool_get_array(hydroPool, 'deltatSGH', deltatSGH)
call mpas_pool_get_array(hydroPool, 'basalMeltInput', basalMeltInput)
call mpas_pool_get_array(hydroPool, 'externalWaterInput', externalWaterInput)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask, timeLevel = 1)

WtillOld = Wtill
Wtill = Wtill + deltatSGH * ( (basalMeltInput + externalWaterInput) / rho_water - Cd)
Expand Down Expand Up @@ -420,7 +420,7 @@ subroutine li_SGH_solve(domain, err)
call mpas_pool_get_array(hydroPool, 'waterVelocity', waterVelocity)
call mpas_pool_get_array(hydroPool, 'waterVelocityCellX', waterVelocityCellX)
call mpas_pool_get_array(hydroPool, 'waterVelocityCellY', waterVelocityCellY)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask, timeLevel = 1)
allocate(cellJunk(nCells+1))
call mpas_reconstruct(meshPool, waterVelocity, waterVelocityCellX, waterVelocityCellY, &
cellJunk, cellJunk, cellJunk)
Expand Down Expand Up @@ -476,7 +476,7 @@ subroutine li_SGH_solve(domain, err)
call mpas_pool_get_array(meshPool, 'edgesOnCell', edgesOnCell)
call mpas_pool_get_array(meshPool, 'cellsOnEdge', cellsOnEdge)
call mpas_pool_get_array(meshPool, 'edgeSignOnCell', edgeSignOnCell)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask, timeLevel = 1)

divergence(:) = 0.0_RKIND ! zero div before starting
! loop over locally owned cells
Expand Down Expand Up @@ -551,7 +551,7 @@ subroutine li_SGH_solve(domain, err)
call mpas_pool_get_array(hydroPool, 'divergence', divergence)
call mpas_pool_get_array(hydroPool, 'divergenceChannel', divergenceChannel)
call mpas_pool_get_array(hydroPool, 'channelAreaChangeCell', channelAreaChangeCell)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask, timeLevel = 1)

waterThicknessOld = waterThickness
waterThickness = waterThicknessOld + deltatSGH * ( (basalMeltInput + externalWaterInput) / rho_water - divergence &
Expand Down Expand Up @@ -755,7 +755,7 @@ subroutine calc_edge_quantities(block, err)
call mpas_pool_get_array(hydroPool, 'hydropotentialBaseSlopeNormal', hydropotentialBaseSlopeNormal)
call mpas_pool_get_array(hydroPool, 'waterPressureSlopeNormal', waterPressureSlopeNormal)
call mpas_pool_get_array(meshPool, 'dcEdge', dcEdge)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask, timeLevel = 1)
call mpas_pool_get_array(meshPool, 'cellsOnEdge', cellsOnEdge)
call mpas_pool_get_array(meshPool, 'edgeSignOnCell', edgeSignOnCell)
call mpas_pool_get_array(hydroPool, 'hydropotentialBaseSlopeTangent', hydropotentialBaseSlopeTangent)
Expand Down Expand Up @@ -1217,7 +1217,7 @@ subroutine calc_pressure(block, err)
call mpas_pool_get_array(velocityPool, 'basalSpeed', basalSpeed)
call mpas_pool_get_array(velocityPool, 'flowParamA', flowParamA)
call mpas_pool_get_array(geometryPool, 'thickness', thickness)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask, timeLevel = 1)
call mpas_pool_get_array(geometryPool, 'bedTopography', bedTopography)

openingRate(:) = bedRough * basalSpeed(:) * (bedRoughMax - waterThickness(:))
Expand Down Expand Up @@ -1338,7 +1338,7 @@ subroutine calc_pressure_diag_vars(block, err)
call mpas_pool_get_array(hydroPool, 'hydropotentialBase', hydropotentialBase)
call mpas_pool_get_array(hydroPool, 'waterThickness', waterThickness)
call mpas_pool_get_array(hydroPool, 'hydropotential', hydropotential)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask, timeLevel = 1)

effectivePressure = rhoi * gravity * thickness - waterPressure
! < this should evalute to 0 for floating ice if Pw set correctly there.
Expand Down
Loading