Skip to content

Commit

Permalink
*Rearranged the calculation of part_sz(0) in SIS2.
Browse files Browse the repository at this point in the history
  Rearranged the final calculation of the ice-free fractional area coverage,
part_sz(:,:,0), in SIS2 to be less sensitive to roundoff errors when there are
thickness categories with very small fractional thicknesses, as can often arise
due to advection.  Although the algorithms are mathematically identical, there
are small bitwise changes in all SIS2 solutions, and new reference solutions
have been checked in.
  • Loading branch information
Hallberg-NOAA committed Sep 15, 2014
1 parent 627ade0 commit e506e91
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions ice_transport.F90
Original file line number Diff line number Diff line change
Expand Up @@ -370,13 +370,14 @@ subroutine ice_transport(part_sz, mH_ice, mH_snow, uc, vc, TrReg, &
call pass_var(mH_snow, G%Domain, complete=.false.)
call pass_var(mH_ice, G%Domain, complete=.true.)

! Recalculate part_sz(:,:,0) to ensure that the sum of part_sz adds up to 1.
part_sz(:,:,0) = 1.0
do k=1,G%CatIce ; part_sz(:,:,0) = part_sz(:,:,0) - part_sz(:,:,k) ; enddo
!### This would handle roundoff in a slightly better way.
! ice_cover(:,:) = 0.0
! do k=1,G%CatIce ; ice_cover(:,:) = ice_cover(:,:) + part_sz(:,:,k) ; enddo
! part_sz(:,:,0) = max(1.0 - ice_cover(:,:), 0.0)
! Recalculate part_sz(:,:,0) to ensure that the sum of part_sz adds up to 1.
! Compress_ice should already have taken care of this within the computational
! domain, but with a slightly different order of arithmetic. The max is here
! to avoid tiny negative values of order -1e-16 from round-off in the
! difference between ice_cover and 1.
ice_cover(:,:) = 0.0
do k=1,G%CatIce ; ice_cover(:,:) = ice_cover(:,:) + part_sz(:,:,k) ; enddo
part_sz(:,:,0) = max(1.0 - ice_cover(:,:), 0.0)

if (CS%check_conservation) then
do k=1,G%CatIce ; do j=jsc,jec ; do i=isc,iec
Expand Down

0 comments on commit e506e91

Please sign in to comment.