Skip to content

Commit

Permalink
Create hydroTerrestrialMarginMask
Browse files Browse the repository at this point in the history
Creates hydroTerrestrialMarginMask variable, which designates the
terrestrial margins of the active subglacial hydrology model
  • Loading branch information
alexolinhager authored and matthewhoffman committed Feb 12, 2024
1 parent e2ce733 commit e5b7f0c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@
description="mask indicating how to handle fluxes on each edge: 0=calculate based on hydropotential gradient; 1=allow outflow based on hydropotential gradient, but no inflow (NOT YET IMPLEMENTED); 2=zero flux" />
<var name="hydroMarineMarginMask" type="integer" dimensions="nEdges Time" units="none"
description="mask indicating the marine boundary of the active subglacial hydrology domain" />
<var name="waterFluxAdvec" type="real" dimensions="nEdges Time" units="m{^2} s^{-1}"
<var name="hydroTerrestrialMarginMask" type="integer" dimensions="nEdges Time" units="none"
description="mask indicating the terrestrial boundary of the active subglacial hydrology domain" />
<var name="waterFluxAdvec" type="real" dimensions="nEdges Time" units="m{^2} s^{-1}"
description="advective water flux in subglacial hydrology system" />
<var name="waterFluxDiffu" type="real" dimensions="nEdges Time" units="m{^2} s^{-1}"
description="diffusive water flux in subglacial hydrology system" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2183,6 +2183,7 @@ subroutine calc_hydro_mask(domain)
type (mpas_pool_type), pointer :: meshPool
real (kind=RKIND), dimension(:), pointer :: bedTopography
integer, dimension(:), pointer :: hydroMarineMarginMask
integer, dimension(:), pointer :: hydroTerrestrialMarginMask
integer, dimension(:,:), pointer :: cellsOnEdge
integer, dimension(:), pointer :: cellMask
integer, pointer :: nEdgesSolve
Expand All @@ -2199,6 +2200,7 @@ subroutine calc_hydro_mask(domain)
call mpas_pool_get_array(geometryPool, 'bedTopography', bedTopography)
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
call mpas_pool_get_array(hydroPool, 'hydroMarineMarginMask', hydroMarineMarginMask)
call mpas_pool_get_array(hydroPool, 'hydroTerrestrialMarginMask', hydroTerrestrialMarginMask)
call mpas_pool_get_array(meshPool, 'cellsOnEdge', cellsOnEdge)
call mpas_pool_get_dimension(meshPool, 'nEdgesSolve', nEdgesSolve)
Expand All @@ -2218,6 +2220,20 @@ subroutine calc_hydro_mask(domain)
endif
enddo
hydroTerrestrialMarginMask(:) = 0
do iEdge = 1, nEdgesSolve
cell1 = cellsOnEdge(1, iEdge)
cell2 = cellsOnEdge(2, iEdge)
!Look for edges with 1 cell on grounding ice and the other cell on land without ice
if ((li_mask_is_grounded_ice(cellMask(cell1))) .and. ( .not. li_mask_is_ice(cellMask(cell2))) &
.and. (bedTopography(cell2) > config_sea_level)) then
hydroTerrestrialMarginMask(iEdge) = 1
elseif ((li_mask_is_grounded_ice(cellMask(cell2))) .and. ( .not. li_mask_is_ice(cellMask(cell1))) &
.and. (bedTopography(cell1) > config_sea_level)) then
hydroTerrestrialMarginMask(iEdge) = 1
endif
enddo
block => block % next
end do
Expand Down

0 comments on commit e5b7f0c

Please sign in to comment.