subroutine metrics_fold_north_faces(this, grid)
!! North fold of the face and corner metric arrays (the Cu / Cv / Bu
!! part of `metrics_fold_periodic_ghosts`; the T arrays are folded
!! there).
type(ocean_metrics_t), intent(inout) :: this
type(hgrid_t), intent(in) :: grid
integer :: ng, ni, nj
ng = grid%nghost
ni = grid%nx_phys
nj = grid%ny_phys
! u-stagger (Cu) — scalar copy. fold_north_u_face NEGATES (it is
! built for the vector u-component), so metrics use a local scalar-copy
! variant with the same (nx+1,ny) index map.
call metrics_fold_north_cu_scalar(this%dxCu, grid)
call metrics_fold_north_cu_scalar(this%dyCu, grid)
call metrics_fold_north_cu_scalar(this%areaCu, grid)
call metrics_fold_north_cu_scalar(this%dy_cu, grid)
! v-stagger (Cv) — scalar copy on the (nx,ny+1) extent.
call metrics_fold_north_cv_scalar(this%dxCv, grid)
call metrics_fold_north_cv_scalar(this%dyCv, grid)
call metrics_fold_north_cv_scalar(this%areaCv, grid)
call metrics_fold_north_cv_scalar(this%dx_cv, grid)
! corner-stagger (Bu) — scalar copy via the corner op with negate=.false.
call fold_north_corner(this%dxBu, grid%nx_total + 1, grid%ny_total + 1, &
ni, nj, ng, negate=.false.)
call fold_north_corner(this%dyBu, grid%nx_total + 1, grid%ny_total + 1, &
ni, nj, ng, negate=.false.)
call fold_north_corner(this%areaBu, grid%nx_total + 1, grid%ny_total + 1, &
ni, nj, ng, negate=.false.)
call fold_north_corner(this%geolatBu, grid%nx_total + 1, grid%ny_total + 1, &
ni, nj, ng, negate=.false.)
call fold_north_corner(this%geolonBu, grid%nx_total + 1, grid%ny_total + 1, &
ni, nj, ng, negate=.false.)
end subroutine metrics_fold_north_faces