Skip to content
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

Modification of edge mask computation when l_fixed_area=T in horizontal remapping #833

Merged
merged 9 commits into from
Jul 25, 2023
29 changes: 8 additions & 21 deletions cicecore/cicedyn/dynamics/ice_transport_remap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1838,7 +1838,7 @@ subroutine locate_triangles (nx_block, ny_block, &
! BL | BC | BR (bottom left, center, right)
! | |
!
! and the transport is across the edge between cells TC and TB.
! and the transport is across the edge between cells TC and BC.
!
! Departure points are scaled to a local coordinate system
! whose origin is at the midpoint of the edge.
Expand Down Expand Up @@ -1951,21 +1951,9 @@ subroutine locate_triangles (nx_block, ny_block, &
! Compute mask for edges with nonzero departure areas
!-------------------------------------------------------------------

if (l_fixed_area) then
icellsd = 0
icellsd = 0
if (trim(edge) == 'north') then
do j = jb, je
do i = ib, ie
if (edgearea(i,j) /= c0) then
icellsd = icellsd + 1
indxid(icellsd) = i
indxjd(icellsd) = j
endif
enddo
enddo
else
icellsd = 0
if (trim(edge) == 'north') then
do j = jb, je
do i = ib, ie
if (dpx(i-1,j)/=c0 .or. dpy(i-1,j)/=c0 &
.or. &
Expand All @@ -1975,9 +1963,9 @@ subroutine locate_triangles (nx_block, ny_block, &
indxjd(icellsd) = j
endif
enddo
enddo
else ! east edge
do j = jb, je
enddo
else ! east edge
do j = jb, je
do i = ib, ie
if (dpx(i,j-1)/=c0 .or. dpy(i,j-1)/=c0 &
.or. &
Expand All @@ -1987,9 +1975,8 @@ subroutine locate_triangles (nx_block, ny_block, &
indxjd(icellsd) = j
endif
enddo
enddo
endif ! edge = north/east
endif ! l_fixed_area
enddo
endif ! edge = north/east

!-------------------------------------------------------------------
! Scale the departure points
Expand Down